27 #include "htmlexportsettings.h"
29 #include <KDateComboBox>
30 #include <KFileDialog>
32 #include <KMessageBox>
33 #include <KUrlRequester>
39 #include <QHBoxLayout>
41 #include <QVBoxLayout>
48 :
KPageDialog( parent ), KPIM::KPrefsWidManager( settings ), mSettings( settings )
50 setAttribute(Qt::WA_DeleteOnClose);
51 setFaceType( Tabbed );
52 setCaption( i18n(
"Export Calendar as Web Page" ) );
53 setButtons( Default|User1|Cancel );
55 setDefaultButton( User1 );
57 showButtonSeparator(
false );
58 setButtonText( User1, i18n(
"Export" ) );
68 connect(
this, SIGNAL(user1Clicked()), SLOT(
slotOk()) );
69 connect(
this, SIGNAL(cancelClicked()), SLOT(reject()) );
70 connect(
this, SIGNAL(defaultClicked()),
this, SLOT(
slotDefault()) );
71 connect(
this, SIGNAL(applyClicked()),
this, SLOT(
slotApply()) );
115 if ( KMessageBox::warningContinueCancel(
117 i18n(
"You are about to set all preferences to default values. "
118 "All custom modifications will be lost." ),
119 i18n(
"Setting Default Preferences" ),
120 KGuiItem( i18n(
"Reset to Defaults" ) ) ) == KMessageBox::Continue ) {
127 mGeneralPage =
new QFrame(
this );
128 addPage( mGeneralPage, i18nc(
"general settings for html export",
"General" ) );
132 mDateRangeGroup =
new QGroupBox( i18n(
"Date Range" ), mGeneralPage );
137 KPIM::KPrefsWidDate *dateStart = addWidDate( mSettings->dateStartItem() );
138 rangeLayout->
addWidget( dateStart->label() );
139 rangeLayout->
addWidget( dateStart->dateEdit() );
140 KPIM::KPrefsWidDate *dateEnd = addWidDate( mSettings->dateEndItem() );
141 rangeLayout->
addWidget( dateEnd->label() );
142 rangeLayout->
addWidget( dateEnd->dateEdit() );
149 mMonthViewCheckBox = addWidBool( mSettings->monthViewItem() )->checkBox();
150 connect( mMonthViewCheckBox, SIGNAL(stateChanged(
int)), SLOT(updateState()) );
151 typeLayout->
addWidget( mMonthViewCheckBox );
153 mEventListCheckBox = addWidBool( mSettings->eventViewItem() )->checkBox();
154 connect( mEventListCheckBox, SIGNAL(stateChanged(
int)), SLOT(updateState()) );
155 typeLayout->
addWidget( mEventListCheckBox );
157 typeLayout->
addWidget( addWidBool( mSettings->todoViewItem() )->checkBox() );
159 addWidBool( mSettings->excludePrivateItem() )->checkBox() );
161 addWidBool( mSettings->excludeConfidentialItem() )->checkBox() );
168 KPIM::KPrefsWidPath *pathWid = addWidPath( mSettings->outputFileItem(),
170 pathWid->urlRequester()->fileDialog()->setOperationMode( KFileDialog::Saving );
171 connect( pathWid->urlRequester(), SIGNAL(textChanged(
QString)),
173 destLayout->
addWidget( pathWid->label() );
174 destLayout->
addWidget( pathWid->urlRequester() );
186 mTodoPage =
new QFrame(
this );
187 addPage( mTodoPage, i18n(
"To-dos" ) );
191 KHBox *hbox =
new KHBox( mTodoPage );
192 hbox->setSpacing(10);
194 addWidString( mSettings->todoListTitleItem(), hbox );
196 KVBox *vbox =
new KVBox( mTodoPage );
198 addWidBool( mSettings->taskDueDateItem(), vbox );
199 addWidBool( mSettings->taskLocationItem(), vbox );
200 addWidBool( mSettings->taskCategoriesItem(), vbox );
201 addWidBool( mSettings->taskAttendeesItem(), vbox );
210 mEventPage =
new QFrame(
this );
211 addPage( mEventPage, i18n(
"Events" ) );
215 KHBox *hbox =
new KHBox( mEventPage );
216 hbox->setSpacing(10);
218 addWidString( mSettings->eventTitleItem(), hbox );
220 KVBox *vbox =
new KVBox( mEventPage );
222 addWidBool( mSettings->eventLocationItem(), vbox );
223 addWidBool( mSettings->eventCategoriesItem(), vbox );
224 addWidBool( mSettings->eventAttendeesItem(), vbox );
279 void ExportWebDialog::updateState()
281 const bool exportEvents = mMonthViewCheckBox->
isChecked() ||
virtual void usrReadConfig()
void slotTextChanged(const QString &_text)
void exportHTML(KOrg::HTMLExportSettings *)
virtual ~ExportWebDialog()
ExportWebDialog(KOrg::HTMLExportSettings *settings, QWidget *parent=0)
void addStretch(int stretch)
virtual void usrWriteConfig()
void setSpacing(int spacing)