appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialogtitlewidget.cpp
changeset 29 26b6f0522fd8
parent 25 98b66e4fb0be
child 37 6e7b00453237
--- a/appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialogtitlewidget.cpp	Fri Apr 16 15:05:20 2010 +0300
+++ b/appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialogtitlewidget.cpp	Mon May 03 12:38:03 2010 +0300
@@ -21,8 +21,9 @@
 #include <hblabel.h>
 #include <hbpushbutton.h>
 
-// See definitions in sifuidevicedialogplugin.qrc
-const char KSifUiDialogIconCertificates[] = ":/cert_indi_icon.svg";
+const char KSifUiCertTrusted[]    = "qtg_small_secure.svg";
+// TODO: enable when available, take also in use
+//const char KSifUiCertNotTrusted[] = "qtg_small_untrusted.svg";
 
 
 // ----------------------------------------------------------------------------
@@ -58,8 +59,7 @@
         titleLabel = new HbLabel(titleText);
     } else {
         SifUiDeviceDialogType type = SifUiDialog::dialogType(parameters);
-        SifUiDeviceDialogMode mode = SifUiDialog::dialogMode(parameters);
-        titleLabel = new HbLabel(defaultTitle(type, mode));
+        titleLabel = new HbLabel(defaultTitle(type));
     }
     titleLabel->setFontSpec(HbFontSpec(HbFontSpec::Title));
     mLayout->addItem(titleLabel);
@@ -83,98 +83,49 @@
         titleText = parameters.value(KSifUiDialogTitle).toString();
     } else {
         SifUiDeviceDialogType type = SifUiDialog::dialogType(parameters);
-        SifUiDeviceDialogMode mode = SifUiDialog::dialogMode(parameters);
-        titleText = defaultTitle(type, mode);
+        titleText = defaultTitle(type);
     }
     if (titleText != mTitle->plainText()) {
         mTitle->setPlainText(titleText);
     }
-
-    if (parameters.contains(KSifUiCertificates)) {
-        createCertButton();
-    } else {
-        removeCertButton();
-    }
 }
 
 // ----------------------------------------------------------------------------
 // SifUiDialogTitleWidget::defaultTitle()
 // ----------------------------------------------------------------------------
 //
-QString SifUiDialogTitleWidget::defaultTitle(SifUiDeviceDialogType type,
-    SifUiDeviceDialogMode mode)
+QString SifUiDialogTitleWidget::defaultTitle(SifUiDeviceDialogType type)
 {
     QString title;
-    switch (mode) {
-        case SifUiInstalling:
-            switch (type) {
-                case SifUiConfirmationQuery:
-                    //: Install confirmation query title. Installation starts if
-                    //: the user accepts the query.
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_install_conf_head");
-                    title = tr("Install?");
-                    break;
-                case SifUiProgressNote:
-                    //: Progress note title. Installation is going on and progress
-                    //: bar shows how it proceeds.
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_installing_progress_head");
-                    title = tr("Installing");
-                    break;
-                case SifUiCompleteNote:
-                    //: Installation complete note title. Indicates that installation
-                    //: was succesfully completed. User has option to launch AppLib
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_install_complete_head");
-                    title = tr("Installed");
-                    break;
-                case SifUiErrorNote:
-                    //: Installation failed note title. Indicates that installation failed.
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_install_failed_head");
-                    title = tr("Install failed");
-                    break;
-                case SifUiUnspecifiedDialog:
-                default:
-                    break;
-            }
+    switch (type) {
+        case SifUiConfirmationQuery:
+            //: Install confirmation query title. Installation starts if
+            //: the user accepts the query.
+            // TODO: enable when translations ready
+            //title = hbTrId("txt_sisxui_install_conf_head");
+            title = tr("Install?");
+            break;
+        case SifUiProgressNote:
+            //: Progress note title. Installation is going on and progress
+            //: bar shows how it proceeds.
+            // TODO: enable when translations ready
+            //title = hbTrId("txt_sisxui_installing_progress_head");
+            title = tr("Installing");
             break;
-        case SifUiUninstalling:
-            switch (type) {
-                case SifUiConfirmationQuery:
-                    //: Uninstall confirmation query title. Asks permission to
-                    //: remove selected application/other content.
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_uninstall_conf_head");
-                    title = tr("Remove?");
-                    break;
-                case SifUiProgressNote:
-                    //: Progress note title. Uninstallation is going on and progress
-                    //: bar shows how it proceeds.
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_uninstalling_progress_head");
-                    title = tr("Removing");
-                    break;
-                case SifUiCompleteNote:
-                    //: Uninstallation complete note title. Indicates that application
-                    //: was succesfully removed.
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_uninstall_complete_head");
-                    title = tr("Removed");
-                    break;
-                case SifUiErrorNote:
-                    //: Uninstallation failed note title. Indicates that uninstallation failed.
-                    // TODO: enable when translations ready
-                    //title = hbTrId("txt_sisxui_uninstall_failed_head");
-                    title = tr("Uninstall failed");
-                    break;
-                case SifUiUnspecifiedDialog:
-                default:
-                    break;
-            }
+        case SifUiCompleteNote:
+            //: Installation complete note title. Indicates that installation
+            //: was succesfully completed. User has option to launch AppLib
+            // TODO: enable when translations ready
+            //title = hbTrId("txt_sisxui_install_complete_head");
+            title = tr("Installed");
             break;
-        case SifUiUnspecified:
+        case SifUiErrorNote:
+            //: Installation failed note title. Indicates that installation failed.
+            // TODO: enable when translations ready
+            //title = hbTrId("txt_sisxui_install_failed_head");
+            title = tr("Install failed");
+            break;
+        case SifUiUnspecifiedDialog:
         default:
             break;
     }
@@ -189,7 +140,8 @@
 {
     if (!mCertButton) {
         HbPushButton *certButton = new HbPushButton;
-        certButton->setIcon(HbIcon(KSifUiDialogIconCertificates));
+        // TODO: show KSifUiCertNotTrusted when needed (and when available)
+        certButton->setIcon(HbIcon(KSifUiCertTrusted));
         connect(certButton,SIGNAL(clicked()),this,SIGNAL(certificatesClicked()));
         mLayout->addStretch();
         mLayout->addItem(certButton);