author | zautrix <zautrix> | 2005-07-28 10:38:58 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-28 10:38:58 (UTC) |
commit | fee4c893fe8fd01af1b55c1ccd40213fc18a36b4 (patch) (unidiff) | |
tree | 83a3018d54d60e880d441a6f91ef8fe54254aaff /korganizer | |
parent | 27ffa2e08ebb38e71f613af3a214750442418e2c (diff) | |
download | kdepimpi-fee4c893fe8fd01af1b55c1ccd40213fc18a36b4.zip kdepimpi-fee4c893fe8fd01af1b55c1ccd40213fc18a36b4.tar.gz kdepimpi-fee4c893fe8fd01af1b55c1ccd40213fc18a36b4.tar.bz2 |
fixxxx
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 21 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 71 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 5 |
3 files changed, 47 insertions, 50 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index 965cf47..10d9a8c 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -4,216 +4,215 @@ | |||
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
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 <qfiledialog.h> | 25 | #include <qfiledialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <qbuttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <qvgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <qwidgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | 33 | ||
34 | #include <kglobal.h> | 34 | #include <kglobal.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kiconloader.h> | 36 | #include <kiconloader.h> |
37 | #include <kmessagebox.h> | 37 | #include <kmessagebox.h> |
38 | #include <kdebug.h> | 38 | #include <kdebug.h> |
39 | #include <krestrictedline.h> | 39 | #include <krestrictedline.h> |
40 | #include <kstandarddirs.h> | 40 | #include <kstandarddirs.h> |
41 | #include <kfiledialog.h> | 41 | #include <kfiledialog.h> |
42 | #include <kdialog.h> | 42 | #include <kdialog.h> |
43 | 43 | ||
44 | #include <libkcal/todo.h> | 44 | #include <libkcal/todo.h> |
45 | 45 | ||
46 | #include <libkdepim/kdateedit.h> | 46 | #include <libkdepim/kdateedit.h> |
47 | 47 | ||
48 | #include "koprefs.h" | 48 | #include "koprefs.h" |
49 | #include "ktimeedit.h" | 49 | #include "ktimeedit.h" |
50 | 50 | ||
51 | #include "koeditorgeneraltodo.h" | 51 | #include "koeditorgeneraltodo.h" |
52 | #include "kolocationbox.h" | 52 | #include "kolocationbox.h" |
53 | 53 | ||
54 | KOEditorGeneralTodo::KOEditorGeneralTodo(QObject* parent, | 54 | KOEditorGeneralTodo::KOEditorGeneralTodo(QObject* parent, |
55 | const char* name) | 55 | const char* name) |
56 | : KOEditorGeneral( parent, name) | 56 | : KOEditorGeneral( parent, name) |
57 | { | 57 | { |
58 | } | 58 | } |
59 | 59 | ||
60 | KOEditorGeneralTodo::~KOEditorGeneralTodo() | 60 | KOEditorGeneralTodo::~KOEditorGeneralTodo() |
61 | { | 61 | { |
62 | } | 62 | } |
63 | 63 | ||
64 | void KOEditorGeneralTodo::finishSetup() | 64 | void KOEditorGeneralTodo::finishSetup() |
65 | { | 65 | { |
66 | 66 | ||
67 | // QWidget::setTabOrder(mSummaryEdit, mLocationEdit); | 67 | // QWidget::setTabOrder(mSummaryEdit, mLocationEdit); |
68 | // QWidget::setTabOrder(mLocationEdit, mDueCheck); | 68 | // QWidget::setTabOrder(mLocationEdit, mDueCheck); |
69 | // QWidget::setTabOrder(mDueCheck, mDueDateEdit); | 69 | // QWidget::setTabOrder(mDueCheck, mDueDateEdit); |
70 | // QWidget::setTabOrder(mDueDateEdit, mDueTimeEdit); | 70 | // QWidget::setTabOrder(mDueDateEdit, mDueTimeEdit); |
71 | // QWidget::setTabOrder(mDueTimeEdit, mStartCheck); | 71 | // QWidget::setTabOrder(mDueTimeEdit, mStartCheck); |
72 | // QWidget::setTabOrder(mStartCheck, mStartDateEdit); | 72 | // QWidget::setTabOrder(mStartCheck, mStartDateEdit); |
73 | // QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit); | 73 | // QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit); |
74 | // QWidget::setTabOrder(mStartTimeEdit, mTimeButton); | 74 | // QWidget::setTabOrder(mStartTimeEdit, mTimeButton); |
75 | // QWidget::setTabOrder(mTimeButton, mCompletedCombo); | 75 | // QWidget::setTabOrder(mTimeButton, mCompletedCombo); |
76 | // QWidget::setTabOrder(mCompletedCombo, mPriorityCombo); | 76 | // QWidget::setTabOrder(mCompletedCombo, mPriorityCombo); |
77 | // QWidget::setTabOrder(mPriorityCombo, mAlarmButton); | 77 | // QWidget::setTabOrder(mPriorityCombo, mAlarmButton); |
78 | // QWidget::setTabOrder(mAlarmButton, mCategoriesButton); | 78 | // QWidget::setTabOrder(mAlarmButton, mCategoriesButton); |
79 | // QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); | 79 | // QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); |
80 | // QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); | 80 | // QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); |
81 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); | 81 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); |
82 | mSummaryEdit->setFocus(); | 82 | mSummaryEdit->setFocus(); |
83 | } | 83 | } |
84 | 84 | ||
85 | void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | 85 | void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) |
86 | { | 86 | { |
87 | QBoxLayout *timeLayout = new QVBoxLayout(topLayout); | 87 | QBoxLayout *timeLayout = new QVBoxLayout(topLayout); |
88 | 88 | ||
89 | QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, | 89 | QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, |
90 | i18n("Date && Time"),parent); | 90 | i18n("Date && Time"),parent); |
91 | timeLayout->addWidget(timeGroupBox); | 91 | timeLayout->addWidget(timeGroupBox); |
92 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); | 92 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); |
93 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); | 93 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); |
94 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); | 94 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); |
95 | 95 | ||
96 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); | 96 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); |
97 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); | 97 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); |
98 | layoutTimeBox->setColStretch( 1, 1 ); | 98 | layoutTimeBox->setColStretch( 1, 1 ); |
99 | 99 | ||
100 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | ||
101 | layoutTimeBox->addWidget(mStartCheck,0,0); | ||
102 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | ||
103 | |||
104 | mStartDateEdit = new KDateEdit(timeBoxFrame); | ||
105 | layoutTimeBox->addWidget(mStartDateEdit,0,1); | ||
106 | |||
107 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); | ||
108 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); | ||
109 | |||
100 | mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); | 110 | mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); |
101 | layoutTimeBox->addWidget(mDueCheck,1,0); | 111 | layoutTimeBox->addWidget(mDueCheck,1,0); |
102 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); | 112 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); |
103 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm())); | 113 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm())); |
104 | 114 | ||
105 | 115 | ||
106 | mDueDateEdit = new KDateEdit(timeBoxFrame); | 116 | mDueDateEdit = new KDateEdit(timeBoxFrame); |
107 | layoutTimeBox->addWidget(mDueDateEdit,1,1); | 117 | layoutTimeBox->addWidget(mDueDateEdit,1,1); |
108 | 118 | ||
109 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); | 119 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); |
110 | layoutTimeBox->addWidget(mDueTimeEdit,1,2); | 120 | layoutTimeBox->addWidget(mDueTimeEdit,1,2); |
111 | 121 | ||
112 | 122 | ||
113 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | ||
114 | layoutTimeBox->addWidget(mStartCheck,0,0); | ||
115 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | ||
116 | |||
117 | mStartDateEdit = new KDateEdit(timeBoxFrame); | ||
118 | layoutTimeBox->addWidget(mStartDateEdit,0,1); | ||
119 | |||
120 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); | ||
121 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); | ||
122 | |||
123 | |||
124 | mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); | 123 | mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); |
125 | layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); | 124 | layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); |
126 | 125 | ||
127 | connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); | 126 | connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); |
128 | connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); | 127 | connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); |
129 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); | 128 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); |
130 | connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), | 129 | connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), |
131 | this, SLOT(startDateChanged(QDate))); | 130 | this, SLOT(startDateChanged(QDate))); |
132 | // some more layouting | 131 | // some more layouting |
133 | //layoutTimeBox->setColStretch(3,1); | 132 | //layoutTimeBox->setColStretch(3,1); |
134 | } | 133 | } |
135 | 134 | ||
136 | 135 | ||
137 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | 136 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) |
138 | { | 137 | { |
139 | mCompletedCombo = new QComboBox(parent); | 138 | mCompletedCombo = new QComboBox(parent); |
140 | // xgettext:no-c-format | 139 | // xgettext:no-c-format |
141 | mCompletedCombo->insertItem(i18n(" 0 %")); | 140 | mCompletedCombo->insertItem(i18n(" 0 %")); |
142 | // xgettext:no-c-format | 141 | // xgettext:no-c-format |
143 | mCompletedCombo->insertItem(i18n(" 20 %")); | 142 | mCompletedCombo->insertItem(i18n(" 20 %")); |
144 | // xgettext:no-c-format | 143 | // xgettext:no-c-format |
145 | mCompletedCombo->insertItem(i18n(" 40 %")); | 144 | mCompletedCombo->insertItem(i18n(" 40 %")); |
146 | // xgettext:no-c-format | 145 | // xgettext:no-c-format |
147 | mCompletedCombo->insertItem(i18n(" 60 %")); | 146 | mCompletedCombo->insertItem(i18n(" 60 %")); |
148 | // xgettext:no-c-format | 147 | // xgettext:no-c-format |
149 | mCompletedCombo->insertItem(i18n(" 80 %")); | 148 | mCompletedCombo->insertItem(i18n(" 80 %")); |
150 | // xgettext:no-c-format | 149 | // xgettext:no-c-format |
151 | mCompletedCombo->insertItem(i18n("100 %")); | 150 | mCompletedCombo->insertItem(i18n("100 %")); |
152 | connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int))); | 151 | connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int))); |
153 | topLayout->addWidget(mCompletedCombo); | 152 | topLayout->addWidget(mCompletedCombo); |
154 | 153 | ||
155 | mCompletedLabel = new QLabel(i18n("completed"),parent); | 154 | mCompletedLabel = new QLabel(i18n("completed"),parent); |
156 | topLayout->addWidget(mCompletedLabel); | 155 | topLayout->addWidget(mCompletedLabel); |
157 | 156 | ||
158 | mCompleteDateEdit = new KDateEdit(parent); | 157 | mCompleteDateEdit = new KDateEdit(parent); |
159 | topLayout->addWidget(mCompleteDateEdit ); | 158 | topLayout->addWidget(mCompleteDateEdit ); |
160 | 159 | ||
161 | mCompleteTimeEdit = new KOTimeEdit(parent); | 160 | mCompleteTimeEdit = new KOTimeEdit(parent); |
162 | topLayout->addWidget( mCompleteTimeEdit); | 161 | topLayout->addWidget( mCompleteTimeEdit); |
163 | 162 | ||
164 | mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) ); | 163 | mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) ); |
165 | mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); | 164 | mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); |
166 | connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime))); | 165 | connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime))); |
167 | 166 | ||
168 | if ( QApplication::desktop()->width() <= 480 ) { | 167 | if ( QApplication::desktop()->width() <= 480 ) { |
169 | if ( QApplication::desktop()->width() < 320 ) | 168 | if ( QApplication::desktop()->width() < 320 ) |
170 | mCompleteDateEdit->setMaximumWidth( 85 ); | 169 | mCompleteDateEdit->setMaximumWidth( 85 ); |
171 | else | 170 | else |
172 | mCompleteDateEdit->setMaximumWidth( 140 ); | 171 | mCompleteDateEdit->setMaximumWidth( 140 ); |
173 | topLayout->setSpacing( 0 ); | 172 | topLayout->setSpacing( 0 ); |
174 | } | 173 | } |
175 | } | 174 | } |
176 | 175 | ||
177 | void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) | 176 | void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) |
178 | { | 177 | { |
179 | 178 | ||
180 | QHBox* h = new QHBox ( parent ); | 179 | QHBox* h = new QHBox ( parent ); |
181 | topLayout->addWidget( h ); | 180 | topLayout->addWidget( h ); |
182 | QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); | 181 | QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); |
183 | // topLayout->addWidget(priorityLabel); | 182 | // topLayout->addWidget(priorityLabel); |
184 | mPriorityCombo = new QComboBox( h ); | 183 | mPriorityCombo = new QComboBox( h ); |
185 | mPriorityCombo->insertItem(i18n("1 (high)")); | 184 | mPriorityCombo->insertItem(i18n("1 (high)")); |
186 | mPriorityCombo->insertItem(i18n("2")); | 185 | mPriorityCombo->insertItem(i18n("2")); |
187 | mPriorityCombo->insertItem(i18n("3")); | 186 | mPriorityCombo->insertItem(i18n("3")); |
188 | mPriorityCombo->insertItem(i18n("4")); | 187 | mPriorityCombo->insertItem(i18n("4")); |
189 | mPriorityCombo->insertItem(i18n("5 (low)")); | 188 | mPriorityCombo->insertItem(i18n("5 (low)")); |
190 | //topLayout->addWidget(mPriorityCombo); | 189 | //topLayout->addWidget(mPriorityCombo); |
191 | } | 190 | } |
192 | 191 | ||
193 | void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) | 192 | void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) |
194 | { | 193 | { |
195 | QBoxLayout *statusLayout = new QHBoxLayout(topLayout); | 194 | QBoxLayout *statusLayout = new QHBoxLayout(topLayout); |
196 | 195 | ||
197 | initCompletion( parent, statusLayout ); | 196 | initCompletion( parent, statusLayout ); |
198 | 197 | ||
199 | statusLayout->addStretch( 1 ); | 198 | statusLayout->addStretch( 1 ); |
200 | 199 | ||
201 | initPriority( parent, statusLayout ); | 200 | initPriority( parent, statusLayout ); |
202 | } | 201 | } |
203 | 202 | ||
204 | void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) | 203 | void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) |
205 | { | 204 | { |
206 | 205 | ||
207 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); | 206 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); |
208 | mLocationEdit->load(KOLocationBox::LOCATION); | 207 | mLocationEdit->load(KOLocationBox::LOCATION); |
209 | KOEditorGeneral::setDefaults(allDay); | 208 | KOEditorGeneral::setDefaults(allDay); |
210 | 209 | ||
211 | mTimeButton->setChecked( !allDay ); | 210 | mTimeButton->setChecked( !allDay ); |
212 | if(mTimeButton->isChecked()) { | 211 | if(mTimeButton->isChecked()) { |
213 | mTimeButton->setEnabled(true); | 212 | mTimeButton->setEnabled(true); |
214 | } | 213 | } |
215 | else { | 214 | else { |
216 | mTimeButton->setEnabled(false); | 215 | mTimeButton->setEnabled(false); |
217 | } | 216 | } |
218 | 217 | ||
219 | enableTimeEdits( !allDay ); | 218 | enableTimeEdits( !allDay ); |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index e7a5e0e..e560ce4 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -35,366 +35,361 @@ | |||
35 | #include <qwhatsthis.h> | 35 | #include <qwhatsthis.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | #include <qpaintdevicemetrics.h> | 38 | #include <qpaintdevicemetrics.h> |
39 | 39 | ||
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kdebug.h> | 41 | #include <kdebug.h> |
42 | #include <kiconloader.h> | 42 | #include <kiconloader.h> |
43 | #include <kglobal.h> | 43 | #include <kglobal.h> |
44 | 44 | ||
45 | #include <libkdepim/kpimglobalprefs.h> | 45 | #include <libkdepim/kpimglobalprefs.h> |
46 | #include <libkcal/calendar.h> | 46 | #include <libkcal/calendar.h> |
47 | #include <libkcal/calendarlocal.h> | 47 | #include <libkcal/calendarlocal.h> |
48 | #include <libkcal/icalformat.h> | 48 | #include <libkcal/icalformat.h> |
49 | #include <libkcal/vcalformat.h> | 49 | #include <libkcal/vcalformat.h> |
50 | #include <libkcal/recurrence.h> | 50 | #include <libkcal/recurrence.h> |
51 | #include <libkcal/filestorage.h> | 51 | #include <libkcal/filestorage.h> |
52 | #include <libkdepim/categoryselectdialog.h> | 52 | #include <libkdepim/categoryselectdialog.h> |
53 | #include <libkcal/kincidenceformatter.h> | 53 | #include <libkcal/kincidenceformatter.h> |
54 | #ifndef DESKTOP_VERSION | 54 | #ifndef DESKTOP_VERSION |
55 | #include <qpe/qpeapplication.h> | 55 | #include <qpe/qpeapplication.h> |
56 | #else | 56 | #else |
57 | #include <qapplication.h> | 57 | #include <qapplication.h> |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifndef KORG_NOPRINTER | 60 | #ifndef KORG_NOPRINTER |
61 | #include "calprinter.h" | 61 | #include "calprinter.h" |
62 | #endif | 62 | #endif |
63 | #include "koglobals.h" | 63 | #include "koglobals.h" |
64 | #include "koprefs.h" | 64 | #include "koprefs.h" |
65 | #include "kfiledialog.h" | 65 | #include "kfiledialog.h" |
66 | 66 | ||
67 | #include "kolistview.h" | 67 | #include "kolistview.h" |
68 | #include "koeventviewer.h" | 68 | #include "koeventviewer.h" |
69 | 69 | ||
70 | extern QPixmap* sgListViewCompletedPix[6]; | 70 | extern QPixmap* sgListViewCompletedPix[6]; |
71 | extern QPixmap* sgListViewJournalPix; | 71 | extern QPixmap* sgListViewJournalPix; |
72 | 72 | ||
73 | class KOListViewWhatsThis :public QWhatsThis | 73 | class KOListViewWhatsThis :public QWhatsThis |
74 | { | 74 | { |
75 | public: | 75 | public: |
76 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 76 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; |
77 | 77 | ||
78 | protected: | 78 | protected: |
79 | virtual QString text( const QPoint& p) | 79 | virtual QString text( const QPoint& p) |
80 | { | 80 | { |
81 | return _view->getWhatsThisText(p) ; | 81 | return _view->getWhatsThisText(p) ; |
82 | } | 82 | } |
83 | private: | 83 | private: |
84 | QWidget* _wid; | 84 | QWidget* _wid; |
85 | KOListView * _view; | 85 | KOListView * _view; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | 88 | ||
89 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 89 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
90 | { | 90 | { |
91 | mItem = item; | 91 | mItem = item; |
92 | mDate = date; | 92 | mDate = date; |
93 | } | 93 | } |
94 | 94 | ||
95 | ListItemVisitor::~ListItemVisitor() | 95 | ListItemVisitor::~ListItemVisitor() |
96 | { | 96 | { |
97 | } | 97 | } |
98 | 98 | ||
99 | bool ListItemVisitor::visit(Event *e) | 99 | bool ListItemVisitor::visit(Event *e) |
100 | { | 100 | { |
101 | bool ok = false; | 101 | bool ok = false; |
102 | QString start, end; | 102 | QString start, end; |
103 | QDate ds, de; | 103 | QDate ds, de; |
104 | if ( e->doesRecur() ) { | 104 | if ( e->doesRecur() ) { |
105 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 105 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
106 | if ( ok ) { | 106 | if ( ok ) { |
107 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); | 107 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); |
108 | start = KGlobal::locale()->formatDate(ds,true); | 108 | start = KGlobal::locale()->formatDate(ds,true); |
109 | de = ds.addDays( days); | 109 | de = ds.addDays( days); |
110 | end = KGlobal::locale()->formatDate(de,true); | 110 | end = KGlobal::locale()->formatDate(de,true); |
111 | } | 111 | } |
112 | 112 | ||
113 | } | 113 | } |
114 | if ( ! ok ) { | 114 | if ( ! ok ) { |
115 | start =e->dtStartDateStr(); | 115 | start =e->dtStartDateStr(); |
116 | end = e->dtEndDateStr(); | 116 | end = e->dtEndDateStr(); |
117 | ds = e->dtStart().date(); | 117 | ds = e->dtStart().date(); |
118 | de = e->dtEnd().date(); | 118 | de = e->dtEnd().date(); |
119 | } | 119 | } |
120 | mItem->setText(0,e->summary()); | 120 | mItem->setText(0,e->summary()); |
121 | mItem->setText(1,start); | 121 | mItem->setText(1,start); |
122 | if ( e->doesFloat() ) | 122 | if ( e->doesFloat() ) |
123 | mItem->setText(2,"---"); | 123 | mItem->setText(2,"---"); |
124 | else | 124 | else |
125 | mItem->setText(2,e->dtStartTimeStr()); | 125 | mItem->setText(2,e->dtStartTimeStr()); |
126 | mItem->setText(3,end); | 126 | mItem->setText(3,end); |
127 | if ( e->doesFloat() ) | 127 | if ( e->doesFloat() ) |
128 | mItem->setText(4,"---"); | 128 | mItem->setText(4,"---"); |
129 | else | 129 | else |
130 | mItem->setText(4,e->dtEndTimeStr()); | 130 | mItem->setText(4,e->dtEndTimeStr()); |
131 | mItem->setText(5, e->durationText()); | ||
131 | if ( e->isAlarmEnabled() ) { | 132 | if ( e->isAlarmEnabled() ) { |
132 | mItem->setText(5,e->alarms().first()->offsetText() ); | 133 | mItem->setText(6,e->alarms().first()->offsetText() ); |
133 | } else { | 134 | } else { |
134 | mItem->setText(5, i18n("No")); | 135 | mItem->setText(6, i18n("No")); |
135 | } | 136 | } |
136 | mItem->setText(6, e->recurrenceText()); | 137 | mItem->setText(7, e->recurrenceText()); |
137 | if( ! e->doesRecur() ) | 138 | if( ! e->doesRecur() ) |
138 | mItem->setSortKey( 6, "-" ); | 139 | mItem->setSortKey( 7, "-" ); |
139 | mItem->setText(7,"---"); | 140 | mItem->setText(8, e->cancelled() ? i18n("Yes") : i18n("No")); |
140 | mItem->setText(8,"---"); | 141 | mItem->setText(9,e->categoriesStr()); |
141 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 142 | mItem->setText(10, KOPrefs::instance()->calName( e->calID() )); |
142 | mItem->setText(10,e->categoriesStr()); | 143 | mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); |
143 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); | ||
144 | mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); | ||
145 | 144 | ||
146 | QString key; | 145 | QString key; |
147 | QDate d = e->lastModified().date(); | 146 | QDate d = e->lastModified().date(); |
148 | QTime t = e->lastModified().time(); | 147 | QTime t = e->lastModified().time(); |
149 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 148 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); |
150 | mItem->setSortKey(12,key); | 149 | mItem->setSortKey(12,key); |
151 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 150 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
152 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 151 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
153 | mItem->setSortKey(1,key); | 152 | mItem->setSortKey(1,key); |
154 | 153 | ||
155 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 154 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
156 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 155 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
157 | mItem->setSortKey(3,key); | 156 | mItem->setSortKey(3,key); |
158 | return true; | 157 | return true; |
159 | } | 158 | } |
160 | 159 | ||
161 | bool ListItemVisitor::visit(Todo *t) | 160 | bool ListItemVisitor::visit(Todo *t) |
162 | { | 161 | { |
163 | mItem->setText(0,t->summary()); | 162 | mItem->setText(0,t->summary()); |
164 | if ( t->isCompleted() ) { | 163 | if ( t->isCompleted() ) { |
165 | mItem->setSortKey(0,"99"+ t->summary().left(10)); | 164 | mItem->setSortKey(0,"99"+ t->summary().left(10)); |
166 | } else | 165 | } else |
167 | mItem->setSortKey(0,QString::number( t->percentComplete()+1 )+ t->summary().left(10)); | 166 | mItem->setSortKey(0,QString::number( t->percentComplete()+1 )+ t->summary().left(10)); |
168 | mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20])); | 167 | mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20])); |
169 | if (t->hasStartDate()) { | 168 | if (t->hasStartDate()) { |
170 | mItem->setText(1,t->dtStartDateStr()); | 169 | mItem->setText(1,t->dtStartDateStr()); |
171 | if (t->doesFloat()) { | 170 | if (t->doesFloat()) { |
172 | mItem->setText(2,"---"); | 171 | mItem->setText(2,"---"); |
173 | } else { | 172 | } else { |
174 | mItem->setText(2,t->dtStartTimeStr()); | 173 | mItem->setText(2,t->dtStartTimeStr()); |
175 | } | 174 | } |
176 | } else { | 175 | } else { |
177 | mItem->setText(1,"---"); | 176 | mItem->setText(1,"---"); |
178 | mItem->setText(2,"---"); | 177 | mItem->setText(2,"---"); |
179 | } | 178 | } |
180 | mItem->setText(3,"---"); | ||
181 | mItem->setText(4,"---"); | ||
182 | if ( t->isAlarmEnabled() ) { | 179 | if ( t->isAlarmEnabled() ) { |
183 | mItem->setText(5,t->alarms().first()->offsetText() ); | 180 | mItem->setText(6,t->alarms().first()->offsetText() ); |
184 | } else { | 181 | } else { |
185 | mItem->setText(5, i18n("No")); | 182 | mItem->setText(6, i18n("No")); |
186 | } | 183 | } |
187 | mItem->setText(6, t->recurrenceText()); | 184 | mItem->setText(7, t->recurrenceText()); |
188 | if( ! t->doesRecur() ) | 185 | if( ! t->doesRecur() ) |
189 | mItem->setSortKey( 6, "-" ); | 186 | mItem->setSortKey( 7, "-" ); |
190 | if (t->hasDueDate()) { | 187 | if (t->hasDueDate()) { |
191 | mItem->setText(7,t->dtDueDateStr()); | 188 | mItem->setText(3,t->dtDueDateStr()); |
192 | if (t->doesFloat()) { | 189 | if (t->doesFloat()) { |
193 | mItem->setText(8,"---"); | 190 | mItem->setText(4,"---"); |
194 | } else { | 191 | } else { |
195 | mItem->setText(8,t->dtDueTimeStr()); | 192 | mItem->setText(4,t->dtDueTimeStr()); |
196 | } | 193 | } |
197 | } else { | 194 | } else { |
198 | mItem->setText(7,"---"); | 195 | mItem->setText(3,"---"); |
199 | mItem->setText(8,"---"); | 196 | mItem->setText(4,"---"); |
200 | } | 197 | } |
201 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 198 | mItem->setText(5, t->durationText()); |
202 | mItem->setText(10,t->categoriesStr()); | 199 | mItem->setText(8, t->cancelled() ? i18n("Yes") : i18n("No")); |
203 | mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); | 200 | mItem->setText(9,t->categoriesStr()); |
204 | mItem->setText(12, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); | 201 | mItem->setText(10, KOPrefs::instance()->calName( t->calID() )); |
202 | mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); | ||
205 | QString key; | 203 | QString key; |
206 | QDate d = t->lastModified().date(); | 204 | QDate d = t->lastModified().date(); |
207 | QTime tm = t->lastModified().time(); | 205 | QTime tm = t->lastModified().time(); |
208 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | 206 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); |
209 | mItem->setSortKey(12,key); | 207 | mItem->setSortKey(11,key); |
210 | if (t->hasDueDate()) { | 208 | if (t->hasDueDate()) { |
211 | d = t->dtDue().date(); | 209 | d = t->dtDue().date(); |
212 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 210 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
213 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 211 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
214 | mItem->setSortKey(7,key); | 212 | mItem->setSortKey(3,key); |
215 | } | 213 | } |
216 | if ( t->hasStartDate() ) { | 214 | if ( t->hasStartDate() ) { |
217 | d = t->dtStart().date(); | 215 | d = t->dtStart().date(); |
218 | tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 216 | tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
219 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 217 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
220 | mItem->setSortKey(1,key); | 218 | mItem->setSortKey(1,key); |
221 | } | 219 | } |
222 | return true; | 220 | return true; |
223 | } | 221 | } |
224 | 222 | ||
225 | bool ListItemVisitor::visit(Journal * j) | 223 | bool ListItemVisitor::visit(Journal * j) |
226 | { | 224 | { |
227 | 225 | ||
228 | QString des; | 226 | QString des; |
229 | mItem->setPixmap( 0, *sgListViewJournalPix); | 227 | mItem->setPixmap( 0, *sgListViewJournalPix); |
230 | if ( !j->summary().isEmpty() ) { | 228 | if ( !j->summary().isEmpty() ) { |
231 | des = j->summary(); | 229 | des = j->summary(); |
232 | } else { | 230 | } else { |
233 | des = j->description().left(30); | 231 | des = j->description().left(30); |
234 | des = des.simplifyWhiteSpace (); | 232 | des = des.simplifyWhiteSpace (); |
235 | des.replace (QRegExp ("\\n"),"" ); | 233 | des.replace (QRegExp ("\\n"),"" ); |
236 | des.replace (QRegExp ("\\r"),"" ); | 234 | des.replace (QRegExp ("\\r"),"" ); |
237 | } | 235 | } |
238 | mItem->setText(0,des.left(25)); | 236 | mItem->setText(0,des.left(25)); |
239 | mItem->setSortKey(0,"0"+ des.left(25)); | 237 | mItem->setSortKey(0,"0"+ des.left(25)); |
240 | mItem->setText(1,j->dtStartDateStr()); | 238 | mItem->setText(1,j->dtStartDateStr()); |
241 | mItem->setText(2,"---"); | 239 | mItem->setText(2,"---"); |
242 | mItem->setText(3,"---"); | 240 | mItem->setText(3,"---"); |
243 | mItem->setText(4,"---"); | 241 | mItem->setText(4,"---"); |
244 | mItem->setText(5,"---"); | 242 | mItem->setText(5,"---"); |
245 | mItem->setText(6,"---"); | 243 | mItem->setText(6,"---"); |
246 | mItem->setText(7,j->dtStartDateStr()); | 244 | mItem->setText(7,"---"); |
247 | mItem->setText(8,"---"); | 245 | mItem->setText(8,"---"); |
248 | mItem->setText(9,"---"); | 246 | mItem->setText(9,j->categoriesStr()); |
249 | mItem->setText(10,j->categoriesStr()); | 247 | mItem->setText(10, KOPrefs::instance()->calName( j->calID() )); |
250 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); | 248 | mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); |
251 | mItem->setText(12, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); | ||
252 | 249 | ||
253 | QString key; | 250 | QString key; |
254 | QDate d = j->lastModified().date(); | 251 | QDate d = j->lastModified().date(); |
255 | QTime tm = j->lastModified().time(); | 252 | QTime tm = j->lastModified().time(); |
256 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | 253 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); |
257 | mItem->setSortKey(12,key); | 254 | mItem->setSortKey(12,key); |
258 | d = j->dtStart().date(); | 255 | d = j->dtStart().date(); |
259 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 256 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
260 | mItem->setSortKey(1,key); | 257 | mItem->setSortKey(1,key); |
261 | mItem->setSortKey(7,key); | 258 | mItem->setSortKey(7,key); |
262 | 259 | ||
263 | return true; | 260 | return true; |
264 | } | 261 | } |
265 | 262 | ||
266 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 263 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
267 | const char *name) | 264 | const char *name) |
268 | : KOEventView(calendar, parent, name) | 265 | : KOEventView(calendar, parent, name) |
269 | { | 266 | { |
270 | 267 | ||
271 | mActiveItem = 0; | 268 | mActiveItem = 0; |
272 | mForceShowCompletedTodos = false; | 269 | mForceShowCompletedTodos = false; |
273 | mListView = new KOListViewListView(this); | 270 | mListView = new KOListViewListView(this); |
274 | mListView->addColumn(i18n("Summary")); | 271 | mListView->addColumn(i18n("Summary")); |
275 | mListView->addColumn(i18n("Start Date")); | 272 | mListView->addColumn(i18n("Start Date")); |
276 | mListView->addColumn(i18n("Start Time")); | 273 | mListView->addColumn(i18n("Start Time")); |
277 | mListView->addColumn(i18n("End Date")); | 274 | mListView->addColumn(i18n("End/Due Date")); |
278 | mListView->addColumn(i18n("End Time")); | 275 | mListView->addColumn(i18n("End/Due Time")); |
276 | mListView->addColumn(i18n("Duration")); | ||
279 | mListView->addColumn(i18n("Alarm")); // alarm set? | 277 | mListView->addColumn(i18n("Alarm")); // alarm set? |
280 | mListView->addColumn(i18n("Recurs")); // recurs? | 278 | mListView->addColumn(i18n("Recurs")); // recurs? |
281 | mListView->addColumn(i18n("Due Date")); | ||
282 | mListView->addColumn(i18n("Due Time")); | ||
283 | mListView->addColumn(i18n("Cancelled")); | 279 | mListView->addColumn(i18n("Cancelled")); |
284 | mListView->addColumn(i18n("Categories")); | 280 | mListView->addColumn(i18n("Categories")); |
285 | mListView->addColumn(i18n("Calendar")); | 281 | mListView->addColumn(i18n("Calendar")); |
286 | mListView->addColumn(i18n("Last Modified")); | 282 | mListView->addColumn(i18n("Last Modified")); |
287 | 283 | ||
288 | mListView->setColumnAlignment(0,AlignLeft); | 284 | mListView->setColumnAlignment(0,AlignLeft); |
289 | mListView->setColumnAlignment(1,AlignLeft); | 285 | mListView->setColumnAlignment(1,AlignLeft); |
290 | mListView->setColumnAlignment(2,AlignHCenter); | 286 | mListView->setColumnAlignment(2,AlignHCenter); |
291 | mListView->setColumnAlignment(3,AlignLeft); | 287 | mListView->setColumnAlignment(3,AlignLeft); |
292 | mListView->setColumnAlignment(4,AlignHCenter); | 288 | mListView->setColumnAlignment(4,AlignHCenter); |
293 | mListView->setColumnAlignment(5,AlignLeft); | 289 | mListView->setColumnAlignment(5,AlignLeft); |
294 | mListView->setColumnAlignment(6,AlignLeft); | 290 | mListView->setColumnAlignment(6,AlignLeft); |
295 | mListView->setColumnAlignment(7,AlignLeft); | 291 | mListView->setColumnAlignment(7,AlignLeft); |
296 | mListView->setColumnAlignment(8,AlignLeft); | 292 | mListView->setColumnAlignment(8,AlignLeft); |
297 | mListView->setColumnAlignment(9,AlignLeft); | 293 | mListView->setColumnAlignment(9,AlignLeft); |
298 | mListView->setColumnAlignment(10,AlignLeft); | 294 | mListView->setColumnAlignment(10,AlignLeft); |
299 | mListView->setColumnAlignment(11,AlignLeft); | 295 | mListView->setColumnAlignment(11,AlignLeft); |
300 | mListView->setColumnAlignment(12,AlignLeft); | ||
301 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); | 296 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); |
302 | 297 | ||
303 | int iii = 0; | 298 | int iii = 0; |
304 | for ( iii = 0; iii< 13 ; ++iii ) | 299 | for ( iii = 0; iii< 12 ; ++iii ) |
305 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 300 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
306 | 301 | ||
307 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 302 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
308 | layoutTop->addWidget(mListView); | 303 | layoutTop->addWidget(mListView); |
309 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 304 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
310 | mPopupMenu = eventPopup(); | 305 | mPopupMenu = eventPopup(); |
311 | QPopupMenu* selPopup = new QPopupMenu ( this ); | 306 | QPopupMenu* selPopup = new QPopupMenu ( this ); |
312 | mPopupMenu->insertSeparator(); | 307 | mPopupMenu->insertSeparator(); |
313 | 308 | ||
314 | selPopup->insertItem(i18n("All"),this, | 309 | selPopup->insertItem(i18n("All"),this, |
315 | SLOT(allSelection())); | 310 | SLOT(allSelection())); |
316 | selPopup->insertItem(i18n("None"),this, | 311 | selPopup->insertItem(i18n("None"),this, |
317 | SLOT(clearSelection())); | 312 | SLOT(clearSelection())); |
318 | selPopup->insertItem(i18n("Delete selected..."),this, | 313 | selPopup->insertItem(i18n("Delete selected..."),this, |
319 | SLOT(deleteAll())); | 314 | SLOT(deleteAll())); |
320 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); | 315 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); |
321 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 316 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
322 | i18n("Hide all selected"),this, | 317 | i18n("Hide all selected"),this, |
323 | SLOT(hideAll()),true); | 318 | SLOT(hideAll()),true); |
324 | 319 | ||
325 | selPopup->insertSeparator(); | 320 | selPopup->insertSeparator(); |
326 | QPopupMenu * exportPO = new QPopupMenu ( this ); | 321 | QPopupMenu * exportPO = new QPopupMenu ( this ); |
327 | selPopup->insertItem( i18n("Export"), exportPO ); | 322 | selPopup->insertItem( i18n("Export"), exportPO ); |
328 | #ifdef DESKTOP_VERSION | 323 | #ifdef DESKTOP_VERSION |
329 | mPopupMenu->insertSeparator(); | 324 | mPopupMenu->insertSeparator(); |
330 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 325 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
331 | i18n("Print complete list..."),this, | 326 | i18n("Print complete list..."),this, |
332 | SLOT(printList()),true); | 327 | SLOT(printList()),true); |
333 | #endif | 328 | #endif |
334 | mCalPopup = new QPopupMenu ( this ); | 329 | mCalPopup = new QPopupMenu ( this ); |
335 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); | 330 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); |
336 | 331 | ||
337 | selPopup->insertItem(i18n("Set categories")+"...",this, | 332 | selPopup->insertItem(i18n("Set categories")+"...",this, |
338 | SLOT(setCat()) ); | 333 | SLOT(setCat()) ); |
339 | selPopup->insertItem( i18n("Set alarm..."),this, | 334 | selPopup->insertItem( i18n("Set alarm..."),this, |
340 | SLOT(setAlarm())); | 335 | SLOT(setAlarm())); |
341 | #if 0 | 336 | #if 0 |
342 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 337 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
343 | i18n("Set categories")+"...",this, | 338 | i18n("Set categories")+"...",this, |
344 | SLOT(setCat()),true); | 339 | SLOT(setCat()),true); |
345 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 340 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
346 | i18n("Set alarm..."),this, | 341 | i18n("Set alarm..."),this, |
347 | SLOT(setAlarm()),true); | 342 | SLOT(setAlarm()),true); |
348 | #endif | 343 | #endif |
349 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, | 344 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, |
350 | SLOT( populateCalPopup() )); | 345 | SLOT( populateCalPopup() )); |
351 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, | 346 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, |
352 | SLOT( setCalendar( int ) )); | 347 | SLOT( setCalendar( int ) )); |
353 | QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, | 348 | QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this, |
354 | SLOT( catChanged( Incidence * ) )); | 349 | SLOT( catChanged( Incidence * ) )); |
355 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, | 350 | exportPO->insertItem( i18n("As iCal (ics) file..."),this, |
356 | SLOT(saveToFile())); | 351 | SLOT(saveToFile())); |
357 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, | 352 | exportPO->insertItem( i18n("As vCal (vcs) file..."),this, |
358 | SLOT(saveToFileVCS())); | 353 | SLOT(saveToFileVCS())); |
359 | exportPO->insertItem( i18n("Journal/Details..."),this, | 354 | exportPO->insertItem( i18n("Journal/Details..."),this, |
360 | SLOT(saveDescriptionToFile())); | 355 | SLOT(saveDescriptionToFile())); |
361 | // mPopupMenu->insertSeparator(); | 356 | // mPopupMenu->insertSeparator(); |
362 | // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 357 | // mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
363 | // i18n("Add Categ. to selected..."),this, | 358 | // i18n("Add Categ. to selected..."),this, |
364 | // SLOT(addCat()),true); | 359 | // SLOT(addCat()),true); |
365 | //mPopupMenu->insertSeparator(); | 360 | //mPopupMenu->insertSeparator(); |
366 | #ifndef DESKTOP_VERSION | 361 | #ifndef DESKTOP_VERSION |
367 | selPopup->insertSeparator(); | 362 | selPopup->insertSeparator(); |
368 | selPopup->insertItem( i18n("Beam via IR..."),this, | 363 | selPopup->insertItem( i18n("Beam via IR..."),this, |
369 | SLOT(beamSelected())); | 364 | SLOT(beamSelected())); |
370 | #if 0 | 365 | #if 0 |
371 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 366 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
372 | i18n("Beam via IR"),this, | 367 | i18n("Beam via IR"),this, |
373 | SLOT(beamSelected()),true); | 368 | SLOT(beamSelected()),true); |
374 | #endif | 369 | #endif |
375 | #endif | 370 | #endif |
376 | /* | 371 | /* |
377 | mPopupMenu = new QPopupMenu; | 372 | mPopupMenu = new QPopupMenu; |
378 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 373 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
379 | SLOT (editEvent())); | 374 | SLOT (editEvent())); |
380 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 375 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
381 | SLOT (deleteEvent())); | 376 | SLOT (deleteEvent())); |
382 | mPopupMenu->insertSeparator(); | 377 | mPopupMenu->insertSeparator(); |
383 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 378 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
384 | SLOT(showDates())); | 379 | SLOT(showDates())); |
385 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 380 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
386 | SLOT(hideDates())); | 381 | SLOT(hideDates())); |
387 | */ | 382 | */ |
388 | QObject::connect(mListView,SIGNAL( newEvent()), | 383 | QObject::connect(mListView,SIGNAL( newEvent()), |
389 | this,SIGNAL(signalNewEvent())); | 384 | this,SIGNAL(signalNewEvent())); |
390 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 385 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
391 | this,SLOT(defaultItemAction(QListViewItem *))); | 386 | this,SLOT(defaultItemAction(QListViewItem *))); |
392 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, | 387 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, |
393 | const QPoint &, int )), | 388 | const QPoint &, int )), |
394 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 389 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
395 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 390 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
396 | SLOT(processSelectionChange(QListViewItem *))); | 391 | SLOT(processSelectionChange(QListViewItem *))); |
397 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 392 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
398 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 393 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
399 | 394 | ||
400 | readSettings(KOGlobals::config(),"KOListView Layout"); | 395 | readSettings(KOGlobals::config(),"KOListView Layout"); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 77d0ac8..98a820d 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -132,193 +132,196 @@ QPixmap* sgListViewCompletedPix[6]; | |||
132 | QPixmap* sgListViewJournalPix; | 132 | QPixmap* sgListViewJournalPix; |
133 | 133 | ||
134 | 134 | ||
135 | int globalFlagBlockStartup; | 135 | int globalFlagBlockStartup; |
136 | MainWindow::MainWindow( QWidget *parent, const char *name ) : | 136 | MainWindow::MainWindow( QWidget *parent, const char *name ) : |
137 | QMainWindow( parent, name ) | 137 | QMainWindow( parent, name ) |
138 | { | 138 | { |
139 | sgListViewCompletedPix[5] = &listviewPix; | 139 | sgListViewCompletedPix[5] = &listviewPix; |
140 | sgListViewCompletedPix[0] = &listviewPix0; | 140 | sgListViewCompletedPix[0] = &listviewPix0; |
141 | sgListViewCompletedPix[1] = &listviewPix20; | 141 | sgListViewCompletedPix[1] = &listviewPix20; |
142 | sgListViewCompletedPix[2] = &listviewPix40; | 142 | sgListViewCompletedPix[2] = &listviewPix40; |
143 | sgListViewCompletedPix[3] = &listviewPix60; | 143 | sgListViewCompletedPix[3] = &listviewPix60; |
144 | sgListViewCompletedPix[4] = &listviewPix80; | 144 | sgListViewCompletedPix[4] = &listviewPix80; |
145 | //int size = 12; | 145 | //int size = 12; |
146 | { | 146 | { |
147 | sgListViewCompletedPix[5]->resize( 11, 11 ); | 147 | sgListViewCompletedPix[5]->resize( 11, 11 ); |
148 | sgListViewCompletedPix[5]->fill( Qt::white ); | 148 | sgListViewCompletedPix[5]->fill( Qt::white ); |
149 | QPainter p ( sgListViewCompletedPix[5] ); | 149 | QPainter p ( sgListViewCompletedPix[5] ); |
150 | p.drawRect( 0,0,11,11); | 150 | p.drawRect( 0,0,11,11); |
151 | p.drawLine ( 2, 5, 4 , 7 ) ; | 151 | p.drawLine ( 2, 5, 4 , 7 ) ; |
152 | p.drawLine ( 4 , 7 , 8, 3) ; | 152 | p.drawLine ( 4 , 7 , 8, 3) ; |
153 | int iii = 0; | 153 | int iii = 0; |
154 | for ( iii = 0; iii < 5; ++iii ) { | 154 | for ( iii = 0; iii < 5; ++iii ) { |
155 | sgListViewCompletedPix[iii]->resize( 11, 11 ); | 155 | sgListViewCompletedPix[iii]->resize( 11, 11 ); |
156 | sgListViewCompletedPix[iii]->fill( Qt::white ); | 156 | sgListViewCompletedPix[iii]->fill( Qt::white ); |
157 | QPainter p ( sgListViewCompletedPix[iii] ); | 157 | QPainter p ( sgListViewCompletedPix[iii] ); |
158 | p.drawRect( 0,0,11,11); | 158 | p.drawRect( 0,0,11,11); |
159 | if ( iii ) | 159 | if ( iii ) |
160 | p.fillRect( 1,1,iii*2,9,Qt::gray ); | 160 | p.fillRect( 1,1,iii*2,9,Qt::gray ); |
161 | } | 161 | } |
162 | sgListViewJournalPix = &journalPix; | 162 | sgListViewJournalPix = &journalPix; |
163 | sgListViewJournalPix->resize( 11, 11 ); | 163 | sgListViewJournalPix->resize( 11, 11 ); |
164 | sgListViewJournalPix->fill( Qt::white ); | 164 | sgListViewJournalPix->fill( Qt::white ); |
165 | { | 165 | { |
166 | QPainter p ( sgListViewJournalPix ); | 166 | QPainter p ( sgListViewJournalPix ); |
167 | p.drawRect( 0,0,11,11); | 167 | p.drawRect( 0,0,11,11); |
168 | p.drawLine( 2,3,5,3); | 168 | p.drawLine( 2,3,5,3); |
169 | p.drawLine( 2,5,8,5); | 169 | p.drawLine( 2,5,8,5); |
170 | p.drawLine( 2,7,6,7); | 170 | p.drawLine( 2,7,6,7); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | mClosed = false; | 173 | mClosed = false; |
174 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 174 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
175 | QString confFile = locateLocal("config","korganizerrc"); | 175 | QString confFile = locateLocal("config","korganizerrc"); |
176 | QFileInfo finf ( confFile ); | 176 | QFileInfo finf ( confFile ); |
177 | bool showWarning = !finf.exists(); | 177 | bool showWarning = !finf.exists(); |
178 | setIcon(SmallIcon( "ko24" ) ); | 178 | setIcon(SmallIcon( "ko24" ) ); |
179 | mBlockAtStartup = true; | 179 | mBlockAtStartup = true; |
180 | mFlagKeyPressed = false; | 180 | mFlagKeyPressed = false; |
181 | setCaption("KO/Pi"); | 181 | setCaption("KO/Pi"); |
182 | KOPrefs *p = KOPrefs::instance(); | 182 | KOPrefs *p = KOPrefs::instance(); |
183 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 183 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
184 | p->mCurrentDisplayedView = 0; | 184 | p->mCurrentDisplayedView = 0; |
185 | if ( p->mHourSize > 22 ) | 185 | if ( p->mHourSize > 22 ) |
186 | p->mHourSize = 22; | 186 | p->mHourSize = 22; |
187 | QMainWindow::ToolBarDock tbd; | 187 | QMainWindow::ToolBarDock tbd; |
188 | if ( p->mToolBarHor ) { | 188 | if ( p->mToolBarHor ) { |
189 | if ( p->mToolBarUp ) | 189 | if ( p->mToolBarUp ) |
190 | tbd = Bottom; | 190 | tbd = Bottom; |
191 | else | 191 | else |
192 | tbd = Top; | 192 | tbd = Top; |
193 | } | 193 | } |
194 | else { | 194 | else { |
195 | if ( p->mToolBarUp ) | 195 | if ( p->mToolBarUp ) |
196 | tbd = Right; | 196 | tbd = Right; |
197 | else | 197 | else |
198 | tbd = Left; | 198 | tbd = Left; |
199 | } | 199 | } |
200 | if ( KOPrefs::instance()->mUseAppColors ) | 200 | if ( KOPrefs::instance()->mUseAppColors ) |
201 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 201 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
202 | globalFlagBlockStartup = 1; | 202 | globalFlagBlockStartup = 1; |
203 | iconToolBar = new QPEToolBar( this ); | 203 | iconToolBar = new QPEToolBar( this ); |
204 | addToolBar (iconToolBar , tbd ); | 204 | addToolBar (iconToolBar , tbd ); |
205 | 205 | ||
206 | #ifdef DESKTOP_VERSION | 206 | #ifdef DESKTOP_VERSION |
207 | if ( KOPrefs::instance()->mShowIconFilter ) | 207 | if ( KOPrefs::instance()->mShowIconFilter ) |
208 | #else | 208 | #else |
209 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) | 209 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | { | 212 | { |
213 | if ( p->mToolBarHorF ) { | 213 | if ( p->mToolBarHorF ) { |
214 | if ( p->mToolBarUpF ) | 214 | if ( p->mToolBarUpF ) |
215 | tbd = Bottom; | 215 | tbd = Bottom; |
216 | else | 216 | else |
217 | tbd = Top; | 217 | tbd = Top; |
218 | } | 218 | } |
219 | else { | 219 | else { |
220 | if ( p->mToolBarUpF ) | 220 | if ( p->mToolBarUpF ) |
221 | tbd = Right; | 221 | tbd = Right; |
222 | else | 222 | else |
223 | tbd = Left; | 223 | tbd = Left; |
224 | } | 224 | } |
225 | filterToolBar = new QPEToolBar ( this ); | 225 | filterToolBar = new QPEToolBar ( this ); |
226 | filterMenubar = new KMenuBar( 0 ); | 226 | filterMenubar = new KMenuBar( 0 ); |
227 | QFontMetrics fm ( filterMenubar->font() ); | 227 | QFontMetrics fm ( filterMenubar->font() ); |
228 | 228 | #ifndef DESKTOP_VERSION | |
229 | filterToolBar->setFocusPolicy( NoFocus ); | ||
230 | filterMenubar->setFocusPolicy( NoFocus ); | ||
231 | #endif | ||
229 | filterPopupMenu = new QPopupMenu( this ); | 232 | filterPopupMenu = new QPopupMenu( this ); |
230 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 233 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
231 | QString addTest = "A"; | 234 | QString addTest = "A"; |
232 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | 235 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); |
233 | #ifdef DESKTOP_VERSION | 236 | #ifdef DESKTOP_VERSION |
234 | addTest = "AAABBBCCCx"; | 237 | addTest = "AAABBBCCCx"; |
235 | #else | 238 | #else |
236 | addTest = "AAx"; | 239 | addTest = "AAx"; |
237 | #endif | 240 | #endif |
238 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); | 241 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); |
239 | addToolBar (filterToolBar , tbd ); | 242 | addToolBar (filterToolBar , tbd ); |
240 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 243 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
241 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 244 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
242 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | 245 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) |
243 | filterToolBar->hide(); | 246 | filterToolBar->hide(); |
244 | } else { | 247 | } else { |
245 | filterToolBar = 0; | 248 | filterToolBar = 0; |
246 | filterMenubar = 0; | 249 | filterMenubar = 0; |
247 | filterPopupMenu = 0; | 250 | filterPopupMenu = 0; |
248 | } | 251 | } |
249 | if ( p->mShowIconOnetoolbar ) { | 252 | if ( p->mShowIconOnetoolbar ) { |
250 | viewToolBar = iconToolBar ; | 253 | viewToolBar = iconToolBar ; |
251 | navigatorToolBar = iconToolBar ; | 254 | navigatorToolBar = iconToolBar ; |
252 | } else { | 255 | } else { |
253 | #ifndef DESKTOP_VERSION | 256 | #ifndef DESKTOP_VERSION |
254 | setToolBarsMovable( false ); | 257 | setToolBarsMovable( false ); |
255 | #endif | 258 | #endif |
256 | if ( p->mToolBarHorV ) { | 259 | if ( p->mToolBarHorV ) { |
257 | if ( p->mToolBarUpV ) | 260 | if ( p->mToolBarUpV ) |
258 | tbd = Bottom; | 261 | tbd = Bottom; |
259 | else | 262 | else |
260 | tbd = Top; | 263 | tbd = Top; |
261 | } | 264 | } |
262 | else { | 265 | else { |
263 | if ( p->mToolBarUpV ) | 266 | if ( p->mToolBarUpV ) |
264 | tbd = Right; | 267 | tbd = Right; |
265 | else | 268 | else |
266 | tbd = Left; | 269 | tbd = Left; |
267 | } | 270 | } |
268 | viewToolBar = new QPEToolBar( this ); | 271 | viewToolBar = new QPEToolBar( this ); |
269 | addToolBar (viewToolBar , tbd ); | 272 | addToolBar (viewToolBar , tbd ); |
270 | if ( p->mToolBarHorN ) { | 273 | if ( p->mToolBarHorN ) { |
271 | if ( p->mToolBarUpN ) | 274 | if ( p->mToolBarUpN ) |
272 | tbd = Bottom; | 275 | tbd = Bottom; |
273 | else | 276 | else |
274 | tbd = Top; | 277 | tbd = Top; |
275 | } | 278 | } |
276 | else { | 279 | else { |
277 | if ( p->mToolBarUpN ) | 280 | if ( p->mToolBarUpN ) |
278 | tbd = Right; | 281 | tbd = Right; |
279 | else | 282 | else |
280 | tbd = Left; | 283 | tbd = Left; |
281 | } | 284 | } |
282 | navigatorToolBar = new QPEToolBar( this ); | 285 | navigatorToolBar = new QPEToolBar( this ); |
283 | addToolBar (navigatorToolBar , tbd ); | 286 | addToolBar (navigatorToolBar , tbd ); |
284 | } | 287 | } |
285 | 288 | ||
286 | 289 | ||
287 | 290 | ||
288 | mCalendarModifiedFlag = false; | 291 | mCalendarModifiedFlag = false; |
289 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 292 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
290 | splash->setAlignment ( AlignCenter ); | 293 | splash->setAlignment ( AlignCenter ); |
291 | setCentralWidget( splash ); | 294 | setCentralWidget( splash ); |
292 | #ifndef DESKTOP_VERSION | 295 | #ifndef DESKTOP_VERSION |
293 | showMaximized(); | 296 | showMaximized(); |
294 | #endif | 297 | #endif |
295 | 298 | ||
296 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 299 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
297 | setDefaultPreferences(); | 300 | setDefaultPreferences(); |
298 | mCalendar = new CalendarLocal(); | 301 | mCalendar = new CalendarLocal(); |
299 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 302 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
300 | mView->hide(); | 303 | mView->hide(); |
301 | //mView->resize(splash->size() ); | 304 | //mView->resize(splash->size() ); |
302 | initActions(); | 305 | initActions(); |
303 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 306 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
304 | mSyncManager->setBlockSave(false); | 307 | mSyncManager->setBlockSave(false); |
305 | mView->setSyncManager(mSyncManager); | 308 | mView->setSyncManager(mSyncManager); |
306 | #ifndef DESKTOP_VERSION | 309 | #ifndef DESKTOP_VERSION |
307 | iconToolBar->show(); | 310 | iconToolBar->show(); |
308 | qApp->processEvents(); | 311 | qApp->processEvents(); |
309 | #endif | 312 | #endif |
310 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 313 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
311 | int vh = height() ; | 314 | int vh = height() ; |
312 | int vw = width(); | 315 | int vw = width(); |
313 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 316 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
314 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 317 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
315 | vh -= iconToolBar->height(); | 318 | vh -= iconToolBar->height(); |
316 | } else { | 319 | } else { |
317 | vw -= iconToolBar->height(); | 320 | vw -= iconToolBar->height(); |
318 | } | 321 | } |
319 | //mView->setMaximumSize( splash->size() ); | 322 | //mView->setMaximumSize( splash->size() ); |
320 | //mView->resize( splash->size() ); | 323 | //mView->resize( splash->size() ); |
321 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 324 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
322 | mView->readSettings(); | 325 | mView->readSettings(); |
323 | bool newFile = false; | 326 | bool newFile = false; |
324 | if( !QFile::exists( defaultFileName() ) ) { | 327 | if( !QFile::exists( defaultFileName() ) ) { |