-rw-r--r-- | korganizer/kotodoeditor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 51e2524..6a05cc8 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -1,170 +1,171 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 1997, 1998 Preston Brown | 3 | Copyright (c) 1997, 1998 Preston Brown |
4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qtooltip.h> | 25 | #include <qtooltip.h> |
26 | #include <qframe.h> | 26 | #include <qframe.h> |
27 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qhbox.h> | 29 | #include <qhbox.h> |
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <qtabwidget.h> | 33 | #include <qtabwidget.h> |
34 | 34 | ||
35 | #include <kiconloader.h> | 35 | #include <kiconloader.h> |
36 | #include <klocale.h> | 36 | #include <klocale.h> |
37 | #include <kfiledialog.h> | 37 | #include <kfiledialog.h> |
38 | #include <kstandarddirs.h> | 38 | #include <kstandarddirs.h> |
39 | #include <kmessagebox.h> | 39 | #include <kmessagebox.h> |
40 | 40 | ||
41 | #include <libkdepim/categoryselectdialog.h> | 41 | #include <libkdepim/categoryselectdialog.h> |
42 | #include <libkcal/calendarlocal.h> | 42 | #include <libkcal/calendarlocal.h> |
43 | #include <libkcal/calendarresources.h> | 43 | #include <libkcal/calendarresources.h> |
44 | #include <libkcal/resourcecalendar.h> | 44 | #include <libkcal/resourcecalendar.h> |
45 | #include <libkcal/icalformat.h> | 45 | #include <libkcal/icalformat.h> |
46 | #include <kresources/resourceselectdialog.h> | 46 | #include <kresources/resourceselectdialog.h> |
47 | #include <libkdepim/kdateedit.h> | 47 | #include <libkdepim/kdateedit.h> |
48 | 48 | ||
49 | #include "koprefs.h" | 49 | #include "koprefs.h" |
50 | #include "kolocationbox.h" | 50 | #include "kolocationbox.h" |
51 | 51 | ||
52 | #include "kotodoeditor.h" | 52 | #include "kotodoeditor.h" |
53 | extern int globalFlagBlockAgenda; | 53 | extern int globalFlagBlockAgenda; |
54 | 54 | ||
55 | KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) : | 55 | KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) : |
56 | KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent ) | 56 | KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent ) |
57 | { | 57 | { |
58 | mTodo = 0; | 58 | mTodo = 0; |
59 | mRelatedTodo = 0; | 59 | mRelatedTodo = 0; |
60 | findButton(User1)->hide(); | 60 | findButton(User1)->hide(); |
61 | init(); | 61 | init(); |
62 | } | 62 | } |
63 | 63 | ||
64 | KOTodoEditor::~KOTodoEditor() | 64 | KOTodoEditor::~KOTodoEditor() |
65 | { | 65 | { |
66 | emit dialogClose( mTodo ); | 66 | emit dialogClose( mTodo ); |
67 | } | 67 | } |
68 | 68 | ||
69 | void KOTodoEditor::init() | 69 | void KOTodoEditor::init() |
70 | { | 70 | { |
71 | setupGeneral(); | 71 | setupGeneral(); |
72 | setupAttendeesTab(); | 72 | setupAttendeesTab(); |
73 | setupRecurrence(); | 73 | setupRecurrence(); |
74 | connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence())); | 74 | connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence())); |
75 | mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") ); | ||
75 | } | 76 | } |
76 | void KOTodoEditor::setupRecurrence() | 77 | void KOTodoEditor::setupRecurrence() |
77 | { | 78 | { |
78 | QFrame *topFrame = addPage( i18n("Recurrence") ); | 79 | QFrame *topFrame = addPage( i18n("Recurrence") ); |
79 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); | 80 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); |
80 | 81 | ||
81 | mRecurrence = new KOEditorRecurrence( topFrame ); | 82 | mRecurrence = new KOEditorRecurrence( topFrame ); |
82 | topLayout->addWidget( mRecurrence ); | 83 | topLayout->addWidget( mRecurrence ); |
83 | } | 84 | } |
84 | 85 | ||
85 | void KOTodoEditor::setCategories( QString s ) | 86 | void KOTodoEditor::setCategories( QString s ) |
86 | { | 87 | { |
87 | mGeneral->setCategories(s); | 88 | mGeneral->setCategories(s); |
88 | } | 89 | } |
89 | void KOTodoEditor::setSecrecy( int sec ) | 90 | void KOTodoEditor::setSecrecy( int sec ) |
90 | { | 91 | { |
91 | mGeneral->setSecrecy( sec ); | 92 | mGeneral->setSecrecy( sec ); |
92 | } | 93 | } |
93 | void KOTodoEditor::reload() | 94 | void KOTodoEditor::reload() |
94 | { | 95 | { |
95 | if ( mTodo ) readTodo( mTodo ); | 96 | if ( mTodo ) readTodo( mTodo ); |
96 | } | 97 | } |
97 | 98 | ||
98 | void KOTodoEditor::setupGeneral() | 99 | void KOTodoEditor::setupGeneral() |
99 | { | 100 | { |
100 | mGeneral = new KOEditorGeneralTodo(this); | 101 | mGeneral = new KOEditorGeneralTodo(this); |
101 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); | 102 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); |
102 | 103 | ||
103 | // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); | 104 | // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); |
104 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), | 105 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), |
105 | // mGeneral,SLOT(setCategories(const QString &))); | 106 | // mGeneral,SLOT(setCategories(const QString &))); |
106 | 107 | ||
107 | if (KOPrefs::instance()->mCompactDialogs) { | 108 | if (KOPrefs::instance()->mCompactDialogs) { |
108 | QFrame *topFrame = addPage(i18n("General")); | 109 | QFrame *topFrame = addPage(i18n("General")); |
109 | 110 | ||
110 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 111 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); |
111 | if ( QApplication::desktop()->width() < 480 ) { | 112 | if ( QApplication::desktop()->width() < 480 ) { |
112 | topLayout->setMargin(1); | 113 | topLayout->setMargin(1); |
113 | topLayout->setSpacing(1); | 114 | topLayout->setSpacing(1); |
114 | } else { | 115 | } else { |
115 | topLayout->setMargin(marginHint()-1); | 116 | topLayout->setMargin(marginHint()-1); |
116 | topLayout->setSpacing(spacingHint()-1); | 117 | topLayout->setSpacing(spacingHint()-1); |
117 | } | 118 | } |
118 | mGeneral->initHeader(topFrame,topLayout); | 119 | mGeneral->initHeader(topFrame,topLayout); |
119 | mGeneral->initTime(topFrame,topLayout); | 120 | mGeneral->initTime(topFrame,topLayout); |
120 | mGeneral->initAlarm(topFrame,topLayout); | 121 | mGeneral->initAlarm(topFrame,topLayout); |
121 | mGeneral->enableAlarm( false ); | 122 | mGeneral->enableAlarm( false ); |
122 | 123 | ||
123 | 124 | ||
124 | QBoxLayout *priorityLayout; | 125 | QBoxLayout *priorityLayout; |
125 | if ( QApplication::desktop()->width() < 500 ) | 126 | if ( QApplication::desktop()->width() < 500 ) |
126 | priorityLayout = new QVBoxLayout( topLayout ); | 127 | priorityLayout = new QVBoxLayout( topLayout ); |
127 | else | 128 | else |
128 | priorityLayout = new QHBoxLayout( topLayout ); | 129 | priorityLayout = new QHBoxLayout( topLayout ); |
129 | QWidget* prioWidget = new QWidget (topFrame); | 130 | QWidget* prioWidget = new QWidget (topFrame); |
130 | priorityLayout->addWidget( prioWidget ); | 131 | priorityLayout->addWidget( prioWidget ); |
131 | QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); | 132 | QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); |
132 | 133 | ||
133 | 134 | ||
134 | QIconSet icon; | 135 | QIconSet icon; |
135 | if ( QApplication::desktop()->width() < 321 ) | 136 | if ( QApplication::desktop()->width() < 321 ) |
136 | icon = SmallIcon("fileimport16"); | 137 | icon = SmallIcon("fileimport16"); |
137 | else | 138 | else |
138 | icon = SmallIcon("fileimport"); | 139 | icon = SmallIcon("fileimport"); |
139 | QPushButton * loadTemplate = new QPushButton( prioWidget); | 140 | QPushButton * loadTemplate = new QPushButton( prioWidget); |
140 | loadTemplate->setIconSet (icon ) ; | 141 | loadTemplate->setIconSet (icon ) ; |
141 | int size = loadTemplate->sizeHint().height(); | 142 | int size = loadTemplate->sizeHint().height(); |
142 | loadTemplate->setFixedSize( size, size ); | 143 | loadTemplate->setFixedSize( size, size ); |
143 | if ( QApplication::desktop()->width() < 321 ) | 144 | if ( QApplication::desktop()->width() < 321 ) |
144 | icon = SmallIcon("fileexport16"); | 145 | icon = SmallIcon("fileexport16"); |
145 | else | 146 | else |
146 | icon = SmallIcon("fileexport"); | 147 | icon = SmallIcon("fileexport"); |
147 | QPushButton * saveTemplate = new QPushButton( prioWidget); | 148 | QPushButton * saveTemplate = new QPushButton( prioWidget); |
148 | saveTemplate->setIconSet (icon ) ; | 149 | saveTemplate->setIconSet (icon ) ; |
149 | saveTemplate->setFixedSize( size, size ); | 150 | saveTemplate->setFixedSize( size, size ); |
150 | 151 | ||
151 | priorityLayout2->addWidget(loadTemplate); | 152 | priorityLayout2->addWidget(loadTemplate); |
152 | priorityLayout2->addWidget(saveTemplate); | 153 | priorityLayout2->addWidget(saveTemplate); |
153 | mGeneral->initPriority(prioWidget,priorityLayout2); | 154 | mGeneral->initPriority(prioWidget,priorityLayout2); |
154 | mGeneral->initCategories( topFrame, priorityLayout ); | 155 | mGeneral->initCategories( topFrame, priorityLayout ); |
155 | topLayout->addStretch(1); | 156 | topLayout->addStretch(1); |
156 | 157 | ||
157 | QFrame *topFrame2 = addPage(i18n("Details")); | 158 | QFrame *topFrame2 = addPage(i18n("Details")); |
158 | 159 | ||
159 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); | 160 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); |
160 | topLayout2->setMargin(marginHint()); | 161 | topLayout2->setMargin(marginHint()); |
161 | topLayout2->setSpacing(spacingHint()); | 162 | topLayout2->setSpacing(spacingHint()); |
162 | 163 | ||
163 | QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); | 164 | QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); |
164 | mGeneral->initCompletion(topFrame2,completionLayout); | 165 | mGeneral->initCompletion(topFrame2,completionLayout); |
165 | 166 | ||
166 | 167 | ||
167 | mGeneral->initSecrecy( topFrame2, topLayout2 ); | 168 | mGeneral->initSecrecy( topFrame2, topLayout2 ); |
168 | mGeneral->initDescription(topFrame2,topLayout2); | 169 | mGeneral->initDescription(topFrame2,topLayout2); |
169 | 170 | ||
170 | // QHBox * hb = new QHBox ( topFrame2 ); | 171 | // QHBox * hb = new QHBox ( topFrame2 ); |