comparison mainwindow.cpp @ 148:2fef6b0dfbe8

* Some implementation of right-button menu actions on changeset item
author Chris Cannam
date Wed, 01 Dec 2010 21:02:53 +0000
parents 465c8d51c6d5
children 38faf16df9b6
comparison
equal deleted inserted replaced
147:465c8d51c6d5 148:2fef6b0dfbe8
445 445
446 QStringList params; 446 QStringList params;
447 447
448 // Diff parent against working folder (folder diff) 448 // Diff parent against working folder (folder diff)
449 449
450 params << "--config" << "extensions.extdiff=" << "extdiff" << "-p"; 450 params << "--config" << "extensions.extdiff=" << "extdiff";
451 params << diffBinaryName; 451 params << "--program" << diffBinaryName;
452 452
453 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params)); 453 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params));
454 } 454 }
455 455
456 456
457 void MainWindow::hgChgSetDiff() 457 void MainWindow::hgDiffToCurrent(QString id)
458 { 458 {
459 QStringList params; 459 QStringList params;
460 460
461 //Diff 2 history log versions against each other 461 // Diff given revision against working folder
462 QString revA; 462
463 QString revB; 463 params << "--config" << "extensions.extdiff=" << "extdiff";
464 /*!!! 464 params << "--program" << diffBinaryName;
465 hgTabs -> getHistoryDiffRevisions(revA, revB); 465 params << "--rev" << id;
466 466
467 if ((!revA.isEmpty()) && (!revB.isEmpty())) 467 runner->requestAction(HgAction(ACT_FOLDERDIFF, workFolderPath, params));
468 { 468 }
469 params << "kdiff3" << "--rev" << revA << "--rev" << revB; 469
470 runner -> startHgCommand(workFolderPath, params); 470
471 runningAction = ACT_CHGSETDIFF; 471 void MainWindow::hgDiffToParent(QString child, QString parent)
472 } 472 {
473 else 473 QStringList params;
474 { 474
475 QMessageBox::information(this, tr("Changeset diff"), tr("Please select two changesets from history list or heads list first.")); 475 // Diff given revision against working folder
476 } 476
477 */ 477 params << "--config" << "extensions.extdiff=" << "extdiff";
478 } 478 params << "--program" << diffBinaryName;
479 479 params << "--rev" << parent << "--rev" << child;
480
481 runner->requestAction(HgAction(ACT_CHGSETDIFF, workFolderPath, params));
482 }
480 483
481 484
482 void MainWindow::hgUpdate() 485 void MainWindow::hgUpdate()
483 { 486 {
484 QStringList params; 487 QStringList params;
487 490
488 runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params)); 491 runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params));
489 } 492 }
490 493
491 494
492 void MainWindow::hgUpdateToRev() 495 void MainWindow::hgUpdateToRev(QString id)
493 { 496 {
494 QStringList params; 497 QStringList params;
495 QString rev; 498
496 /*!!! 499 params << "update" << "--rev" << id << "--check";
497 hgTabs -> getUpdateToRevRevision(rev); 500
498 501 runner->requestAction(HgAction(ACT_UPDATE, workFolderPath, params));
499 hgTabs -> setCurrentIndex(WORKTAB);
500 enableDisableActions();
501
502 params << "update" << "--rev" << rev << "--clean";
503
504 runner -> startHgCommand(workFolderPath, params);
505
506 runningAction = ACT_UPDATE;
507 */
508
509 } 502 }
510 503
511 504
512 void MainWindow::hgRevert() 505 void MainWindow::hgRevert()
513 { 506 {
546 void MainWindow::hgMerge() 539 void MainWindow::hgMerge()
547 { 540 {
548 QStringList params; 541 QStringList params;
549 542
550 params << "merge"; 543 params << "merge";
544
545 runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params));
546 }
547
548
549 void MainWindow::hgMergeFrom(QString id)
550 {
551 QStringList params;
552
553 params << "merge";
554 params << "--rev" << id;
551 555
552 runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params)); 556 runner->requestAction(HgAction(ACT_MERGE, workFolderPath, params));
553 } 557 }
554 558
555 559
1389 connect(hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull())); 1393 connect(hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull()));
1390 connect(hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush())); 1394 connect(hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush()));
1391 1395
1392 // connect(hgTabs, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int))); 1396 // connect(hgTabs, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
1393 1397
1394 connect(hgUpdateToRevAct, SIGNAL(triggered()), this, SLOT(hgUpdateToRev())); 1398 // connect(hgUpdateToRevAct, SIGNAL(triggered()), this, SLOT(hgUpdateToRev()));
1395 connect(hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate())); 1399 connect(hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate()));
1396 connect(hgResolveListAct, SIGNAL(triggered()), this, SLOT(hgResolveList())); 1400 connect(hgResolveListAct, SIGNAL(triggered()), this, SLOT(hgResolveList()));
1397 connect(hgResolveMarkAct, SIGNAL(triggered()), this, SLOT(hgResolveMark())); 1401 connect(hgResolveMarkAct, SIGNAL(triggered()), this, SLOT(hgResolveMark()));
1398 connect(hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe())); 1402 connect(hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe()));
1399 connect(clearSelectionsAct, SIGNAL(triggered()), this, SLOT(clearSelections())); 1403 connect(clearSelectionsAct, SIGNAL(triggered()), this, SLOT(clearSelections()));
1407 connect(hgTabs, SIGNAL(revert()), 1411 connect(hgTabs, SIGNAL(revert()),
1408 this, SLOT(hgRevert())); 1412 this, SLOT(hgRevert()));
1409 1413
1410 connect(hgTabs, SIGNAL(diffWorkingFolder()), 1414 connect(hgTabs, SIGNAL(diffWorkingFolder()),
1411 this, SLOT(hgFolderDiff())); 1415 this, SLOT(hgFolderDiff()));
1412 /*!!!! 1416
1413 connect(hgTabs, SIGNAL(updateTo(QString)), 1417 connect(hgTabs, SIGNAL(updateTo(QString)),
1414 this, SIGNAL(updateTo(QString))); 1418 this, SLOT(hgUpdateToRev(QString)));
1415 1419
1416 connect(hgTabs, SIGNAL(diffToCurrent(QString)), 1420 connect(hgTabs, SIGNAL(diffToCurrent(QString)),
1417 this, SIGNAL(diffToCurrent(QString))); 1421 this, SLOT(hgDiffToCurrent(QString)));
1418 1422
1419 connect(hgTabs, SIGNAL(diffToPrevious(QString)), 1423 connect(hgTabs, SIGNAL(diffToParent(QString, QString)),
1420 this, SIGNAL(diffToPrevious(QString))); 1424 this, SLOT(hgDiffToParent(QString, QString)));
1421 1425
1422 connect(hgTabs, SIGNAL(mergeFrom(QString)), 1426 connect(hgTabs, SIGNAL(mergeFrom(QString)),
1423 this, SIGNAL(mergeFrom(QString))); 1427 this, SLOT(hgMergeFrom(QString)));
1424 1428 /*
1425 connect(hgTabs, SIGNAL(tag(QString)), 1429 connect(hgTabs, SIGNAL(tag(QString)),
1426 this, SIGNAL(tag(QString))); 1430 this, SLOT(hgTag(QString)));
1427 */ 1431 */
1428 } 1432 }
1429 1433
1430 /*!!! 1434 /*!!!
1431 void MainWindow::tabChanged(int currTab) 1435 void MainWindow::tabChanged(int currTab)
1633 1637
1634 hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this); 1638 hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this);
1635 hgMergeAct->setStatusTip(tr("Merge two local repository changesets to working folder")); 1639 hgMergeAct->setStatusTip(tr("Merge two local repository changesets to working folder"));
1636 1640
1637 //Advanced actions 1641 //Advanced actions
1638 hgUpdateToRevAct = new QAction(tr("Update to revision"), this); 1642 /* hgUpdateToRevAct = new QAction(tr("Update to revision"), this);
1639 hgUpdateToRevAct -> setStatusTip(tr("Update working folder to version selected from history list")); 1643 hgUpdateToRevAct -> setStatusTip(tr("Update working folder to version selected from history list"));
1640 1644 */
1641 hgAnnotateAct = new QAction(tr("Annotate"), this); 1645 hgAnnotateAct = new QAction(tr("Annotate"), this);
1642 hgAnnotateAct -> setStatusTip(tr("Show line-by-line version information for selected file")); 1646 hgAnnotateAct -> setStatusTip(tr("Show line-by-line version information for selected file"));
1643 1647
1644 hgResolveListAct = new QAction(tr("Resolve (list)"), this); 1648 hgResolveListAct = new QAction(tr("Resolve (list)"), this);
1645 hgResolveListAct -> setStatusTip(tr("Resolve (list): Show list of files needing merge")); 1649 hgResolveListAct -> setStatusTip(tr("Resolve (list): Show list of files needing merge"));