summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-28 11:59:41 (UTC)
committer zautrix <zautrix>2005-03-28 11:59:41 (UTC)
commit314908d5d9139af7711c6e425260363bb014afce (patch) (unidiff)
tree8b4a72042d6f2e158c64b6b1cbfb7ef002d2fd61 /korganizer
parent9ff0641f33e63cc88e96d0066dba43b4699ca489 (diff)
downloadkdepimpi-314908d5d9139af7711c6e425260363bb014afce.zip
kdepimpi-314908d5d9139af7711c6e425260363bb014afce.tar.gz
kdepimpi-314908d5d9139af7711c6e425260363bb014afce.tar.bz2
toolbar fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/mainwindow.cpp70
3 files changed, 42 insertions, 30 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 2168094..1e68a44 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -62,64 +62,65 @@ KOPrefs::KOPrefs() :
62 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 62 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
63 QColor defaultTodoDueTodayColor = QColor(255,220,100); 63 QColor defaultTodoDueTodayColor = QColor(255,220,100);
64 QColor defaultTodoOverdueColor = QColor(255,153,125); 64 QColor defaultTodoOverdueColor = QColor(255,153,125);
65 65
66 66
67 KPrefs::setCurrentGroup("General"); 67 KPrefs::setCurrentGroup("General");
68 68
69 69
70 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 70 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
71 71
72 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 72 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
73 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 73 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
74 addItemBool("ShowIconSearch",&mShowIconSearch,true); 74 addItemBool("ShowIconSearch",&mShowIconSearch,true);
75 addItemBool("ShowIconList",&mShowIconList,true); 75 addItemBool("ShowIconList",&mShowIconList,true);
76 addItemBool("ShowIconDay1",&mShowIconDay1,true); 76 addItemBool("ShowIconDay1",&mShowIconDay1,true);
77 addItemBool("ShowIconDay5",&mShowIconDay5,true); 77 addItemBool("ShowIconDay5",&mShowIconDay5,true);
78 addItemBool("ShowIconDay6",&mShowIconDay6,true); 78 addItemBool("ShowIconDay6",&mShowIconDay6,true);
79 addItemBool("ShowIconDay7",&mShowIconDay7,true); 79 addItemBool("ShowIconDay7",&mShowIconDay7,true);
80 addItemBool("ShowIconMonth",&mShowIconMonth,true); 80 addItemBool("ShowIconMonth",&mShowIconMonth,true);
81 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 81 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
82 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 82 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
83 addItemBool("ShowIconBack",&mShowIconBack,true); 83 addItemBool("ShowIconBack",&mShowIconBack,true);
84 addItemBool("ShowIconToday",&mShowIconToday,true); 84 addItemBool("ShowIconToday",&mShowIconToday,true);
85 addItemBool("ShowIconForward",&mShowIconForward,true); 85 addItemBool("ShowIconForward",&mShowIconForward,true);
86 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 86 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
87 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 87 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
88 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); 88 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true);
89 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 89 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
90 addItemBool("ShowIconNext",&mShowIconNext,true); 90 addItemBool("ShowIconNext",&mShowIconNext,true);
91 addItemBool("ShowIconJournal",&mShowIconJournal,true); 91 addItemBool("ShowIconJournal",&mShowIconJournal,true);
92 addItemBool("ShowIconStretch",&mShowIconStretch,true); 92 addItemBool("ShowIconStretch",&mShowIconStretch,true);
93 addItemBool("ShowIconFilter",&mShowIconFilter,false); 93 addItemBool("ShowIconFilter",&mShowIconFilter,false);
94 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true);
94 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 95 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
95 96
96 addItemBool("AskForQuit",&mAskForQuit,false); 97 addItemBool("AskForQuit",&mAskForQuit,false);
97 98
98#ifndef DESKTOP_VERSION 99#ifndef DESKTOP_VERSION
99 addItemBool("ShowFullMenu",&mShowFullMenu,false); 100 addItemBool("ShowFullMenu",&mShowFullMenu,false);
100#else 101#else
101 addItemBool("ShowFullMenu",&mShowFullMenu,true); 102 addItemBool("ShowFullMenu",&mShowFullMenu,true);
102#endif 103#endif
103 addItemBool("ToolBarHor",&mToolBarHor, true ); 104 addItemBool("ToolBarHor",&mToolBarHor, true );
104 addItemBool("ToolBarUp",&mToolBarUp, false ); 105 addItemBool("ToolBarUp",&mToolBarUp, false );
105 addItemBool("ToolBarHorV",&mToolBarHorV, true ); 106 addItemBool("ToolBarHorV",&mToolBarHorV, true );
106 addItemBool("ToolBarUpV",&mToolBarUpV, false ); 107 addItemBool("ToolBarUpV",&mToolBarUpV, false );
107 addItemBool("ToolBarHorN",&mToolBarHorN, true ); 108 addItemBool("ToolBarHorN",&mToolBarHorN, true );
108 addItemBool("ToolBarUpN",&mToolBarUpN, false ); 109 addItemBool("ToolBarUpN",&mToolBarUpN, false );
109 addItemBool("ToolBarHorF",&mToolBarHorF, true ); 110 addItemBool("ToolBarHorF",&mToolBarHorF, true );
110 addItemBool("ToolBarUpF",&mToolBarUpF, false ); 111 addItemBool("ToolBarUpF",&mToolBarUpF, false );
111 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 112 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
112 addItemInt("Whats Next Days",&mWhatsNextDays,3); 113 addItemInt("Whats Next Days",&mWhatsNextDays,3);
113 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 114 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
114 115
115 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 116 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
116 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 117 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
117 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 118 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
118 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 119 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
119 addItemInt("AllDay Size",&mAllDaySize,28); 120 addItemInt("AllDay Size",&mAllDaySize,28);
120 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 121 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
121 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 122 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
122 123
123 addItemStringList("LocationDefaults",&mLocationDefaults ); 124 addItemStringList("LocationDefaults",&mLocationDefaults );
124 addItemStringList("EventSummary User",&mEventSummaryUser); 125 addItemStringList("EventSummary User",&mEventSummaryUser);
125 addItemStringList("TodoSummary User",&mTodoSummaryUser); 126 addItemStringList("TodoSummary User",&mTodoSummaryUser);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 8dfdf69..fbce6ea 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -157,64 +157,65 @@ class KOPrefs : public KPimPrefs
157 bool mFullViewTodo; 157 bool mFullViewTodo;
158 bool mShowCompletedTodo; 158 bool mShowCompletedTodo;
159 bool mMarcusBainsEnabled; 159 bool mMarcusBainsEnabled;
160 int mNextXDays; 160 int mNextXDays;
161 int mWhatsNextDays; 161 int mWhatsNextDays;
162 int mWhatsNextPrios; 162 int mWhatsNextPrios;
163 bool mEnableQuickTodo; 163 bool mEnableQuickTodo;
164 164
165 bool mCompactDialogs; 165 bool mCompactDialogs;
166 bool mVerticalScreen; 166 bool mVerticalScreen;
167 167
168 bool mShowIconNewTodo; 168 bool mShowIconNewTodo;
169 bool mShowIconNewEvent; 169 bool mShowIconNewEvent;
170 bool mShowIconSearch; 170 bool mShowIconSearch;
171 bool mShowIconList; 171 bool mShowIconList;
172 bool mShowIconDay1; 172 bool mShowIconDay1;
173 bool mShowIconDay5; 173 bool mShowIconDay5;
174 bool mShowIconDay6; 174 bool mShowIconDay6;
175 bool mShowIconDay7; 175 bool mShowIconDay7;
176 bool mShowIconMonth; 176 bool mShowIconMonth;
177 bool mShowIconTodoview; 177 bool mShowIconTodoview;
178 bool mShowIconBackFast; 178 bool mShowIconBackFast;
179 bool mShowIconBack; 179 bool mShowIconBack;
180 bool mShowIconToday; 180 bool mShowIconToday;
181 bool mShowIconForward; 181 bool mShowIconForward;
182 bool mShowIconForwardFast; 182 bool mShowIconForwardFast;
183 bool mShowIconWhatsThis; 183 bool mShowIconWhatsThis;
184 bool mShowIconWeekNum; 184 bool mShowIconWeekNum;
185 bool mShowIconNextDays; 185 bool mShowIconNextDays;
186 bool mShowIconNext; 186 bool mShowIconNext;
187 bool mShowIconJournal; 187 bool mShowIconJournal;
188 bool mShowIconFilter; 188 bool mShowIconFilter;
189 bool mShowIconOnetoolbar;
189 190
190 bool mShowIconStretch; 191 bool mShowIconStretch;
191 192
192 bool mToolBarHor; 193 bool mToolBarHor;
193 bool mToolBarUp; 194 bool mToolBarUp;
194 bool mToolBarHorV; 195 bool mToolBarHorV;
195 bool mToolBarUpV; 196 bool mToolBarUpV;
196 bool mToolBarHorN; 197 bool mToolBarHorN;
197 bool mToolBarUpN; 198 bool mToolBarUpN;
198 bool mToolBarHorF; 199 bool mToolBarHorF;
199 bool mToolBarUpF; 200 bool mToolBarUpF;
200 bool mToolBarMiniIcons; 201 bool mToolBarMiniIcons;
201 202
202 bool mAskForQuit; 203 bool mAskForQuit;
203 bool mUsePassWd; 204 bool mUsePassWd;
204 bool mShowSyncEvents; 205 bool mShowSyncEvents;
205 bool mShowTodoInAgenda; 206 bool mShowTodoInAgenda;
206 bool mShowTimeInAgenda; 207 bool mShowTimeInAgenda;
207 bool mHideNonStartedTodos; 208 bool mHideNonStartedTodos;
208 209
209 int mLastSyncTime; 210 int mLastSyncTime;
210 void setCategoryColor(QString cat,const QColor & color); 211 void setCategoryColor(QString cat,const QColor & color);
211 QColor *categoryColor(QString cat); 212 QColor *categoryColor(QString cat);
212 213
213 QString mArchiveFile; 214 QString mArchiveFile;
214 QString mHtmlExportFile; 215 QString mHtmlExportFile;
215 bool mHtmlWithSave; 216 bool mHtmlWithSave;
216 217
217 QStringList mSelectedPlugins; 218 QStringList mSelectedPlugins;
218 219
219 QString mLastImportFile; 220 QString mLastImportFile;
220 QString mLastVcalFile; 221 QString mLastVcalFile;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c6ae868..a4e0834 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -165,94 +165,97 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
165 globalFlagBlockStartup = 1; 165 globalFlagBlockStartup = 1;
166 iconToolBar = new QPEToolBar( this ); 166 iconToolBar = new QPEToolBar( this );
167 addToolBar (iconToolBar , tbd ); 167 addToolBar (iconToolBar , tbd );
168 168
169 if ( KOPrefs::instance()->mShowIconFilter ) { 169 if ( KOPrefs::instance()->mShowIconFilter ) {
170 if ( p->mToolBarHorF ) { 170 if ( p->mToolBarHorF ) {
171 if ( p->mToolBarUpF ) 171 if ( p->mToolBarUpF )
172 tbd = Bottom; 172 tbd = Bottom;
173 else 173 else
174 tbd = Top; 174 tbd = Top;
175 } 175 }
176 else { 176 else {
177 if ( p->mToolBarUpF ) 177 if ( p->mToolBarUpF )
178 tbd = Right; 178 tbd = Right;
179 else 179 else
180 tbd = Left; 180 tbd = Left;
181 } 181 }
182 filterToolBar = new QPEToolBar ( this ); 182 filterToolBar = new QPEToolBar ( this );
183 filterMenubar = new QPEMenuBar( filterToolBar ); 183 filterMenubar = new QPEMenuBar( filterToolBar );
184 QFontMetrics fm ( filterMenubar->font() ); 184 QFontMetrics fm ( filterMenubar->font() );
185 185
186 filterPopupMenu = new QPopupMenu( this ); 186 filterPopupMenu = new QPopupMenu( this );
187 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 187 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
188 filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) ); 188 filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) );
189 addToolBar (filterToolBar , tbd ); 189 addToolBar (filterToolBar , tbd );
190 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 190 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
191 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 191 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
192 } else { 192 } else {
193 filterToolBar = 0; 193 filterToolBar = 0;
194 filterMenubar = 0; 194 filterMenubar = 0;
195 filterPopupMenu = 0; 195 filterPopupMenu = 0;
196 } 196 }
197 197 if ( p->mShowIconOnetoolbar ) {
198 if ( p->mToolBarHorV ) { 198 viewToolBar = iconToolBar ;
199 if ( p->mToolBarUpV ) 199 navigatorToolBar = iconToolBar ;
200 tbd = Bottom; 200 } else {
201 else 201 if ( p->mToolBarHorV ) {
202 tbd = Top; 202 if ( p->mToolBarUpV )
203 } 203 tbd = Bottom;
204 else { 204 else
205 if ( p->mToolBarUpV ) 205 tbd = Top;
206 tbd = Right; 206 }
207 else 207 else {
208 tbd = Left; 208 if ( p->mToolBarUpV )
209 } 209 tbd = Right;
210 viewToolBar = new QPEToolBar( this ); 210 else
211 addToolBar (viewToolBar , tbd ); 211 tbd = Left;
212 if ( p->mToolBarHorN ) { 212 }
213 if ( p->mToolBarUpN ) 213 viewToolBar = new QPEToolBar( this );
214 tbd = Bottom; 214 addToolBar (viewToolBar , tbd );
215 else 215 if ( p->mToolBarHorN ) {
216 tbd = Top; 216 if ( p->mToolBarUpN )
217 } 217 tbd = Bottom;
218 else { 218 else
219 if ( p->mToolBarUpN ) 219 tbd = Top;
220 tbd = Right; 220 }
221 else 221 else {
222 tbd = Left; 222 if ( p->mToolBarUpN )
223 tbd = Right;
224 else
225 tbd = Left;
226 }
227 navigatorToolBar = new QPEToolBar( this );
228 addToolBar (navigatorToolBar , tbd );
223 } 229 }
224 navigatorToolBar = new QPEToolBar( this );
225 addToolBar (navigatorToolBar , tbd );
226
227 230
228 231
229 232
230 mCalendarModifiedFlag = false; 233 mCalendarModifiedFlag = false;
231 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 234 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
232 splash->setAlignment ( AlignCenter ); 235 splash->setAlignment ( AlignCenter );
233 setCentralWidget( splash ); 236 setCentralWidget( splash );
234#ifndef DESKTOP_VERSION 237#ifndef DESKTOP_VERSION
235 showMaximized(); 238 showMaximized();
236#endif 239#endif
237 240
238 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 241 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
239 setDefaultPreferences(); 242 setDefaultPreferences();
240 mCalendar = new CalendarLocal(); 243 mCalendar = new CalendarLocal();
241 mView = new CalendarView( mCalendar, this,"mCalendar " ); 244 mView = new CalendarView( mCalendar, this,"mCalendar " );
242 mView->hide(); 245 mView->hide();
243 //mView->resize(splash->size() ); 246 //mView->resize(splash->size() );
244 initActions(); 247 initActions();
245 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 248 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
246 mSyncManager->setBlockSave(false); 249 mSyncManager->setBlockSave(false);
247 mView->setSyncManager(mSyncManager); 250 mView->setSyncManager(mSyncManager);
248#ifndef DESKTOP_VERSION 251#ifndef DESKTOP_VERSION
249 iconToolBar->show(); 252 iconToolBar->show();
250 qApp->processEvents(); 253 qApp->processEvents();
251#endif 254#endif
252 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 255 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
253 int vh = height() ; 256 int vh = height() ;
254 int vw = width(); 257 int vw = width();
255 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 258 //qDebug("Toolbar hei %d ",iconToolBar->height() );
256 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 259 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
257 vh -= iconToolBar->height(); 260 vh -= iconToolBar->height();
258 } else { 261 } else {
@@ -664,64 +667,65 @@ void MainWindow::initActions()
664 //#endif 667 //#endif
665 // ****************** 668 // ******************
666 QAction *action; 669 QAction *action;
667 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 670 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
668 configureToolBarMenu->setCheckable( true ); 671 configureToolBarMenu->setCheckable( true );
669 672
670 673
671 configureAgendaMenu->setCheckable( true ); 674 configureAgendaMenu->setCheckable( true );
672 int iii ; 675 int iii ;
673 for ( iii = 1;iii<= 10 ;++iii ){ 676 for ( iii = 1;iii<= 10 ;++iii ){
674 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 677 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
675 } 678 }
676 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 679 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
677 680
678 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 681 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
679 this, SLOT( showConfigureAgenda( ) ) ); 682 this, SLOT( showConfigureAgenda( ) ) );
680 683
681 icon = loadPixmap( pathString + "configure" ); 684 icon = loadPixmap( pathString + "configure" );
682 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); 685 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
683 action->addTo( actionMenu ); 686 action->addTo( actionMenu );
684 connect( action, SIGNAL( activated() ), 687 connect( action, SIGNAL( activated() ),
685 mView, SLOT( edit_options() ) ); 688 mView, SLOT( edit_options() ) );
686 actionMenu->insertSeparator(); 689 actionMenu->insertSeparator();
687 690
688 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 691 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
689 action->addTo( actionMenu ); 692 action->addTo( actionMenu );
690 connect( action, SIGNAL( activated() ), 693 connect( action, SIGNAL( activated() ),
691 mView, SLOT( undo_delete() ) ); 694 mView, SLOT( undo_delete() ) );
692 actionMenu->insertSeparator(); 695 actionMenu->insertSeparator();
693 696
694 icon = loadPixmap( pathString + "newevent" ); 697 icon = loadPixmap( pathString + "newevent" );
695 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 698 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
699 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
696 configureToolBarMenu->insertSeparator(); 700 configureToolBarMenu->insertSeparator();
697 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 701 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
698 configureToolBarMenu->insertSeparator(); 702 configureToolBarMenu->insertSeparator();
699 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 703 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
700 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 704 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
701 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 705 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
702 ne_action->addTo( actionMenu ); 706 ne_action->addTo( actionMenu );
703 connect( ne_action, SIGNAL( activated() ), 707 connect( ne_action, SIGNAL( activated() ),
704 mView, SLOT( newEvent() ) ); 708 mView, SLOT( newEvent() ) );
705 icon = loadPixmap( pathString + "newtodo" ); 709 icon = loadPixmap( pathString + "newtodo" );
706 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 710 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
707 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 711 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
708 nt_action->addTo( actionMenu ); 712 nt_action->addTo( actionMenu );
709 connect( nt_action, SIGNAL( activated() ), 713 connect( nt_action, SIGNAL( activated() ),
710 mView, SLOT( newTodo() ) ); 714 mView, SLOT( newTodo() ) );
711 715
712 icon = loadPixmap( pathString + "today" ); 716 icon = loadPixmap( pathString + "today" );
713 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 717 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
714 today_action->addTo( viewMenu ); 718 today_action->addTo( viewMenu );
715 connect( today_action, SIGNAL( activated() ), 719 connect( today_action, SIGNAL( activated() ),
716 mView, SLOT( goToday() ) ); 720 mView, SLOT( goToday() ) );
717 viewMenu->insertSeparator(); 721 viewMenu->insertSeparator();
718 722
719 icon = loadPixmap( pathString + "navi" ); 723 icon = loadPixmap( pathString + "navi" );
720 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 724 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
721 action->addTo( viewMenu ); 725 action->addTo( viewMenu );
722 connect( action, SIGNAL( activated() ), 726 connect( action, SIGNAL( activated() ),
723 mView, SLOT( toggleDateNavigatorWidget() ) ); 727 mView, SLOT( toggleDateNavigatorWidget() ) );
724 mToggleNav = action ; 728 mToggleNav = action ;
725 icon = loadPixmap( pathString + "filter" ); 729 icon = loadPixmap( pathString + "filter" );
726 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 730 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
727 action->addTo( viewMenu ); 731 action->addTo( viewMenu );
@@ -1164,64 +1168,66 @@ void MainWindow::initActions()
1164 configureToolBarMenu->setItemChecked( 130, true ); 1168 configureToolBarMenu->setItemChecked( 130, true );
1165 if (p-> mShowIconForward) 1169 if (p-> mShowIconForward)
1166 configureToolBarMenu->setItemChecked( 220, true ); 1170 configureToolBarMenu->setItemChecked( 220, true );
1167 if (p-> mShowIconForwardFast) 1171 if (p-> mShowIconForwardFast)
1168 configureToolBarMenu->setItemChecked( 230, true ); 1172 configureToolBarMenu->setItemChecked( 230, true );
1169 if (p-> mShowIconNextDays) 1173 if (p-> mShowIconNextDays)
1170 configureToolBarMenu->setItemChecked( 100, true ); 1174 configureToolBarMenu->setItemChecked( 100, true );
1171 if (p-> mShowIconNext) 1175 if (p-> mShowIconNext)
1172 configureToolBarMenu->setItemChecked( 110, true ); 1176 configureToolBarMenu->setItemChecked( 110, true );
1173 if (p-> mShowIconJournal) 1177 if (p-> mShowIconJournal)
1174 configureToolBarMenu->setItemChecked( 90, true ); 1178 configureToolBarMenu->setItemChecked( 90, true );
1175 if (p-> mShowIconWhatsThis) 1179 if (p-> mShowIconWhatsThis)
1176 configureToolBarMenu->setItemChecked( 300, true ); 1180 configureToolBarMenu->setItemChecked( 300, true );
1177 if (p-> mShowIconWeekNum) 1181 if (p-> mShowIconWeekNum)
1178 configureToolBarMenu->setItemChecked( 400, true ); 1182 configureToolBarMenu->setItemChecked( 400, true );
1179 if (!p-> mShowIconStretch) { 1183 if (!p-> mShowIconStretch) {
1180 QLabel* dummy = new QLabel( iconToolBar ); 1184 QLabel* dummy = new QLabel( iconToolBar );
1181 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1185 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1182 dummy->setMinimumWidth( 0 ); 1186 dummy->setMinimumWidth( 0 );
1183 iconToolBar->setStretchableWidget ( dummy ) ; 1187 iconToolBar->setStretchableWidget ( dummy ) ;
1184 } 1188 }
1185 else { 1189 else {
1186 iconToolBar->setHorizontalStretchable (true ); 1190 iconToolBar->setHorizontalStretchable (true );
1187 viewToolBar->setHorizontalStretchable (true ); 1191 viewToolBar->setHorizontalStretchable (true );
1188 navigatorToolBar->setHorizontalStretchable (true ); 1192 navigatorToolBar->setHorizontalStretchable (true );
1189 iconToolBar->setVerticalStretchable (true ); 1193 iconToolBar->setVerticalStretchable (true );
1190 viewToolBar->setVerticalStretchable (true ); 1194 viewToolBar->setVerticalStretchable (true );
1191 navigatorToolBar->setVerticalStretchable (true ); 1195 navigatorToolBar->setVerticalStretchable (true );
1192 configureToolBarMenu->setItemChecked( 5, true ); 1196 configureToolBarMenu->setItemChecked( 5, true );
1193 } 1197 }
1194 if (p-> mShowIconFilter) 1198 if (p-> mShowIconFilter)
1195 configureToolBarMenu->setItemChecked( 7, true ); 1199 configureToolBarMenu->setItemChecked( 7, true );
1200 if (p-> mShowIconOnetoolbar)
1201 configureToolBarMenu->setItemChecked( 6, true );
1196 1202
1197 1203
1198 if ( filterMenubar ) 1204 if ( filterMenubar )
1199 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); 1205 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) );
1200 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1206 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1201 configureAgenda( p->mHourSize ); 1207 configureAgenda( p->mHourSize );
1202 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1208 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1203} 1209}
1204 1210
1205void MainWindow::exportToPhone( int mode ) 1211void MainWindow::exportToPhone( int mode )
1206{ 1212{
1207 1213
1208 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1214 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1209 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1215 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1210 KOex2phonePrefs ex2phone; 1216 KOex2phonePrefs ex2phone;
1211 1217
1212 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1218 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1213 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1219 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1214 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1220 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1215 if ( mode == 1 ) 1221 if ( mode == 1 )
1216 ex2phone.setCaption(i18n("Export complete calendar")); 1222 ex2phone.setCaption(i18n("Export complete calendar"));
1217 if ( mode == 2 ) 1223 if ( mode == 2 )
1218 ex2phone.setCaption(i18n("Export filtered calendar")); 1224 ex2phone.setCaption(i18n("Export filtered calendar"));
1219 1225
1220 if ( !ex2phone.exec() ) { 1226 if ( !ex2phone.exec() ) {
1221 return; 1227 return;
1222 } 1228 }
1223 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1229 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1224 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1230 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1225 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1231 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1226 1232
1227 int inFuture = 0; 1233 int inFuture = 0;
@@ -1925,93 +1931,97 @@ void MainWindow::fillFilterMenu()
1925 selectFilterMenu->setItemChecked( 1, true ); 1931 selectFilterMenu->setItemChecked( 1, true );
1926} 1932}
1927void MainWindow::fillFilterMenuPopup() 1933void MainWindow::fillFilterMenuPopup()
1928{ 1934{
1929 filterPopupMenu->clear(); 1935 filterPopupMenu->clear();
1930 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 1936 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
1931 1937
1932 filterPopupMenu->insertSeparator(); 1938 filterPopupMenu->insertSeparator();
1933 QPtrList<CalFilter> fili = mView->filters(); 1939 QPtrList<CalFilter> fili = mView->filters();
1934 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1940 CalFilter *curfilter = mView->filterView()->selectedFilter();
1935 CalFilter *filter = fili.first(); 1941 CalFilter *filter = fili.first();
1936 int iii = 1; 1942 int iii = 1;
1937 bool checkitem = mView->filterView()->filtersEnabled(); 1943 bool checkitem = mView->filterView()->filtersEnabled();
1938 while(filter) { 1944 while(filter) {
1939 filterPopupMenu->insertItem( filter->name(), iii ); 1945 filterPopupMenu->insertItem( filter->name(), iii );
1940 if ( filter == curfilter) 1946 if ( filter == curfilter)
1941 filterPopupMenu->setItemChecked( iii, checkitem ); 1947 filterPopupMenu->setItemChecked( iii, checkitem );
1942 filter = fili.next(); 1948 filter = fili.next();
1943 ++iii; 1949 ++iii;
1944 } 1950 }
1945 if ( !checkitem ) 1951 if ( !checkitem )
1946 filterPopupMenu->setItemChecked( 0, true ); 1952 filterPopupMenu->setItemChecked( 0, true );
1947} 1953}
1948void MainWindow::selectFilter( int fil ) 1954void MainWindow::selectFilter( int fil )
1949{ 1955{
1950 1956
1951 if ( fil == 0 ) { 1957 if ( fil == 0 ) {
1952 mView->editFilters( ); 1958 mView->editFilters( );
1953 } else if ( fil == 1 ){ 1959 } else if ( fil == 1 ){
1954 if ( mView->filterView()->filtersEnabled() ) 1960 if ( mView->filterView()->filtersEnabled() )
1955 mView->toggleFilerEnabled( ); 1961 mView->toggleFilerEnabled( );
1956 } else { 1962 } else {
1957 if ( !mView->filterView()->filtersEnabled() ) 1963 if ( !mView->filterView()->filtersEnabled() ) {
1964 mView->filterView()->blockSignals( true );
1958 mView->toggleFilerEnabled( ); 1965 mView->toggleFilerEnabled( );
1966 mView->filterView()->blockSignals( false );
1967 }
1959 mView->selectFilter( fil-2 ); 1968 mView->selectFilter( fil-2 );
1960 } 1969 }
1961} 1970}
1962void MainWindow::updateFilterToolbar() 1971void MainWindow::updateFilterToolbar()
1963{ 1972{
1964 if ( filterMenubar ) { 1973 if ( filterMenubar ) {
1965 if ( !mView->filterView()->filtersEnabled() ) { 1974 if ( !mView->filterView()->filtersEnabled() ) {
1966 filterMenubar->changeItem( 0, i18n("No Filter") ); 1975 filterMenubar->changeItem( 0, i18n("No Filter") );
1967 } else { 1976 } else {
1968 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1977 CalFilter *curfilter = mView->filterView()->selectedFilter();
1969 if ( curfilter ) { 1978 if ( curfilter ) {
1970 filterMenubar->changeItem( 0, curfilter->name() ); 1979 filterMenubar->changeItem( 0, curfilter->name() );
1971 } 1980 }
1972 } 1981 }
1973 } 1982 }
1974} 1983}
1975void MainWindow::selectFilterPopup( int fil ) 1984void MainWindow::selectFilterPopup( int fil )
1976{ 1985{
1977 selectFilter( fil + 1 ); 1986 selectFilter( fil + 1 );
1978 1987
1979} 1988}
1980void MainWindow::configureToolBar( int item ) 1989void MainWindow::configureToolBar( int item )
1981{ 1990{
1982 1991
1983 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 1992 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
1984 KOPrefs *p = KOPrefs::instance(); 1993 KOPrefs *p = KOPrefs::instance();
1985 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 1994 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
1995 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
1986 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 1996 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
1987 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 1997 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
1988 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 1998 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
1989 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 1999 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
1990 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2000 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
1991 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2001 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
1992 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2002 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
1993 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2003 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
1994 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2004 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
1995 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2005 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
1996 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2006 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
1997 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2007 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
1998 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2008 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
1999 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2009 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2000 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2010 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2001 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2011 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2002 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2012 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2003 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2013 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2004 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2014 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2005 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2015 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2006 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2016 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2007 // initActions(); 2017 // initActions();
2008} 2018}
2009void MainWindow::setCaption ( const QString & c ) 2019void MainWindow::setCaption ( const QString & c )
2010{ 2020{
2011 QString cap = c; 2021 QString cap = c;
2012 cap.replace( QRegExp("\n"), " " ); 2022 cap.replace( QRegExp("\n"), " " );
2013 cap = cap.stripWhiteSpace(); 2023 cap = cap.stripWhiteSpace();
2014 if ( cap.isEmpty() ) 2024 if ( cap.isEmpty() )
2015 cap = "KO/Pi"; 2025 cap = "KO/Pi";
2016 QWidget::setCaption( cap ); 2026 QWidget::setCaption( cap );
2017} 2027}