Fuel

Diff
Login

Differences From Artifact [b7d4d636ad]:

To Artifact [b671fe2af7]:


587
588
589
590
591
592
593
594



595
596
597
598
599
600
601

	// Build default versions list
	const QString latest = tr(LATEST_VERSION);

	versionList.clear();
	versionList.append(latest);
	versionList += getWorkspace().getBranches();
	versionList += getWorkspace().getTags();




	setBusy(false);
	setStatus("");
}

//------------------------------------------------------------------------------
static void addPathToTree(QStandardItem &root, const QString &path)







|
>
>
>







587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604

	// Build default versions list
	const QString latest = tr(LATEST_VERSION);

	versionList.clear();
	versionList.append(latest);
	versionList += getWorkspace().getBranches();
	versionList += getWorkspace().getTags().keys();

	selectedTags.clear();
	selectedBranches.clear();

	setBusy(false);
	setStatus("");
}

//------------------------------------------------------------------------------
static void addPathToTree(QStandardItem &root, const QString &path)
673
674
675
676
677
678
679
680
681

682
683
684
685
686
687
688
	}

	// Tags
	QStandardItem *tags = new QStandardItem(QIcon(":icons/icons/Book-01.png"), "Tags");
	tags->setData(TreeViewItem(TreeViewItem::TYPE_TAGS, ""), REPODIRMODEL_ROLE_PATH);
	tags->setEditable(false);
	getWorkspace().getDirModel().appendRow(tags);
	foreach(const QString &tag_name, getWorkspace().getTags())
	{

		QStandardItem *tag = new QStandardItem(QIcon(":icons/icons/Book-01.png"), tag_name);
		tag->setData(TreeViewItem(TreeViewItem::TYPE_TAG, tag_name), REPODIRMODEL_ROLE_PATH);
		tags->appendRow(tag);
	}

	// Stashes
	QStandardItem *stashes = new QStandardItem(QIcon(":icons/icons/My Documents-01.png"), "Stashes");







|

>







676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
	}

	// Tags
	QStandardItem *tags = new QStandardItem(QIcon(":icons/icons/Book-01.png"), "Tags");
	tags->setData(TreeViewItem(TreeViewItem::TYPE_TAGS, ""), REPODIRMODEL_ROLE_PATH);
	tags->setEditable(false);
	getWorkspace().getDirModel().appendRow(tags);
	for(QStringMap::const_iterator it=getWorkspace().getTags().begin(); it!=getWorkspace().getTags().end(); ++it)
	{
		const QString &tag_name = it.key();
		QStandardItem *tag = new QStandardItem(QIcon(":icons/icons/Book-01.png"), tag_name);
		tag->setData(TreeViewItem(TreeViewItem::TYPE_TAG, tag_name), REPODIRMODEL_ROLE_PATH);
		tags->appendRow(tag);
	}

	// Stashes
	QStandardItem *stashes = new QStandardItem(QIcon(":icons/icons/My Documents-01.png"), "Stashes");
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619




1620
1621
1622
1623
1624
1625
1626

	foreach(const QModelIndex &id, indices)
	{
		QVariant data = id.model()->data(id, REPODIRMODEL_ROLE_PATH);
		Q_ASSERT(data.isValid());
		TreeViewItem tv = data.value<TreeViewItem>();

		if(tv.Type != TreeViewItem::TYPE_FOLDER && tv.Type != TreeViewItem::TYPE_WORKSPACE)
			continue;

		new_dirs.insert(tv.Value);




	}

	// Update the selection if we have any new folders
	if(!new_dirs.empty() && viewMode == VIEWMODE_TREE)
	{
		selectedDirs = new_dirs;
		updateFileView();







<
<
|
|
>
>
>
>







1613
1614
1615
1616
1617
1618
1619


1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632

	foreach(const QModelIndex &id, indices)
	{
		QVariant data = id.model()->data(id, REPODIRMODEL_ROLE_PATH);
		Q_ASSERT(data.isValid());
		TreeViewItem tv = data.value<TreeViewItem>();



		if(tv.Type == TreeViewItem::TYPE_FOLDER || tv.Type == TreeViewItem::TYPE_WORKSPACE)
			new_dirs.insert(tv.Value);
		else if(tv.Type == TreeViewItem::TYPE_TAG)
			selectedTags.append(tv.Value);
		else if(tv.Type == TreeViewItem::TYPE_BRANCH)
			selectedBranches.append(tv.Value);
	}

	// Update the selection if we have any new folders
	if(!new_dirs.empty() && viewMode == VIEWMODE_TREE)
	{
		selectedDirs = new_dirs;
		updateFileView();
1865
1866
1867
1868
1869
1870
1871



1872
1873
1874
1875
1876
1877
1878
}

//------------------------------------------------------------------------------
void MainWindow::on_actionApplyStash_triggered()
{
	QStringList stashes;
	getSelectionStashes(stashes);




	bool delete_stashes = false;
	if(!FileActionDialog::run(this, tr("Apply Stash"), tr("The following stashes will be applied.")+"\n"+tr("Are you sure?"), stashes, tr("Delete after applying"), &delete_stashes))
		return;

	// Apply stashes
	for(QStringList::iterator it=stashes.begin(); it!=stashes.end(); ++it)







>
>
>







1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
}

//------------------------------------------------------------------------------
void MainWindow::on_actionApplyStash_triggered()
{
	QStringList stashes;
	getSelectionStashes(stashes);

	if(stashes.empty())
		return;

	bool delete_stashes = false;
	if(!FileActionDialog::run(this, tr("Apply Stash"), tr("The following stashes will be applied.")+"\n"+tr("Are you sure?"), stashes, tr("Delete after applying"), &delete_stashes))
		return;

	// Apply stashes
	for(QStringList::iterator it=stashes.begin(); it!=stashes.end(); ++it)
2221
2222
2223
2224
2225
2226
2227


2228











2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
	fossil().tagNew(name, revision);
	refresh();
}

//------------------------------------------------------------------------------
void MainWindow::on_actionDeleteTag_triggered()
{














}

//------------------------------------------------------------------------------
void MainWindow::on_actionNewBranch_triggered()
{

}

//------------------------------------------------------------------------------
void MainWindow::on_actionMergeBranch_triggered()
{

}







>
>

>
>
>
>
>
>
>
>
>
>
>













2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
	fossil().tagNew(name, revision);
	refresh();
}

//------------------------------------------------------------------------------
void MainWindow::on_actionDeleteTag_triggered()
{
	if(selectedTags.size()!=1)
		return;

	const QString &tagname = selectedTags.first();

	if(QMessageBox::Yes != DialogQuery(this, tr("Delete Tag"), tr("Are you sure want to delete the tag %0 ?").arg(tagname)))
		return;

	Q_ASSERT(getWorkspace().getTags().contains(tagname));

	const QString &revision = getWorkspace().getTags()[tagname];

	fossil().tagDelete(tagname, revision);
	refresh();
}

//------------------------------------------------------------------------------
void MainWindow::on_actionNewBranch_triggered()
{

}

//------------------------------------------------------------------------------
void MainWindow::on_actionMergeBranch_triggered()
{

}