Merge resolved
Merge resolved successfully.
"));
- shouldHgStat = true;
- justMerged = true;
+ m_shouldHgStat = true;
+ m_justMerged = true;
break;
default:
@@ -1979,7 +2023,7 @@
settings.beginGroup("General");
if (settings.value("useextension", true).toBool()) {
hgTestExtension();
- } else if (workFolderPath == "") {
+ } else if (m_workFolderPath == "") {
open();
} else {
hgQueryPaths();
@@ -1988,7 +2032,7 @@
}
case ACT_TEST_HG_EXT:
- if (workFolderPath == "") {
+ if (m_workFolderPath == "") {
open();
} else{
hgQueryPaths();
@@ -2012,7 +2056,7 @@
break;
case ACT_QUERY_HEADS:
- if (headsChanged && !needNewLog) {
+ if (headsChanged && !m_needNewLog) {
hgLogIncremental(oldHeadIds);
} else {
hgQueryParents();
@@ -2024,7 +2068,7 @@
break;
case ACT_QUERY_PARENTS:
- if (needNewLog) {
+ if (m_needNewLog) {
hgLog();
} else {
// we're done
@@ -2038,8 +2082,8 @@
break;
default:
- if (shouldHgStat) {
- shouldHgStat = false;
+ if (m_shouldHgStat) {
+ m_shouldHgStat = false;
hgQueryPaths();
} else {
noMore = true;
@@ -2048,66 +2092,69 @@
}
if (noMore) {
- stateUnknown = false;
+ m_stateUnknown = false;
enableDisableActions();
- hgTabs->updateHistory();
+ m_hgTabs->updateHistory();
}
}
void MainWindow::connectActions()
{
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- connect(hgRefreshAct, SIGNAL(triggered()), this, SLOT(hgRefresh()));
- connect(hgRemoveAct, SIGNAL(triggered()), this, SLOT(hgRemove()));
- connect(hgAddAct, SIGNAL(triggered()), this, SLOT(hgAdd()));
- connect(hgCommitAct, SIGNAL(triggered()), this, SLOT(hgCommit()));
- connect(hgFolderDiffAct, SIGNAL(triggered()), this, SLOT(hgFolderDiff()));
- connect(hgUpdateAct, SIGNAL(triggered()), this, SLOT(hgUpdate()));
- connect(hgRevertAct, SIGNAL(triggered()), this, SLOT(hgRevert()));
- connect(hgMergeAct, SIGNAL(triggered()), this, SLOT(hgMerge()));
- connect(hgIgnoreAct, SIGNAL(triggered()), this, SLOT(hgIgnore()));
-
- connect(settingsAct, SIGNAL(triggered()), this, SLOT(settings()));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
- connect(changeRemoteRepoAct, SIGNAL(triggered()), this, SLOT(changeRemoteRepo()));
-
- connect(hgIncomingAct, SIGNAL(triggered()), this, SLOT(hgIncoming()));
- connect(hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull()));
- connect(hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush()));
-
- connect(hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate()));
- connect(hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe()));
+ connect(m_exitAct, SIGNAL(triggered()), this, SLOT(close()));
+ connect(m_aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+
+ connect(m_hgRefreshAct, SIGNAL(triggered()), this, SLOT(hgRefresh()));
+ connect(m_hgRemoveAct, SIGNAL(triggered()), this, SLOT(hgRemove()));
+ connect(m_hgAddAct, SIGNAL(triggered()), this, SLOT(hgAdd()));
+ connect(m_hgCommitAct, SIGNAL(triggered()), this, SLOT(hgCommit()));
+ connect(m_hgFolderDiffAct, SIGNAL(triggered()), this, SLOT(hgFolderDiff()));
+ connect(m_hgUpdateAct, SIGNAL(triggered()), this, SLOT(hgUpdate()));
+ connect(m_hgRevertAct, SIGNAL(triggered()), this, SLOT(hgRevert()));
+ connect(m_hgMergeAct, SIGNAL(triggered()), this, SLOT(hgMerge()));
+ connect(m_hgIgnoreAct, SIGNAL(triggered()), this, SLOT(hgIgnore()));
+
+ connect(m_settingsAct, SIGNAL(triggered()), this, SLOT(settings()));
+ connect(m_openAct, SIGNAL(triggered()), this, SLOT(open()));
+ connect(m_changeRemoteRepoAct, SIGNAL(triggered()), this, SLOT(changeRemoteRepo()));
+
+ connect(m_hgIncomingAct, SIGNAL(triggered()), this, SLOT(hgIncoming()));
+ connect(m_hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull()));
+ connect(m_hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush()));
+
+ connect(m_hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate()));
+ connect(m_hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe()));
}
void MainWindow::connectTabsSignals()
{
- connect(hgTabs, SIGNAL(commit()),
+ connect(m_hgTabs, SIGNAL(commit()),
this, SLOT(hgCommit()));
- connect(hgTabs, SIGNAL(revert()),
+ connect(m_hgTabs, SIGNAL(revert()),
this, SLOT(hgRevert()));
- connect(hgTabs, SIGNAL(diffWorkingFolder()),
+ connect(m_hgTabs, SIGNAL(diffWorkingFolder()),
this, SLOT(hgFolderDiff()));
- connect(hgTabs, SIGNAL(showSummary()),
+ connect(m_hgTabs, SIGNAL(showSummary()),
this, SLOT(hgShowSummary()));
- connect(hgTabs, SIGNAL(updateTo(QString)),
+ connect(m_hgTabs, SIGNAL(updateTo(QString)),
this, SLOT(hgUpdateToRev(QString)));
- connect(hgTabs, SIGNAL(diffToCurrent(QString)),
+ connect(m_hgTabs, SIGNAL(diffToCurrent(QString)),
this, SLOT(hgDiffToCurrent(QString)));
- connect(hgTabs, SIGNAL(diffToParent(QString, QString)),
+ connect(m_hgTabs, SIGNAL(diffToParent(QString, QString)),
this, SLOT(hgDiffToParent(QString, QString)));
- connect(hgTabs, SIGNAL(mergeFrom(QString)),
+ connect(m_hgTabs, SIGNAL(showSummary(Changeset *)),
+ this, SLOT(hgShowSummaryFor(Changeset *)));
+
+ connect(m_hgTabs, SIGNAL(mergeFrom(QString)),
this, SLOT(hgMergeFrom(QString)));
- connect(hgTabs, SIGNAL(tag(QString)),
+ connect(m_hgTabs, SIGNAL(tag(QString)),
this, SLOT(hgTag(QString)));
}
@@ -2115,7 +2162,7 @@
{
DEBUG << "MainWindow::enableDisableActions" << endl;
- QString dirname = QDir(workFolderPath).dirName();
+ QString dirname = QDir(m_workFolderPath).dirName();
if (dirname != "") {
setWindowTitle(tr("EasyMercurial: %1").arg(dirname));
} else {
@@ -2130,32 +2177,32 @@
bool workFolderExist = true;
bool localRepoExist = true;
- remoteRepoActionsEnabled = true;
- if (remoteRepoPath.isEmpty()) {
- remoteRepoActionsEnabled = false;
+ m_remoteRepoActionsEnabled = true;
+ if (m_remoteRepoPath.isEmpty()) {
+ m_remoteRepoActionsEnabled = false;
}
- localRepoActionsEnabled = true;
- if (workFolderPath.isEmpty()) {
- localRepoActionsEnabled = false;
+ m_localRepoActionsEnabled = true;
+ if (m_workFolderPath.isEmpty()) {
+ m_localRepoActionsEnabled = false;
workFolderExist = false;
}
- if (workFolderPath == "" || !workFolderDir.exists(workFolderPath)) {
- localRepoActionsEnabled = false;
+ if (m_workFolderPath == "" || !workFolderDir.exists(m_workFolderPath)) {
+ m_localRepoActionsEnabled = false;
workFolderExist = false;
} else {
workFolderExist = true;
}
- if (!localRepoDir.exists(workFolderPath + "/.hg")) {
- localRepoActionsEnabled = false;
+ if (!localRepoDir.exists(m_workFolderPath + "/.hg")) {
+ m_localRepoActionsEnabled = false;
localRepoExist = false;
}
- hgIncomingAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled);
- hgPullAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled);
- hgPushAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled);
+ m_hgIncomingAct -> setEnabled(m_remoteRepoActionsEnabled && m_remoteRepoActionsEnabled);
+ m_hgPullAct -> setEnabled(m_remoteRepoActionsEnabled && m_remoteRepoActionsEnabled);
+ m_hgPushAct -> setEnabled(m_remoteRepoActionsEnabled && m_remoteRepoActionsEnabled);
bool haveDiff = false;
QSettings settings;
@@ -2165,26 +2212,26 @@
}
settings.endGroup();
- hgRefreshAct -> setEnabled(localRepoActionsEnabled);
- hgFolderDiffAct -> setEnabled(localRepoActionsEnabled && haveDiff);
- hgRevertAct -> setEnabled(localRepoActionsEnabled);
- hgAddAct -> setEnabled(localRepoActionsEnabled);
- hgRemoveAct -> setEnabled(localRepoActionsEnabled);
- hgUpdateAct -> setEnabled(localRepoActionsEnabled);
- hgCommitAct -> setEnabled(localRepoActionsEnabled);
- hgMergeAct -> setEnabled(localRepoActionsEnabled);
- hgAnnotateAct -> setEnabled(localRepoActionsEnabled);
- hgServeAct -> setEnabled(localRepoActionsEnabled);
- hgIgnoreAct -> setEnabled(localRepoActionsEnabled);
-
- DEBUG << "localRepoActionsEnabled = " << localRepoActionsEnabled << endl;
- DEBUG << "canCommit = " << hgTabs->canCommit() << endl;
-
- hgAddAct->setEnabled(localRepoActionsEnabled && hgTabs->canAdd());
- hgRemoveAct->setEnabled(localRepoActionsEnabled && hgTabs->canRemove());
- hgCommitAct->setEnabled(localRepoActionsEnabled && hgTabs->canCommit());
- hgRevertAct->setEnabled(localRepoActionsEnabled && hgTabs->canRevert());
- hgFolderDiffAct->setEnabled(localRepoActionsEnabled && hgTabs->canDiff());
+ m_hgRefreshAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgFolderDiffAct -> setEnabled(m_localRepoActionsEnabled && haveDiff);
+ m_hgRevertAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgAddAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgRemoveAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgUpdateAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgCommitAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgMergeAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgAnnotateAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgServeAct -> setEnabled(m_localRepoActionsEnabled);
+ m_hgIgnoreAct -> setEnabled(m_localRepoActionsEnabled);
+
+ DEBUG << "m_localRepoActionsEnabled = " << m_localRepoActionsEnabled << endl;
+ DEBUG << "canCommit = " << m_hgTabs->canCommit() << endl;
+
+ m_hgAddAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canAdd());
+ m_hgRemoveAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canRemove());
+ m_hgCommitAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canCommit());
+ m_hgRevertAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canRevert());
+ m_hgFolderDiffAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canDiff());
// A default merge makes sense if:
// * there is only one parent (if there are two, we have an uncommitted merge) and
@@ -2201,24 +2248,24 @@
bool emptyRepo = false;
bool noWorkingCopy = false;
bool newBranch = false;
- int currentBranchHeads = 0;
-
- if (currentParents.size() == 1) {
+ int m_currentBranchHeads = 0;
+
+ if (m_currentParents.size() == 1) {
bool parentIsHead = false;
- Changeset *parent = currentParents[0];
- foreach (Changeset *head, currentHeads) {
- DEBUG << "head branch " << head->branch() << ", current branch " << currentBranch << endl;
- if (head->isOnBranch(currentBranch)) {
- ++currentBranchHeads;
+ Changeset *parent = m_currentParents[0];
+ foreach (Changeset *head, m_currentHeads) {
+ DEBUG << "head branch " << head->branch() << ", current branch " << m_currentBranch << endl;
+ if (head->isOnBranch(m_currentBranch)) {
+ ++m_currentBranchHeads;
}
if (parent->id() == head->id()) {
parentIsHead = true;
}
}
- if (currentBranchHeads == 2 && parentIsHead) {
+ if (m_currentBranchHeads == 2 && parentIsHead) {
canMerge = true;
}
- if (currentBranchHeads == 0 && parentIsHead) {
+ if (m_currentBranchHeads == 0 && parentIsHead) {
// Just created a new branch
newBranch = true;
}
@@ -2226,13 +2273,13 @@
canUpdate = true;
DEBUG << "parent id = " << parent->id() << endl;
DEBUG << " head ids "<setState(tr("No repository open"));
+ if (m_stateUnknown) {
+ if (m_workFolderPath == "") {
+ m_hgTabs->setState(tr("No repository open"));
} else {
- hgTabs->setState(tr("(Examining repository)"));
+ m_hgTabs->setState(tr("(Examining repository)"));
}
} else if (emptyRepo) {
- hgTabs->setState(tr("Nothing committed to this repository yet"));
+ m_hgTabs->setState(tr("Nothing committed to this repository yet"));
} else if (noWorkingCopy) {
- hgTabs->setState(tr("No working copy yet: consider updating"));
+ m_hgTabs->setState(tr("No working copy yet: consider updating"));
} else if (canMerge) {
- hgTabs->setState(tr("Awaiting merge on %1").arg(branchText));
- } else if (!hgTabs->getAllUnresolvedFiles().empty()) {
- hgTabs->setState(tr("Have unresolved files following merge on %1").arg(branchText));
+ m_hgTabs->setState(tr("Awaiting merge on %1").arg(branchText));
+ } else if (!m_hgTabs->getAllUnresolvedFiles().empty()) {
+ m_hgTabs->setState(tr("Have unresolved files following merge on %1").arg(branchText));
} else if (haveMerge) {
- hgTabs->setState(tr("Have merged but not yet committed on %1").arg(branchText));
+ m_hgTabs->setState(tr("Have merged but not yet committed on %1").arg(branchText));
} else if (newBranch) {
- hgTabs->setState(tr("On %1. New branch: has not yet been committed").arg(branchText));
+ m_hgTabs->setState(tr("On %1. New branch: has not yet been committed").arg(branchText));
} else if (canUpdate) {
- if (hgTabs->haveChangesToCommit()) {
+ if (m_hgTabs->haveChangesToCommit()) {
// have uncommitted changes
- hgTabs->setState(tr("On %1. Not at the head of the branch").arg(branchText));
+ m_hgTabs->setState(tr("On %1. Not at the head of the branch").arg(branchText));
} else {
// no uncommitted changes
- hgTabs->setState(tr("On %1. Not at the head of the branch: consider updating").arg(branchText));
+ m_hgTabs->setState(tr("On %1. Not at the head of the branch: consider updating").arg(branchText));
}
- } else if (currentBranchHeads > 1) {
- hgTabs->setState(tr("At one of %n heads of %1", "", currentBranchHeads).arg(branchText));
+ } else if (m_currentBranchHeads > 1) {
+ m_hgTabs->setState(tr("At one of %n heads of %1", "", m_currentBranchHeads).arg(branchText));
} else {
- hgTabs->setState(tr("At the head of %1").arg(branchText));
+ m_hgTabs->setState(tr("At the head of %1").arg(branchText));
}
}
void MainWindow::createActions()
{
//File actions
- openAct = new QAction(QIcon(":/images/fileopen.png"), tr("Open..."), this);
- openAct -> setStatusTip(tr("Open an existing repository or working folder"));
-
- changeRemoteRepoAct = new QAction(tr("Change Remote Location..."), this);
- changeRemoteRepoAct->setStatusTip(tr("Change the default remote repository for pull and push actions"));
-
- settingsAct = new QAction(QIcon(":/images/settings.png"), tr("Settings..."), this);
- settingsAct -> setStatusTip(tr("View and change application settings"));
-
- exitAct = new QAction(QIcon(":/images/exit.png"), tr("Quit"), this);
- exitAct->setShortcuts(QKeySequence::Quit);
- exitAct->setStatusTip(tr("Quit EasyMercurial"));
+ m_openAct = new QAction(QIcon(":/images/fileopen.png"), tr("Open..."), this);
+ m_openAct -> setStatusTip(tr("Open an existing repository or working folder"));
+
+ m_changeRemoteRepoAct = new QAction(tr("Change Remote Location..."), this);
+ m_changeRemoteRepoAct->setStatusTip(tr("Change the default remote repository for pull and push actions"));
+
+ m_settingsAct = new QAction(QIcon(":/images/settings.png"), tr("Settings..."), this);
+ m_settingsAct -> setStatusTip(tr("View and change application settings"));
+
+ m_exitAct = new QAction(QIcon(":/images/exit.png"), tr("Quit"), this);
+ m_exitAct->setShortcuts(QKeySequence::Quit);
+ m_exitAct->setStatusTip(tr("Quit EasyMercurial"));
//Repository actions
- hgRefreshAct = new QAction(QIcon(":/images/status.png"), tr("Refresh"), this);
- hgRefreshAct->setStatusTip(tr("Refresh the window to show the current state of the working folder"));
-
- hgIncomingAct = new QAction(QIcon(":/images/incoming.png"), tr("Preview"), this);
- hgIncomingAct -> setStatusTip(tr("See what changes are available in the remote repository waiting to be pulled"));
-
- hgPullAct = new QAction(QIcon(":/images/pull.png"), tr("Pull"), this);
- hgPullAct -> setStatusTip(tr("Pull changes from the remote repository to the local repository"));
-
- hgPushAct = new QAction(QIcon(":/images/push.png"), tr("Push"), this);
- hgPushAct->setStatusTip(tr("Push changes from the local repository to the remote repository"));
+ m_hgRefreshAct = new QAction(QIcon(":/images/status.png"), tr("Refresh"), this);
+ m_hgRefreshAct->setStatusTip(tr("Refresh the window to show the current state of the working folder"));
+
+ m_hgIncomingAct = new QAction(QIcon(":/images/incoming.png"), tr("Preview"), this);
+ m_hgIncomingAct -> setStatusTip(tr("See what changes are available in the remote repository waiting to be pulled"));
+
+ m_hgPullAct = new QAction(QIcon(":/images/pull.png"), tr("Pull"), this);
+ m_hgPullAct -> setStatusTip(tr("Pull changes from the remote repository to the local repository"));
+
+ m_hgPushAct = new QAction(QIcon(":/images/push.png"), tr("Push"), this);
+ m_hgPushAct->setStatusTip(tr("Push changes from the local repository to the remote repository"));
//Workfolder actions
- hgFolderDiffAct = new QAction(QIcon(":/images/folderdiff.png"), tr("Diff"), this);
- hgFolderDiffAct->setStatusTip(tr("See what has changed in the working folder compared with the last committed state"));
-
- hgRevertAct = new QAction(QIcon(":/images/undo.png"), tr("Revert"), this);
- hgRevertAct->setStatusTip(tr("Throw away your changes and return to the last committed state"));
-
- hgAddAct = new QAction(QIcon(":/images/add.png"), tr("Add"), this);
- hgAddAct -> setStatusTip(tr("Mark the selected file(s) to be added on the next commit"));
+ m_hgFolderDiffAct = new QAction(QIcon(":/images/folderdiff.png"), tr("Diff"), this);
+ m_hgFolderDiffAct->setStatusTip(tr("See what has changed in the working folder compared with the last committed state"));
+
+ m_hgRevertAct = new QAction(QIcon(":/images/undo.png"), tr("Revert"), this);
+ m_hgRevertAct->setStatusTip(tr("Throw away your changes and return to the last committed state"));
+
+ m_hgAddAct = new QAction(QIcon(":/images/add.png"), tr("Add"), this);
+ m_hgAddAct -> setStatusTip(tr("Mark the selected file(s) to be added on the next commit"));
//!!! needs to be modified for number
- hgRemoveAct = new QAction(QIcon(":/images/remove.png"), tr("Remove"), this);
- hgRemoveAct -> setStatusTip(tr("Mark the selected file(s) to be removed from version control on the next commit"));
-
- hgUpdateAct = new QAction(QIcon(":/images/update.png"), tr("Update"), this);
- hgUpdateAct->setStatusTip(tr("Update the working folder to the head of the current repository branch"));
+ m_hgRemoveAct = new QAction(QIcon(":/images/remove.png"), tr("Remove"), this);
+ m_hgRemoveAct -> setStatusTip(tr("Mark the selected file(s) to be removed from version control on the next commit"));
+
+ m_hgUpdateAct = new QAction(QIcon(":/images/update.png"), tr("Update"), this);
+ m_hgUpdateAct->setStatusTip(tr("Update the working folder to the head of the current repository branch"));
//!!! needs to be modified when files selected
- hgCommitAct = new QAction(QIcon(":/images/commit.png"), tr("Commit"), this);
- hgCommitAct->setStatusTip(tr("Commit your changes to the local repository"));
-
- hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this);
- hgMergeAct->setStatusTip(tr("Merge the two independent sets of changes in the local repository into the working folder"));
+ m_hgCommitAct = new QAction(QIcon(":/images/commit.png"), tr("Commit"), this);
+ m_hgCommitAct->setStatusTip(tr("Commit your changes to the local repository"));
+
+ m_hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this);
+ m_hgMergeAct->setStatusTip(tr("Merge the two independent sets of changes in the local repository into the working folder"));
//Advanced actions
//!!! needs to be modified for number
- hgAnnotateAct = new QAction(tr("Annotate"), this);
- hgAnnotateAct -> setStatusTip(tr("Show line-by-line version information for selected file"));
-
- hgIgnoreAct = new QAction(tr("Edit .hgignore File"), this);
- hgIgnoreAct -> setStatusTip(tr("Edit the .hgignore file, containing the names of files that should be ignored by Mercurial"));
-
- hgServeAct = new QAction(tr("Serve via HTTP"), this);
- hgServeAct -> setStatusTip(tr("Serve local repository via http for workgroup access"));
+ m_hgAnnotateAct = new QAction(tr("Annotate"), this);
+ m_hgAnnotateAct -> setStatusTip(tr("Show line-by-line version information for selected file"));
+
+ m_hgIgnoreAct = new QAction(tr("Edit .hgignore File"), this);
+ m_hgIgnoreAct -> setStatusTip(tr("Edit the .hgignore file, containing the names of files that should be ignored by Mercurial"));
+
+ m_hgServeAct = new QAction(tr("Serve via HTTP"), this);
+ m_hgServeAct -> setStatusTip(tr("Serve local repository via http for workgroup access"));
//Help actions
- aboutAct = new QAction(tr("About EasyMercurial"), this);
+ m_aboutAct = new QAction(tr("About EasyMercurial"), this);
// Miscellaneous
QShortcut *clearSelectionsShortcut = new QShortcut(Qt::Key_Escape, this);
@@ -2370,56 +2417,56 @@
void MainWindow::createMenus()
{
- fileMenu = menuBar()->addMenu(tr("File"));
-
- fileMenu -> addAction(openAct);
- fileMenu -> addAction(changeRemoteRepoAct);
- fileMenu -> addSeparator();
-
- advancedMenu = fileMenu->addMenu(tr("Advanced"));
-
- fileMenu -> addAction(settingsAct);
-
- fileMenu -> addSeparator();
- fileMenu -> addAction(exitAct);
-
- advancedMenu -> addAction(hgIgnoreAct);
- advancedMenu -> addSeparator();
- advancedMenu -> addAction(hgServeAct);
-
- helpMenu = menuBar()->addMenu(tr("Help"));
- helpMenu->addAction(aboutAct);
+ m_fileMenu = menuBar()->addMenu(tr("File"));
+
+ m_fileMenu -> addAction(m_openAct);
+ m_fileMenu -> addAction(m_changeRemoteRepoAct);
+ m_fileMenu -> addSeparator();
+
+ m_advancedMenu = m_fileMenu->addMenu(tr("Advanced"));
+
+ m_fileMenu -> addAction(m_settingsAct);
+
+ m_fileMenu -> addSeparator();
+ m_fileMenu -> addAction(m_exitAct);
+
+ m_advancedMenu -> addAction(m_hgIgnoreAct);
+ m_advancedMenu -> addSeparator();
+ m_advancedMenu -> addAction(m_hgServeAct);
+
+ m_helpMenu = menuBar()->addMenu(tr("Help"));
+ m_helpMenu->addAction(m_aboutAct);
}
void MainWindow::createToolBars()
{
- fileToolBar = addToolBar(tr("File"));
- fileToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE));
- fileToolBar -> addAction(openAct);
- fileToolBar -> addAction(hgRefreshAct);
- fileToolBar -> addSeparator();
- fileToolBar -> setMovable(false);
-
- repoToolBar = addToolBar(tr(REPOMENU_TITLE));
- repoToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE));
- repoToolBar->addAction(hgIncomingAct);
- repoToolBar->addAction(hgPullAct);
- repoToolBar->addAction(hgPushAct);
- repoToolBar -> setMovable(false);
-
- workFolderToolBar = addToolBar(tr(WORKFOLDERMENU_TITLE));
- addToolBar(Qt::LeftToolBarArea, workFolderToolBar);
- workFolderToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE));
- workFolderToolBar->addAction(hgFolderDiffAct);
- workFolderToolBar->addSeparator();
- workFolderToolBar->addAction(hgRevertAct);
- workFolderToolBar->addAction(hgUpdateAct);
- workFolderToolBar->addAction(hgCommitAct);
- workFolderToolBar->addAction(hgMergeAct);
- workFolderToolBar->addSeparator();
- workFolderToolBar->addAction(hgAddAct);
- workFolderToolBar->addAction(hgRemoveAct);
- workFolderToolBar -> setMovable(false);
+ m_fileToolBar = addToolBar(tr("File"));
+ m_fileToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE));
+ m_fileToolBar -> addAction(m_openAct);
+ m_fileToolBar -> addAction(m_hgRefreshAct);
+ m_fileToolBar -> addSeparator();
+ m_fileToolBar -> setMovable(false);
+
+ m_repoToolBar = addToolBar(tr(REPOMENU_TITLE));
+ m_repoToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE));
+ m_repoToolBar->addAction(m_hgIncomingAct);
+ m_repoToolBar->addAction(m_hgPullAct);
+ m_repoToolBar->addAction(m_hgPushAct);
+ m_repoToolBar -> setMovable(false);
+
+ m_workFolderToolBar = addToolBar(tr(WORKFOLDERMENU_TITLE));
+ addToolBar(Qt::LeftToolBarArea, m_workFolderToolBar);
+ m_workFolderToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE));
+ m_workFolderToolBar->addAction(m_hgFolderDiffAct);
+ m_workFolderToolBar->addSeparator();
+ m_workFolderToolBar->addAction(m_hgRevertAct);
+ m_workFolderToolBar->addAction(m_hgUpdateAct);
+ m_workFolderToolBar->addAction(m_hgCommitAct);
+ m_workFolderToolBar->addAction(m_hgMergeAct);
+ m_workFolderToolBar->addSeparator();
+ m_workFolderToolBar->addAction(m_hgAddAct);
+ m_workFolderToolBar->addAction(m_hgRemoveAct);
+ m_workFolderToolBar -> setMovable(false);
updateToolBarStyle();
}
@@ -2452,16 +2499,16 @@
QSettings settings;
- remoteRepoPath = settings.value("remoterepopath", "").toString();
- workFolderPath = settings.value("workfolderpath", "").toString();
- if (!workFolder.exists(workFolderPath))
+ m_remoteRepoPath = settings.value("remoterepopath", "").toString();
+ m_workFolderPath = settings.value("workfolderpath", "").toString();
+ if (!workFolder.exists(m_workFolderPath))
{
- workFolderPath = "";
+ m_workFolderPath = "";
}
QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
QSize size = settings.value("size", QSize(400, 400)).toSize();
- firstStart = settings.value("firststart", QVariant(true)).toBool();
+ m_firstStart = settings.value("firststart", QVariant(true)).toBool();
//!!! initialFileTypesBits = (unsigned char) settings.value("viewFileTypes", QVariant(DEFAULT_HG_STAT_BITS)).toInt();
resize(size);
@@ -2474,10 +2521,10 @@
QSettings settings;
settings.setValue("pos", pos());
settings.setValue("size", size());
- settings.setValue("remoterepopath", remoteRepoPath);
- settings.setValue("workfolderpath", workFolderPath);
- settings.setValue("firststart", firstStart);
- //!!!settings.setValue("viewFileTypes", hgTabs -> getFileTypesBits());
+ settings.setValue("remoterepopath", m_remoteRepoPath);
+ settings.setValue("workfolderpath", m_workFolderPath);
+ settings.setValue("firststart", m_firstStart);
+ //!!!settings.setValue("viewFileTypes", m_hgTabs -> getFileTypesBits());
}
diff -r 2e34e7ee7baf -r 7b4f42cfc596 mainwindow.h
--- a/mainwindow.h Mon Feb 21 15:55:39 2011 +0000
+++ b/mainwindow.h Mon Feb 21 18:17:18 2011 +0000
@@ -40,20 +40,6 @@
public:
MainWindow(QString myDirPath);
- HgTabWidget *hgTabs;
- void writeSettings();
-
- //Paths to remote repo & workfolder
- //Local repo is directory "./hg/" under work folder
- QString remoteRepoPath;
- QString workFolderPath;
- QString currentBranch;
- Changesets currentHeads;
- Changesets currentParents;
- int commitsSincePush;
- bool stateUnknown;
- bool hgIsOK;
- bool needNewLog;
protected:
void closeEvent(QCloseEvent *event);
@@ -83,6 +69,7 @@
void hgAdd();
void hgCommit();
void hgShowSummary();
+ void hgShowSummaryFor(Changeset *);
void hgFolderDiff();
void hgDiffToCurrent(QString);
void hgDiffToParent(QString, QString);
@@ -126,6 +113,7 @@
void splitChangeSets(QStringList *list, QString hgLogOutput);
void reportNewRemoteHeads(QString);
void presentLongStdoutToUser(QString stdo);
+ void writeSettings();
QStringList listAllUpIpV4Addresses();
QString filterTag(QString tag);
@@ -163,71 +151,83 @@
void suspendFileSystemWatcher();
void restoreFileSystemWatcher();
- bool firstStart;
+ HgTabWidget *m_hgTabs;
- bool showAllFiles;
+ QString m_remoteRepoPath;
+ QString m_workFolderPath;
+ QString m_currentBranch;
+ Changesets m_currentHeads;
+ Changesets m_currentParents;
+ int m_commitsSincePush;
+ bool m_stateUnknown;
+ bool m_hgIsOK;
+ bool m_needNewLog;
+
+ bool m_firstStart;
+
+ bool m_showAllFiles;
//Actions enabled flags
- bool remoteRepoActionsEnabled;
- bool localRepoActionsEnabled;
+ bool m_remoteRepoActionsEnabled;
+ bool m_localRepoActionsEnabled;
QString m_myDirPath;
- //File menu actions
- QAction *openAct;
- QAction *changeRemoteRepoAct;
- QAction *settingsAct;
- QAction *exitAct;
+ // File menu actions
+ QAction *m_openAct;
+ QAction *m_changeRemoteRepoAct;
+ QAction *m_settingsAct;
+ QAction *m_exitAct;
- //Repo actions
- QAction *hgIncomingAct;
- QAction *hgPushAct;
- QAction *hgPullAct;
- QAction *hgRefreshAct;
- QAction *hgFolderDiffAct;
- QAction *hgChgSetDiffAct;
- QAction *hgRevertAct;
- QAction *hgAddAct;
- QAction *hgRemoveAct;
- QAction *hgUpdateAct;
- QAction *hgCommitAct;
- QAction *hgMergeAct;
- QAction *hgUpdateToRevAct;
- QAction *hgAnnotateAct;
- QAction *hgIgnoreAct;
- QAction *hgServeAct;
+ // Repo actions
+ QAction *m_hgIncomingAct;
+ QAction *m_hgPushAct;
+ QAction *m_hgPullAct;
+ QAction *m_hgRefreshAct;
+ QAction *m_hgFolderDiffAct;
+ QAction *m_hgChgSetDiffAct;
+ QAction *m_hgRevertAct;
+ QAction *m_hgAddAct;
+ QAction *m_hgRemoveAct;
+ QAction *m_hgUpdateAct;
+ QAction *m_hgCommitAct;
+ QAction *m_hgMergeAct;
+ QAction *m_hgUpdateToRevAct;
+ QAction *m_hgAnnotateAct;
+ QAction *m_hgIgnoreAct;
+ QAction *m_hgServeAct;
- //Menus
- QMenu *fileMenu;
- QMenu *advancedMenu;
- QMenu *helpMenu;
+ // Menus
+ QMenu *m_fileMenu;
+ QMenu *m_advancedMenu;
+ QMenu *m_helpMenu;
- //Help menu actions
- QAction *aboutAct;
+ // Help menu actions
+ QAction *m_aboutAct;
- QToolBar *fileToolBar;
- QToolBar *repoToolBar;
- QToolBar *workFolderToolBar;
+ QToolBar *m_fileToolBar;
+ QToolBar *m_repoToolBar;
+ QToolBar *m_workFolderToolBar;
- HgRunner *runner;
+ HgRunner *m_runner;
- bool shouldHgStat;
+ bool m_shouldHgStat;
QString getDiffBinaryName();
QString getMergeBinaryName();
QString getEditorBinaryName();
- QFileSystemWatcher *fsWatcher;
+ QFileSystemWatcher *m_fsWatcher;
QTimer *m_fsWatcherGeneralTimer;
QTimer *m_fsWatcherRestoreTimer;
bool m_fsWatcherSuspended;
- QString lastStatOutput;
- QStringList lastRevertedFiles;
+ QString m_lastStatOutput;
+ QStringList m_lastRevertedFiles;
- bool justMerged;
- QString mergeTargetRevision;
- QString mergeCommitComment;
+ bool m_justMerged;
+ QString m_mergeTargetRevision;
+ QString m_mergeCommitComment;
};
#endif