summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qabstractprintdialog.cpp7
-rw-r--r--src/gui/dialogs/qabstractprintdialog.h6
-rw-r--r--src/gui/dialogs/qdialog.cpp6
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm27
-rw-r--r--src/gui/dialogs/qfontdialog.cpp27
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm395
-rw-r--r--src/gui/dialogs/qfontdialog_p.h12
-rw-r--r--src/gui/dialogs/qmessagebox.cpp2
-rw-r--r--src/gui/dialogs/qprintdialog_qws.cpp11
-rw-r--r--src/gui/dialogs/qprintdialog_unix.cpp11
-rw-r--r--src/gui/dialogs/qprintdialog_win.cpp16
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp13
-rw-r--r--src/gui/dialogs/qprintsettingsoutput.ui246
13 files changed, 353 insertions, 426 deletions
diff --git a/src/gui/dialogs/qabstractprintdialog.cpp b/src/gui/dialogs/qabstractprintdialog.cpp
index 4523433..25d9ebb 100644
--- a/src/gui/dialogs/qabstractprintdialog.cpp
+++ b/src/gui/dialogs/qabstractprintdialog.cpp
@@ -76,6 +76,7 @@ class QPrintDialogPrivate : public QAbstractPrintDialogPrivate
\value AllPages All pages should be printed.
\value Selection Only the selection should be printed.
\value PageRange The specified page range should be printed.
+ \value CurrentPage Only the currently visible page should be printed.
\sa QPrinter::PrintRange
*/
@@ -89,7 +90,9 @@ class QPrintDialogPrivate : public QAbstractPrintDialogPrivate
\value PrintToFile The print to file option is enabled.
\value PrintSelection The print selection option is enabled.
\value PrintPageRange The page range selection option is enabled.
- \value PrintCollateCopies
+ \value PrintShowPageSize Show the page size + margins page only if this is enabled.
+ \value PrintCollateCopies The collate copies option is enabled
+ \value PrintCurrentPage The print current page option is enabled
This value is obsolete and does nothing since Qt 4.5:
@@ -97,8 +100,6 @@ class QPrintDialogPrivate : public QAbstractPrintDialogPrivate
would create a sheet by default the dialog was given a parent.
This is no longer supported in Qt 4.5. If you want to use sheets, use
QPrintDialog::open() instead.
-
- \value PrintShowPageSize Show the page size + margins page only if this is enabled.
*/
/*!
diff --git a/src/gui/dialogs/qabstractprintdialog.h b/src/gui/dialogs/qabstractprintdialog.h
index 4d867f6..82e3df8 100644
--- a/src/gui/dialogs/qabstractprintdialog.h
+++ b/src/gui/dialogs/qabstractprintdialog.h
@@ -65,7 +65,8 @@ public:
enum PrintRange {
AllPages,
Selection,
- PageRange
+ PageRange,
+ CurrentPage
};
enum PrintDialogOption {
@@ -75,7 +76,8 @@ public:
PrintPageRange = 0x0004,
PrintShowPageSize = 0x0008,
PrintCollateCopies = 0x0010,
- DontUseSheet = 0x0020
+ DontUseSheet = 0x0020,
+ PrintCurrentPage = 0x0040
};
Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption)
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index fb0dba4..2d75913 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -808,11 +808,11 @@ void QDialog::setVisible(bool visible)
void QDialog::showEvent(QShowEvent *event)
{
if (!event->spontaneous() && !testAttribute(Qt::WA_Moved)) {
- Qt::WindowStates state = windowState();
+ Qt::WindowStates state = windowState();
adjustPosition(parentWidget());
setAttribute(Qt::WA_Moved, false); // not really an explicit position
- if (state != windowState())
- setWindowState(state);
+ if (state != windowState())
+ setWindowState(state);
}
}
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index 67daced..14a5f15 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -295,10 +295,14 @@ QT_USE_NAMESPACE
if (!mQDirFilterEntryList->contains(info.fileName()))
return NO;
- // Always accept directories regardless of their names:
+ // Always accept directories regardless of their names (unless it is a bundle):
BOOL isDir;
- if ([[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir] && isDir)
- return YES;
+ if ([[NSFileManager defaultManager] fileExistsAtPath:filename isDirectory:&isDir] && isDir) {
+ if ([mSavePanel treatsFilePackagesAsDirectories] == NO) {
+ if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:filename] == NO)
+ return YES;
+ }
+ }
// No filter means accept everything
if (mSelectedNameFilter->isEmpty())
@@ -725,6 +729,7 @@ Boolean QFileDialogPrivate::qt_mac_filedialog_filter_proc(AEDesc *theItem, void
NavFileOrFolderInfo *theInfo = static_cast<NavFileOrFolderInfo *>(info);
QString file;
+ QString path;
const QtMacFilterName &fn
= fileDialogPrivate->filterInfo.filters.at(fileDialogPrivate->filterInfo.currentSelection);
if (theItem->descriptorType == typeFSRef) {
@@ -732,10 +737,12 @@ Boolean QFileDialogPrivate::qt_mac_filedialog_filter_proc(AEDesc *theItem, void
AEGetDescData(theItem, &ref, sizeof(ref));
UInt8 str_buffer[1024];
FSRefMakePath(&ref, str_buffer, 1024);
- file = QString::fromUtf8(reinterpret_cast<const char *>(str_buffer));
- int slsh = file.lastIndexOf(QLatin1Char('/'));
+ path = QString::fromUtf8(reinterpret_cast<const char *>(str_buffer));
+ int slsh = path.lastIndexOf(QLatin1Char('/'));
if (slsh != -1)
- file = file.right(file.length() - slsh - 1);
+ file = path.right(path.length() - slsh - 1);
+ else
+ file = path;
}
QStringList reg = fn.regexp.split(QLatin1String(";"));
for (QStringList::const_iterator it = reg.constBegin(); it != reg.constEnd(); ++it) {
@@ -747,7 +754,13 @@ Boolean QFileDialogPrivate::qt_mac_filedialog_filter_proc(AEDesc *theItem, void
if (rg.exactMatch(file))
return true;
}
- return (theInfo->isFolder && !file.endsWith(QLatin1String(".app")));
+
+ if (theInfo->isFolder) {
+ if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:qt_mac_QStringToNSString(path)])
+ return false;
+ return true;
+ }
+ return false;
}
void QFileDialogPrivate::qt_mac_filedialog_event_proc(const NavEventCallbackMessage msg,
diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp
index a4bf15d..b159fa7 100644
--- a/src/gui/dialogs/qfontdialog.cpp
+++ b/src/gui/dialogs/qfontdialog.cpp
@@ -174,6 +174,11 @@ void QFontDialogPrivate::init()
{
Q_Q(QFontDialog);
+#ifdef Q_WS_MAC
+ nativeDialogInUse = false;
+ delegate = 0;
+#endif
+
q->setSizeGripEnabled(true);
q->setWindowTitle(QFontDialog::tr("Select Font"));
@@ -329,10 +334,6 @@ void QFontDialogPrivate::init()
familyList->setFocus();
retranslateStrings();
-
-#ifdef Q_WS_MAC
- delegate = 0;
-#endif
}
/*!
@@ -345,8 +346,7 @@ QFontDialog::~QFontDialog()
#ifdef Q_WS_MAC
Q_D(QFontDialog);
if (d->delegate) {
- QFontDialogPrivate::closeCocoaFontPanel(d->delegate);
- QFontDialogPrivate::sharedFontPanelAvailable = true;
+ d->closeCocoaFontPanel();
return;
}
#endif
@@ -428,14 +428,6 @@ QFont QFontDialog::getFont(bool *ok, QWidget *parent)
QFont QFontDialogPrivate::getFont(bool *ok, const QFont &initial, QWidget *parent,
const QString &title, QFontDialog::FontDialogOptions options)
{
-#ifdef Q_WS_MAC
- if (!(options & QFontDialog::DontUseNativeDialog)
- && QFontDialogPrivate::sharedFontPanelAvailable) {
- return QFontDialogPrivate::execCocoaFontPanel(ok, initial, parent,
- title.isEmpty() ? QFontDialog::tr("Select Font") : title, options);
- }
-#endif
-
QFontDialog dlg(parent);
dlg.setOptions(options);
dlg.setCurrentFont(initial);
@@ -988,13 +980,10 @@ void QFontDialog::open(QObject *receiver, const char *member)
*/
void QFontDialog::setVisible(bool visible)
{
- Q_D(QFontDialog);
- if (visible) {
- if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden))
- return;
- } else if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden))
+ if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden) != visible)
return;
#ifdef Q_WS_MAC
+ Q_D(QFontDialog);
if (d->canBeNativeDialog()){
if (d->setVisible_sys(visible)){
d->nativeDialogInUse = true;
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index 67d32b8..919790b 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -58,6 +58,14 @@
typedef float CGFloat; // Should only not be defined on 32-bit platforms
#endif
+QT_BEGIN_NAMESPACE
+
+extern void macStartInterceptNSPanelCtor();
+extern void macStopInterceptNSPanelCtor();
+extern NSButton *macCreateButton(const char *text, NSView *superview);
+extern bool qt_mac_is_macsheet(const QWidget *w); // qwidget_mac.mm
+
+QT_END_NAMESPACE
QT_USE_NAMESPACE
// should a priori be kept in sync with qcolordialog_mac.mm
@@ -95,7 +103,8 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin
BOOL mPanelHackedWithButtons;
CGFloat mDialogExtraWidth;
CGFloat mDialogExtraHeight;
- NSModalSession mModalSession;
+ int mReturnCode;
+ BOOL mAppModal;
}
- (id)initWithFontPanel:(NSFontPanel *)panel
stolenContentView:(NSView *)stolenContentView
@@ -104,9 +113,11 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin
priv:(QFontDialogPrivate *)priv
extraWidth:(CGFloat)extraWidth
extraHeight:(CGFloat)extraHeight;
+- (void)showModelessPanel;
+- (void)showWindowModalSheet:(QWidget *)docWidget;
+- (void)runApplicationModalPanel;
- (void)changeFont:(id)sender;
- (void)changeAttributes:(id)sender;
-- (void)setModalSession:(NSModalSession)session;
- (BOOL)windowShouldClose:(id)window;
- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
- (void)relayout;
@@ -163,7 +174,8 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
mPanelHackedWithButtons = (okButton != 0);
mDialogExtraWidth = extraWidth;
mDialogExtraHeight = extraHeight;
- mModalSession = 0;
+ mReturnCode = -1;
+ mAppModal = false;
if (mPanelHackedWithButtons) {
[self relayout];
@@ -174,6 +186,20 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
[cancelButton setAction:@selector(onCancelClicked)];
[cancelButton setTarget:self];
}
+
+#ifdef QT_MAC_USE_COCOA
+ // Stack the native dialog in front of its parent, if any:
+ QFontDialog *q = mPriv->fontDialog();
+ if (!qt_mac_is_macsheet(q)) {
+ if (QWidget *parent = q->parentWidget()) {
+ if (parent->isWindow()) {
+ [qt_mac_window_for(parent)
+ addChildWindow:[mStolenContentView window] ordered:NSWindowAbove];
+ }
+ }
+ }
+#endif
+
mQtFont = new QFont();
return self;
}
@@ -184,6 +210,50 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
[super dealloc];
}
+- (void)showModelessPanel
+{
+ mAppModal = false;
+ NSWindow *ourPanel = [mStolenContentView window];
+ [ourPanel makeKeyAndOrderFront:self];
+}
+
+- (void)runApplicationModalPanel
+{
+ QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
+ mAppModal = true;
+ NSWindow *ourPanel = [mStolenContentView window];
+ [NSApp runModalForWindow:ourPanel];
+ QAbstractEventDispatcher::instance()->interrupt();
+
+ if (mReturnCode == NSOKButton)
+ mPriv->fontDialog()->accept();
+ else
+ mPriv->fontDialog()->reject();
+}
+
+- (void)showWindowModalSheet:(QWidget *)docWidget
+{
+#ifdef QT_MAC_USE_COCOA
+ NSWindow *window = qt_mac_window_for(docWidget);
+#else
+ WindowRef hiwindowRef = qt_mac_window_for(docWidget);
+ NSWindow *window = [[NSWindow alloc] initWithWindowRef:hiwindowRef];
+ CFRetain(hiwindowRef);
+#endif
+
+ mAppModal = false;
+ NSWindow *ourPanel = [mStolenContentView window];
+ [NSApp beginSheet:ourPanel
+ modalForWindow:window
+ modalDelegate:0
+ didEndSelector:0
+ contextInfo:0 ];
+
+#ifndef QT_MAC_USE_COCOA
+ CFRelease(hiwindowRef);
+#endif
+}
+
- (void)changeFont:(id)sender
{
NSFont *dummyFont = [NSFont userFontOfSize:12.0];
@@ -216,12 +286,6 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
mPriv->updateSampleFont(*mQtFont);
}
-- (void)setModalSession:(NSModalSession)session
-{
- Q_ASSERT(!mModalSession);
- mModalSession = session;
-}
-
- (BOOL)windowShouldClose:(id)window
{
Q_UNUSED(window);
@@ -282,9 +346,8 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
NSSize cancelSizeHint = [mCancelButton frame].size;
const CGFloat ButtonWidth = qMin(qMax(ButtonMinWidth,
- qMax(okSizeHint.width, cancelSizeHint.width)),
- CGFloat((frameSize.width - 2.0 * ButtonSideMargin
- - ButtonSpacing) * 0.5));
+ qMax(okSizeHint.width, cancelSizeHint.width)),
+ CGFloat((frameSize.width - 2.0 * ButtonSideMargin - ButtonSpacing) * 0.5));
const CGFloat ButtonHeight = qMax(ButtonMinHeight,
qMax(okSizeHint.height, cancelSizeHint.height));
@@ -317,14 +380,12 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
NSFontManager *fontManager = [NSFontManager sharedFontManager];
[self setQtFont:qfontForCocoaFont([fontManager convertFont:[fontManager selectedFont]],
*mQtFont)];
- [[mStolenContentView window] close];
[self finishOffWithCode:NSOKButton];
}
- (void)onCancelClicked
{
Q_ASSERT(mPanelHackedWithButtons);
- [[mStolenContentView window] close];
[self finishOffWithCode:NSCancelButton];
}
@@ -368,20 +429,26 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
- (void)finishOffWithCode:(NSInteger)code
{
- if (mPriv) {
- if (mModalSession) {
- [NSApp endModalSession:mModalSession];
- mModalSession = 0;
+#ifdef QT_MAC_USE_COCOA
+ QFontDialog *q = mPriv->fontDialog();
+ if (QWidget *parent = q->parentWidget()) {
+ if (parent->isWindow()) {
+ [qt_mac_window_for(parent) removeChildWindow:[mStolenContentView window]];
}
- // Hack alert!
- // Since this code path was never intended to be followed when starting from exec
- // we need to force the dialog to communicate the new font, otherwise the signal
- // won't get emitted.
- if(code == NSOKButton)
- mPriv->sampleEdit->setFont([self qtFont]);
- mPriv->done((code == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
- } else {
+ }
+#endif
+
+ if(code == NSOKButton)
+ mPriv->sampleEdit->setFont([self qtFont]);
+
+ if (mAppModal) {
+ mReturnCode = code;
[NSApp stopModalWithCode:code];
+ } else {
+ if (code == NSOKButton)
+ mPriv->fontDialog()->accept();
+ else
+ mPriv->fontDialog()->reject();
}
}
@@ -408,206 +475,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
QT_BEGIN_NAMESPACE
-extern void macStartInterceptNSPanelCtor();
-extern void macStopInterceptNSPanelCtor();
-extern NSButton *macCreateButton(const char *text, NSView *superview);
-
-void *QFontDialogPrivate::openCocoaFontPanel(const QFont &initial,
- QWidget *parent, const QString &title, QFontDialog::FontDialogOptions options,
- QFontDialogPrivate *priv)
-{
- Q_UNUSED(parent); // we would use the parent if only NSFontPanel could be a sheet
- QMacCocoaAutoReleasePool pool;
-
- /*
- The standard Cocoa font panel has no OK or Cancel button and
- is created as a utility window. For strange reasons (which seem
- to stem from the fact that the font panel is based on a NIB
- file), the approach we use for the color panel doesn't work for
- the font panel (and, inversely, the approach we use here doesn't
- quite work for color panel, and crashed last time I tried). So
- instead, we take the following steps:
-
- 1. Constructs a plain NSPanel that looks the way we want it
- to look. Specifically, if the NoButtons option is off, we
- construct a panel without the NSUtilityWindowMask flag
- and with buttons (OK and Cancel).
-
- 2. Steal the content view from the shared NSFontPanel and
- put it inside our new NSPanel's content view, together
- with the OK and Cancel buttons.
-
- 3. Lay out the original content view and the buttons when
- the font panel is shown and whenever it is resized.
-
- 4. Clean up after ourselves.
-
- PS. Some customization is also done in QCocoaApplication
- validModesForFontPanel:.
- */
-
- Qt::WindowModality modality = Qt::ApplicationModal;
- if (priv)
- modality = priv->fontDialog()->windowModality();
-
- bool needButtons = !(options & QFontDialog::NoButtons);
- // don't need our own panel if the title bar isn't visible anyway (in a sheet)
- bool needOwnPanel = (needButtons && modality != Qt::WindowModal);
-
- bool sharedFontPanelExisted = [NSFontPanel sharedFontPanelExists];
- NSFontPanel *sharedFontPanel = [NSFontPanel sharedFontPanel];
- [sharedFontPanel setHidesOnDeactivate:false];
-
- // hack to ensure that QCocoaApplication's validModesForFontPanel:
- // implementation is honored
- if (!sharedFontPanelExisted && needOwnPanel) {
- [sharedFontPanel makeKeyAndOrderFront:sharedFontPanel];
- [sharedFontPanel close];
- }
-
- NSPanel *ourPanel = 0;
- NSView *stolenContentView = 0;
- NSButton *okButton = 0;
- NSButton *cancelButton = 0;
-
- CGFloat dialogExtraWidth = 0.0;
- CGFloat dialogExtraHeight = 0.0;
-
- if (!needOwnPanel) {
- // we can reuse the NSFontPanel unchanged
- ourPanel = sharedFontPanel;
- } else {
- // compute dialogExtra{Width,Height}
- dialogExtraWidth = 2.0 * DialogSideMargin;
- dialogExtraHeight = DialogTopMargin + ButtonTopMargin + ButtonMinHeight
- + ButtonBottomMargin;
-
- // compute initial contents rectangle
- NSRect contentRect = [sharedFontPanel contentRectForFrameRect:[sharedFontPanel frame]];
- contentRect.size.width += dialogExtraWidth;
- contentRect.size.height += dialogExtraHeight;
-
- // create the new panel
- ourPanel = [[NSPanel alloc] initWithContentRect:contentRect
- styleMask:StyleMask
- backing:NSBackingStoreBuffered
- defer:YES];
- [ourPanel setReleasedWhenClosed:YES];
- }
-
- stolenContentView = [sharedFontPanel contentView];
-
- if (needButtons) {
- // steal the font panel's contents view
- [stolenContentView retain];
- [sharedFontPanel setContentView:0];
-
- // create a new content view and add the stolen one as a subview
- NSRect frameRect = { { 0.0, 0.0 }, { 0.0, 0.0 } };
- NSView *ourContentView = [[NSView alloc] initWithFrame:frameRect];
- [ourContentView addSubview:stolenContentView];
-
- // create OK and Cancel buttons and add these as subviews
- okButton = macCreateButton("&OK", ourContentView);
- cancelButton = macCreateButton("Cancel", ourContentView);
-
- [ourPanel setContentView:ourContentView];
- [ourPanel setDefaultButtonCell:[okButton cell]];
- }
-
- // create a delegate and set it
- QCocoaFontPanelDelegate *delegate =
- [[QCocoaFontPanelDelegate alloc] initWithFontPanel:sharedFontPanel
- stolenContentView:stolenContentView
- okButton:okButton
- cancelButton:cancelButton
- priv:priv
- extraWidth:dialogExtraWidth
- extraHeight:dialogExtraHeight];
- [ourPanel setDelegate:delegate];
- [[NSFontManager sharedFontManager] setDelegate:delegate];
-#ifdef QT_MAC_USE_COCOA
- [[NSFontManager sharedFontManager] setTarget:delegate];
-#endif
- setFont(delegate, initial);
-
- // hack to get correct initial layout
- NSRect frameRect = [ourPanel frame];
- frameRect.size.width += 1.0;
- [ourPanel setFrame:frameRect display:NO];
- frameRect.size.width -= 1.0;
- frameRect.size = [delegate windowWillResize:ourPanel toSize:frameRect.size];
- [ourPanel setFrame:frameRect display:NO];
- [ourPanel center];
-
- [ourPanel setTitle:(NSString*)(CFStringRef)QCFString(title)];
-
- if (priv) {
- switch (modality) {
- case Qt::WindowModal:
- if (parent) {
-#ifndef QT_MAC_USE_COCOA
- WindowRef hiwindowRef = qt_mac_window_for(parent);
- NSWindow *window =
- [[NSWindow alloc] initWithWindowRef:hiwindowRef];
- // Cocoa docs say I should retain the Carbon ref.
- CFRetain(hiwindowRef);
-#else
- NSWindow *window = qt_mac_window_for(parent);
-#endif
- [NSApp beginSheet:ourPanel
- modalForWindow:window
- modalDelegate:0
- didEndSelector:0
- contextInfo:0];
-#ifndef QT_MAC_USE_COCOA
- [window release];
-#endif
- break;
- }
- // fallthrough
- case Qt::ApplicationModal:
- [delegate setModalSession:[NSApp beginModalSessionForWindow:ourPanel]];
- break;
- default:
- [ourPanel makeKeyAndOrderFront:ourPanel];
- }
- }
- return delegate;
-}
-
-void QFontDialogPrivate::closeCocoaFontPanel(void *delegate)
+void QFontDialogPrivate::closeCocoaFontPanel()
{
QMacCocoaAutoReleasePool pool;
QCocoaFontPanelDelegate *theDelegate = static_cast<QCocoaFontPanelDelegate *>(delegate);
NSWindow *ourPanel = [theDelegate actualPanel];
[ourPanel close];
[theDelegate cleanUpAfterMyself];
- [theDelegate autorelease];
-}
-
-QFont QFontDialogPrivate::execCocoaFontPanel(bool *ok, const QFont &initial,
- QWidget *parent, const QString &title, QFontDialog::FontDialogOptions options)
-{
- QMacCocoaAutoReleasePool pool;
- QCocoaFontPanelDelegate *delegate =
- static_cast<QCocoaFontPanelDelegate *>(
- openCocoaFontPanel(initial, parent, title, options));
- NSWindow *ourPanel = [delegate actualPanel];
- [ourPanel retain];
- int rval = [NSApp runModalForWindow:ourPanel];
- QFont font([delegate qtFont]);
- [ourPanel release];
- [delegate cleanUpAfterMyself];
- [delegate release];
- bool isOk = ((options & QFontDialog::NoButtons) || rval == NSOKButton);
- if (ok)
- *ok = isOk;
- if (isOk) {
- return font;
- } else {
- return initial;
- }
+ [theDelegate release];
+ this->delegate = 0;
+ sharedFontPanelAvailable = true;
}
void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
@@ -645,10 +522,13 @@ void QFontDialogPrivate::setFont(void *delegate, const QFont &font)
[static_cast<QCocoaFontPanelDelegate *>(delegate) setQtFont:font];
}
-void *QFontDialogPrivate::_q_constructNativePanel()
+void QFontDialogPrivate::createNSFontPanelDelegate()
{
- QMacCocoaAutoReleasePool pool;
+ if (delegate)
+ return;
+ sharedFontPanelAvailable = false;
+ QMacCocoaAutoReleasePool pool;
bool sharedFontPanelExisted = [NSFontPanel sharedFontPanelExists];
NSFontPanel *sharedFontPanel = [NSFontPanel sharedFontPanel];
[sharedFontPanel setHidesOnDeactivate:false];
@@ -670,8 +550,7 @@ void *QFontDialogPrivate::_q_constructNativePanel()
// compute dialogExtra{Width,Height}
dialogExtraWidth = 2.0 * DialogSideMargin;
- dialogExtraHeight = DialogTopMargin + ButtonTopMargin + ButtonMinHeight
- + ButtonBottomMargin;
+ dialogExtraHeight = DialogTopMargin + ButtonTopMargin + ButtonMinHeight + ButtonBottomMargin;
// compute initial contents rectangle
NSRect contentRect = [sharedFontPanel contentRectForFrameRect:[sharedFontPanel frame]];
@@ -684,7 +563,6 @@ void *QFontDialogPrivate::_q_constructNativePanel()
backing:NSBackingStoreBuffered
defer:YES];
[ourPanel setReleasedWhenClosed:YES];
-
stolenContentView = [sharedFontPanel contentView];
// steal the font panel's contents view
@@ -704,21 +582,23 @@ void *QFontDialogPrivate::_q_constructNativePanel()
[ourPanel setContentView:ourContentView];
[ourPanel setDefaultButtonCell:[okButton cell]];
}
- // create a delegate and set it
- QCocoaFontPanelDelegate *delegate =
- [[QCocoaFontPanelDelegate alloc] initWithFontPanel:sharedFontPanel
+
+ // create the delegate and set it
+ QCocoaFontPanelDelegate *del = [[QCocoaFontPanelDelegate alloc] initWithFontPanel:sharedFontPanel
stolenContentView:stolenContentView
okButton:okButton
cancelButton:cancelButton
priv:this
extraWidth:dialogExtraWidth
extraHeight:dialogExtraHeight];
- [ourPanel setDelegate:delegate];
- [[NSFontManager sharedFontManager] setDelegate:delegate];
+ delegate = del;
+ [ourPanel setDelegate:del];
+
+ [[NSFontManager sharedFontManager] setDelegate:del];
#ifdef QT_MAC_USE_COCOA
- [[NSFontManager sharedFontManager] setTarget:delegate];
+ [[NSFontManager sharedFontManager] setTarget:del];
#endif
- setFont(delegate, QApplication::font());
+ setFont(del, q_func()->currentFont());
{
// hack to get correct initial layout
@@ -726,15 +606,12 @@ void *QFontDialogPrivate::_q_constructNativePanel()
frameRect.size.width += 1.0;
[ourPanel setFrame:frameRect display:NO];
frameRect.size.width -= 1.0;
- frameRect.size = [delegate windowWillResize:ourPanel toSize:frameRect.size];
+ frameRect.size = [del windowWillResize:ourPanel toSize:frameRect.size];
[ourPanel setFrame:frameRect display:NO];
[ourPanel center];
}
NSString *title = @"Select font";
[ourPanel setTitle:title];
-
- [delegate setModalSession:[NSApp beginModalSessionForWindow:ourPanel]];
- return delegate;
}
void QFontDialogPrivate::mac_nativeDialogModalHelp()
@@ -759,29 +636,47 @@ void QFontDialogPrivate::mac_nativeDialogModalHelp()
// and "adding" the buttons.
void QFontDialogPrivate::_q_macRunNativeAppModalPanel()
{
- QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
+ createNSFontPanelDelegate();
+ QCocoaFontPanelDelegate *del = static_cast<QCocoaFontPanelDelegate *>(delegate);
+ [del runApplicationModalPanel];
+}
+
+bool QFontDialogPrivate::showCocoaFontPanel()
+{
+ if (!sharedFontPanelAvailable)
+ return false;
+
Q_Q(QFontDialog);
- QCocoaFontPanelDelegate *delegate = (QCocoaFontPanelDelegate *)_q_constructNativePanel();
- NSWindow *ourPanel = [delegate actualPanel];
- [ourPanel retain];
- int rval = [NSApp runModalForWindow:ourPanel];
- QAbstractEventDispatcher::instance()->interrupt();
- [ourPanel release];
- [delegate cleanUpAfterMyself];
- [delegate release];
- bool isOk = (rval == NSOKButton);
- if(isOk)
- rescode = QDialog::Accepted;
+ QMacCocoaAutoReleasePool pool;
+ createNSFontPanelDelegate();
+ QCocoaFontPanelDelegate *del = static_cast<QCocoaFontPanelDelegate *>(delegate);
+ if (qt_mac_is_macsheet(q))
+ [del showWindowModalSheet:q->parentWidget()];
else
- rescode = QDialog::Rejected;
+ [del showModelessPanel];
+ return true;
}
+bool QFontDialogPrivate::hideCocoaFontPanel()
+{
+ if (!delegate){
+ // Nothing to do. We return false to leave the question
+ // open regarding whether or not to go native:
+ return false;
+ } else {
+ closeCocoaFontPanel();
+ // Even when we hide it, we are still using a
+ // native dialog, so return true:
+ return true;
+ }
+}
bool QFontDialogPrivate::setVisible_sys(bool visible)
{
Q_Q(QFontDialog);
if (!visible == q->isHidden())
return false;
- return visible;
+
+ return visible ? showCocoaFontPanel() : hideCocoaFontPanel();
}
QT_END_NAMESPACE
diff --git a/src/gui/dialogs/qfontdialog_p.h b/src/gui/dialogs/qfontdialog_p.h
index 7654a80..8676be3 100644
--- a/src/gui/dialogs/qfontdialog_p.h
+++ b/src/gui/dialogs/qfontdialog_p.h
@@ -139,25 +139,21 @@ public:
QByteArray memberToDisconnectOnClose;
#ifdef Q_WS_MAC
- static void *openCocoaFontPanel(const QFont &initial,
- QWidget *parent, const QString &title,
- QFontDialog::FontDialogOptions options,
- QFontDialogPrivate *priv = 0);
- static void closeCocoaFontPanel(void *delegate);
- static QFont execCocoaFontPanel(bool *ok, const QFont &initial, QWidget *parent,
- const QString &title, QFontDialog::FontDialogOptions options);
static void setFont(void *delegate, const QFont &font);
inline void done(int result) { q_func()->done(result); }
inline QFontDialog *fontDialog() { return q_func(); }
void *delegate;
+ void closeCocoaFontPanel();
bool nativeDialogInUse;
bool canBeNativeDialog();
bool setVisible_sys(bool visible);
- void *_q_constructNativePanel();
+ void createNSFontPanelDelegate();
void _q_macRunNativeAppModalPanel();
void mac_nativeDialogModalHelp();
+ bool showCocoaFontPanel();
+ bool hideCocoaFontPanel();
static bool sharedFontPanelAvailable;
#endif
diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp
index ed437ff..121ba62 100644
--- a/src/gui/dialogs/qmessagebox.cpp
+++ b/src/gui/dialogs/qmessagebox.cpp
@@ -314,6 +314,7 @@ void QMessageBoxPrivate::updateSize()
}
width = hardLimit;
}
+ }
#ifdef Q_WS_S60
// in S60 portait messageBoxes should always occupy maximum width
if (QApplication::desktop()->size().height() > QApplication::desktop()->size().width()){
@@ -323,7 +324,6 @@ void QMessageBoxPrivate::updateSize()
width = qMin(QApplication::desktop()->size().height(), hardLimit);
}
#endif
- }
if (informativeLabel) {
label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
diff --git a/src/gui/dialogs/qprintdialog_qws.cpp b/src/gui/dialogs/qprintdialog_qws.cpp
index 1336c04..b071427 100644
--- a/src/gui/dialogs/qprintdialog_qws.cpp
+++ b/src/gui/dialogs/qprintdialog_qws.cpp
@@ -178,6 +178,10 @@ void QPrintDialogPrivate::_q_okClicked()
q->setPrintRange(QPrintDialog::PageRange);
q->setFromTo(firstPage->value(), lastPage->value());
break;
+ case (int)QPrintDialog::CurrentPage:
+ q->setPrintRange(QPrintDialog::CurrentPage);
+ q->setFromTo(0, 0);
+ break;
}
q->accept();
}
@@ -375,6 +379,7 @@ void QPrintDialogPrivate::setupOptions()
rangeCombo->addItem(QPrintDialog::tr("Print all"), QPrintDialog::AllPages);
rangeCombo->addItem(QPrintDialog::tr("Print selection"), QPrintDialog::Selection);
rangeCombo->addItem(QPrintDialog::tr("Print range"), QPrintDialog::PageRange);
+ rangeCombo->addItem(QPrintDialog::tr("Print current page"), QPrintDialog::CurrentPage);
QObject::connect(rangeCombo, SIGNAL(activated(int)),
q, SLOT(_q_printRangeSelected(int)));
@@ -490,6 +495,9 @@ void QPrintDialogPrivate::setPrinter(QPrinter *p, bool pickUpSettings)
if (!q->isOptionEnabled(QPrintDialog::PrintPageRange)
&& rangeCombo->findData(QPrintDialog::PageRange) > 0)
rangeCombo->removeItem(rangeCombo->findData(QPrintDialog::PageRange));
+ if (!q->isOptionEnabled(QPrintDialog::PrintCurrentPage)
+ && rangeCombo->findData(QPrintDialog::CurrentPage) > 0)
+ rangeCombo->removeItem(rangeCombo->findData(QPrintDialog::CurrentPage));
switch (q->printRange()) {
case QPrintDialog::AllPages:
@@ -501,6 +509,9 @@ void QPrintDialogPrivate::setPrinter(QPrinter *p, bool pickUpSettings)
case QPrintDialog::PageRange:
rangeCombo->setCurrentIndex((int)(QPrintDialog::PageRange));
break;
+ case QPrintDialog::CurrentPage:
+ rangeCombo->setCurrentIndex((int)(QPrintDialog::CurrentPage));
+ break;
}
}
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp
index 2d169cf..0487f23 100644
--- a/src/gui/dialogs/qprintdialog_unix.cpp
+++ b/src/gui/dialogs/qprintdialog_unix.cpp
@@ -502,6 +502,9 @@ void QPrintDialogPrivate::setupPrinter()
} else if (options.printSelection->isChecked()) {
p->setPrintRange(QPrinter::Selection);
p->setFromTo(0,0);
+ } else if (options.printCurrentPage->isChecked()) {
+ p->setPrintRange(QPrinter::CurrentPage);
+ p->setFromTo(0,0);
} else if (options.printRange->isChecked()) {
p->setPrintRange(QPrinter::PageRange);
p->setFromTo(options.from->value(), qMax(options.from->value(), options.to->value()));
@@ -518,10 +521,12 @@ void QPrintDialogPrivate::updateWidgets()
{
Q_Q(QPrintDialog);
options.gbPrintRange->setVisible(q->isOptionEnabled(QPrintDialog::PrintPageRange) ||
- q->isOptionEnabled(QPrintDialog::PrintSelection));
+ q->isOptionEnabled(QPrintDialog::PrintSelection) ||
+ q->isOptionEnabled(QPrintDialog::PrintCurrentPage));
options.printRange->setEnabled(q->isOptionEnabled(QPrintDialog::PrintPageRange));
options.printSelection->setVisible(q->isOptionEnabled(QPrintDialog::PrintSelection));
+ options.printCurrentPage->setVisible(q->isOptionEnabled(QPrintDialog::PrintCurrentPage));
options.collate->setVisible(q->isOptionEnabled(QPrintDialog::PrintCollateCopies));
switch (q->printRange()) {
@@ -534,6 +539,10 @@ void QPrintDialogPrivate::updateWidgets()
case QPrintDialog::PageRange:
options.printRange->setChecked(true);
break;
+ case QPrintDialog::CurrentPage:
+ if (q->isOptionEnabled(QPrintDialog::PrintCurrentPage))
+ options.printCurrentPage->setChecked(true);
+ break;
default:
break;
}
diff --git a/src/gui/dialogs/qprintdialog_win.cpp b/src/gui/dialogs/qprintdialog_win.cpp
index fa0c99f..1061660 100644
--- a/src/gui/dialogs/qprintdialog_win.cpp
+++ b/src/gui/dialogs/qprintdialog_win.cpp
@@ -128,11 +128,14 @@ static void qt_win_setup_PRINTDLGEX(PRINTDLGEX *pd, QWidget *parent,
if (pd->nMinPage==0 && pd->nMaxPage==0)
pd->Flags |= PD_NOPAGENUMS;
- // we don't have a 'current page' notion in the QPrinter API yet.
- // Neither do we support more than one page range, so limit those
- // options
- pd->Flags |= PD_NOCURRENTPAGE;
+ // Disable Current Page option if not required as default is Enabled
+ if (!pdlg->isOptionEnabled(QPrintDialog::PrintCurrentPage))
+ pd->Flags |= PD_NOCURRENTPAGE;
+
+ // Default to showing the General tab first
pd->nStartPage = START_PAGE_GENERAL;
+
+ // We don't support more than one page range in the QPrinter API yet.
pd->nPageRanges = 1;
pd->nMaxPageRanges = 1;
@@ -153,7 +156,10 @@ static void qt_win_read_back_PRINTDLGEX(PRINTDLGEX *pd, QPrintDialog *pdlg, QPri
} else if (pd->Flags & PD_PAGENUMS) {
pdlg->setPrintRange(QPrintDialog::PageRange);
pdlg->setFromTo(pd->lpPageRanges[0].nFromPage, pd->lpPageRanges[0].nToPage);
- } else {
+ } else if (pd->Flags & PD_CURRENTPAGE) {
+ pdlg->setPrintRange(QPrintDialog::CurrentPage);
+ pdlg->setFromTo(0, 0);
+ } else { // PD_ALLPAGES
pdlg->setPrintRange(QPrintDialog::AllPages);
pdlg->setFromTo(0, 0);
}
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp
index 6723b53..f21343e 100644
--- a/src/gui/dialogs/qprintpreviewdialog.cpp
+++ b/src/gui/dialogs/qprintpreviewdialog.cpp
@@ -273,7 +273,20 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer)
QWidget *pageEdit = new QWidget(toolbar);
QVBoxLayout *vboxLayout = new QVBoxLayout;
vboxLayout->setContentsMargins(0, 0, 0, 0);
+#ifdef Q_WS_MAC
+ // We query the widgets about their size and then we fix the size.
+ // This should do the trick for the laying out part...
+ QSize pageNumEditSize, pageNumLabelSize;
+ pageNumEditSize = pageNumEdit->minimumSizeHint();
+ pageNumLabelSize = pageNumLabel->minimumSizeHint();
+ pageNumEdit->resize(pageNumEditSize);
+ pageNumLabel->resize(pageNumLabelSize);
+#endif
QFormLayout *formLayout = new QFormLayout;
+#ifdef Q_WS_MAC
+ // We have to change the growth policy in Mac.
+ formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
+#endif
formLayout->setWidget(0, QFormLayout::LabelRole, pageNumEdit);
formLayout->setWidget(0, QFormLayout::FieldRole, pageNumLabel);
vboxLayout->addLayout(formLayout);
diff --git a/src/gui/dialogs/qprintsettingsoutput.ui b/src/gui/dialogs/qprintsettingsoutput.ui
index fc57e86..be91679 100644
--- a/src/gui/dialogs/qprintsettingsoutput.ui
+++ b/src/gui/dialogs/qprintsettingsoutput.ui
@@ -1,121 +1,114 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>QPrintSettingsOutput</class>
- <widget class="QWidget" name="QPrintSettingsOutput" >
- <property name="geometry" >
+ <widget class="QWidget" name="QPrintSettingsOutput">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>416</width>
- <height>166</height>
+ <width>426</width>
+ <height>171</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_2" >
- <property name="margin" >
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="margin">
<number>0</number>
</property>
<item>
- <widget class="QTabWidget" name="tabs" >
- <property name="currentIndex" >
+ <widget class="QTabWidget" name="tabs">
+ <property name="currentIndex">
<number>0</number>
</property>
- <widget class="QWidget" name="copiesTab" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>412</width>
- <height>139</height>
- </rect>
- </property>
- <attribute name="title" >
+ <widget class="QWidget" name="copiesTab">
+ <attribute name="title">
<string>Copies</string>
</attribute>
- <layout class="QHBoxLayout" name="horizontalLayout" >
+ <layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QGroupBox" name="gbPrintRange" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
+ <widget class="QGroupBox" name="gbPrintRange">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title" >
+ <property name="title">
<string>Print range</string>
</property>
- <layout class="QVBoxLayout" name="_3" >
- <property name="spacing" >
+ <layout class="QVBoxLayout" name="_3">
+ <property name="spacing">
<number>4</number>
</property>
- <property name="margin" >
+ <property name="margin">
<number>6</number>
</property>
<item>
- <widget class="QRadioButton" name="printAll" >
- <property name="text" >
+ <widget class="QRadioButton" name="printAll">
+ <property name="text">
<string>Print all</string>
</property>
- <property name="checked" >
+ <property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" name="_4" >
- <property name="spacing" >
+ <layout class="QHBoxLayout" name="_4">
+ <property name="spacing">
<number>6</number>
</property>
- <property name="margin" >
+ <property name="margin">
<number>0</number>
</property>
<item>
- <widget class="QRadioButton" name="printRange" >
- <property name="text" >
+ <widget class="QRadioButton" name="printRange">
+ <property name="text">
<string>Pages from</string>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="from" >
- <property name="enabled" >
+ <widget class="QSpinBox" name="from">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="minimum" >
+ <property name="minimum">
<number>1</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>999</number>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="label_3" >
- <property name="text" >
+ <widget class="QLabel" name="label_3">
+ <property name="text">
<string>to</string>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="to" >
- <property name="enabled" >
+ <widget class="QSpinBox" name="to">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="minimum" >
+ <property name="minimum">
<number>1</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>999</number>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
@@ -126,18 +119,25 @@
</layout>
</item>
<item>
- <widget class="QRadioButton" name="printSelection" >
- <property name="text" >
+ <widget class="QRadioButton" name="printCurrentPage">
+ <property name="text">
+ <string>Current Page</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="printSelection">
+ <property name="text">
<string>Selection</string>
</property>
</widget>
</item>
<item>
- <spacer name="verticalSpacer" >
- <property name="orientation" >
+ <spacer name="verticalSpacer">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
@@ -149,37 +149,37 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
<string>Output Settings</string>
</property>
- <layout class="QGridLayout" name="gridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Copies:</string>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>copies</cstring>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
- <widget class="QSpinBox" name="copies" >
- <property name="minimum" >
+ <item row="0" column="1" colspan="2">
+ <widget class="QSpinBox" name="copies">
+ <property name="minimum">
<number>1</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>999</number>
</property>
</widget>
</item>
- <item row="0" column="3" >
- <spacer name="horizontalSpacer" >
- <property name="orientation" >
+ <item row="0" column="3">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>91</width>
<height>20</height>
@@ -187,36 +187,36 @@
</property>
</spacer>
</item>
- <item row="1" column="0" colspan="2" >
- <widget class="QCheckBox" name="collate" >
- <property name="text" >
+ <item row="1" column="0" colspan="2">
+ <widget class="QCheckBox" name="collate">
+ <property name="text">
<string>Collate</string>
</property>
</widget>
</item>
- <item rowspan="2" row="1" column="2" colspan="2" >
- <widget class="QLabel" name="outputIcon" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Ignored" hsizetype="Ignored" >
+ <item row="1" column="2" rowspan="2" colspan="2">
+ <widget class="QLabel" name="outputIcon">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="2" >
- <widget class="QCheckBox" name="reverse" >
- <property name="text" >
+ <item row="2" column="0" colspan="2">
+ <widget class="QCheckBox" name="reverse">
+ <property name="text">
<string>Reverse</string>
</property>
</widget>
</item>
- <item row="3" column="0" colspan="4" >
- <spacer name="verticalSpacer_2" >
- <property name="orientation" >
+ <item row="3" column="0" colspan="4">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>1</height>
@@ -229,31 +229,23 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="optionsTab" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>412</width>
- <height>139</height>
- </rect>
- </property>
- <attribute name="title" >
+ <widget class="QWidget" name="optionsTab">
+ <attribute name="title">
<string>Options</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_2" >
- <item row="0" column="1" >
- <widget class="QGroupBox" name="colorMode" >
- <property name="title" >
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="1">
+ <widget class="QGroupBox" name="colorMode">
+ <property name="title">
<string>Color Mode</string>
</property>
- <layout class="QGridLayout" name="gridLayout_4" >
- <item row="2" column="0" >
- <spacer name="verticalSpacer_6" >
- <property name="orientation" >
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="2" column="0">
+ <spacer name="verticalSpacer_6">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>0</height>
@@ -261,19 +253,19 @@
</property>
</spacer>
</item>
- <item row="0" column="0" >
- <widget class="QRadioButton" name="color" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="color">
+ <property name="text">
<string>Color</string>
</property>
</widget>
</item>
- <item rowspan="3" row="0" column="1" >
- <widget class="QLabel" name="colorIcon" />
+ <item row="0" column="1" rowspan="3">
+ <widget class="QLabel" name="colorIcon"/>
</item>
- <item row="1" column="0" >
- <widget class="QRadioButton" name="grayscale" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QRadioButton" name="grayscale">
+ <property name="text">
<string>Grayscale</string>
</property>
</widget>
@@ -281,42 +273,42 @@
</layout>
</widget>
</item>
- <item row="0" column="0" >
- <widget class="QGroupBox" name="duplex" >
- <property name="title" >
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="duplex">
+ <property name="title">
<string>Duplex Printing</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QRadioButton" name="noDuplex" >
- <property name="text" >
+ <widget class="QRadioButton" name="noDuplex">
+ <property name="text">
<string>None</string>
</property>
- <property name="checked" >
+ <property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <widget class="QRadioButton" name="duplexLong" >
- <property name="text" >
+ <widget class="QRadioButton" name="duplexLong">
+ <property name="text">
<string>Long side</string>
</property>
</widget>
</item>
<item>
- <widget class="QRadioButton" name="duplexShort" >
- <property name="text" >
+ <widget class="QRadioButton" name="duplexShort">
+ <property name="text">
<string>Short side</string>
</property>
</widget>
</item>
<item>
- <spacer name="verticalSpacer_42" >
- <property name="orientation" >
+ <spacer name="verticalSpacer_42">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>0</height>
@@ -341,11 +333,11 @@
<receiver>from</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>76</x>
<y>59</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>122</x>
<y>57</y>
</hint>
@@ -357,11 +349,11 @@
<receiver>to</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>69</x>
<y>67</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>215</x>
<y>67</y>
</hint>