author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/koeventeditor.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/koeventeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventeditor.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 3e87197..62ad250 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp | |||
@@ -19,20 +19,25 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qframe.h> | 25 | #include <q3frame.h> |
26 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
27 | #include <qhbox.h> | 27 | #include <q3hbox.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qdir.h> | 29 | #include <qdir.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qwidgetstack.h> | 31 | #include <q3widgetstack.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <QDesktopWidget> | ||
34 | //Added by qt3to4: | ||
35 | #include <Q3HBoxLayout> | ||
36 | #include <Q3PtrList> | ||
37 | #include <Q3VBoxLayout> | ||
33 | 38 | ||
34 | #include <kiconloader.h> | 39 | #include <kiconloader.h> |
35 | #include <kstandarddirs.h> | 40 | #include <kstandarddirs.h> |
36 | #include <kdebug.h> | 41 | #include <kdebug.h> |
37 | #include <klocale.h> | 42 | #include <klocale.h> |
38 | #include <kfiledialog.h> | 43 | #include <kfiledialog.h> |
@@ -102,33 +107,33 @@ void KOEventEditor::setCategories( QString s ) | |||
102 | void KOEventEditor::setupGeneral() | 107 | void KOEventEditor::setupGeneral() |
103 | { | 108 | { |
104 | mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); | 109 | mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); |
105 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); | 110 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); |
106 | 111 | ||
107 | if( KOPrefs::instance()->mCompactDialogs ) { | 112 | if( KOPrefs::instance()->mCompactDialogs ) { |
108 | QFrame *topFrame = addPage(i18n("General")); | 113 | Q3Frame *topFrame = addPage(i18n("General")); |
109 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 114 | Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); |
110 | topLayout->setSpacing(spacingHint()-1); | 115 | topLayout->setSpacing(spacingHint()-1); |
111 | topLayout->setMargin(marginHint()-1); | 116 | topLayout->setMargin(marginHint()-1); |
112 | topLayout->addStretch ( 1 ); | 117 | topLayout->addStretch ( 1 ); |
113 | mGeneral->initHeader(topFrame,topLayout); | 118 | mGeneral->initHeader(topFrame,topLayout); |
114 | topLayout->addStretch ( 1 ); | 119 | topLayout->addStretch ( 1 ); |
115 | mGeneral->initTime(topFrame,topLayout); | 120 | mGeneral->initTime(topFrame,topLayout); |
116 | topLayout->addStretch ( 1 ); | 121 | topLayout->addStretch ( 1 ); |
117 | // QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 122 | // QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); |
118 | mGeneral->initAlarm(topFrame,topLayout); | 123 | mGeneral->initAlarm(topFrame,topLayout); |
119 | topLayout->addStretch ( 1 ); | 124 | topLayout->addStretch ( 1 ); |
120 | mGeneral->enableAlarm( false ); | 125 | mGeneral->enableAlarm( false ); |
121 | 126 | ||
122 | QBoxLayout *buttonLayout; | 127 | Q3BoxLayout *buttonLayout; |
123 | if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) | 128 | if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) |
124 | buttonLayout = new QVBoxLayout( topLayout ); | 129 | buttonLayout = new Q3VBoxLayout( topLayout ); |
125 | else | 130 | else |
126 | buttonLayout = new QHBoxLayout( topLayout ); | 131 | buttonLayout = new Q3HBoxLayout( topLayout ); |
127 | QHBox* buttonWidget = new QHBox (topFrame); | 132 | Q3HBox* buttonWidget = new Q3HBox (topFrame); |
128 | QIconSet icon; | 133 | QIcon icon; |
129 | if ( QApplication::desktop()->width() < 321 ) | 134 | if ( QApplication::desktop()->width() < 321 ) |
130 | icon = SmallIcon("fileexport16"); | 135 | icon = SmallIcon("fileexport16"); |
131 | else | 136 | else |
132 | icon = SmallIcon("fileexport"); | 137 | icon = SmallIcon("fileexport"); |
133 | QPushButton * loadTemplate = new QPushButton( buttonWidget); | 138 | QPushButton * loadTemplate = new QPushButton( buttonWidget); |
134 | QPushButton * saveTemplate = new QPushButton( buttonWidget); | 139 | QPushButton * saveTemplate = new QPushButton( buttonWidget); |
@@ -143,50 +148,50 @@ void KOEventEditor::setupGeneral() | |||
143 | loadTemplate->setFixedSize( size, size ); | 148 | loadTemplate->setFixedSize( size, size ); |
144 | buttonLayout->addWidget( buttonWidget ); | 149 | buttonLayout->addWidget( buttonWidget ); |
145 | mGeneral->initCategories( topFrame, buttonLayout ); | 150 | mGeneral->initCategories( topFrame, buttonLayout ); |
146 | 151 | ||
147 | topLayout->addStretch( 1 ); | 152 | topLayout->addStretch( 1 ); |
148 | 153 | ||
149 | QFrame *topFrame2 = addPage(i18n("Details")); | 154 | Q3Frame *topFrame2 = addPage(i18n("Details")); |
150 | 155 | ||
151 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); | 156 | Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); |
152 | topLayout2->setSpacing(spacingHint()-1); | 157 | topLayout2->setSpacing(spacingHint()-1); |
153 | topLayout2->setMargin(marginHint()-1); | 158 | topLayout2->setMargin(marginHint()-1); |
154 | topLayout2->setSpacing(spacingHint()); | 159 | topLayout2->setSpacing(spacingHint()); |
155 | 160 | ||
156 | mGeneral->initClass(topFrame2,topLayout2); | 161 | mGeneral->initClass(topFrame2,topLayout2); |
157 | mGeneral->initSecrecy( topFrame2, topLayout2 ); | 162 | mGeneral->initSecrecy( topFrame2, topLayout2 ); |
158 | mGeneral->initDescription(topFrame2,topLayout2); | 163 | mGeneral->initDescription(topFrame2,topLayout2); |
159 | 164 | ||
160 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 165 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
161 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 166 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
162 | } else { | 167 | } else { |
163 | QFrame *topFrame = addPage(i18n("General")); | 168 | Q3Frame *topFrame = addPage(i18n("General")); |
164 | 169 | ||
165 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 170 | Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); |
166 | topLayout->setSpacing(spacingHint()); | 171 | topLayout->setSpacing(spacingHint()); |
167 | 172 | ||
168 | mGeneral->initHeader(topFrame,topLayout); | 173 | mGeneral->initHeader(topFrame,topLayout); |
169 | mGeneral->initTime(topFrame,topLayout); | 174 | mGeneral->initTime(topFrame,topLayout); |
170 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 175 | Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); |
171 | mGeneral->initAlarm(topFrame,alarmLineLayout); | 176 | mGeneral->initAlarm(topFrame,alarmLineLayout); |
172 | mGeneral->initClass(topFrame,alarmLineLayout); | 177 | mGeneral->initClass(topFrame,alarmLineLayout); |
173 | mGeneral->initDescription(topFrame,topLayout); | 178 | mGeneral->initDescription(topFrame,topLayout); |
174 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); | 179 | Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout); |
175 | mGeneral->initCategories( topFrame, detailsLayout ); | 180 | mGeneral->initCategories( topFrame, detailsLayout ); |
176 | mGeneral->initSecrecy( topFrame, detailsLayout ); | 181 | mGeneral->initSecrecy( topFrame, detailsLayout ); |
177 | } | 182 | } |
178 | 183 | ||
179 | mGeneral->finishSetup(); | 184 | mGeneral->finishSetup(); |
180 | 185 | ||
181 | } | 186 | } |
182 | 187 | ||
183 | void KOEventEditor::setupRecurrence() | 188 | void KOEventEditor::setupRecurrence() |
184 | { | 189 | { |
185 | QFrame *topFrame = addPage( i18n("Recurrence") ); | 190 | Q3Frame *topFrame = addPage( i18n("Recurrence") ); |
186 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); | 191 | Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); |
187 | 192 | ||
188 | mRecurrence = new KOEditorRecurrence( topFrame ); | 193 | mRecurrence = new KOEditorRecurrence( topFrame ); |
189 | topLayout->addWidget( mRecurrence ); | 194 | topLayout->addWidget( mRecurrence ); |
190 | } | 195 | } |
191 | 196 | ||
192 | void KOEventEditor::editEvent(Event *event, bool showDescription) | 197 | void KOEventEditor::editEvent(Event *event, bool showDescription) |
@@ -353,13 +358,13 @@ void KOEventEditor::slotLoadTemplate() | |||
353 | ICalFormat format; | 358 | ICalFormat format; |
354 | if ( !format.load( &cal, fileName ) ) { | 359 | if ( !format.load( &cal, fileName ) ) { |
355 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 360 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
356 | .arg( fileName ) ); | 361 | .arg( fileName ) ); |
357 | return ; | 362 | return ; |
358 | } | 363 | } |
359 | QPtrList<Event> events = cal.events(); | 364 | Q3PtrList<Event> events = cal.events(); |
360 | Event* event = events.first(); | 365 | Event* event = events.first(); |
361 | if ( !event ) { | 366 | if ( !event ) { |
362 | KMessageBox::error( this, | 367 | KMessageBox::error( this, |
363 | i18n("Template does not contain\na valid Event.")); | 368 | i18n("Template does not contain\na valid Event.")); |
364 | } else { | 369 | } else { |
365 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; | 370 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; |