-rw-r--r-- | korganizer/mainwindow.cpp | 206 |
1 files changed, 172 insertions, 34 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ca0d542..c6ae868 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -36,48 +36,49 @@ | |||
36 | 36 | ||
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendarlocal.h> | 38 | #include <libkcal/calendarlocal.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | #include <libkcal/phoneformat.h> | 40 | #include <libkcal/phoneformat.h> |
41 | #include <libkdepim/ksyncprofile.h> | 41 | #include <libkdepim/ksyncprofile.h> |
42 | #include <libkdepim/phoneaccess.h> | 42 | #include <libkdepim/phoneaccess.h> |
43 | #include <libkcal/kincidenceformatter.h> | 43 | #include <libkcal/kincidenceformatter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "calendarview.h" | 46 | #include "calendarview.h" |
47 | #include "koviewmanager.h" | 47 | #include "koviewmanager.h" |
48 | #include "datenavigator.h" | 48 | #include "datenavigator.h" |
49 | #include "koagendaview.h" | 49 | #include "koagendaview.h" |
50 | #include "koagenda.h" | 50 | #include "koagenda.h" |
51 | #include "kodialogmanager.h" | 51 | #include "kodialogmanager.h" |
52 | #include "kdialogbase.h" | 52 | #include "kdialogbase.h" |
53 | #include "kapplication.h" | 53 | #include "kapplication.h" |
54 | #include "kofilterview.h" | 54 | #include "kofilterview.h" |
55 | #include "kstandarddirs.h" | 55 | #include "kstandarddirs.h" |
56 | #include "koprefs.h" | 56 | #include "koprefs.h" |
57 | #include "kfiledialog.h" | 57 | #include "kfiledialog.h" |
58 | #include "koglobals.h" | 58 | #include "koglobals.h" |
59 | #include "kglobal.h" | 59 | #include "kglobal.h" |
60 | #include "ktoolbar.h" | ||
60 | #include "klocale.h" | 61 | #include "klocale.h" |
61 | #include "kconfig.h" | 62 | #include "kconfig.h" |
62 | #include "simplealarmclient.h" | 63 | #include "simplealarmclient.h" |
63 | #include "externalapphandler.h" | 64 | #include "externalapphandler.h" |
64 | 65 | ||
65 | using namespace KCal; | 66 | using namespace KCal; |
66 | #ifndef _WIN32_ | 67 | #ifndef _WIN32_ |
67 | #include <unistd.h> | 68 | #include <unistd.h> |
68 | #else | 69 | #else |
69 | #ifdef _OL_IMPORT_ | 70 | #ifdef _OL_IMPORT_ |
70 | #include "koimportoldialog.h" | 71 | #include "koimportoldialog.h" |
71 | #endif | 72 | #endif |
72 | #endif | 73 | #endif |
73 | #include "mainwindow.h" | 74 | #include "mainwindow.h" |
74 | 75 | ||
75 | 76 | ||
76 | class KOex2phonePrefs : public QDialog | 77 | class KOex2phonePrefs : public QDialog |
77 | { | 78 | { |
78 | public: | 79 | public: |
79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 80 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
80 | QDialog( parent, name, true ) | 81 | QDialog( parent, name, true ) |
81 | { | 82 | { |
82 | setCaption( i18n("Export to phone options") ); | 83 | setCaption( i18n("Export to phone options") ); |
83 | QVBoxLayout* lay = new QVBoxLayout( this ); | 84 | QVBoxLayout* lay = new QVBoxLayout( this ); |
@@ -143,48 +144,110 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
143 | mFlagKeyPressed = false; | 144 | mFlagKeyPressed = false; |
144 | setCaption("KO/Pi"); | 145 | setCaption("KO/Pi"); |
145 | KOPrefs *p = KOPrefs::instance(); | 146 | KOPrefs *p = KOPrefs::instance(); |
146 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 147 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
147 | if ( p->mHourSize > 22 ) | 148 | if ( p->mHourSize > 22 ) |
148 | p->mHourSize = 22; | 149 | p->mHourSize = 22; |
149 | QMainWindow::ToolBarDock tbd; | 150 | QMainWindow::ToolBarDock tbd; |
150 | if ( p->mToolBarHor ) { | 151 | if ( p->mToolBarHor ) { |
151 | if ( p->mToolBarUp ) | 152 | if ( p->mToolBarUp ) |
152 | tbd = Bottom; | 153 | tbd = Bottom; |
153 | else | 154 | else |
154 | tbd = Top; | 155 | tbd = Top; |
155 | } | 156 | } |
156 | else { | 157 | else { |
157 | if ( p->mToolBarUp ) | 158 | if ( p->mToolBarUp ) |
158 | tbd = Right; | 159 | tbd = Right; |
159 | else | 160 | else |
160 | tbd = Left; | 161 | tbd = Left; |
161 | } | 162 | } |
162 | if ( KOPrefs::instance()->mUseAppColors ) | 163 | if ( KOPrefs::instance()->mUseAppColors ) |
163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 164 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
164 | globalFlagBlockStartup = 1; | 165 | globalFlagBlockStartup = 1; |
165 | iconToolBar = new QPEToolBar( this ); | 166 | iconToolBar = new QPEToolBar( this ); |
166 | addToolBar (iconToolBar , tbd ); | 167 | addToolBar (iconToolBar , tbd ); |
168 | |||
169 | if ( KOPrefs::instance()->mShowIconFilter ) { | ||
170 | if ( p->mToolBarHorF ) { | ||
171 | if ( p->mToolBarUpF ) | ||
172 | tbd = Bottom; | ||
173 | else | ||
174 | tbd = Top; | ||
175 | } | ||
176 | else { | ||
177 | if ( p->mToolBarUpF ) | ||
178 | tbd = Right; | ||
179 | else | ||
180 | tbd = Left; | ||
181 | } | ||
182 | filterToolBar = new QPEToolBar ( this ); | ||
183 | filterMenubar = new QPEMenuBar( filterToolBar ); | ||
184 | QFontMetrics fm ( filterMenubar->font() ); | ||
185 | |||
186 | filterPopupMenu = new QPopupMenu( this ); | ||
187 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | ||
188 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) ); | ||
189 | addToolBar (filterToolBar , tbd ); | ||
190 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | ||
191 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | ||
192 | } else { | ||
193 | filterToolBar = 0; | ||
194 | filterMenubar = 0; | ||
195 | filterPopupMenu = 0; | ||
196 | } | ||
197 | |||
198 | if ( p->mToolBarHorV ) { | ||
199 | if ( p->mToolBarUpV ) | ||
200 | tbd = Bottom; | ||
201 | else | ||
202 | tbd = Top; | ||
203 | } | ||
204 | else { | ||
205 | if ( p->mToolBarUpV ) | ||
206 | tbd = Right; | ||
207 | else | ||
208 | tbd = Left; | ||
209 | } | ||
210 | viewToolBar = new QPEToolBar( this ); | ||
211 | addToolBar (viewToolBar , tbd ); | ||
212 | if ( p->mToolBarHorN ) { | ||
213 | if ( p->mToolBarUpN ) | ||
214 | tbd = Bottom; | ||
215 | else | ||
216 | tbd = Top; | ||
217 | } | ||
218 | else { | ||
219 | if ( p->mToolBarUpN ) | ||
220 | tbd = Right; | ||
221 | else | ||
222 | tbd = Left; | ||
223 | } | ||
224 | navigatorToolBar = new QPEToolBar( this ); | ||
225 | addToolBar (navigatorToolBar , tbd ); | ||
226 | |||
227 | |||
228 | |||
229 | |||
167 | mCalendarModifiedFlag = false; | 230 | mCalendarModifiedFlag = false; |
168 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 231 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
169 | splash->setAlignment ( AlignCenter ); | 232 | splash->setAlignment ( AlignCenter ); |
170 | setCentralWidget( splash ); | 233 | setCentralWidget( splash ); |
171 | #ifndef DESKTOP_VERSION | 234 | #ifndef DESKTOP_VERSION |
172 | showMaximized(); | 235 | showMaximized(); |
173 | #endif | 236 | #endif |
174 | 237 | ||
175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 238 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
176 | setDefaultPreferences(); | 239 | setDefaultPreferences(); |
177 | mCalendar = new CalendarLocal(); | 240 | mCalendar = new CalendarLocal(); |
178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 241 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
179 | mView->hide(); | 242 | mView->hide(); |
180 | //mView->resize(splash->size() ); | 243 | //mView->resize(splash->size() ); |
181 | initActions(); | 244 | initActions(); |
182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 245 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
183 | mSyncManager->setBlockSave(false); | 246 | mSyncManager->setBlockSave(false); |
184 | mView->setSyncManager(mSyncManager); | 247 | mView->setSyncManager(mSyncManager); |
185 | #ifndef DESKTOP_VERSION | 248 | #ifndef DESKTOP_VERSION |
186 | iconToolBar->show(); | 249 | iconToolBar->show(); |
187 | qApp->processEvents(); | 250 | qApp->processEvents(); |
188 | #endif | 251 | #endif |
189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 252 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
190 | int vh = height() ; | 253 | int vh = height() ; |
@@ -610,48 +673,50 @@ void MainWindow::initActions() | |||
610 | for ( iii = 1;iii<= 10 ;++iii ){ | 673 | for ( iii = 1;iii<= 10 ;++iii ){ |
611 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 674 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
612 | } | 675 | } |
613 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 676 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
614 | 677 | ||
615 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 678 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
616 | this, SLOT( showConfigureAgenda( ) ) ); | 679 | this, SLOT( showConfigureAgenda( ) ) ); |
617 | 680 | ||
618 | icon = loadPixmap( pathString + "configure" ); | 681 | icon = loadPixmap( pathString + "configure" ); |
619 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 682 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
620 | action->addTo( actionMenu ); | 683 | action->addTo( actionMenu ); |
621 | connect( action, SIGNAL( activated() ), | 684 | connect( action, SIGNAL( activated() ), |
622 | mView, SLOT( edit_options() ) ); | 685 | mView, SLOT( edit_options() ) ); |
623 | actionMenu->insertSeparator(); | 686 | actionMenu->insertSeparator(); |
624 | 687 | ||
625 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 688 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
626 | action->addTo( actionMenu ); | 689 | action->addTo( actionMenu ); |
627 | connect( action, SIGNAL( activated() ), | 690 | connect( action, SIGNAL( activated() ), |
628 | mView, SLOT( undo_delete() ) ); | 691 | mView, SLOT( undo_delete() ) ); |
629 | actionMenu->insertSeparator(); | 692 | actionMenu->insertSeparator(); |
630 | 693 | ||
631 | icon = loadPixmap( pathString + "newevent" ); | 694 | icon = loadPixmap( pathString + "newevent" ); |
632 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 695 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
633 | configureToolBarMenu->insertSeparator(); | 696 | configureToolBarMenu->insertSeparator(); |
697 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | ||
698 | configureToolBarMenu->insertSeparator(); | ||
634 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 699 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
635 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 700 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
636 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 701 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
637 | ne_action->addTo( actionMenu ); | 702 | ne_action->addTo( actionMenu ); |
638 | connect( ne_action, SIGNAL( activated() ), | 703 | connect( ne_action, SIGNAL( activated() ), |
639 | mView, SLOT( newEvent() ) ); | 704 | mView, SLOT( newEvent() ) ); |
640 | icon = loadPixmap( pathString + "newtodo" ); | 705 | icon = loadPixmap( pathString + "newtodo" ); |
641 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 706 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
642 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 707 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
643 | nt_action->addTo( actionMenu ); | 708 | nt_action->addTo( actionMenu ); |
644 | connect( nt_action, SIGNAL( activated() ), | 709 | connect( nt_action, SIGNAL( activated() ), |
645 | mView, SLOT( newTodo() ) ); | 710 | mView, SLOT( newTodo() ) ); |
646 | 711 | ||
647 | icon = loadPixmap( pathString + "today" ); | 712 | icon = loadPixmap( pathString + "today" ); |
648 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 713 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
649 | today_action->addTo( viewMenu ); | 714 | today_action->addTo( viewMenu ); |
650 | connect( today_action, SIGNAL( activated() ), | 715 | connect( today_action, SIGNAL( activated() ), |
651 | mView, SLOT( goToday() ) ); | 716 | mView, SLOT( goToday() ) ); |
652 | viewMenu->insertSeparator(); | 717 | viewMenu->insertSeparator(); |
653 | 718 | ||
654 | icon = loadPixmap( pathString + "navi" ); | 719 | icon = loadPixmap( pathString + "navi" ); |
655 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 720 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
656 | action->addTo( viewMenu ); | 721 | action->addTo( viewMenu ); |
657 | connect( action, SIGNAL( activated() ), | 722 | connect( action, SIGNAL( activated() ), |
@@ -978,166 +1043,181 @@ void MainWindow::initActions() | |||
978 | connect( action, SIGNAL( activated() ), | 1043 | connect( action, SIGNAL( activated() ), |
979 | SLOT( aboutKnownBugs() ) ); | 1044 | SLOT( aboutKnownBugs() ) ); |
980 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 1045 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
981 | action->addTo( helpMenu ); | 1046 | action->addTo( helpMenu ); |
982 | connect( action, SIGNAL( activated() ), | 1047 | connect( action, SIGNAL( activated() ), |
983 | SLOT( usertrans() ) ); | 1048 | SLOT( usertrans() ) ); |
984 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1049 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
985 | action->addTo( helpMenu ); | 1050 | action->addTo( helpMenu ); |
986 | connect( action, SIGNAL( activated() ), | 1051 | connect( action, SIGNAL( activated() ), |
987 | SLOT( faq() ) ); | 1052 | SLOT( faq() ) ); |
988 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1053 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
989 | action->addTo( helpMenu ); | 1054 | action->addTo( helpMenu ); |
990 | connect( action, SIGNAL( activated() ), | 1055 | connect( action, SIGNAL( activated() ), |
991 | SLOT( licence() ) ); | 1056 | SLOT( licence() ) ); |
992 | action = new QAction( "about", i18n("About..."), 0, this ); | 1057 | action = new QAction( "about", i18n("About..."), 0, this ); |
993 | action->addTo( helpMenu ); | 1058 | action->addTo( helpMenu ); |
994 | connect( action, SIGNAL( activated() ), | 1059 | connect( action, SIGNAL( activated() ), |
995 | SLOT( about() ) ); | 1060 | SLOT( about() ) ); |
996 | //menuBar->insertSeparator(); | 1061 | //menuBar->insertSeparator(); |
997 | 1062 | ||
998 | // ****************************************************** | 1063 | // ****************************************************** |
999 | // menubar icons | 1064 | // menubar icons |
1000 | 1065 | ||
1001 | 1066 | ||
1002 | iconToolBar->setHorizontalStretchable (true ); | 1067 | |
1003 | //menuBar->insertItem( iconToolBar ); | 1068 | //menuBar->insertItem( iconToolBar ); |
1004 | //xdays_action | 1069 | //xdays_action |
1005 | if (p-> mShowIconNewEvent) | 1070 | if (p-> mShowIconNewEvent) |
1006 | ne_action->addTo( iconToolBar ); | 1071 | ne_action->addTo( iconToolBar ); |
1007 | if (p->mShowIconNewTodo ) | 1072 | if (p->mShowIconNewTodo ) |
1008 | nt_action->addTo( iconToolBar ); | 1073 | nt_action->addTo( iconToolBar ); |
1009 | if (p-> mShowIconSearch) | 1074 | if (p-> mShowIconSearch) |
1010 | search_action->addTo( iconToolBar ); | 1075 | search_action->addTo( iconToolBar ); |
1011 | if (p-> mShowIconWhatsThis) | 1076 | if (p-> mShowIconWhatsThis) |
1012 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1077 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1013 | if (p-> mShowIconNext) | 1078 | if (p-> mShowIconNext) |
1014 | whatsnext_action->addTo( iconToolBar ); | 1079 | whatsnext_action->addTo( viewToolBar ); |
1015 | if (p-> mShowIconNextDays) | 1080 | if (p-> mShowIconNextDays) |
1016 | xdays_action->addTo( iconToolBar ); | 1081 | xdays_action->addTo( viewToolBar ); |
1017 | if (p-> mShowIconJournal) | 1082 | if (p-> mShowIconJournal) |
1018 | viewjournal_action->addTo( iconToolBar ); | 1083 | viewjournal_action->addTo( viewToolBar ); |
1019 | if (p-> mShowIconDay1) | 1084 | if (p-> mShowIconDay1) |
1020 | day1_action->addTo( iconToolBar ); | 1085 | day1_action->addTo( viewToolBar ); |
1021 | if (p-> mShowIconDay5) | 1086 | if (p-> mShowIconDay5) |
1022 | day5_action->addTo( iconToolBar ); | 1087 | day5_action->addTo( viewToolBar ); |
1023 | if (p-> mShowIconDay7) | 1088 | if (p-> mShowIconDay7) |
1024 | day7_action->addTo( iconToolBar ); | 1089 | day7_action->addTo( viewToolBar ); |
1025 | if (p-> mShowIconDay6) | 1090 | if (p-> mShowIconDay6) |
1026 | day6_action->addTo( iconToolBar ); | 1091 | day6_action->addTo( viewToolBar ); |
1027 | if (p-> mShowIconMonth) | 1092 | if (p-> mShowIconMonth) |
1028 | month_action->addTo( iconToolBar ); | 1093 | month_action->addTo( viewToolBar ); |
1029 | if (p-> mShowIconList) | 1094 | if (p-> mShowIconList) |
1030 | showlist_action->addTo( iconToolBar ); | 1095 | showlist_action->addTo( viewToolBar ); |
1031 | if (p-> mShowIconTodoview) | 1096 | if (p-> mShowIconTodoview) |
1032 | todoview_action->addTo( iconToolBar ); | 1097 | todoview_action->addTo( viewToolBar ); |
1033 | 1098 | ||
1034 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1099 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1035 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1100 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1036 | if (p-> mShowIconBackFast) { | 1101 | if (p-> mShowIconBackFast) { |
1037 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1102 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1038 | connect( action, SIGNAL( activated() ), | 1103 | connect( action, SIGNAL( activated() ), |
1039 | mView, SLOT( goPreviousMonth() ) ); | 1104 | mView, SLOT( goPreviousMonth() ) ); |
1040 | action->addTo( iconToolBar ); | 1105 | action->addTo( navigatorToolBar ); |
1041 | } | 1106 | } |
1042 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1107 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1043 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1108 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1044 | if (p-> mShowIconBack) { | 1109 | if (p-> mShowIconBack) { |
1045 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1110 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1046 | connect( action, SIGNAL( activated() ), | 1111 | connect( action, SIGNAL( activated() ), |
1047 | mView, SLOT( goPrevious() ) ); | 1112 | mView, SLOT( goPrevious() ) ); |
1048 | action->addTo( iconToolBar ); | 1113 | action->addTo( navigatorToolBar ); |
1049 | } | 1114 | } |
1050 | icon = loadPixmap( pathString + "today" ); | 1115 | icon = loadPixmap( pathString + "today" ); |
1051 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1116 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1052 | if (p-> mShowIconToday) | 1117 | if (p-> mShowIconToday) |
1053 | today_action->addTo( iconToolBar ); | 1118 | today_action->addTo( navigatorToolBar ); |
1054 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1119 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1055 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1120 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1056 | if (p-> mShowIconForward) { | 1121 | if (p-> mShowIconForward) { |
1057 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1122 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1058 | connect( action, SIGNAL( activated() ), | 1123 | connect( action, SIGNAL( activated() ), |
1059 | mView, SLOT( goNext() ) ); | 1124 | mView, SLOT( goNext() ) ); |
1060 | action->addTo( iconToolBar ); | 1125 | action->addTo( navigatorToolBar ); |
1061 | } | 1126 | } |
1062 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1127 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1063 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1128 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1064 | if (p-> mShowIconForwardFast) { | 1129 | if (p-> mShowIconForwardFast) { |
1065 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1130 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1066 | connect( action, SIGNAL( activated() ), | 1131 | connect( action, SIGNAL( activated() ), |
1067 | mView, SLOT( goNextMonth() ) ); | 1132 | mView, SLOT( goNextMonth() ) ); |
1068 | action->addTo( iconToolBar ); | 1133 | action->addTo( navigatorToolBar ); |
1069 | } | 1134 | } |
1070 | 1135 | ||
1071 | 1136 | ||
1072 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); | 1137 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); |
1073 | 1138 | ||
1074 | if (p-> mShowIconNewEvent) | 1139 | if (p-> mShowIconNewEvent) |
1075 | configureToolBarMenu->setItemChecked( 10, true ); | 1140 | configureToolBarMenu->setItemChecked( 10, true ); |
1076 | if (p->mShowIconNewTodo ) | 1141 | if (p->mShowIconNewTodo ) |
1077 | configureToolBarMenu->setItemChecked( 20, true ); | 1142 | configureToolBarMenu->setItemChecked( 20, true ); |
1078 | if (p-> mShowIconSearch) | 1143 | if (p-> mShowIconSearch) |
1079 | configureToolBarMenu->setItemChecked( 120, true ); | 1144 | configureToolBarMenu->setItemChecked( 120, true ); |
1080 | if (p-> mShowIconList) | 1145 | if (p-> mShowIconList) |
1081 | configureToolBarMenu->setItemChecked( 30, true ); | 1146 | configureToolBarMenu->setItemChecked( 30, true ); |
1082 | if (p-> mShowIconDay1) | 1147 | if (p-> mShowIconDay1) |
1083 | configureToolBarMenu->setItemChecked( 40, true ); | 1148 | configureToolBarMenu->setItemChecked( 40, true ); |
1084 | if (p-> mShowIconDay5) | 1149 | if (p-> mShowIconDay5) |
1085 | configureToolBarMenu->setItemChecked( 50, true ); | 1150 | configureToolBarMenu->setItemChecked( 50, true ); |
1086 | if (p-> mShowIconDay6) | 1151 | if (p-> mShowIconDay6) |
1087 | configureToolBarMenu->setItemChecked( 75, true ); | 1152 | configureToolBarMenu->setItemChecked( 75, true ); |
1088 | if (p-> mShowIconDay7) | 1153 | if (p-> mShowIconDay7) |
1089 | configureToolBarMenu->setItemChecked( 60, true ); | 1154 | configureToolBarMenu->setItemChecked( 60, true ); |
1090 | if (p-> mShowIconMonth) | 1155 | if (p-> mShowIconMonth) |
1091 | configureToolBarMenu->setItemChecked( 70, true ); | 1156 | configureToolBarMenu->setItemChecked( 70, true ); |
1092 | if (p-> mShowIconTodoview) | 1157 | if (p-> mShowIconTodoview) |
1093 | configureToolBarMenu->setItemChecked( 80, true ); | 1158 | configureToolBarMenu->setItemChecked( 80, true ); |
1094 | if (p-> mShowIconBackFast) | 1159 | if (p-> mShowIconBackFast) |
1095 | configureToolBarMenu->setItemChecked( 200, true ); | 1160 | configureToolBarMenu->setItemChecked( 200, true ); |
1096 | if (p-> mShowIconBack) | 1161 | if (p-> mShowIconBack) |
1097 | configureToolBarMenu->setItemChecked( 210, true ); | 1162 | configureToolBarMenu->setItemChecked( 210, true ); |
1098 | if (p-> mShowIconToday) | 1163 | if (p-> mShowIconToday) |
1099 | configureToolBarMenu->setItemChecked( 130, true ); | 1164 | configureToolBarMenu->setItemChecked( 130, true ); |
1100 | if (p-> mShowIconForward) | 1165 | if (p-> mShowIconForward) |
1101 | configureToolBarMenu->setItemChecked( 220, true ); | 1166 | configureToolBarMenu->setItemChecked( 220, true ); |
1102 | if (p-> mShowIconForwardFast) | 1167 | if (p-> mShowIconForwardFast) |
1103 | configureToolBarMenu->setItemChecked( 230, true ); | 1168 | configureToolBarMenu->setItemChecked( 230, true ); |
1104 | if (p-> mShowIconNextDays) | 1169 | if (p-> mShowIconNextDays) |
1105 | configureToolBarMenu->setItemChecked( 100, true ); | 1170 | configureToolBarMenu->setItemChecked( 100, true ); |
1106 | if (p-> mShowIconNext) | 1171 | if (p-> mShowIconNext) |
1107 | configureToolBarMenu->setItemChecked( 110, true ); | 1172 | configureToolBarMenu->setItemChecked( 110, true ); |
1108 | if (p-> mShowIconJournal) | 1173 | if (p-> mShowIconJournal) |
1109 | configureToolBarMenu->setItemChecked( 90, true ); | 1174 | configureToolBarMenu->setItemChecked( 90, true ); |
1110 | if (p-> mShowIconWhatsThis) | 1175 | if (p-> mShowIconWhatsThis) |
1111 | configureToolBarMenu->setItemChecked( 300, true ); | 1176 | configureToolBarMenu->setItemChecked( 300, true ); |
1112 | if (p-> mShowIconWeekNum) | 1177 | if (p-> mShowIconWeekNum) |
1113 | configureToolBarMenu->setItemChecked( 400, true ); | 1178 | configureToolBarMenu->setItemChecked( 400, true ); |
1114 | QLabel* dummy = new QLabel( iconToolBar ); | 1179 | if (!p-> mShowIconStretch) { |
1115 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1180 | QLabel* dummy = new QLabel( iconToolBar ); |
1116 | if (!p-> mShowIconStretch) | 1181 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1182 | dummy->setMinimumWidth( 0 ); | ||
1117 | iconToolBar->setStretchableWidget ( dummy ) ; | 1183 | iconToolBar->setStretchableWidget ( dummy ) ; |
1118 | else | 1184 | } |
1185 | else { | ||
1186 | iconToolBar->setHorizontalStretchable (true ); | ||
1187 | viewToolBar->setHorizontalStretchable (true ); | ||
1188 | navigatorToolBar->setHorizontalStretchable (true ); | ||
1189 | iconToolBar->setVerticalStretchable (true ); | ||
1190 | viewToolBar->setVerticalStretchable (true ); | ||
1191 | navigatorToolBar->setVerticalStretchable (true ); | ||
1119 | configureToolBarMenu->setItemChecked( 5, true ); | 1192 | configureToolBarMenu->setItemChecked( 5, true ); |
1193 | } | ||
1194 | if (p-> mShowIconFilter) | ||
1195 | configureToolBarMenu->setItemChecked( 7, true ); | ||
1196 | |||
1197 | |||
1198 | if ( filterMenubar ) | ||
1199 | connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); | ||
1120 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1200 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1121 | configureAgenda( p->mHourSize ); | 1201 | configureAgenda( p->mHourSize ); |
1122 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1202 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1123 | } | 1203 | } |
1124 | 1204 | ||
1125 | void MainWindow::exportToPhone( int mode ) | 1205 | void MainWindow::exportToPhone( int mode ) |
1126 | { | 1206 | { |
1127 | 1207 | ||
1128 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1208 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1129 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1209 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1130 | KOex2phonePrefs ex2phone; | 1210 | KOex2phonePrefs ex2phone; |
1131 | 1211 | ||
1132 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1212 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1133 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1213 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1134 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1214 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1135 | if ( mode == 1 ) | 1215 | if ( mode == 1 ) |
1136 | ex2phone.setCaption(i18n("Export complete calendar")); | 1216 | ex2phone.setCaption(i18n("Export complete calendar")); |
1137 | if ( mode == 2 ) | 1217 | if ( mode == 2 ) |
1138 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1218 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1139 | 1219 | ||
1140 | if ( !ex2phone.exec() ) { | 1220 | if ( !ex2phone.exec() ) { |
1141 | return; | 1221 | return; |
1142 | } | 1222 | } |
1143 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1223 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
@@ -1540,50 +1620,69 @@ void MainWindow::importQtopia() | |||
1540 | #ifndef DESKTOP_VERSION | 1620 | #ifndef DESKTOP_VERSION |
1541 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1621 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1542 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1622 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1543 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1623 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1544 | #else | 1624 | #else |
1545 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1625 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1546 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1626 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1547 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1627 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1548 | #endif | 1628 | #endif |
1549 | mView->importQtopia( categories, datebook, todolist ); | 1629 | mView->importQtopia( categories, datebook, todolist ); |
1550 | } | 1630 | } |
1551 | #if 0 | 1631 | #if 0 |
1552 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1632 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1553 | i18n("Not supported \non desktop!\n"), | 1633 | i18n("Not supported \non desktop!\n"), |
1554 | i18n("Ok"), i18n("Cancel"), 0, | 1634 | i18n("Ok"), i18n("Cancel"), 0, |
1555 | 0, 1 ); | 1635 | 0, 1 ); |
1556 | 1636 | ||
1557 | #endif | 1637 | #endif |
1558 | } | 1638 | } |
1559 | 1639 | ||
1560 | void MainWindow::saveOnClose() | 1640 | void MainWindow::saveOnClose() |
1561 | { | 1641 | { |
1562 | KOPrefs *p = KOPrefs::instance(); | 1642 | KOPrefs *p = KOPrefs::instance(); |
1563 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1643 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1564 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1644 | if ( p->mToolBarHor ) |
1565 | iconToolBar->y() > height()/2; | 1645 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1646 | else | ||
1647 | p->mToolBarUp = iconToolBar->x() > width()/2; | ||
1648 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | ||
1649 | if ( p->mToolBarHorV ) | ||
1650 | p->mToolBarUpV = viewToolBar->y() > height()/2; | ||
1651 | else | ||
1652 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; | ||
1653 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | ||
1654 | if ( p->mToolBarHorN ) | ||
1655 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; | ||
1656 | else | ||
1657 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | ||
1658 | if ( filterToolBar ) { | ||
1659 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | ||
1660 | if ( p->mToolBarHorF ) | ||
1661 | p->mToolBarUpF = filterToolBar->y() > height()/2; | ||
1662 | else | ||
1663 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | ||
1664 | } | ||
1566 | mView->writeSettings(); | 1665 | mView->writeSettings(); |
1567 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1666 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1568 | save(); | 1667 | save(); |
1569 | } | 1668 | } |
1570 | void MainWindow::slotModifiedChanged( bool changed ) | 1669 | void MainWindow::slotModifiedChanged( bool changed ) |
1571 | { | 1670 | { |
1572 | if ( mBlockAtStartup ) | 1671 | if ( mBlockAtStartup ) |
1573 | return; | 1672 | return; |
1574 | 1673 | ||
1575 | int msec; | 1674 | int msec; |
1576 | // we store the changes after 1 minute, | 1675 | // we store the changes after 1 minute, |
1577 | // and for safety reasons after 10 minutes again | 1676 | // and for safety reasons after 10 minutes again |
1578 | if ( !mSyncManager->blockSave() ) | 1677 | if ( !mSyncManager->blockSave() ) |
1579 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1678 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1580 | else | 1679 | else |
1581 | msec = 1000 * 600; | 1680 | msec = 1000 * 600; |
1582 | mSaveTimer.start( msec, true ); // 1 minute | 1681 | mSaveTimer.start( msec, true ); // 1 minute |
1583 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1682 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1584 | mCalendarModifiedFlag = true; | 1683 | mCalendarModifiedFlag = true; |
1585 | } | 1684 | } |
1586 | void MainWindow::saveStopTimer() | 1685 | void MainWindow::saveStopTimer() |
1587 | { | 1686 | { |
1588 | mSaveTimer.stop(); | 1687 | mSaveTimer.stop(); |
1589 | if (mSaveTimer.isActive() ) | 1688 | if (mSaveTimer.isActive() ) |
@@ -1784,89 +1883,128 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1784 | configureAgenda( size ); | 1883 | configureAgenda( size ); |
1785 | break; | 1884 | break; |
1786 | case Qt::Key_Minus: | 1885 | case Qt::Key_Minus: |
1787 | size = p->mHourSize - 2; | 1886 | size = p->mHourSize - 2; |
1788 | if ( size >= 4 ) | 1887 | if ( size >= 4 ) |
1789 | configureAgenda( size ); | 1888 | configureAgenda( size ); |
1790 | break; | 1889 | break; |
1791 | 1890 | ||
1792 | 1891 | ||
1793 | default: | 1892 | default: |
1794 | e->ignore(); | 1893 | e->ignore(); |
1795 | } | 1894 | } |
1796 | if ( pro > 0 ) { | 1895 | if ( pro > 0 ) { |
1797 | mView->selectFilter( pro-1 ); | 1896 | mView->selectFilter( pro-1 ); |
1798 | } | 1897 | } |
1799 | if ( showSelectedDates ) { | 1898 | if ( showSelectedDates ) { |
1800 | ;// setCaptionToDates(); | 1899 | ;// setCaptionToDates(); |
1801 | } | 1900 | } |
1802 | 1901 | ||
1803 | } | 1902 | } |
1804 | 1903 | ||
1805 | void MainWindow::fillFilterMenu() | 1904 | void MainWindow::fillFilterMenu() |
1806 | { | 1905 | { |
1807 | selectFilterMenu->clear(); | 1906 | selectFilterMenu->clear(); |
1808 | bool disable = false; | ||
1809 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1907 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1810 | selectFilterMenu->insertSeparator(); | 1908 | selectFilterMenu->insertSeparator(); |
1811 | if ( mView->filterView()->filtersEnabled() ) { | 1909 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); |
1812 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1910 | |
1813 | } | ||
1814 | else { | ||
1815 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | ||
1816 | disable = true; | ||
1817 | } | ||
1818 | selectFilterMenu->insertSeparator(); | 1911 | selectFilterMenu->insertSeparator(); |
1819 | QPtrList<CalFilter> fili = mView->filters(); | 1912 | QPtrList<CalFilter> fili = mView->filters(); |
1820 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1913 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1821 | CalFilter *filter = fili.first(); | 1914 | CalFilter *filter = fili.first(); |
1822 | int iii = 2; | 1915 | int iii = 2; |
1916 | bool checkitem = mView->filterView()->filtersEnabled(); | ||
1823 | while(filter) { | 1917 | while(filter) { |
1824 | selectFilterMenu->insertItem( filter->name(), iii ); | 1918 | selectFilterMenu->insertItem( filter->name(), iii ); |
1825 | if ( filter == curfilter) | 1919 | if ( filter == curfilter) |
1826 | selectFilterMenu->setItemChecked( iii, true ); | 1920 | selectFilterMenu->setItemChecked( iii, checkitem ); |
1827 | if ( disable ) | ||
1828 | selectFilterMenu->setItemEnabled( iii, false ); | ||
1829 | filter = fili.next(); | 1921 | filter = fili.next(); |
1830 | ++iii; | 1922 | ++iii; |
1831 | } | 1923 | } |
1924 | if ( !checkitem ) | ||
1925 | selectFilterMenu->setItemChecked( 1, true ); | ||
1926 | } | ||
1927 | void MainWindow::fillFilterMenuPopup() | ||
1928 | { | ||
1929 | filterPopupMenu->clear(); | ||
1930 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); | ||
1931 | |||
1932 | filterPopupMenu->insertSeparator(); | ||
1933 | QPtrList<CalFilter> fili = mView->filters(); | ||
1934 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | ||
1935 | CalFilter *filter = fili.first(); | ||
1936 | int iii = 1; | ||
1937 | bool checkitem = mView->filterView()->filtersEnabled(); | ||
1938 | while(filter) { | ||
1939 | filterPopupMenu->insertItem( filter->name(), iii ); | ||
1940 | if ( filter == curfilter) | ||
1941 | filterPopupMenu->setItemChecked( iii, checkitem ); | ||
1942 | filter = fili.next(); | ||
1943 | ++iii; | ||
1944 | } | ||
1945 | if ( !checkitem ) | ||
1946 | filterPopupMenu->setItemChecked( 0, true ); | ||
1832 | } | 1947 | } |
1833 | void MainWindow::selectFilter( int fil ) | 1948 | void MainWindow::selectFilter( int fil ) |
1834 | { | 1949 | { |
1950 | |||
1835 | if ( fil == 0 ) { | 1951 | if ( fil == 0 ) { |
1836 | mView->editFilters( ); | 1952 | mView->editFilters( ); |
1837 | } else if ( fil == 1 ){ | 1953 | } else if ( fil == 1 ){ |
1838 | mView->toggleFilerEnabled( ); | 1954 | if ( mView->filterView()->filtersEnabled() ) |
1955 | mView->toggleFilerEnabled( ); | ||
1839 | } else { | 1956 | } else { |
1957 | if ( !mView->filterView()->filtersEnabled() ) | ||
1958 | mView->toggleFilerEnabled( ); | ||
1840 | mView->selectFilter( fil-2 ); | 1959 | mView->selectFilter( fil-2 ); |
1960 | } | ||
1961 | } | ||
1962 | void MainWindow::updateFilterToolbar() | ||
1963 | { | ||
1964 | if ( filterMenubar ) { | ||
1965 | if ( !mView->filterView()->filtersEnabled() ) { | ||
1966 | filterMenubar->changeItem( 0, i18n("No Filter") ); | ||
1967 | } else { | ||
1968 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | ||
1969 | if ( curfilter ) { | ||
1970 | filterMenubar->changeItem( 0, curfilter->name() ); | ||
1971 | } | ||
1972 | } | ||
1841 | } | 1973 | } |
1842 | } | 1974 | } |
1975 | void MainWindow::selectFilterPopup( int fil ) | ||
1976 | { | ||
1977 | selectFilter( fil + 1 ); | ||
1978 | |||
1979 | } | ||
1843 | void MainWindow::configureToolBar( int item ) | 1980 | void MainWindow::configureToolBar( int item ) |
1844 | { | 1981 | { |
1845 | 1982 | ||
1846 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1983 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1847 | KOPrefs *p = KOPrefs::instance(); | 1984 | KOPrefs *p = KOPrefs::instance(); |
1848 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1985 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1986 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); | ||
1849 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1987 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1850 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1988 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1851 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1989 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1852 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1990 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1853 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1991 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1854 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1992 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1855 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 1993 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
1856 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1994 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1857 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1995 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1858 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1996 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1859 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1997 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1860 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1998 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1861 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1999 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1862 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 2000 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1863 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 2001 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1864 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 2002 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1865 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 2003 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1866 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 2004 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1867 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 2005 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1868 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 2006 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
1869 | // initActions(); | 2007 | // initActions(); |
1870 | } | 2008 | } |
1871 | void MainWindow::setCaption ( const QString & c ) | 2009 | void MainWindow::setCaption ( const QString & c ) |
1872 | { | 2010 | { |