Diffstat (limited to 'korganizer/kodialogmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/kodialogmanager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index a8652ea..c927b37 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -11,64 +11,65 @@ | |||
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <libkdepim/categoryeditdialog.h> | 22 | #include <libkdepim/categoryeditdialog.h> |
23 | 23 | ||
24 | #include "calendarview.h" | 24 | #include "calendarview.h" |
25 | #include "incomingdialog.h" | 25 | #include "incomingdialog.h" |
26 | #include "outgoingdialog.h" | 26 | #include "outgoingdialog.h" |
27 | #include "koprefsdialog.h" | 27 | #include "koprefsdialog.h" |
28 | #include "koeventeditor.h" | 28 | #include "koeventeditor.h" |
29 | #include "koprefs.h" | 29 | #include "koprefs.h" |
30 | #include "datenavigator.h" | 30 | #include "datenavigator.h" |
31 | #include "kotodoeditor.h" | 31 | #include "kotodoeditor.h" |
32 | #include "searchdialog.h" | 32 | #include "searchdialog.h" |
33 | #include "filtereditdialog.h" | 33 | #include "filtereditdialog.h" |
34 | #ifndef KORG_NOPLUGINS | 34 | #ifndef KORG_NOPLUGINS |
35 | #include "plugindialog.h" | 35 | #include "plugindialog.h" |
36 | #endif | 36 | #endif |
37 | #ifndef KORG_NOARCHIVE | 37 | #ifndef KORG_NOARCHIVE |
38 | #include "archivedialog.h" | 38 | #include "archivedialog.h" |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #include "kconfig.h" | 41 | #include "kconfig.h" |
42 | #include "kodialogmanager.h" | 42 | #include "kodialogmanager.h" |
43 | #include <kapplication.h> | ||
43 | 44 | ||
44 | KODialogManager::KODialogManager( CalendarView *mainView ) : | 45 | KODialogManager::KODialogManager( CalendarView *mainView ) : |
45 | QObject(), mMainView( mainView ) | 46 | QObject(), mMainView( mainView ) |
46 | { | 47 | { |
47 | mOutgoingDialog = 0; | 48 | mOutgoingDialog = 0; |
48 | mIncomingDialog = 0; | 49 | mIncomingDialog = 0; |
49 | mOptionsDialog = 0; | 50 | mOptionsDialog = 0; |
50 | mSearchDialog = 0; | 51 | mSearchDialog = 0; |
51 | mArchiveDialog = 0; | 52 | mArchiveDialog = 0; |
52 | mFilterEditDialog = 0; | 53 | mFilterEditDialog = 0; |
53 | mPluginDialog = 0; | 54 | mPluginDialog = 0; |
54 | 55 | ||
55 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); | 56 | // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); |
56 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); | 57 | //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); |
57 | } | 58 | } |
58 | 59 | ||
59 | KODialogManager::~KODialogManager() | 60 | KODialogManager::~KODialogManager() |
60 | { | 61 | { |
61 | delete mOutgoingDialog; | 62 | delete mOutgoingDialog; |
62 | delete mIncomingDialog; | 63 | delete mIncomingDialog; |
63 | delete mOptionsDialog; | 64 | delete mOptionsDialog; |
64 | delete mSearchDialog; | 65 | delete mSearchDialog; |
65 | #ifndef KORG_NOARCHIVE | 66 | #ifndef KORG_NOARCHIVE |
66 | delete mArchiveDialog; | 67 | delete mArchiveDialog; |
67 | #endif | 68 | #endif |
68 | delete mFilterEditDialog; | 69 | delete mFilterEditDialog; |
69 | #ifndef KORG_NOPLUGINS | 70 | #ifndef KORG_NOPLUGINS |
70 | delete mPluginDialog; | 71 | delete mPluginDialog; |
71 | #endif | 72 | #endif |
72 | } | 73 | } |
73 | 74 | ||
74 | OutgoingDialog *KODialogManager::outgoingDialog() | 75 | OutgoingDialog *KODialogManager::outgoingDialog() |
@@ -175,78 +176,79 @@ void KODialogManager::showSearchDialog() | |||
175 | mMainView, SLOT(showIncidence(Incidence *))); | 176 | mMainView, SLOT(showIncidence(Incidence *))); |
176 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), | 177 | connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), |
177 | mMainView, SLOT(editIncidence(Incidence *))); | 178 | mMainView, SLOT(editIncidence(Incidence *))); |
178 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), | 179 | connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), |
179 | mMainView, SLOT(deleteIncidence(Incidence *))); | 180 | mMainView, SLOT(deleteIncidence(Incidence *))); |
180 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), | 181 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), |
181 | mMainView, SLOT(cloneIncidence(Incidence *))); | 182 | mMainView, SLOT(cloneIncidence(Incidence *))); |
182 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), | 183 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), |
183 | mMainView, SLOT(beamIncidence(Incidence *))); | 184 | mMainView, SLOT(beamIncidence(Incidence *))); |
184 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), | 185 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), |
185 | mMainView, SLOT(moveIncidence(Incidence *))); | 186 | mMainView, SLOT(moveIncidence(Incidence *))); |
186 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), | 187 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), |
187 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); | 188 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); |
188 | 189 | ||
189 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); | 190 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); |
190 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); | 191 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); |
191 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), | 192 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), |
192 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 193 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
193 | #ifndef DESKTOP_VERSION | 194 | #ifndef DESKTOP_VERSION |
194 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); | 195 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); |
195 | mSearchDialog->showMaximized(); | 196 | mSearchDialog->showMaximized(); |
196 | #else | 197 | #else |
197 | KConfig *config = KOGlobals::config(); | 198 | KConfig *config = KOGlobals::config(); |
198 | config->setGroup("WidgetLayout"); | 199 | config->setGroup("WidgetLayout"); |
199 | QStringList list; | 200 | QStringList list; |
200 | list = config->readListEntry("SearchLayout"); | 201 | list = config->readListEntry("SearchLayout"); |
201 | int x,y,w,h; | 202 | int x,y,w,h; |
202 | if ( ! list.isEmpty() ) { | 203 | if ( ! list.isEmpty() ) { |
203 | x = list[0].toInt(); | 204 | x = list[0].toInt(); |
204 | y = list[1].toInt(); | 205 | y = list[1].toInt(); |
205 | w = list[2].toInt(); | 206 | w = list[2].toInt(); |
206 | h = list[3].toInt(); | 207 | h = list[3].toInt(); |
208 | KApplication::testCoords( &x,&y,&w,&h ); | ||
207 | mSearchDialog->setGeometry(x,y,w,h); | 209 | mSearchDialog->setGeometry(x,y,w,h); |
208 | 210 | ||
209 | } | 211 | } |
210 | 212 | ||
211 | #endif | 213 | #endif |
212 | } | 214 | } |
213 | // make sure the widget is on top again | 215 | // make sure the widget is on top again |
214 | #ifdef DESKTOP_VERSION | 216 | #ifdef DESKTOP_VERSION |
215 | mSearchDialog->show(); | 217 | mSearchDialog->show(); |
216 | #else | 218 | #else |
217 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); | 219 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); |
218 | mSearchDialog->showMaximized(); | 220 | mSearchDialog->showMaximized(); |
219 | #endif | 221 | #endif |
220 | mSearchDialog->raise(); | 222 | mSearchDialog->raiseAndSelect(); |
221 | } | 223 | } |
222 | 224 | ||
223 | SearchDialog * KODialogManager::getSearchDialog() | 225 | SearchDialog * KODialogManager::getSearchDialog() |
224 | { | 226 | { |
225 | return mSearchDialog; | 227 | return mSearchDialog; |
226 | } | 228 | } |
227 | void KODialogManager::showArchiveDialog() | 229 | void KODialogManager::showArchiveDialog() |
228 | { | 230 | { |
229 | #ifndef KORG_NOARCHIVE | 231 | #ifndef KORG_NOARCHIVE |
230 | if (!mArchiveDialog) { | 232 | if (!mArchiveDialog) { |
231 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); | 233 | mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); |
232 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), | 234 | connect(mArchiveDialog,SIGNAL(eventsDeleted()), |
233 | mMainView,SLOT(updateView())); | 235 | mMainView,SLOT(updateView())); |
234 | } | 236 | } |
235 | mArchiveDialog->show(); | 237 | mArchiveDialog->show(); |
236 | mArchiveDialog->raise(); | 238 | mArchiveDialog->raise(); |
237 | 239 | ||
238 | // Workaround. | 240 | // Workaround. |
239 | QApplication::restoreOverrideCursor(); | 241 | QApplication::restoreOverrideCursor(); |
240 | #endif | 242 | #endif |
241 | } | 243 | } |
242 | 244 | ||
243 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) | 245 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) |
244 | { | 246 | { |
245 | if (!mFilterEditDialog) { | 247 | if (!mFilterEditDialog) { |
246 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); | 248 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); |
247 | connect(mFilterEditDialog,SIGNAL(filterChanged()), | 249 | connect(mFilterEditDialog,SIGNAL(filterChanged()), |
248 | mMainView,SLOT(filterEdited())); | 250 | mMainView,SLOT(filterEdited())); |
249 | 251 | ||
250 | } | 252 | } |
251 | 253 | ||
252 | #ifndef DESKTOP_VERSION | 254 | #ifndef DESKTOP_VERSION |