More Symbian fixes.
authorAkos Polster <akos@pipacs.com>
Sun, 26 Sep 2010 18:34:51 +0000 (20:34 +0200)
committerAkos Polster <akos@pipacs.com>
Sun, 26 Sep 2010 18:34:51 +0000 (20:34 +0200)
chaptersdialog.cpp
settingswindow.cpp
widgets/adopterwindow.cpp
widgets/dyalog.cpp
widgets/listwindow.cpp

index 1aaffd3..85f0d92 100644 (file)
@@ -23,7 +23,7 @@ ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): ListWindow(parent)
     connect(list, SIGNAL(activated(const QModelIndex &)),
             this, SLOT(onItemActivated(const QModelIndex &)));
 
-#ifndef Q_WS_MAEMO_5
+#if !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN)
     addAction(tr("Close"), this, SLOT(close()), QString(),
               QDialogButtonBox::RejectRole);
 #endif // Q_WS_MAEMO_5
index f533e17..4bece61 100644 (file)
@@ -132,6 +132,13 @@ SettingsWindow::SettingsWindow(QWidget *parent):  QMainWindow(parent)
             this, SLOT(onSchemeButtonClicked(int)));
     connect(orientationBox, SIGNAL(buttonClicked(int)),
             this, SLOT(onOrientationButtonClicked(int)));
+
+#ifdef Q_OS_SYMBIAN
+    QAction *closeAction = new QAction(parent? tr("Back"): tr("Exit"), this);
+    closeAction->setSoftKeyRole(QAction::NegativeSoftKey);
+    connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
+    QMainWindow::addAction(closeAction);
+#endif
 }
 
 void SettingsWindow::onSliderValueChanged(int value)
index 98aa51c..0c734c0 100644 (file)
@@ -34,6 +34,7 @@ AdopterWindow::AdopterWindow(QWidget *parent):
     QAction *closeAction = new QAction(parent? tr("Back"): tr("Exit"), this);
     closeAction->setSoftKeyRole(QAction::NegativeSoftKey);
     connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
+    QMainWindow::addAction(closeAction);
 #else
     // Tool bar
     setUnifiedTitleAndToolBarOnMac(true);
@@ -120,6 +121,9 @@ void AdopterWindow::doGrabZoomKeys(bool grab)
 void AdopterWindow::show()
 {
 #ifdef Q_OS_SYMBIAN
+    foreach (QWidget *w, QApplication::allWidgets()) {
+        w->setContextMenuPolicy(Qt::NoContextMenu);
+    }
     showMaximized();
 #else
     QMainWindow::show();
index 0e4d295..98ade66 100644 (file)
@@ -99,12 +99,15 @@ void Dyalog::addButton(const QString &label, QObject *receiver,
 
 void Dyalog::show()
 {
+    foreach (QWidget *w, QApplication::allWidgets()) {
+        w->setContextMenuPolicy(Qt::NoContextMenu);
+    }
     showMaximized();
 }
 
 int Dyalog::exec()
 {
-    showMaximized();
+    show();
     return QDialog::exec();
 }
 
index 9317aa6..2c6fcf1 100644 (file)
@@ -31,7 +31,12 @@ ListWindow::ListWindow(QWidget *parent): QMainWindow(parent), list(0)
     setCentralWidget(frame);
     contentLayout = new QHBoxLayout();
     frame->setLayout(contentLayout);
-#ifndef Q_OS_SYMBIAN
+#ifdef Q_OS_SYMBIAN
+    QAction *closeAction = new QAction(parent? tr("Back"): tr("Exit"), this);
+    closeAction->setSoftKeyRole(QAction::NegativeSoftKey);
+    connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
+    QMainWindow::addAction(closeAction);
+#else
     buttonBox = new QDialogButtonBox(Qt::Vertical, this);
     contentLayout->addWidget(buttonBox);
 #endif // Q_OS_SYMBIAN
@@ -174,6 +179,9 @@ void ListWindow::onModelChanged()
 
 void ListWindow::show()
 {
+    foreach (QWidget *w, QApplication::allWidgets()) {
+        w->setContextMenuPolicy(Qt::NoContextMenu);
+    }
     showMaximized();
 }