Make modal dialogs closeable on Mac.
authorAkos Polster <akos@pipacs.com>
Sat, 2 Oct 2010 10:43:44 +0000 (12:43 +0200)
committerAkos Polster <akos@pipacs.com>
Sat, 2 Oct 2010 10:43:44 +0000 (12:43 +0200)
chaptersdialog.cpp
pkg/changelog
widgets/dyalog.cpp
widgets/listwindow.cpp

index 85f0d92..44d16bb 100644 (file)
@@ -22,11 +22,6 @@ ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): ListWindow(parent)
     addList(list);
     connect(list, SIGNAL(activated(const QModelIndex &)),
             this, SLOT(onItemActivated(const QModelIndex &)));
-
-#if !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN)
-    addAction(tr("Close"), this, SLOT(close()), QString(),
-              QDialogButtonBox::RejectRole);
-#endif // Q_WS_MAEMO_5
 }
 
 void ChaptersDialog::onItemActivated(const QModelIndex &index)
index 4c9ddad..c3685aa 100644 (file)
@@ -2,6 +2,7 @@ dorian (0.2.1-1) unstable; urgency=low
 
   * Fix TOC in "The Awakening" (and possibly other Google books) [#6318]
   * Works on Symbian (far from usable)
+  * Make modal dialogs closeable on Mac
 
  -- Akos Polster <akos@pipacs.com>  Thu, 16 Sep 2010 02:00:00 +0200
 
index 98ade66..d9ba0a5 100644 (file)
@@ -52,7 +52,7 @@ Dyalog::Dyalog(QWidget *parent, bool showButtons_):
     content->show();
     scroller->setWidgetResizable(true);
 
-#ifdef Q_OS_SYMBIAN
+#if defined(Q_OS_SYMBIAN)
     QAction *closeAction = new QAction(tr("Back"), this);
     closeAction->setSoftKeyRole(QAction::NegativeSoftKey);
     connect(closeAction, SIGNAL(triggered()), this, SLOT(reject()));
index 2c6fcf1..98ad89c 100644 (file)
@@ -31,16 +31,21 @@ ListWindow::ListWindow(QWidget *parent): QMainWindow(parent), list(0)
     setCentralWidget(frame);
     contentLayout = new QHBoxLayout();
     frame->setLayout(contentLayout);
-#ifdef 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
+#   else
     buttonBox = new QDialogButtonBox(Qt::Vertical, this);
     contentLayout->addWidget(buttonBox);
-#endif // Q_OS_SYMBIAN
+#   endif // Q_OS_SYMBIAN
 #endif // Q_WS_MAEMO_5
+
+#ifdef Q_WS_MAC
+    addAction(tr("Close"), this, SLOT(close()), QString(),
+              QDialogButtonBox::RejectRole);
+#endif // Q_WS_MAC
 }
 
 void ListWindow::addList(ListView *listView)
@@ -93,7 +98,7 @@ void ListWindow::addItemAction(const QString &title, QObject *receiver,
                                const char *slot)
 {
     Trace t("ListWindow::addItemAction");
-#ifdef Q_WS_MAEMO
+#ifdef Q_WS_MAEMO_5
     popup->addAction(title, receiver, slot);
 #elif defined Q_OS_SYMBIAN
     QAction *action = new QAction(title, this);