From 3268128a73077e9c931804b4d564f9dfe7353805 Mon Sep 17 00:00:00 2001 From: Akos Polster Date: Sat, 2 Oct 2010 12:43:44 +0200 Subject: [PATCH] Make modal dialogs closeable on Mac. --- chaptersdialog.cpp | 5 ----- pkg/changelog | 1 + widgets/dyalog.cpp | 2 +- widgets/listwindow.cpp | 13 +++++++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/chaptersdialog.cpp b/chaptersdialog.cpp index 85f0d92..44d16bb 100644 --- a/chaptersdialog.cpp +++ b/chaptersdialog.cpp @@ -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) diff --git a/pkg/changelog b/pkg/changelog index 4c9ddad..c3685aa 100644 --- a/pkg/changelog +++ b/pkg/changelog @@ -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 Thu, 16 Sep 2010 02:00:00 +0200 diff --git a/widgets/dyalog.cpp b/widgets/dyalog.cpp index 98ade66..d9ba0a5 100644 --- a/widgets/dyalog.cpp +++ b/widgets/dyalog.cpp @@ -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())); diff --git a/widgets/listwindow.cpp b/widgets/listwindow.cpp index 2c6fcf1..98ad89c 100644 --- a/widgets/listwindow.cpp +++ b/widgets/listwindow.cpp @@ -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); -- 1.7.9.5