Mercurial > hg > easyhg
comparison mainwindow.cpp @ 284:a68801b31ceb mainwindow_member_tidy
Make MainWindow members private and m_prefixed
| author | Chris Cannam |
|---|---|
| date | Mon, 21 Feb 2011 09:08:55 +0000 |
| parents | 1ec306df738e |
| children | 3fbafca196e4 ca6edd303c9d |
comparison
equal
deleted
inserted
replaced
| 282:1ec306df738e | 284:a68801b31ceb |
|---|---|
| 54 { | 54 { |
| 55 setWindowIcon(QIcon(":images/easyhg-icon.png")); | 55 setWindowIcon(QIcon(":images/easyhg-icon.png")); |
| 56 | 56 |
| 57 QString wndTitle; | 57 QString wndTitle; |
| 58 | 58 |
| 59 showAllFiles = false; | 59 m_showAllFiles = false; |
| 60 | 60 |
| 61 fsWatcher = 0; | 61 m_fsWatcher = 0; |
| 62 commitsSincePush = 0; | 62 m_commitsSincePush = 0; |
| 63 shouldHgStat = true; | 63 m_shouldHgStat = true; |
| 64 | 64 |
| 65 createActions(); | 65 createActions(); |
| 66 createMenus(); | 66 createMenus(); |
| 67 createToolBars(); | 67 createToolBars(); |
| 68 createStatusBar(); | 68 createStatusBar(); |
| 69 | 69 |
| 70 runner = new HgRunner(myDirPath, this); | 70 m_runner = new HgRunner(m_myDirPath, this); |
| 71 connect(runner, SIGNAL(commandStarting(HgAction)), | 71 connect(m_runner, SIGNAL(commandStarting(HgAction)), |
| 72 this, SLOT(commandStarting(HgAction))); | 72 this, SLOT(commandStarting(HgAction))); |
| 73 connect(runner, SIGNAL(commandCompleted(HgAction, QString)), | 73 connect(m_runner, SIGNAL(commandCompleted(HgAction, QString)), |
| 74 this, SLOT(commandCompleted(HgAction, QString))); | 74 this, SLOT(commandCompleted(HgAction, QString))); |
| 75 connect(runner, SIGNAL(commandFailed(HgAction, QString)), | 75 connect(m_runner, SIGNAL(commandFailed(HgAction, QString)), |
| 76 this, SLOT(commandFailed(HgAction, QString))); | 76 this, SLOT(commandFailed(HgAction, QString))); |
| 77 statusBar()->addPermanentWidget(runner); | 77 statusBar()->addPermanentWidget(m_runner); |
| 78 | 78 |
| 79 setWindowTitle(tr("EasyMercurial")); | 79 setWindowTitle(tr("EasyMercurial")); |
| 80 | 80 |
| 81 remoteRepoPath = ""; | 81 m_remoteRepoPath = ""; |
| 82 workFolderPath = ""; | 82 m_workFolderPath = ""; |
| 83 | 83 |
| 84 readSettings(); | 84 readSettings(); |
| 85 | 85 |
| 86 justMerged = false; | 86 m_justMerged = false; |
| 87 | 87 |
| 88 QWidget *central = new QWidget(this); | 88 QWidget *central = new QWidget(this); |
| 89 setCentralWidget(central); | 89 setCentralWidget(central); |
| 90 | 90 |
| 91 hgTabs = new HgTabWidget(central, remoteRepoPath, workFolderPath); | 91 m_hgTabs = new HgTabWidget(central, m_remoteRepoPath, m_workFolderPath); |
| 92 connectTabsSignals(); | 92 connectTabsSignals(); |
| 93 | 93 |
| 94 // Instead of setting the tab widget as our central widget | 94 // Instead of setting the tab widget as our central widget |
| 95 // directly, put it in a layout, so that we can have some space | 95 // directly, put it in a layout, so that we can have some space |
| 96 // around it on the Mac where it looks very strange without | 96 // around it on the Mac where it looks very strange without |
| 97 | 97 |
| 98 QGridLayout *cl = new QGridLayout(central); | 98 QGridLayout *cl = new QGridLayout(central); |
| 99 cl->addWidget(hgTabs, 0, 0); | 99 cl->addWidget(m_hgTabs, 0, 0); |
| 100 | 100 |
| 101 #ifndef Q_OS_MAC | 101 #ifndef Q_OS_MAC |
| 102 cl->setMargin(0); | 102 cl->setMargin(0); |
| 103 #endif | 103 #endif |
| 104 | 104 |
| 105 connect(hgTabs, SIGNAL(selectionChanged()), | 105 connect(m_hgTabs, SIGNAL(selectionChanged()), |
| 106 this, SLOT(enableDisableActions())); | 106 this, SLOT(enableDisableActions())); |
| 107 connect(hgTabs, SIGNAL(showAllChanged(bool)), | 107 connect(m_hgTabs, SIGNAL(showAllChanged(bool)), |
| 108 this, SLOT(showAllChanged(bool))); | 108 this, SLOT(showAllChanged(bool))); |
| 109 | 109 |
| 110 setUnifiedTitleAndToolBarOnMac(true); | 110 setUnifiedTitleAndToolBarOnMac(true); |
| 111 connectActions(); | 111 connectActions(); |
| 112 clearState(); | 112 clearState(); |
| 113 enableDisableActions(); | 113 enableDisableActions(); |
| 114 | 114 |
| 115 if (firstStart) { | 115 if (m_firstStart) { |
| 116 startupDialog(); | 116 startupDialog(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 SettingsDialog::findDefaultLocations(m_myDirPath); | 119 SettingsDialog::findDefaultLocations(m_myDirPath); |
| 120 | 120 |
| 129 | 129 |
| 130 | 130 |
| 131 void MainWindow::closeEvent(QCloseEvent *) | 131 void MainWindow::closeEvent(QCloseEvent *) |
| 132 { | 132 { |
| 133 writeSettings(); | 133 writeSettings(); |
| 134 delete fsWatcher; | 134 delete m_fsWatcher; |
| 135 } | 135 } |
| 136 | 136 |
| 137 | 137 |
| 138 QString MainWindow::getUserInfo() const | 138 QString MainWindow::getUserInfo() const |
| 139 { | 139 { |
| 193 ).arg(EASYHG_VERSION)); | 193 ).arg(EASYHG_VERSION)); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void MainWindow::clearSelections() | 196 void MainWindow::clearSelections() |
| 197 { | 197 { |
| 198 hgTabs->clearSelections(); | 198 m_hgTabs->clearSelections(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void MainWindow::showAllChanged(bool s) | 201 void MainWindow::showAllChanged(bool s) |
| 202 { | 202 { |
| 203 showAllFiles = s; | 203 m_showAllFiles = s; |
| 204 hgQueryPaths(); | 204 hgQueryPaths(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void MainWindow::hgRefresh() | 207 void MainWindow::hgRefresh() |
| 208 { | 208 { |
| 214 { | 214 { |
| 215 QStringList params; | 215 QStringList params; |
| 216 //!!! should we test version output? Really we want at least 1.7.x | 216 //!!! should we test version output? Really we want at least 1.7.x |
| 217 //!!! for options such as merge --tool | 217 //!!! for options such as merge --tool |
| 218 params << "--version"; | 218 params << "--version"; |
| 219 runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params)); | 219 m_runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params)); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void MainWindow::hgTestExtension() | 222 void MainWindow::hgTestExtension() |
| 223 { | 223 { |
| 224 QStringList params; | 224 QStringList params; |
| 225 params << "--version"; | 225 params << "--version"; |
| 226 runner->requestAction(HgAction(ACT_TEST_HG_EXT, m_myDirPath, params)); | 226 m_runner->requestAction(HgAction(ACT_TEST_HG_EXT, m_myDirPath, params)); |
| 227 } | 227 } |
| 228 | 228 |
| 229 void MainWindow::hgStat() | 229 void MainWindow::hgStat() |
| 230 { | 230 { |
| 231 QStringList params; | 231 QStringList params; |
| 232 | 232 |
| 233 if (showAllFiles) { | 233 if (m_showAllFiles) { |
| 234 params << "stat" << "-A"; | 234 params << "stat" << "-A"; |
| 235 } else { | 235 } else { |
| 236 params << "stat" << "-ardum"; | 236 params << "stat" << "-ardum"; |
| 237 } | 237 } |
| 238 | 238 |
| 239 lastStatOutput = ""; | 239 m_lastStatOutput = ""; |
| 240 | 240 |
| 241 runner->requestAction(HgAction(ACT_STAT, workFolderPath, params)); | 241 m_runner->requestAction(HgAction(ACT_STAT, m_workFolderPath, params)); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void MainWindow::hgQueryPaths() | 244 void MainWindow::hgQueryPaths() |
| 245 { | 245 { |
| 246 // Quickest is to just read the file | 246 // Quickest is to just read the file |
| 247 | 247 |
| 248 QFileInfo hgrc(workFolderPath + "/.hg/hgrc"); | 248 QFileInfo hgrc(m_workFolderPath + "/.hg/hgrc"); |
| 249 | 249 |
| 250 QString path; | 250 QString path; |
| 251 | 251 |
| 252 if (hgrc.exists()) { | 252 if (hgrc.exists()) { |
| 253 QSettings s(hgrc.canonicalFilePath(), QSettings::IniFormat); | 253 QSettings s(hgrc.canonicalFilePath(), QSettings::IniFormat); |
| 254 s.beginGroup("paths"); | 254 s.beginGroup("paths"); |
| 255 path = s.value("default").toString(); | 255 path = s.value("default").toString(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 remoteRepoPath = path; | 258 m_remoteRepoPath = path; |
| 259 | 259 |
| 260 // We have to do this here, because commandCompleted won't be called | 260 // We have to do this here, because commandCompleted won't be called |
| 261 MultiChoiceDialog::addRecentArgument("local", workFolderPath); | 261 MultiChoiceDialog::addRecentArgument("local", m_workFolderPath); |
| 262 MultiChoiceDialog::addRecentArgument("remote", remoteRepoPath); | 262 MultiChoiceDialog::addRecentArgument("remote", m_remoteRepoPath); |
| 263 hgTabs->setWorkFolderAndRepoNames(workFolderPath, remoteRepoPath); | 263 m_hgTabs->setWorkFolderAndRepoNames(m_workFolderPath, m_remoteRepoPath); |
| 264 | 264 |
| 265 hgQueryBranch(); | 265 hgQueryBranch(); |
| 266 return; | 266 return; |
| 267 | 267 |
| 268 /* The classic method! | 268 /* The classic method! |
| 269 | 269 |
| 270 QStringList params; | 270 QStringList params; |
| 271 params << "paths"; | 271 params << "paths"; |
| 272 runner->requestAction(HgAction(ACT_QUERY_PATHS, workFolderPath, params)); | 272 m_runner->requestAction(HgAction(ACT_QUERY_PATHS, m_workFolderPath, params)); |
| 273 */ | 273 */ |
| 274 } | 274 } |
| 275 | 275 |
| 276 void MainWindow::hgQueryBranch() | 276 void MainWindow::hgQueryBranch() |
| 277 { | 277 { |
| 278 // Quickest is to just read the file | 278 // Quickest is to just read the file |
| 279 | 279 |
| 280 QFile hgbr(workFolderPath + "/.hg/branch"); | 280 QFile hgbr(m_workFolderPath + "/.hg/branch"); |
| 281 | 281 |
| 282 QString br = "default"; | 282 QString br = "default"; |
| 283 | 283 |
| 284 if (hgbr.exists() && hgbr.open(QFile::ReadOnly)) { | 284 if (hgbr.exists() && hgbr.open(QFile::ReadOnly)) { |
| 285 QByteArray ba = hgbr.readLine(); | 285 QByteArray ba = hgbr.readLine(); |
| 286 br = QString::fromUtf8(ba).trimmed(); | 286 br = QString::fromUtf8(ba).trimmed(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 currentBranch = br; | 289 m_currentBranch = br; |
| 290 | 290 |
| 291 // We have to do this here, because commandCompleted won't be called | 291 // We have to do this here, because commandCompleted won't be called |
| 292 hgStat(); | 292 hgStat(); |
| 293 return; | 293 return; |
| 294 | 294 |
| 295 /* The classic method! | 295 /* The classic method! |
| 296 | 296 |
| 297 QStringList params; | 297 QStringList params; |
| 298 params << "branch"; | 298 params << "branch"; |
| 299 runner->requestAction(HgAction(ACT_QUERY_BRANCH, workFolderPath, params)); | 299 m_runner->requestAction(HgAction(ACT_QUERY_BRANCH, m_workFolderPath, params)); |
| 300 */ | 300 */ |
| 301 } | 301 } |
| 302 | 302 |
| 303 void MainWindow::hgQueryHeads() | 303 void MainWindow::hgQueryHeads() |
| 304 { | 304 { |
| 307 // that. Use --closed option so as to include closed branches; | 307 // that. Use --closed option so as to include closed branches; |
| 308 // otherwise we'll be stuck if the user updates into one, and our | 308 // otherwise we'll be stuck if the user updates into one, and our |
| 309 // incremental log will end up with spurious stuff in it because | 309 // incremental log will end up with spurious stuff in it because |
| 310 // we won't be pruning at the ends of closed branches | 310 // we won't be pruning at the ends of closed branches |
| 311 params << "heads" << "--closed"; | 311 params << "heads" << "--closed"; |
| 312 runner->requestAction(HgAction(ACT_QUERY_HEADS, workFolderPath, params)); | 312 m_runner->requestAction(HgAction(ACT_QUERY_HEADS, m_workFolderPath, params)); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void MainWindow::hgLog() | 315 void MainWindow::hgLog() |
| 316 { | 316 { |
| 317 QStringList params; | 317 QStringList params; |
| 318 params << "log"; | 318 params << "log"; |
| 319 params << "--template"; | 319 params << "--template"; |
| 320 params << Changeset::getLogTemplate(); | 320 params << Changeset::getLogTemplate(); |
| 321 | 321 |
| 322 runner->requestAction(HgAction(ACT_LOG, workFolderPath, params)); | 322 m_runner->requestAction(HgAction(ACT_LOG, m_workFolderPath, params)); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void MainWindow::hgLogIncremental(QStringList prune) | 325 void MainWindow::hgLogIncremental(QStringList prune) |
| 326 { | 326 { |
| 327 QStringList params; | 327 QStringList params; |
| 332 } | 332 } |
| 333 | 333 |
| 334 params << "--template"; | 334 params << "--template"; |
| 335 params << Changeset::getLogTemplate(); | 335 params << Changeset::getLogTemplate(); |
| 336 | 336 |
| 337 runner->requestAction(HgAction(ACT_LOG_INCREMENTAL, workFolderPath, params)); | 337 m_runner->requestAction(HgAction(ACT_LOG_INCREMENTAL, m_workFolderPath, params)); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void MainWindow::hgQueryParents() | 340 void MainWindow::hgQueryParents() |
| 341 { | 341 { |
| 342 QStringList params; | 342 QStringList params; |
| 343 params << "parents"; | 343 params << "parents"; |
| 344 runner->requestAction(HgAction(ACT_QUERY_PARENTS, workFolderPath, params)); | 344 m_runner->requestAction(HgAction(ACT_QUERY_PARENTS, m_workFolderPath, params)); |
| 345 } | 345 } |
| 346 | 346 |
| 347 void MainWindow::hgAnnotate() | 347 void MainWindow::hgAnnotate() |
| 348 { | 348 { |
| 349 QStringList params; | 349 QStringList params; |
| 350 QString currentFile;//!!! = hgTabs -> getCurrentFileListLine(); | 350 QString currentFile;//!!! = m_hgTabs -> getCurrentFileListLine(); |
| 351 | 351 |
| 352 if (!currentFile.isEmpty()) | 352 if (!currentFile.isEmpty()) |
| 353 { | 353 { |
| 354 params << "annotate" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") | 354 params << "annotate" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") |
| 355 | 355 |
| 356 runner->requestAction(HgAction(ACT_ANNOTATE, workFolderPath, params)); | 356 m_runner->requestAction(HgAction(ACT_ANNOTATE, m_workFolderPath, params)); |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 void MainWindow::hgResolveList() | 360 void MainWindow::hgResolveList() |
| 361 { | 361 { |
| 362 QStringList params; | 362 QStringList params; |
| 363 | 363 |
| 364 params << "resolve" << "--list"; | 364 params << "resolve" << "--list"; |
| 365 runner->requestAction(HgAction(ACT_RESOLVE_LIST, workFolderPath, params)); | 365 m_runner->requestAction(HgAction(ACT_RESOLVE_LIST, m_workFolderPath, params)); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void MainWindow::hgAdd() | 368 void MainWindow::hgAdd() |
| 369 { | 369 { |
| 370 QStringList params; | 370 QStringList params; |
| 371 | 371 |
| 372 // hgExplorer permitted adding "all" files -- I'm not sure | 372 // hgExplorer permitted adding "all" files -- I'm not sure |
| 373 // that one is a good idea, let's require the user to select | 373 // that one is a good idea, let's require the user to select |
| 374 | 374 |
| 375 QStringList files = hgTabs->getSelectedAddableFiles(); | 375 QStringList files = m_hgTabs->getSelectedAddableFiles(); |
| 376 | 376 |
| 377 if (!files.empty()) { | 377 if (!files.empty()) { |
| 378 params << "add" << "--" << files; | 378 params << "add" << "--" << files; |
| 379 runner->requestAction(HgAction(ACT_ADD, workFolderPath, params)); | 379 m_runner->requestAction(HgAction(ACT_ADD, m_workFolderPath, params)); |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 | 383 |
| 384 void MainWindow::hgRemove() | 384 void MainWindow::hgRemove() |
| 385 { | 385 { |
| 386 QStringList params; | 386 QStringList params; |
| 387 | 387 |
| 388 QStringList files = hgTabs->getSelectedRemovableFiles(); | 388 QStringList files = m_hgTabs->getSelectedRemovableFiles(); |
| 389 | 389 |
| 390 if (!files.empty()) { | 390 if (!files.empty()) { |
| 391 params << "remove" << "--after" << "--force" << "--" << files; | 391 params << "remove" << "--after" << "--force" << "--" << files; |
| 392 runner->requestAction(HgAction(ACT_REMOVE, workFolderPath, params)); | 392 m_runner->requestAction(HgAction(ACT_REMOVE, m_workFolderPath, params)); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 | 395 |
| 396 void MainWindow::hgCommit() | 396 void MainWindow::hgCommit() |
| 397 { | 397 { |
| 398 QStringList params; | 398 QStringList params; |
| 399 QString comment; | 399 QString comment; |
| 400 | 400 |
| 401 if (justMerged) { | 401 if (m_justMerged) { |
| 402 comment = mergeCommitComment; | 402 comment = m_mergeCommitComment; |
| 403 } | 403 } |
| 404 | 404 |
| 405 QStringList files = hgTabs->getSelectedCommittableFiles(); | 405 QStringList files = m_hgTabs->getSelectedCommittableFiles(); |
| 406 QStringList allFiles = hgTabs->getAllCommittableFiles(); | 406 QStringList allFiles = m_hgTabs->getAllCommittableFiles(); |
| 407 QStringList reportFiles = files; | 407 QStringList reportFiles = files; |
| 408 if (reportFiles.empty()) { | 408 if (reportFiles.empty()) { |
| 409 reportFiles = allFiles; | 409 reportFiles = allFiles; |
| 410 } | 410 } |
| 411 | 411 |
| 427 .arg(subsetNote), | 427 .arg(subsetNote), |
| 428 reportFiles, | 428 reportFiles, |
| 429 comment, | 429 comment, |
| 430 tr("Commit"))) { | 430 tr("Commit"))) { |
| 431 | 431 |
| 432 if (!justMerged && !files.empty()) { | 432 if (!m_justMerged && !files.empty()) { |
| 433 // User wants to commit selected file(s) (and this is not | 433 // User wants to commit selected file(s) (and this is not |
| 434 // merge commit, which would fail if we selected files) | 434 // merge commit, which would fail if we selected files) |
| 435 params << "commit" << "--message" << comment | 435 params << "commit" << "--message" << comment |
| 436 << "--user" << getUserInfo() << "--" << files; | 436 << "--user" << getUserInfo() << "--" << files; |
| 437 } else { | 437 } else { |
| 438 // Commit all changes | 438 // Commit all changes |
| 439 params << "commit" << "--message" << comment | 439 params << "commit" << "--message" << comment |
| 440 << "--user" << getUserInfo(); | 440 << "--user" << getUserInfo(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 runner->requestAction(HgAction(ACT_COMMIT, workFolderPath, params)); | 443 m_runner->requestAction(HgAction(ACT_COMMIT, m_workFolderPath, params)); |
| 444 mergeCommitComment = ""; | 444 m_mergeCommitComment = ""; |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 QString MainWindow::filterTag(QString tag) | 448 QString MainWindow::filterTag(QString tag) |
| 449 { | 449 { |
| 476 if (!tag.isEmpty()) {//!!! do something better if it is empty | 476 if (!tag.isEmpty()) {//!!! do something better if it is empty |
| 477 | 477 |
| 478 params << "tag" << "--user" << getUserInfo(); | 478 params << "tag" << "--user" << getUserInfo(); |
| 479 params << "--rev" << Changeset::hashOf(id) << filterTag(tag); | 479 params << "--rev" << Changeset::hashOf(id) << filterTag(tag); |
| 480 | 480 |
| 481 runner->requestAction(HgAction(ACT_TAG, workFolderPath, params)); | 481 m_runner->requestAction(HgAction(ACT_TAG, m_workFolderPath, params)); |
| 482 } | 482 } |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 | 486 |
| 487 void MainWindow::hgIgnore() | 487 void MainWindow::hgIgnore() |
| 488 { | 488 { |
| 489 QString hgIgnorePath; | 489 QString hgIgnorePath; |
| 490 QStringList params; | 490 QStringList params; |
| 491 | 491 |
| 492 hgIgnorePath = workFolderPath; | 492 hgIgnorePath = m_workFolderPath; |
| 493 hgIgnorePath += "/.hgignore"; | 493 hgIgnorePath += "/.hgignore"; |
| 494 | 494 |
| 495 if (!QDir(workFolderPath).exists()) return; | 495 if (!QDir(m_workFolderPath).exists()) return; |
| 496 QFile f(hgIgnorePath); | 496 QFile f(hgIgnorePath); |
| 497 if (!f.exists()) { | 497 if (!f.exists()) { |
| 498 f.open(QFile::WriteOnly); | 498 f.open(QFile::WriteOnly); |
| 499 QTextStream *ts = new QTextStream(&f); | 499 QTextStream *ts = new QTextStream(&f); |
| 500 *ts << "syntax: glob\n"; | 500 *ts << "syntax: glob\n"; |
| 510 DEBUG << "Failed to find a text editor" << endl; | 510 DEBUG << "Failed to find a text editor" << endl; |
| 511 //!!! visible error! | 511 //!!! visible error! |
| 512 return; | 512 return; |
| 513 } | 513 } |
| 514 | 514 |
| 515 HgAction action(ACT_HG_IGNORE, workFolderPath, params); | 515 HgAction action(ACT_HG_IGNORE, m_workFolderPath, params); |
| 516 action.executable = editor; | 516 action.executable = editor; |
| 517 | 517 |
| 518 runner->requestAction(action); | 518 m_runner->requestAction(action); |
| 519 } | 519 } |
| 520 | 520 |
| 521 QString MainWindow::getDiffBinaryName() | 521 QString MainWindow::getDiffBinaryName() |
| 522 { | 522 { |
| 523 QSettings settings; | 523 QSettings settings; |
| 543 { | 543 { |
| 544 QStringList params; | 544 QStringList params; |
| 545 | 545 |
| 546 params << "diff" << "--stat"; | 546 params << "diff" << "--stat"; |
| 547 | 547 |
| 548 runner->requestAction(HgAction(ACT_DIFF_SUMMARY, workFolderPath, params)); | 548 m_runner->requestAction(HgAction(ACT_DIFF_SUMMARY, m_workFolderPath, params)); |
| 549 } | 549 } |
| 550 | 550 |
| 551 void MainWindow::hgFolderDiff() | 551 void MainWindow::hgFolderDiff() |
| 552 { | 552 { |
| 553 QString diff = getDiffBinaryName(); | 553 QString diff = getDiffBinaryName(); |
| 558 // Diff parent against working folder (folder diff) | 558 // Diff parent against working folder (folder diff) |
| 559 | 559 |
| 560 params << "--config" << "extensions.extdiff=" << "extdiff"; | 560 params << "--config" << "extensions.extdiff=" << "extdiff"; |
| 561 params << "--program" << diff; | 561 params << "--program" << diff; |
| 562 | 562 |
| 563 params << hgTabs->getSelectedCommittableFiles(); // may be none: whole dir | 563 params << m_hgTabs->getSelectedCommittableFiles(); // may be none: whole dir |
| 564 | 564 |
| 565 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params)); | 565 m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); |
| 566 } | 566 } |
| 567 | 567 |
| 568 | 568 |
| 569 void MainWindow::hgDiffToCurrent(QString id) | 569 void MainWindow::hgDiffToCurrent(QString id) |
| 570 { | 570 { |
| 577 | 577 |
| 578 params << "--config" << "extensions.extdiff=" << "extdiff"; | 578 params << "--config" << "extensions.extdiff=" << "extdiff"; |
| 579 params << "--program" << diff; | 579 params << "--program" << diff; |
| 580 params << "--rev" << Changeset::hashOf(id); | 580 params << "--rev" << Changeset::hashOf(id); |
| 581 | 581 |
| 582 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params)); | 582 m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); |
| 583 } | 583 } |
| 584 | 584 |
| 585 | 585 |
| 586 void MainWindow::hgDiffToParent(QString child, QString parent) | 586 void MainWindow::hgDiffToParent(QString child, QString parent) |
| 587 { | 587 { |
| 595 params << "--config" << "extensions.extdiff=" << "extdiff"; | 595 params << "--config" << "extensions.extdiff=" << "extdiff"; |
| 596 params << "--program" << diff; | 596 params << "--program" << diff; |
| 597 params << "--rev" << Changeset::hashOf(parent) | 597 params << "--rev" << Changeset::hashOf(parent) |
| 598 << "--rev" << Changeset::hashOf(child); | 598 << "--rev" << Changeset::hashOf(child); |
| 599 | 599 |
| 600 runner->requestAction(HgAction(ACT_CHGSETDIFF, workFolderPath, params)); | 600 m_runner->requestAction(HgAction(ACT_CHGSETDIFF, m_workFolderPath, params)); |
| 601 } | 601 } |
| 602 | 602 |
| 603 | 603 |
| 604 void MainWindow::hgUpdate() | 604 void MainWindow::hgUpdate() |
| 605 { | 605 { |
| 606 QStringList params; | 606 QStringList params; |
| 607 | 607 |
| 608 params << "update"; | 608 params << "update"; |
| 609 | 609 |
| 610 runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params)); | 610 m_runner->requestAction(HgAction(ACT_UPDATE, m_workFolderPath, params)); |
| 611 } | 611 } |
| 612 | 612 |
| 613 | 613 |
| 614 void MainWindow::hgUpdateToRev(QString id) | 614 void MainWindow::hgUpdateToRev(QString id) |
| 615 { | 615 { |
| 616 QStringList params; | 616 QStringList params; |
| 617 | 617 |
| 618 params << "update" << "--rev" << Changeset::hashOf(id) << "--check"; | 618 params << "update" << "--rev" << Changeset::hashOf(id) << "--check"; |
| 619 | 619 |
| 620 runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params)); | 620 m_runner->requestAction(HgAction(ACT_UPDATE, m_workFolderPath, params)); |
| 621 } | 621 } |
| 622 | 622 |
| 623 | 623 |
| 624 void MainWindow::hgRevert() | 624 void MainWindow::hgRevert() |
| 625 { | 625 { |
| 626 QStringList params; | 626 QStringList params; |
| 627 QString comment; | 627 QString comment; |
| 628 bool all = false; | 628 bool all = false; |
| 629 | 629 |
| 630 QStringList files = hgTabs->getSelectedRevertableFiles(); | 630 QStringList files = m_hgTabs->getSelectedRevertableFiles(); |
| 631 QStringList allFiles = hgTabs->getAllRevertableFiles(); | 631 QStringList allFiles = m_hgTabs->getAllRevertableFiles(); |
| 632 if (files.empty() || files == allFiles) { | 632 if (files.empty() || files == allFiles) { |
| 633 files = allFiles; | 633 files = allFiles; |
| 634 all = true; | 634 all = true; |
| 635 } | 635 } |
| 636 | 636 |
| 642 QString rf(tr("Revert files")); | 642 QString rf(tr("Revert files")); |
| 643 | 643 |
| 644 // Set up params before asking for confirmation, because there is | 644 // Set up params before asking for confirmation, because there is |
| 645 // a failure case here that we would need to report on early | 645 // a failure case here that we would need to report on early |
| 646 | 646 |
| 647 DEBUG << "hgRevert: justMerged = " << justMerged << ", mergeTargetRevision = " << mergeTargetRevision << endl; | 647 DEBUG << "hgRevert: m_justMerged = " << m_justMerged << ", m_mergeTargetRevision = " << m_mergeTargetRevision << endl; |
| 648 | 648 |
| 649 if (justMerged) { | 649 if (m_justMerged) { |
| 650 | 650 |
| 651 // This is a little fiddly. The proper way to "revert" the | 651 // This is a little fiddly. The proper way to "revert" the |
| 652 // whole of an uncommitted merge is with "hg update --clean ." | 652 // whole of an uncommitted merge is with "hg update --clean ." |
| 653 // But if the user has selected only some files, we're sort of | 653 // But if the user has selected only some files, we're sort of |
| 654 // promising to revert only those, which means we need to | 654 // promising to revert only those, which means we need to |
| 658 // restarted, or changed repository, since then. Hmmm. | 658 // restarted, or changed repository, since then. Hmmm. |
| 659 | 659 |
| 660 if (all) { | 660 if (all) { |
| 661 params << "update" << "--clean" << "."; | 661 params << "update" << "--clean" << "."; |
| 662 } else { | 662 } else { |
| 663 if (mergeTargetRevision != "") { | 663 if (m_mergeTargetRevision != "") { |
| 664 params << "revert" << "--rev" | 664 params << "revert" << "--rev" |
| 665 << Changeset::hashOf(mergeTargetRevision) | 665 << Changeset::hashOf(m_mergeTargetRevision) |
| 666 << "--" << files; | 666 << "--" << files; |
| 667 } else { | 667 } else { |
| 668 QMessageBox::information | 668 QMessageBox::information |
| 669 (this, tr("Unable to revert"), | 669 (this, tr("Unable to revert"), |
| 670 tr("<qt><b>Sorry, unable to revert these files</b><br><br>EasyMercurial can only revert a subset of files during a merge if it still has a record of which parent was the original merge target; that information is no longer available.<br><br>This is a limitation of EasyMercurial. Consider reverting all files, or using hg revert with a specific revision at the command-line instead.</qt>")); | 670 tr("<qt><b>Sorry, unable to revert these files</b><br><br>EasyMercurial can only revert a subset of files during a merge if it still has a record of which parent was the original merge target; that information is no longer available.<br><br>This is a limitation of EasyMercurial. Consider reverting all files, or using hg revert with a specific revision at the command-line instead.</qt>")); |
| 685 .arg(tr("You are about to <b>revert</b> %n file(s).<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed.", "", files.size())) | 685 .arg(tr("You are about to <b>revert</b> %n file(s).<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed.", "", files.size())) |
| 686 .arg(subsetNote), | 686 .arg(subsetNote), |
| 687 files, | 687 files, |
| 688 tr("Revert"))) { | 688 tr("Revert"))) { |
| 689 | 689 |
| 690 lastRevertedFiles = files; | 690 m_lastRevertedFiles = files; |
| 691 | 691 |
| 692 runner->requestAction(HgAction(ACT_REVERT, workFolderPath, params)); | 692 m_runner->requestAction(HgAction(ACT_REVERT, m_workFolderPath, params)); |
| 693 } | 693 } |
| 694 } | 694 } |
| 695 | 695 |
| 696 | 696 |
| 697 void MainWindow::hgMarkResolved(QStringList files) | 697 void MainWindow::hgMarkResolved(QStringList files) |
| 704 params << "--all"; | 704 params << "--all"; |
| 705 } else { | 705 } else { |
| 706 params << "--" << files; | 706 params << "--" << files; |
| 707 } | 707 } |
| 708 | 708 |
| 709 runner->requestAction(HgAction(ACT_RESOLVE_MARK, workFolderPath, params)); | 709 m_runner->requestAction(HgAction(ACT_RESOLVE_MARK, m_workFolderPath, params)); |
| 710 } | 710 } |
| 711 | 711 |
| 712 | 712 |
| 713 void MainWindow::hgRetryMerge() | 713 void MainWindow::hgRetryMerge() |
| 714 { | 714 { |
| 719 QString merge = getMergeBinaryName(); | 719 QString merge = getMergeBinaryName(); |
| 720 if (merge != "") { | 720 if (merge != "") { |
| 721 params << "--tool" << merge; | 721 params << "--tool" << merge; |
| 722 } | 722 } |
| 723 | 723 |
| 724 QStringList files = hgTabs->getSelectedUnresolvedFiles(); | 724 QStringList files = m_hgTabs->getSelectedUnresolvedFiles(); |
| 725 if (files.empty()) { | 725 if (files.empty()) { |
| 726 params << "--all"; | 726 params << "--all"; |
| 727 } else { | 727 } else { |
| 728 params << "--" << files; | 728 params << "--" << files; |
| 729 } | 729 } |
| 730 | 730 |
| 731 if (currentParents.size() == 1) { | 731 if (m_currentParents.size() == 1) { |
| 732 mergeTargetRevision = currentParents[0]->id(); | 732 m_mergeTargetRevision = m_currentParents[0]->id(); |
| 733 } | 733 } |
| 734 | 734 |
| 735 runner->requestAction(HgAction(ACT_RETRY_MERGE, workFolderPath, params)); | 735 m_runner->requestAction(HgAction(ACT_RETRY_MERGE, m_workFolderPath, params)); |
| 736 | 736 |
| 737 mergeCommitComment = tr("Merge"); | 737 m_mergeCommitComment = tr("Merge"); |
| 738 } | 738 } |
| 739 | 739 |
| 740 | 740 |
| 741 void MainWindow::hgMerge() | 741 void MainWindow::hgMerge() |
| 742 { | 742 { |
| 743 if (hgTabs->canResolve()) { | 743 if (m_hgTabs->canResolve()) { |
| 744 hgRetryMerge(); | 744 hgRetryMerge(); |
| 745 return; | 745 return; |
| 746 } | 746 } |
| 747 | 747 |
| 748 QStringList params; | 748 QStringList params; |
| 752 QString merge = getMergeBinaryName(); | 752 QString merge = getMergeBinaryName(); |
| 753 if (merge != "") { | 753 if (merge != "") { |
| 754 params << "--tool" << merge; | 754 params << "--tool" << merge; |
| 755 } | 755 } |
| 756 | 756 |
| 757 if (currentParents.size() == 1) { | 757 if (m_currentParents.size() == 1) { |
| 758 mergeTargetRevision = currentParents[0]->id(); | 758 m_mergeTargetRevision = m_currentParents[0]->id(); |
| 759 } | 759 } |
| 760 | 760 |
| 761 runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params)); | 761 m_runner->requestAction(HgAction(ACT_MERGE, m_workFolderPath, params)); |
| 762 | 762 |
| 763 mergeCommitComment = tr("Merge"); | 763 m_mergeCommitComment = tr("Merge"); |
| 764 } | 764 } |
| 765 | 765 |
| 766 | 766 |
| 767 void MainWindow::hgMergeFrom(QString id) | 767 void MainWindow::hgMergeFrom(QString id) |
| 768 { | 768 { |
| 774 QString merge = getMergeBinaryName(); | 774 QString merge = getMergeBinaryName(); |
| 775 if (merge != "") { | 775 if (merge != "") { |
| 776 params << "--tool" << merge; | 776 params << "--tool" << merge; |
| 777 } | 777 } |
| 778 | 778 |
| 779 if (currentParents.size() == 1) { | 779 if (m_currentParents.size() == 1) { |
| 780 mergeTargetRevision = currentParents[0]->id(); | 780 m_mergeTargetRevision = m_currentParents[0]->id(); |
| 781 } | 781 } |
| 782 | 782 |
| 783 runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params)); | 783 m_runner->requestAction(HgAction(ACT_MERGE, m_workFolderPath, params)); |
| 784 | 784 |
| 785 mergeCommitComment = ""; | 785 m_mergeCommitComment = ""; |
| 786 | 786 |
| 787 foreach (Changeset *cs, currentHeads) { | 787 foreach (Changeset *cs, m_currentHeads) { |
| 788 if (cs->id() == id && !cs->isOnBranch(currentBranch)) { | 788 if (cs->id() == id && !cs->isOnBranch(m_currentBranch)) { |
| 789 if (cs->branch() == "" || cs->branch() == "default") { | 789 if (cs->branch() == "" || cs->branch() == "default") { |
| 790 mergeCommitComment = tr("Merge from the default branch"); | 790 m_mergeCommitComment = tr("Merge from the default branch"); |
| 791 } else { | 791 } else { |
| 792 mergeCommitComment = tr("Merge from branch \"%1\"").arg(cs->branch()); | 792 m_mergeCommitComment = tr("Merge from branch \"%1\"").arg(cs->branch()); |
| 793 } | 793 } |
| 794 } | 794 } |
| 795 } | 795 } |
| 796 | 796 |
| 797 if (mergeCommitComment == "") { | 797 if (m_mergeCommitComment == "") { |
| 798 mergeCommitComment = tr("Merge from %1").arg(id); | 798 m_mergeCommitComment = tr("Merge from %1").arg(id); |
| 799 } | 799 } |
| 800 } | 800 } |
| 801 | 801 |
| 802 | 802 |
| 803 void MainWindow::hgCloneFromRemote() | 803 void MainWindow::hgCloneFromRemote() |
| 804 { | 804 { |
| 805 QStringList params; | 805 QStringList params; |
| 806 | 806 |
| 807 if (!QDir(workFolderPath).exists()) { | 807 if (!QDir(m_workFolderPath).exists()) { |
| 808 if (!QDir().mkpath(workFolderPath)) { | 808 if (!QDir().mkpath(m_workFolderPath)) { |
| 809 DEBUG << "hgCloneFromRemote: Failed to create target path " | 809 DEBUG << "hgCloneFromRemote: Failed to create target path " |
| 810 << workFolderPath << endl; | 810 << m_workFolderPath << endl; |
| 811 //!!! report error | 811 //!!! report error |
| 812 return; | 812 return; |
| 813 } | 813 } |
| 814 } | 814 } |
| 815 | 815 |
| 816 params << "clone" << remoteRepoPath << workFolderPath; | 816 params << "clone" << m_remoteRepoPath << m_workFolderPath; |
| 817 | 817 |
| 818 hgTabs->setWorkFolderAndRepoNames(workFolderPath, remoteRepoPath); | 818 m_hgTabs->setWorkFolderAndRepoNames(m_workFolderPath, m_remoteRepoPath); |
| 819 hgTabs->updateWorkFolderFileList(""); | 819 m_hgTabs->updateWorkFolderFileList(""); |
| 820 | 820 |
| 821 runner->requestAction(HgAction(ACT_CLONEFROMREMOTE, workFolderPath, params)); | 821 m_runner->requestAction(HgAction(ACT_CLONEFROMREMOTE, m_workFolderPath, params)); |
| 822 } | 822 } |
| 823 | 823 |
| 824 void MainWindow::hgInit() | 824 void MainWindow::hgInit() |
| 825 { | 825 { |
| 826 QStringList params; | 826 QStringList params; |
| 827 | 827 |
| 828 params << "init"; | 828 params << "init"; |
| 829 params << workFolderPath; | 829 params << m_workFolderPath; |
| 830 | 830 |
| 831 runner->requestAction(HgAction(ACT_INIT, workFolderPath, params)); | 831 m_runner->requestAction(HgAction(ACT_INIT, m_workFolderPath, params)); |
| 832 } | 832 } |
| 833 | 833 |
| 834 void MainWindow::hgIncoming() | 834 void MainWindow::hgIncoming() |
| 835 { | 835 { |
| 836 QStringList params; | 836 QStringList params; |
| 837 | 837 |
| 838 params << "incoming" << "--newest-first" << remoteRepoPath; | 838 params << "incoming" << "--newest-first" << m_remoteRepoPath; |
| 839 params << "--template" << Changeset::getLogTemplate(); | 839 params << "--template" << Changeset::getLogTemplate(); |
| 840 | 840 |
| 841 runner->requestAction(HgAction(ACT_INCOMING, workFolderPath, params)); | 841 m_runner->requestAction(HgAction(ACT_INCOMING, m_workFolderPath, params)); |
| 842 } | 842 } |
| 843 | 843 |
| 844 void MainWindow::hgPull() | 844 void MainWindow::hgPull() |
| 845 { | 845 { |
| 846 if (ConfirmCommentDialog::confirm | 846 if (ConfirmCommentDialog::confirm |
| 847 (this, tr("Confirm pull"), | 847 (this, tr("Confirm pull"), |
| 848 format3(tr("Confirm pull from remote repository"), | 848 format3(tr("Confirm pull from remote repository"), |
| 849 tr("You are about to pull changes from the following remote repository:"), | 849 tr("You are about to pull changes from the following remote repository:"), |
| 850 remoteRepoPath), | 850 m_remoteRepoPath), |
| 851 tr("Pull"))) { | 851 tr("Pull"))) { |
| 852 | 852 |
| 853 QStringList params; | 853 QStringList params; |
| 854 params << "pull" << remoteRepoPath; | 854 params << "pull" << m_remoteRepoPath; |
| 855 runner->requestAction(HgAction(ACT_PULL, workFolderPath, params)); | 855 m_runner->requestAction(HgAction(ACT_PULL, m_workFolderPath, params)); |
| 856 } | 856 } |
| 857 } | 857 } |
| 858 | 858 |
| 859 void MainWindow::hgPush() | 859 void MainWindow::hgPush() |
| 860 { | 860 { |
| 861 if (ConfirmCommentDialog::confirm | 861 if (ConfirmCommentDialog::confirm |
| 862 (this, tr("Confirm push"), | 862 (this, tr("Confirm push"), |
| 863 format3(tr("Confirm push to remote repository"), | 863 format3(tr("Confirm push to remote repository"), |
| 864 tr("You are about to push your changes to the following remote repository:"), | 864 tr("You are about to push your changes to the following remote repository:"), |
| 865 remoteRepoPath), | 865 m_remoteRepoPath), |
| 866 tr("Push"))) { | 866 tr("Push"))) { |
| 867 | 867 |
| 868 QStringList params; | 868 QStringList params; |
| 869 params << "push" << "--new-branch" << remoteRepoPath; | 869 params << "push" << "--new-branch" << m_remoteRepoPath; |
| 870 runner->requestAction(HgAction(ACT_PUSH, workFolderPath, params)); | 870 m_runner->requestAction(HgAction(ACT_PUSH, m_workFolderPath, params)); |
| 871 } | 871 } |
| 872 } | 872 } |
| 873 | 873 |
| 874 QStringList MainWindow::listAllUpIpV4Addresses() | 874 QStringList MainWindow::listAllUpIpV4Addresses() |
| 875 { | 875 { |
| 891 return ret; | 891 return ret; |
| 892 } | 892 } |
| 893 | 893 |
| 894 void MainWindow::clearState() | 894 void MainWindow::clearState() |
| 895 { | 895 { |
| 896 foreach (Changeset *cs, currentParents) delete cs; | 896 foreach (Changeset *cs, m_currentParents) delete cs; |
| 897 currentParents.clear(); | 897 m_currentParents.clear(); |
| 898 foreach (Changeset *cs, currentHeads) delete cs; | 898 foreach (Changeset *cs, m_currentHeads) delete cs; |
| 899 currentHeads.clear(); | 899 m_currentHeads.clear(); |
| 900 currentBranch = ""; | 900 m_currentBranch = ""; |
| 901 lastStatOutput = ""; | 901 m_lastStatOutput = ""; |
| 902 lastRevertedFiles.clear(); | 902 m_lastRevertedFiles.clear(); |
| 903 mergeTargetRevision = ""; | 903 m_mergeTargetRevision = ""; |
| 904 mergeCommitComment = ""; | 904 m_mergeCommitComment = ""; |
| 905 stateUnknown = true; | 905 m_stateUnknown = true; |
| 906 needNewLog = true; | 906 m_needNewLog = true; |
| 907 if (fsWatcher) { | 907 if (m_fsWatcher) { |
| 908 delete m_fsWatcherGeneralTimer; | 908 delete m_fsWatcherGeneralTimer; |
| 909 m_fsWatcherGeneralTimer = 0; | 909 m_fsWatcherGeneralTimer = 0; |
| 910 delete m_fsWatcherRestoreTimer; | 910 delete m_fsWatcherRestoreTimer; |
| 911 m_fsWatcherRestoreTimer = 0; | 911 m_fsWatcherRestoreTimer = 0; |
| 912 delete fsWatcher; | 912 delete m_fsWatcher; |
| 913 fsWatcher = 0; | 913 m_fsWatcher = 0; |
| 914 } | 914 } |
| 915 } | 915 } |
| 916 | 916 |
| 917 void MainWindow::hgServe() | 917 void MainWindow::hgServe() |
| 918 { | 918 { |
| 938 ts << tr("<p>Press Close to stop the server and return.</p>"); | 938 ts << tr("<p>Press Close to stop the server and return.</p>"); |
| 939 ts.flush(); | 939 ts.flush(); |
| 940 | 940 |
| 941 params << "serve"; | 941 params << "serve"; |
| 942 | 942 |
| 943 runner->requestAction(HgAction(ACT_SERVE, workFolderPath, params)); | 943 m_runner->requestAction(HgAction(ACT_SERVE, m_workFolderPath, params)); |
| 944 | 944 |
| 945 QMessageBox::information(this, tr("Serve"), msg, QMessageBox::Close); | 945 QMessageBox::information(this, tr("Serve"), msg, QMessageBox::Close); |
| 946 | 946 |
| 947 runner->killCurrentActions(); | 947 m_runner->killCurrentActions(); |
| 948 } | 948 } |
| 949 | 949 |
| 950 void MainWindow::startupDialog() | 950 void MainWindow::startupDialog() |
| 951 { | 951 { |
| 952 StartupDialog *dlg = new StartupDialog(this); | 952 StartupDialog *dlg = new StartupDialog(this); |
| 953 if (dlg->exec()) firstStart = false; | 953 if (dlg->exec()) m_firstStart = false; |
| 954 } | 954 } |
| 955 | 955 |
| 956 void MainWindow::open() | 956 void MainWindow::open() |
| 957 { | 957 { |
| 958 bool done = false; | 958 bool done = false; |
| 1026 | 1026 |
| 1027 void MainWindow::changeRemoteRepo() | 1027 void MainWindow::changeRemoteRepo() |
| 1028 { | 1028 { |
| 1029 // This will involve rewriting the local .hgrc | 1029 // This will involve rewriting the local .hgrc |
| 1030 | 1030 |
| 1031 QDir hgDir(workFolderPath + "/.hg"); | 1031 QDir hgDir(m_workFolderPath + "/.hg"); |
| 1032 if (!hgDir.exists()) { | 1032 if (!hgDir.exists()) { |
| 1033 //!!! visible error! | 1033 //!!! visible error! |
| 1034 return; | 1034 return; |
| 1035 } | 1035 } |
| 1036 | 1036 |
| 1037 QFileInfo hgrc(workFolderPath + "/.hg/hgrc"); | 1037 QFileInfo hgrc(m_workFolderPath + "/.hg/hgrc"); |
| 1038 if (hgrc.exists() && !hgrc.isWritable()) { | 1038 if (hgrc.exists() && !hgrc.isWritable()) { |
| 1039 //!!! visible error! | 1039 //!!! visible error! |
| 1040 return; | 1040 return; |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1061 QSettings s(hgrc.absoluteFilePath(), QSettings::IniFormat); | 1061 QSettings s(hgrc.absoluteFilePath(), QSettings::IniFormat); |
| 1062 s.beginGroup("paths"); | 1062 s.beginGroup("paths"); |
| 1063 s.setValue("default", d->getArgument()); | 1063 s.setValue("default", d->getArgument()); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 stateUnknown = true; | 1066 m_stateUnknown = true; |
| 1067 hgQueryPaths(); | 1067 hgQueryPaths(); |
| 1068 } | 1068 } |
| 1069 | 1069 |
| 1070 delete d; | 1070 delete d; |
| 1071 } | 1071 } |
| 1279 | 1279 |
| 1280 case FolderIsFile: | 1280 case FolderIsFile: |
| 1281 return complainAboutFilePath(local); | 1281 return complainAboutFilePath(local); |
| 1282 } | 1282 } |
| 1283 | 1283 |
| 1284 workFolderPath = local; | 1284 m_workFolderPath = local; |
| 1285 remoteRepoPath = ""; | 1285 m_remoteRepoPath = ""; |
| 1286 return true; | 1286 return true; |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 bool MainWindow::openRemote(QString remote, QString local) | 1289 bool MainWindow::openRemote(QString remote, QString local) |
| 1290 { | 1290 { |
| 1312 if (status == FolderExists) { | 1312 if (status == FolderExists) { |
| 1313 local = complainAboutCloneToExistingFolder(local, remote); | 1313 local = complainAboutCloneToExistingFolder(local, remote); |
| 1314 if (local == "") return false; | 1314 if (local == "") return false; |
| 1315 } | 1315 } |
| 1316 | 1316 |
| 1317 workFolderPath = local; | 1317 m_workFolderPath = local; |
| 1318 remoteRepoPath = remote; | 1318 m_remoteRepoPath = remote; |
| 1319 hgCloneFromRemote(); | 1319 hgCloneFromRemote(); |
| 1320 | 1320 |
| 1321 return true; | 1321 return true; |
| 1322 } | 1322 } |
| 1323 | 1323 |
| 1344 | 1344 |
| 1345 if (status == FolderUnknown) { | 1345 if (status == FolderUnknown) { |
| 1346 return complainAboutUnknownFolder(local); | 1346 return complainAboutUnknownFolder(local); |
| 1347 } | 1347 } |
| 1348 | 1348 |
| 1349 workFolderPath = local; | 1349 m_workFolderPath = local; |
| 1350 remoteRepoPath = ""; | 1350 m_remoteRepoPath = ""; |
| 1351 hgInit(); | 1351 hgInit(); |
| 1352 return true; | 1352 return true; |
| 1353 } | 1353 } |
| 1354 | 1354 |
| 1355 void MainWindow::settings() | 1355 void MainWindow::settings() |
| 1356 { | 1356 { |
| 1357 SettingsDialog *settingsDlg = new SettingsDialog(this); | 1357 SettingsDialog *settingsDlg = new SettingsDialog(this); |
| 1358 settingsDlg->exec(); | 1358 settingsDlg->exec(); |
| 1359 | 1359 |
| 1360 if (settingsDlg->presentationChanged()) { | 1360 if (settingsDlg->presentationChanged()) { |
| 1361 hgTabs->updateFileStates(); | 1361 m_hgTabs->updateFileStates(); |
| 1362 updateToolBarStyle(); | 1362 updateToolBarStyle(); |
| 1363 hgRefresh(); | 1363 hgRefresh(); |
| 1364 } | 1364 } |
| 1365 } | 1365 } |
| 1366 | 1366 |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 void MainWindow::updateFileSystemWatcher() | 1410 void MainWindow::updateFileSystemWatcher() |
| 1411 { | 1411 { |
| 1412 bool justCreated = false; | 1412 bool justCreated = false; |
| 1413 if (!fsWatcher) { | 1413 if (!m_fsWatcher) { |
| 1414 fsWatcher = new QFileSystemWatcher(); | 1414 m_fsWatcher = new QFileSystemWatcher(); |
| 1415 justCreated = true; | 1415 justCreated = true; |
| 1416 } | 1416 } |
| 1417 | 1417 |
| 1418 // QFileSystemWatcher will refuse to add a file or directory to | 1418 // QFileSystemWatcher will refuse to add a file or directory to |
| 1419 // its watch list that it is already watching -- fine, that's what | 1419 // its watch list that it is already watching -- fine, that's what |
| 1420 // we want -- but it prints a warning when this happens, which is | 1420 // we want -- but it prints a warning when this happens, which is |
| 1421 // annoying because it would be the normal case for us. So we'll | 1421 // annoying because it would be the normal case for us. So we'll |
| 1422 // check for duplicates ourselves. | 1422 // check for duplicates ourselves. |
| 1423 QSet<QString> alreadyWatched; | 1423 QSet<QString> alreadyWatched; |
| 1424 QStringList dl(fsWatcher->directories()); | 1424 QStringList dl(m_fsWatcher->directories()); |
| 1425 foreach (QString d, dl) alreadyWatched.insert(d); | 1425 foreach (QString d, dl) alreadyWatched.insert(d); |
| 1426 | 1426 |
| 1427 std::deque<QString> pending; | 1427 std::deque<QString> pending; |
| 1428 pending.push_back(workFolderPath); | 1428 pending.push_back(m_workFolderPath); |
| 1429 | 1429 |
| 1430 while (!pending.empty()) { | 1430 while (!pending.empty()) { |
| 1431 | 1431 |
| 1432 QString path = pending.front(); | 1432 QString path = pending.front(); |
| 1433 pending.pop_front(); | 1433 pending.pop_front(); |
| 1434 if (!alreadyWatched.contains(path)) { | 1434 if (!alreadyWatched.contains(path)) { |
| 1435 fsWatcher->addPath(path); | 1435 m_fsWatcher->addPath(path); |
| 1436 DEBUG << "Added to file system watcher: " << path << endl; | 1436 DEBUG << "Added to file system watcher: " << path << endl; |
| 1437 } | 1437 } |
| 1438 | 1438 |
| 1439 QDir d(path); | 1439 QDir d(path); |
| 1440 if (d.exists()) { | 1440 if (d.exists()) { |
| 1457 this, SLOT(checkFilesystem())); | 1457 this, SLOT(checkFilesystem())); |
| 1458 m_fsWatcherGeneralTimer->setInterval(30 * 60 * 1000); // half an hour | 1458 m_fsWatcherGeneralTimer->setInterval(30 * 60 * 1000); // half an hour |
| 1459 m_fsWatcherGeneralTimer->start(); | 1459 m_fsWatcherGeneralTimer->start(); |
| 1460 | 1460 |
| 1461 if (justCreated) { | 1461 if (justCreated) { |
| 1462 connect(fsWatcher, SIGNAL(directoryChanged(QString)), | 1462 connect(m_fsWatcher, SIGNAL(directoryChanged(QString)), |
| 1463 this, SLOT(fsDirectoryChanged(QString))); | 1463 this, SLOT(fsDirectoryChanged(QString))); |
| 1464 connect(fsWatcher, SIGNAL(fileChanged(QString)), | 1464 connect(m_fsWatcher, SIGNAL(fileChanged(QString)), |
| 1465 this, SLOT(fsFileChanged(QString))); | 1465 this, SLOT(fsFileChanged(QString))); |
| 1466 } | 1466 } |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 void MainWindow::suspendFileSystemWatcher() | 1469 void MainWindow::suspendFileSystemWatcher() |
| 1470 { | 1470 { |
| 1471 DEBUG << "MainWindow::suspendFileSystemWatcher" << endl; | 1471 DEBUG << "MainWindow::suspendFileSystemWatcher" << endl; |
| 1472 if (fsWatcher) { | 1472 if (m_fsWatcher) { |
| 1473 m_fsWatcherSuspended = true; | 1473 m_fsWatcherSuspended = true; |
| 1474 if (m_fsWatcherRestoreTimer) { | 1474 if (m_fsWatcherRestoreTimer) { |
| 1475 delete m_fsWatcherRestoreTimer; | 1475 delete m_fsWatcherRestoreTimer; |
| 1476 m_fsWatcherRestoreTimer = 0; | 1476 m_fsWatcherRestoreTimer = 0; |
| 1477 } | 1477 } |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 void MainWindow::actuallyRestoreFileSystemWatcher() | 1501 void MainWindow::actuallyRestoreFileSystemWatcher() |
| 1502 { | 1502 { |
| 1503 DEBUG << "MainWindow::actuallyRestoreFileSystemWatcher" << endl; | 1503 DEBUG << "MainWindow::actuallyRestoreFileSystemWatcher" << endl; |
| 1504 if (fsWatcher) { | 1504 if (m_fsWatcher) { |
| 1505 m_fsWatcherSuspended = false; | 1505 m_fsWatcherSuspended = false; |
| 1506 m_fsWatcherGeneralTimer->start(); | 1506 m_fsWatcherGeneralTimer->start(); |
| 1507 } | 1507 } |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1549 } | 1549 } |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 void MainWindow::showIncoming(QString output) | 1552 void MainWindow::showIncoming(QString output) |
| 1553 { | 1553 { |
| 1554 runner->hide(); | 1554 m_runner->hide(); |
| 1555 IncomingDialog *d = new IncomingDialog(this, output); | 1555 IncomingDialog *d = new IncomingDialog(this, output); |
| 1556 d->exec(); | 1556 d->exec(); |
| 1557 delete d; | 1557 delete d; |
| 1558 } | 1558 } |
| 1559 | 1559 |
| 1579 report = tr("No changes to push"); | 1579 report = tr("No changes to push"); |
| 1580 } else { | 1580 } else { |
| 1581 report = tr("Push complete"); | 1581 report = tr("Push complete"); |
| 1582 } | 1582 } |
| 1583 report = format3(report, tr("The push command output was:"), output); | 1583 report = format3(report, tr("The push command output was:"), output); |
| 1584 runner->hide(); | 1584 m_runner->hide(); |
| 1585 QMessageBox::information(this, "Push complete", report); | 1585 QMessageBox::information(this, "Push complete", report); |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 void MainWindow::showPullResult(QString output) | 1588 void MainWindow::showPullResult(QString output) |
| 1589 { | 1589 { |
| 1595 report = tr("No changes to pull"); | 1595 report = tr("No changes to pull"); |
| 1596 } else { | 1596 } else { |
| 1597 report = tr("Pull complete"); | 1597 report = tr("Pull complete"); |
| 1598 } | 1598 } |
| 1599 report = format3(report, tr("The pull command output was:"), output); | 1599 report = format3(report, tr("The pull command output was:"), output); |
| 1600 runner->hide(); | 1600 m_runner->hide(); |
| 1601 | 1601 |
| 1602 //!!! and something about updating | 1602 //!!! and something about updating |
| 1603 | 1603 |
| 1604 QMessageBox::information(this, "Pull complete", report); | 1604 QMessageBox::information(this, "Pull complete", report); |
| 1605 } | 1605 } |
| 1606 | 1606 |
| 1607 void MainWindow::reportNewRemoteHeads(QString output) | 1607 void MainWindow::reportNewRemoteHeads(QString output) |
| 1608 { | 1608 { |
| 1609 bool headsAreLocal = false; | 1609 bool headsAreLocal = false; |
| 1610 | 1610 |
| 1611 if (currentParents.size() == 1) { | 1611 if (m_currentParents.size() == 1) { |
| 1612 int currentBranchHeads = 0; | 1612 int m_currentBranchHeads = 0; |
| 1613 bool parentIsHead = false; | 1613 bool parentIsHead = false; |
| 1614 Changeset *parent = currentParents[0]; | 1614 Changeset *parent = m_currentParents[0]; |
| 1615 foreach (Changeset *head, currentHeads) { | 1615 foreach (Changeset *head, m_currentHeads) { |
| 1616 if (head->isOnBranch(currentBranch)) { | 1616 if (head->isOnBranch(m_currentBranch)) { |
| 1617 ++currentBranchHeads; | 1617 ++m_currentBranchHeads; |
| 1618 } | 1618 } |
| 1619 if (parent->id() == head->id()) { | 1619 if (parent->id() == head->id()) { |
| 1620 parentIsHead = true; | 1620 parentIsHead = true; |
| 1621 } | 1621 } |
| 1622 } | 1622 } |
| 1623 if (currentBranchHeads == 2 && parentIsHead) { | 1623 if (m_currentBranchHeads == 2 && parentIsHead) { |
| 1624 headsAreLocal = true; | 1624 headsAreLocal = true; |
| 1625 } | 1625 } |
| 1626 } | 1626 } |
| 1627 | 1627 |
| 1628 if (headsAreLocal) { | 1628 if (headsAreLocal) { |
| 1687 output)); | 1687 output)); |
| 1688 settings(); | 1688 settings(); |
| 1689 return; | 1689 return; |
| 1690 case ACT_CLONEFROMREMOTE: | 1690 case ACT_CLONEFROMREMOTE: |
| 1691 // if clone fails, we have no repo | 1691 // if clone fails, we have no repo |
| 1692 workFolderPath = ""; | 1692 m_workFolderPath = ""; |
| 1693 enableDisableActions(); | 1693 enableDisableActions(); |
| 1694 break; | 1694 break; |
| 1695 case ACT_INCOMING: | 1695 case ACT_INCOMING: |
| 1696 // returns non-zero code and no output if the check was | 1696 // returns non-zero code and no output if the check was |
| 1697 // successful but there are no changes pending | 1697 // successful but there are no changes pending |
| 1767 DEBUG << "stdout is " << output << endl; | 1767 DEBUG << "stdout is " << output << endl; |
| 1768 LogParser lp(output, "="); | 1768 LogParser lp(output, "="); |
| 1769 LogList ll = lp.parse(); | 1769 LogList ll = lp.parse(); |
| 1770 DEBUG << ll.size() << " results" << endl; | 1770 DEBUG << ll.size() << " results" << endl; |
| 1771 if (!ll.empty()) { | 1771 if (!ll.empty()) { |
| 1772 remoteRepoPath = lp.parse()[0]["default"].trimmed(); | 1772 m_remoteRepoPath = lp.parse()[0]["default"].trimmed(); |
| 1773 DEBUG << "Set remote path to " << remoteRepoPath << endl; | 1773 DEBUG << "Set remote path to " << m_remoteRepoPath << endl; |
| 1774 } else { | 1774 } else { |
| 1775 remoteRepoPath = ""; | 1775 m_remoteRepoPath = ""; |
| 1776 } | 1776 } |
| 1777 MultiChoiceDialog::addRecentArgument("local", workFolderPath); | 1777 MultiChoiceDialog::addRecentArgument("local", m_workFolderPath); |
| 1778 MultiChoiceDialog::addRecentArgument("remote", remoteRepoPath); | 1778 MultiChoiceDialog::addRecentArgument("remote", m_remoteRepoPath); |
| 1779 hgTabs->setWorkFolderAndRepoNames(workFolderPath, remoteRepoPath); | 1779 m_hgTabs->setWorkFolderAndRepoNames(m_workFolderPath, m_remoteRepoPath); |
| 1780 break; | 1780 break; |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 case ACT_QUERY_BRANCH: | 1783 case ACT_QUERY_BRANCH: |
| 1784 currentBranch = output.trimmed(); | 1784 m_currentBranch = output.trimmed(); |
| 1785 break; | 1785 break; |
| 1786 | 1786 |
| 1787 case ACT_STAT: | 1787 case ACT_STAT: |
| 1788 lastStatOutput = output; | 1788 m_lastStatOutput = output; |
| 1789 updateFileSystemWatcher(); | 1789 updateFileSystemWatcher(); |
| 1790 break; | 1790 break; |
| 1791 | 1791 |
| 1792 case ACT_RESOLVE_LIST: | 1792 case ACT_RESOLVE_LIST: |
| 1793 if (output != "") { | 1793 if (output != "") { |
| 1798 foreach (QString line, outList) { | 1798 foreach (QString line, outList) { |
| 1799 if (!line.startsWith("R ")) winnowed.push_back(line); | 1799 if (!line.startsWith("R ")) winnowed.push_back(line); |
| 1800 } | 1800 } |
| 1801 output = winnowed.join("\n"); | 1801 output = winnowed.join("\n"); |
| 1802 } | 1802 } |
| 1803 DEBUG << "lastStatOutput = " << lastStatOutput << endl; | 1803 DEBUG << "m_lastStatOutput = " << m_lastStatOutput << endl; |
| 1804 DEBUG << "resolve output = " << output << endl; | 1804 DEBUG << "resolve output = " << output << endl; |
| 1805 hgTabs->updateWorkFolderFileList(lastStatOutput + output); | 1805 m_hgTabs->updateWorkFolderFileList(m_lastStatOutput + output); |
| 1806 break; | 1806 break; |
| 1807 | 1807 |
| 1808 case ACT_RESOLVE_MARK: | 1808 case ACT_RESOLVE_MARK: |
| 1809 shouldHgStat = true; | 1809 m_shouldHgStat = true; |
| 1810 break; | 1810 break; |
| 1811 | 1811 |
| 1812 case ACT_INCOMING: | 1812 case ACT_INCOMING: |
| 1813 showIncoming(output); | 1813 showIncoming(output); |
| 1814 break; | 1814 break; |
| 1815 | 1815 |
| 1816 case ACT_ANNOTATE: | 1816 case ACT_ANNOTATE: |
| 1817 presentLongStdoutToUser(output); | 1817 presentLongStdoutToUser(output); |
| 1818 shouldHgStat = true; | 1818 m_shouldHgStat = true; |
| 1819 break; | 1819 break; |
| 1820 | 1820 |
| 1821 case ACT_PULL: | 1821 case ACT_PULL: |
| 1822 showPullResult(output); | 1822 showPullResult(output); |
| 1823 shouldHgStat = true; | 1823 m_shouldHgStat = true; |
| 1824 break; | 1824 break; |
| 1825 | 1825 |
| 1826 case ACT_PUSH: | 1826 case ACT_PUSH: |
| 1827 showPushResult(output); | 1827 showPushResult(output); |
| 1828 break; | 1828 break; |
| 1829 | 1829 |
| 1830 case ACT_INIT: | 1830 case ACT_INIT: |
| 1831 MultiChoiceDialog::addRecentArgument("init", workFolderPath); | 1831 MultiChoiceDialog::addRecentArgument("init", m_workFolderPath); |
| 1832 MultiChoiceDialog::addRecentArgument("local", workFolderPath); | 1832 MultiChoiceDialog::addRecentArgument("local", m_workFolderPath); |
| 1833 enableDisableActions(); | 1833 enableDisableActions(); |
| 1834 shouldHgStat = true; | 1834 m_shouldHgStat = true; |
| 1835 break; | 1835 break; |
| 1836 | 1836 |
| 1837 case ACT_CLONEFROMREMOTE: | 1837 case ACT_CLONEFROMREMOTE: |
| 1838 MultiChoiceDialog::addRecentArgument("local", workFolderPath); | 1838 MultiChoiceDialog::addRecentArgument("local", m_workFolderPath); |
| 1839 MultiChoiceDialog::addRecentArgument("remote", remoteRepoPath); | 1839 MultiChoiceDialog::addRecentArgument("remote", m_remoteRepoPath); |
| 1840 MultiChoiceDialog::addRecentArgument("remote", workFolderPath, true); | 1840 MultiChoiceDialog::addRecentArgument("remote", m_workFolderPath, true); |
| 1841 QMessageBox::information(this, tr("Clone"), tr("<qt><h3>Clone successful</h3><pre>%1</pre>").arg(xmlEncode(output))); | 1841 QMessageBox::information(this, tr("Clone"), tr("<qt><h3>Clone successful</h3><pre>%1</pre>").arg(xmlEncode(output))); |
| 1842 enableDisableActions(); | 1842 enableDisableActions(); |
| 1843 shouldHgStat = true; | 1843 m_shouldHgStat = true; |
| 1844 break; | 1844 break; |
| 1845 | 1845 |
| 1846 case ACT_LOG: | 1846 case ACT_LOG: |
| 1847 hgTabs->setNewLog(output); | 1847 m_hgTabs->setNewLog(output); |
| 1848 needNewLog = false; | 1848 m_needNewLog = false; |
| 1849 break; | 1849 break; |
| 1850 | 1850 |
| 1851 case ACT_LOG_INCREMENTAL: | 1851 case ACT_LOG_INCREMENTAL: |
| 1852 hgTabs->addIncrementalLog(output); | 1852 m_hgTabs->addIncrementalLog(output); |
| 1853 break; | 1853 break; |
| 1854 | 1854 |
| 1855 case ACT_QUERY_PARENTS: | 1855 case ACT_QUERY_PARENTS: |
| 1856 { | 1856 { |
| 1857 foreach (Changeset *cs, currentParents) delete cs; | 1857 foreach (Changeset *cs, m_currentParents) delete cs; |
| 1858 currentParents = Changeset::parseChangesets(output); | 1858 m_currentParents = Changeset::parseChangesets(output); |
| 1859 QStringList parentIds = Changeset::getIds(currentParents); | 1859 QStringList parentIds = Changeset::getIds(m_currentParents); |
| 1860 hgTabs->setCurrent(parentIds, currentBranch); | 1860 m_hgTabs->setCurrent(parentIds, m_currentBranch); |
| 1861 } | 1861 } |
| 1862 break; | 1862 break; |
| 1863 | 1863 |
| 1864 case ACT_QUERY_HEADS: | 1864 case ACT_QUERY_HEADS: |
| 1865 { | 1865 { |
| 1866 oldHeadIds = Changeset::getIds(currentHeads); | 1866 oldHeadIds = Changeset::getIds(m_currentHeads); |
| 1867 Changesets newHeads = Changeset::parseChangesets(output); | 1867 Changesets newHeads = Changeset::parseChangesets(output); |
| 1868 QStringList newHeadIds = Changeset::getIds(newHeads); | 1868 QStringList newHeadIds = Changeset::getIds(newHeads); |
| 1869 if (oldHeadIds != newHeadIds) { | 1869 if (oldHeadIds != newHeadIds) { |
| 1870 DEBUG << "Heads changed, will prompt an incremental log if appropriate" << endl; | 1870 DEBUG << "Heads changed, will prompt an incremental log if appropriate" << endl; |
| 1871 headsChanged = true; | 1871 headsChanged = true; |
| 1872 foreach (Changeset *cs, currentHeads) delete cs; | 1872 foreach (Changeset *cs, m_currentHeads) delete cs; |
| 1873 currentHeads = newHeads; | 1873 m_currentHeads = newHeads; |
| 1874 } | 1874 } |
| 1875 } | 1875 } |
| 1876 break; | 1876 break; |
| 1877 | 1877 |
| 1878 case ACT_COMMIT: | 1878 case ACT_COMMIT: |
| 1879 hgTabs->clearSelections(); | 1879 m_hgTabs->clearSelections(); |
| 1880 justMerged = false; | 1880 m_justMerged = false; |
| 1881 shouldHgStat = true; | 1881 m_shouldHgStat = true; |
| 1882 break; | 1882 break; |
| 1883 | 1883 |
| 1884 case ACT_REVERT: | 1884 case ACT_REVERT: |
| 1885 hgMarkResolved(lastRevertedFiles); | 1885 hgMarkResolved(m_lastRevertedFiles); |
| 1886 justMerged = false; | 1886 m_justMerged = false; |
| 1887 break; | 1887 break; |
| 1888 | 1888 |
| 1889 case ACT_REMOVE: | 1889 case ACT_REMOVE: |
| 1890 case ACT_ADD: | 1890 case ACT_ADD: |
| 1891 hgTabs->clearSelections(); | 1891 m_hgTabs->clearSelections(); |
| 1892 shouldHgStat = true; | 1892 m_shouldHgStat = true; |
| 1893 break; | 1893 break; |
| 1894 | 1894 |
| 1895 case ACT_TAG: | 1895 case ACT_TAG: |
| 1896 needNewLog = true; | 1896 m_needNewLog = true; |
| 1897 shouldHgStat = true; | 1897 m_shouldHgStat = true; |
| 1898 break; | 1898 break; |
| 1899 | 1899 |
| 1900 case ACT_DIFF_SUMMARY: | 1900 case ACT_DIFF_SUMMARY: |
| 1901 QMessageBox::information(this, tr("Change summary"), | 1901 QMessageBox::information(this, tr("Change summary"), |
| 1902 format3(tr("Summary of uncommitted changes"), | 1902 format3(tr("Summary of uncommitted changes"), |
| 1906 | 1906 |
| 1907 case ACT_FOLDERDIFF: | 1907 case ACT_FOLDERDIFF: |
| 1908 case ACT_CHGSETDIFF: | 1908 case ACT_CHGSETDIFF: |
| 1909 case ACT_SERVE: | 1909 case ACT_SERVE: |
| 1910 case ACT_HG_IGNORE: | 1910 case ACT_HG_IGNORE: |
| 1911 shouldHgStat = true; | 1911 m_shouldHgStat = true; |
| 1912 break; | 1912 break; |
| 1913 | 1913 |
| 1914 case ACT_UPDATE: | 1914 case ACT_UPDATE: |
| 1915 QMessageBox::information(this, tr("Update"), tr("<qt><h3>Update successful</h3><p>%1</p>").arg(xmlEncode(output))); | 1915 QMessageBox::information(this, tr("Update"), tr("<qt><h3>Update successful</h3><p>%1</p>").arg(xmlEncode(output))); |
| 1916 shouldHgStat = true; | 1916 m_shouldHgStat = true; |
| 1917 break; | 1917 break; |
| 1918 | 1918 |
| 1919 case ACT_MERGE: | 1919 case ACT_MERGE: |
| 1920 //!!! use format3? | 1920 //!!! use format3? |
| 1921 QMessageBox::information(this, tr("Merge"), tr("<qt><h3>Merge successful</h3><pre>%1</pre>").arg(xmlEncode(output))); | 1921 QMessageBox::information(this, tr("Merge"), tr("<qt><h3>Merge successful</h3><pre>%1</pre>").arg(xmlEncode(output))); |
| 1922 shouldHgStat = true; | 1922 m_shouldHgStat = true; |
| 1923 justMerged = true; | 1923 m_justMerged = true; |
| 1924 break; | 1924 break; |
| 1925 | 1925 |
| 1926 case ACT_RETRY_MERGE: | 1926 case ACT_RETRY_MERGE: |
| 1927 QMessageBox::information(this, tr("Resolved"), | 1927 QMessageBox::information(this, tr("Resolved"), |
| 1928 tr("<qt><h3>Merge resolved</h3><p>Merge resolved successfully.</p>")); | 1928 tr("<qt><h3>Merge resolved</h3><p>Merge resolved successfully.</p>")); |
| 1929 shouldHgStat = true; | 1929 m_shouldHgStat = true; |
| 1930 justMerged = true; | 1930 m_justMerged = true; |
| 1931 break; | 1931 break; |
| 1932 | 1932 |
| 1933 default: | 1933 default: |
| 1934 break; | 1934 break; |
| 1935 } | 1935 } |
| 1952 { | 1952 { |
| 1953 QSettings settings; | 1953 QSettings settings; |
| 1954 settings.beginGroup("General"); | 1954 settings.beginGroup("General"); |
| 1955 if (settings.value("useextension", true).toBool()) { | 1955 if (settings.value("useextension", true).toBool()) { |
| 1956 hgTestExtension(); | 1956 hgTestExtension(); |
| 1957 } else if (workFolderPath == "") { | 1957 } else if (m_workFolderPath == "") { |
| 1958 open(); | 1958 open(); |
| 1959 } else { | 1959 } else { |
| 1960 hgQueryPaths(); | 1960 hgQueryPaths(); |
| 1961 } | 1961 } |
| 1962 break; | 1962 break; |
| 1963 } | 1963 } |
| 1964 | 1964 |
| 1965 case ACT_TEST_HG_EXT: | 1965 case ACT_TEST_HG_EXT: |
| 1966 if (workFolderPath == "") { | 1966 if (m_workFolderPath == "") { |
| 1967 open(); | 1967 open(); |
| 1968 } else{ | 1968 } else{ |
| 1969 hgQueryPaths(); | 1969 hgQueryPaths(); |
| 1970 } | 1970 } |
| 1971 break; | 1971 break; |
| 1985 case ACT_RESOLVE_LIST: | 1985 case ACT_RESOLVE_LIST: |
| 1986 hgQueryHeads(); | 1986 hgQueryHeads(); |
| 1987 break; | 1987 break; |
| 1988 | 1988 |
| 1989 case ACT_QUERY_HEADS: | 1989 case ACT_QUERY_HEADS: |
| 1990 if (headsChanged && !needNewLog) { | 1990 if (headsChanged && !m_needNewLog) { |
| 1991 hgLogIncremental(oldHeadIds); | 1991 hgLogIncremental(oldHeadIds); |
| 1992 } else { | 1992 } else { |
| 1993 hgQueryParents(); | 1993 hgQueryParents(); |
| 1994 } | 1994 } |
| 1995 break; | 1995 break; |
| 1997 case ACT_LOG_INCREMENTAL: | 1997 case ACT_LOG_INCREMENTAL: |
| 1998 hgQueryParents(); | 1998 hgQueryParents(); |
| 1999 break; | 1999 break; |
| 2000 | 2000 |
| 2001 case ACT_QUERY_PARENTS: | 2001 case ACT_QUERY_PARENTS: |
| 2002 if (needNewLog) { | 2002 if (m_needNewLog) { |
| 2003 hgLog(); | 2003 hgLog(); |
| 2004 } else { | 2004 } else { |
| 2005 // we're done | 2005 // we're done |
| 2006 noMore = true; | 2006 noMore = true; |
| 2007 } | 2007 } |
| 2011 // we're done | 2011 // we're done |
| 2012 noMore = true; | 2012 noMore = true; |
| 2013 break; | 2013 break; |
| 2014 | 2014 |
| 2015 default: | 2015 default: |
| 2016 if (shouldHgStat) { | 2016 if (m_shouldHgStat) { |
| 2017 shouldHgStat = false; | 2017 m_shouldHgStat = false; |
| 2018 hgQueryPaths(); | 2018 hgQueryPaths(); |
| 2019 } else { | 2019 } else { |
| 2020 noMore = true; | 2020 noMore = true; |
| 2021 } | 2021 } |
| 2022 break; | 2022 break; |
| 2023 } | 2023 } |
| 2024 | 2024 |
| 2025 if (noMore) { | 2025 if (noMore) { |
| 2026 stateUnknown = false; | 2026 m_stateUnknown = false; |
| 2027 enableDisableActions(); | 2027 enableDisableActions(); |
| 2028 hgTabs->updateHistory(); | 2028 m_hgTabs->updateHistory(); |
| 2029 } | 2029 } |
| 2030 } | 2030 } |
| 2031 | 2031 |
| 2032 void MainWindow::connectActions() | 2032 void MainWindow::connectActions() |
| 2033 { | 2033 { |
| 2034 connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); | 2034 connect(m_exitAct, SIGNAL(triggered()), this, SLOT(close())); |
| 2035 connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); | 2035 connect(m_aboutAct, SIGNAL(triggered()), this, SLOT(about())); |
| 2036 | 2036 |
| 2037 connect(hgRefreshAct, SIGNAL(triggered()), this, SLOT(hgRefresh())); | 2037 connect(m_hgRefreshAct, SIGNAL(triggered()), this, SLOT(hgRefresh())); |
| 2038 connect(hgRemoveAct, SIGNAL(triggered()), this, SLOT(hgRemove())); | 2038 connect(m_hgRemoveAct, SIGNAL(triggered()), this, SLOT(hgRemove())); |
| 2039 connect(hgAddAct, SIGNAL(triggered()), this, SLOT(hgAdd())); | 2039 connect(m_hgAddAct, SIGNAL(triggered()), this, SLOT(hgAdd())); |
| 2040 connect(hgCommitAct, SIGNAL(triggered()), this, SLOT(hgCommit())); | 2040 connect(m_hgCommitAct, SIGNAL(triggered()), this, SLOT(hgCommit())); |
| 2041 connect(hgFolderDiffAct, SIGNAL(triggered()), this, SLOT(hgFolderDiff())); | 2041 connect(m_hgFolderDiffAct, SIGNAL(triggered()), this, SLOT(hgFolderDiff())); |
| 2042 connect(hgUpdateAct, SIGNAL(triggered()), this, SLOT(hgUpdate())); | 2042 connect(m_hgUpdateAct, SIGNAL(triggered()), this, SLOT(hgUpdate())); |
| 2043 connect(hgRevertAct, SIGNAL(triggered()), this, SLOT(hgRevert())); | 2043 connect(m_hgRevertAct, SIGNAL(triggered()), this, SLOT(hgRevert())); |
| 2044 connect(hgMergeAct, SIGNAL(triggered()), this, SLOT(hgMerge())); | 2044 connect(m_hgMergeAct, SIGNAL(triggered()), this, SLOT(hgMerge())); |
| 2045 connect(hgIgnoreAct, SIGNAL(triggered()), this, SLOT(hgIgnore())); | 2045 connect(m_hgIgnoreAct, SIGNAL(triggered()), this, SLOT(hgIgnore())); |
| 2046 | 2046 |
| 2047 connect(settingsAct, SIGNAL(triggered()), this, SLOT(settings())); | 2047 connect(m_settingsAct, SIGNAL(triggered()), this, SLOT(settings())); |
| 2048 connect(openAct, SIGNAL(triggered()), this, SLOT(open())); | 2048 connect(m_openAct, SIGNAL(triggered()), this, SLOT(open())); |
| 2049 connect(changeRemoteRepoAct, SIGNAL(triggered()), this, SLOT(changeRemoteRepo())); | 2049 connect(m_changeRemoteRepoAct, SIGNAL(triggered()), this, SLOT(changeRemoteRepo())); |
| 2050 | 2050 |
| 2051 connect(hgIncomingAct, SIGNAL(triggered()), this, SLOT(hgIncoming())); | 2051 connect(m_hgIncomingAct, SIGNAL(triggered()), this, SLOT(hgIncoming())); |
| 2052 connect(hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull())); | 2052 connect(m_hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull())); |
| 2053 connect(hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush())); | 2053 connect(m_hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush())); |
| 2054 | 2054 |
| 2055 connect(hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate())); | 2055 connect(m_hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate())); |
| 2056 connect(hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe())); | 2056 connect(m_hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe())); |
| 2057 } | 2057 } |
| 2058 | 2058 |
| 2059 void MainWindow::connectTabsSignals() | 2059 void MainWindow::connectTabsSignals() |
| 2060 { | 2060 { |
| 2061 connect(hgTabs, SIGNAL(commit()), | 2061 connect(m_hgTabs, SIGNAL(commit()), |
| 2062 this, SLOT(hgCommit())); | 2062 this, SLOT(hgCommit())); |
| 2063 | 2063 |
| 2064 connect(hgTabs, SIGNAL(revert()), | 2064 connect(m_hgTabs, SIGNAL(revert()), |
| 2065 this, SLOT(hgRevert())); | 2065 this, SLOT(hgRevert())); |
| 2066 | 2066 |
| 2067 connect(hgTabs, SIGNAL(diffWorkingFolder()), | 2067 connect(m_hgTabs, SIGNAL(diffWorkingFolder()), |
| 2068 this, SLOT(hgFolderDiff())); | 2068 this, SLOT(hgFolderDiff())); |
| 2069 | 2069 |
| 2070 connect(hgTabs, SIGNAL(showSummary()), | 2070 connect(m_hgTabs, SIGNAL(showSummary()), |
| 2071 this, SLOT(hgShowSummary())); | 2071 this, SLOT(hgShowSummary())); |
| 2072 | 2072 |
| 2073 connect(hgTabs, SIGNAL(updateTo(QString)), | 2073 connect(m_hgTabs, SIGNAL(updateTo(QString)), |
| 2074 this, SLOT(hgUpdateToRev(QString))); | 2074 this, SLOT(hgUpdateToRev(QString))); |
| 2075 | 2075 |
| 2076 connect(hgTabs, SIGNAL(diffToCurrent(QString)), | 2076 connect(m_hgTabs, SIGNAL(diffToCurrent(QString)), |
| 2077 this, SLOT(hgDiffToCurrent(QString))); | 2077 this, SLOT(hgDiffToCurrent(QString))); |
| 2078 | 2078 |
| 2079 connect(hgTabs, SIGNAL(diffToParent(QString, QString)), | 2079 connect(m_hgTabs, SIGNAL(diffToParent(QString, QString)), |
| 2080 this, SLOT(hgDiffToParent(QString, QString))); | 2080 this, SLOT(hgDiffToParent(QString, QString))); |
| 2081 | 2081 |
| 2082 connect(hgTabs, SIGNAL(mergeFrom(QString)), | 2082 connect(m_hgTabs, SIGNAL(mergeFrom(QString)), |
| 2083 this, SLOT(hgMergeFrom(QString))); | 2083 this, SLOT(hgMergeFrom(QString))); |
| 2084 | 2084 |
| 2085 connect(hgTabs, SIGNAL(tag(QString)), | 2085 connect(m_hgTabs, SIGNAL(tag(QString)), |
| 2086 this, SLOT(hgTag(QString))); | 2086 this, SLOT(hgTag(QString))); |
| 2087 } | 2087 } |
| 2088 | 2088 |
| 2089 void MainWindow::enableDisableActions() | 2089 void MainWindow::enableDisableActions() |
| 2090 { | 2090 { |
| 2091 DEBUG << "MainWindow::enableDisableActions" << endl; | 2091 DEBUG << "MainWindow::enableDisableActions" << endl; |
| 2092 | 2092 |
| 2093 QString dirname = QDir(workFolderPath).dirName(); | 2093 QString dirname = QDir(m_workFolderPath).dirName(); |
| 2094 if (dirname != "") { | 2094 if (dirname != "") { |
| 2095 setWindowTitle(tr("EasyMercurial: %1").arg(dirname)); | 2095 setWindowTitle(tr("EasyMercurial: %1").arg(dirname)); |
| 2096 } else { | 2096 } else { |
| 2097 setWindowTitle(tr("EasyMercurial")); | 2097 setWindowTitle(tr("EasyMercurial")); |
| 2098 } | 2098 } |
| 2103 QDir localRepoDir; | 2103 QDir localRepoDir; |
| 2104 QDir workFolderDir; | 2104 QDir workFolderDir; |
| 2105 bool workFolderExist = true; | 2105 bool workFolderExist = true; |
| 2106 bool localRepoExist = true; | 2106 bool localRepoExist = true; |
| 2107 | 2107 |
| 2108 remoteRepoActionsEnabled = true; | 2108 m_remoteRepoActionsEnabled = true; |
| 2109 if (remoteRepoPath.isEmpty()) { | 2109 if (m_remoteRepoPath.isEmpty()) { |
| 2110 remoteRepoActionsEnabled = false; | 2110 m_remoteRepoActionsEnabled = false; |
| 2111 } | 2111 } |
| 2112 | 2112 |
| 2113 localRepoActionsEnabled = true; | 2113 m_localRepoActionsEnabled = true; |
| 2114 if (workFolderPath.isEmpty()) { | 2114 if (m_workFolderPath.isEmpty()) { |
| 2115 localRepoActionsEnabled = false; | 2115 m_localRepoActionsEnabled = false; |
| 2116 workFolderExist = false; | 2116 workFolderExist = false; |
| 2117 } | 2117 } |
| 2118 | 2118 |
| 2119 if (workFolderPath == "" || !workFolderDir.exists(workFolderPath)) { | 2119 if (m_workFolderPath == "" || !workFolderDir.exists(m_workFolderPath)) { |
| 2120 localRepoActionsEnabled = false; | 2120 m_localRepoActionsEnabled = false; |
| 2121 workFolderExist = false; | 2121 workFolderExist = false; |
| 2122 } else { | 2122 } else { |
| 2123 workFolderExist = true; | 2123 workFolderExist = true; |
| 2124 } | 2124 } |
| 2125 | 2125 |
| 2126 if (!localRepoDir.exists(workFolderPath + "/.hg")) { | 2126 if (!localRepoDir.exists(m_workFolderPath + "/.hg")) { |
| 2127 localRepoActionsEnabled = false; | 2127 m_localRepoActionsEnabled = false; |
| 2128 localRepoExist = false; | 2128 localRepoExist = false; |
| 2129 } | 2129 } |
| 2130 | 2130 |
| 2131 hgIncomingAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled); | 2131 m_hgIncomingAct -> setEnabled(m_remoteRepoActionsEnabled && m_remoteRepoActionsEnabled); |
| 2132 hgPullAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled); | 2132 m_hgPullAct -> setEnabled(m_remoteRepoActionsEnabled && m_remoteRepoActionsEnabled); |
| 2133 hgPushAct -> setEnabled(remoteRepoActionsEnabled && remoteRepoActionsEnabled); | 2133 m_hgPushAct -> setEnabled(m_remoteRepoActionsEnabled && m_remoteRepoActionsEnabled); |
| 2134 | 2134 |
| 2135 bool haveDiff = false; | 2135 bool haveDiff = false; |
| 2136 QSettings settings; | 2136 QSettings settings; |
| 2137 settings.beginGroup("Locations"); | 2137 settings.beginGroup("Locations"); |
| 2138 if (settings.value("extdiffbinary", "").toString() != "") { | 2138 if (settings.value("extdiffbinary", "").toString() != "") { |
| 2139 haveDiff = true; | 2139 haveDiff = true; |
| 2140 } | 2140 } |
| 2141 settings.endGroup(); | 2141 settings.endGroup(); |
| 2142 | 2142 |
| 2143 hgRefreshAct -> setEnabled(localRepoActionsEnabled); | 2143 m_hgRefreshAct -> setEnabled(m_localRepoActionsEnabled); |
| 2144 hgFolderDiffAct -> setEnabled(localRepoActionsEnabled && haveDiff); | 2144 m_hgFolderDiffAct -> setEnabled(m_localRepoActionsEnabled && haveDiff); |
| 2145 hgRevertAct -> setEnabled(localRepoActionsEnabled); | 2145 m_hgRevertAct -> setEnabled(m_localRepoActionsEnabled); |
| 2146 hgAddAct -> setEnabled(localRepoActionsEnabled); | 2146 m_hgAddAct -> setEnabled(m_localRepoActionsEnabled); |
| 2147 hgRemoveAct -> setEnabled(localRepoActionsEnabled); | 2147 m_hgRemoveAct -> setEnabled(m_localRepoActionsEnabled); |
| 2148 hgUpdateAct -> setEnabled(localRepoActionsEnabled); | 2148 m_hgUpdateAct -> setEnabled(m_localRepoActionsEnabled); |
| 2149 hgCommitAct -> setEnabled(localRepoActionsEnabled); | 2149 m_hgCommitAct -> setEnabled(m_localRepoActionsEnabled); |
| 2150 hgMergeAct -> setEnabled(localRepoActionsEnabled); | 2150 m_hgMergeAct -> setEnabled(m_localRepoActionsEnabled); |
| 2151 hgAnnotateAct -> setEnabled(localRepoActionsEnabled); | 2151 m_hgAnnotateAct -> setEnabled(m_localRepoActionsEnabled); |
| 2152 hgServeAct -> setEnabled(localRepoActionsEnabled); | 2152 m_hgServeAct -> setEnabled(m_localRepoActionsEnabled); |
| 2153 hgIgnoreAct -> setEnabled(localRepoActionsEnabled); | 2153 m_hgIgnoreAct -> setEnabled(m_localRepoActionsEnabled); |
| 2154 | 2154 |
| 2155 DEBUG << "localRepoActionsEnabled = " << localRepoActionsEnabled << endl; | 2155 DEBUG << "m_localRepoActionsEnabled = " << m_localRepoActionsEnabled << endl; |
| 2156 DEBUG << "canCommit = " << hgTabs->canCommit() << endl; | 2156 DEBUG << "canCommit = " << m_hgTabs->canCommit() << endl; |
| 2157 | 2157 |
| 2158 hgAddAct->setEnabled(localRepoActionsEnabled && hgTabs->canAdd()); | 2158 m_hgAddAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canAdd()); |
| 2159 hgRemoveAct->setEnabled(localRepoActionsEnabled && hgTabs->canRemove()); | 2159 m_hgRemoveAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canRemove()); |
| 2160 hgCommitAct->setEnabled(localRepoActionsEnabled && hgTabs->canCommit()); | 2160 m_hgCommitAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canCommit()); |
| 2161 hgRevertAct->setEnabled(localRepoActionsEnabled && hgTabs->canRevert()); | 2161 m_hgRevertAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canRevert()); |
| 2162 hgFolderDiffAct->setEnabled(localRepoActionsEnabled && hgTabs->canDiff()); | 2162 m_hgFolderDiffAct->setEnabled(m_localRepoActionsEnabled && m_hgTabs->canDiff()); |
| 2163 | 2163 |
| 2164 // A default merge makes sense if: | 2164 // A default merge makes sense if: |
| 2165 // * there is only one parent (if there are two, we have an uncommitted merge) and | 2165 // * there is only one parent (if there are two, we have an uncommitted merge) and |
| 2166 // * there are exactly two heads that have the same branch as the current branch and | 2166 // * there are exactly two heads that have the same branch as the current branch and |
| 2167 // * our parent is one of those heads | 2167 // * our parent is one of those heads |
| 2174 bool canUpdate = false; | 2174 bool canUpdate = false; |
| 2175 bool haveMerge = false; | 2175 bool haveMerge = false; |
| 2176 bool emptyRepo = false; | 2176 bool emptyRepo = false; |
| 2177 bool noWorkingCopy = false; | 2177 bool noWorkingCopy = false; |
| 2178 bool newBranch = false; | 2178 bool newBranch = false; |
| 2179 int currentBranchHeads = 0; | 2179 int m_currentBranchHeads = 0; |
| 2180 | 2180 |
| 2181 if (currentParents.size() == 1) { | 2181 if (m_currentParents.size() == 1) { |
| 2182 bool parentIsHead = false; | 2182 bool parentIsHead = false; |
| 2183 Changeset *parent = currentParents[0]; | 2183 Changeset *parent = m_currentParents[0]; |
| 2184 foreach (Changeset *head, currentHeads) { | 2184 foreach (Changeset *head, m_currentHeads) { |
| 2185 DEBUG << "head branch " << head->branch() << ", current branch " << currentBranch << endl; | 2185 DEBUG << "head branch " << head->branch() << ", current branch " << m_currentBranch << endl; |
| 2186 if (head->isOnBranch(currentBranch)) { | 2186 if (head->isOnBranch(m_currentBranch)) { |
| 2187 ++currentBranchHeads; | 2187 ++m_currentBranchHeads; |
| 2188 } | 2188 } |
| 2189 if (parent->id() == head->id()) { | 2189 if (parent->id() == head->id()) { |
| 2190 parentIsHead = true; | 2190 parentIsHead = true; |
| 2191 } | 2191 } |
| 2192 } | 2192 } |
| 2193 if (currentBranchHeads == 2 && parentIsHead) { | 2193 if (m_currentBranchHeads == 2 && parentIsHead) { |
| 2194 canMerge = true; | 2194 canMerge = true; |
| 2195 } | 2195 } |
| 2196 if (currentBranchHeads == 0 && parentIsHead) { | 2196 if (m_currentBranchHeads == 0 && parentIsHead) { |
| 2197 // Just created a new branch | 2197 // Just created a new branch |
| 2198 newBranch = true; | 2198 newBranch = true; |
| 2199 } | 2199 } |
| 2200 if (!parentIsHead) { | 2200 if (!parentIsHead) { |
| 2201 canUpdate = true; | 2201 canUpdate = true; |
| 2202 DEBUG << "parent id = " << parent->id() << endl; | 2202 DEBUG << "parent id = " << parent->id() << endl; |
| 2203 DEBUG << " head ids "<<endl; | 2203 DEBUG << " head ids "<<endl; |
| 2204 foreach (Changeset *h, currentHeads) { | 2204 foreach (Changeset *h, m_currentHeads) { |
| 2205 DEBUG << "head id = " << h->id() << endl; | 2205 DEBUG << "head id = " << h->id() << endl; |
| 2206 } | 2206 } |
| 2207 } | 2207 } |
| 2208 justMerged = false; | 2208 m_justMerged = false; |
| 2209 } else if (currentParents.size() == 0) { | 2209 } else if (m_currentParents.size() == 0) { |
| 2210 if (currentHeads.size() == 0) { | 2210 if (m_currentHeads.size() == 0) { |
| 2211 // No heads -> empty repo | 2211 // No heads -> empty repo |
| 2212 emptyRepo = true; | 2212 emptyRepo = true; |
| 2213 } else { | 2213 } else { |
| 2214 // Heads, but no parents -> no working copy, e.g. we have | 2214 // Heads, but no parents -> no working copy, e.g. we have |
| 2215 // just converted this repo but haven't updated in it yet. | 2215 // just converted this repo but haven't updated in it yet. |
| 2216 // Uncommon but confusing; probably merits a special case | 2216 // Uncommon but confusing; probably merits a special case |
| 2217 noWorkingCopy = true; | 2217 noWorkingCopy = true; |
| 2218 canUpdate = true; | 2218 canUpdate = true; |
| 2219 } | 2219 } |
| 2220 justMerged = false; | 2220 m_justMerged = false; |
| 2221 } else { | 2221 } else { |
| 2222 haveMerge = true; | 2222 haveMerge = true; |
| 2223 justMerged = true; | 2223 m_justMerged = true; |
| 2224 } | 2224 } |
| 2225 | 2225 |
| 2226 hgMergeAct->setEnabled(localRepoActionsEnabled && | 2226 m_hgMergeAct->setEnabled(m_localRepoActionsEnabled && |
| 2227 (canMerge || hgTabs->canResolve())); | 2227 (canMerge || m_hgTabs->canResolve())); |
| 2228 hgUpdateAct->setEnabled(localRepoActionsEnabled && | 2228 m_hgUpdateAct->setEnabled(m_localRepoActionsEnabled && |
| 2229 (canUpdate && !hgTabs->haveChangesToCommit())); | 2229 (canUpdate && !m_hgTabs->haveChangesToCommit())); |
| 2230 | 2230 |
| 2231 // Set the state field on the file status widget | 2231 // Set the state field on the file status widget |
| 2232 | 2232 |
| 2233 QString branchText; | 2233 QString branchText; |
| 2234 if (currentBranch == "" || currentBranch == "default") { | 2234 if (m_currentBranch == "" || m_currentBranch == "default") { |
| 2235 branchText = tr("the default branch"); | 2235 branchText = tr("the default branch"); |
| 2236 } else { | 2236 } else { |
| 2237 branchText = tr("branch \"%1\"").arg(currentBranch); | 2237 branchText = tr("branch \"%1\"").arg(m_currentBranch); |
| 2238 } | 2238 } |
| 2239 | 2239 |
| 2240 if (stateUnknown) { | 2240 if (m_stateUnknown) { |
| 2241 if (workFolderPath == "") { | 2241 if (m_workFolderPath == "") { |
| 2242 hgTabs->setState(tr("No repository open")); | 2242 m_hgTabs->setState(tr("No repository open")); |
| 2243 } else { | 2243 } else { |
| 2244 hgTabs->setState(tr("(Examining repository)")); | 2244 m_hgTabs->setState(tr("(Examining repository)")); |
| 2245 } | 2245 } |
| 2246 } else if (emptyRepo) { | 2246 } else if (emptyRepo) { |
| 2247 hgTabs->setState(tr("Nothing committed to this repository yet")); | 2247 m_hgTabs->setState(tr("Nothing committed to this repository yet")); |
| 2248 } else if (noWorkingCopy) { | 2248 } else if (noWorkingCopy) { |
| 2249 hgTabs->setState(tr("No working copy yet: consider updating")); | 2249 m_hgTabs->setState(tr("No working copy yet: consider updating")); |
| 2250 } else if (canMerge) { | 2250 } else if (canMerge) { |
| 2251 hgTabs->setState(tr("<b>Awaiting merge</b> on %1").arg(branchText)); | 2251 m_hgTabs->setState(tr("<b>Awaiting merge</b> on %1").arg(branchText)); |
| 2252 } else if (!hgTabs->getAllUnresolvedFiles().empty()) { | 2252 } else if (!m_hgTabs->getAllUnresolvedFiles().empty()) { |
| 2253 hgTabs->setState(tr("Have unresolved files following merge on %1").arg(branchText)); | 2253 m_hgTabs->setState(tr("Have unresolved files following merge on %1").arg(branchText)); |
| 2254 } else if (haveMerge) { | 2254 } else if (haveMerge) { |
| 2255 hgTabs->setState(tr("Have merged but not yet committed on %1").arg(branchText)); | 2255 m_hgTabs->setState(tr("Have merged but not yet committed on %1").arg(branchText)); |
| 2256 } else if (newBranch) { | 2256 } else if (newBranch) { |
| 2257 hgTabs->setState(tr("On %1. New branch: has not yet been committed").arg(branchText)); | 2257 m_hgTabs->setState(tr("On %1. New branch: has not yet been committed").arg(branchText)); |
| 2258 } else if (canUpdate) { | 2258 } else if (canUpdate) { |
| 2259 if (hgTabs->haveChangesToCommit()) { | 2259 if (m_hgTabs->haveChangesToCommit()) { |
| 2260 // have uncommitted changes | 2260 // have uncommitted changes |
| 2261 hgTabs->setState(tr("On %1. Not at the head of the branch").arg(branchText)); | 2261 m_hgTabs->setState(tr("On %1. Not at the head of the branch").arg(branchText)); |
| 2262 } else { | 2262 } else { |
| 2263 // no uncommitted changes | 2263 // no uncommitted changes |
| 2264 hgTabs->setState(tr("On %1. Not at the head of the branch: consider updating").arg(branchText)); | 2264 m_hgTabs->setState(tr("On %1. Not at the head of the branch: consider updating").arg(branchText)); |
| 2265 } | 2265 } |
| 2266 } else if (currentBranchHeads > 1) { | 2266 } else if (m_currentBranchHeads > 1) { |
| 2267 hgTabs->setState(tr("At one of %n heads of %1", "", currentBranchHeads).arg(branchText)); | 2267 m_hgTabs->setState(tr("At one of %n heads of %1", "", m_currentBranchHeads).arg(branchText)); |
| 2268 } else { | 2268 } else { |
| 2269 hgTabs->setState(tr("At the head of %1").arg(branchText)); | 2269 m_hgTabs->setState(tr("At the head of %1").arg(branchText)); |
| 2270 } | 2270 } |
| 2271 } | 2271 } |
| 2272 | 2272 |
| 2273 void MainWindow::createActions() | 2273 void MainWindow::createActions() |
| 2274 { | 2274 { |
| 2275 //File actions | 2275 //File actions |
| 2276 openAct = new QAction(QIcon(":/images/fileopen.png"), tr("Open..."), this); | 2276 m_openAct = new QAction(QIcon(":/images/fileopen.png"), tr("Open..."), this); |
| 2277 openAct -> setStatusTip(tr("Open an existing repository or working folder")); | 2277 m_openAct -> setStatusTip(tr("Open an existing repository or working folder")); |
| 2278 | 2278 |
| 2279 changeRemoteRepoAct = new QAction(tr("Change Remote Location..."), this); | 2279 m_changeRemoteRepoAct = new QAction(tr("Change Remote Location..."), this); |
| 2280 changeRemoteRepoAct->setStatusTip(tr("Change the default remote repository for pull and push actions")); | 2280 m_changeRemoteRepoAct->setStatusTip(tr("Change the default remote repository for pull and push actions")); |
| 2281 | 2281 |
| 2282 settingsAct = new QAction(QIcon(":/images/settings.png"), tr("Settings..."), this); | 2282 m_settingsAct = new QAction(QIcon(":/images/settings.png"), tr("Settings..."), this); |
| 2283 settingsAct -> setStatusTip(tr("View and change application settings")); | 2283 m_settingsAct -> setStatusTip(tr("View and change application settings")); |
| 2284 | 2284 |
| 2285 exitAct = new QAction(QIcon(":/images/exit.png"), tr("Quit"), this); | 2285 m_exitAct = new QAction(QIcon(":/images/exit.png"), tr("Quit"), this); |
| 2286 exitAct->setShortcuts(QKeySequence::Quit); | 2286 m_exitAct->setShortcuts(QKeySequence::Quit); |
| 2287 exitAct->setStatusTip(tr("Quit EasyMercurial")); | 2287 m_exitAct->setStatusTip(tr("Quit EasyMercurial")); |
| 2288 | 2288 |
| 2289 //Repository actions | 2289 //Repository actions |
| 2290 hgRefreshAct = new QAction(QIcon(":/images/status.png"), tr("Refresh"), this); | 2290 m_hgRefreshAct = new QAction(QIcon(":/images/status.png"), tr("Refresh"), this); |
| 2291 hgRefreshAct->setStatusTip(tr("Refresh the window to show the current state of the working folder")); | 2291 m_hgRefreshAct->setStatusTip(tr("Refresh the window to show the current state of the working folder")); |
| 2292 | 2292 |
| 2293 hgIncomingAct = new QAction(QIcon(":/images/incoming.png"), tr("Preview"), this); | 2293 m_hgIncomingAct = new QAction(QIcon(":/images/incoming.png"), tr("Preview"), this); |
| 2294 hgIncomingAct -> setStatusTip(tr("See what changes are available in the remote repository waiting to be pulled")); | 2294 m_hgIncomingAct -> setStatusTip(tr("See what changes are available in the remote repository waiting to be pulled")); |
| 2295 | 2295 |
| 2296 hgPullAct = new QAction(QIcon(":/images/pull.png"), tr("Pull"), this); | 2296 m_hgPullAct = new QAction(QIcon(":/images/pull.png"), tr("Pull"), this); |
| 2297 hgPullAct -> setStatusTip(tr("Pull changes from the remote repository to the local repository")); | 2297 m_hgPullAct -> setStatusTip(tr("Pull changes from the remote repository to the local repository")); |
| 2298 | 2298 |
| 2299 hgPushAct = new QAction(QIcon(":/images/push.png"), tr("Push"), this); | 2299 m_hgPushAct = new QAction(QIcon(":/images/push.png"), tr("Push"), this); |
| 2300 hgPushAct->setStatusTip(tr("Push changes from the local repository to the remote repository")); | 2300 m_hgPushAct->setStatusTip(tr("Push changes from the local repository to the remote repository")); |
| 2301 | 2301 |
| 2302 //Workfolder actions | 2302 //Workfolder actions |
| 2303 hgFolderDiffAct = new QAction(QIcon(":/images/folderdiff.png"), tr("Diff"), this); | 2303 m_hgFolderDiffAct = new QAction(QIcon(":/images/folderdiff.png"), tr("Diff"), this); |
| 2304 hgFolderDiffAct->setStatusTip(tr("See what has changed in the working folder compared with the last committed state")); | 2304 m_hgFolderDiffAct->setStatusTip(tr("See what has changed in the working folder compared with the last committed state")); |
| 2305 | 2305 |
| 2306 hgRevertAct = new QAction(QIcon(":/images/undo.png"), tr("Revert"), this); | 2306 m_hgRevertAct = new QAction(QIcon(":/images/undo.png"), tr("Revert"), this); |
| 2307 hgRevertAct->setStatusTip(tr("Throw away your changes and return to the last committed state")); | 2307 m_hgRevertAct->setStatusTip(tr("Throw away your changes and return to the last committed state")); |
| 2308 | 2308 |
| 2309 hgAddAct = new QAction(QIcon(":/images/add.png"), tr("Add"), this); | 2309 m_hgAddAct = new QAction(QIcon(":/images/add.png"), tr("Add"), this); |
| 2310 hgAddAct -> setStatusTip(tr("Mark the selected file(s) to be added on the next commit")); | 2310 m_hgAddAct -> setStatusTip(tr("Mark the selected file(s) to be added on the next commit")); |
| 2311 | 2311 |
| 2312 //!!! needs to be modified for number | 2312 //!!! needs to be modified for number |
| 2313 hgRemoveAct = new QAction(QIcon(":/images/remove.png"), tr("Remove"), this); | 2313 m_hgRemoveAct = new QAction(QIcon(":/images/remove.png"), tr("Remove"), this); |
| 2314 hgRemoveAct -> setStatusTip(tr("Mark the selected file(s) to be removed from version control on the next commit")); | 2314 m_hgRemoveAct -> setStatusTip(tr("Mark the selected file(s) to be removed from version control on the next commit")); |
| 2315 | 2315 |
| 2316 hgUpdateAct = new QAction(QIcon(":/images/update.png"), tr("Update"), this); | 2316 m_hgUpdateAct = new QAction(QIcon(":/images/update.png"), tr("Update"), this); |
| 2317 hgUpdateAct->setStatusTip(tr("Update the working folder to the head of the current repository branch")); | 2317 m_hgUpdateAct->setStatusTip(tr("Update the working folder to the head of the current repository branch")); |
| 2318 | 2318 |
| 2319 //!!! needs to be modified when files selected | 2319 //!!! needs to be modified when files selected |
| 2320 hgCommitAct = new QAction(QIcon(":/images/commit.png"), tr("Commit"), this); | 2320 m_hgCommitAct = new QAction(QIcon(":/images/commit.png"), tr("Commit"), this); |
| 2321 hgCommitAct->setStatusTip(tr("Commit your changes to the local repository")); | 2321 m_hgCommitAct->setStatusTip(tr("Commit your changes to the local repository")); |
| 2322 | 2322 |
| 2323 hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this); | 2323 m_hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this); |
| 2324 hgMergeAct->setStatusTip(tr("Merge the two independent sets of changes in the local repository into the working folder")); | 2324 m_hgMergeAct->setStatusTip(tr("Merge the two independent sets of changes in the local repository into the working folder")); |
| 2325 | 2325 |
| 2326 //Advanced actions | 2326 //Advanced actions |
| 2327 //!!! needs to be modified for number | 2327 //!!! needs to be modified for number |
| 2328 hgAnnotateAct = new QAction(tr("Annotate"), this); | 2328 m_hgAnnotateAct = new QAction(tr("Annotate"), this); |
| 2329 hgAnnotateAct -> setStatusTip(tr("Show line-by-line version information for selected file")); | 2329 m_hgAnnotateAct -> setStatusTip(tr("Show line-by-line version information for selected file")); |
| 2330 | 2330 |
| 2331 hgIgnoreAct = new QAction(tr("Edit .hgignore File"), this); | 2331 m_hgIgnoreAct = new QAction(tr("Edit .hgignore File"), this); |
| 2332 hgIgnoreAct -> setStatusTip(tr("Edit the .hgignore file, containing the names of files that should be ignored by Mercurial")); | 2332 m_hgIgnoreAct -> setStatusTip(tr("Edit the .hgignore file, containing the names of files that should be ignored by Mercurial")); |
| 2333 | 2333 |
| 2334 hgServeAct = new QAction(tr("Serve via HTTP"), this); | 2334 m_hgServeAct = new QAction(tr("Serve via HTTP"), this); |
| 2335 hgServeAct -> setStatusTip(tr("Serve local repository via http for workgroup access")); | 2335 m_hgServeAct -> setStatusTip(tr("Serve local repository via http for workgroup access")); |
| 2336 | 2336 |
| 2337 //Help actions | 2337 //Help actions |
| 2338 aboutAct = new QAction(tr("About EasyMercurial"), this); | 2338 m_aboutAct = new QAction(tr("About EasyMercurial"), this); |
| 2339 | 2339 |
| 2340 // Miscellaneous | 2340 // Miscellaneous |
| 2341 QShortcut *clearSelectionsShortcut = new QShortcut(Qt::Key_Escape, this); | 2341 QShortcut *clearSelectionsShortcut = new QShortcut(Qt::Key_Escape, this); |
| 2342 connect(clearSelectionsShortcut, SIGNAL(activated()), | 2342 connect(clearSelectionsShortcut, SIGNAL(activated()), |
| 2343 this, SLOT(clearSelections())); | 2343 this, SLOT(clearSelections())); |
| 2344 } | 2344 } |
| 2345 | 2345 |
| 2346 void MainWindow::createMenus() | 2346 void MainWindow::createMenus() |
| 2347 { | 2347 { |
| 2348 fileMenu = menuBar()->addMenu(tr("File")); | 2348 m_fileMenu = menuBar()->addMenu(tr("File")); |
| 2349 | 2349 |
| 2350 fileMenu -> addAction(openAct); | 2350 m_fileMenu -> addAction(m_openAct); |
| 2351 fileMenu -> addAction(changeRemoteRepoAct); | 2351 m_fileMenu -> addAction(m_changeRemoteRepoAct); |
| 2352 fileMenu -> addSeparator(); | 2352 m_fileMenu -> addSeparator(); |
| 2353 | 2353 |
| 2354 advancedMenu = fileMenu->addMenu(tr("Advanced")); | 2354 m_advancedMenu = m_fileMenu->addMenu(tr("Advanced")); |
| 2355 | 2355 |
| 2356 fileMenu -> addAction(settingsAct); | 2356 m_fileMenu -> addAction(m_settingsAct); |
| 2357 | 2357 |
| 2358 fileMenu -> addSeparator(); | 2358 m_fileMenu -> addSeparator(); |
| 2359 fileMenu -> addAction(exitAct); | 2359 m_fileMenu -> addAction(m_exitAct); |
| 2360 | 2360 |
| 2361 advancedMenu -> addAction(hgIgnoreAct); | 2361 m_advancedMenu -> addAction(m_hgIgnoreAct); |
| 2362 advancedMenu -> addSeparator(); | 2362 m_advancedMenu -> addSeparator(); |
| 2363 advancedMenu -> addAction(hgServeAct); | 2363 m_advancedMenu -> addAction(m_hgServeAct); |
| 2364 | 2364 |
| 2365 helpMenu = menuBar()->addMenu(tr("Help")); | 2365 m_helpMenu = menuBar()->addMenu(tr("Help")); |
| 2366 helpMenu->addAction(aboutAct); | 2366 m_helpMenu->addAction(m_aboutAct); |
| 2367 } | 2367 } |
| 2368 | 2368 |
| 2369 void MainWindow::createToolBars() | 2369 void MainWindow::createToolBars() |
| 2370 { | 2370 { |
| 2371 fileToolBar = addToolBar(tr("File")); | 2371 m_fileToolBar = addToolBar(tr("File")); |
| 2372 fileToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE)); | 2372 m_fileToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE)); |
| 2373 fileToolBar -> addAction(openAct); | 2373 m_fileToolBar -> addAction(m_openAct); |
| 2374 fileToolBar -> addAction(hgRefreshAct); | 2374 m_fileToolBar -> addAction(m_hgRefreshAct); |
| 2375 fileToolBar -> addSeparator(); | 2375 m_fileToolBar -> addSeparator(); |
| 2376 fileToolBar -> setMovable(false); | 2376 m_fileToolBar -> setMovable(false); |
| 2377 | 2377 |
| 2378 repoToolBar = addToolBar(tr(REPOMENU_TITLE)); | 2378 m_repoToolBar = addToolBar(tr(REPOMENU_TITLE)); |
| 2379 repoToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE)); | 2379 m_repoToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE)); |
| 2380 repoToolBar->addAction(hgIncomingAct); | 2380 m_repoToolBar->addAction(m_hgIncomingAct); |
| 2381 repoToolBar->addAction(hgPullAct); | 2381 m_repoToolBar->addAction(m_hgPullAct); |
| 2382 repoToolBar->addAction(hgPushAct); | 2382 m_repoToolBar->addAction(m_hgPushAct); |
| 2383 repoToolBar -> setMovable(false); | 2383 m_repoToolBar -> setMovable(false); |
| 2384 | 2384 |
| 2385 workFolderToolBar = addToolBar(tr(WORKFOLDERMENU_TITLE)); | 2385 m_workFolderToolBar = addToolBar(tr(WORKFOLDERMENU_TITLE)); |
| 2386 addToolBar(Qt::LeftToolBarArea, workFolderToolBar); | 2386 addToolBar(Qt::LeftToolBarArea, m_workFolderToolBar); |
| 2387 workFolderToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE)); | 2387 m_workFolderToolBar -> setIconSize(QSize(MY_ICON_SIZE, MY_ICON_SIZE)); |
| 2388 workFolderToolBar->addAction(hgFolderDiffAct); | 2388 m_workFolderToolBar->addAction(m_hgFolderDiffAct); |
| 2389 workFolderToolBar->addSeparator(); | 2389 m_workFolderToolBar->addSeparator(); |
| 2390 workFolderToolBar->addAction(hgRevertAct); | 2390 m_workFolderToolBar->addAction(m_hgRevertAct); |
| 2391 workFolderToolBar->addAction(hgUpdateAct); | 2391 m_workFolderToolBar->addAction(m_hgUpdateAct); |
| 2392 workFolderToolBar->addAction(hgCommitAct); | 2392 m_workFolderToolBar->addAction(m_hgCommitAct); |
| 2393 workFolderToolBar->addAction(hgMergeAct); | 2393 m_workFolderToolBar->addAction(m_hgMergeAct); |
| 2394 workFolderToolBar->addSeparator(); | 2394 m_workFolderToolBar->addSeparator(); |
| 2395 workFolderToolBar->addAction(hgAddAct); | 2395 m_workFolderToolBar->addAction(m_hgAddAct); |
| 2396 workFolderToolBar->addAction(hgRemoveAct); | 2396 m_workFolderToolBar->addAction(m_hgRemoveAct); |
| 2397 workFolderToolBar -> setMovable(false); | 2397 m_workFolderToolBar -> setMovable(false); |
| 2398 | 2398 |
| 2399 updateToolBarStyle(); | 2399 updateToolBarStyle(); |
| 2400 } | 2400 } |
| 2401 | 2401 |
| 2402 void MainWindow::updateToolBarStyle() | 2402 void MainWindow::updateToolBarStyle() |
| 2425 { | 2425 { |
| 2426 QDir workFolder; | 2426 QDir workFolder; |
| 2427 | 2427 |
| 2428 QSettings settings; | 2428 QSettings settings; |
| 2429 | 2429 |
| 2430 remoteRepoPath = settings.value("remoterepopath", "").toString(); | 2430 m_remoteRepoPath = settings.value("remoterepopath", "").toString(); |
| 2431 workFolderPath = settings.value("workfolderpath", "").toString(); | 2431 m_workFolderPath = settings.value("workfolderpath", "").toString(); |
| 2432 if (!workFolder.exists(workFolderPath)) | 2432 if (!workFolder.exists(m_workFolderPath)) |
| 2433 { | 2433 { |
| 2434 workFolderPath = ""; | 2434 m_workFolderPath = ""; |
| 2435 } | 2435 } |
| 2436 | 2436 |
| 2437 QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); | 2437 QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); |
| 2438 QSize size = settings.value("size", QSize(400, 400)).toSize(); | 2438 QSize size = settings.value("size", QSize(400, 400)).toSize(); |
| 2439 firstStart = settings.value("firststart", QVariant(true)).toBool(); | 2439 m_firstStart = settings.value("firststart", QVariant(true)).toBool(); |
| 2440 | 2440 |
| 2441 //!!! initialFileTypesBits = (unsigned char) settings.value("viewFileTypes", QVariant(DEFAULT_HG_STAT_BITS)).toInt(); | 2441 //!!! initialFileTypesBits = (unsigned char) settings.value("viewFileTypes", QVariant(DEFAULT_HG_STAT_BITS)).toInt(); |
| 2442 resize(size); | 2442 resize(size); |
| 2443 move(pos); | 2443 move(pos); |
| 2444 } | 2444 } |
| 2447 void MainWindow::writeSettings() | 2447 void MainWindow::writeSettings() |
| 2448 { | 2448 { |
| 2449 QSettings settings; | 2449 QSettings settings; |
| 2450 settings.setValue("pos", pos()); | 2450 settings.setValue("pos", pos()); |
| 2451 settings.setValue("size", size()); | 2451 settings.setValue("size", size()); |
| 2452 settings.setValue("remoterepopath", remoteRepoPath); | 2452 settings.setValue("remoterepopath", m_remoteRepoPath); |
| 2453 settings.setValue("workfolderpath", workFolderPath); | 2453 settings.setValue("workfolderpath", m_workFolderPath); |
| 2454 settings.setValue("firststart", firstStart); | 2454 settings.setValue("firststart", m_firstStart); |
| 2455 //!!!settings.setValue("viewFileTypes", hgTabs -> getFileTypesBits()); | 2455 //!!!settings.setValue("viewFileTypes", m_hgTabs -> getFileTypesBits()); |
| 2456 } | 2456 } |
| 2457 | 2457 |
| 2458 | 2458 |
| 2459 | 2459 |
| 2460 | 2460 |
