comparison incomingdialog.cpp @ 307:5b4aa1c24407 new-branches-with-status-outside-tabs

Merge branch status_outside_tabs into branch new-branches, and make a new branch
author Chris Cannam
date Mon, 28 Feb 2011 13:09:37 +0000
parents 5e4a10af7945
children
comparison
equal deleted inserted replaced
278:f7cdd5b31aed 307:5b4aa1c24407
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);
76 } 79 }
77 80
78 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); 81 QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok);
79 connect(bb, SIGNAL(accepted()), this, SLOT(accept())); 82 connect(bb, SIGNAL(accepted()), this, SLOT(accept()));
80 layout->addWidget(bb, 2, 0, 1, 2); 83 layout->addWidget(bb, 2, 0, 1, 2);
84
85 layout->setColumnStretch(1, 20);
86 setMinimumWidth(400);
81 } 87 }
82 88
83 89