Added Workspace menu
Some action refactoring FossilOrigin-Name: 343b1675fb8eb023a04a1b84131f132d382f01dc
This commit is contained in:
parent
9c63e0e0dc
commit
1e111052c6
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Fixed\smissing\sworkspace\stree\sheader
|
||||
D 2015-05-24T14:47:14.342
|
||||
C Added\sWorkspace\smenu\nSome\saction\srefactoring
|
||||
D 2015-05-24T15:28:43.887
|
||||
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
|
||||
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
|
||||
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
|
||||
@ -200,8 +200,8 @@ F src/Fossil.cpp a0b44c6b77de686e45cb4d84cfbf94865c8b39bf
|
||||
F src/Fossil.h 651d2a1c052abe2804f9eff366bf2561dc54f7eb
|
||||
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
|
||||
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
|
||||
F src/MainWindow.cpp f0803414a83d70d357c1aa4a43ff20397eb9878f
|
||||
F src/MainWindow.h 0a10bf6f5c3ebf2aae1cef9e387289764d47586d
|
||||
F src/MainWindow.cpp 537c458f5b7ad78ee3b9ad2e8479cac2f6dd8ec3
|
||||
F src/MainWindow.h cfc19137172a9200cff2b68676cbb26c2611a7d8
|
||||
F src/RevisionDialog.cpp 51065c65a07c118dd1a7363da4a55a135d1c6c9c
|
||||
F src/RevisionDialog.h b718c3009342eaabad39c8a11a253a4e4fef7a73
|
||||
F src/SearchBox.cpp d4209c575baa9933e1ce5ed376e785b289a145ba
|
||||
@ -219,10 +219,10 @@ F ui/BrowserWidget.ui 994ad9ea0e9f5815d6b1a27acc2f6f39164c507f
|
||||
F ui/CloneDialog.ui 4886e7d4f258ea8b852b5eefc860396e35145712
|
||||
F ui/CommitDialog.ui 5270bbf9c0b0c64d695420388160e2bb0e217d9f
|
||||
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
|
||||
F ui/MainWindow.ui 62465473277cca143d1618579a3375551e551ab3
|
||||
F ui/MainWindow.ui 22dc5cebf86223754dc8e0b14707b4cb81c95cc6
|
||||
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
|
||||
F ui/SettingsDialog.ui 5aafd8784268ea7cd828330d4673500b8f38d6db
|
||||
P 239c19ebecb1565f0c9e3319b1ea3d18bce59ab9
|
||||
R 3bccc129817cf3b1d6570a99f0682985
|
||||
P c50d8ea3ed378c1f9efbb6d83e93ffd1ce050db0
|
||||
R 6da61eacec95d19b45b31627041306ab
|
||||
U kostas
|
||||
Z 23e2a55234a8daa618ea7c34e0b6d98a
|
||||
Z 54a69f89b2494f325606e1959873a5e9
|
||||
|
@ -1 +1 @@
|
||||
c50d8ea3ed378c1f9efbb6d83e93ffd1ce050db0
|
||||
343b1675fb8eb023a04a1b84131f132d382f01dc
|
@ -152,7 +152,7 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
|
||||
// StashMenu
|
||||
menuStashes = new QMenu(this);
|
||||
menuStashes->addAction(ui->actionNewStash);
|
||||
menuStashes->addAction(ui->actionCreateStash);
|
||||
menuStashes->addAction(separator);
|
||||
menuStashes->addAction(ui->actionApplyStash);
|
||||
menuStashes->addAction(ui->actionDiffStash);
|
||||
@ -160,14 +160,14 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
|
||||
// TagsMenu
|
||||
menuTags = new QMenu(this);
|
||||
menuTags->addAction(ui->actionNewTag);
|
||||
menuTags->addAction(ui->actionCreateTag);
|
||||
menuTags->addAction(separator);
|
||||
menuTags->addAction(ui->actionDeleteTag);
|
||||
menuTags->addAction(ui->actionUpdate);
|
||||
|
||||
// BranchesMenu
|
||||
menuBranches = new QMenu(this);
|
||||
menuBranches->addAction(ui->actionNewBranch);
|
||||
menuBranches->addAction(ui->actionCreateBranch);
|
||||
menuBranches->addAction(separator);
|
||||
menuBranches->addAction(ui->actionMergeBranch);
|
||||
menuBranches->addAction(ui->actionUpdate);
|
||||
@ -556,27 +556,38 @@ void MainWindow::onOpenRecent()
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::enableActions(bool on)
|
||||
{
|
||||
ui->actionCommit->setEnabled(on);
|
||||
ui->actionDiff->setEnabled(on);
|
||||
ui->actionAdd->setEnabled(on);
|
||||
ui->actionDelete->setEnabled(on);
|
||||
ui->actionPush->setEnabled(on);
|
||||
ui->actionPull->setEnabled(on);
|
||||
ui->actionRename->setEnabled(on);
|
||||
ui->actionHistory->setEnabled(on);
|
||||
ui->actionFossilUI->setEnabled(on);
|
||||
ui->actionRevert->setEnabled(on);
|
||||
ui->actionTimeline->setEnabled(on);
|
||||
ui->actionOpenFile->setEnabled(on);
|
||||
ui->actionOpenContaining->setEnabled(on);
|
||||
ui->actionUndo->setEnabled(on);
|
||||
ui->actionUpdate->setEnabled(on);
|
||||
ui->actionOpenFolder->setEnabled(on);
|
||||
ui->actionRenameFolder->setEnabled(on);
|
||||
ui->actionNewStash->setEnabled(on);
|
||||
ui->actionDeleteStash->setEnabled(on);
|
||||
ui->actionDiffStash->setEnabled(on);
|
||||
ui->actionApplyStash->setEnabled(on);
|
||||
QAction *actions[] = {
|
||||
ui->actionCommit,
|
||||
ui->actionDiff,
|
||||
ui->actionAdd,
|
||||
ui->actionDelete,
|
||||
ui->actionPush,
|
||||
ui->actionPull,
|
||||
ui->actionRename,
|
||||
ui->actionHistory,
|
||||
ui->actionFossilUI,
|
||||
ui->actionRevert,
|
||||
ui->actionTimeline,
|
||||
ui->actionOpenFile,
|
||||
ui->actionOpenContaining,
|
||||
ui->actionUndo,
|
||||
ui->actionUpdate,
|
||||
ui->actionOpenFolder,
|
||||
ui->actionRenameFolder,
|
||||
ui->actionCreateStash,
|
||||
ui->actionDeleteStash,
|
||||
ui->actionDiffStash,
|
||||
ui->actionApplyStash,
|
||||
ui->actionDeleteStash,
|
||||
ui->actionCreateTag,
|
||||
ui->actionDeleteTag,
|
||||
ui->actionCreateBranch,
|
||||
ui->actionMergeBranch,
|
||||
};
|
||||
|
||||
for(size_t i=0; i<COUNTOF(actions); ++i)
|
||||
actions[i]->setEnabled(on);
|
||||
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
bool MainWindow::refresh()
|
||||
@ -732,7 +743,7 @@ void MainWindow::updateWorkspaceView()
|
||||
}
|
||||
|
||||
// Branches
|
||||
QStandardItem *branches = new QStandardItem(getInternalIcon(":icons/icon-item-branch"), "Branches");
|
||||
QStandardItem *branches = new QStandardItem(getInternalIcon(":icons/icon-item-branch"), tr("Branches"));
|
||||
branches->setData(WorkspaceItem(WorkspaceItem::TYPE_BRANCHES, ""), ROLE_WORKSPACE_ITEM);
|
||||
branches->setEditable(false);
|
||||
getWorkspace().getTreeModel().appendRow(branches);
|
||||
@ -752,7 +763,7 @@ void MainWindow::updateWorkspaceView()
|
||||
}
|
||||
|
||||
// Tags
|
||||
QStandardItem *tags = new QStandardItem(getInternalIcon(":icons/icon-item-tag"), "Tags");
|
||||
QStandardItem *tags = new QStandardItem(getInternalIcon(":icons/icon-item-tag"), tr("Tags"));
|
||||
tags->setData(WorkspaceItem(WorkspaceItem::TYPE_TAGS, ""), ROLE_WORKSPACE_ITEM);
|
||||
tags->setEditable(false);
|
||||
getWorkspace().getTreeModel().appendRow(tags);
|
||||
@ -776,7 +787,7 @@ void MainWindow::updateWorkspaceView()
|
||||
|
||||
// FIXME: Unique Icon name
|
||||
// Stashes
|
||||
QStandardItem *stashes = new QStandardItem(getInternalIcon(":icons/icon-action-repo-open"), "Stashes");
|
||||
QStandardItem *stashes = new QStandardItem(getInternalIcon(":icons/icon-action-repo-open"), tr("Stashes"));
|
||||
stashes->setData(WorkspaceItem(WorkspaceItem::TYPE_STASHES, ""), ROLE_WORKSPACE_ITEM);
|
||||
stashes->setEditable(false);
|
||||
getWorkspace().getTreeModel().appendRow(stashes);
|
||||
@ -787,18 +798,20 @@ void MainWindow::updateWorkspaceView()
|
||||
stashes->appendRow(stash);
|
||||
}
|
||||
|
||||
#if 0 // Unimplemented for now
|
||||
#if 0
|
||||
// Remotes
|
||||
QStandardItem *remotes = new QStandardItem(getInternalIcon(":icons/icon-item-remote"), "Remotes");
|
||||
QStandardItem *remotes = new QStandardItem(getInternalIcon(":icons/icon-item-remote"), tr("Remotes"));
|
||||
remotes->setData(WorkspaceItem(WorkspaceItem::TYPE_REMOTES, ""), ROLE_WORKSPACE_ITEM);
|
||||
remotes->setEditable(false);
|
||||
getWorkspace().getDirModel().appendRow(remotes);
|
||||
getWorkspace().getTreeModel().appendRow(remotes);
|
||||
#endif
|
||||
|
||||
#if 0 // Unimplemented for now
|
||||
// Settings
|
||||
QStandardItem *settings = new QStandardItem(getInternalIcon(":icons/icon-action-settings"), "Settings");
|
||||
QStandardItem *settings = new QStandardItem(getInternalIcon(":icons/icon-action-settings"), tr("Settings"));
|
||||
settings->setData(WorkspaceItem(WorkspaceItem::TYPE_SETTINGS, ""), ROLE_WORKSPACE_ITEM);
|
||||
settings->setEditable(false);
|
||||
getWorkspace().getDirModel().appendRow(settings);
|
||||
getWorkspace().getTreeModel().appendRow(settings);
|
||||
#endif
|
||||
|
||||
// Expand previously selected nodes
|
||||
@ -1962,7 +1975,7 @@ const QIcon &MainWindow::getInternalIcon(const char* name)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionNewStash_triggered()
|
||||
void MainWindow::on_actionCreateStash_triggered()
|
||||
{
|
||||
QStringList stashed_files;
|
||||
getSelectionFilenames(stashed_files, WorkspaceFile::TYPE_MODIFIED, true);
|
||||
@ -2350,13 +2363,13 @@ void MainWindow::updateRevision(const QString &revision)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionNewTag_triggered()
|
||||
void MainWindow::on_actionCreateTag_triggered()
|
||||
{
|
||||
// Default to current revision
|
||||
QString revision = fossil().getCurrentRevision();
|
||||
|
||||
QString name;
|
||||
if(!RevisionDialog::runNewTag(this, tr("New Tag"), versionList, revision, revision, name))
|
||||
if(!RevisionDialog::runNewTag(this, tr("Create Tag"), versionList, revision, revision, name))
|
||||
return;
|
||||
|
||||
if(name.isEmpty() || getWorkspace().getTags().contains(name) || getWorkspace().getBranches().contains(name))
|
||||
@ -2389,13 +2402,13 @@ void MainWindow::on_actionDeleteTag_triggered()
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void MainWindow::on_actionNewBranch_triggered()
|
||||
void MainWindow::on_actionCreateBranch_triggered()
|
||||
{
|
||||
// Default to current revision
|
||||
QString revision = fossil().getCurrentRevision();
|
||||
|
||||
QString branch_name;
|
||||
if(!RevisionDialog::runNewTag(this, tr("New Branch"), versionList, revision, revision, branch_name))
|
||||
if(!RevisionDialog::runNewTag(this, tr("Create Branch"), versionList, revision, revision, branch_name))
|
||||
return;
|
||||
|
||||
if(branch_name.isEmpty() || getWorkspace().getTags().contains(branch_name) || getWorkspace().getBranches().contains(branch_name))
|
||||
|
@ -113,16 +113,16 @@ private slots:
|
||||
void on_actionOpenRepository_triggered();
|
||||
void on_actionCloseRepository_triggered();
|
||||
void on_actionCloneRepository_triggered();
|
||||
void on_actionNewStash_triggered();
|
||||
void on_actionCreateStash_triggered();
|
||||
void on_actionApplyStash_triggered();
|
||||
void on_actionDeleteStash_triggered();
|
||||
void on_actionDiffStash_triggered();
|
||||
void on_textBrowser_customContextMenuRequested(const QPoint &pos);
|
||||
void on_fileTableView_customContextMenuRequested(const QPoint &pos);
|
||||
void on_workspaceTreeView_customContextMenuRequested(const QPoint &pos);
|
||||
void on_actionNewTag_triggered();
|
||||
void on_actionCreateTag_triggered();
|
||||
void on_actionDeleteTag_triggered();
|
||||
void on_actionNewBranch_triggered();
|
||||
void on_actionCreateBranch_triggered();
|
||||
void on_actionMergeBranch_triggered();
|
||||
|
||||
private:
|
||||
|
@ -259,8 +259,27 @@
|
||||
<addaction name="actionViewAsList"/>
|
||||
<addaction name="actionViewAsFolders"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuWorkspace">
|
||||
<property name="title">
|
||||
<string>&Workspace</string>
|
||||
</property>
|
||||
<addaction name="actionRefresh"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCommit"/>
|
||||
<addaction name="actionUpdate"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionPush"/>
|
||||
<addaction name="actionPull"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionUndo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCreateBranch"/>
|
||||
<addaction name="actionCreateTag"/>
|
||||
<addaction name="actionCreateStash"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuView"/>
|
||||
<addaction name="menuWorkspace"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
@ -302,7 +321,7 @@
|
||||
<addaction name="actionRevert"/>
|
||||
<addaction name="actionDelete"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionNewStash"/>
|
||||
<addaction name="actionCreateStash"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDiff"/>
|
||||
<addaction name="actionHistory"/>
|
||||
@ -319,7 +338,7 @@
|
||||
<normaloff>:/icons/icon-action-refresh</normaloff>:/icons/icon-action-refresh</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
<string>&Refresh</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Refresh the views</string>
|
||||
@ -337,7 +356,7 @@
|
||||
<normaloff>:/icons/icon-action-commit</normaloff>:/icons/icon-action-commit</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Commit</string>
|
||||
<string>&Commit</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Commit modifications</string>
|
||||
@ -471,7 +490,7 @@
|
||||
<normaloff>:/icons/icon-action-push</normaloff>:/icons/icon-action-push</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Push</string>
|
||||
<string>&Push</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Push changes to the remote repository</string>
|
||||
@ -489,7 +508,7 @@
|
||||
<normaloff>:/icons/icon-action-pull</normaloff>:/icons/icon-action-pull</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Pull</string>
|
||||
<string>Pu&ll</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Pull changes from the remote repository</string>
|
||||
@ -663,7 +682,7 @@
|
||||
<normaloff>:/icons/icon-action-undo</normaloff>:/icons/icon-action-undo</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Undo</string>
|
||||
<string>U&ndo</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Undo the last Fossil action</string>
|
||||
@ -696,7 +715,7 @@
|
||||
<normaloff>:/icons/icon-action-update</normaloff>:/icons/icon-action-update</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update</string>
|
||||
<string>&Update</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Update the workspace to a revision</string>
|
||||
@ -826,13 +845,13 @@
|
||||
<string>Rename the selected folder</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNewStash">
|
||||
<action name="actionCreateStash">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icon-action-stash-new</normaloff>:/icons/icon-action-stash-new</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stash changes</string>
|
||||
<string>&Stash Changes</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Stash changes</string>
|
||||
@ -871,13 +890,13 @@
|
||||
<string>Diff Stash</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNewTag">
|
||||
<action name="actionCreateTag">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icon-action-tag-new</normaloff>:/icons/icon-action-tag-new</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New Tag</string>
|
||||
<string>Create &Tag</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Tag current revision</string>
|
||||
@ -895,13 +914,13 @@
|
||||
<string>Delete tag</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNewBranch">
|
||||
<action name="actionCreateBranch">
|
||||
<property name="icon">
|
||||
<iconset resource="../rsrc/resources.qrc">
|
||||
<normaloff>:/icons/icon-item-branch</normaloff>:/icons/icon-item-branch</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New Branch</string>
|
||||
<string>Create &Branch</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create a branch from the current revision</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user