comparison incomingdialog.cpp @ 298:fd9dc5a457d8

* Make "More Details" button non-auto-default in more-info dialog * Make Incoming dialog show same message as in Pull dialog when no changes are pending * Try to make the confirm-push/pull dialogs look more in-keeping on OS/X... but mostly we end up making their text too small. Hmm.
author Chris Cannam
date Tue, 22 Feb 2011 15:12:56 +0000
parents 8fd71f570884
children 5e4a10af7945
comparison
equal deleted inserted replaced
295:01a471e9cbe3 298:fd9dc5a457d8
38 head = tr("No changes waiting to pull"); 38 head = tr("No changes waiting to pull");
39 if (text.trimmed() != "") { 39 if (text.trimmed() != "") {
40 body = QString("<p>%1</p><code>%2</code>") 40 body = QString("<p>%1</p><code>%2</code>")
41 .arg(tr("The command output was:")) 41 .arg(tr("The command output was:"))
42 .arg(xmlEncode(text).replace("\n", "<br>")); 42 .arg(xmlEncode(text).replace("\n", "<br>"));
43 } 43 } else {
44 body = tr("<qt>Your local repository already contains all changes found in the remote repository.</qt>");
45 }
44 scroll = false; 46 scroll = false;
45 } else { 47 } else {
46 head = tr("There are %n change(s) ready to pull", "", csets.size()); 48 head = tr("There are %n change(s) ready to pull", "", csets.size());
47 foreach (Changeset *cs, csets) { 49 foreach (Changeset *cs, csets) {
48 body += cs->formatHtml() + "<p>"; 50 body += cs->formatHtml() + "<p>";
57 QLabel *info = new QLabel; 59 QLabel *info = new QLabel;
58 QStyle *style = qApp->style(); 60 QStyle *style = qApp->style();
59 int iconSize = style->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, this); 61 int iconSize = style->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, this);
60 info->setPixmap(style->standardIcon(QStyle::SP_MessageBoxInformation, 0, this) 62 info->setPixmap(style->standardIcon(QStyle::SP_MessageBoxInformation, 0, this)
61 .pixmap(iconSize, iconSize)); 63 .pixmap(iconSize, iconSize));
62 layout->addWidget(info, 0, 0); 64 layout->addWidget(info, 0, 0, 2, 1);
63 65
64 QLabel *headLabel = new QLabel(QString("<qt><h3>%1</h3></qt>").arg(head)); 66 QLabel *headLabel = new QLabel(QString("<qt><h3>%1</h3></qt>").arg(head));
65 layout->addWidget(headLabel, 0, 1); 67 layout->addWidget(headLabel, 0, 1);
66 68
67 QLabel *textLabel = new QLabel(body); 69 QLabel *textLabel = new QLabel(body);
70 if (csets.empty()) textLabel->setWordWrap(true);
68 71
69 if (scroll) { 72 if (scroll) {
70 QScrollArea *sa = new QScrollArea; 73 QScrollArea *sa = new QScrollArea;
71 layout->addWidget(sa, 1, 1); 74 layout->addWidget(sa, 1, 1);
72 layout->setRowStretch(1, 20); 75 layout->setRowStretch(1, 20);