summaryrefslogtreecommitdiffstats
path: root/kviewshell/pageSizeDialog.cpp
blob: 3a64cbe30d3e00001affff70ab694758cce7b144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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"