comparison mainwindow.cpp @ 73:a773c6e7b301

* Make stat work regardless of which tab is selected
author Chris Cannam
date Thu, 18 Nov 2010 18:08:18 +0000
parents 121cb1032717
children 10eb97683aa9
comparison
equal deleted inserted replaced
72:121cb1032717 73:a773c6e7b301
126 } 126 }
127 127
128 128
129 void MainWindow::hgStat() 129 void MainWindow::hgStat()
130 { 130 {
131 if (hgStatAct -> isEnabled()) 131 if (runningAction == ACT_NONE)
132 { 132 {
133 if (runningAction == ACT_NONE) 133 QStringList params;
134 { 134
135 QStringList params; 135 QString statFlags = hgExp -> getStatFlags();
136 136 if (statFlags.isEmpty())
137 QString statFlags = hgExp -> getStatFlags(); 137 {
138 if (statFlags.isEmpty()) 138 params << "stat";
139 { 139 }
140 params << "stat"; 140 else
141 } 141 {
142 else 142 params << "stat" << "-" + statFlags;
143 { 143 }
144 params << "stat" << "-" + statFlags; 144
145 } 145
146 146 runner -> startHgCommand(workFolderPath, params);
147 147 runningAction = ACT_STAT;
148 runner -> startHgCommand(workFolderPath, params);
149 runningAction = ACT_STAT;
150 }
151 } 148 }
152 } 149 }
153 150
154 void MainWindow::hgHeads() 151 void MainWindow::hgHeads()
155 { 152 {
727 724
728 QString choice = d->getCurrentChoice(); 725 QString choice = d->getCurrentChoice();
729 QString arg = d->getArgument().trimmed(); 726 QString arg = d->getArgument().trimmed();
730 727
731 if (choice == "local") { 728 if (choice == "local") {
729 DEBUG << "open " << arg << endl;
732 workFolderPath = arg; 730 workFolderPath = arg;
731 remoteRepoPath = "";
733 } else if (choice == "remote") { 732 } else if (choice == "remote") {
734 DEBUG << "clone " << arg << " to " << d->getAdditionalArgument().trimmed() << endl; 733 DEBUG << "clone " << arg << " to " << d->getAdditionalArgument().trimmed() << endl;
734 //!!! check that work folder does not exist, append to it if it does
735 } else if (choice == "init") {
736 DEBUG << "init " << arg << endl;
735 //!!! 737 //!!!
736 } 738 }
737 739
738 hgExp->clearLists(); 740 hgExp->clearLists();
739 enableDisableActions(); 741 enableDisableActions();
1224 1226
1225 hgCloneFromRemoteAct -> setEnabled(remoteRepoActionsEnabled); 1227 hgCloneFromRemoteAct -> setEnabled(remoteRepoActionsEnabled);
1226 hgIncomingAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled); 1228 hgIncomingAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled);
1227 hgPullAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled); 1229 hgPullAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled);
1228 hgPushAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled); 1230 hgPushAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled);
1229 1231 /*
1230 if (tabPage != WORKTAB) 1232 if (tabPage != WORKTAB)
1231 { 1233 {
1232 localRepoActionsEnabled = false; 1234 localRepoActionsEnabled = false;
1233 } 1235 }
1234 1236 */
1235 hgInitAct -> setEnabled((localRepoExist == false) && (workFolderExist==true)); 1237 hgInitAct -> setEnabled((localRepoExist == false) && (workFolderExist==true));
1236 hgStatAct -> setEnabled(localRepoActionsEnabled); 1238 hgStatAct -> setEnabled(localRepoActionsEnabled);
1237 hgFileDiffAct -> setEnabled(localRepoActionsEnabled); 1239 hgFileDiffAct -> setEnabled(localRepoActionsEnabled);
1238 hgFolderDiffAct -> setEnabled(localRepoActionsEnabled); 1240 hgFolderDiffAct -> setEnabled(localRepoActionsEnabled);
1239 hgRevertAct -> setEnabled(localRepoActionsEnabled); 1241 hgRevertAct -> setEnabled(localRepoActionsEnabled);