summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-08-17 16:19:18 (UTC)
committer zautrix <zautrix>2005-08-17 16:19:18 (UTC)
commitc21edc19916722f5dd4e939f1522d311a86411fd (patch) (unidiff)
treeed91c2cd9afb7d37c73f2056851c95293eff6038
parent9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd (diff)
downloadkdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.zip
kdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.tar.gz
kdepimpi-c21edc19916722f5dd4e939f1522d311a86411fd.tar.bz2
minor kopi fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp27
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
@@ -201,17 +201,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
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;
@@ -229,19 +229,19 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
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 {
@@ -832,17 +832,16 @@ void MainWindow::initActions()
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() ),
@@ -852,16 +851,18 @@ void MainWindow::initActions()
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 );
@@ -1043,16 +1044,17 @@ void MainWindow::initActions()
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 );
@@ -2320,17 +2322,20 @@ void MainWindow::selectFilter( int fil )
2320void MainWindow::updateFilterToolbar() 2322void 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}
2333void MainWindow::selectFilterPopup( int fil ) 2338void MainWindow::selectFilterPopup( int fil )
2334{ 2339{
2335 selectFilter( fil + 1 ); 2340 selectFilter( fil + 1 );
2336 2341
@@ -2657,17 +2662,19 @@ void MainWindow::hideEvent ( QHideEvent * )
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
2662void MainWindow::resizeEvent( QResizeEvent* e) 2667void 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}