comparison src/mainwindow.cpp @ 648:b55466f7b8bf

Adjust text when closing something that is only a single sprout of a branch -- and don't warn when closing a sprout of the default branch (it's not the same thing as closing the default branch)
author Chris Cannam
date Thu, 24 Jan 2013 14:02:50 +0000
parents a03264984ef8
children a16d0d70b1ee
comparison
equal deleted inserted replaced
647:a03264984ef8 648:b55466f7b8bf
569 QString cf(tr("Close branch")); 569 QString cf(tr("Close branch"));
570 QString comment; 570 QString comment;
571 571
572 QString defaultWarning; 572 QString defaultWarning;
573 573
574 bool haveSprouts = (m_hgMergeAct->isEnabled());
575
574 QString branchText; 576 QString branchText;
575 if (m_currentBranch == "" || m_currentBranch == "default") { 577 if (m_currentBranch == "" || m_currentBranch == "default") {
576 branchText = tr("the default branch"); 578 branchText = tr("the default branch");
577 defaultWarning = tr("<p><b>Warning:</b> you are asking to close the default branch. This is not usually a good idea!</p>"); 579 if (!haveSprouts) {
580 defaultWarning = tr("<p><b>Warning:</b> you are asking to close the default branch. This is not usually a good idea!</p>");
581 }
578 } else { 582 } else {
579 branchText = tr("branch \"%1\"").arg(m_currentBranch); 583 branchText = tr("branch \"%1\"").arg(m_currentBranch);
584 }
585
586 if (haveSprouts) {
587 branchText = tr("a sub-branch of %1").arg(branchText);
580 } 588 }
581 589
582 if (ConfirmCommentDialog::confirmAndGetLongComment 590 if (ConfirmCommentDialog::confirmAndGetLongComment
583 (this, 591 (this,
584 cf, 592 cf,