# HG changeset patch # User Chris Cannam # Date 1298389942 0 # Node ID 3bb6b63420adb332a677c38441f24b28aa4f6ea5 # Parent e4284fab6962851febf965ba517bf6f271ac1a52# Parent 5e4a10af7945d7a10bfe9d3e220f141269af054a Merge from the default branch diff -r e4284fab6962 -r 3bb6b63420ad confirmcommentdialog.cpp --- a/confirmcommentdialog.cpp Tue Feb 22 13:12:16 2011 +0000 +++ b/confirmcommentdialog.cpp Tue Feb 22 15:52:22 2011 +0000 @@ -73,26 +73,33 @@ QString ConfirmCommentDialog::buildFilesText(QString intro, QStringList files) { QString text; - text = "" + intro; - text += "

"; + + if (intro == "") text = ""; + else text = "" + intro + "

"; + + text += ""; foreach (QString file, files) { text += "   " + xmlEncode(file) + "
"; } text += "
"; + return text; } bool ConfirmCommentDialog::confirm(QWidget *parent, QString title, + QString head, QString text, QString okButtonText) { QMessageBox box(QMessageBox::Question, title, - text, + head, QMessageBox::Cancel, parent); + box.setInformativeText(text); + QPushButton *ok = box.addButton(QMessageBox::Ok); ok->setText(okButtonText); box.setDefaultButton(QMessageBox::Ok); @@ -102,15 +109,18 @@ bool ConfirmCommentDialog::confirmDangerous(QWidget *parent, QString title, + QString head, QString text, QString okButtonText) { QMessageBox box(QMessageBox::Warning, title, - text, + head, QMessageBox::Cancel, parent); + box.setInformativeText(text); + QPushButton *ok = box.addButton(QMessageBox::Ok); ok->setText(okButtonText); box.setDefaultButton(QMessageBox::Cancel); @@ -131,7 +141,7 @@ } else { text = "" + introTextWithCount + ""; } - return confirm(parent, title, text, okButtonText); + return confirm(parent, title, text, "", okButtonText); } bool ConfirmCommentDialog::confirmDangerousFilesAction(QWidget *parent, @@ -147,7 +157,7 @@ } else { text = "" + introTextWithCount + ""; } - return confirmDangerous(parent, title, text, okButtonText); + return confirmDangerous(parent, title, text, "", okButtonText); } bool ConfirmCommentDialog::confirmAndGetShortComment(QWidget *parent, diff -r e4284fab6962 -r 3bb6b63420ad confirmcommentdialog.h --- a/confirmcommentdialog.h Tue Feb 22 13:12:16 2011 +0000 +++ b/confirmcommentdialog.h Tue Feb 22 15:52:22 2011 +0000 @@ -32,11 +32,13 @@ public: static bool confirm(QWidget *parent, QString title, + QString head, QString text, QString okButtonText); static bool confirmDangerous(QWidget *parent, QString title, + QString head, QString text, QString okButtonText); diff -r e4284fab6962 -r 3bb6b63420ad incomingdialog.cpp --- a/incomingdialog.cpp Tue Feb 22 13:12:16 2011 +0000 +++ b/incomingdialog.cpp Tue Feb 22 15:52:22 2011 +0000 @@ -40,7 +40,9 @@ body = QString("

%1

%2") .arg(tr("The command output was:")) .arg(xmlEncode(text).replace("\n", "
")); - } + } else { + body = tr("Your local repository already contains all changes found in the remote repository."); + } scroll = false; } else { head = tr("There are %n change(s) ready to pull", "", csets.size()); @@ -59,12 +61,13 @@ int iconSize = style->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, this); info->setPixmap(style->standardIcon(QStyle::SP_MessageBoxInformation, 0, this) .pixmap(iconSize, iconSize)); - layout->addWidget(info, 0, 0); + layout->addWidget(info, 0, 0, 2, 1); QLabel *headLabel = new QLabel(QString("

%1

").arg(head)); layout->addWidget(headLabel, 0, 1); QLabel *textLabel = new QLabel(body); + if (csets.empty()) textLabel->setWordWrap(true); if (scroll) { QScrollArea *sa = new QScrollArea; @@ -78,6 +81,9 @@ QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); connect(bb, SIGNAL(accepted()), this, SLOT(accept())); layout->addWidget(bb, 2, 0, 1, 2); + + layout->setColumnStretch(1, 20); + setMinimumWidth(400); } diff -r e4284fab6962 -r 3bb6b63420ad mainwindow.cpp --- a/mainwindow.cpp Tue Feb 22 13:12:16 2011 +0000 +++ b/mainwindow.cpp Tue Feb 22 15:52:22 2011 +0000 @@ -862,9 +862,8 @@ { if (ConfirmCommentDialog::confirm (this, tr("Confirm pull"), - format3(tr("Pull from remote repository?"), - tr("You are about to pull changes from the following remote repository:"), - m_remoteRepoPath), + tr("

Pull from remote repository?

"), + tr("

You are about to pull changes from the remote repository at %1.

").arg(xmlEncode(m_remoteRepoPath)), tr("Pull"))) { QStringList params; @@ -877,9 +876,8 @@ { if (ConfirmCommentDialog::confirm (this, tr("Confirm push"), - format3(tr("Push to remote repository?"), - tr("You are about to push your changes to the following remote repository:"), - m_remoteRepoPath), + tr("

Push to remote repository?

"), + tr("

You are about to push your changes to the remote repository at %1.

").arg(xmlEncode(m_remoteRepoPath)), tr("Push"))) { QStringList params; @@ -1598,6 +1596,7 @@ int n = extractChangeCount(output); if (n > 0) { head = tr("Pushed %n changeset(s)", "", n); + report = tr("Successfully pushed to the remote repository at %1.").arg(xmlEncode(m_remoteRepoPath)); } else if (n == 0) { head = tr("No changes to push"); report = tr("The remote repository already contains all changes that have been committed locally."); diff -r e4284fab6962 -r 3bb6b63420ad moreinformationdialog.cpp --- a/moreinformationdialog.cpp Tue Feb 22 13:12:16 2011 +0000 +++ b/moreinformationdialog.cpp Tue Feb 22 15:52:22 2011 +0000 @@ -56,6 +56,7 @@ m_moreButton = bb->addButton(tr("More Details..."), QDialogButtonBox::ActionRole); + m_moreButton->setAutoDefault(false); m_moreButton->setDefault(false); connect(m_moreButton, SIGNAL(clicked()), this, SLOT(moreClicked()));