author | zautrix <zautrix> | 2005-08-17 16:19:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-17 16:19:18 (UTC) |
commit | c21edc19916722f5dd4e939f1522d311a86411fd (patch) (unidiff) | |
tree | ed91c2cd9afb7d37c73f2056851c95293eff6038 | |
parent | 9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd (diff) | |
download | kdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.zip kdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.tar.gz kdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.tar.bz2 |
minor kopi fixes
-rw-r--r-- | korganizer/mainwindow.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 45775c5..94bc4c1 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -177,95 +177,95 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
177 | bool showWarning = !finf.exists(); | 177 | bool showWarning = !finf.exists(); |
178 | setIcon(SmallIcon( "ko24" ) ); | 178 | setIcon(SmallIcon( "ko24" ) ); |
179 | mBlockAtStartup = true; | 179 | mBlockAtStartup = true; |
180 | mFlagKeyPressed = false; | 180 | mFlagKeyPressed = false; |
181 | setCaption("KO/Pi"); | 181 | setCaption("KO/Pi"); |
182 | KOPrefs *p = KOPrefs::instance(); | 182 | KOPrefs *p = KOPrefs::instance(); |
183 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 183 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
184 | p->mCurrentDisplayedView = 0; | 184 | p->mCurrentDisplayedView = 0; |
185 | if ( p->mHourSize > 22 ) | 185 | if ( p->mHourSize > 22 ) |
186 | p->mHourSize = 22; | 186 | p->mHourSize = 22; |
187 | QMainWindow::ToolBarDock tbd; | 187 | QMainWindow::ToolBarDock tbd; |
188 | if ( p->mToolBarHor ) { | 188 | if ( p->mToolBarHor ) { |
189 | if ( p->mToolBarUp ) | 189 | if ( p->mToolBarUp ) |
190 | tbd = Bottom; | 190 | tbd = Bottom; |
191 | else | 191 | else |
192 | tbd = Top; | 192 | tbd = Top; |
193 | } | 193 | } |
194 | else { | 194 | else { |
195 | if ( p->mToolBarUp ) | 195 | if ( p->mToolBarUp ) |
196 | tbd = Right; | 196 | tbd = Right; |
197 | else | 197 | else |
198 | tbd = Left; | 198 | tbd = Left; |
199 | } | 199 | } |
200 | if ( KOPrefs::instance()->mUseAppColors ) | 200 | if ( KOPrefs::instance()->mUseAppColors ) |
201 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 201 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
202 | globalFlagBlockStartup = 1; | 202 | globalFlagBlockStartup = 1; |
203 | iconToolBar = new QPEToolBar( this ); | 203 | iconToolBar = new QPEToolBar( this ); |
204 | addToolBar (iconToolBar , tbd ); | 204 | addToolBar (iconToolBar , tbd ); |
205 | 205 | ||
206 | #ifdef DESKTOP_VERSION | 206 | #ifdef DESKTOP_VERSION |
207 | if ( KOPrefs::instance()->mShowIconFilter ) | 207 | if ( KOPrefs::instance()->mShowIconFilter ) |
208 | #else | 208 | #else |
209 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) | 209 | if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | { | 212 | { |
213 | if ( p->mToolBarHorF ) { | 213 | if ( p->mToolBarHorF ) { |
214 | if ( p->mToolBarUpF ) | 214 | if ( p->mToolBarUpF ) |
215 | tbd = Bottom; | 215 | tbd = Bottom; |
216 | else | 216 | else |
217 | tbd = Top; | 217 | tbd = Top; |
218 | } | 218 | } |
219 | else { | 219 | else { |
220 | if ( p->mToolBarUpF ) | 220 | if ( p->mToolBarUpF ) |
221 | tbd = Right; | 221 | tbd = Right; |
222 | else | 222 | else |
223 | tbd = Left; | 223 | tbd = Left; |
224 | } | 224 | } |
225 | filterToolBar = new QPEToolBar ( this ); | 225 | filterToolBar = new QPEToolBar ( this ); |
226 | filterMenubar = new KMenuBar( 0 ); | 226 | filterMenubar = new KMenuBar( 0 ); |
227 | QFontMetrics fm ( filterMenubar->font() ); | 227 | QFontMetrics fm ( filterMenubar->font() ); |
228 | #ifndef DESKTOP_VERSION | 228 | #ifndef DESKTOP_VERSION |
229 | filterToolBar->setFocusPolicy( NoFocus ); | 229 | filterToolBar->setFocusPolicy( NoFocus ); |
230 | filterMenubar->setFocusPolicy( NoFocus ); | 230 | filterMenubar->setFocusPolicy( NoFocus ); |
231 | #endif | 231 | #endif |
232 | filterPopupMenu = new QPopupMenu( this ); | 232 | filterPopupMenu = new QPopupMenu( this ); |
233 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 233 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
234 | QString addTest = "A"; | 234 | QString addTest = "A"; |
235 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | 235 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); |
236 | #ifdef DESKTOP_VERSION | 236 | #ifdef DESKTOP_VERSION |
237 | addTest = "AAABBBCCCx"; | 237 | addTest = "AAAAAABBBCCCx"; |
238 | #else | 238 | #else |
239 | addTest = "AAx"; | 239 | addTest = "AAAAAx"; |
240 | #endif | 240 | #endif |
241 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); | 241 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); |
242 | addToolBar (filterToolBar , tbd ); | 242 | addToolBar (filterToolBar , tbd ); |
243 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 243 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
244 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 244 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
245 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | 245 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) |
246 | filterToolBar->hide(); | 246 | filterToolBar->hide(); |
247 | } else { | 247 | } else { |
248 | filterToolBar = 0; | 248 | filterToolBar = 0; |
249 | filterMenubar = 0; | 249 | filterMenubar = 0; |
250 | filterPopupMenu = 0; | 250 | filterPopupMenu = 0; |
251 | } | 251 | } |
252 | if ( p->mShowIconOnetoolbar ) { | 252 | if ( p->mShowIconOnetoolbar ) { |
253 | viewToolBar = iconToolBar ; | 253 | viewToolBar = iconToolBar ; |
254 | navigatorToolBar = iconToolBar ; | 254 | navigatorToolBar = iconToolBar ; |
255 | } else { | 255 | } else { |
256 | #ifndef DESKTOP_VERSION | 256 | #ifndef DESKTOP_VERSION |
257 | setToolBarsMovable( false ); | 257 | setToolBarsMovable( false ); |
258 | #endif | 258 | #endif |
259 | if ( p->mToolBarHorV ) { | 259 | if ( p->mToolBarHorV ) { |
260 | if ( p->mToolBarUpV ) | 260 | if ( p->mToolBarUpV ) |
261 | tbd = Bottom; | 261 | tbd = Bottom; |
262 | else | 262 | else |
263 | tbd = Top; | 263 | tbd = Top; |
264 | } | 264 | } |
265 | else { | 265 | else { |
266 | if ( p->mToolBarUpV ) | 266 | if ( p->mToolBarUpV ) |
267 | tbd = Right; | 267 | tbd = Right; |
268 | else | 268 | else |
269 | tbd = Left; | 269 | tbd = Left; |
270 | } | 270 | } |
271 | viewToolBar = new QPEToolBar( this ); | 271 | viewToolBar = new QPEToolBar( this ); |
@@ -808,84 +808,85 @@ void MainWindow::initActions() | |||
808 | mView, SLOT( showDatePicker() ) ); | 808 | mView, SLOT( showDatePicker() ) ); |
809 | 809 | ||
810 | icon = loadPixmap( pathString + "search" ); | 810 | icon = loadPixmap( pathString + "search" ); |
811 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 811 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
812 | search_action->addTo( actionMenu ); | 812 | search_action->addTo( actionMenu ); |
813 | connect( search_action, SIGNAL( activated() ), | 813 | connect( search_action, SIGNAL( activated() ), |
814 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 814 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
815 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); | 815 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); |
816 | 816 | ||
817 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); | 817 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); |
818 | action->addTo( nextConflictMenu ); | 818 | action->addTo( nextConflictMenu ); |
819 | connect( action, SIGNAL( activated() ), | 819 | connect( action, SIGNAL( activated() ), |
820 | mView, SLOT( conflictAll() ) ); | 820 | mView, SLOT( conflictAll() ) ); |
821 | 821 | ||
822 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); | 822 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); |
823 | action->addTo( nextConflictMenu ); | 823 | action->addTo( nextConflictMenu ); |
824 | connect( action, SIGNAL( activated() ), | 824 | connect( action, SIGNAL( activated() ), |
825 | mView, SLOT( conflictAllday() ) ); | 825 | mView, SLOT( conflictAllday() ) ); |
826 | 826 | ||
827 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); | 827 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); |
828 | action->addTo( nextConflictMenu ); | 828 | action->addTo( nextConflictMenu ); |
829 | connect( action, SIGNAL( activated() ), | 829 | connect( action, SIGNAL( activated() ), |
830 | mView, SLOT( conflictNotAll() ) ); | 830 | mView, SLOT( conflictNotAll() ) ); |
831 | 831 | ||
832 | actionMenu->insertSeparator(); | 832 | actionMenu->insertSeparator(); |
833 | 833 | ||
834 | icon = loadPixmap( pathString + "newevent" ); | 834 | icon = loadPixmap( pathString + "newevent" ); |
835 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 835 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
836 | ne_action->addTo( mCurrentItemMenu ); | 836 | ne_action->addTo( mCurrentItemMenu ); |
837 | connect( ne_action, SIGNAL( activated() ), | 837 | connect( ne_action, SIGNAL( activated() ), |
838 | mView, SLOT( newEvent() ) ); | 838 | mView, SLOT( newEvent() ) ); |
839 | icon = loadPixmap( pathString + "newtodo" ); | 839 | icon = loadPixmap( pathString + "newtodo" ); |
840 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | ||
841 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 840 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
842 | nt_action->addTo( mCurrentItemMenu ); | 841 | nt_action->addTo( mCurrentItemMenu ); |
843 | connect( nt_action, SIGNAL( activated() ), | 842 | connect( nt_action, SIGNAL( activated() ), |
844 | mView, SLOT( newTodo() ) ); | 843 | mView, SLOT( newTodo() ) ); |
845 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 844 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
846 | this ); | 845 | this ); |
847 | mNewSubTodoAction->addTo( mCurrentItemMenu ); | 846 | mNewSubTodoAction->addTo( mCurrentItemMenu ); |
848 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 847 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
849 | mView, SLOT( newSubTodo() ) ); | 848 | mView, SLOT( newSubTodo() ) ); |
850 | 849 | ||
851 | mCurrentItemMenu->insertSeparator(); | 850 | mCurrentItemMenu->insertSeparator(); |
852 | icon = loadPixmap( pathString + "newevent" ); | 851 | icon = loadPixmap( pathString + "newevent" ); |
853 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 852 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
854 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 853 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
855 | configureToolBarMenu->insertSeparator(); | 854 | configureToolBarMenu->insertSeparator(); |
856 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 855 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
857 | configureToolBarMenu->insertSeparator(); | 856 | configureToolBarMenu->insertSeparator(); |
858 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 857 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
859 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 858 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
859 | icon = loadPixmap( pathString + "newtodo" ); | ||
860 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | ||
860 | 861 | ||
861 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 862 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
862 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); | 863 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); |
863 | mShowAction->addTo( mCurrentItemMenu ); | 864 | mShowAction->addTo( mCurrentItemMenu ); |
864 | connect( mShowAction, SIGNAL( activated() ), | 865 | connect( mShowAction, SIGNAL( activated() ), |
865 | mView, SLOT( showIncidence() ) ); | 866 | mView, SLOT( showIncidence() ) ); |
866 | 867 | ||
867 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 868 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
868 | mEditAction->addTo( mCurrentItemMenu ); | 869 | mEditAction->addTo( mCurrentItemMenu ); |
869 | connect( mEditAction, SIGNAL( activated() ), | 870 | connect( mEditAction, SIGNAL( activated() ), |
870 | mView, SLOT( editIncidence() ) ); | 871 | mView, SLOT( editIncidence() ) ); |
871 | 872 | ||
872 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 873 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
873 | mDeleteAction->addTo( mCurrentItemMenu ); | 874 | mDeleteAction->addTo( mCurrentItemMenu ); |
874 | connect( mDeleteAction, SIGNAL( activated() ), | 875 | connect( mDeleteAction, SIGNAL( activated() ), |
875 | mView, SLOT( deleteIncidence() ) ); | 876 | mView, SLOT( deleteIncidence() ) ); |
876 | 877 | ||
877 | 878 | ||
878 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 879 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
879 | mCloneAction->addTo( mCurrentItemMenu ); | 880 | mCloneAction->addTo( mCurrentItemMenu ); |
880 | connect( mCloneAction, SIGNAL( activated() ), | 881 | connect( mCloneAction, SIGNAL( activated() ), |
881 | mView, SLOT( cloneIncidence() ) ); | 882 | mView, SLOT( cloneIncidence() ) ); |
882 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 883 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
883 | mMoveAction->addTo( mCurrentItemMenu ); | 884 | mMoveAction->addTo( mCurrentItemMenu ); |
884 | connect( mMoveAction, SIGNAL( activated() ), | 885 | connect( mMoveAction, SIGNAL( activated() ), |
885 | mView, SLOT( moveIncidence() ) ); | 886 | mView, SLOT( moveIncidence() ) ); |
886 | #ifndef DESKTOP_VERSION | 887 | #ifndef DESKTOP_VERSION |
887 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 888 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
888 | mBeamAction->addTo(mCurrentItemMenu ); | 889 | mBeamAction->addTo(mCurrentItemMenu ); |
889 | connect( mBeamAction, SIGNAL( activated() ), | 890 | connect( mBeamAction, SIGNAL( activated() ), |
890 | mView, SLOT( beamIncidence() ) ); | 891 | mView, SLOT( beamIncidence() ) ); |
891 | #endif | 892 | #endif |
@@ -1019,64 +1020,65 @@ void MainWindow::initActions() | |||
1019 | 1020 | ||
1020 | icon = loadPixmap( pathString + "list" ); | 1021 | icon = loadPixmap( pathString + "list" ); |
1021 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 1022 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
1022 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 1023 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
1023 | showlist_action->addTo( viewMenu ); | 1024 | showlist_action->addTo( viewMenu ); |
1024 | connect( showlist_action, SIGNAL( activated() ), | 1025 | connect( showlist_action, SIGNAL( activated() ), |
1025 | mView->viewManager(), SLOT( showListView() ) ); | 1026 | mView->viewManager(), SLOT( showListView() ) ); |
1026 | 1027 | ||
1027 | icon = loadPixmap( pathString + "todo" ); | 1028 | icon = loadPixmap( pathString + "todo" ); |
1028 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 1029 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
1029 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 1030 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
1030 | todoview_action->addTo( viewMenu ); | 1031 | todoview_action->addTo( viewMenu ); |
1031 | connect( todoview_action, SIGNAL( activated() ), | 1032 | connect( todoview_action, SIGNAL( activated() ), |
1032 | mView->viewManager(), SLOT( showTodoView() ) ); | 1033 | mView->viewManager(), SLOT( showTodoView() ) ); |
1033 | 1034 | ||
1034 | 1035 | ||
1035 | 1036 | ||
1036 | #if 0 | 1037 | #if 0 |
1037 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 1038 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
1038 | action->addTo( viewMenu ); | 1039 | action->addTo( viewMenu ); |
1039 | connect( action, SIGNAL( activated() ), | 1040 | connect( action, SIGNAL( activated() ), |
1040 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 1041 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
1041 | #endif | 1042 | #endif |
1042 | 1043 | ||
1043 | 1044 | ||
1044 | 1045 | ||
1045 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, | 1046 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, |
1046 | this ); | 1047 | this ); |
1047 | action->addTo( actionMenu ); | 1048 | action->addTo( actionMenu ); |
1048 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 1049 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
1049 | 1050 | ||
1050 | 1051 | ||
1052 | icon = loadPixmap( pathString + "search" ); | ||
1051 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 1053 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
1052 | 1054 | ||
1053 | 1055 | ||
1054 | 1056 | ||
1055 | actionMenu->insertSeparator(); | 1057 | actionMenu->insertSeparator(); |
1056 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, | 1058 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, |
1057 | this ); | 1059 | this ); |
1058 | action->addTo( actionMenu ); | 1060 | action->addTo( actionMenu ); |
1059 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); | 1061 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); |
1060 | 1062 | ||
1061 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1063 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1062 | this ); | 1064 | this ); |
1063 | action->addTo( actionMenu ); | 1065 | action->addTo( actionMenu ); |
1064 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1066 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1065 | 1067 | ||
1066 | 1068 | ||
1067 | actionMenu->insertSeparator(); | 1069 | actionMenu->insertSeparator(); |
1068 | icon = loadPixmap( pathString + "configure" ); | 1070 | icon = loadPixmap( pathString + "configure" ); |
1069 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | 1071 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); |
1070 | action->addTo( actionMenu ); | 1072 | action->addTo( actionMenu ); |
1071 | connect( action, SIGNAL( activated() ), | 1073 | connect( action, SIGNAL( activated() ), |
1072 | mView, SLOT( edit_options() ) ); | 1074 | mView, SLOT( edit_options() ) ); |
1073 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); | 1075 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); |
1074 | action->addTo( actionMenu ); | 1076 | action->addTo( actionMenu ); |
1075 | connect( action, SIGNAL( activated() ), | 1077 | connect( action, SIGNAL( activated() ), |
1076 | this, SLOT( calHint() ) ); | 1078 | this, SLOT( calHint() ) ); |
1077 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | 1079 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); |
1078 | action->addTo( actionMenu ); | 1080 | action->addTo( actionMenu ); |
1079 | connect( action, SIGNAL( activated() ), | 1081 | connect( action, SIGNAL( activated() ), |
1080 | mView, SLOT( edit_global_options() ) ); | 1082 | mView, SLOT( edit_global_options() ) ); |
1081 | if ( KOPrefs::instance()->mShowFullMenu ) { | 1083 | if ( KOPrefs::instance()->mShowFullMenu ) { |
1082 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 1084 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
@@ -2296,65 +2298,68 @@ void MainWindow::fillFilterMenuPopup() | |||
2296 | filterPopupMenu->setItemChecked( iii, checkitem ); | 2298 | filterPopupMenu->setItemChecked( iii, checkitem ); |
2297 | filter = fili.next(); | 2299 | filter = fili.next(); |
2298 | ++iii; | 2300 | ++iii; |
2299 | } | 2301 | } |
2300 | if ( !checkitem ) | 2302 | if ( !checkitem ) |
2301 | filterPopupMenu->setItemChecked( 0, true ); | 2303 | filterPopupMenu->setItemChecked( 0, true ); |
2302 | } | 2304 | } |
2303 | void MainWindow::selectFilter( int fil ) | 2305 | void MainWindow::selectFilter( int fil ) |
2304 | { | 2306 | { |
2305 | 2307 | ||
2306 | if ( fil == 0 ) { | 2308 | if ( fil == 0 ) { |
2307 | mView->editFilters( ); | 2309 | mView->editFilters( ); |
2308 | } else if ( fil == 1 ){ | 2310 | } else if ( fil == 1 ){ |
2309 | if ( mView->filterView()->filtersEnabled() ) | 2311 | if ( mView->filterView()->filtersEnabled() ) |
2310 | mView->toggleFilerEnabled( ); | 2312 | mView->toggleFilerEnabled( ); |
2311 | } else { | 2313 | } else { |
2312 | if ( !mView->filterView()->filtersEnabled() ) { | 2314 | if ( !mView->filterView()->filtersEnabled() ) { |
2313 | mView->filterView()->blockSignals( true ); | 2315 | mView->filterView()->blockSignals( true ); |
2314 | mView->toggleFilerEnabled( ); | 2316 | mView->toggleFilerEnabled( ); |
2315 | mView->filterView()->blockSignals( false ); | 2317 | mView->filterView()->blockSignals( false ); |
2316 | } | 2318 | } |
2317 | mView->selectFilter( fil-2 ); | 2319 | mView->selectFilter( fil-2 ); |
2318 | } | 2320 | } |
2319 | } | 2321 | } |
2320 | void MainWindow::updateFilterToolbar() | 2322 | void MainWindow::updateFilterToolbar() |
2321 | { | 2323 | { |
2322 | if ( filterMenubar ) { | 2324 | if ( filterMenubar ) { |
2323 | if ( !mView->filterView()->filtersEnabled() ) { | 2325 | if ( !mView->filterView()->filtersEnabled() ) { |
2324 | filterMenubar->changeItem( 0, i18n("No Filter") ); | 2326 | filterMenubar->changeItem( 0, i18n("No Filter") ); |
2325 | } else { | 2327 | } else { |
2326 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2328 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2327 | if ( curfilter ) { | 2329 | if ( curfilter ) { |
2328 | filterMenubar->changeItem( 0, curfilter->name() ); | 2330 | QString name = curfilter->name(); |
2331 | if ( name.length() > 12 ) | ||
2332 | name = name.left(10)+"..."; | ||
2333 | filterMenubar->changeItem( 0, name ); | ||
2329 | } | 2334 | } |
2330 | } | 2335 | } |
2331 | } | 2336 | } |
2332 | } | 2337 | } |
2333 | void MainWindow::selectFilterPopup( int fil ) | 2338 | void MainWindow::selectFilterPopup( int fil ) |
2334 | { | 2339 | { |
2335 | selectFilter( fil + 1 ); | 2340 | selectFilter( fil + 1 ); |
2336 | 2341 | ||
2337 | } | 2342 | } |
2338 | void MainWindow::configureToolBar( int item ) | 2343 | void MainWindow::configureToolBar( int item ) |
2339 | { | 2344 | { |
2340 | 2345 | ||
2341 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 2346 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
2342 | KOPrefs *p = KOPrefs::instance(); | 2347 | KOPrefs *p = KOPrefs::instance(); |
2343 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 2348 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
2344 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); | 2349 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); |
2345 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); | 2350 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); |
2346 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 2351 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
2347 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 2352 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
2348 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); | 2353 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); |
2349 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); | 2354 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); |
2350 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); | 2355 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); |
2351 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); | 2356 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); |
2352 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 2357 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
2353 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 2358 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
2354 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 2359 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
2355 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 2360 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
2356 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 2361 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
2357 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 2362 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
2358 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 2363 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
2359 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 2364 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
2360 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 2365 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
@@ -2633,41 +2638,43 @@ void MainWindow::weekAction() | |||
2633 | dX= picker->sizeHint().width()+8; | 2638 | dX= picker->sizeHint().width()+8; |
2634 | y = 0; | 2639 | y = 0; |
2635 | } else { | 2640 | } else { |
2636 | x= iconToolBar->width(); | 2641 | x= iconToolBar->width(); |
2637 | y = 0; | 2642 | y = 0; |
2638 | } | 2643 | } |
2639 | } | 2644 | } |
2640 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2645 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2641 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) | 2646 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) |
2642 | { | 2647 | { |
2643 | month = picker->getResult(); | 2648 | month = picker->getResult(); |
2644 | emit selectWeek ( month ); | 2649 | emit selectWeek ( month ); |
2645 | //qDebug("weekSelected %d ", month); | 2650 | //qDebug("weekSelected %d ", month); |
2646 | } | 2651 | } |
2647 | delete popup; | 2652 | delete popup; |
2648 | } | 2653 | } |
2649 | 2654 | ||
2650 | void MainWindow::hideEvent ( QHideEvent * ) | 2655 | void MainWindow::hideEvent ( QHideEvent * ) |
2651 | { | 2656 | { |
2652 | QString message; | 2657 | QString message; |
2653 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); | 2658 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); |
2654 | if ( nextA.isValid() ) { | 2659 | if ( nextA.isValid() ) { |
2655 | QString sum = mCalendar->nextSummary(); | 2660 | QString sum = mCalendar->nextSummary(); |
2656 | 2661 | ||
2657 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); | 2662 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); |
2658 | setCaption( message ); | 2663 | setCaption( message ); |
2659 | } | 2664 | } |
2660 | } | 2665 | } |
2661 | 2666 | ||
2662 | void MainWindow::resizeEvent( QResizeEvent* e) | 2667 | void MainWindow::resizeEvent( QResizeEvent* e) |
2663 | { | 2668 | { |
2664 | #ifndef DESKTOP_VERSION | 2669 | #ifndef DESKTOP_VERSION |
2665 | if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { | 2670 | if ( filterToolBar ) { |
2666 | if (QApplication::desktop()->width() > QApplication::desktop()->height() ) | 2671 | if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { |
2667 | filterToolBar->hide(); | 2672 | if (QApplication::desktop()->width() > QApplication::desktop()->height() ) |
2668 | else | 2673 | filterToolBar->hide(); |
2669 | filterToolBar->show(); | 2674 | else |
2675 | filterToolBar->show(); | ||
2676 | } | ||
2670 | } | 2677 | } |
2671 | #endif | 2678 | #endif |
2672 | QMainWindow::resizeEvent( e); | 2679 | QMainWindow::resizeEvent( e); |
2673 | } | 2680 | } |