src/gui/dialogs/qprintpreviewdialog.cpp
branchRCL_3
changeset 5 d3bac044e0f0
parent 4 3b1da2848fc7
child 8 3f74d0d4af4c
equal deleted inserted replaced
4:3b1da2848fc7 5:d3bac044e0f0
   205     QAction *overviewModeAction;
   205     QAction *overviewModeAction;
   206 
   206 
   207     QActionGroup *printerGroup;
   207     QActionGroup *printerGroup;
   208     QAction *printAction;
   208     QAction *printAction;
   209     QAction *pageSetupAction;
   209     QAction *pageSetupAction;
       
   210 #if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
       
   211     QAction *closeAction;
       
   212 #endif
   210 
   213 
   211     QPointer<QObject> receiverToDisconnectOnClose;
   214     QPointer<QObject> receiverToDisconnectOnClose;
   212     QByteArray memberToDisconnectOnClose;
   215     QByteArray memberToDisconnectOnClose;
   213 };
   216 };
   214 
   217 
   285     toolbar->addAction(facingModeAction);
   288     toolbar->addAction(facingModeAction);
   286     toolbar->addAction(overviewModeAction);
   289     toolbar->addAction(overviewModeAction);
   287     toolbar->addSeparator();
   290     toolbar->addSeparator();
   288     toolbar->addAction(pageSetupAction);
   291     toolbar->addAction(pageSetupAction);
   289     toolbar->addAction(printAction);
   292     toolbar->addAction(printAction);
       
   293 #if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
       
   294     toolbar->addAction(closeAction);
       
   295 #endif
   290 
   296 
   291     // Cannot use the actions' triggered signal here, since it doesn't autorepeat
   297     // Cannot use the actions' triggered signal here, since it doesn't autorepeat
   292     QToolButton *zoomInButton = static_cast<QToolButton *>(toolbar->widgetForAction(zoomInAction));
   298     QToolButton *zoomInButton = static_cast<QToolButton *>(toolbar->widgetForAction(zoomInAction));
   293     QToolButton *zoomOutButton = static_cast<QToolButton *>(toolbar->widgetForAction(zoomOutAction));
   299     QToolButton *zoomOutButton = static_cast<QToolButton *>(toolbar->widgetForAction(zoomOutAction));
   294     zoomInButton->setAutoRepeat(true);
   300     zoomInButton->setAutoRepeat(true);
   404     pageSetupAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Page setup"));
   410     pageSetupAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Page setup"));
   405     qt_setupActionIcon(printAction, QLatin1String("print"));
   411     qt_setupActionIcon(printAction, QLatin1String("print"));
   406     qt_setupActionIcon(pageSetupAction, QLatin1String("page-setup"));
   412     qt_setupActionIcon(pageSetupAction, QLatin1String("page-setup"));
   407     QObject::connect(printAction, SIGNAL(triggered(bool)), q, SLOT(_q_print()));
   413     QObject::connect(printAction, SIGNAL(triggered(bool)), q, SLOT(_q_print()));
   408     QObject::connect(pageSetupAction, SIGNAL(triggered(bool)), q, SLOT(_q_pageSetup()));
   414     QObject::connect(pageSetupAction, SIGNAL(triggered(bool)), q, SLOT(_q_pageSetup()));
       
   415 #if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA)
       
   416     closeAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Close"));
       
   417     QObject::connect(closeAction, SIGNAL(triggered(bool)), q, SLOT(reject()));
       
   418 #endif
   409 
   419 
   410     // Initial state:
   420     // Initial state:
   411     fitPageAction->setChecked(true);
   421     fitPageAction->setChecked(true);
   412     singleModeAction->setChecked(true);
   422     singleModeAction->setChecked(true);
   413     if (preview->orientation() == QPrinter::Portrait)
   423     if (preview->orientation() == QPrinter::Portrait)