changeset 1110:b6cb4fd7ee20

(issue115) Move tooltips into body to make qt tr work
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 15 Sep 2014 19:10:57 +0200
parents 6594e8e63a25
children 9749f6f98189
files ui/mainwindow.cpp
diffstat 1 files changed, 18 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Mon Sep 15 19:02:17 2014 +0200
+++ b/ui/mainwindow.cpp	Mon Sep 15 19:10:57 2014 +0200
@@ -93,15 +93,6 @@
 #define HELP_PATH "/../share/doc/trustbridge/index.html"
 #endif
 
-#define NEW_INSTALL_TT "Certificate will be installed."
-#define NOT_INSTALL_TT "Certificate will not be installed."
-#define NEW_REMOVE_TT "Certificate will be removed."
-#define NOT_REMOVE_TT "Certificate will not be removed."
-#define IS_INSTALLED_TT "Certificate is installed."
-#define IS_NOT_INSTALLED_TT "Certifcate is not installed."
-#define IS_REMOVED_TT "Certificate has been removed."
-#define IS_NOT_REMOVED_TT "Certificate has not been removed."
-
 static void activateDetailsButton(QPushButton *);
 static void deactivateDetailsButton(QPushButton *);
 
@@ -1153,11 +1144,11 @@
                 if (!state) {
                     btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
                     btnIcon.addFile(":/img/security-low.png", QSize(48, 48), QIcon::Normal, QIcon::On);
-                    actionBtn->setProperty("ToolTip_Off", tr(NEW_INSTALL_TT));
-                    actionBtn->setProperty("ToolTip_On", tr(IS_NOT_INSTALLED_TT));
+                    actionBtn->setProperty("ToolTip_Off", tr("Certificate will be installed."));
+                    actionBtn->setProperty("ToolTip_On", tr("Certifcate is not installed."));
                 } else {
-                    actionBtn->setProperty("ToolTip_Off", tr(IS_INSTALLED_TT));
-                    actionBtn->setProperty("ToolTip_On", tr(NEW_REMOVE_TT));
+                    actionBtn->setProperty("ToolTip_Off", tr("Certificate is installed."));
+                    actionBtn->setProperty("ToolTip_On", tr("Certificate will be removed."));
                     btnIcon.addFile(":/img/security-high.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
                     btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::On);
                 }
@@ -1168,15 +1159,15 @@
                 oldRemoveCerts.append(cert);
                 QToolButton* actionBtn = new QToolButton();
                 QIcon btnIcon;
-                actionBtn->setProperty("ToolTip_Off", tr(NEW_REMOVE_TT));
-                actionBtn->setProperty("ToolTip_On", tr(IS_NOT_REMOVED_TT));
+                actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed."));
+                actionBtn->setProperty("ToolTip_On", tr("Certificate has not been removed."));
                 btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
                 btnIcon.addFile(":/img/security-medium.png", QSize(48, 48), QIcon::Normal, QIcon::On);
                 btnIcon.addFile(":/img/trash-empty.png", QSize(48, 48), QIcon::Disabled, QIcon::Off);
                 actionBtn->setIcon(btnIcon);
                 if (state) {
                     actionBtn->setEnabled(false);
-                    actionBtn->setToolTip(tr(IS_REMOVED_TT));
+                    actionBtn->setToolTip(tr("Certificate has been removed."));
                 }
                 mRemoveList->addCertificate(cert, state, actionBtn);
             }
@@ -1193,8 +1184,8 @@
                     oldInstallCerts.append(cert);
                     QToolButton* actionBtn = new QToolButton();
                     QIcon btnIcon;
-                    actionBtn->setProperty("ToolTip_Off", tr(IS_INSTALLED_TT));
-                    actionBtn->setProperty("ToolTip_On", tr(IS_NOT_INSTALLED_TT));
+                    actionBtn->setProperty("ToolTip_Off", tr("Certificate is installed."));
+                    actionBtn->setProperty("ToolTip_On", tr("Certifcate is not installed."));
                     btnIcon.addFile(":/img/security-high.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
                     btnIcon.addFile(":/img/security-low.png", QSize(48, 48), QIcon::Normal, QIcon::On);
                     actionBtn->setIcon(btnIcon);
@@ -1205,8 +1196,8 @@
                     newInstallCerts.append(cert);
                     QToolButton* actionBtn = new QToolButton();
                     QIcon btnIcon;
-                    actionBtn->setProperty("ToolTip_Off", tr(NEW_INSTALL_TT));
-                    actionBtn->setProperty("ToolTip_On", tr(NOT_INSTALL_TT));
+                    actionBtn->setProperty("ToolTip_Off", tr("Certificate will be installed."));
+                    actionBtn->setProperty("ToolTip_On", tr("Certificate will not be installed."));
                     btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
                     btnIcon.addFile(":/img/security-low.png", QSize(48, 48), QIcon::Normal, QIcon::On);
                     actionBtn->setIcon(btnIcon);
@@ -1221,15 +1212,15 @@
                     // Is removed, so set editable to false.
                     QToolButton* actionBtn = new QToolButton();
                     QIcon btnIcon;
-                    actionBtn->setProperty("ToolTip_Off", tr(NEW_REMOVE_TT));
-                    actionBtn->setProperty("ToolTip_On", tr(IS_NOT_REMOVED_TT));
+                    actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed."));
+                    actionBtn->setProperty("ToolTip_On", tr("Certificate has not been removed."));
                     btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
                     btnIcon.addFile(":/img/security-medium.png", QSize(48, 48), QIcon::Normal, QIcon::On);
                     btnIcon.addFile(":/img/trash-empty.png", QSize(48, 48), QIcon::Disabled, QIcon::Off);
                     actionBtn->setIcon(btnIcon);
                     if (state) {
                         actionBtn->setEnabled(false);
-                        actionBtn->setToolTip(tr(IS_REMOVED_TT));
+                        actionBtn->setToolTip(tr("Certificate has been removed."));
                     }
                     mRemoveList->addCertificate(cert, state, actionBtn);
                 }
@@ -1239,8 +1230,8 @@
                     newRemoveCerts.append(cert);
                     QToolButton* actionBtn = new QToolButton();
                     QIcon btnIcon;
-                    actionBtn->setProperty("ToolTip_Off", tr(NEW_REMOVE_TT));
-                    actionBtn->setProperty("ToolTip_On", tr(NOT_REMOVE_TT));
+                    actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed."));
+                    actionBtn->setProperty("ToolTip_On", tr("Certificate will not be removed."));
                     btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
                     btnIcon.addFile(":/img/security-medium.png", QSize(48, 48), QIcon::Normal, QIcon::On);
                     actionBtn->setIcon(btnIcon);
@@ -1417,8 +1408,8 @@
         QIcon btnIcon;
         btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::On);
         btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off);
-        actionBtn->setProperty("ToolTip_On", tr(NEW_INSTALL_TT));
-        actionBtn->setProperty("ToolTip_Off", tr(NEW_REMOVE_TT));
+        actionBtn->setProperty("ToolTip_On", tr("Certificate will be installed."));
+        actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed."));
         actionBtn->setIcon(btnIcon);
         mUpdatesManual->addCertificate(cert, state, actionBtn);
     }

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