mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
PS print dialog: open with a non-lilliputian size, and remember its size across invocations
svn path=/trunk/KDE/kdegraphics/okular/; revision=945138
This commit is contained in:
parent
fa136bc6db
commit
512ad01b14
|
@ -37,6 +37,8 @@ public:
|
|||
, mainWidget(new QWidget(host))
|
||||
, previewPart(0)
|
||||
, failMessage(0)
|
||||
, config(KSharedConfig::openConfig(QString::fromLatin1("okularrc")))
|
||||
|
||||
{
|
||||
filename = _filename;
|
||||
}
|
||||
|
@ -53,6 +55,8 @@ public:
|
|||
|
||||
KParts::ReadOnlyPart *previewPart;
|
||||
QWidget *failMessage;
|
||||
|
||||
KSharedConfig::Ptr config;
|
||||
};
|
||||
|
||||
void FilePrinterPreviewPrivate::getPart()
|
||||
|
@ -124,13 +128,24 @@ FilePrinterPreview::FilePrinterPreview( const QString &filename, QWidget *parent
|
|||
// Set up the dialog
|
||||
setCaption(i18n("Print Preview"));
|
||||
setButtons(KDialog::Close);
|
||||
|
||||
restoreDialogSize(d->config->group("Print Preview"));
|
||||
}
|
||||
|
||||
FilePrinterPreview::~FilePrinterPreview()
|
||||
{
|
||||
KConfigGroup group(d->config->group("Print Preview"));
|
||||
saveDialogSize(group);
|
||||
|
||||
delete d;
|
||||
}
|
||||
|
||||
QSize FilePrinterPreview::sizeHint() const
|
||||
{
|
||||
// return a more or less useful window size, if not saved already
|
||||
return QSize(600, 500);
|
||||
}
|
||||
|
||||
void FilePrinterPreview::showEvent(QShowEvent *event)
|
||||
{
|
||||
if (!event->spontaneous()) {
|
||||
|
|
|
@ -35,6 +35,8 @@ public:
|
|||
explicit FilePrinterPreview( const QString &filename, QWidget *parent = 0 );
|
||||
virtual ~FilePrinterPreview();
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
protected:
|
||||
void showEvent( QShowEvent *event );
|
||||
|
||||
|
|
Loading…
Reference in a new issue