summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolocationbox.cpp2
-rw-r--r--korganizer/kolocationbox.h2
-rw-r--r--korganizer/mainwindow.cpp4
3 files changed, 4 insertions, 4 deletions
diff --git a/korganizer/kolocationbox.cpp b/korganizer/kolocationbox.cpp
index f8fee2e..35a8123 100644
--- a/korganizer/kolocationbox.cpp
+++ b/korganizer/kolocationbox.cpp
@@ -1,96 +1,96 @@
1/* 1/*
2 Copyright (c) 2004 Dirk Loesche <dirk.loesche@bigfoot.de> 2 Copyright (c) 2004 Dirk Loesche <dirk.loesche@bigfoot.de>
3 3
4 This file is part of KOrganizer/PI 4 This file is part of KOrganizer/PI
5 KOrganizer Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 5 KOrganizer Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
6 KOrganizer/PI Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net> 6 KOrganizer/PI Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or 10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version. 11 (at your option) any later version.
12 12
13 This program is distributed in the hope that it will be useful, 13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 16 GNU General Public License for more details.
17 17
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 21
22 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
25*/ 25*/
26 26
27#include "kolocationbox.h" 27#include "kolocationbox.h"
28#include <qstring.h> 28#include <qstring.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include <qapplication.h> 30#include <qapplication.h>
31 31
32 32
33KOLocationBox::KOLocationBox( bool rw , QWidget *parent , int _maxItems) : 33KOLocationBox::KOLocationBox( bool rw , QWidget *parent , int _maxItems) :
34 QComboBox( rw , parent ) 34 QComboBox( rw , parent )
35{ 35{
36 maxItems = _maxItems; 36 maxItems = _maxItems;
37 maxItems = 50; // sorry - hack from me to set maxitems globally to 30 37 maxItems = 50; // sorry - hack from me to set maxitems globally to 30
38 setInsertionPolicy(AtTop); 38 setInsertionPolicy(AtTop);
39 setDuplicatesEnabled( FALSE ); 39 setDuplicatesEnabled( FALSE );
40 setMaxCount( maxItems ); 40 setMaxCount( maxItems );
41 setAutoCompletion( TRUE ); 41 setAutoCompletion( TRUE );
42 42
43} 43}
44 44
45KOLocationBox::~KOLocationBox() 45KOLocationBox::~KOLocationBox()
46{ 46{
47} 47}
48 48
49void KOLocationBox::load(int what) 49void KOLocationBox::load(int what)
50{ 50{
51 clear(); 51 clear();
52 // qDebug("load %d ",what ); 52 // qDebug("load %d ",what );
53 switch(what) { 53 switch(what) {
54 case LOCATION: 54 case LOCATION:
55 insertStringList( KOPrefs::instance()->mLocationDefaults, 0 ); 55 insertStringList( KOPrefs::instance()->mLocationDefaults, 0 );
56// insertStringList( KOPrefs::instance()->mLocationUserDefaults, 0 ); 56// insertStringList( KOPrefs::instance()->mLocationUserDefaults, 0 );
57 break; // don't disable 57 break; // don't disable
58 case SUMMARYEVENT: 58 case SUMMARYEVENT:
59 insertStringList( KOPrefs::instance()->mEventSummaryUser, 0 ); 59 insertStringList( KOPrefs::instance()->mEventSummaryUser, 0 );
60 break; // don't disable 60 break; // don't disable
61 case SUMMARYTODO: 61 case SUMMARYTODO:
62 insertStringList( KOPrefs::instance()->mTodoSummaryUser, 0 ); 62 insertStringList( KOPrefs::instance()->mTodoSummaryUser, 0 );
63 break; // don't disable 63 break; // don't disable
64 } 64 }
65} 65}
66 66
67void KOLocationBox::save(int what) 67void KOLocationBox::save(int what)
68{ 68{
69 strlist.clear(); 69 strlist.clear();
70 for( int l = 0; l < count() ; l++ ) { 70 for( int l = 0; l < count() ; l++ ) {
71 strlist << text( l ); 71 strlist << text( l );
72 } 72 }
73 // strlist.sort(); 73 // strlist.sort();
74 QString currentLine = lineEdit()->text(); 74 QString currentLine = lineEdit()->text();
75 if ( !strlist.contains( currentLine ) ) 75 if ( !strlist.contains( currentLine ) )
76 strlist.prepend( currentLine ); 76 strlist.prepend( currentLine );
77 // qDebug("save %d ", what); 77 // qDebug("save %d ", what);
78 switch(what) { 78 switch(what) {
79 case LOCATION: 79 case LOCATION:
80 KOPrefs::instance()->mLocationDefaults = strlist; 80 KOPrefs::instance()->mLocationDefaults = strlist;
81// KOPrefs::instance()->mLocationUserDefaults = strlist; 81// KOPrefs::instance()->mLocationUserDefaults = strlist;
82 break; // don't disable 82 break; // don't disable
83 case SUMMARYEVENT: 83 case SUMMARYEVENT:
84 KOPrefs::instance()->mEventSummaryUser = strlist; 84 KOPrefs::instance()->mEventSummaryUser = strlist;
85 break; // don't disable 85 break; // don't disable
86 case SUMMARYTODO: 86 case SUMMARYTODO:
87 KOPrefs::instance()->mTodoSummaryUser = strlist; 87 KOPrefs::instance()->mTodoSummaryUser = strlist;
88 break; // don't disable 88 break; // don't disable
89 } 89 }
90} 90}
91 91
92void KOLocationBox::clearItems(int what) 92void KOLocationBox::clearItems(int what)
93{ 93{
94 clear(); 94 clear();
95 save(what); 95 save(what);
96} 96}
diff --git a/korganizer/kolocationbox.h b/korganizer/kolocationbox.h
index be8ea86..b604d33 100644
--- a/korganizer/kolocationbox.h
+++ b/korganizer/kolocationbox.h
@@ -1,55 +1,55 @@
1/* 1/*
2 File Copyright (c) 2004 Dirk Loesche <dirk.loesche@bigfoot.de> 2 File Copyright (c) 2004 Dirk Loesche <dirk.loesche@bigfoot.de>
3 3
4 This file is part of KOrganizer/PI 4 This file is part of KOrganizer/PI
5 KOrganizer Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 5 KOrganizer Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
6 KOrganizer/PI Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net> 6 KOrganizer/PI Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.info>
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or 10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version. 11 (at your option) any later version.
12 12
13 This program is distributed in the hope that it will be useful, 13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 16 GNU General Public License for more details.
17 17
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 21
22 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
25*/ 25*/
26 26
27#ifndef KOLOCATIONBOX_H 27#ifndef KOLOCATIONBOX_H
28#define KOLOCATIONBOX_H 28#define KOLOCATIONBOX_H
29 29
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include "koprefs.h" 31#include "koprefs.h"
32 32
33class KOLocationBox : public QComboBox 33class KOLocationBox : public QComboBox
34{ 34{
35 public: 35 public:
36 KOLocationBox( bool rw , QWidget *parent , int _maxItems ); 36 KOLocationBox( bool rw , QWidget *parent , int _maxItems );
37 virtual ~KOLocationBox(); 37 virtual ~KOLocationBox();
38 38
39 enum {LOCATION, SUMMARYEVENT, SUMMARYTODO}; 39 enum {LOCATION, SUMMARYEVENT, SUMMARYTODO};
40 40
41 public slots: 41 public slots:
42 void load(int); 42 void load(int);
43 void save(int); 43 void save(int);
44 void clearItems(int); // clear listbox and config rc items 44 void clearItems(int); // clear listbox and config rc items
45 45
46 protected: 46 protected:
47// void focusOutEvent( QFocusEvent * ); 47// void focusOutEvent( QFocusEvent * );
48// void timerEvent( QTimerEvent * ); 48// void timerEvent( QTimerEvent * );
49 49
50 private: 50 private:
51 int maxItems; // maximal listbox items 51 int maxItems; // maximal listbox items
52 QStringList strlist; // temporary stringlist 52 QStringList strlist; // temporary stringlist
53}; 53};
54 54
55#endif 55#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 4f71788..bd9efc8 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -894,841 +894,841 @@ void MainWindow::initActions()
894 action->addTo( beamMenu_X ); 894 action->addTo( beamMenu_X );
895 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 895 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
896 896
897 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 897 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
898 this ); 898 this );
899 action->addTo( beamMenu_X ); 899 action->addTo( beamMenu_X );
900 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 900 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
901 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 901 importMenu->insertItem( i18n("Beam"), beamMenu_X );
902#else 902#else
903 //importMenu->insertSeparator(); 903 //importMenu->insertSeparator();
904 icon = loadPixmap( pathString + "print" ); 904 icon = loadPixmap( pathString + "print" );
905 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 905 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
906 action->addTo( beamMenu_X ); 906 action->addTo( beamMenu_X );
907 connect( action, SIGNAL( activated() ), 907 connect( action, SIGNAL( activated() ),
908 this, SLOT( printCal() ) ); 908 this, SLOT( printCal() ) );
909 909
910 icon = loadPixmap( pathString + "print" ); 910 icon = loadPixmap( pathString + "print" );
911 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 911 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
912 action->addTo( beamMenu_X ); 912 action->addTo( beamMenu_X );
913 connect( action, SIGNAL( activated() ), 913 connect( action, SIGNAL( activated() ),
914 this, SLOT( printSel() ) ); 914 this, SLOT( printSel() ) );
915 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 915 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
916 action->addTo( beamMenu_X ); 916 action->addTo( beamMenu_X );
917 connect( action, SIGNAL( activated() ), 917 connect( action, SIGNAL( activated() ),
918 mView->viewManager(), SIGNAL( printWNV() ) ); 918 mView->viewManager(), SIGNAL( printWNV() ) );
919 importMenu->insertItem( i18n("Print"), beamMenu_X ); 919 importMenu->insertItem( i18n("Print"), beamMenu_X );
920#endif 920#endif
921 importMenu->insertSeparator(); 921 importMenu->insertSeparator();
922 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 922 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
923 this ); 923 this );
924 action->addTo( importMenu ); 924 action->addTo( importMenu );
925 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 925 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
926 importMenu->insertSeparator(); 926 importMenu->insertSeparator();
927 action = new QAction( "beam all", i18n("Save"), 0, 927 action = new QAction( "beam all", i18n("Save"), 0,
928 this ); 928 this );
929 action->addTo( importMenu ); 929 action->addTo( importMenu );
930 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 930 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
931 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 931 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
932 this ); 932 this );
933 action->addTo( importMenu ); 933 action->addTo( importMenu );
934 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 934 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
935 935
936 //menuBar->insertItem( "Configure",configureMenu ); 936 //menuBar->insertItem( "Configure",configureMenu );
937 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 937 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
938 icon = loadPixmap( "korganizer/korganizer" ); 938 icon = loadPixmap( "korganizer/korganizer" );
939 939
940 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 940 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
941 action->addTo( helpMenu ); 941 action->addTo( helpMenu );
942 connect( action, SIGNAL( activated() ), 942 connect( action, SIGNAL( activated() ),
943 SLOT( whatsNew() ) ); 943 SLOT( whatsNew() ) );
944 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 944 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
945 action->addTo( helpMenu ); 945 action->addTo( helpMenu );
946 connect( action, SIGNAL( activated() ), 946 connect( action, SIGNAL( activated() ),
947 SLOT( features() ) ); 947 SLOT( features() ) );
948 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 948 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
949 action->addTo( helpMenu ); 949 action->addTo( helpMenu );
950 connect( action, SIGNAL( activated() ), 950 connect( action, SIGNAL( activated() ),
951 SLOT( keyBindings() ) ); 951 SLOT( keyBindings() ) );
952 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 952 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
953 action->addTo( helpMenu ); 953 action->addTo( helpMenu );
954 connect( action, SIGNAL( activated() ), 954 connect( action, SIGNAL( activated() ),
955 SLOT( synchowto() ) ); 955 SLOT( synchowto() ) );
956 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 956 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
957 action->addTo( helpMenu ); 957 action->addTo( helpMenu );
958 connect( action, SIGNAL( activated() ), 958 connect( action, SIGNAL( activated() ),
959 SLOT( kdesynchowto() ) ); 959 SLOT( kdesynchowto() ) );
960 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 960 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
961 action->addTo( helpMenu ); 961 action->addTo( helpMenu );
962 connect( action, SIGNAL( activated() ), 962 connect( action, SIGNAL( activated() ),
963 SLOT( multisynchowto() ) ); 963 SLOT( multisynchowto() ) );
964 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 964 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
965 action->addTo( helpMenu ); 965 action->addTo( helpMenu );
966 connect( action, SIGNAL( activated() ), 966 connect( action, SIGNAL( activated() ),
967 SLOT( aboutAutoSaving() ) ); 967 SLOT( aboutAutoSaving() ) );
968 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 968 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
969 action->addTo( helpMenu ); 969 action->addTo( helpMenu );
970 connect( action, SIGNAL( activated() ), 970 connect( action, SIGNAL( activated() ),
971 SLOT( aboutKnownBugs() ) ); 971 SLOT( aboutKnownBugs() ) );
972 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 972 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
973 action->addTo( helpMenu ); 973 action->addTo( helpMenu );
974 connect( action, SIGNAL( activated() ), 974 connect( action, SIGNAL( activated() ),
975 SLOT( usertrans() ) ); 975 SLOT( usertrans() ) );
976 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 976 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
977 action->addTo( helpMenu ); 977 action->addTo( helpMenu );
978 connect( action, SIGNAL( activated() ), 978 connect( action, SIGNAL( activated() ),
979 SLOT( faq() ) ); 979 SLOT( faq() ) );
980 action = new QAction( "licence", i18n("Licence..."), 0, this ); 980 action = new QAction( "licence", i18n("Licence..."), 0, this );
981 action->addTo( helpMenu ); 981 action->addTo( helpMenu );
982 connect( action, SIGNAL( activated() ), 982 connect( action, SIGNAL( activated() ),
983 SLOT( licence() ) ); 983 SLOT( licence() ) );
984 action = new QAction( "about", i18n("About..."), 0, this ); 984 action = new QAction( "about", i18n("About..."), 0, this );
985 action->addTo( helpMenu ); 985 action->addTo( helpMenu );
986 connect( action, SIGNAL( activated() ), 986 connect( action, SIGNAL( activated() ),
987 SLOT( about() ) ); 987 SLOT( about() ) );
988 //menuBar->insertSeparator(); 988 //menuBar->insertSeparator();
989 989
990 // ****************************************************** 990 // ******************************************************
991 // menubar icons 991 // menubar icons
992 992
993 993
994 iconToolBar->setHorizontalStretchable (true ); 994 iconToolBar->setHorizontalStretchable (true );
995 //menuBar->insertItem( iconToolBar ); 995 //menuBar->insertItem( iconToolBar );
996 //xdays_action 996 //xdays_action
997 if (p-> mShowIconNewEvent) 997 if (p-> mShowIconNewEvent)
998 ne_action->addTo( iconToolBar ); 998 ne_action->addTo( iconToolBar );
999 if (p->mShowIconNewTodo ) 999 if (p->mShowIconNewTodo )
1000 nt_action->addTo( iconToolBar ); 1000 nt_action->addTo( iconToolBar );
1001 if (p-> mShowIconSearch) 1001 if (p-> mShowIconSearch)
1002 search_action->addTo( iconToolBar ); 1002 search_action->addTo( iconToolBar );
1003 if (p-> mShowIconNext) 1003 if (p-> mShowIconNext)
1004 whatsnext_action->addTo( iconToolBar ); 1004 whatsnext_action->addTo( iconToolBar );
1005 if (p-> mShowIconNextDays) 1005 if (p-> mShowIconNextDays)
1006 xdays_action->addTo( iconToolBar ); 1006 xdays_action->addTo( iconToolBar );
1007 if (p-> mShowIconList) 1007 if (p-> mShowIconList)
1008 showlist_action->addTo( iconToolBar ); 1008 showlist_action->addTo( iconToolBar );
1009 if (p-> mShowIconDay1) 1009 if (p-> mShowIconDay1)
1010 day1_action->addTo( iconToolBar ); 1010 day1_action->addTo( iconToolBar );
1011 if (p-> mShowIconDay5) 1011 if (p-> mShowIconDay5)
1012 day5_action->addTo( iconToolBar ); 1012 day5_action->addTo( iconToolBar );
1013 if (p-> mShowIconDay7) 1013 if (p-> mShowIconDay7)
1014 day7_action->addTo( iconToolBar ); 1014 day7_action->addTo( iconToolBar );
1015 if (p-> mShowIconDay6) 1015 if (p-> mShowIconDay6)
1016 day6_action->addTo( iconToolBar ); 1016 day6_action->addTo( iconToolBar );
1017 if (p-> mShowIconMonth) 1017 if (p-> mShowIconMonth)
1018 month_action->addTo( iconToolBar ); 1018 month_action->addTo( iconToolBar );
1019 if (p-> mShowIconTodoview) 1019 if (p-> mShowIconTodoview)
1020 todoview_action->addTo( iconToolBar ); 1020 todoview_action->addTo( iconToolBar );
1021 if (p-> mShowIconJournal) 1021 if (p-> mShowIconJournal)
1022 viewjournal_action->addTo( iconToolBar ); 1022 viewjournal_action->addTo( iconToolBar );
1023 icon = loadPixmap( pathString + "2leftarrowB" ); 1023 icon = loadPixmap( pathString + "2leftarrowB" );
1024 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 1024 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
1025 if (p-> mShowIconBackFast) { 1025 if (p-> mShowIconBackFast) {
1026 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1026 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1027 connect( action, SIGNAL( activated() ), 1027 connect( action, SIGNAL( activated() ),
1028 mView, SLOT( goPreviousMonth() ) ); 1028 mView, SLOT( goPreviousMonth() ) );
1029 action->addTo( iconToolBar ); 1029 action->addTo( iconToolBar );
1030 } 1030 }
1031 icon = loadPixmap( pathString + "1leftarrowB" ); 1031 icon = loadPixmap( pathString + "1leftarrowB" );
1032 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 1032 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
1033 if (p-> mShowIconBack) { 1033 if (p-> mShowIconBack) {
1034 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1034 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1035 connect( action, SIGNAL( activated() ), 1035 connect( action, SIGNAL( activated() ),
1036 mView, SLOT( goPrevious() ) ); 1036 mView, SLOT( goPrevious() ) );
1037 action->addTo( iconToolBar ); 1037 action->addTo( iconToolBar );
1038 } 1038 }
1039 icon = loadPixmap( pathString + "today" ); 1039 icon = loadPixmap( pathString + "today" );
1040 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1040 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1041 if (p-> mShowIconToday) 1041 if (p-> mShowIconToday)
1042 today_action->addTo( iconToolBar ); 1042 today_action->addTo( iconToolBar );
1043 icon = loadPixmap( pathString + "1rightarrowB" ); 1043 icon = loadPixmap( pathString + "1rightarrowB" );
1044 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1044 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1045 if (p-> mShowIconForward) { 1045 if (p-> mShowIconForward) {
1046 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1046 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1047 connect( action, SIGNAL( activated() ), 1047 connect( action, SIGNAL( activated() ),
1048 mView, SLOT( goNext() ) ); 1048 mView, SLOT( goNext() ) );
1049 action->addTo( iconToolBar ); 1049 action->addTo( iconToolBar );
1050 } 1050 }
1051 icon = loadPixmap( pathString + "2rightarrowB" ); 1051 icon = loadPixmap( pathString + "2rightarrowB" );
1052 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1052 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1053 if (p-> mShowIconForwardFast) { 1053 if (p-> mShowIconForwardFast) {
1054 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1054 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1055 connect( action, SIGNAL( activated() ), 1055 connect( action, SIGNAL( activated() ),
1056 mView, SLOT( goNextMonth() ) ); 1056 mView, SLOT( goNextMonth() ) );
1057 action->addTo( iconToolBar ); 1057 action->addTo( iconToolBar );
1058 } 1058 }
1059 1059
1060 1060
1061 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 1061 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
1062 1062
1063 if (p-> mShowIconNewEvent) 1063 if (p-> mShowIconNewEvent)
1064 configureToolBarMenu->setItemChecked( 10, true ); 1064 configureToolBarMenu->setItemChecked( 10, true );
1065 if (p->mShowIconNewTodo ) 1065 if (p->mShowIconNewTodo )
1066 configureToolBarMenu->setItemChecked( 20, true ); 1066 configureToolBarMenu->setItemChecked( 20, true );
1067 if (p-> mShowIconSearch) 1067 if (p-> mShowIconSearch)
1068 configureToolBarMenu->setItemChecked( 120, true ); 1068 configureToolBarMenu->setItemChecked( 120, true );
1069 if (p-> mShowIconList) 1069 if (p-> mShowIconList)
1070 configureToolBarMenu->setItemChecked( 30, true ); 1070 configureToolBarMenu->setItemChecked( 30, true );
1071 if (p-> mShowIconDay1) 1071 if (p-> mShowIconDay1)
1072 configureToolBarMenu->setItemChecked( 40, true ); 1072 configureToolBarMenu->setItemChecked( 40, true );
1073 if (p-> mShowIconDay5) 1073 if (p-> mShowIconDay5)
1074 configureToolBarMenu->setItemChecked( 50, true ); 1074 configureToolBarMenu->setItemChecked( 50, true );
1075 if (p-> mShowIconDay6) 1075 if (p-> mShowIconDay6)
1076 configureToolBarMenu->setItemChecked( 75, true ); 1076 configureToolBarMenu->setItemChecked( 75, true );
1077 if (p-> mShowIconDay7) 1077 if (p-> mShowIconDay7)
1078 configureToolBarMenu->setItemChecked( 60, true ); 1078 configureToolBarMenu->setItemChecked( 60, true );
1079 if (p-> mShowIconMonth) 1079 if (p-> mShowIconMonth)
1080 configureToolBarMenu->setItemChecked( 70, true ); 1080 configureToolBarMenu->setItemChecked( 70, true );
1081 if (p-> mShowIconTodoview) 1081 if (p-> mShowIconTodoview)
1082 configureToolBarMenu->setItemChecked( 80, true ); 1082 configureToolBarMenu->setItemChecked( 80, true );
1083 if (p-> mShowIconBackFast) 1083 if (p-> mShowIconBackFast)
1084 configureToolBarMenu->setItemChecked( 200, true ); 1084 configureToolBarMenu->setItemChecked( 200, true );
1085 if (p-> mShowIconBack) 1085 if (p-> mShowIconBack)
1086 configureToolBarMenu->setItemChecked( 210, true ); 1086 configureToolBarMenu->setItemChecked( 210, true );
1087 if (p-> mShowIconToday) 1087 if (p-> mShowIconToday)
1088 configureToolBarMenu->setItemChecked( 130, true ); 1088 configureToolBarMenu->setItemChecked( 130, true );
1089 if (p-> mShowIconForward) 1089 if (p-> mShowIconForward)
1090 configureToolBarMenu->setItemChecked( 220, true ); 1090 configureToolBarMenu->setItemChecked( 220, true );
1091 if (p-> mShowIconForwardFast) 1091 if (p-> mShowIconForwardFast)
1092 configureToolBarMenu->setItemChecked( 230, true ); 1092 configureToolBarMenu->setItemChecked( 230, true );
1093 if (p-> mShowIconNextDays) 1093 if (p-> mShowIconNextDays)
1094 configureToolBarMenu->setItemChecked( 100, true ); 1094 configureToolBarMenu->setItemChecked( 100, true );
1095 if (p-> mShowIconNext) 1095 if (p-> mShowIconNext)
1096 configureToolBarMenu->setItemChecked( 110, true ); 1096 configureToolBarMenu->setItemChecked( 110, true );
1097 if (p-> mShowIconJournal) 1097 if (p-> mShowIconJournal)
1098 configureToolBarMenu->setItemChecked( 90, true ); 1098 configureToolBarMenu->setItemChecked( 90, true );
1099 if (p-> mShowIconWhatsThis) 1099 if (p-> mShowIconWhatsThis)
1100 configureToolBarMenu->setItemChecked( 300, true ); 1100 configureToolBarMenu->setItemChecked( 300, true );
1101 if (p-> mShowIconWeekNum) 1101 if (p-> mShowIconWeekNum)
1102 configureToolBarMenu->setItemChecked( 400, true ); 1102 configureToolBarMenu->setItemChecked( 400, true );
1103 QLabel* dummy = new QLabel( iconToolBar ); 1103 QLabel* dummy = new QLabel( iconToolBar );
1104 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1104 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1105 if (!p-> mShowIconStretch) 1105 if (!p-> mShowIconStretch)
1106 iconToolBar->setStretchableWidget ( dummy ) ; 1106 iconToolBar->setStretchableWidget ( dummy ) ;
1107 else 1107 else
1108 configureToolBarMenu->setItemChecked( 5, true ); 1108 configureToolBarMenu->setItemChecked( 5, true );
1109 if (p-> mShowIconWhatsThis) 1109 if (p-> mShowIconWhatsThis)
1110 QWhatsThis::whatsThisButton ( iconToolBar ); 1110 QWhatsThis::whatsThisButton ( iconToolBar );
1111 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1111 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1112 configureAgenda( p->mHourSize ); 1112 configureAgenda( p->mHourSize );
1113 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1113 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1114} 1114}
1115 1115
1116void MainWindow::exportToPhone( int mode ) 1116void MainWindow::exportToPhone( int mode )
1117{ 1117{
1118 1118
1119 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1119 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1120 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1120 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1121 KOex2phonePrefs ex2phone; 1121 KOex2phonePrefs ex2phone;
1122 1122
1123 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1123 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1124 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1124 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1125 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1125 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1126 if ( mode == 1 ) 1126 if ( mode == 1 )
1127 ex2phone.setCaption(i18n("Export complete calendar")); 1127 ex2phone.setCaption(i18n("Export complete calendar"));
1128 if ( mode == 2 ) 1128 if ( mode == 2 )
1129 ex2phone.setCaption(i18n("Export filtered calendar")); 1129 ex2phone.setCaption(i18n("Export filtered calendar"));
1130 1130
1131 if ( !ex2phone.exec() ) { 1131 if ( !ex2phone.exec() ) {
1132 return; 1132 return;
1133 } 1133 }
1134 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1134 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1135 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1135 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1136 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1136 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1137 1137
1138 int inFuture = 0; 1138 int inFuture = 0;
1139 if ( ex2phone.mWriteBackFuture->isChecked() ) 1139 if ( ex2phone.mWriteBackFuture->isChecked() )
1140 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1140 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1141 QPtrList<Incidence> delSel; 1141 QPtrList<Incidence> delSel;
1142 if ( mode == 1 ) 1142 if ( mode == 1 )
1143 delSel = mCalendar->rawIncidences(); 1143 delSel = mCalendar->rawIncidences();
1144 if ( mode == 2 ) 1144 if ( mode == 2 )
1145 delSel = mCalendar->incidences(); 1145 delSel = mCalendar->incidences();
1146 CalendarLocal* cal = new CalendarLocal(); 1146 CalendarLocal* cal = new CalendarLocal();
1147 cal->setLocalTime(); 1147 cal->setLocalTime();
1148 Incidence *incidence = delSel.first(); 1148 Incidence *incidence = delSel.first();
1149 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1149 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1150 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1150 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1151 while ( incidence ) { 1151 while ( incidence ) {
1152 if ( incidence->type() != "Journal" ) { 1152 if ( incidence->type() != "Journal" ) {
1153 bool add = true; 1153 bool add = true;
1154 if ( inFuture ) { 1154 if ( inFuture ) {
1155 QDateTime dt; 1155 QDateTime dt;
1156 if ( incidence->type() == "Todo" ) { 1156 if ( incidence->type() == "Todo" ) {
1157 Todo * t = (Todo*)incidence; 1157 Todo * t = (Todo*)incidence;
1158 if ( t->hasDueDate() ) 1158 if ( t->hasDueDate() )
1159 dt = t->dtDue(); 1159 dt = t->dtDue();
1160 else 1160 else
1161 dt = cur.addSecs( 62 ); 1161 dt = cur.addSecs( 62 );
1162 } 1162 }
1163 else { 1163 else {
1164 bool ok; 1164 bool ok;
1165 dt = incidence->getNextOccurence( cur, &ok ); 1165 dt = incidence->getNextOccurence( cur, &ok );
1166 if ( !ok ) 1166 if ( !ok )
1167 dt = cur.addSecs( -62 ); 1167 dt = cur.addSecs( -62 );
1168 } 1168 }
1169 if ( dt < cur || dt > end ) { 1169 if ( dt < cur || dt > end ) {
1170 add = false; 1170 add = false;
1171 } 1171 }
1172 } 1172 }
1173 if ( add ) { 1173 if ( add ) {
1174 Incidence *in = incidence->clone(); 1174 Incidence *in = incidence->clone();
1175 cal->addIncidence( in ); 1175 cal->addIncidence( in );
1176 } 1176 }
1177 } 1177 }
1178 incidence = delSel.next(); 1178 incidence = delSel.next();
1179 } 1179 }
1180 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1180 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1181 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1181 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1182 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1182 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1183 1183
1184 setCaption( i18n("Writing to phone...")); 1184 setCaption( i18n("Writing to phone..."));
1185 if ( PhoneFormat::writeToPhone( cal ) ) 1185 if ( PhoneFormat::writeToPhone( cal ) )
1186 setCaption( i18n("Export to phone successful!")); 1186 setCaption( i18n("Export to phone successful!"));
1187 else 1187 else
1188 setCaption( i18n("Error exporting to phone!")); 1188 setCaption( i18n("Error exporting to phone!"));
1189 delete cal; 1189 delete cal;
1190} 1190}
1191 1191
1192 1192
1193void MainWindow::setDefaultPreferences() 1193void MainWindow::setDefaultPreferences()
1194{ 1194{
1195 KOPrefs *p = KOPrefs::instance(); 1195 KOPrefs *p = KOPrefs::instance();
1196 1196
1197 p->mCompactDialogs = true; 1197 p->mCompactDialogs = true;
1198 p->mConfirm = true; 1198 p->mConfirm = true;
1199 // p->mEnableQuickTodo = false; 1199 // p->mEnableQuickTodo = false;
1200 1200
1201} 1201}
1202 1202
1203QString MainWindow::resourcePath() 1203QString MainWindow::resourcePath()
1204{ 1204{
1205 return KGlobal::iconLoader()->iconPath(); 1205 return KGlobal::iconLoader()->iconPath();
1206} 1206}
1207 1207
1208void MainWindow::displayText( QString text ,QString cap ) 1208void MainWindow::displayText( QString text ,QString cap )
1209{ 1209{
1210 QDialog dia( this, "name", true ); ; 1210 QDialog dia( this, "name", true ); ;
1211 dia.setCaption( cap ); 1211 dia.setCaption( cap );
1212 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1212 QVBoxLayout* lay = new QVBoxLayout( &dia );
1213 lay->setSpacing( 3 ); 1213 lay->setSpacing( 3 );
1214 lay->setMargin( 3 ); 1214 lay->setMargin( 3 );
1215 QTextBrowser tb ( &dia ); 1215 QTextBrowser tb ( &dia );
1216 lay->addWidget( &tb ); 1216 lay->addWidget( &tb );
1217 tb.setText( text ); 1217 tb.setText( text );
1218#ifdef DESKTOP_VERSION 1218#ifdef DESKTOP_VERSION
1219 dia.resize( 640, 480); 1219 dia.resize( 640, 480);
1220#else 1220#else
1221 dia.showMaximized(); 1221 dia.showMaximized();
1222#endif 1222#endif
1223 dia.exec(); 1223 dia.exec();
1224} 1224}
1225 1225
1226void MainWindow::features() 1226void MainWindow::features()
1227{ 1227{
1228 1228
1229 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1229 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1230} 1230}
1231 1231
1232void MainWindow::usertrans() 1232void MainWindow::usertrans()
1233{ 1233{
1234 1234
1235 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1235 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1236} 1236}
1237 1237
1238void MainWindow::kdesynchowto() 1238void MainWindow::kdesynchowto()
1239{ 1239{
1240 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1240 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1241} 1241}
1242void MainWindow::multisynchowto() 1242void MainWindow::multisynchowto()
1243{ 1243{
1244 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1244 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1245} 1245}
1246void MainWindow::synchowto() 1246void MainWindow::synchowto()
1247{ 1247{
1248 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1248 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1249} 1249}
1250void MainWindow::faq() 1250void MainWindow::faq()
1251{ 1251{
1252 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1252 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1253 1253
1254} 1254}
1255void MainWindow::whatsNew() 1255void MainWindow::whatsNew()
1256{ 1256{
1257 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1257 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1258 1258
1259} 1259}
1260void MainWindow::licence() 1260void MainWindow::licence()
1261{ 1261{
1262 KApplication::showLicence(); 1262 KApplication::showLicence();
1263 1263
1264} 1264}
1265void MainWindow::about() 1265void MainWindow::about()
1266{ 1266{
1267 QString version; 1267 QString version;
1268#include <../version> 1268#include <../version>
1269 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1269 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1270 i18n("KOrganizer/Platform-independent\n") + 1270 i18n("KOrganizer/Platform-independent\n") +
1271 "(KO/Pi) " + version + " - " + 1271 "(KO/Pi) " + version + " - " +
1272 1272
1273#ifdef DESKTOP_VERSION 1273#ifdef DESKTOP_VERSION
1274 i18n("Desktop Edition\n") + 1274 i18n("Desktop Edition\n") +
1275#else 1275#else
1276 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1276 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1277#endif 1277#endif
1278 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); 1278 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
1279} 1279}
1280void MainWindow::keyBindings() 1280void MainWindow::keyBindings()
1281{ 1281{
1282 QString cap = i18n("KO/Pi Keys + Colors"); 1282 QString cap = i18n("KO/Pi Keys + Colors");
1283 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1283 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1284 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1284 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1285 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1285 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1286 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1286 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1287 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1287 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1288 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1288 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1289 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1289 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1290 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1290 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+
1291 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1291 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1292 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1292 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1293 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1293 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1294 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1294 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1295 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1295 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1296 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1296 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1297 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ 1297 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+
1298 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1298 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1299 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1299 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1300 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1300 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1301 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1301 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1302 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1302 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1303 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1303 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1304 i18n("<p><h3>In agenda view:</h3></p>\n") + 1304 i18n("<p><h3>In agenda view:</h3></p>\n") +
1305 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1305 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1306 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1306 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1307 i18n("<p><h3>In todo view:</h3></p>\n") + 1307 i18n("<p><h3>In todo view:</h3></p>\n") +
1308 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1308 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1309 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1309 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1310 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1310 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1311 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1311 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1312 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1312 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1313 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1313 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1314 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1314 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1315 i18n("<p><h3>In list view:</h3></p>\n") + 1315 i18n("<p><h3>In list view:</h3></p>\n") +
1316 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1316 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1317 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1317 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1318 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1318 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1319 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1319 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1320 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1320 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1321 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1321 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1322 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1322 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1323 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1323 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1324 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1324 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1325 i18n("<p><b>E</b>: Edit item</p>\n") + 1325 i18n("<p><b>E</b>: Edit item</p>\n") +
1326 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1326 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1327 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1327 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1328 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1328 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1329 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1329 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1330 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1330 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1331 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1331 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1332 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1332 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1333 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1333 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1334 i18n("<p><b>White</b>: Item readonly</p>\n"); 1334 i18n("<p><b>White</b>: Item readonly</p>\n");
1335 displayText( text, cap); 1335 displayText( text, cap);
1336} 1336}
1337void MainWindow::aboutAutoSaving() 1337void MainWindow::aboutAutoSaving()
1338{ 1338{
1339 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1339 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1340 1340
1341 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1341 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1342 1342
1343} 1343}
1344void MainWindow::aboutKnownBugs() 1344void MainWindow::aboutKnownBugs()
1345{ 1345{
1346 QMessageBox* msg; 1346 QMessageBox* msg;
1347 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1347 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1348 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1348 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1349 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1349 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1350 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n") + 1350 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1351 i18n("\nor report them in the bugtracker on\n") + 1351 i18n("\nor report them in the bugtracker on\n") +
1352 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1352 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1353 QMessageBox::NoIcon, 1353 QMessageBox::NoIcon,
1354 QMessageBox::Ok, 1354 QMessageBox::Ok,
1355 QMessageBox::NoButton, 1355 QMessageBox::NoButton,
1356 QMessageBox::NoButton); 1356 QMessageBox::NoButton);
1357 msg->exec(); 1357 msg->exec();
1358 delete msg; 1358 delete msg;
1359 1359
1360} 1360}
1361 1361
1362QString MainWindow::defaultFileName() 1362QString MainWindow::defaultFileName()
1363{ 1363{
1364 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1364 return locateLocal( "data", "korganizer/mycalendar.ics" );
1365} 1365}
1366QString MainWindow::syncFileName() 1366QString MainWindow::syncFileName()
1367{ 1367{
1368#ifdef DESKTOP_VERSION 1368#ifdef DESKTOP_VERSION
1369 return locateLocal( "tmp", "synccalendar.ics" ); 1369 return locateLocal( "tmp", "synccalendar.ics" );
1370#else 1370#else
1371 return QString( "/tmp/synccalendar.ics" ); 1371 return QString( "/tmp/synccalendar.ics" );
1372#endif 1372#endif
1373} 1373}
1374void MainWindow::updateWeek(QDate seda) 1374void MainWindow::updateWeek(QDate seda)
1375{ 1375{
1376 int weekNum = 0; 1376 int weekNum = 0;
1377 QDate d = QDate ( seda.year(), 1,1); 1377 QDate d = QDate ( seda.year(), 1,1);
1378 seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday 1378 seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday
1379 if ( seda.addDays(6).year() != seda.year() ) { 1379 if ( seda.addDays(6).year() != seda.year() ) {
1380 if ( seda.year() != d.year() ) { 1380 if ( seda.year() != d.year() ) {
1381 if ( d.dayOfWeek() > 4 ) 1381 if ( d.dayOfWeek() > 4 )
1382 d = QDate ( seda.year(), 1,1); 1382 d = QDate ( seda.year(), 1,1);
1383 else 1383 else
1384 weekNum = 1; 1384 weekNum = 1;
1385 } else { 1385 } else {
1386 QDate dd( seda.year()+1, 1,1); 1386 QDate dd( seda.year()+1, 1,1);
1387 if ( dd.dayOfWeek() <= 4 ) 1387 if ( dd.dayOfWeek() <= 4 )
1388 weekNum = 1; 1388 weekNum = 1;
1389 } 1389 }
1390 } 1390 }
1391 if ( weekNum == 0 ){ 1391 if ( weekNum == 0 ){
1392 int dow = d.dayOfWeek(); 1392 int dow = d.dayOfWeek();
1393 if ( dow <= 4 ) 1393 if ( dow <= 4 )
1394 d = d.addDays( 1-dow ); 1394 d = d.addDays( 1-dow );
1395 else // 5,6,7 1395 else // 5,6,7
1396 d = d.addDays( 8-dow ); 1396 d = d.addDays( 8-dow );
1397 // we have the first week of the year.we are on monday 1397 // we have the first week of the year.we are on monday
1398 weekNum = d.daysTo( seda ) / 7 +1; 1398 weekNum = d.daysTo( seda ) / 7 +1;
1399 } 1399 }
1400 1400
1401 mWeekPixmap.fill( mWeekBgColor ); 1401 mWeekPixmap.fill( mWeekBgColor );
1402 QPainter p ( &mWeekPixmap ); 1402 QPainter p ( &mWeekPixmap );
1403 p.setFont( mWeekFont ); 1403 p.setFont( mWeekFont );
1404 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1404 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1405 p.end(); 1405 p.end();
1406 QIconSet icon3 ( mWeekPixmap ); 1406 QIconSet icon3 ( mWeekPixmap );
1407 mWeekAction->setIconSet ( icon3 ); 1407 mWeekAction->setIconSet ( icon3 );
1408 1408
1409} 1409}
1410void MainWindow::updateWeekNum(const DateList &selectedDates) 1410void MainWindow::updateWeekNum(const DateList &selectedDates)
1411{ 1411{
1412 updateWeek( selectedDates.first() ); 1412 updateWeek( selectedDates.first() );
1413} 1413}
1414void MainWindow::processIncidenceSelection( Incidence *incidence ) 1414void MainWindow::processIncidenceSelection( Incidence *incidence )
1415{ 1415{
1416 1416
1417 if ( !incidence ) { 1417 if ( !incidence ) {
1418 enableIncidenceActions( false ); 1418 enableIncidenceActions( false );
1419 1419
1420 mNewSubTodoAction->setEnabled( false ); 1420 mNewSubTodoAction->setEnabled( false );
1421 setCaptionToDates(); 1421 setCaptionToDates();
1422 return; 1422 return;
1423 1423
1424 } 1424 }
1425 1425
1426 //KGlobal::locale()->formatDateTime(nextA, true); 1426 //KGlobal::locale()->formatDateTime(nextA, true);
1427 QString startString = ""; 1427 QString startString = "";
1428 if ( incidence->type() != "Todo" ) { 1428 if ( incidence->type() != "Todo" ) {
1429 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1429 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1430 if ( incidence->doesFloat() ) { 1430 if ( incidence->doesFloat() ) {
1431 startString += ": "+incidence->dtStartDateStr( true ); 1431 startString += ": "+incidence->dtStartDateStr( true );
1432 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1432 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1433 1433
1434 } else { 1434 } else {
1435 startString = ": "+incidence->dtStartStr(true); 1435 startString = ": "+incidence->dtStartStr(true);
1436 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1436 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1437 1437
1438 } 1438 }
1439 1439
1440 } else { 1440 } else {
1441 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1441 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1442 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1442 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1443 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1443 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1444 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { 1444 if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) {
1445 bool ok; 1445 bool ok;
1446 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1446 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1447 if ( ok ) { 1447 if ( ok ) {
1448 int years = noc.date().year() - incidence->dtStart().date().year(); 1448 int years = noc.date().year() - incidence->dtStart().date().year();
1449 startString += i18n(" (%1 y.)"). arg( years ); 1449 startString += i18n(" (%1 y.)"). arg( years );
1450 } 1450 }
1451 } 1451 }
1452 else 1452 else
1453 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1453 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1454 } 1454 }
1455 1455
1456 } 1456 }
1457 else 1457 else
1458 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1458 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1459 if ( !incidence->location().isEmpty() ) 1459 if ( !incidence->location().isEmpty() )
1460 startString += " (" +incidence->location()+")"; 1460 startString += " (" +incidence->location()+")";
1461 setCaption( incidence->summary()+startString); 1461 setCaption( incidence->summary()+startString);
1462 1462
1463 enableIncidenceActions( true ); 1463 enableIncidenceActions( true );
1464 1464
1465 if ( incidence->type() == "Event" ) { 1465 if ( incidence->type() == "Event" ) {
1466 mShowAction->setText( i18n("Show Event...") ); 1466 mShowAction->setText( i18n("Show Event...") );
1467 mEditAction->setText( i18n("Edit Event...") ); 1467 mEditAction->setText( i18n("Edit Event...") );
1468 mDeleteAction->setText( i18n("Delete Event...") ); 1468 mDeleteAction->setText( i18n("Delete Event...") );
1469 1469
1470 mNewSubTodoAction->setEnabled( false ); 1470 mNewSubTodoAction->setEnabled( false );
1471 } else if ( incidence->type() == "Todo" ) { 1471 } else if ( incidence->type() == "Todo" ) {
1472 mShowAction->setText( i18n("Show Todo...") ); 1472 mShowAction->setText( i18n("Show Todo...") );
1473 mEditAction->setText( i18n("Edit Todo...") ); 1473 mEditAction->setText( i18n("Edit Todo...") );
1474 mDeleteAction->setText( i18n("Delete Todo...") ); 1474 mDeleteAction->setText( i18n("Delete Todo...") );
1475 1475
1476 mNewSubTodoAction->setEnabled( true ); 1476 mNewSubTodoAction->setEnabled( true );
1477 } else { 1477 } else {
1478 mShowAction->setText( i18n("Show...") ); 1478 mShowAction->setText( i18n("Show...") );
1479 mShowAction->setText( i18n("Edit...") ); 1479 mShowAction->setText( i18n("Edit...") );
1480 mShowAction->setText( i18n("Delete...") ); 1480 mShowAction->setText( i18n("Delete...") );
1481 1481
1482 mNewSubTodoAction->setEnabled( false ); 1482 mNewSubTodoAction->setEnabled( false );
1483 } 1483 }
1484} 1484}
1485 1485
1486void MainWindow::enableIncidenceActions( bool enabled ) 1486void MainWindow::enableIncidenceActions( bool enabled )
1487{ 1487{
1488 mShowAction->setEnabled( enabled ); 1488 mShowAction->setEnabled( enabled );
1489 mEditAction->setEnabled( enabled ); 1489 mEditAction->setEnabled( enabled );
1490 mDeleteAction->setEnabled( enabled ); 1490 mDeleteAction->setEnabled( enabled );
1491 1491
1492 mCloneAction->setEnabled( enabled ); 1492 mCloneAction->setEnabled( enabled );
1493 mMoveAction->setEnabled( enabled ); 1493 mMoveAction->setEnabled( enabled );
1494 mBeamAction->setEnabled( enabled ); 1494 mBeamAction->setEnabled( enabled );
1495 mCancelAction->setEnabled( enabled ); 1495 mCancelAction->setEnabled( enabled );
1496} 1496}
1497 1497
1498void MainWindow::importOL() 1498void MainWindow::importOL()
1499{ 1499{
1500#ifdef _OL_IMPORT_ 1500#ifdef _OL_IMPORT_
1501 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1501 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1502 id->exec(); 1502 id->exec();
1503 delete id; 1503 delete id;
1504 mView->updateView(); 1504 mView->updateView();
1505#endif 1505#endif
1506} 1506}
1507void MainWindow::importBday() 1507void MainWindow::importBday()
1508{ 1508{
1509 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1509 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1510 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1510 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1511 i18n("Import!"), i18n("Cancel"), 0, 1511 i18n("Import!"), i18n("Cancel"), 0,
1512 0, 1 ); 1512 0, 1 );
1513 if ( result == 0 ) { 1513 if ( result == 0 ) {
1514 mView->importBday(); 1514 mView->importBday();
1515 1515
1516 } 1516 }
1517 1517
1518 1518
1519} 1519}
1520void MainWindow::importQtopia() 1520void MainWindow::importQtopia()
1521{ 1521{
1522 //#ifndef DESKTOP_VERSION 1522 //#ifndef DESKTOP_VERSION
1523 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1523 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1524#ifdef DESKTOP_VERSION 1524#ifdef DESKTOP_VERSION
1525 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1525 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1526#endif 1526#endif
1527 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1527 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1528 i18n("Import!"), i18n("Cancel"), 0, 1528 i18n("Import!"), i18n("Cancel"), 0,
1529 0, 1 ); 1529 0, 1 );
1530 if ( result == 0 ) { 1530 if ( result == 0 ) {
1531#ifndef DESKTOP_VERSION 1531#ifndef DESKTOP_VERSION
1532 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1532 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1533 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1533 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1534 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1534 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1535#else 1535#else
1536 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1536 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1537 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1537 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1538 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1538 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1539#endif 1539#endif
1540 mView->importQtopia( categories, datebook, todolist ); 1540 mView->importQtopia( categories, datebook, todolist );
1541 } 1541 }
1542#if 0 1542#if 0
1543 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1543 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1544 i18n("Not supported \non desktop!\n"), 1544 i18n("Not supported \non desktop!\n"),
1545 i18n("Ok"), i18n("Cancel"), 0, 1545 i18n("Ok"), i18n("Cancel"), 0,
1546 0, 1 ); 1546 0, 1 );
1547 1547
1548#endif 1548#endif
1549} 1549}
1550 1550
1551void MainWindow::saveOnClose() 1551void MainWindow::saveOnClose()
1552{ 1552{
1553 KOPrefs *p = KOPrefs::instance(); 1553 KOPrefs *p = KOPrefs::instance();
1554 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1554 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1555 p->mToolBarUp = iconToolBar->x() > width()/2 || 1555 p->mToolBarUp = iconToolBar->x() > width()/2 ||
1556 iconToolBar->y() > height()/2; 1556 iconToolBar->y() > height()/2;
1557 mView->writeSettings(); 1557 mView->writeSettings();
1558 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1558 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1559 save(); 1559 save();
1560} 1560}
1561void MainWindow::slotModifiedChanged( bool changed ) 1561void MainWindow::slotModifiedChanged( bool changed )
1562{ 1562{
1563 if ( mBlockAtStartup ) 1563 if ( mBlockAtStartup )
1564 return; 1564 return;
1565 1565
1566 int msec; 1566 int msec;
1567 // we store the changes after 1 minute, 1567 // we store the changes after 1 minute,
1568 // and for safety reasons after 10 minutes again 1568 // and for safety reasons after 10 minutes again
1569 if ( !mSyncManager->blockSave() ) 1569 if ( !mSyncManager->blockSave() )
1570 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1570 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1571 else 1571 else
1572 msec = 1000 * 600; 1572 msec = 1000 * 600;
1573 mSaveTimer.start( msec, true ); // 1 minute 1573 mSaveTimer.start( msec, true ); // 1 minute
1574 qDebug("KO: Saving File in %d secs!", msec/1000); 1574 qDebug("KO: Saving File in %d secs!", msec/1000);
1575 mCalendarModifiedFlag = true; 1575 mCalendarModifiedFlag = true;
1576} 1576}
1577void MainWindow::saveStopTimer() 1577void MainWindow::saveStopTimer()
1578{ 1578{
1579 mSaveTimer.stop(); 1579 mSaveTimer.stop();
1580 if (mSaveTimer.isActive() ) 1580 if (mSaveTimer.isActive() )
1581 qDebug("ti active "); 1581 qDebug("ti active ");
1582 else 1582 else
1583 qDebug("KO: Save timer stopped"); 1583 qDebug("KO: Save timer stopped");
1584} 1584}
1585void MainWindow::save() 1585void MainWindow::save()
1586{ 1586{
1587 if ( !mCalendarModifiedFlag ) { 1587 if ( !mCalendarModifiedFlag ) {
1588 qDebug("KO: Calendar not modified. Nothing saved."); 1588 qDebug("KO: Calendar not modified. Nothing saved.");
1589 return; 1589 return;
1590 } 1590 }
1591 if ( mSyncManager->blockSave() ) 1591 if ( mSyncManager->blockSave() )
1592 return; 1592 return;
1593 mSyncManager->setBlockSave(true); 1593 mSyncManager->setBlockSave(true);
1594 if ( mView->checkFileVersion( defaultFileName()) ) { 1594 if ( mView->checkFileVersion( defaultFileName()) ) {
1595 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1595 QTime neededSaveTime = QDateTime::currentDateTime().time();
1596 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1596 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1597 qDebug("KO: Start saving data to file!"); 1597 qDebug("KO: Start saving data to file!");
1598 mView->saveCalendar( defaultFileName() ); 1598 mView->saveCalendar( defaultFileName() );
1599 mCalendarModifiedFlag = false; 1599 mCalendarModifiedFlag = false;
1600 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1600 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1601 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1601 qDebug("KO: Needed %d ms for saving.",msNeeded );
1602 QString savemes; 1602 QString savemes;
1603 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1603 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1604 setCaption(savemes); 1604 setCaption(savemes);
1605 } else 1605 } else
1606 setCaption(i18n("Saving cancelled!")); 1606 setCaption(i18n("Saving cancelled!"));
1607 mSyncManager->setBlockSave( false ); 1607 mSyncManager->setBlockSave( false );
1608} 1608}
1609 1609
1610void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1610void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1611{ 1611{
1612 if ( !e->isAutoRepeat() ) { 1612 if ( !e->isAutoRepeat() ) {
1613 mFlagKeyPressed = false; 1613 mFlagKeyPressed = false;
1614 } 1614 }
1615} 1615}
1616void MainWindow::keyPressEvent ( QKeyEvent * e ) 1616void MainWindow::keyPressEvent ( QKeyEvent * e )
1617{ 1617{
1618 qApp->processEvents(); 1618 qApp->processEvents();
1619 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1619 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1620 e->ignore(); 1620 e->ignore();
1621 // qDebug(" ignore %d",e->isAutoRepeat() ); 1621 // qDebug(" ignore %d",e->isAutoRepeat() );
1622 return; 1622 return;
1623 } 1623 }
1624 if (! e->isAutoRepeat() ) 1624 if (! e->isAutoRepeat() )
1625 mFlagKeyPressed = true; 1625 mFlagKeyPressed = true;
1626 KOPrefs *p = KOPrefs::instance(); 1626 KOPrefs *p = KOPrefs::instance();
1627 bool showSelectedDates = false; 1627 bool showSelectedDates = false;
1628 int size; 1628 int size;
1629 int pro = 0; 1629 int pro = 0;
1630 //qDebug("MainWindow::keyPressEvent "); 1630 //qDebug("MainWindow::keyPressEvent ");
1631 switch ( e->key() ) { 1631 switch ( e->key() ) {
1632 case Qt::Key_Right: 1632 case Qt::Key_Right:
1633 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1633 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1634 mView->goNextMonth(); 1634 mView->goNextMonth();
1635 else 1635 else
1636 mView->goNext(); 1636 mView->goNext();
1637 showSelectedDates = true; 1637 showSelectedDates = true;
1638 break; 1638 break;
1639 case Qt::Key_Left: 1639 case Qt::Key_Left:
1640 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1640 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1641 mView->goPreviousMonth(); 1641 mView->goPreviousMonth();
1642 else 1642 else
1643 mView->goPrevious(); 1643 mView->goPrevious();
1644 showSelectedDates = true; 1644 showSelectedDates = true;
1645 break; 1645 break;
1646 case Qt::Key_Down: 1646 case Qt::Key_Down:
1647 mView->viewManager()->agendaView()->scrollOneHourDown(); 1647 mView->viewManager()->agendaView()->scrollOneHourDown();
1648 break; 1648 break;
1649 case Qt::Key_Up: 1649 case Qt::Key_Up:
1650 mView->viewManager()->agendaView()->scrollOneHourUp(); 1650 mView->viewManager()->agendaView()->scrollOneHourUp();
1651 break; 1651 break;
1652 case Qt::Key_K: 1652 case Qt::Key_K:
1653 mView->viewManager()->showMonthViewWeek(); 1653 mView->viewManager()->showMonthViewWeek();
1654 break; 1654 break;
1655 case Qt::Key_I: 1655 case Qt::Key_I:
1656 mView->showIncidence(); 1656 mView->showIncidence();
1657 break; 1657 break;
1658 case Qt::Key_Delete: 1658 case Qt::Key_Delete:
1659 case Qt::Key_Backspace: 1659 case Qt::Key_Backspace:
1660 mView->deleteIncidence(); 1660 mView->deleteIncidence();
1661 break; 1661 break;
1662 case Qt::Key_D: 1662 case Qt::Key_D:
1663 mView->viewManager()->showDayView(); 1663 mView->viewManager()->showDayView();
1664 showSelectedDates = true; 1664 showSelectedDates = true;
1665 break; 1665 break;
1666 case Qt::Key_O: 1666 case Qt::Key_O:
1667 mView->toggleFilerEnabled( ); 1667 mView->toggleFilerEnabled( );
1668 break; 1668 break;
1669 case Qt::Key_0: 1669 case Qt::Key_0:
1670 case Qt::Key_1: 1670 case Qt::Key_1:
1671 case Qt::Key_2: 1671 case Qt::Key_2:
1672 case Qt::Key_3: 1672 case Qt::Key_3:
1673 case Qt::Key_4: 1673 case Qt::Key_4:
1674 case Qt::Key_5: 1674 case Qt::Key_5:
1675 case Qt::Key_6: 1675 case Qt::Key_6:
1676 case Qt::Key_7: 1676 case Qt::Key_7:
1677 case Qt::Key_8: 1677 case Qt::Key_8:
1678 case Qt::Key_9: 1678 case Qt::Key_9:
1679 pro = e->key()-48; 1679 pro = e->key()-48;
1680 if ( pro == 0 ) 1680 if ( pro == 0 )
1681 pro = 10; 1681 pro = 10;
1682 if ( e->state() == Qt::ControlButton) 1682 if ( e->state() == Qt::ControlButton)
1683 pro += 10; 1683 pro += 10;
1684 break; 1684 break;
1685 case Qt::Key_M: 1685 case Qt::Key_M:
1686 mView->viewManager()->showMonthView(); 1686 mView->viewManager()->showMonthView();
1687 showSelectedDates = true; 1687 showSelectedDates = true;
1688 break; 1688 break;
1689 case Qt::Key_Insert: 1689 case Qt::Key_Insert:
1690 mView->newEvent(); 1690 mView->newEvent();
1691 break; 1691 break;
1692 case Qt::Key_S : 1692 case Qt::Key_S :
1693 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1693 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1694 mView->newSubTodo(); 1694 mView->newSubTodo();
1695 else 1695 else
1696 mView->dialogManager()->showSearchDialog(); 1696 mView->dialogManager()->showSearchDialog();
1697 break; 1697 break;
1698 case Qt::Key_Y : 1698 case Qt::Key_Y :
1699 case Qt::Key_Z : 1699 case Qt::Key_Z :
1700 mView->viewManager()->showWorkWeekView(); 1700 mView->viewManager()->showWorkWeekView();
1701 showSelectedDates = true; 1701 showSelectedDates = true;
1702 break; 1702 break;
1703 case Qt::Key_U : 1703 case Qt::Key_U :
1704 mView->viewManager()->showWeekView(); 1704 mView->viewManager()->showWeekView();
1705 showSelectedDates = true; 1705 showSelectedDates = true;
1706 break; 1706 break;
1707 case Qt::Key_H : 1707 case Qt::Key_H :
1708 keyBindings(); 1708 keyBindings();
1709 break; 1709 break;
1710 case Qt::Key_W: 1710 case Qt::Key_W:
1711 mView->viewManager()->showWhatsNextView(); 1711 mView->viewManager()->showWhatsNextView();
1712 break; 1712 break;
1713 case Qt::Key_L: 1713 case Qt::Key_L:
1714 mView->viewManager()->showListView(); 1714 mView->viewManager()->showListView();
1715 break; 1715 break;
1716 case Qt::Key_N: 1716 case Qt::Key_N:
1717 mView->viewManager()->showNextXView(); 1717 mView->viewManager()->showNextXView();
1718 showSelectedDates = true; 1718 showSelectedDates = true;
1719 break; 1719 break;
1720 case Qt::Key_V: 1720 case Qt::Key_V:
1721 mView->viewManager()->showTodoView(); 1721 mView->viewManager()->showTodoView();
1722 break; 1722 break;
1723 case Qt::Key_C: 1723 case Qt::Key_C:
1724 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1724 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1725 break; 1725 break;
1726 case Qt::Key_P: 1726 case Qt::Key_P:
1727 mView->showDatePicker( ); 1727 mView->showDatePicker( );
1728 break; 1728 break;
1729 case Qt::Key_F: 1729 case Qt::Key_F:
1730 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1730 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1731 mView->editFilters(); 1731 mView->editFilters();
1732 else 1732 else
1733 mView->toggleFilter(); 1733 mView->toggleFilter();
1734 break; 1734 break;