-rw-r--r-- | korganizer/mainwindow.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index c6ae868..a4e0834 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -185,25 +185,28 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
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 | viewToolBar = iconToolBar ; | ||
199 | navigatorToolBar = iconToolBar ; | ||
200 | } else { | ||
198 | if ( p->mToolBarHorV ) { | 201 | if ( p->mToolBarHorV ) { |
199 | if ( p->mToolBarUpV ) | 202 | if ( p->mToolBarUpV ) |
200 | tbd = Bottom; | 203 | tbd = Bottom; |
201 | else | 204 | else |
202 | tbd = Top; | 205 | tbd = Top; |
203 | } | 206 | } |
204 | else { | 207 | else { |
205 | if ( p->mToolBarUpV ) | 208 | if ( p->mToolBarUpV ) |
206 | tbd = Right; | 209 | tbd = Right; |
207 | else | 210 | else |
208 | tbd = Left; | 211 | tbd = Left; |
209 | } | 212 | } |
@@ -214,25 +217,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
214 | tbd = Bottom; | 217 | tbd = Bottom; |
215 | else | 218 | else |
216 | tbd = Top; | 219 | tbd = Top; |
217 | } | 220 | } |
218 | else { | 221 | else { |
219 | if ( p->mToolBarUpN ) | 222 | if ( p->mToolBarUpN ) |
220 | tbd = Right; | 223 | tbd = Right; |
221 | else | 224 | else |
222 | tbd = Left; | 225 | tbd = Left; |
223 | } | 226 | } |
224 | navigatorToolBar = new QPEToolBar( this ); | 227 | navigatorToolBar = new QPEToolBar( this ); |
225 | addToolBar (navigatorToolBar , tbd ); | 228 | addToolBar (navigatorToolBar , tbd ); |
226 | 229 | } | |
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 ()); |
@@ -684,24 +687,25 @@ void MainWindow::initActions() | |||
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 ); |
@@ -1184,24 +1188,26 @@ void MainWindow::initActions() | |||
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 | ||
1205 | void MainWindow::exportToPhone( int mode ) | 1211 | void MainWindow::exportToPhone( int mode ) |
1206 | { | 1212 | { |
1207 | 1213 | ||
@@ -1945,26 +1951,29 @@ void MainWindow::fillFilterMenuPopup() | |||
1945 | if ( !checkitem ) | 1951 | if ( !checkitem ) |
1946 | filterPopupMenu->setItemChecked( 0, true ); | 1952 | filterPopupMenu->setItemChecked( 0, true ); |
1947 | } | 1953 | } |
1948 | void MainWindow::selectFilter( int fil ) | 1954 | void 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 | } |
1962 | void MainWindow::updateFilterToolbar() | 1971 | void 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() ); |
@@ -1974,24 +1983,25 @@ void MainWindow::updateFilterToolbar() | |||
1974 | } | 1983 | } |
1975 | void MainWindow::selectFilterPopup( int fil ) | 1984 | void MainWindow::selectFilterPopup( int fil ) |
1976 | { | 1985 | { |
1977 | selectFilter( fil + 1 ); | 1986 | selectFilter( fil + 1 ); |
1978 | 1987 | ||
1979 | } | 1988 | } |
1980 | void MainWindow::configureToolBar( int item ) | 1989 | void 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 ); |