author | zautrix <zautrix> | 2004-12-05 11:14:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-05 11:14:32 (UTC) |
commit | 196365e533c6fd1a8f47aa9579763ef5afcebcda (patch) (unidiff) | |
tree | 3784f0be50b790d9386db1e4ebd29d44317db026 /korganizer | |
parent | e4e75984b6cb581d87d436cb6c5140eb57dbdc51 (diff) | |
download | kdepimpi-196365e533c6fd1a8f47aa9579763ef5afcebcda.zip kdepimpi-196365e533c6fd1a8f47aa9579763ef5afcebcda.tar.gz kdepimpi-196365e533c6fd1a8f47aa9579763ef5afcebcda.tar.bz2 |
layout bugfixes
-rw-r--r-- | korganizer/calendarview.cpp | 14 | ||||
-rw-r--r-- | korganizer/koeditordetails.cpp | 7 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 5 |
3 files changed, 18 insertions, 8 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 47cd488..543897a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2405,108 +2405,114 @@ void CalendarView::moveIncidence(Incidence * inc ) | |||
2405 | if ( !inc ) return; | 2405 | if ( !inc ) return; |
2406 | // qDebug("showDatePickerForIncidence( ) "); | 2406 | // qDebug("showDatePickerForIncidence( ) "); |
2407 | if ( mDateFrame->isVisible() ) | 2407 | if ( mDateFrame->isVisible() ) |
2408 | mDateFrame->hide(); | 2408 | mDateFrame->hide(); |
2409 | else { | 2409 | else { |
2410 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; | 2410 | int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ; |
2411 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; | 2411 | int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ; |
2412 | int dw = QApplication::desktop()->width(); | 2412 | int dw = QApplication::desktop()->width(); |
2413 | int dh = QApplication::desktop()->height(); | 2413 | int dh = QApplication::desktop()->height(); |
2414 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2414 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2415 | mDateFrame->show(); | 2415 | mDateFrame->show(); |
2416 | } | 2416 | } |
2417 | mDatePickerMode = 2; | 2417 | mDatePickerMode = 2; |
2418 | mMoveIncidence = inc ; | 2418 | mMoveIncidence = inc ; |
2419 | QDate da; | 2419 | QDate da; |
2420 | if ( mMoveIncidence->type() == "Todo" ) { | 2420 | if ( mMoveIncidence->type() == "Todo" ) { |
2421 | Todo * to = (Todo *) mMoveIncidence; | 2421 | Todo * to = (Todo *) mMoveIncidence; |
2422 | if ( to->hasDueDate() ) | 2422 | if ( to->hasDueDate() ) |
2423 | da = to->dtDue().date(); | 2423 | da = to->dtDue().date(); |
2424 | else | 2424 | else |
2425 | da = QDate::currentDate(); | 2425 | da = QDate::currentDate(); |
2426 | } else { | 2426 | } else { |
2427 | da = mMoveIncidence->dtStart().date(); | 2427 | da = mMoveIncidence->dtStart().date(); |
2428 | } | 2428 | } |
2429 | mDatePicker->setDate( da ); | 2429 | mDatePicker->setDate( da ); |
2430 | } | 2430 | } |
2431 | void CalendarView::showDatePicker( ) | 2431 | void CalendarView::showDatePicker( ) |
2432 | { | 2432 | { |
2433 | //qDebug("CalendarView::showDatePicker( ) "); | 2433 | //qDebug("CalendarView::showDatePicker( ) "); |
2434 | if ( mDateFrame->isVisible() ) | 2434 | if ( mDateFrame->isVisible() ) |
2435 | mDateFrame->hide(); | 2435 | mDateFrame->hide(); |
2436 | else { | 2436 | else { |
2437 | int w =mDatePicker->sizeHint().width() ; | 2437 | int w =mDatePicker->sizeHint().width() ; |
2438 | int h = mDatePicker->sizeHint().height() ; | 2438 | int h = mDatePicker->sizeHint().height() ; |
2439 | int dw = QApplication::desktop()->width(); | 2439 | int dw = QApplication::desktop()->width(); |
2440 | int dh = QApplication::desktop()->height(); | 2440 | int dh = QApplication::desktop()->height(); |
2441 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2441 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2442 | mDateFrame->show(); | 2442 | mDateFrame->show(); |
2443 | } | 2443 | } |
2444 | mDatePickerMode = 1; | 2444 | mDatePickerMode = 1; |
2445 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2445 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2446 | } | 2446 | } |
2447 | 2447 | ||
2448 | void CalendarView::showEventEditor() | 2448 | void CalendarView::showEventEditor() |
2449 | { | 2449 | { |
2450 | #ifdef DESKTOP_VERSION | 2450 | #ifdef DESKTOP_VERSION |
2451 | mEventEditor->show(); | 2451 | mEventEditor->show(); |
2452 | #else | 2452 | #else |
2453 | if ( mEventEditor->width() != QApplication::desktop()->width() ) | 2453 | if ( mEventEditor->width() != QApplication::desktop()->width() ) { |
2454 | mEventEditor->hide(); | 2454 | qDebug("CalendarView: recreate mEventEditor "); |
2455 | delete mEventEditor; | ||
2456 | mEventEditor = mDialogManager->getEventEditor(); | ||
2457 | } | ||
2455 | mEventEditor->showMaximized(); | 2458 | mEventEditor->showMaximized(); |
2456 | #endif | 2459 | #endif |
2457 | } | 2460 | } |
2458 | void CalendarView::showTodoEditor() | 2461 | void CalendarView::showTodoEditor() |
2459 | { | 2462 | { |
2460 | #ifdef DESKTOP_VERSION | 2463 | #ifdef DESKTOP_VERSION |
2461 | mTodoEditor->show(); | 2464 | mTodoEditor->show(); |
2462 | #else | 2465 | #else |
2463 | if ( mTodoEditor->width() != QApplication::desktop()->width() ) | 2466 | if ( mTodoEditor->width() != QApplication::desktop()->width() ) { |
2464 | mTodoEditor->hide(); | 2467 | qDebug("CalendarView: recreate mTodoEditor "); |
2468 | delete mTodoEditor; | ||
2469 | mTodoEditor = mDialogManager->getTodoEditor(); | ||
2470 | } | ||
2465 | mTodoEditor->showMaximized(); | 2471 | mTodoEditor->showMaximized(); |
2466 | #endif | 2472 | #endif |
2467 | } | 2473 | } |
2468 | 2474 | ||
2469 | void CalendarView::cloneIncidence() | 2475 | void CalendarView::cloneIncidence() |
2470 | { | 2476 | { |
2471 | Incidence *incidence = currentSelection(); | 2477 | Incidence *incidence = currentSelection(); |
2472 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2478 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2473 | if ( incidence ) { | 2479 | if ( incidence ) { |
2474 | cloneIncidence(incidence); | 2480 | cloneIncidence(incidence); |
2475 | } | 2481 | } |
2476 | } | 2482 | } |
2477 | void CalendarView::moveIncidence() | 2483 | void CalendarView::moveIncidence() |
2478 | { | 2484 | { |
2479 | Incidence *incidence = currentSelection(); | 2485 | Incidence *incidence = currentSelection(); |
2480 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2486 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2481 | if ( incidence ) { | 2487 | if ( incidence ) { |
2482 | moveIncidence(incidence); | 2488 | moveIncidence(incidence); |
2483 | } | 2489 | } |
2484 | } | 2490 | } |
2485 | void CalendarView::beamIncidence() | 2491 | void CalendarView::beamIncidence() |
2486 | { | 2492 | { |
2487 | Incidence *incidence = currentSelection(); | 2493 | Incidence *incidence = currentSelection(); |
2488 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2494 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2489 | if ( incidence ) { | 2495 | if ( incidence ) { |
2490 | beamIncidence(incidence); | 2496 | beamIncidence(incidence); |
2491 | } | 2497 | } |
2492 | } | 2498 | } |
2493 | void CalendarView::toggleCancelIncidence() | 2499 | void CalendarView::toggleCancelIncidence() |
2494 | { | 2500 | { |
2495 | Incidence *incidence = currentSelection(); | 2501 | Incidence *incidence = currentSelection(); |
2496 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2502 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2497 | if ( incidence ) { | 2503 | if ( incidence ) { |
2498 | cancelIncidence(incidence); | 2504 | cancelIncidence(incidence); |
2499 | } | 2505 | } |
2500 | } | 2506 | } |
2501 | 2507 | ||
2502 | 2508 | ||
2503 | void CalendarView::cancelIncidence(Incidence * inc ) | 2509 | void CalendarView::cancelIncidence(Incidence * inc ) |
2504 | { | 2510 | { |
2505 | inc->setCancelled( ! inc->cancelled() ); | 2511 | inc->setCancelled( ! inc->cancelled() ); |
2506 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 2512 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
2507 | updateView(); | 2513 | updateView(); |
2508 | } | 2514 | } |
2509 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 2515 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
2510 | { | 2516 | { |
2511 | Incidence * newInc = orgInc->clone(); | 2517 | Incidence * newInc = orgInc->clone(); |
2512 | newInc->recreate(); | 2518 | newInc->recreate(); |
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 66f6977..b73d22f 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp | |||
@@ -97,108 +97,109 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | |||
97 | QLabel *attendeeLabel = new QLabel(this); | 97 | QLabel *attendeeLabel = new QLabel(this); |
98 | attendeeLabel->setText(i18n("Name:")); | 98 | attendeeLabel->setText(i18n("Name:")); |
99 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); | 99 | attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); |
100 | mNameEdit = new QLineEdit(this); | 100 | mNameEdit = new QLineEdit(this); |
101 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), | 101 | connect(mNameEdit,SIGNAL(textChanged(const QString &)), |
102 | SLOT(updateAttendeeItem())); | 102 | SLOT(updateAttendeeItem())); |
103 | 103 | ||
104 | mUidEdit = new QLineEdit(0); | 104 | mUidEdit = new QLineEdit(0); |
105 | mUidEdit->setText(""); | 105 | mUidEdit->setText(""); |
106 | 106 | ||
107 | QLabel *emailLabel = new QLabel(this); | 107 | QLabel *emailLabel = new QLabel(this); |
108 | emailLabel->setText(i18n("Email:")); | 108 | emailLabel->setText(i18n("Email:")); |
109 | mEmailEdit = new QLineEdit(this); | 109 | mEmailEdit = new QLineEdit(this); |
110 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), | 110 | connect(mEmailEdit,SIGNAL(textChanged(const QString &)), |
111 | SLOT(updateAttendeeItem())); | 111 | SLOT(updateAttendeeItem())); |
112 | 112 | ||
113 | QLabel *attendeeRoleLabel = new QLabel(this); | 113 | QLabel *attendeeRoleLabel = new QLabel(this); |
114 | attendeeRoleLabel->setText(i18n("Role:")); | 114 | attendeeRoleLabel->setText(i18n("Role:")); |
115 | mRoleCombo = new QComboBox(false,this); | 115 | mRoleCombo = new QComboBox(false,this); |
116 | mRoleCombo->insertStringList(Attendee::roleList()); | 116 | mRoleCombo->insertStringList(Attendee::roleList()); |
117 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 117 | connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
118 | 118 | ||
119 | QLabel *statusLabel = new QLabel(this); | 119 | QLabel *statusLabel = new QLabel(this); |
120 | statusLabel->setText( i18n("Status:") ); | 120 | statusLabel->setText( i18n("Status:") ); |
121 | 121 | ||
122 | mStatusCombo = new QComboBox(false,this); | 122 | mStatusCombo = new QComboBox(false,this); |
123 | mStatusCombo->insertStringList(Attendee::statusList()); | 123 | mStatusCombo->insertStringList(Attendee::statusList()); |
124 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 124 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
125 | 125 | ||
126 | mRsvpButton = new QCheckBox(this); | 126 | mRsvpButton = new QCheckBox(this); |
127 | mRsvpButton->setText(i18n("Request response")); | 127 | mRsvpButton->setText(i18n("Request response")); |
128 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); | 128 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); |
129 | QWidget *buttonBox = new QWidget(this); | 129 | QWidget *buttonBox = new QWidget(this); |
130 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); | 130 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); |
131 | 131 | ||
132 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); | 132 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); |
133 | buttonLayout->addWidget(newButton); | 133 | buttonLayout->addWidget(newButton); |
134 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); | 134 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); |
135 | 135 | ||
136 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); | 136 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); |
137 | buttonLayout->addWidget(mRemoveButton); | 137 | buttonLayout->addWidget(mRemoveButton); |
138 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); | 138 | connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); |
139 | 139 | ||
140 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); | 140 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); |
141 | // buttonLayout->addWidget(mAddressBookButton); | 141 | // buttonLayout->addWidget(mAddressBookButton); |
142 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); | 142 | connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); |
143 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); | 143 | //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); |
144 | 144 | ||
145 | if (qApp->desktop()->width() < 300 ) { | 145 | if (qApp->desktop()->width() < 640 ) { |
146 | if ( qApp->desktop()->width() < 300 ) | ||
146 | mListView->setFixedHeight(80); | 147 | mListView->setFixedHeight(80); |
147 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); | 148 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); |
148 | topLayout->addMultiCellWidget(mListView,1,1,0,3); | 149 | topLayout->addMultiCellWidget(mListView,1,1,0,3); |
149 | topLayout->addWidget(attendeeLabel,3,0); | 150 | topLayout->addWidget(attendeeLabel,3,0); |
150 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); | 151 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); |
151 | topLayout->addWidget(emailLabel,4,0); | 152 | topLayout->addWidget(emailLabel,4,0); |
152 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); | 153 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); |
153 | topLayout->addWidget(attendeeRoleLabel,5,0); | 154 | topLayout->addWidget(attendeeRoleLabel,5,0); |
154 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | 155 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); |
155 | topLayout->addWidget(statusLabel,6,0); | 156 | topLayout->addWidget(statusLabel,6,0); |
156 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,2); | 157 | topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); |
157 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); | 158 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); |
158 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 159 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
159 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); | 160 | topLayout->addMultiCellWidget(buttonBox,3,4,3,3); |
160 | topLayout->setRowStretch(1,2); | 161 | topLayout->setRowStretch(1,2); |
161 | topLayout->setColStretch(0,0); | 162 | topLayout->setColStretch(0,0); |
162 | topLayout->setColStretch(1,2); | 163 | topLayout->setColStretch(1,2); |
163 | topLayout->setColStretch(2,1); | 164 | topLayout->setColStretch(2,1); |
164 | topLayout->setColStretch(3,1); | 165 | topLayout->setColStretch(3,1); |
165 | 166 | ||
166 | } else { | 167 | } else { |
167 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); | 168 | topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); |
168 | topLayout->addMultiCellWidget(mListView,1,1,0,5); | 169 | topLayout->addMultiCellWidget(mListView,1,1,0,5); |
169 | topLayout->addWidget(attendeeLabel,3,0); | 170 | topLayout->addWidget(attendeeLabel,3,0); |
170 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); | 171 | topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); |
171 | topLayout->addWidget(emailLabel,4,0); | 172 | topLayout->addWidget(emailLabel,4,0); |
172 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); | 173 | topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); |
173 | topLayout->addWidget(attendeeRoleLabel,5,0); | 174 | topLayout->addWidget(attendeeRoleLabel,5,0); |
174 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); | 175 | topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); |
175 | topLayout->addWidget(statusLabel,5,3); | 176 | topLayout->addWidget(statusLabel,5,3); |
176 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); | 177 | topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); |
177 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); | 178 | topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); |
178 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); | 179 | topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); |
179 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); | 180 | topLayout->addMultiCellWidget(buttonBox,3,4,5,5); |
180 | topLayout->setRowStretch(1,5); | 181 | topLayout->setRowStretch(1,5); |
181 | topLayout->setColStretch(0,0); | 182 | topLayout->setColStretch(0,0); |
182 | } | 183 | } |
183 | // #if 0 | 184 | // #if 0 |
184 | // topLayout->setColStretch(2,1); | 185 | // topLayout->setColStretch(2,1); |
185 | // topLayout->addWidget(statusLabel,3,3); | 186 | // topLayout->addWidget(statusLabel,3,3); |
186 | // topLayout->addWidget(mStatusCombo,3,4); | 187 | // topLayout->addWidget(mStatusCombo,3,4); |
187 | // #else | 188 | // #else |
188 | // topLayout->addWidget(statusLabel,4,3); | 189 | // topLayout->addWidget(statusLabel,4,3); |
189 | // // topLayout->addWidget(mStatusCombo,4,3); | 190 | // // topLayout->addWidget(mStatusCombo,4,3); |
190 | // topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); | 191 | // topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); |
191 | 192 | ||
192 | // #endif | 193 | // #endif |
193 | // // topLayout->setRowStretch(5,1); | 194 | // // topLayout->setRowStretch(5,1); |
194 | // topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); | 195 | // topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); |
195 | // topLayout->addMultiCellWidget(buttonBox,2,3,5,5); | 196 | // topLayout->addMultiCellWidget(buttonBox,2,3,5,5); |
196 | // topLayout->setRowStretch(1,5); | 197 | // topLayout->setRowStretch(1,5); |
197 | // topLayout->setColStretch(0,0); | 198 | // topLayout->setColStretch(0,0); |
198 | 199 | ||
199 | #ifdef KORG_NOKABC | 200 | #ifdef KORG_NOKABC |
200 | mAddressBookButton->hide(); | 201 | mAddressBookButton->hide(); |
201 | #endif | 202 | #endif |
202 | 203 | ||
203 | updateAttendeeInput(); | 204 | updateAttendeeInput(); |
204 | #ifndef DESKTOP_VERSION | 205 | #ifndef DESKTOP_VERSION |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 65566b5..46ae6a0 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -68,97 +68,100 @@ using namespace KCal; | |||
68 | #else | 68 | #else |
69 | #include "koimportoldialog.h" | 69 | #include "koimportoldialog.h" |
70 | #endif | 70 | #endif |
71 | #include "mainwindow.h" | 71 | #include "mainwindow.h" |
72 | 72 | ||
73 | class KOex2phonePrefs : public QDialog | 73 | class KOex2phonePrefs : public QDialog |
74 | { | 74 | { |
75 | public: | 75 | public: |
76 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 76 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
77 | QDialog( parent, name, true ) | 77 | QDialog( parent, name, true ) |
78 | { | 78 | { |
79 | setCaption( i18n("Export to phone options") ); | 79 | setCaption( i18n("Export to phone options") ); |
80 | QVBoxLayout* lay = new QVBoxLayout( this ); | 80 | QVBoxLayout* lay = new QVBoxLayout( this ); |
81 | lay->setSpacing( 3 ); | 81 | lay->setSpacing( 3 ); |
82 | lay->setMargin( 3 ); | 82 | lay->setMargin( 3 ); |
83 | QLabel *lab; | 83 | QLabel *lab; |
84 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 84 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
85 | lab->setAlignment (AlignHCenter ); | 85 | lab->setAlignment (AlignHCenter ); |
86 | QHBox* temphb; | 86 | QHBox* temphb; |
87 | temphb = new QHBox( this ); | 87 | temphb = new QHBox( this ); |
88 | new QLabel( i18n("I/O device: "), temphb ); | 88 | new QLabel( i18n("I/O device: "), temphb ); |
89 | mPhoneDevice = new QLineEdit( temphb); | 89 | mPhoneDevice = new QLineEdit( temphb); |
90 | lay->addWidget( temphb ); | 90 | lay->addWidget( temphb ); |
91 | temphb = new QHBox( this ); | 91 | temphb = new QHBox( this ); |
92 | new QLabel( i18n("Connection: "), temphb ); | 92 | new QLabel( i18n("Connection: "), temphb ); |
93 | mPhoneConnection = new QLineEdit( temphb); | 93 | mPhoneConnection = new QLineEdit( temphb); |
94 | lay->addWidget( temphb ); | 94 | lay->addWidget( temphb ); |
95 | temphb = new QHBox( this ); | 95 | temphb = new QHBox( this ); |
96 | new QLabel( i18n("Model(opt.): "), temphb ); | 96 | new QLabel( i18n("Model(opt.): "), temphb ); |
97 | mPhoneModel = new QLineEdit( temphb); | 97 | mPhoneModel = new QLineEdit( temphb); |
98 | lay->addWidget( temphb ); | 98 | lay->addWidget( temphb ); |
99 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 99 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
100 | mWriteBackFuture->setChecked( true ); | 100 | mWriteBackFuture->setChecked( true ); |
101 | lay->addWidget( mWriteBackFuture ); | 101 | lay->addWidget( mWriteBackFuture ); |
102 | temphb = new QHBox( this ); | 102 | temphb = new QHBox( this ); |
103 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 103 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
104 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 104 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
105 | mWriteBackFutureWeeks->setValue( 8 ); | 105 | mWriteBackFutureWeeks->setValue( 8 ); |
106 | lay->addWidget( temphb ); | 106 | lay->addWidget( temphb ); |
107 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 107 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
108 | lab->setAlignment (AlignHCenter ); | 108 | lab->setAlignment (AlignHCenter ); |
109 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 109 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
110 | lay->addWidget( ok ); | 110 | lay->addWidget( ok ); |
111 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 111 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
112 | lay->addWidget( cancel ); | 112 | lay->addWidget( cancel ); |
113 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 113 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
114 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 114 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
115 | resize( 220, 240 ); | 115 | resize( 220, 240 ); |
116 | 116 | qApp->processEvents(); | |
117 | int dw = QApplication::desktop()->width(); | ||
118 | int dh = QApplication::desktop()->height(); | ||
119 | move( (dw-width())/2, (dh - height() )/2 ); | ||
117 | } | 120 | } |
118 | 121 | ||
119 | public: | 122 | public: |
120 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 123 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
121 | QCheckBox* mWriteBackFuture; | 124 | QCheckBox* mWriteBackFuture; |
122 | QSpinBox* mWriteBackFutureWeeks; | 125 | QSpinBox* mWriteBackFutureWeeks; |
123 | }; | 126 | }; |
124 | 127 | ||
125 | int globalFlagBlockStartup; | 128 | int globalFlagBlockStartup; |
126 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 129 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
127 | QMainWindow( parent, name ) | 130 | QMainWindow( parent, name ) |
128 | { | 131 | { |
129 | 132 | ||
130 | #ifdef DESKTOP_VERSION | 133 | #ifdef DESKTOP_VERSION |
131 | setFont( QFont("Arial"), 14 ); | 134 | setFont( QFont("Arial"), 14 ); |
132 | #endif | 135 | #endif |
133 | mClosed = false; | 136 | mClosed = false; |
134 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
135 | QString confFile = locateLocal("config","korganizerrc"); | 138 | QString confFile = locateLocal("config","korganizerrc"); |
136 | QFileInfo finf ( confFile ); | 139 | QFileInfo finf ( confFile ); |
137 | bool showWarning = !finf.exists(); | 140 | bool showWarning = !finf.exists(); |
138 | setIcon(SmallIcon( "ko24" ) ); | 141 | setIcon(SmallIcon( "ko24" ) ); |
139 | mBlockAtStartup = true; | 142 | mBlockAtStartup = true; |
140 | mFlagKeyPressed = false; | 143 | mFlagKeyPressed = false; |
141 | setCaption("KOrganizer/Pi"); | 144 | setCaption("KOrganizer/Pi"); |
142 | KOPrefs *p = KOPrefs::instance(); | 145 | KOPrefs *p = KOPrefs::instance(); |
143 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 146 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
144 | if ( p->mHourSize > 18 ) | 147 | if ( p->mHourSize > 18 ) |
145 | p->mHourSize = 18; | 148 | p->mHourSize = 18; |
146 | QMainWindow::ToolBarDock tbd; | 149 | QMainWindow::ToolBarDock tbd; |
147 | if ( p->mToolBarHor ) { | 150 | if ( p->mToolBarHor ) { |
148 | if ( p->mToolBarUp ) | 151 | if ( p->mToolBarUp ) |
149 | tbd = Bottom; | 152 | tbd = Bottom; |
150 | else | 153 | else |
151 | tbd = Top; | 154 | tbd = Top; |
152 | } | 155 | } |
153 | else { | 156 | else { |
154 | if ( p->mToolBarUp ) | 157 | if ( p->mToolBarUp ) |
155 | tbd = Right; | 158 | tbd = Right; |
156 | else | 159 | else |
157 | tbd = Left; | 160 | tbd = Left; |
158 | } | 161 | } |
159 | if ( KOPrefs::instance()->mUseAppColors ) | 162 | if ( KOPrefs::instance()->mUseAppColors ) |
160 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
161 | globalFlagBlockStartup = 1; | 164 | globalFlagBlockStartup = 1; |
162 | iconToolBar = new QPEToolBar( this ); | 165 | iconToolBar = new QPEToolBar( this ); |
163 | addToolBar (iconToolBar , tbd ); | 166 | addToolBar (iconToolBar , tbd ); |
164 | mCalendarModifiedFlag = false; | 167 | mCalendarModifiedFlag = false; |