155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
menuStashes->addAction(ui->actionDeleteStash);
// TagsMenu
menuTags = new QMenu(this);
menuTags->addAction(ui->actionNewTag);
menuTags->addAction(separator);
menuTags->addAction(ui->actionDeleteTag);
menuTags->addAction(ui->actionUpdateRevision);
// BranchesMenu
menuBranches = new QMenu(this);
menuBranches->addAction(ui->actionNewBranch);
menuBranches->addAction(separator);
menuBranches->addAction(ui->actionMergeBranch);
menuBranches->addAction(ui->actionUpdateRevision);
// Recent Workspaces
// Locate a sequence of two separator actions in file menu
QList<QAction*> file_actions = ui->menuFile->actions();
QAction *recent_sep=0;
for(int i=0; i<file_actions.size(); ++i)
{
|
|
|
|
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
menuStashes->addAction(ui->actionDeleteStash);
// TagsMenu
menuTags = new QMenu(this);
menuTags->addAction(ui->actionNewTag);
menuTags->addAction(separator);
menuTags->addAction(ui->actionDeleteTag);
menuTags->addAction(ui->actionUpdate);
// BranchesMenu
menuBranches = new QMenu(this);
menuBranches->addAction(ui->actionNewBranch);
menuBranches->addAction(separator);
menuBranches->addAction(ui->actionMergeBranch);
menuBranches->addAction(ui->actionUpdate);
// Recent Workspaces
// Locate a sequence of two separator actions in file menu
QList<QAction*> file_actions = ui->menuFile->actions();
QAction *recent_sep=0;
for(int i=0; i<file_actions.size(); ++i)
{
|
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
|
for(stashmap_t::const_iterator it= getWorkspace().getStashes().begin(); it!=getWorkspace().getStashes().end(); ++it)
{
QStandardItem *stash = new QStandardItem(QIcon(":icons/icons/My Documents-01.png"), it.key());
stash->setData(WorkspaceItem(WorkspaceItem::TYPE_STASH, it.value()), ROLE_WORKSPACE_ITEM);
stashes->appendRow(stash);
}
// Remotes
QStandardItem *remotes = new QStandardItem(QIcon(":icons/icons/Network PC-01.png"), "Remotes");
remotes->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTES, ""), ROLE_WORKSPACE_ITEM);
remotes->setEditable(false);
getWorkspace().getDirModel().appendRow(remotes);
// Settings
QStandardItem *settings = new QStandardItem(QIcon(":icons/icons/Gear-01.png"), "Settings");
settings->setData(WorkspaceItem(WorkspaceItem::TYPE_SETTINGS, ""), ROLE_WORKSPACE_ITEM);
settings->setEditable(false);
getWorkspace().getDirModel().appendRow(settings);
ui->workspaceTreeView->expandToDepth(0);
//ui->workspaceTreeView->sortByColumn(0, Qt::AscendingOrder);
}
//------------------------------------------------------------------------------
void MainWindow::updateFileView()
{
|
>
|
<
|
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
|
for(stashmap_t::const_iterator it= getWorkspace().getStashes().begin(); it!=getWorkspace().getStashes().end(); ++it)
{
QStandardItem *stash = new QStandardItem(QIcon(":icons/icons/My Documents-01.png"), it.key());
stash->setData(WorkspaceItem(WorkspaceItem::TYPE_STASH, it.value()), ROLE_WORKSPACE_ITEM);
stashes->appendRow(stash);
}
#if 0 // Unimplemented for now
// Remotes
QStandardItem *remotes = new QStandardItem(QIcon(":icons/icons/Network PC-01.png"), "Remotes");
remotes->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTES, ""), ROLE_WORKSPACE_ITEM);
remotes->setEditable(false);
getWorkspace().getDirModel().appendRow(remotes);
// Settings
QStandardItem *settings = new QStandardItem(QIcon(":icons/icons/Gear-01.png"), "Settings");
settings->setData(WorkspaceItem(WorkspaceItem::TYPE_SETTINGS, ""), ROLE_WORKSPACE_ITEM);
settings->setEditable(false);
getWorkspace().getDirModel().appendRow(settings);
#endif
ui->workspaceTreeView->expandToDepth(0);
//ui->workspaceTreeView->sortByColumn(0, Qt::AscendingOrder);
}
//------------------------------------------------------------------------------
void MainWindow::updateFileView()
{
|
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
|
"emansije: pt_PT\n"
);
}
//------------------------------------------------------------------------------
void MainWindow::on_actionUpdate_triggered()
{
QStringList res;
// Do test update
if(!fossil().updateRepository(res, "", true))
return;
if(res.length()==0)
return;
QStringMap kv;
ParseProperties(kv, res, ':');
// If no changes exit
if(kv.contains("changes") && kv["changes"].indexOf("None.")!=-1)
return;
if(!FileActionDialog::run(this, tr("Update"), tr("The following files will be updated.")+"\n"+tr("Are you sure?"), res))
return;
// Do update
fossil().updateRepository(res, "", false);
refresh();
}
//------------------------------------------------------------------------------
void MainWindow::on_actionUpdateRevision_triggered()
{
QStringList selected = selectedBranches + selectedTags;
QString revision;
if(!selected.isEmpty())
revision = selected.first();
updateRevision(revision);
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
|
"emansije: pt_PT\n"
);
}
//------------------------------------------------------------------------------
void MainWindow::on_actionUpdate_triggered()
{
QStringList selected = selectedBranches + selectedTags;
QString revision;
if(!selected.isEmpty())
revision = selected.first();
updateRevision(revision);
|