summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-30 00:57:42 (UTC)
committer zautrix <zautrix>2005-03-30 00:57:42 (UTC)
commit889d2102fcfe2fb0786b3f8f406dc32b42e38c7a (patch) (unidiff)
tree32b269c1140a5646a00b65c78ac71116adb91aa1
parent99324133d35ba588b688bc5b22788fd8fb9e752d (diff)
downloadkdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.zip
kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.gz
kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp67
-rw-r--r--korganizer/mainwindow.h4
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp13
3 files changed, 71 insertions, 13 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 6ddced0..ae03a09 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -635,48 +635,60 @@ void MainWindow::initActions()
635 menuBar->insertItem( i18n("View"), viewMenu ); 635 menuBar->insertItem( i18n("View"), viewMenu );
636 menuBar->insertItem( i18n("Actions"), actionMenu ); 636 menuBar->insertItem( i18n("Actions"), actionMenu );
637 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 637 menuBar->insertItem( i18n("Synchronize"), syncMenu );
638 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 638 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
639 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 639 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
640 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 640 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
641 menuBar->insertItem( i18n("Help"), helpMenu ); 641 menuBar->insertItem( i18n("Help"), helpMenu );
642 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 642 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
643 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 643 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
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 );
650 icon = mWeekPixmap; 652 icon = mWeekPixmap;
651 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 653 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
652 if ( p-> mShowIconWeekNum ) 654 if ( p-> mShowIconWeekNum )
653 mWeekAction->addTo( iconToolBar ); 655 mWeekAction->addTo( iconToolBar );
654 mWeekFont = font(); 656 mWeekFont = font();
655 657
656 int fontPoint = mWeekFont.pointSize(); 658 int fontPoint = mWeekFont.pointSize();
657 QFontMetrics f( mWeekFont ); 659 QFontMetrics f( mWeekFont );
658 int fontWid = f.width( "30" ); 660 int fontWid = f.width( "30" );
659 while ( fontWid > pixWid ) { 661 while ( fontWid > pixWid ) {
660 --fontPoint; 662 --fontPoint;
661 mWeekFont.setPointSize( fontPoint ); 663 mWeekFont.setPointSize( fontPoint );
662 QFontMetrics f( mWeekFont ); 664 QFontMetrics f( mWeekFont );
663 fontWid = f.width( "30" ); 665 fontWid = f.width( "30" );
664 //qDebug("dec-- "); 666 //qDebug("dec-- ");
665 } 667 }
666 668
667 connect( mWeekAction, SIGNAL( activated() ), 669 connect( mWeekAction, SIGNAL( activated() ),
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 // ******************
674 QAction *action; 686 QAction *action;
675 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 687 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
676 configureToolBarMenu->setCheckable( true ); 688 configureToolBarMenu->setCheckable( true );
677 689
678 690
679 configureAgendaMenu->setCheckable( true ); 691 configureAgendaMenu->setCheckable( true );
680 int iii ; 692 int iii ;
681 for ( iii = 1;iii<= 10 ;++iii ){ 693 for ( iii = 1;iii<= 10 ;++iii ){
682 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 694 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
@@ -769,33 +781,25 @@ void MainWindow::initActions()
769 viewMenu->insertSeparator(); 781 viewMenu->insertSeparator();
770 icon = loadPixmap( pathString + "picker" ); 782 icon = loadPixmap( pathString + "picker" );
771 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 783 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
772 action->addTo( viewMenu ); 784 action->addTo( viewMenu );
773 connect( action, SIGNAL( activated() ), 785 connect( action, SIGNAL( activated() ),
774 mView, SLOT( showDatePicker() ) ); 786 mView, SLOT( showDatePicker() ) );
775 action->addTo( iconToolBar ); 787 action->addTo( iconToolBar );
776 viewMenu->insertSeparator(); 788 viewMenu->insertSeparator();
777 789
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
793 797
794 icon = loadPixmap( pathString + "whatsnext" ); 798 icon = loadPixmap( pathString + "whatsnext" );
795 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 799 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
796 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 800 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
797 whatsnext_action->addTo( viewMenu ); 801 whatsnext_action->addTo( viewMenu );
798 connect( whatsnext_action, SIGNAL( activated() ), 802 connect( whatsnext_action, SIGNAL( activated() ),
799 mView->viewManager(), SLOT( showWhatsNextView() ) ); 803 mView->viewManager(), SLOT( showWhatsNextView() ) );
800 804
801 icon = loadPixmap( pathString + "xdays" ); 805 icon = loadPixmap( pathString + "xdays" );
@@ -1954,25 +1958,69 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1954 1958
1955 default: 1959 default:
1956 e->ignore(); 1960 e->ignore();
1957 } 1961 }
1958 if ( pro > 0 ) { 1962 if ( pro > 0 ) {
1959 mView->selectFilter( pro-1 ); 1963 mView->selectFilter( pro-1 );
1960 } 1964 }
1961 if ( showSelectedDates ) { 1965 if ( showSelectedDates ) {
1962 ;// setCaptionToDates(); 1966 ;// setCaptionToDates();
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();
1970 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2018 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
1971 selectFilterMenu->insertSeparator(); 2019 selectFilterMenu->insertSeparator();
1972 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2020 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
1973 2021
1974 selectFilterMenu->insertSeparator(); 2022 selectFilterMenu->insertSeparator();
1975 QPtrList<CalFilter> fili = mView->filters(); 2023 QPtrList<CalFilter> fili = mView->filters();
1976 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2024 CalFilter *curfilter = mView->filterView()->selectedFilter();
1977 CalFilter *filter = fili.first(); 2025 CalFilter *filter = fili.first();
1978 int iii = 2; 2026 int iii = 2;
@@ -2302,24 +2350,25 @@ void MainWindow::printSel( )
2302{ 2350{
2303 mView->viewManager()->agendaView()->agenda()->printSelection(); 2351 mView->viewManager()->agendaView()->agenda()->printSelection();
2304} 2352}
2305 2353
2306void MainWindow::printCal() 2354void MainWindow::printCal()
2307{ 2355{
2308 mView->print();//mCp->showDialog(); 2356 mView->print();//mCp->showDialog();
2309} 2357}
2310 2358
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;
2317 KPopupFrame* popup = new KPopupFrame(this); 2366 KPopupFrame* popup = new KPopupFrame(this);
2318 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2367 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2319 // ----- 2368 // -----
2320 picker->resize(picker->sizeHint()); 2369 picker->resize(picker->sizeHint());
2321 popup->setMainWidget(picker); 2370 popup->setMainWidget(picker);
2322 picker->setFocus(); 2371 picker->setFocus();
2323 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2372 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2324 int x = 0; 2373 int x = 0;
2325 int y = iconToolBar->height(); 2374 int y = iconToolBar->height();
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 79fb305..7c16aeb 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -85,24 +85,25 @@ class MainWindow : public QMainWindow
85 85
86 void slotModifiedChanged( bool ); 86 void slotModifiedChanged( bool );
87 87
88 void save(); 88 void save();
89 void saveStopTimer(); 89 void saveStopTimer();
90 void configureToolBar( int ); 90 void configureToolBar( int );
91 void printSel(); 91 void printSel();
92 void printCal(); 92 void printCal();
93 void saveCalendar(); 93 void saveCalendar();
94 void loadCalendar(); 94 void loadCalendar();
95 void exportVCalendar(); 95 void exportVCalendar();
96 void fillFilterMenu(); 96 void fillFilterMenu();
97 void fillFilterMenuTB();
97 void selectFilter( int ); 98 void selectFilter( int );
98 void fillFilterMenuPopup(); 99 void fillFilterMenuPopup();
99 void selectFilterPopup( int ); 100 void selectFilterPopup( int );
100 void exportToPhone( int ); 101 void exportToPhone( int );
101 void toggleBeamReceive(); 102 void toggleBeamReceive();
102 void disableBR(bool); 103 void disableBR(bool);
103 signals: 104 signals:
104 void selectWeek ( int ); 105 void selectWeek ( int );
105 private slots: 106 private slots:
106 void showConfigureAgenda(); 107 void showConfigureAgenda();
107 void getFile( bool ); 108 void getFile( bool );
108 void syncFileRequest(); 109 void syncFileRequest();
@@ -127,44 +128,45 @@ class MainWindow : public QMainWindow
127 QPEToolBar *iconToolBar; 128 QPEToolBar *iconToolBar;
128 QPEToolBar *viewToolBar; 129 QPEToolBar *viewToolBar;
129 QPEToolBar *navigatorToolBar; 130 QPEToolBar *navigatorToolBar;
130 QPEToolBar *filterToolBar; 131 QPEToolBar *filterToolBar;
131 QPEMenuBar *filterMenubar; 132 QPEMenuBar *filterMenubar;
132 QPopupMenu * filterPopupMenu; 133 QPopupMenu * filterPopupMenu;
133 void initActions(); 134 void initActions();
134 void setDefaultPreferences(); 135 void setDefaultPreferences();
135 void keyPressEvent ( QKeyEvent * ) ; 136 void keyPressEvent ( QKeyEvent * ) ;
136 void keyReleaseEvent ( QKeyEvent * ) ; 137 void keyReleaseEvent ( QKeyEvent * ) ;
137 QPopupMenu *configureToolBarMenu; 138 QPopupMenu *configureToolBarMenu;
138 QPopupMenu *selectFilterMenu; 139 QPopupMenu *selectFilterMenu;
140 QPopupMenu *selectFilterMenuTB;
139 QPopupMenu *configureAgendaMenu, *syncMenu; 141 QPopupMenu *configureAgendaMenu, *syncMenu;
140 CalendarLocal *mCalendar; 142 CalendarLocal *mCalendar;
141 CalendarView *mView; 143 CalendarView *mView;
142 QAction *mNewSubTodoAction; 144 QAction *mNewSubTodoAction;
143 QAction *mWeekAction; 145 QAction *mWeekAction;
144 QFont mWeekFont; 146 QFont mWeekFont;
145 QPixmap mWeekPixmap; 147 QPixmap mWeekPixmap;
146 QColor mWeekBgColor; 148 QColor mWeekBgColor;
147 149
148 QAction *mShowAction; 150 QAction *mShowAction;
149 QAction *mEditAction; 151 QAction *mEditAction;
150 QAction *mDeleteAction; 152 QAction *mDeleteAction;
151 QAction *mCloneAction; 153 QAction *mCloneAction;
152 QAction *mMoveAction; 154 QAction *mMoveAction;
153 QAction *mBeamAction; 155 QAction *mBeamAction;
154 QAction *mCancelAction; 156 QAction *mCancelAction;
155 157
156 QAction *mToggleNav; 158 QAction *mToggleNav;
157 QAction *mToggleFilter; 159 QAction *mToggleFilter;
158 QAction *mToggleAllday; 160 QAction *mToggleAllday;
159 161 QAction *actionFilterMenuTB;
160 162
161 void closeEvent( QCloseEvent* ce ); 163 void closeEvent( QCloseEvent* ce );
162 SimpleAlarmClient mAlarmClient; 164 SimpleAlarmClient mAlarmClient;
163 QTimer mSaveTimer; 165 QTimer mSaveTimer;
164 //bool mBlockSaveFlag; 166 //bool mBlockSaveFlag;
165 bool mCalendarModifiedFlag; 167 bool mCalendarModifiedFlag;
166 QPixmap loadPixmap( QString ); 168 QPixmap loadPixmap( QString );
167}; 169};
168 170
169 171
170#endif 172#endif
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index bbed38d..5cd845e 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -134,28 +134,35 @@ void KDEPIMConfigWidget::setupStoreTab()
134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
136 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 136 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
137} 137}
138void KDEPIMConfigWidget::setStandardStore() 138void KDEPIMConfigWidget::setStandardStore()
139{ 139{
140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
141 saveStoreSettings(); 141 saveStoreSettings();
142} 142}
143void KDEPIMConfigWidget::saveStoreSettings() 143void KDEPIMConfigWidget::saveStoreSettings()
144{ 144{
145 if ( !mStoreUrl->url().isEmpty() ) { 145 if ( !mStoreUrl->url().isEmpty() ) {
146 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); 146 QString path = QDir::homeDirPath();
147 QString url = mStoreUrl->url();
148#ifdef DESKTOP_VERSION
149 if ( url.startsWith( "LOCAL:" ) ) {
150 path = qApp->applicationDirPath () ;
151 }
152#endif
153 KConfig cfg ( path + "/.microkdehome" );
147 cfg.setGroup("Global"); 154 cfg.setGroup("Global");
148 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); 155 cfg.writeEntry( "MICROKDEHOME", url );
149 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); 156 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
150 cfg.sync(); 157 cfg.sync();
151 } else { 158 } else {
152 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 159 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
153 saveStoreSettings(); 160 saveStoreSettings();
154 } 161 }
155} 162}
156void KDEPIMConfigWidget::setupExternalAppTab() 163void KDEPIMConfigWidget::setupExternalAppTab()
157{ 164{
158 QWidget *externalAppsPage = new QWidget( this ); 165 QWidget *externalAppsPage = new QWidget( this );
159 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 166 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
160 KDialog::spacingHintSmall() ); 167 KDialog::spacingHintSmall() );
161 168