23 #include <tqbuttongroup.h>
24 #include <tqcheckbox.h>
28 #include <tqlineedit.h>
30 #include <tqpushbutton.h>
33 #include <tqwhatsthis.h>
35 #include <kiconloader.h>
36 #include <tdelocale.h>
37 #include <twinmodule.h>
39 #include "printdialog.h"
40 #include <libtdepim/kdateedit.h>
43 PrintDialog::PrintDialog()
44 : KDialogBase(0, "PrintDialog", true, i18n( "Print Dialog"), Ok|Cancel,
47 TQWidget *page = new TQWidget( this );
51 TQVBoxLayout *layout = new TQVBoxLayout(page, KDialog::spacingHint());
52 layout->addSpacing(10);
53 layout->addStretch(1);
56 TQGroupBox *rangeGroup = new TQGroupBox(1, TQt::Horizontal, i18n( "Date Range"),
58 layout->addWidget(rangeGroup);
60 TQWidget *rangeWidget = new TQWidget(rangeGroup);
61 TQHBoxLayout *rangeLayout = new TQHBoxLayout(rangeWidget, 0, spacingHint());
63 rangeLayout->addWidget( new TQLabel(i18n( "From:"), rangeWidget));
64 _from = new KDateEdit(rangeWidget);
67 year = TQDate::currentDate().year();
68 month = TQDate::currentDate().month();
69 _from->setDate(TQDate(year, month, 1));
70 rangeLayout->addWidget(_from);
71 rangeLayout->addWidget( new TQLabel(i18n( "To:"), rangeWidget));
72 _to = new KDateEdit(rangeWidget);
73 rangeLayout->addWidget(_to);
75 layout->addSpacing(10);
76 layout->addStretch(1);
78 _allTasks = new TQComboBox( page );
79 _allTasks->insertItem( i18n( "Selected Task" ) );
80 _allTasks->insertItem( i18n( "All Tasks" ) );
81 layout->addWidget( _allTasks );
83 _perWeek = new TQCheckBox( i18n( "Summarize per week" ), page );
84 layout->addWidget( _perWeek );
85 _totalsOnly = new TQCheckBox( i18n( "Totals only" ), page );
86 layout->addWidget( _totalsOnly );
88 layout->addSpacing(10);
89 layout->addStretch(1);
92 TQDate PrintDialog::from() const
97 TQDate PrintDialog::to() const
102 bool PrintDialog::perWeek() const
104 return _perWeek->isChecked();
107 bool PrintDialog::allTasks() const
109 return _allTasks->currentItem() == 1;
112 bool PrintDialog::totalsOnly() const
114 return _totalsOnly->isChecked();
117 #include "printdialog.moc"
|