summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-01 09:50:16 (UTC)
committer zautrix <zautrix>2005-04-01 09:50:16 (UTC)
commitf8e027db1d950ec27a3c47fc2a5ea2fe49ae9772 (patch) (unidiff)
tree15edcb7a2b053eae5c5391191f71ba5c5c015211
parentb76ad1e7e329051a47e28c9d132ce3fcd0b25c5c (diff)
downloadkdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.zip
kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.tar.gz
kdepimpi-f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp6
-rw-r--r--korganizer/kodialogmanager.cpp4
-rw-r--r--korganizer/koprefs.h11
-rw-r--r--korganizer/koviewmanager.cpp20
-rw-r--r--korganizer/mainwindow.cpp1
-rw-r--r--korganizer/searchdialog.cpp47
-rw-r--r--korganizer/searchdialog.h1
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp7
-rw-r--r--microkde/kapplication.cpp15
-rw-r--r--microkde/kapplication.h1
-rw-r--r--microkde/kresources/factory.cpp6
11 files changed, 100 insertions, 19 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1e83236..beb19d9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1810,94 +1810,98 @@ void CalendarView::readSettings()
1810 KConfig *config = KOGlobals::config(); 1810 KConfig *config = KOGlobals::config();
1811#ifndef KORG_NOSPLITTER 1811#ifndef KORG_NOSPLITTER
1812 config->setGroup("KOrganizer Geometry"); 1812 config->setGroup("KOrganizer Geometry");
1813 1813
1814 QValueList<int> sizes = config->readIntListEntry("Separator1"); 1814 QValueList<int> sizes = config->readIntListEntry("Separator1");
1815 if (sizes.count() != 2) { 1815 if (sizes.count() != 2) {
1816 sizes << mDateNavigator->minimumSizeHint().width(); 1816 sizes << mDateNavigator->minimumSizeHint().width();
1817 sizes << 300; 1817 sizes << 300;
1818 } 1818 }
1819 mPanner->setSizes(sizes); 1819 mPanner->setSizes(sizes);
1820 1820
1821 sizes = config->readIntListEntry("Separator2"); 1821 sizes = config->readIntListEntry("Separator2");
1822 if ( ( mResourceView && sizes.count() == 4 ) || 1822 if ( ( mResourceView && sizes.count() == 4 ) ||
1823 ( !mResourceView && sizes.count() == 3 ) ) { 1823 ( !mResourceView && sizes.count() == 3 ) ) {
1824 mLeftSplitter->setSizes(sizes); 1824 mLeftSplitter->setSizes(sizes);
1825 } 1825 }
1826#endif 1826#endif
1827 globalFlagBlockAgenda = 1; 1827 globalFlagBlockAgenda = 1;
1828 mViewManager->showAgendaView(); 1828 mViewManager->showAgendaView();
1829 //mViewManager->readSettings( config ); 1829 //mViewManager->readSettings( config );
1830 mTodoList->restoreLayout(config,QString("Todo Layout")); 1830 mTodoList->restoreLayout(config,QString("Todo Layout"));
1831 readFilterSettings(config); 1831 readFilterSettings(config);
1832 1832
1833#ifdef DESKTOP_VERSION 1833#ifdef DESKTOP_VERSION
1834 config->setGroup("WidgetLayout"); 1834 config->setGroup("WidgetLayout");
1835 QStringList list; 1835 QStringList list;
1836 list = config->readListEntry("MainLayout"); 1836 list = config->readListEntry("MainLayout");
1837 int x,y,w,h; 1837 int x,y,w,h;
1838 if ( ! list.isEmpty() ) { 1838 if ( ! list.isEmpty() ) {
1839 x = list[0].toInt(); 1839 x = list[0].toInt();
1840 y = list[1].toInt(); 1840 y = list[1].toInt();
1841 w = list[2].toInt(); 1841 w = list[2].toInt();
1842 h = list[3].toInt(); 1842 h = list[3].toInt();
1843 KApplication::testCoords( &x,&y,&w,&h );
1843 topLevelWidget()->setGeometry(x,y,w,h); 1844 topLevelWidget()->setGeometry(x,y,w,h);
1844 1845
1845 } else { 1846 } else {
1846 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 1847 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
1847 } 1848 }
1848 list = config->readListEntry("EditEventLayout"); 1849 list = config->readListEntry("EditEventLayout");
1849 if ( ! list.isEmpty() ) { 1850 if ( ! list.isEmpty() ) {
1850 x = list[0].toInt(); 1851 x = list[0].toInt();
1851 y = list[1].toInt(); 1852 y = list[1].toInt();
1852 w = list[2].toInt(); 1853 w = list[2].toInt();
1853 h = list[3].toInt(); 1854 h = list[3].toInt();
1855 KApplication::testCoords( &x,&y,&w,&h );
1854 mEventEditor->setGeometry(x,y,w,h); 1856 mEventEditor->setGeometry(x,y,w,h);
1855 1857
1856 } 1858 }
1857 list = config->readListEntry("EditTodoLayout"); 1859 list = config->readListEntry("EditTodoLayout");
1858 if ( ! list.isEmpty() ) { 1860 if ( ! list.isEmpty() ) {
1859 x = list[0].toInt(); 1861 x = list[0].toInt();
1860 y = list[1].toInt(); 1862 y = list[1].toInt();
1861 w = list[2].toInt(); 1863 w = list[2].toInt();
1862 h = list[3].toInt(); 1864 h = list[3].toInt();
1865 KApplication::testCoords( &x,&y,&w,&h );
1863 mTodoEditor->setGeometry(x,y,w,h); 1866 mTodoEditor->setGeometry(x,y,w,h);
1864 1867
1865 } 1868 }
1866 list = config->readListEntry("ViewerLayout"); 1869 list = config->readListEntry("ViewerLayout");
1867 if ( ! list.isEmpty() ) { 1870 if ( ! list.isEmpty() ) {
1868 x = list[0].toInt(); 1871 x = list[0].toInt();
1869 y = list[1].toInt(); 1872 y = list[1].toInt();
1870 w = list[2].toInt(); 1873 w = list[2].toInt();
1871 h = list[3].toInt(); 1874 h = list[3].toInt();
1875 KApplication::testCoords( &x,&y,&w,&h );
1872 getEventViewerDialog()->setGeometry(x,y,w,h); 1876 getEventViewerDialog()->setGeometry(x,y,w,h);
1873 } 1877 }
1874#endif 1878#endif
1875 config->setGroup( "Views" ); 1879 config->setGroup( "Views" );
1876 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 1880 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
1877 1881
1878 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 1882 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
1879 1883
1880 int resetval = 0; 1884 int resetval = 0;
1881 int maxVal = 0; 1885 int maxVal = 0;
1882 if (sizes.count() != 3) { 1886 if (sizes.count() != 3) {
1883 if ( KOPrefs::instance()->mVerticalScreen ) { 1887 if ( KOPrefs::instance()->mVerticalScreen ) {
1884 resetval = mDateNavigator->sizeHint().width()+2; 1888 resetval = mDateNavigator->sizeHint().width()+2;
1885 } else { 1889 } else {
1886 resetval = mDateNavigator->sizeHint().height()+2; 1890 resetval = mDateNavigator->sizeHint().height()+2;
1887 } 1891 }
1888 } 1892 }
1889 if ( resetval ) { 1893 if ( resetval ) {
1890 sizes.clear(); 1894 sizes.clear();
1891 if ( KOPrefs::instance()->mVerticalScreen ) { 1895 if ( KOPrefs::instance()->mVerticalScreen ) {
1892 maxVal = QApplication::desktop()->width() -10; 1896 maxVal = QApplication::desktop()->width() -10;
1893 } else { 1897 } else {
1894 maxVal = QApplication::desktop()->height()-10; 1898 maxVal = QApplication::desktop()->height()-10;
1895 } 1899 }
1896 sizes << resetval; 1900 sizes << resetval;
1897 if ( maxVal < resetval + resetval) 1901 if ( maxVal < resetval + resetval)
1898 resetval = maxVal - resetval; 1902 resetval = maxVal - resetval;
1899 sizes << resetval; 1903 sizes << resetval;
1900 sizes << 100; 1904 sizes << 100;
1901 } 1905 }
1902 mLeftFrame->setSizes(sizes); 1906 mLeftFrame->setSizes(sizes);
1903 sizes = config->readIntListEntry("Main Splitter Frame"); 1907 sizes = config->readIntListEntry("Main Splitter Frame");
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
44KODialogManager::KODialogManager( CalendarView *mainView ) : 45KODialogManager::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
59KODialogManager::~KODialogManager() 60KODialogManager::~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
74OutgoingDialog *KODialogManager::outgoingDialog() 75OutgoingDialog *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
223SearchDialog * KODialogManager::getSearchDialog() 225SearchDialog * KODialogManager::getSearchDialog()
224{ 226{
225 return mSearchDialog; 227 return mSearchDialog;
226} 228}
227void KODialogManager::showArchiveDialog() 229void 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
243void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) 245void 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
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 3a07348..cf8dae6 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -3,64 +3,73 @@
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
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#ifndef KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28#include <qdict.h> 28#include <qdict.h>
29 29
30class KConfig; 30class KConfig;
31class QFont; 31class QFont;
32class QColor; 32class QColor;
33class QStringList; 33class QStringList;
34 34
35#define VIEW_WN_VIEW 1
36#define VIEW_NX_VIEW 2
37#define VIEW_J_VIEW 3
38#define VIEW_A_VIEW 4
39#define VIEW_ML_VIEW 5
40#define VIEW_M_VIEW 6
41#define VIEW_L_VIEW 7
42#define VIEW_T_VIEW 8
43
35class KOPrefs : public KPimPrefs 44class KOPrefs : public KPimPrefs
36{ 45{
37 public: 46 public:
38 enum { FormatVCalendar, FormatICalendar }; 47 enum { FormatVCalendar, FormatICalendar };
39 enum { MailClientKMail, MailClientSendmail }; 48 enum { MailClientKMail, MailClientSendmail };
40 enum { IMIPDummy, IMIPKMail }; 49 enum { IMIPDummy, IMIPKMail };
41 enum { IMIPOutbox, IMIPdirectsend }; 50 enum { IMIPOutbox, IMIPdirectsend };
42 enum { neverAuto, addressbookAuto, selectedAuto }; 51 enum { neverAuto, addressbookAuto, selectedAuto };
43 enum { standardDestination, askDestination }; 52 enum { standardDestination, askDestination };
44 53
45 virtual ~KOPrefs(); 54 virtual ~KOPrefs();
46 55
47 /** Get instance of KOPrefs. It is made sure that there is only one 56 /** Get instance of KOPrefs. It is made sure that there is only one
48 instance. */ 57 instance. */
49 static KOPrefs *instance(); 58 static KOPrefs *instance();
50 59
51 /** Set preferences to default values */ 60 /** Set preferences to default values */
52 void usrSetDefaults(); 61 void usrSetDefaults();
53 62
54 /** Read preferences from config file */ 63 /** Read preferences from config file */
55 void usrReadConfig(); 64 void usrReadConfig();
56 65
57 /** Write preferences to config file */ 66 /** Write preferences to config file */
58 void usrWriteConfig(); 67 void usrWriteConfig();
59 void setCategoryDefaults(); 68 void setCategoryDefaults();
60 void setAllDefaults(); 69 void setAllDefaults();
61 70
62 protected: 71 protected:
63 void setTimeZoneIdDefault(); 72 void setTimeZoneIdDefault();
64 73
65 /** Fill empty mail fields with default values. */ 74 /** Fill empty mail fields with default values. */
66 void fillMailDefaults(); 75 void fillMailDefaults();
@@ -261,45 +270,47 @@ class KOPrefs : public KPimPrefs
261 bool mTodoViewUsesForegroundColor; 270 bool mTodoViewUsesForegroundColor;
262 bool mMonthViewUsesForegroundColor; 271 bool mMonthViewUsesForegroundColor;
263 272
264 bool mHightlightDateTimeEdit; 273 bool mHightlightDateTimeEdit;
265 bool mShortDateInViewer; 274 bool mShortDateInViewer;
266 275
267 bool mShowDateNavigator; 276 bool mShowDateNavigator;
268 277
269 QStringList mLocationDefaults; 278 QStringList mLocationDefaults;
270 QStringList mEventSummaryUser; 279 QStringList mEventSummaryUser;
271 QStringList mTodoSummaryUser; 280 QStringList mTodoSummaryUser;
272 281
273 bool mUseInternalAlarmNotification; 282 bool mUseInternalAlarmNotification;
274 int mAlarmPlayBeeps; 283 int mAlarmPlayBeeps;
275 int mAlarmSuspendTime; 284 int mAlarmSuspendTime;
276 int mAlarmSuspendCount; 285 int mAlarmSuspendCount;
277 int mAlarmBeepInterval; 286 int mAlarmBeepInterval;
278 int mOldLanguage; 287 int mOldLanguage;
279 int mOldLoadedLanguage; 288 int mOldLoadedLanguage;
280 289
281 290
282 QString mActiveSyncPort; 291 QString mActiveSyncPort;
283 QString mActiveSyncIP; 292 QString mActiveSyncIP;
284 293
285 // settings for eventviewer 294 // settings for eventviewer
286 bool mEVshowDetails; 295 bool mEVshowDetails;
287 bool mEVshowCreated; 296 bool mEVshowCreated;
288 bool mEVshowChanged; 297 bool mEVshowChanged;
289 bool mWTshowDetails; 298 bool mWTshowDetails;
290 bool mWTshowCreated; 299 bool mWTshowCreated;
291 bool mWTshowChanged; 300 bool mWTshowChanged;
292 301
302 int mCurrentDisplayedView;
303
293 private: 304 private:
294 QDict<QColor> mCategoryColors; 305 QDict<QColor> mCategoryColors;
295 QColor mDefaultCategoryColor; 306 QColor mDefaultCategoryColor;
296 307
297 QFont mDefaultTimeBarFont; 308 QFont mDefaultTimeBarFont;
298 QFont mDefaultViewFont; 309 QFont mDefaultViewFont;
299 QFont mDefaultMonthViewFont; 310 QFont mDefaultMonthViewFont;
300 311
301 QString mName; 312 QString mName;
302 QString mEmail; 313 QString mEmail;
303}; 314};
304 315
305#endif 316#endif
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index c442d0b..406e741 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -198,73 +198,65 @@ void KOViewManager::writeSettings(KConfig *config)
198 mTodoView->saveLayout(config,"Todo View"); 198 mTodoView->saveLayout(config,"Todo View");
199 } 199 }
200} 200}
201void KOViewManager::showNextView() 201void KOViewManager::showNextView()
202{ 202{
203 static int selecteddatescount = 0; 203 static int selecteddatescount = 0;
204 static QDate selecteddate = QDate ( 2000, 1, 1 ); 204 static QDate selecteddate = QDate ( 2000, 1, 1 );
205 static QDate baseCycleDate = QDate ( 2000, 1, 1 ); 205 static QDate baseCycleDate = QDate ( 2000, 1, 1 );
206 int newCount = mMainView->dateNavigator()->selectedDates().count(); 206 int newCount = mMainView->dateNavigator()->selectedDates().count();
207 if ( selecteddatescount != newCount && flagResetViewChangeDate == 0 ) { 207 if ( selecteddatescount != newCount && flagResetViewChangeDate == 0 ) {
208 flagResetViewChangeDate = 1; 208 flagResetViewChangeDate = 1;
209 } 209 }
210 if ( selecteddate != mMainView->dateNavigator()->selectedDates().first() ) 210 if ( selecteddate != mMainView->dateNavigator()->selectedDates().first() )
211 flagResetViewChangeDate = 1; 211 flagResetViewChangeDate = 1;
212 if ( flagResetViewChangeDate > 0 ) { 212 if ( flagResetViewChangeDate > 0 ) {
213 baseCycleDate = mMainView->dateNavigator()->selectedDates().first(); 213 baseCycleDate = mMainView->dateNavigator()->selectedDates().first();
214 //qDebug("newCycle "); 214 //qDebug("newCycle ");
215 } 215 }
216 if (mCurrentView == mWhatsNextView) goto NEXT_X; 216 if (mCurrentView == mWhatsNextView) goto NEXT_X;
217 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL; 217 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL;
218 if (mCurrentView == mJournalView ) goto DAY_1; 218 if (mCurrentView == mJournalView ) goto DAY_1;
219 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; 219 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5;
220 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; 220 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7;
221 if (mCurrentView == mAgendaView ) goto DAY_6; 221 if (mCurrentView == mAgendaView ) goto DAY_6;
222 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; 222 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
223 if (mCurrentView == mMonthView ) goto LIST; 223 if (mCurrentView == mMonthView ) goto LIST;
224 if (mCurrentView == mListView ) goto TODO; 224 if (mCurrentView == mListView ) goto TODO;
225 // if (mCurrentView == mTodoView ) goto NEXT; 225 // if (mCurrentView == mTodoView ) goto NEXT;
226 NEXT: 226 NEXT:
227 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;} 227 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;}
228 NEXT_X: 228 NEXT_X:
229 if ( KOPrefs::instance()->mShowIconNextDays ) { 229 if ( KOPrefs::instance()->mShowIconNextDays ) {
230 globalFlagBlockAgenda = 1; 230 showNextXView();
231 if ( mCurrentAgendaView != 3 )
232 mCurrentAgendaView = -1;
233 showAgendaView(KOPrefs::instance()->mFullViewMonth);
234 globalFlagBlockAgenda = 2;
235 mMainView->dateNavigator()->selectDates( baseCycleDate ,
236 KOPrefs::instance()->mNextXDays );
237 mFlagShowNextxDays = true;
238 mCurrentAgendaView = 3 ;
239 goto ENTE ; 231 goto ENTE ;
240 } 232 }
241 JOURNAL: 233 JOURNAL:
242 if ( KOPrefs::instance()->mShowIconJournal ) { 234 if ( KOPrefs::instance()->mShowIconJournal ) {
243 resetDateSilent( baseCycleDate , 1 ); 235 resetDateSilent( baseCycleDate , 1 );
244 showJournalView() ;goto ENTE ;} 236 showJournalView() ;goto ENTE ;}
245 DAY_1: 237 DAY_1:
246 if ( KOPrefs::instance()->mShowIconDay1 ) { 238 if ( KOPrefs::instance()->mShowIconDay1 ) {
247 resetDateSilent( baseCycleDate , 2 ); 239 resetDateSilent( baseCycleDate , 2 );
248 showDayView() ;goto ENTE ;} 240 showDayView() ;goto ENTE ;}
249 DAY_5: 241 DAY_5:
250 if ( KOPrefs::instance()->mShowIconDay5 ) { 242 if ( KOPrefs::instance()->mShowIconDay5 ) {
251 resetDateSilent( baseCycleDate , 2 ); 243 resetDateSilent( baseCycleDate , 2 );
252 showWorkWeekView() ;goto ENTE ;} 244 showWorkWeekView() ;goto ENTE ;}
253 DAY_7: 245 DAY_7:
254 if ( KOPrefs::instance()->mShowIconDay7 ) { 246 if ( KOPrefs::instance()->mShowIconDay7 ) {
255 resetDateSilent( baseCycleDate , 2 ); 247 resetDateSilent( baseCycleDate , 2 );
256 showWeekView();goto ENTE ;} 248 showWeekView();goto ENTE ;}
257 DAY_6: 249 DAY_6:
258 if ( KOPrefs::instance()->mShowIconDay6 ) { 250 if ( KOPrefs::instance()->mShowIconDay6 ) {
259 resetDateSilent( baseCycleDate , 2 ); 251 resetDateSilent( baseCycleDate , 2 );
260 showMonthViewWeek();goto ENTE ;} 252 showMonthViewWeek();goto ENTE ;}
261 MONTH: 253 MONTH:
262 if ( KOPrefs::instance()->mShowIconMonth ) { 254 if ( KOPrefs::instance()->mShowIconMonth ) {
263 resetDateSilent( baseCycleDate , 2 ); 255 resetDateSilent( baseCycleDate , 2 );
264 showMonthView();goto ENTE ;} 256 showMonthView();goto ENTE ;}
265 LIST: 257 LIST:
266 if ( KOPrefs::instance()->mShowIconList ) { 258 if ( KOPrefs::instance()->mShowIconList ) {
267 resetDateSilent( baseCycleDate , 2 ); 259 resetDateSilent( baseCycleDate , 2 );
268 showListView() ;goto ENTE ;} 260 showListView() ;goto ENTE ;}
269 TODO: 261 TODO:
270 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;goto ENTE ;} 262 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;goto ENTE ;}
@@ -378,110 +370,111 @@ void KOViewManager::updateView()
378void KOViewManager::updateView(const QDate &start, const QDate &end) 370void KOViewManager::updateView(const QDate &start, const QDate &end)
379{ 371{
380 // kdDebug() << "KOViewManager::updateView()" << endl; 372 // kdDebug() << "KOViewManager::updateView()" << endl;
381 373
382 if (mCurrentView) mCurrentView->showDates(start, end); 374 if (mCurrentView) mCurrentView->showDates(start, end);
383 375
384 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); 376 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView();
385} 377}
386 378
387 379
388void KOViewManager::updateWNview() 380void KOViewManager::updateWNview()
389{ 381{
390 if ( mCurrentView == mWhatsNextView && mWhatsNextView ) 382 if ( mCurrentView == mWhatsNextView && mWhatsNextView )
391 mWhatsNextView->updateView(); 383 mWhatsNextView->updateView();
392 if ( mCurrentView == mMonthView && mMonthView ) 384 if ( mCurrentView == mMonthView && mMonthView )
393 mMonthView->updateView(); 385 mMonthView->updateView();
394 386
395} 387}
396void KOViewManager::showWhatsNextView() 388void KOViewManager::showWhatsNextView()
397{ 389{
398 if (!mWhatsNextView) { 390 if (!mWhatsNextView) {
399 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), 391 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(),
400 "KOViewManager::WhatsNextView"); 392 "KOViewManager::WhatsNextView");
401 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); 393 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog());
402 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); 394 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
403 addView(mWhatsNextView); 395 addView(mWhatsNextView);
404 connect(this, SIGNAL( printWNV() ), 396 connect(this, SIGNAL( printWNV() ),
405 mWhatsNextView, SLOT( printMe() ) ); 397 mWhatsNextView, SLOT( printMe() ) );
406 } 398 }
407 globalFlagBlockAgenda = 1; 399 globalFlagBlockAgenda = 1;
408 showView(mWhatsNextView, true ); 400 showView(mWhatsNextView, true );
409 //mWhatsNextView->updateView(); 401 //mWhatsNextView->updateView();
410 402 KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW;
411} 403}
412 404
413void KOViewManager::slotprintWNV() 405void KOViewManager::slotprintWNV()
414{ 406{
415 if (!mWhatsNextView) 407 if (!mWhatsNextView)
416 showWhatsNextView(); 408 showWhatsNextView();
417 emit printWNV(); 409 emit printWNV();
418 410
419} 411}
420void KOViewManager::showListView() 412void KOViewManager::showListView()
421{ 413{
422 if (!mListView) { 414 if (!mListView) {
423 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); 415 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
424 addView(mListView); 416 addView(mListView);
425 417
426 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), 418 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
427 mMainView, SLOT(showIncidence(Incidence *))); 419 mMainView, SLOT(showIncidence(Incidence *)));
428 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), 420 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
429 mMainView, SLOT(editIncidence(Incidence *))); 421 mMainView, SLOT(editIncidence(Incidence *)));
430 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), 422 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
431 mMainView, SLOT(deleteIncidence(Incidence *))); 423 mMainView, SLOT(deleteIncidence(Incidence *)));
432 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), 424 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
433 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 425 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
434 connect( mListView, SIGNAL( signalNewEvent() ), 426 connect( mListView, SIGNAL( signalNewEvent() ),
435 mMainView, SLOT( newEvent() ) ); 427 mMainView, SLOT( newEvent() ) );
436 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 428 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
437 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 429 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
438 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 430 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
439 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 431 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
440 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 432 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
441 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 433 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
442 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 434 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
443 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 435 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
444 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 436 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
445 } 437 }
446 // bool temp = mFlagShowNextxDays; 438 // bool temp = mFlagShowNextxDays;
447 //globalFlagBlockPainting = true; 439 //globalFlagBlockPainting = true;
448 globalFlagBlockAgenda = 1; 440 globalFlagBlockAgenda = 1;
449 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 441 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
450 mMainView->setBlockShowDates( true ); 442 mMainView->setBlockShowDates( true );
451 mMainView->dateNavigator()->selectMonth(); 443 mMainView->dateNavigator()->selectMonth();
452 mMainView->setBlockShowDates( false ); 444 mMainView->setBlockShowDates( false );
453 } 445 }
454 showView(mListView, KOPrefs::instance()->mFullViewTodo); 446 showView(mListView, KOPrefs::instance()->mFullViewTodo);
455 //mFlagShowNextxDays = temp; 447 //mFlagShowNextxDays = temp;
448 KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
456} 449}
457 450
458void KOViewManager::showAgendaView( bool fullScreen ) 451void KOViewManager::showAgendaView( bool fullScreen )
459{ 452{
460 453
461 mMainView->dialogManager()->hideSearchDialog(); 454 mMainView->dialogManager()->hideSearchDialog();
462 // qDebug("KOViewManager::showAgendaView "); 455 // qDebug("KOViewManager::showAgendaView ");
463 bool full; 456 bool full;
464 full = fullScreen; 457 full = fullScreen;
465 if (!mAgendaView) { 458 if (!mAgendaView) {
466 full = false; 459 full = false;
467 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 460 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
468 addView(mAgendaView); 461 addView(mAgendaView);
469#ifndef DESKTOP_VERSION 462#ifndef DESKTOP_VERSION
470 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); 463 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
471#endif 464#endif
472 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), 465 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
473 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); 466 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
474 467
475 // SIGNALS/SLOTS FOR DAY/WEEK VIEW 468 // SIGNALS/SLOTS FOR DAY/WEEK VIEW
476 469
477 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); 470 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
478 471
479 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), 472 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
480 mMainView, SLOT(newTodoDateTime(QDateTime,bool))); 473 mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
481 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), 474 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
482 mMainView, SLOT(newEvent(QDateTime))); 475 mMainView, SLOT(newEvent(QDateTime)));
483 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), 476 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
484 mMainView, SLOT(newEvent(QDateTime,QDateTime))); 477 mMainView, SLOT(newEvent(QDateTime,QDateTime)));
485 connect(mAgendaView,SIGNAL(newEventSignal(QDate)), 478 connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
486 mMainView, SLOT(newEvent(QDate))); 479 mMainView, SLOT(newEvent(QDate)));
487 480
@@ -489,65 +482,65 @@ void KOViewManager::showAgendaView( bool fullScreen )
489 mMainView, SLOT(editIncidence(Incidence *))); 482 mMainView, SLOT(editIncidence(Incidence *)));
490 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), 483 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
491 mMainView, SLOT(showIncidence(Incidence *))); 484 mMainView, SLOT(showIncidence(Incidence *)));
492 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), 485 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
493 mMainView, SLOT(deleteIncidence(Incidence *))); 486 mMainView, SLOT(deleteIncidence(Incidence *)));
494 487
495 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), 488 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
496 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 489 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
497 490
498 connect(mAgendaView, SIGNAL( toggleExpand() ), 491 connect(mAgendaView, SIGNAL( toggleExpand() ),
499 mMainView, SLOT( toggleExpand() ) ); 492 mMainView, SLOT( toggleExpand() ) );
500 493
501 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), 494 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
502 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; 495 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
503 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), 496 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
504 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; 497 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
505 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); 498 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
506 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, 499 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
507 SLOT( updateTodo( Todo *, int ) ) ); 500 SLOT( updateTodo( Todo *, int ) ) );
508 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), 501 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
509 mMainView, SIGNAL( todoModified( Todo *, int ))); 502 mMainView, SIGNAL( todoModified( Todo *, int )));
510 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 503 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
511 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 504 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
512 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 505 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
513 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 506 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
514 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), 507 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
515 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); 508 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
516 mAgendaView->readSettings(); 509 mAgendaView->readSettings();
517 mAgendaView->updateConfig(); 510 mAgendaView->updateConfig();
518 } 511 }
519 512
520 showView( mAgendaView, full); 513 showView( mAgendaView, full);
521 514 KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
522} 515}
523 516
524void KOViewManager::showDayView() 517void KOViewManager::showDayView()
525{ 518{
526 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 519 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
527 mFlagShowNextxDays = false; 520 mFlagShowNextxDays = false;
528 globalFlagBlockLabel = 1; 521 globalFlagBlockLabel = 1;
529 globalFlagBlockAgenda = 1; 522 globalFlagBlockAgenda = 1;
530 if ( mCurrentAgendaView != 1 ) 523 if ( mCurrentAgendaView != 1 )
531 mCurrentAgendaView = -1; 524 mCurrentAgendaView = -1;
532 showAgendaView(); 525 showAgendaView();
533 qApp->processEvents(); 526 qApp->processEvents();
534 globalFlagBlockAgenda = 2; 527 globalFlagBlockAgenda = 2;
535 globalFlagBlockLabel = 0; 528 globalFlagBlockLabel = 0;
536 mMainView->dateNavigator()->selectDates( 1 ); 529 mMainView->dateNavigator()->selectDates( 1 );
537 mCurrentAgendaView = 1 ; 530 mCurrentAgendaView = 1 ;
538 531
539} 532}
540 533
541void KOViewManager::showWorkWeekView() 534void KOViewManager::showWorkWeekView()
542{ 535{
543 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 536 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
544 mFlagShowNextxDays = false; 537 mFlagShowNextxDays = false;
545 globalFlagBlockAgenda = 1; 538 globalFlagBlockAgenda = 1;
546 globalFlagBlockLabel = 1; 539 globalFlagBlockLabel = 1;
547 if ( mCurrentAgendaView != 5 ) 540 if ( mCurrentAgendaView != 5 )
548 mCurrentAgendaView = -1; 541 mCurrentAgendaView = -1;
549 showAgendaView(); 542 showAgendaView();
550 qApp->processEvents(); 543 qApp->processEvents();
551 globalFlagBlockAgenda = 2; 544 globalFlagBlockAgenda = 2;
552 globalFlagBlockLabel = 0; 545 globalFlagBlockLabel = 0;
553 mMainView->dateNavigator()->selectWorkWeek(); 546 mMainView->dateNavigator()->selectWorkWeek();
@@ -563,64 +556,65 @@ void KOViewManager::showWeekView()
563 //globalFlagBlockPainting = true; 556 //globalFlagBlockPainting = true;
564 mMainView->dateNavigator()->selectWeek(); 557 mMainView->dateNavigator()->selectWeek();
565 showAgendaView(); 558 showAgendaView();
566 */ 559 */
567 560
568 561
569 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 562 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
570 mFlagShowNextxDays = false; 563 mFlagShowNextxDays = false;
571 globalFlagBlockAgenda = 1; 564 globalFlagBlockAgenda = 1;
572 globalFlagBlockLabel = 1; 565 globalFlagBlockLabel = 1;
573 if ( mCurrentAgendaView != 7 ) 566 if ( mCurrentAgendaView != 7 )
574 mCurrentAgendaView = -1; 567 mCurrentAgendaView = -1;
575 showAgendaView(); 568 showAgendaView();
576 qApp->processEvents(); 569 qApp->processEvents();
577 globalFlagBlockAgenda = 2; 570 globalFlagBlockAgenda = 2;
578 globalFlagBlockLabel = 0; 571 globalFlagBlockLabel = 0;
579 mMainView->dateNavigator()->selectWeek(); 572 mMainView->dateNavigator()->selectWeek();
580 mCurrentAgendaView = 7 ; 573 mCurrentAgendaView = 7 ;
581} 574}
582 575
583void KOViewManager::showNextXView() 576void KOViewManager::showNextXView()
584{ 577{
585 578
586 globalFlagBlockAgenda = 1; 579 globalFlagBlockAgenda = 1;
587 if ( mCurrentAgendaView != 3 ) 580 if ( mCurrentAgendaView != 3 )
588 mCurrentAgendaView = -1; 581 mCurrentAgendaView = -1;
589 showAgendaView(KOPrefs::instance()->mFullViewMonth); 582 showAgendaView(KOPrefs::instance()->mFullViewMonth);
590 globalFlagBlockAgenda = 2; 583 globalFlagBlockAgenda = 2;
591 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 584 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
592 KOPrefs::instance()->mNextXDays ); 585 KOPrefs::instance()->mNextXDays );
593 mFlagShowNextxDays = true; 586 mFlagShowNextxDays = true;
594 mCurrentAgendaView = 3 ; 587 mCurrentAgendaView = 3 ;
588 KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
595} 589}
596bool KOViewManager::showsNextDays() 590bool KOViewManager::showsNextDays()
597{ 591{
598 return mFlagShowNextxDays; 592 return mFlagShowNextxDays;
599} 593}
600void KOViewManager::createMonthView() 594void KOViewManager::createMonthView()
601{ 595{
602if (!mMonthView) { 596if (!mMonthView) {
603 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 597 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
604 598
605 addView(mMonthView); 599 addView(mMonthView);
606 // mMonthView->show(); 600 // mMonthView->show();
607 // SIGNALS/SLOTS FOR MONTH VIEW 601 // SIGNALS/SLOTS FOR MONTH VIEW
608 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 602 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
609 mMainView, SLOT(newEvent(QDateTime))); 603 mMainView, SLOT(newEvent(QDateTime)));
610 604
611 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 605 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
612 mMainView, SLOT(showIncidence(Incidence *))); 606 mMainView, SLOT(showIncidence(Incidence *)));
613 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 607 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
614 mMainView, SLOT(editIncidence(Incidence *))); 608 mMainView, SLOT(editIncidence(Incidence *)));
615 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 609 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
616 mMainView, SLOT(deleteIncidence(Incidence *))); 610 mMainView, SLOT(deleteIncidence(Incidence *)));
617 611
618 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 612 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
619 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 613 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
620 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 614 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
621 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 615 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
622 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 616 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
623 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 617 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
624 618
625 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 619 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
626 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 620 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
@@ -647,166 +641,170 @@ if (!mMonthView) {
647 mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); 641 mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
648 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), 642 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
649 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); 643 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
650 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), 644 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
651 mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); 645 mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
652 646
653 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 647 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
654 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); 648 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) );
655 649
656 650
657 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), 651 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ),
658 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); 652 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) );
659 653
660 } 654 }
661} 655}
662void KOViewManager::showMonthViewWeek() 656void KOViewManager::showMonthViewWeek()
663{ 657{
664 createMonthView(); 658 createMonthView();
665 globalFlagBlockAgenda = 1; 659 globalFlagBlockAgenda = 1;
666 bool full = true; 660 bool full = true;
667 if ( mCurrentView == mMonthView) 661 if ( mCurrentView == mMonthView)
668 full = mMainView->leftFrame()->isVisible(); 662 full = mMainView->leftFrame()->isVisible();
669 if ( !KOPrefs::instance()->mMonthViewWeek ) { 663 if ( !KOPrefs::instance()->mMonthViewWeek ) {
670 mMonthView->switchView(); 664 mMonthView->switchView();
671 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 665 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
672 full = false; 666 full = false;
673 else 667 else
674 full = true; 668 full = true;
675 } 669 }
676 mMainView->dateNavigator()->selectWeek(); 670 mMainView->dateNavigator()->selectWeek();
677 showView(mMonthView, full ); 671 showView(mMonthView, full );
678 mMonthView->setKeyBFocus(); 672 mMonthView->setKeyBFocus();
673 KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ;
679} 674}
680 675
681void KOViewManager::showMonth( const QDate & date ) 676void KOViewManager::showMonth( const QDate & date )
682{ 677{
683 mMainView->dateNavigator()->blockSignals( true ); 678 mMainView->dateNavigator()->blockSignals( true );
684 mMainView->dateNavigator()->selectDate( date ); 679 mMainView->dateNavigator()->selectDate( date );
685 mMainView->dateNavigator()->blockSignals( false ); 680 mMainView->dateNavigator()->blockSignals( false );
686 showMonthView(); 681 showMonthView();
687} 682}
688void KOViewManager::showMonthView() 683void KOViewManager::showMonthView()
689 { 684 {
690 685
691 createMonthView(); 686 createMonthView();
692 globalFlagBlockAgenda = 1; 687 globalFlagBlockAgenda = 1;
693 //mFlagShowNextxDays = false; 688 //mFlagShowNextxDays = false;
694 bool full = true; 689 bool full = true;
695 if ( mCurrentView == mMonthView) 690 if ( mCurrentView == mMonthView)
696 full = mMainView->leftFrame()->isVisible(); 691 full = mMainView->leftFrame()->isVisible();
697 // if(mMonthView == mCurrentView) return; 692 // if(mMonthView == mCurrentView) return;
698 if ( KOPrefs::instance()->mMonthViewWeek ) { 693 if ( KOPrefs::instance()->mMonthViewWeek ) {
699 mMonthView->switchView(); 694 mMonthView->switchView();
700 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 695 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
701 full = false; 696 full = false;
702 else 697 else
703 full = true; 698 full = true;
704 } 699 }
705 mMainView->dateNavigator()->selectMonth(); 700 mMainView->dateNavigator()->selectMonth();
706 701
707 showView(mMonthView, full ); 702 showView(mMonthView, full );
708 mMonthView->setKeyBFocus(); 703 mMonthView->setKeyBFocus();
704 KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ;
709 705
710} 706}
711 707
712void KOViewManager::showTodoView() 708void KOViewManager::showTodoView()
713{ 709{
714 //mFlagShowNextxDays = false; 710 //mFlagShowNextxDays = false;
715 if ( !mTodoView ) { 711 if ( !mTodoView ) {
716 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 712 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
717 "KOViewManager::TodoView" ); 713 "KOViewManager::TodoView" );
718 714
719 addView( mTodoView ); 715 addView( mTodoView );
720 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 716 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
721 717
722 // SIGNALS/SLOTS FOR TODO VIEW 718 // SIGNALS/SLOTS FOR TODO VIEW
723 connect( mTodoView, SIGNAL( newTodoSignal() ), 719 connect( mTodoView, SIGNAL( newTodoSignal() ),
724 mMainView, SLOT( newTodo() ) ); 720 mMainView, SLOT( newTodo() ) );
725 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 721 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
726 mMainView, SLOT( newSubTodo( Todo *) ) ); 722 mMainView, SLOT( newSubTodo( Todo *) ) );
727 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 723 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
728 mMainView, SLOT( showTodo( Todo * ) ) ); 724 mMainView, SLOT( showTodo( Todo * ) ) );
729 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 725 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
730 mMainView, SLOT( editTodo( Todo * ) ) ); 726 mMainView, SLOT( editTodo( Todo * ) ) );
731 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 727 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
732 mMainView, SLOT( deleteTodo( Todo * ) ) ); 728 mMainView, SLOT( deleteTodo( Todo * ) ) );
733 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 729 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
734 mMainView, SLOT( purgeCompleted() ) ); 730 mMainView, SLOT( purgeCompleted() ) );
735 731
736 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 732 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
737 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 733 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
738 734
739 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 735 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
740 SLOT( updateConfig() ) ); 736 SLOT( updateConfig() ) );
741 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, 737 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
742 SLOT( updateTodo( Todo *, int ) ) ); 738 SLOT( updateTodo( Todo *, int ) ) );
743 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), 739 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
744 mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); 740 mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
745 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), 741 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ),
746 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 742 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
747 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), 743 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ),
748 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 744 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
749 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), 745 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ),
750 mMainView, SLOT ( todo_unsub( Todo * ) ) ); 746 mMainView, SLOT ( todo_unsub( Todo * ) ) );
751 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 747 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
752 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); 748 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
753 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), 749 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
754 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 750 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
755 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 751 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
756 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 752 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
757 KConfig *config = KOGlobals::config(); 753 KConfig *config = KOGlobals::config();
758 mTodoView->restoreLayout(config,"Todo View"); 754 mTodoView->restoreLayout(config,"Todo View");
759 mTodoView->setNavigator( mMainView->dateNavigator() ); 755 mTodoView->setNavigator( mMainView->dateNavigator() );
760 } 756 }
761 757
762 globalFlagBlockAgenda = 1; 758 globalFlagBlockAgenda = 1;
763 showView( mTodoView, true ); 759 showView( mTodoView, true );
760 KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
764 761
765} 762}
766 763
767void KOViewManager::showJournalView() 764void KOViewManager::showJournalView()
768{ 765{
769 //mFlagShowNextxDays = false; 766 //mFlagShowNextxDays = false;
770 if (!mJournalView) { 767 if (!mJournalView) {
771 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), 768 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
772 "KOViewManager::JournalView"); 769 "KOViewManager::JournalView");
773 connect( mMainView, SIGNAL( configChanged() ), mJournalView, 770 connect( mMainView, SIGNAL( configChanged() ), mJournalView,
774 SLOT( updateConfig() ) ); 771 SLOT( updateConfig() ) );
775 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); 772 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
776 addView(mJournalView); 773 addView(mJournalView);
777 } 774 }
778 775
779 showView(mJournalView); 776 showView(mJournalView);
780 mMainView->dateNavigator()->selectDates( 1 ); 777 mMainView->dateNavigator()->selectDates( 1 );
778 KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
781} 779}
782 780
783void KOViewManager::showTimeSpanView() 781void KOViewManager::showTimeSpanView()
784{ 782{
785 //mFlagShowNextxDays = false; 783 //mFlagShowNextxDays = false;
786 if (!mTimeSpanView) { 784 if (!mTimeSpanView) {
787 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), 785 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
788 "KOViewManager::TimeSpanView"); 786 "KOViewManager::TimeSpanView");
789 addView(mTimeSpanView); 787 addView(mTimeSpanView);
790 788
791 mTimeSpanView->readSettings(); 789 mTimeSpanView->readSettings();
792 } 790 }
793 791
794 showView(mTimeSpanView); 792 showView(mTimeSpanView);
795} 793}
796 794
797Incidence *KOViewManager::currentSelection() 795Incidence *KOViewManager::currentSelection()
798{ 796{
799 if (!mCurrentView) return 0; 797 if (!mCurrentView) return 0;
800 if ( mCurrentView == mListView ) { 798 if ( mCurrentView == mListView ) {
801 if ( mListView->currentItem() ) 799 if ( mListView->currentItem() )
802 return mListView->currentItem(); 800 return mListView->currentItem();
803 } 801 }
804 return mCurrentView->selectedIncidences().first(); 802 return mCurrentView->selectedIncidences().first();
805} 803}
806 804
807QDate KOViewManager::currentSelectionDate() 805QDate KOViewManager::currentSelectionDate()
808{ 806{
809 QDate qd; 807 QDate qd;
810 if (mCurrentView) { 808 if (mCurrentView) {
811 DateList qvl = mCurrentView->selectedDates(); 809 DateList qvl = mCurrentView->selectedDates();
812 if (!qvl.isEmpty()) qd = qvl.first(); 810 if (!qvl.isEmpty()) qd = qvl.first();
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index d98915b..357154e 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -116,64 +116,65 @@ class KOex2phonePrefs : public QDialog
116 lay->addWidget( cancel ); 116 lay->addWidget( cancel );
117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
119 resize( 220, 240 ); 119 resize( 220, 240 );
120 qApp->processEvents(); 120 qApp->processEvents();
121 int dw = QApplication::desktop()->width(); 121 int dw = QApplication::desktop()->width();
122 int dh = QApplication::desktop()->height(); 122 int dh = QApplication::desktop()->height();
123 move( (dw-width())/2, (dh - height() )/2 ); 123 move( (dw-width())/2, (dh - height() )/2 );
124 } 124 }
125 125
126public: 126public:
127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
128 QCheckBox* mWriteBackFuture; 128 QCheckBox* mWriteBackFuture;
129 QSpinBox* mWriteBackFutureWeeks; 129 QSpinBox* mWriteBackFutureWeeks;
130}; 130};
131 131
132int globalFlagBlockStartup; 132int globalFlagBlockStartup;
133MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 133MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
134 QMainWindow( parent, name ) 134 QMainWindow( parent, name )
135{ 135{
136 136
137 mClosed = false; 137 mClosed = false;
138 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 138 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
139 QString confFile = locateLocal("config","korganizerrc"); 139 QString confFile = locateLocal("config","korganizerrc");
140 QFileInfo finf ( confFile ); 140 QFileInfo finf ( confFile );
141 bool showWarning = !finf.exists(); 141 bool showWarning = !finf.exists();
142 setIcon(SmallIcon( "ko24" ) ); 142 setIcon(SmallIcon( "ko24" ) );
143 mBlockAtStartup = true; 143 mBlockAtStartup = true;
144 mFlagKeyPressed = false; 144 mFlagKeyPressed = false;
145 setCaption("KO/Pi"); 145 setCaption("KO/Pi");
146 KOPrefs *p = KOPrefs::instance(); 146 KOPrefs *p = KOPrefs::instance();
147 KPimGlobalPrefs::instance()->setGlobalConfig(); 147 KPimGlobalPrefs::instance()->setGlobalConfig();
148 p->mCurrentDisplayedView = 0;
148 if ( p->mHourSize > 22 ) 149 if ( p->mHourSize > 22 )
149 p->mHourSize = 22; 150 p->mHourSize = 22;
150 QMainWindow::ToolBarDock tbd; 151 QMainWindow::ToolBarDock tbd;
151 if ( p->mToolBarHor ) { 152 if ( p->mToolBarHor ) {
152 if ( p->mToolBarUp ) 153 if ( p->mToolBarUp )
153 tbd = Bottom; 154 tbd = Bottom;
154 else 155 else
155 tbd = Top; 156 tbd = Top;
156 } 157 }
157 else { 158 else {
158 if ( p->mToolBarUp ) 159 if ( p->mToolBarUp )
159 tbd = Right; 160 tbd = Right;
160 else 161 else
161 tbd = Left; 162 tbd = Left;
162 } 163 }
163 if ( KOPrefs::instance()->mUseAppColors ) 164 if ( KOPrefs::instance()->mUseAppColors )
164 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 165 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
165 globalFlagBlockStartup = 1; 166 globalFlagBlockStartup = 1;
166 iconToolBar = new QPEToolBar( this ); 167 iconToolBar = new QPEToolBar( this );
167 addToolBar (iconToolBar , tbd ); 168 addToolBar (iconToolBar , tbd );
168 169
169#ifdef DESKTOP_VERSION 170#ifdef DESKTOP_VERSION
170 if ( KOPrefs::instance()->mShowIconFilter ) 171 if ( KOPrefs::instance()->mShowIconFilter )
171#else 172#else
172 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 173 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
173#endif 174#endif
174 175
175{ 176{
176 if ( p->mToolBarHorF ) { 177 if ( p->mToolBarHorF ) {
177 if ( p->mToolBarUpF ) 178 if ( p->mToolBarUpF )
178 tbd = Bottom; 179 tbd = Bottom;
179 else 180 else
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 341a839..db60383 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -48,116 +48,159 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
48 : QVBox( 0 ) 48 : QVBox( 0 )
49 49
50{ 50{
51 mCalendar = calendar; 51 mCalendar = calendar;
52 QFrame *topFrame = new QFrame( this ) ;//plainPage(); 52 QFrame *topFrame = new QFrame( this ) ;//plainPage();
53 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); 53 QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint());
54 54
55 // Search expression 55 // Search expression
56 QHBoxLayout *subLayout = new QHBoxLayout(); 56 QHBoxLayout *subLayout = new QHBoxLayout();
57 layout->addLayout(subLayout); 57 layout->addLayout(subLayout);
58 searchLabel = new QLabel(topFrame); 58 searchLabel = new QLabel(topFrame);
59 searchLabel->setText(i18n("Search for:")); 59 searchLabel->setText(i18n("Search for:"));
60 subLayout->addWidget(searchLabel); 60 subLayout->addWidget(searchLabel);
61 61
62 searchEdit = new KLineEdit(topFrame); 62 searchEdit = new KLineEdit(topFrame);
63 subLayout->addWidget(searchEdit); 63 subLayout->addWidget(searchEdit);
64 QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); 64 QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame );
65 //OkButton->setDefault( true ); 65 //OkButton->setDefault( true );
66 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); 66 connect(OkButton,SIGNAL(clicked()),SLOT(doSearch()));
67 subLayout->addWidget(OkButton); 67 subLayout->addWidget(OkButton);
68 searchEdit->setText("*"); // Find all events by default 68 searchEdit->setText("*"); // Find all events by default
69 searchEdit->setFocus(); 69 searchEdit->setFocus();
70 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); 70 connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & )));
71 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); 71 connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch()));
72 // Subjects to search 72 // Subjects to search
73 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), 73 // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
74 // topFrame); 74 // topFrame);
75 75
76 QHBox *incidenceGroup = new QHBox( topFrame ); 76 QHBox *incidenceGroup = new QHBox( topFrame );
77 layout->addWidget(incidenceGroup); 77 layout->addWidget(incidenceGroup);
78 78
79 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); 79 mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
80 mSearchEvent->setChecked(true); 80 //mSearchEvent->setChecked(true);
81 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); 81 mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
82 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); 82 mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
83 83
84 QHBox *subjectGroup = new QHBox( topFrame ); 84 QHBox *subjectGroup = new QHBox( topFrame );
85 layout->addWidget(subjectGroup); 85 layout->addWidget(subjectGroup);
86 86
87 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); 87 mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
88 mSummaryCheck->setChecked(true); 88 mSummaryCheck->setChecked(true);
89 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); 89 mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup);
90 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); 90 mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup);
91 91
92 QHBox *attendeeGroup = new QHBox( topFrame ); 92 QHBox *attendeeGroup = new QHBox( topFrame );
93 layout->addWidget(attendeeGroup ); 93 layout->addWidget(attendeeGroup );
94 new QLabel( i18n("Attendee:"),attendeeGroup ); 94 new QLabel( i18n("Attendee:"),attendeeGroup );
95 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); 95 mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup );
96 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); 96 mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup );
97 // Date range 97 // Date range
98 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), 98 // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"),
99 // topFrame); 99 // topFrame);
100 // layout->addWidget(rangeGroup); 100 // layout->addWidget(rangeGroup);
101 101
102 QWidget *rangeWidget = new QWidget(topFrame); 102 QWidget *rangeWidget = new QWidget(topFrame);
103 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); 103 QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint());
104 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); 104 rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget));
105 mStartDate = new KDateEdit(rangeWidget); 105 mStartDate = new KDateEdit(rangeWidget);
106 rangeLayout->addWidget(mStartDate); 106 rangeLayout->addWidget(mStartDate);
107 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); 107 rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget));
108 mEndDate = new KDateEdit(rangeWidget); 108 mEndDate = new KDateEdit(rangeWidget);
109 mEndDate->setDate(QDate::currentDate().addDays(365)); 109 mEndDate->setDate(QDate::currentDate().addDays(365));
110 rangeLayout->addWidget(mEndDate); 110 rangeLayout->addWidget(mEndDate);
111 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); 111 QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget );
112 rangeLayout->addWidget( (QWidget*)wt ); 112 rangeLayout->addWidget( (QWidget*)wt );
113 layout->addWidget(rangeWidget); 113 layout->addWidget(rangeWidget);
114 // Results list view 114 // Results list view
115 listView = new KOListView(mCalendar,topFrame); 115 listView = new KOListView(mCalendar,topFrame);
116 layout->addWidget(listView); 116 layout->addWidget(listView);
117 117
118 listView->readSettings(KOGlobals::config(),"SearchListView Layout"); 118 listView->readSettings(KOGlobals::config(),"SearchListView Layout");
119 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); 119 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
120 120
121 setCaption( i18n("KO/Pi Find: ")); 121 setCaption( i18n("KO/Pi Find: "));
122#ifdef DESKTOP_VERSION 122#ifdef DESKTOP_VERSION
123 OkButton = new QPushButton( i18n("Close"), this ); 123 OkButton = new QPushButton( i18n("Close"), this );
124 connect(OkButton,SIGNAL(clicked()),SLOT(hide())); 124 connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
125#endif 125#endif
126} 126}
127 127
128SearchDialog::~SearchDialog() 128SearchDialog::~SearchDialog()
129{ 129{
130 130
131} 131}
132void SearchDialog::raiseAndSelect()
133{
134
135 static int currentState = 0;
136
137 if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() )
138 currentState = 0;
139 int newState = 0;
140 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
141 newState = VIEW_J_VIEW;
142 }
143 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
144 newState = VIEW_T_VIEW;
145 }
146 else {
147 newState = VIEW_A_VIEW;
148 }
149 if ( newState != currentState ) {
150 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
151 if ( ! mSearchJournal->isChecked() ) {
152 mSearchJournal->setChecked( true );
153 mSearchTodo->setChecked( false );
154 mSearchEvent->setChecked( false );
155 }
156 }
157 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
158 if ( ! mSearchTodo->isChecked() ) {
159 mSearchTodo->setChecked( true );
160 mSearchJournal->setChecked( false );
161 mSearchEvent->setChecked( false );
162 }
163 }
164 else {
165 if ( ! mSearchEvent->isChecked() ) {
166 mSearchEvent->setChecked( true );
167 mSearchJournal->setChecked( false );
168 mSearchTodo->setChecked( false );
169 }
170 }
171 }
172 currentState = newState;
173 raise();
174}
132void SearchDialog::setFocusToList() 175void SearchDialog::setFocusToList()
133{ 176{
134 listView->resetFocus(); 177 listView->resetFocus();
135} 178}
136void SearchDialog::accept() 179void SearchDialog::accept()
137{ 180{
138 doSearch(); 181 doSearch();
139} 182}
140void SearchDialog::updateList() 183void SearchDialog::updateList()
141{ 184{
142 //listView->updateList(); 185 //listView->updateList();
143 if ( isVisible() ) { 186 if ( isVisible() ) {
144 updateView(); 187 updateView();
145 //qDebug("SearchDialog::updated "); 188 //qDebug("SearchDialog::updated ");
146 } 189 }
147 else { 190 else {
148 listView->clear(); 191 listView->clear();
149 //qDebug("SearchDialog::cleared "); 192 //qDebug("SearchDialog::cleared ");
150 193
151 } 194 }
152} 195}
153void SearchDialog::searchTextChanged( const QString &_text ) 196void SearchDialog::searchTextChanged( const QString &_text )
154{ 197{
155#if 0 198#if 0
156 enableButton( KDialogBase::User1, !_text.isEmpty() ); 199 enableButton( KDialogBase::User1, !_text.isEmpty() );
157#endif 200#endif
158} 201}
159 202
160void SearchDialog::doSearch() 203void SearchDialog::doSearch()
161{ 204{
162 QRegExp re; 205 QRegExp re;
163 206
@@ -172,65 +215,65 @@ void SearchDialog::doSearch()
172 if (!re.isValid() ) { 215 if (!re.isValid() ) {
173 KMessageBox::sorry(this, 216 KMessageBox::sorry(this,
174 i18n("Invalid search expression,\ncannot perform " 217 i18n("Invalid search expression,\ncannot perform "
175 "the search.\nPlease enter a search expression\n" 218 "the search.\nPlease enter a search expression\n"
176 "using the wildcard characters\n '*' and '?'" 219 "using the wildcard characters\n '*' and '?'"
177 "where needed.")); 220 "where needed."));
178 return; 221 return;
179 } 222 }
180 223
181 search(re); 224 search(re);
182 225
183 listView->setStartDate( mStartDate->date() ); 226 listView->setStartDate( mStartDate->date() );
184 listView->showEvents(mMatchedEvents); 227 listView->showEvents(mMatchedEvents);
185 listView->addTodos(mMatchedTodos); 228 listView->addTodos(mMatchedTodos);
186 listView->addJournals(mMatchedJournals); 229 listView->addJournals(mMatchedJournals);
187 230
188 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { 231 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) {
189 setCaption(i18n("No items found. Use '*' and '?' where needed.")); 232 setCaption(i18n("No items found. Use '*' and '?' where needed."));
190 } else { 233 } else {
191 QString mess; 234 QString mess;
192 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); 235 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() );
193 setCaption( i18n("KO/Pi Find: ") + mess); 236 setCaption( i18n("KO/Pi Find: ") + mess);
194 237
195 } 238 }
196 searchEdit->setFocus(); 239 searchEdit->setFocus();
197} 240}
198void SearchDialog::updateConfig() 241void SearchDialog::updateConfig()
199{ 242{
200 listView->updateConfig(); 243 listView->updateConfig();
201} 244}
202void SearchDialog::updateView() 245void SearchDialog::updateView()
203{ 246{
204 247 //qDebug("SearchDialog::updateView() %d ", isVisible());
205 QRegExp re; 248 QRegExp re;
206 re.setWildcard(true); // most people understand these better. 249 re.setWildcard(true); // most people understand these better.
207 re.setCaseSensitive(false); 250 re.setCaseSensitive(false);
208 re.setPattern(searchEdit->text()); 251 re.setPattern(searchEdit->text());
209 if (re.isValid()) { 252 if (re.isValid()) {
210 search(re); 253 search(re);
211 } else { 254 } else {
212 mMatchedEvents.clear(); 255 mMatchedEvents.clear();
213 mMatchedTodos.clear(); 256 mMatchedTodos.clear();
214 mMatchedJournals.clear(); 257 mMatchedJournals.clear();
215 } 258 }
216 listView->setStartDate( mStartDate->date() ); 259 listView->setStartDate( mStartDate->date() );
217 listView->showEvents(mMatchedEvents); 260 listView->showEvents(mMatchedEvents);
218 listView->addTodos(mMatchedTodos); 261 listView->addTodos(mMatchedTodos);
219 listView->addJournals(mMatchedJournals); 262 listView->addJournals(mMatchedJournals);
220} 263}
221 264
222void SearchDialog::search(const QRegExp &re) 265void SearchDialog::search(const QRegExp &re)
223{ 266{
224 QPtrList<Event> events = mCalendar->events( mStartDate->date(), 267 QPtrList<Event> events = mCalendar->events( mStartDate->date(),
225 mEndDate->date(), 268 mEndDate->date(),
226 false /*mInclusiveCheck->isChecked()*/ ); 269 false /*mInclusiveCheck->isChecked()*/ );
227 270
228 mMatchedEvents.clear(); 271 mMatchedEvents.clear();
229 if ( mSearchEvent->isChecked() ) { 272 if ( mSearchEvent->isChecked() ) {
230 Event *ev; 273 Event *ev;
231 for(ev=events.first();ev;ev=events.next()) { 274 for(ev=events.first();ev;ev=events.next()) {
232 if (mSummaryCheck->isChecked()) { 275 if (mSummaryCheck->isChecked()) {
233#if QT_VERSION >= 0x030000 276#if QT_VERSION >= 0x030000
234 if (re.search(ev->summary()) != -1) 277 if (re.search(ev->summary()) != -1)
235#else 278#else
236 if (re.match(ev->summary()) != -1) 279 if (re.match(ev->summary()) != -1)
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index b730ed5..4559d20 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -20,64 +20,65 @@
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#ifndef SEARCHDIALOG_H 24#ifndef SEARCHDIALOG_H
25#define SEARCHDIALOG_H 25#define SEARCHDIALOG_H
26 26
27#include <qregexp.h> 27#include <qregexp.h>
28 28
29#include <kdialogbase.h> 29#include <kdialogbase.h>
30#include <qvbox.h> 30#include <qvbox.h>
31 31
32#include <libkcal/calendar.h> 32#include <libkcal/calendar.h>
33 33
34#include "kolistview.h" 34#include "kolistview.h"
35 35
36class KDateEdit; 36class KDateEdit;
37class QCheckBox; 37class QCheckBox;
38class QLineEdit; 38class QLineEdit;
39class KLineEdit; 39class KLineEdit;
40class QLabel; 40class QLabel;
41class CalendarView; 41class CalendarView;
42 42
43using namespace KCal; 43using namespace KCal;
44class SearchDialog : public QVBox 44class SearchDialog : public QVBox
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 public: 47 public:
48 SearchDialog(Calendar *calendar,CalendarView *parent=0); 48 SearchDialog(Calendar *calendar,CalendarView *parent=0);
49 virtual ~SearchDialog(); 49 virtual ~SearchDialog();
50 KOListView *listview(){ return listView;} 50 KOListView *listview(){ return listView;}
51 void updateView(); 51 void updateView();
52 void raiseAndSelect();
52 53
53 public slots: 54 public slots:
54 void changeEventDisplay(Event *, int) { updateView(); } 55 void changeEventDisplay(Event *, int) { updateView(); }
55 void updateConfig(); 56 void updateConfig();
56 void updateList(); 57 void updateList();
57 protected slots: 58 protected slots:
58 void setFocusToList(); 59 void setFocusToList();
59 void accept(); 60 void accept();
60 void doSearch(); 61 void doSearch();
61 void searchTextChanged( const QString &_text ); 62 void searchTextChanged( const QString &_text );
62 63
63 signals: 64 signals:
64 void showEventSignal(Event *); 65 void showEventSignal(Event *);
65 void editEventSignal(Event *); 66 void editEventSignal(Event *);
66 void deleteEventSignal(Event *); 67 void deleteEventSignal(Event *);
67 68
68 private: 69 private:
69 void search(const QRegExp &); 70 void search(const QRegExp &);
70 71
71 Calendar *mCalendar; 72 Calendar *mCalendar;
72 73
73 QPtrList<Event> mMatchedEvents; 74 QPtrList<Event> mMatchedEvents;
74 QPtrList<Todo> mMatchedTodos; 75 QPtrList<Todo> mMatchedTodos;
75 QPtrList<Journal> mMatchedJournals; 76 QPtrList<Journal> mMatchedJournals;
76 77
77 QLabel *searchLabel; 78 QLabel *searchLabel;
78 KLineEdit *searchEdit; 79 KLineEdit *searchEdit;
79 KOListView *listView; 80 KOListView *listView;
80 81
81 KDateEdit *mStartDate; 82 KDateEdit *mStartDate;
82 KDateEdit *mEndDate; 83 KDateEdit *mEndDate;
83 QCheckBox *mSummaryCheck; 84 QCheckBox *mSummaryCheck;
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index c60b566..029f14b 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -83,65 +83,65 @@ KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o,
83 mMouseDown = false; 83 mMouseDown = false;
84 //setMaximumHeight( 5 ); // test only 84 //setMaximumHeight( 5 ); // test only
85} 85}
86 86
87QSize KDGanttSplitterHandle::sizeHint() const 87QSize KDGanttSplitterHandle::sizeHint() const
88{ 88{
89 return mSizeHint; 89 return mSizeHint;
90} 90}
91 91
92void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) 92void KDGanttSplitterHandle::setOrientation( Qt::Orientation o )
93{ 93{
94 orient = o; 94 orient = o;
95#ifndef QT_NO_CURSOR 95#ifndef QT_NO_CURSOR
96 if ( o == KDGanttMinimizeSplitter::Horizontal ) 96 if ( o == KDGanttMinimizeSplitter::Horizontal )
97 setCursor( splitHCursor ); 97 setCursor( splitHCursor );
98 else 98 else
99 setCursor( splitVCursor ); 99 setCursor( splitVCursor );
100#endif 100#endif
101} 101}
102 102
103 103
104void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) 104void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e )
105{ 105{
106 updateCursor( e->pos() ); 106 updateCursor( e->pos() );
107 if ( !(e->state()&LeftButton) ) 107 if ( !(e->state()&LeftButton) )
108 return; 108 return;
109 109
110 if ( _activeButton != 0) 110 if ( _activeButton != 0)
111 return; 111 return;
112 112
113 QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) 113 QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos()))
114 - mouseOffset; 114 - mouseOffset;
115 if ( true /*opaque()*/ ) { 115 if ( opaque() ) {
116 s->moveSplitter( pos, id() ); 116 s->moveSplitter( pos, id() );
117 } else { 117 } else {
118 int min = pos; int max = pos; 118 int min = pos; int max = pos;
119 s->getRange( id(), &min, &max ); 119 s->getRange( id(), &min, &max );
120 s->setRubberband( QMAX( min, QMIN(max, pos ))); 120 s->setRubberband( QMAX( min, QMIN(max, pos )));
121 } 121 }
122 _collapsed = false; 122 _collapsed = false;
123} 123}
124 124
125void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) 125void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e )
126{ 126{
127 if ( e->button() == LeftButton ) { 127 if ( e->button() == LeftButton ) {
128 _activeButton = onButton( e->pos() ); 128 _activeButton = onButton( e->pos() );
129 mouseOffset = s->pick(e->pos()); 129 mouseOffset = s->pick(e->pos());
130 mMouseDown = true; 130 mMouseDown = true;
131 repaint(); 131 repaint();
132 updateCursor( e->pos() ); 132 updateCursor( e->pos() );
133 } 133 }
134} 134}
135 135
136void KDGanttSplitterHandle::updateCursor( const QPoint& p) 136void KDGanttSplitterHandle::updateCursor( const QPoint& p)
137{ 137{
138 if ( onButton( p ) != 0 ) { 138 if ( onButton( p ) != 0 ) {
139 setCursor( arrowCursor ); 139 setCursor( arrowCursor );
140 } 140 }
141 else { 141 else {
142 if ( orient == KDGanttMinimizeSplitter::Horizontal ) 142 if ( orient == KDGanttMinimizeSplitter::Horizontal )
143 setCursor( splitHCursor ); 143 setCursor( splitHCursor );
144 else 144 else
145 setCursor( splitVCursor ); 145 setCursor( splitVCursor );
146 } 146 }
147} 147}
@@ -454,64 +454,69 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *n
454 and \a name arguments being passed on to the QFrame constructor. 454 and \a name arguments being passed on to the QFrame constructor.
455*/ 455*/
456KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name ) 456KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name )
457 :QFrame(parent,name,WPaintUnclipped) 457 :QFrame(parent,name,WPaintUnclipped)
458{ 458{
459 mFirstHandle = 0; 459 mFirstHandle = 0;
460#if QT_VERSION >= 232 460#if QT_VERSION >= 232
461 orient = o; 461 orient = o;
462 init(); 462 init();
463#endif 463#endif
464} 464}
465 465
466/*! 466/*!
467 Destroys the splitter and any children. 467 Destroys the splitter and any children.
468*/ 468*/
469KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() 469KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter()
470{ 470{
471#if QT_VERSION >= 232 471#if QT_VERSION >= 232
472 data->list.setAutoDelete( TRUE ); 472 data->list.setAutoDelete( TRUE );
473 delete data; 473 delete data;
474#endif 474#endif
475} 475}
476 476
477 477
478#if QT_VERSION >= 232 478#if QT_VERSION >= 232
479void KDGanttMinimizeSplitter::init() 479void KDGanttMinimizeSplitter::init()
480{ 480{
481 data = new QSplitterData; 481 data = new QSplitterData;
482 if ( orient == Horizontal ) 482 if ( orient == Horizontal )
483 setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); 483 setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) );
484 else 484 else
485 setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); 485 setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) );
486#ifndef DESKTOP_VERSION
487 setOpaqueResize( false );
488#else
489 setOpaqueResize( true );
490#endif
486} 491}
487#endif 492#endif
488 493
489 494
490void KDGanttMinimizeSplitter::toggle() 495void KDGanttMinimizeSplitter::toggle()
491{ 496{
492 if ( mFirstHandle ) 497 if ( mFirstHandle )
493 mFirstHandle->toggle(); 498 mFirstHandle->toggle();
494 else 499 else
495 qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available "); 500 qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available ");
496 501
497} 502}
498 503
499 504
500/*! 505/*!
501 \brief the orientation of the splitter 506 \brief the orientation of the splitter
502 507
503 By default the orientation is horizontal (the widgets are side by side). 508 By default the orientation is horizontal (the widgets are side by side).
504 The possible orientations are Qt:Vertical and Qt::Horizontal (the default). 509 The possible orientations are Qt:Vertical and Qt::Horizontal (the default).
505*/ 510*/
506void KDGanttMinimizeSplitter::setOrientation( Orientation o ) 511void KDGanttMinimizeSplitter::setOrientation( Orientation o )
507{ 512{
508#if QT_VERSION >= 232 513#if QT_VERSION >= 232
509 if ( orient == o ) 514 if ( orient == o )
510 return; 515 return;
511 orient = o; 516 orient = o;
512 517
513 if ( orient == Horizontal ) 518 if ( orient == Horizontal )
514 setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); 519 setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
515 else 520 else
516 setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 521 setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
517 522
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index f05b91b..80a83e0 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -17,64 +17,79 @@ int KApplication::random()
17} 17}
18 18
19//US 19//US
20QString KApplication::randomString(int length) 20QString KApplication::randomString(int length)
21{ 21{
22 if (length <=0 ) return QString::null; 22 if (length <=0 ) return QString::null;
23 23
24 QString str; 24 QString str;
25 while (length--) 25 while (length--)
26 { 26 {
27 int r=random() % 62; 27 int r=random() % 62;
28 r+=48; 28 r+=48;
29 if (r>57) r+=7; 29 if (r>57) r+=7;
30 if (r>90) r+=6; 30 if (r>90) r+=6;
31 str += char(r); 31 str += char(r);
32 // so what if I work backwards? 32 // so what if I work backwards?
33 } 33 }
34 return str; 34 return str;
35} 35}
36int KApplication::execDialog( QDialog* d ) 36int KApplication::execDialog( QDialog* d )
37{ 37{
38 if (QApplication::desktop()->width() <= 640 ) 38 if (QApplication::desktop()->width() <= 640 )
39 d->showMaximized(); 39 d->showMaximized();
40 else 40 else
41 ;//d->resize( 800, 600 ); 41 ;//d->resize( 800, 600 );
42 return d->exec(); 42 return d->exec();
43} 43}
44void KApplication::showLicence() 44void KApplication::showLicence()
45{ 45{
46 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); 46 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" );
47} 47}
48 48
49void KApplication::testCoords( int* x, int* y, int* wid, int * hei )
50{
51 int dWid = QApplication::desktop()->width() ;
52 int dHei = QApplication::desktop()->height();
53 if ( *x + *wid > dWid ) {
54 *x = 0;
55 if ( *wid > dWid )
56 *wid = dWid;
57 }
58 if ( *y + *hei > dHei ) {
59 *y = 0;
60 if ( *hei > dHei )
61 *hei = dHei;
62 }
63}
49void KApplication::showFile(QString caption, QString fn) 64void KApplication::showFile(QString caption, QString fn)
50{ 65{
51 QString text; 66 QString text;
52 QString fileName; 67 QString fileName;
53#ifndef DESKTOP_VERSION 68#ifndef DESKTOP_VERSION
54 fileName = getenv("QPEDIR"); 69 fileName = getenv("QPEDIR");
55 fileName += "/pics/" + fn ; 70 fileName += "/pics/" + fn ;
56#else 71#else
57 fileName = qApp->applicationDirPath () + "/" + fn; 72 fileName = qApp->applicationDirPath () + "/" + fn;
58#endif 73#endif
59 QFile file( fileName ); 74 QFile file( fileName );
60 if (!file.open( IO_ReadOnly ) ) { 75 if (!file.open( IO_ReadOnly ) ) {
61 return ; 76 return ;
62 } 77 }
63 QTextStream ts( &file ); 78 QTextStream ts( &file );
64 text = ts.read(); 79 text = ts.read();
65 file.close(); 80 file.close();
66 KApplication::showText( caption, text ); 81 KApplication::showText( caption, text );
67 82
68} 83}
69 84
70bool KApplication::convert2latin1(QString fileName) 85bool KApplication::convert2latin1(QString fileName)
71{ 86{
72 QString text; 87 QString text;
73 QFile file( fileName ); 88 QFile file( fileName );
74 if (!file.open( IO_ReadOnly ) ) { 89 if (!file.open( IO_ReadOnly ) ) {
75 return false; 90 return false;
76 91
77 } 92 }
78 QTextStream ts( &file ); 93 QTextStream ts( &file );
79 ts.setEncoding( QTextStream::UnicodeUTF8 ); 94 ts.setEncoding( QTextStream::UnicodeUTF8 );
80 text = ts.read(); 95 text = ts.read();
diff --git a/microkde/kapplication.h b/microkde/kapplication.h
index 497ec2f..f7eb1ef 100644
--- a/microkde/kapplication.h
+++ b/microkde/kapplication.h
@@ -1,30 +1,31 @@
1#ifndef MINIKDE_KAPPLICATION_H 1#ifndef MINIKDE_KAPPLICATION_H
2#define MINIKDE_KAPPLICATION_H 2#define MINIKDE_KAPPLICATION_H
3 3
4#include "qstring.h" 4#include "qstring.h"
5#include <qdialog.h> 5#include <qdialog.h>
6#ifdef QDialog 6#ifdef QDialog
7#undef QDialog 7#undef QDialog
8#endif 8#endif
9 9
10class KApplication 10class KApplication
11{ 11{
12 public: 12 public:
13 static int random(); 13 static int random();
14 14
15//US 15//US
16 /** 16 /**
17 * Generates a random string. It operates in the range [A-Za-z0-9] 17 * Generates a random string. It operates in the range [A-Za-z0-9]
18 * @param length Generate a string of this length. 18 * @param length Generate a string of this length.
19 * @return the random string 19 * @return the random string
20 */ 20 */
21 static QString randomString(int length); 21 static QString randomString(int length);
22 static int execDialog( QDialog* ); 22 static int execDialog( QDialog* );
23 static void showLicence(); 23 static void showLicence();
24 static void testCoords( int* x, int* y, int* wid, int * hei );
24 static void showFile(QString caption, QString file); 25 static void showFile(QString caption, QString file);
25 static void showText(QString caption, QString text); 26 static void showText(QString caption, QString text);
26 static bool convert2latin1(QString file); 27 static bool convert2latin1(QString file);
27}; 28};
28 29
29 30
30#endif 31#endif
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp
index 3d1889f..a3b7fff 100644
--- a/microkde/kresources/factory.cpp
+++ b/microkde/kresources/factory.cpp
@@ -51,77 +51,77 @@ Factory *Factory::self( const QString& resourceFamily)
51 51
52 factory = mSelves->find( resourceFamily ); 52 factory = mSelves->find( resourceFamily );
53 53
54 if ( !factory ) { 54 if ( !factory ) {
55 factory = new Factory( resourceFamily); 55 factory = new Factory( resourceFamily);
56 mSelves->insert( resourceFamily, factory ); 56 mSelves->insert( resourceFamily, factory );
57 } 57 }
58 58
59 return factory; 59 return factory;
60} 60}
61 61
62Factory::Factory( const QString& resourceFamily) : 62Factory::Factory( const QString& resourceFamily) :
63 mResourceFamily( resourceFamily ) 63 mResourceFamily( resourceFamily )
64{ 64{
65//US so far we have three types available for resourceFamily "contact" 65//US so far we have three types available for resourceFamily "contact"
66// and that are "file", "dir", "ldap" 66// and that are "file", "dir", "ldap"
67/*US 67/*US
68 68
69 KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin", QString( "[X-KDE-ResourceFamily] == '%1'" ) 69 KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin", QString( "[X-KDE-ResourceFamily] == '%1'" )
70 .arg( resourceFamily ) ); 70 .arg( resourceFamily ) );
71 KTrader::OfferList::ConstIterator it; 71 KTrader::OfferList::ConstIterator it;
72 for ( it = plugins.begin(); it != plugins.end(); ++it ) { 72 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
73 QVariant type = (*it)->property( "X-KDE-ResourceType" ); 73 QVariant type = (*it)->property( "X-KDE-ResourceType" );
74 if ( !type.toString().isEmpty() ) 74 if ( !type.toString().isEmpty() )
75 mTypeMap.insert( type.toString(), *it ); 75 mTypeMap.insert( type.toString(), *it );
76 } 76 }
77*/ 77*/
78 78
79//US new 79//US new
80 PluginInfo* info = new PluginInfo; 80 PluginInfo* info = new PluginInfo;
81 info->library = "microkabc_file"; 81 info->library = "microkabc_file";
82 info->nameLabel = i18n( "file" ); 82 info->nameLabel = i18n( "file" );
83 info->descriptionLabel = i18n( "Choose one file" ); 83 info->descriptionLabel = i18n( "One file" );
84 mTypeMap.insert( "file", info ); 84 mTypeMap.insert( "file", info );
85 85
86 info = new PluginInfo; 86 info = new PluginInfo;
87 info->library = "microkabc_dir"; 87 info->library = "microkabc_dir";
88 info->nameLabel = i18n( "dir" ); 88 info->nameLabel = i18n( "dir" );
89 info->descriptionLabel = i18n( "Choose a directory with may files" ); 89 info->descriptionLabel = i18n( "A directory with many files" );
90 mTypeMap.insert( "dir", info ); 90 mTypeMap.insert( "dir", info );
91 91
92 info = new PluginInfo; 92 info = new PluginInfo;
93 info->library = "microkabc_ldap"; 93 info->library = "microkabc_ldap";
94 info->nameLabel = i18n( "ldap" ); 94 info->nameLabel = i18n( "ldap" );
95 info->descriptionLabel = i18n( "No description available" ); 95 info->descriptionLabel = i18n( "Connect to a directory server" );
96 mTypeMap.insert( "ldap", info ); 96 mTypeMap.insert( "ldap", info );
97 97
98 //US add opie plugin only, if the library exists. 98 //US add opie plugin only, if the library exists.
99 /*US 99 /*US
100 QString libname = "microkabc_opie"; 100 QString libname = "microkabc_opie";
101 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); 101 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
102 if ( !path.isEmpty() ) 102 if ( !path.isEmpty() )
103 { 103 {
104 info = new PluginInfo; 104 info = new PluginInfo;
105 info->library = libname; 105 info->library = libname;
106 info->nameLabel = i18n( "opie" ); 106 info->nameLabel = i18n( "opie" );
107 info->descriptionLabel = i18n( "Opie PIM Addressbook." ); 107 info->descriptionLabel = i18n( "Opie PIM Addressbook." );
108 mTypeMap.insert( "opie", info ); 108 mTypeMap.insert( "opie", info );
109 } 109 }
110 */ 110 */
111 //US add qtopia plugin only, if the library exists. 111 //US add qtopia plugin only, if the library exists.
112 QString libname = "microkabc_qtopia"; 112 QString libname = "microkabc_qtopia";
113 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); 113 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
114 if ( !path.isEmpty() ) 114 if ( !path.isEmpty() )
115 { 115 {
116 info = new PluginInfo; 116 info = new PluginInfo;
117 info->library = libname; 117 info->library = libname;
118 info->nameLabel = i18n( "qtopia" ); 118 info->nameLabel = i18n( "qtopia" );
119 info->descriptionLabel = i18n( "Qtopia PIM Addressbook." ); 119 info->descriptionLabel = i18n( "Qtopia PIM Addressbook." );
120 mTypeMap.insert( "qtopia", info ); 120 mTypeMap.insert( "qtopia", info );
121 } 121 }
122 122
123 //US add sharp plugin only, if the library exists. 123 //US add sharp plugin only, if the library exists.
124 libname = "microkabc_sharpdtm"; 124 libname = "microkabc_sharpdtm";
125 path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); 125 path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
126 if ( !path.isEmpty() ) 126 if ( !path.isEmpty() )
127 { 127 {