summaryrefslogtreecommitdiffstats
path: root/kivio/kiviopart/ui/export_page_dialog.cpp
blob: 94feb1421946d71f3b40f07a7154346038ee2d04 (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
#include "export_page_dialog.h"

#include <tqcheckbox.h>
#include <tqradiobutton.h>
#include <tqspinbox.h>

#include <klocale.h>

#include "export_page_dialog_base.h"
#include "kivio_config.h"

ExportPageDialog::ExportPageDialog( TQWidget *tqparent, const char *name )
   : KDialogBase(tqparent, name, true, i18n("Export Page"), Ok|Cancel, Ok)
{
  m_view = new ExportPageDialogBase(this);
  setMainWidget(m_view);
  
  m_view->m_checkCrop->setChecked(Kivio::Config::crop());
  m_view->m_radioFullPage->setChecked(!Kivio::Config::selectedStencils());
  m_view->m_radioSelectedStencils->setChecked(Kivio::Config::selectedStencils());
  m_view->m_spinBorder->setValue(Kivio::Config::border());
  m_view->m_spinQuality->setValue(Kivio::Config::quality());
}

int ExportPageDialog::quality()
{
   return m_view->m_spinQuality->value();
}

int ExportPageDialog::border()
{
   return m_view->m_spinBorder->value();
}

bool ExportPageDialog::crop()
{
   return m_view->m_checkCrop->isChecked();
}

bool ExportPageDialog::fullPage()
{
   return m_view->m_radioFullPage->isChecked();
}

bool ExportPageDialog::selectedStencils()
{
   return m_view->m_radioSelectedStencils->isChecked();
}

void ExportPageDialog::slotOk()
{
  Kivio::Config::setCrop(m_view->m_checkCrop->isChecked());
  Kivio::Config::setSelectedStencils(m_view->m_radioSelectedStencils->isChecked());
  Kivio::Config::setBorder(m_view->m_spinBorder->value());
  Kivio::Config::setQuality(m_view->m_spinQuality->value());
  
  accept();
}

#include "export_page_dialog.moc"