summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-28 10:17:06 (UTC)
committer zautrix <zautrix>2005-03-28 10:17:06 (UTC)
commit9ff0641f33e63cc88e96d0066dba43b4699ca489 (patch) (unidiff)
tree166f6ed4fe4b98f2e49278ab2a27b793f301537f /korganizer
parent67dc8738c14716e18e4c433e5c0da474456c9859 (diff)
downloadkdepimpi-9ff0641f33e63cc88e96d0066dba43b4699ca489.zip
kdepimpi-9ff0641f33e63cc88e96d0066dba43b4699ca489.tar.gz
kdepimpi-9ff0641f33e63cc88e96d0066dba43b4699ca489.tar.bz2
filter settings
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp7
-rw-r--r--korganizer/koprefs.h7
-rw-r--r--korganizer/mainwindow.cpp206
-rw-r--r--korganizer/mainwindow.h11
4 files changed, 196 insertions, 35 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 7e3deff..2168094 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -90,6 +90,7 @@ KOPrefs::KOPrefs() :
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 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 94 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
94 95
95 addItemBool("AskForQuit",&mAskForQuit,false); 96 addItemBool("AskForQuit",&mAskForQuit,false);
@@ -101,6 +102,12 @@ KOPrefs::KOPrefs() :
101#endif 102#endif
102 addItemBool("ToolBarHor",&mToolBarHor, true ); 103 addItemBool("ToolBarHor",&mToolBarHor, true );
103 addItemBool("ToolBarUp",&mToolBarUp, false ); 104 addItemBool("ToolBarUp",&mToolBarUp, false );
105 addItemBool("ToolBarHorV",&mToolBarHorV, true );
106 addItemBool("ToolBarUpV",&mToolBarUpV, false );
107 addItemBool("ToolBarHorN",&mToolBarHorN, true );
108 addItemBool("ToolBarUpN",&mToolBarUpN, false );
109 addItemBool("ToolBarHorF",&mToolBarHorF, true );
110 addItemBool("ToolBarUpF",&mToolBarUpF, false );
104 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 111 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
105 addItemInt("Whats Next Days",&mWhatsNextDays,3); 112 addItemInt("Whats Next Days",&mWhatsNextDays,3);
106 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 113 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 09a0dce..8dfdf69 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -185,11 +185,18 @@ class KOPrefs : public KPimPrefs
185 bool mShowIconNextDays; 185 bool mShowIconNextDays;
186 bool mShowIconNext; 186 bool mShowIconNext;
187 bool mShowIconJournal; 187 bool mShowIconJournal;
188 bool mShowIconFilter;
188 189
189 bool mShowIconStretch; 190 bool mShowIconStretch;
190 191
191 bool mToolBarHor; 192 bool mToolBarHor;
192 bool mToolBarUp; 193 bool mToolBarUp;
194 bool mToolBarHorV;
195 bool mToolBarUpV;
196 bool mToolBarHorN;
197 bool mToolBarUpN;
198 bool mToolBarHorF;
199 bool mToolBarUpF;
193 bool mToolBarMiniIcons; 200 bool mToolBarMiniIcons;
194 201
195 bool mAskForQuit; 202 bool mAskForQuit;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ca0d542..c6ae868 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -57,6 +57,7 @@
57#include "kfiledialog.h" 57#include "kfiledialog.h"
58#include "koglobals.h" 58#include "koglobals.h"
59#include "kglobal.h" 59#include "kglobal.h"
60#include "ktoolbar.h"
60#include "klocale.h" 61#include "klocale.h"
61#include "kconfig.h" 62#include "kconfig.h"
62#include "simplealarmclient.h" 63#include "simplealarmclient.h"
@@ -164,6 +165,68 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
164 globalFlagBlockStartup = 1; 165 globalFlagBlockStartup = 1;
165 iconToolBar = new QPEToolBar( this ); 166 iconToolBar = new QPEToolBar( this );
166 addToolBar (iconToolBar , tbd ); 167 addToolBar (iconToolBar , tbd );
168
169 if ( KOPrefs::instance()->mShowIconFilter ) {
170 if ( p->mToolBarHorF ) {
171 if ( p->mToolBarUpF )
172 tbd = Bottom;
173 else
174 tbd = Top;
175 }
176 else {
177 if ( p->mToolBarUpF )
178 tbd = Right;
179 else
180 tbd = Left;
181 }
182 filterToolBar = new QPEToolBar ( this );
183 filterMenubar = new QPEMenuBar( filterToolBar );
184 QFontMetrics fm ( filterMenubar->font() );
185
186 filterPopupMenu = new QPopupMenu( this );
187 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
188 filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+"Ax" ) );
189 addToolBar (filterToolBar , tbd );
190 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
191 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
192 } else {
193 filterToolBar = 0;
194 filterMenubar = 0;
195 filterPopupMenu = 0;
196 }
197
198 if ( p->mToolBarHorV ) {
199 if ( p->mToolBarUpV )
200 tbd = Bottom;
201 else
202 tbd = Top;
203 }
204 else {
205 if ( p->mToolBarUpV )
206 tbd = Right;
207 else
208 tbd = Left;
209 }
210 viewToolBar = new QPEToolBar( this );
211 addToolBar (viewToolBar , tbd );
212 if ( p->mToolBarHorN ) {
213 if ( p->mToolBarUpN )
214 tbd = Bottom;
215 else
216 tbd = Top;
217 }
218 else {
219 if ( p->mToolBarUpN )
220 tbd = Right;
221 else
222 tbd = Left;
223 }
224 navigatorToolBar = new QPEToolBar( this );
225 addToolBar (navigatorToolBar , tbd );
226
227
228
229
167 mCalendarModifiedFlag = false; 230 mCalendarModifiedFlag = false;
168 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 231 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
169 splash->setAlignment ( AlignCenter ); 232 splash->setAlignment ( AlignCenter );
@@ -631,6 +694,8 @@ void MainWindow::initActions()
631 icon = loadPixmap( pathString + "newevent" ); 694 icon = loadPixmap( pathString + "newevent" );
632 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 695 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
633 configureToolBarMenu->insertSeparator(); 696 configureToolBarMenu->insertSeparator();
697 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
698 configureToolBarMenu->insertSeparator();
634 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 699 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
635 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 700 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
636 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 701 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
@@ -999,7 +1064,7 @@ void MainWindow::initActions()
999 // menubar icons 1064 // menubar icons
1000 1065
1001 1066
1002 iconToolBar->setHorizontalStretchable (true ); 1067
1003 //menuBar->insertItem( iconToolBar ); 1068 //menuBar->insertItem( iconToolBar );
1004 //xdays_action 1069 //xdays_action
1005 if (p-> mShowIconNewEvent) 1070 if (p-> mShowIconNewEvent)
@@ -1011,25 +1076,25 @@ void MainWindow::initActions()
1011 if (p-> mShowIconWhatsThis) 1076 if (p-> mShowIconWhatsThis)
1012 QWhatsThis::whatsThisButton ( iconToolBar ); 1077 QWhatsThis::whatsThisButton ( iconToolBar );
1013 if (p-> mShowIconNext) 1078 if (p-> mShowIconNext)
1014 whatsnext_action->addTo( iconToolBar ); 1079 whatsnext_action->addTo( viewToolBar );
1015 if (p-> mShowIconNextDays) 1080 if (p-> mShowIconNextDays)
1016 xdays_action->addTo( iconToolBar ); 1081 xdays_action->addTo( viewToolBar );
1017 if (p-> mShowIconJournal) 1082 if (p-> mShowIconJournal)
1018 viewjournal_action->addTo( iconToolBar ); 1083 viewjournal_action->addTo( viewToolBar );
1019 if (p-> mShowIconDay1) 1084 if (p-> mShowIconDay1)
1020 day1_action->addTo( iconToolBar ); 1085 day1_action->addTo( viewToolBar );
1021 if (p-> mShowIconDay5) 1086 if (p-> mShowIconDay5)
1022 day5_action->addTo( iconToolBar ); 1087 day5_action->addTo( viewToolBar );
1023 if (p-> mShowIconDay7) 1088 if (p-> mShowIconDay7)
1024 day7_action->addTo( iconToolBar ); 1089 day7_action->addTo( viewToolBar );
1025 if (p-> mShowIconDay6) 1090 if (p-> mShowIconDay6)
1026 day6_action->addTo( iconToolBar ); 1091 day6_action->addTo( viewToolBar );
1027 if (p-> mShowIconMonth) 1092 if (p-> mShowIconMonth)
1028 month_action->addTo( iconToolBar ); 1093 month_action->addTo( viewToolBar );
1029 if (p-> mShowIconList) 1094 if (p-> mShowIconList)
1030 showlist_action->addTo( iconToolBar ); 1095 showlist_action->addTo( viewToolBar );
1031 if (p-> mShowIconTodoview) 1096 if (p-> mShowIconTodoview)
1032 todoview_action->addTo( iconToolBar ); 1097 todoview_action->addTo( viewToolBar );
1033 1098
1034 icon = loadPixmap( pathString + "2leftarrowB" ); 1099 icon = loadPixmap( pathString + "2leftarrowB" );
1035 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); 1100 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200);
@@ -1037,7 +1102,7 @@ void MainWindow::initActions()
1037 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1102 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1038 connect( action, SIGNAL( activated() ), 1103 connect( action, SIGNAL( activated() ),
1039 mView, SLOT( goPreviousMonth() ) ); 1104 mView, SLOT( goPreviousMonth() ) );
1040 action->addTo( iconToolBar ); 1105 action->addTo( navigatorToolBar );
1041 } 1106 }
1042 icon = loadPixmap( pathString + "1leftarrowB" ); 1107 icon = loadPixmap( pathString + "1leftarrowB" );
1043 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); 1108 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210);
@@ -1045,19 +1110,19 @@ void MainWindow::initActions()
1045 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1110 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1046 connect( action, SIGNAL( activated() ), 1111 connect( action, SIGNAL( activated() ),
1047 mView, SLOT( goPrevious() ) ); 1112 mView, SLOT( goPrevious() ) );
1048 action->addTo( iconToolBar ); 1113 action->addTo( navigatorToolBar );
1049 } 1114 }
1050 icon = loadPixmap( pathString + "today" ); 1115 icon = loadPixmap( pathString + "today" );
1051 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1116 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1052 if (p-> mShowIconToday) 1117 if (p-> mShowIconToday)
1053 today_action->addTo( iconToolBar ); 1118 today_action->addTo( navigatorToolBar );
1054 icon = loadPixmap( pathString + "1rightarrowB" ); 1119 icon = loadPixmap( pathString + "1rightarrowB" );
1055 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1120 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1056 if (p-> mShowIconForward) { 1121 if (p-> mShowIconForward) {
1057 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1122 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1058 connect( action, SIGNAL( activated() ), 1123 connect( action, SIGNAL( activated() ),
1059 mView, SLOT( goNext() ) ); 1124 mView, SLOT( goNext() ) );
1060 action->addTo( iconToolBar ); 1125 action->addTo( navigatorToolBar );
1061 } 1126 }
1062 icon = loadPixmap( pathString + "2rightarrowB" ); 1127 icon = loadPixmap( pathString + "2rightarrowB" );
1063 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1128 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
@@ -1065,7 +1130,7 @@ void MainWindow::initActions()
1065 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1130 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1066 connect( action, SIGNAL( activated() ), 1131 connect( action, SIGNAL( activated() ),
1067 mView, SLOT( goNextMonth() ) ); 1132 mView, SLOT( goNextMonth() ) );
1068 action->addTo( iconToolBar ); 1133 action->addTo( navigatorToolBar );
1069 } 1134 }
1070 1135
1071 1136
@@ -1111,12 +1176,27 @@ void MainWindow::initActions()
1111 configureToolBarMenu->setItemChecked( 300, true ); 1176 configureToolBarMenu->setItemChecked( 300, true );
1112 if (p-> mShowIconWeekNum) 1177 if (p-> mShowIconWeekNum)
1113 configureToolBarMenu->setItemChecked( 400, true ); 1178 configureToolBarMenu->setItemChecked( 400, true );
1114 QLabel* dummy = new QLabel( iconToolBar ); 1179 if (!p-> mShowIconStretch) {
1115 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1180 QLabel* dummy = new QLabel( iconToolBar );
1116 if (!p-> mShowIconStretch) 1181 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1182 dummy->setMinimumWidth( 0 );
1117 iconToolBar->setStretchableWidget ( dummy ) ; 1183 iconToolBar->setStretchableWidget ( dummy ) ;
1118 else 1184 }
1185 else {
1186 iconToolBar->setHorizontalStretchable (true );
1187 viewToolBar->setHorizontalStretchable (true );
1188 navigatorToolBar->setHorizontalStretchable (true );
1189 iconToolBar->setVerticalStretchable (true );
1190 viewToolBar->setVerticalStretchable (true );
1191 navigatorToolBar->setVerticalStretchable (true );
1119 configureToolBarMenu->setItemChecked( 5, true ); 1192 configureToolBarMenu->setItemChecked( 5, true );
1193 }
1194 if (p-> mShowIconFilter)
1195 configureToolBarMenu->setItemChecked( 7, true );
1196
1197
1198 if ( filterMenubar )
1199 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) );
1120 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1200 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1121 configureAgenda( p->mHourSize ); 1201 configureAgenda( p->mHourSize );
1122 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1202 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
@@ -1561,8 +1641,27 @@ void MainWindow::saveOnClose()
1561{ 1641{
1562 KOPrefs *p = KOPrefs::instance(); 1642 KOPrefs *p = KOPrefs::instance();
1563 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1643 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1564 p->mToolBarUp = iconToolBar->x() > width()/2 || 1644 if ( p->mToolBarHor )
1565 iconToolBar->y() > height()/2; 1645 p->mToolBarUp = iconToolBar->y() > height()/2;
1646 else
1647 p->mToolBarUp = iconToolBar->x() > width()/2;
1648 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1649 if ( p->mToolBarHorV )
1650 p->mToolBarUpV = viewToolBar->y() > height()/2;
1651 else
1652 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1653 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1654 if ( p->mToolBarHorN )
1655 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1656 else
1657 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1658 if ( filterToolBar ) {
1659 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1660 if ( p->mToolBarHorF )
1661 p->mToolBarUpF = filterToolBar->y() > height()/2;
1662 else
1663 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1664 }
1566 mView->writeSettings(); 1665 mView->writeSettings();
1567 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) 1666 if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName()))
1568 save(); 1667 save();
@@ -1805,47 +1904,86 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1805void MainWindow::fillFilterMenu() 1904void MainWindow::fillFilterMenu()
1806{ 1905{
1807 selectFilterMenu->clear(); 1906 selectFilterMenu->clear();
1808 bool disable = false;
1809 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 1907 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
1810 selectFilterMenu->insertSeparator(); 1908 selectFilterMenu->insertSeparator();
1811 if ( mView->filterView()->filtersEnabled() ) { 1909 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
1812 selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); 1910
1813 }
1814 else {
1815 selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 );
1816 disable = true;
1817 }
1818 selectFilterMenu->insertSeparator(); 1911 selectFilterMenu->insertSeparator();
1819 QPtrList<CalFilter> fili = mView->filters(); 1912 QPtrList<CalFilter> fili = mView->filters();
1820 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1913 CalFilter *curfilter = mView->filterView()->selectedFilter();
1821 CalFilter *filter = fili.first(); 1914 CalFilter *filter = fili.first();
1822 int iii = 2; 1915 int iii = 2;
1916 bool checkitem = mView->filterView()->filtersEnabled();
1823 while(filter) { 1917 while(filter) {
1824 selectFilterMenu->insertItem( filter->name(), iii ); 1918 selectFilterMenu->insertItem( filter->name(), iii );
1825 if ( filter == curfilter) 1919 if ( filter == curfilter)
1826 selectFilterMenu->setItemChecked( iii, true ); 1920 selectFilterMenu->setItemChecked( iii, checkitem );
1827 if ( disable )
1828 selectFilterMenu->setItemEnabled( iii, false );
1829 filter = fili.next(); 1921 filter = fili.next();
1830 ++iii; 1922 ++iii;
1831 } 1923 }
1924 if ( !checkitem )
1925 selectFilterMenu->setItemChecked( 1, true );
1926}
1927void MainWindow::fillFilterMenuPopup()
1928{
1929 filterPopupMenu->clear();
1930 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
1931
1932 filterPopupMenu->insertSeparator();
1933 QPtrList<CalFilter> fili = mView->filters();
1934 CalFilter *curfilter = mView->filterView()->selectedFilter();
1935 CalFilter *filter = fili.first();
1936 int iii = 1;
1937 bool checkitem = mView->filterView()->filtersEnabled();
1938 while(filter) {
1939 filterPopupMenu->insertItem( filter->name(), iii );
1940 if ( filter == curfilter)
1941 filterPopupMenu->setItemChecked( iii, checkitem );
1942 filter = fili.next();
1943 ++iii;
1944 }
1945 if ( !checkitem )
1946 filterPopupMenu->setItemChecked( 0, true );
1832} 1947}
1833void MainWindow::selectFilter( int fil ) 1948void MainWindow::selectFilter( int fil )
1834{ 1949{
1950
1835 if ( fil == 0 ) { 1951 if ( fil == 0 ) {
1836 mView->editFilters( ); 1952 mView->editFilters( );
1837 } else if ( fil == 1 ){ 1953 } else if ( fil == 1 ){
1838 mView->toggleFilerEnabled( ); 1954 if ( mView->filterView()->filtersEnabled() )
1955 mView->toggleFilerEnabled( );
1839 } else { 1956 } else {
1957 if ( !mView->filterView()->filtersEnabled() )
1958 mView->toggleFilerEnabled( );
1840 mView->selectFilter( fil-2 ); 1959 mView->selectFilter( fil-2 );
1960 }
1961}
1962void MainWindow::updateFilterToolbar()
1963{
1964 if ( filterMenubar ) {
1965 if ( !mView->filterView()->filtersEnabled() ) {
1966 filterMenubar->changeItem( 0, i18n("No Filter") );
1967 } else {
1968 CalFilter *curfilter = mView->filterView()->selectedFilter();
1969 if ( curfilter ) {
1970 filterMenubar->changeItem( 0, curfilter->name() );
1971 }
1972 }
1841 } 1973 }
1842} 1974}
1975void MainWindow::selectFilterPopup( int fil )
1976{
1977 selectFilter( fil + 1 );
1978
1979}
1843void MainWindow::configureToolBar( int item ) 1980void MainWindow::configureToolBar( int item )
1844{ 1981{
1845 1982
1846 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 1983 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
1847 KOPrefs *p = KOPrefs::instance(); 1984 KOPrefs *p = KOPrefs::instance();
1848 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 1985 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
1986 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
1849 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 1987 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
1850 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 1988 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
1851 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 1989 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index b3041dc..79fb305 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -24,6 +24,7 @@ class KSyncProfile;
24#define QPEMenuBar QMenuBar 24#define QPEMenuBar QMenuBar
25#endif 25#endif
26class QPEToolBar; 26class QPEToolBar;
27class QPEMenuBar;
27 28
28 29
29namespace KCal { 30namespace KCal {
@@ -53,6 +54,7 @@ class MainWindow : public QMainWindow
53 void setCaption ( const QString & ); 54 void setCaption ( const QString & );
54 void updateWeekNum(const KCal::DateList &); 55 void updateWeekNum(const KCal::DateList &);
55 void updateWeek(QDate); 56 void updateWeek(QDate);
57 void updateFilterToolbar();
56 virtual void showMaximized (); 58 virtual void showMaximized ();
57 void configureAgenda( int ); 59 void configureAgenda( int );
58 void recieve( const QCString& msg, const QByteArray& data ); 60 void recieve( const QCString& msg, const QByteArray& data );
@@ -93,6 +95,8 @@ class MainWindow : public QMainWindow
93 void exportVCalendar(); 95 void exportVCalendar();
94 void fillFilterMenu(); 96 void fillFilterMenu();
95 void selectFilter( int ); 97 void selectFilter( int );
98 void fillFilterMenuPopup();
99 void selectFilterPopup( int );
96 void exportToPhone( int ); 100 void exportToPhone( int );
97 void toggleBeamReceive(); 101 void toggleBeamReceive();
98 void disableBR(bool); 102 void disableBR(bool);
@@ -114,13 +118,18 @@ class MainWindow : public QMainWindow
114#ifndef DESKTOP_VERSION 118#ifndef DESKTOP_VERSION
115 QCopChannel* infrared; 119 QCopChannel* infrared;
116#endif 120#endif
117 QAction* brAction; 121 QAction* brAction;
118 KSyncManager* mSyncManager; 122 KSyncManager* mSyncManager;
119 bool mClosed; 123 bool mClosed;
120 void saveOnClose(); 124 void saveOnClose();
121 bool mFlagKeyPressed; 125 bool mFlagKeyPressed;
122 bool mBlockAtStartup; 126 bool mBlockAtStartup;
123 QPEToolBar *iconToolBar; 127 QPEToolBar *iconToolBar;
128 QPEToolBar *viewToolBar;
129 QPEToolBar *navigatorToolBar;
130 QPEToolBar *filterToolBar;
131 QPEMenuBar *filterMenubar;
132 QPopupMenu * filterPopupMenu;
124 void initActions(); 133 void initActions();
125 void setDefaultPreferences(); 134 void setDefaultPreferences();
126 void keyPressEvent ( QKeyEvent * ) ; 135 void keyPressEvent ( QKeyEvent * ) ;