Improve dialogs with a single action on Symbian.
authorAkos Polster <akos@pipacs.com>
Sun, 5 Dec 2010 18:25:39 +0000 (19:25 +0100)
committerAkos Polster <akos@pipacs.com>
Sun, 5 Dec 2010 18:25:39 +0000 (19:25 +0100)
widgets/dyalog.cpp

index 2b8fc1b..addef70 100644 (file)
@@ -92,27 +92,25 @@ void Dyalog::addButton(const QString &label, QObject *receiver,
     }
 #ifdef Q_OS_SYMBIAN
     Q_UNUSED(role);
     }
 #ifdef Q_OS_SYMBIAN
     Q_UNUSED(role);
-#if 0
     if (!leftSoftKey) {
     if (!leftSoftKey) {
-        qDebug() << "Adding left soft key";
+        // Add new action as left softkey
         leftSoftKey = new QAction(label, this);
         leftSoftKey->setSoftKeyRole(QAction::PositiveSoftKey);
         connect(leftSoftKey, SIGNAL(triggered()), receiver, slot);
         addAction(leftSoftKey);
     } else {
         leftSoftKey = new QAction(label, this);
         leftSoftKey->setSoftKeyRole(QAction::PositiveSoftKey);
         connect(leftSoftKey, SIGNAL(triggered()), receiver, slot);
         addAction(leftSoftKey);
     } else {
-#endif
         if (!menuBar) {
         if (!menuBar) {
-            qDebug() << "Creating menu bar";
+            // Create menu bar
             menuBar = new QMenuBar(this);
             menuBar = new QMenuBar(this);
+            // Add previous LSK to menu bar
+            leftSoftKey->setSoftKeyRole(QAction::NoSoftKey);
             menuBar->addAction(leftSoftKey);
         }
             menuBar->addAction(leftSoftKey);
         }
-        qDebug() << "Adding to menu bar";
+        // Add new action to menu bar
         QAction *action = new QAction(label, this);
         connect(action, SIGNAL(triggered()), receiver, slot);
         menuBar->addAction(action);
         QAction *action = new QAction(label, this);
         connect(action, SIGNAL(triggered()), receiver, slot);
         menuBar->addAction(action);
-#if 0
     }
     }
-#endif
 #else
     QPushButton *button = new QPushButton(label, this);
     connect(button, SIGNAL(clicked()), receiver, slot);
 #else
     QPushButton *button = new QPushButton(label, this);
     connect(button, SIGNAL(clicked()), receiver, slot);