summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp67
1 files changed, 58 insertions, 9 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 6ddced0..ae03a09 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -644,6 +644,8 @@ void MainWindow::initActions()
644 } 644 }
645 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 645 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
646 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 646 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
647
648
647 mWeekBgColor = iconToolBar->backgroundColor(); 649 mWeekBgColor = iconToolBar->backgroundColor();
648 mWeekPixmap.resize( pixWid , pixHei ); 650 mWeekPixmap.resize( pixWid , pixHei );
649 mWeekPixmap.fill( mWeekBgColor ); 651 mWeekPixmap.fill( mWeekBgColor );
@@ -668,6 +670,16 @@ void MainWindow::initActions()
668 this, SLOT( weekAction() ) ); 670 this, SLOT( weekAction() ) );
669 671
670 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 672 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
673 if ( p->mShowIconFilterview ) {
674 icon = loadPixmap( pathString + "filter" );
675 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
676 connect( actionFilterMenuTB, SIGNAL( activated() ),
677 this, SLOT( fillFilterMenuTB() ) );
678 actionFilterMenuTB->addTo( iconToolBar );
679 selectFilterMenuTB = new QPopupMenu( this );
680 selectFilterMenuTB->setCheckable( true );
681 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
682 }
671 683
672 //#endif 684 //#endif
673 // ****************** 685 // ******************
@@ -778,15 +790,7 @@ void MainWindow::initActions()
778 if ( p-> mShowIconToggleFull ) 790 if ( p-> mShowIconToggleFull )
779 FSaction->addTo( iconToolBar ); 791 FSaction->addTo( iconToolBar );
780 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 792 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
781 if ( p->mShowIconFilterview ) { 793
782 icon = loadPixmap( pathString + "filter" );
783 QPEMenuBar *menuBar111 = new QPEMenuBar( iconToolBar );
784 menuBar111->insertItem( icon.pixmap(), selectFilterMenu);
785 int isi = 24;
786 if ( QApplication::desktop()->width() < 480 )
787 isi = 18;
788 menuBar111->setFixedSize( QSize( isi, isi )) ;
789 }
790 //******************** 794 //********************
791 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 795 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
792 796
@@ -1963,7 +1967,51 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1963 } 1967 }
1964 1968
1965} 1969}
1970void MainWindow::fillFilterMenuTB()
1971{
1972 selectFilterMenuTB->clear();
1973 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
1974 selectFilterMenuTB->insertSeparator();
1975 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
1976
1977 selectFilterMenuTB->insertSeparator();
1978 QPtrList<CalFilter> fili = mView->filters();
1979 CalFilter *curfilter = mView->filterView()->selectedFilter();
1980 CalFilter *filter = fili.first();
1981 int iii = 2;
1982 bool checkitem = mView->filterView()->filtersEnabled();
1983 while(filter) {
1984 selectFilterMenuTB->insertItem( filter->name(), iii );
1985 if ( filter == curfilter)
1986 selectFilterMenuTB->setItemChecked( iii, checkitem );
1987 filter = fili.next();
1988 ++iii;
1989 }
1990 if ( !checkitem )
1991 selectFilterMenuTB->setItemChecked( 1, true );
1966 1992
1993 int x = 0;
1994 int y = iconToolBar->height();
1995 int dX = 0;
1996 int dY = 0;
1997 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
1998 if ( iconToolBar->y() > height()/2 ) {
1999 dY = selectFilterMenuTB->sizeHint().height()+8;
2000 y = 0;
2001 }
2002 } else {
2003 if ( iconToolBar->x() > width()/2 ) { // right side
2004 x=0;
2005 dX= selectFilterMenuTB->sizeHint().width()+8;
2006 y = 0;
2007 } else {
2008 x= iconToolBar->width();
2009 y = 0;
2010 }
2011 }
2012 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2013 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2014}
1967void MainWindow::fillFilterMenu() 2015void MainWindow::fillFilterMenu()
1968{ 2016{
1969 selectFilterMenu->clear(); 2017 selectFilterMenu->clear();
@@ -2311,6 +2359,7 @@ void MainWindow::printCal()
2311 2359
2312#include "libkdepim/kdatepicker.h" 2360#include "libkdepim/kdatepicker.h"
2313#include <kdatetbl.h> 2361#include <kdatetbl.h>
2362
2314void MainWindow::weekAction() 2363void MainWindow::weekAction()
2315{ 2364{
2316 int month; 2365 int month;