comparison ui/trayicon.cpp @ 1151:22b3daa4e464

Merged
author Sascha Wilde <wilde@intevation.de>
date Thu, 18 Sep 2014 13:29:32 +0200
parents a4282bc67a8b
children 5f4e77acb2f3
comparison
equal deleted inserted replaced
1150:a72d59f8c3ea 1151:22b3daa4e464
35 } 35 }
36 QSystemTrayIcon::show(); 36 QSystemTrayIcon::show();
37 } 37 }
38 38
39 void TrayIcon::showMessage(const QString &title, const QString &msg, 39 void TrayIcon::showMessage(const QString &title, const QString &msg,
40 QSystemTrayIcon::MessageIcon msg_icon, int msecs) { 40 QSystemTrayIcon::MessageIcon msg_icon, int msecs,
41 const QString &okBtnText) {
41 if (!useAlt) { 42 if (!useAlt) {
42 QSystemTrayIcon::showMessage(title, msg, msg_icon, msecs); 43 QSystemTrayIcon::showMessage(title, msg, msg_icon, msecs);
43 return; 44 return;
44 } 45 }
45 if (!mMessageBox) { 46 if (!mMessageBox) {
49 connect(mMessageBox->button(QMessageBox::Ok), SIGNAL(clicked()), this, SIGNAL(messageClicked())); 50 connect(mMessageBox->button(QMessageBox::Ok), SIGNAL(clicked()), this, SIGNAL(messageClicked()));
50 connect(mMessageBox, SIGNAL(destroyed()), this, SLOT(messageDestroyed())); 51 connect(mMessageBox, SIGNAL(destroyed()), this, SLOT(messageDestroyed()));
51 } 52 }
52 mMessageBox->setIconPixmap(icon().pixmap(mMessageBox->iconPixmap().size())); 53 mMessageBox->setIconPixmap(icon().pixmap(mMessageBox->iconPixmap().size()));
53 mMessageBox->setWindowIcon(icon()); 54 mMessageBox->setWindowIcon(icon());
54 mMessageBox->button(QMessageBox::Ok)->setText (tr("Install update")); 55 if (!okBtnText.isEmpty()) {
56 mMessageBox->button(QMessageBox::Ok)->setText (okBtnText);
57 } else {
58 mMessageBox->button(QMessageBox::Ok)->setText (tr("Install update"));
59 }
55 mMessageBox->button(QMessageBox::No)->setText (tr("Remind me later")); 60 mMessageBox->button(QMessageBox::No)->setText (tr("Remind me later"));
56 mMessageBox->show(); 61 mMessageBox->show();
57 } 62 }
58 63
59 void TrayIcon::messageDestroyed() { 64 void TrayIcon::messageDestroyed() {

http://wald.intevation.org/projects/trustbridge/