diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 47d455dd55be855e4cc691c32f687f723d9247ee (patch) | |
tree | 52e236aaa2576bdb3840ebede26619692fed6d7d /kviewshell/pageSizeDialog.cpp | |
download | tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kviewshell/pageSizeDialog.cpp')
-rw-r--r-- | kviewshell/pageSizeDialog.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/kviewshell/pageSizeDialog.cpp b/kviewshell/pageSizeDialog.cpp new file mode 100644 index 00000000..3a64cbe3 --- /dev/null +++ b/kviewshell/pageSizeDialog.cpp @@ -0,0 +1,63 @@ +// pageSizeDialog.cpp +// +// Part of KVIEWSHELL - A framework for multipage text/gfx viewers +// +// (C) 2002-2003 Stefan Kebekus +// Distributed under the GPL + +// Add header files alphabetically + +#include <config.h> + +#include <kapplication.h> +#include <kcombobox.h> +#include <klocale.h> +#include <kmessagebox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qlineedit.h> +#include <qvalidator.h> +#include <qhbox.h> + + + +#include "pageSizeDialog.h" +#include "pageSizeWidget.h" + + +pageSizeDialog::pageSizeDialog( QWidget *parent, pageSize *userPrefdPageSize, const char *name, bool modal) + :KDialogBase( parent, name, modal, i18n("Page Size"), Ok|Apply|Cancel, Ok, + true ) +{ + userPreferredPageSize = userPrefdPageSize; + pageSizeW = new pageSizeWidget(this, "PageSizeWidget"); + pageSizeW->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, + pageSizeW->sizePolicy().hasHeightForWidth() ) ); + setMainWidget(pageSizeW); +} + + +void pageSizeDialog::slotOk() +{ + if (userPreferredPageSize != 0) + *userPreferredPageSize = pageSizeW->pageSizeData(); + accept(); +} + + +void pageSizeDialog::slotApply() +{ + if (userPreferredPageSize != 0) + *userPreferredPageSize = pageSizeW->pageSizeData(); +} + + +void pageSizeDialog::setPageSize(const QString& name) +{ + if (pageSizeW == 0) + return; + pageSizeW->setPageSize(name); +} + + +#include "pageSizeDialog.moc" |