summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-30 00:57:42 (UTC)
committer zautrix <zautrix>2005-03-30 00:57:42 (UTC)
commit889d2102fcfe2fb0786b3f8f406dc32b42e38c7a (patch) (side-by-side diff)
tree32b269c1140a5646a00b65c78ac71116adb91aa1
parent99324133d35ba588b688bc5b22788fd8fb9e752d (diff)
downloadkdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.zip
kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.gz
kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.bz2
fixes
Diffstat (more/less context) (show 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
@@ -639,16 +639,18 @@ void MainWindow::initActions()
menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
menuBar->insertItem( i18n("Filter"),selectFilterMenu );
menuBar->insertItem( i18n("Help"), helpMenu );
//menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
menuBar1->setMaximumSize( menuBar1->sizeHint( ));
}
connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
+
+
mWeekBgColor = iconToolBar->backgroundColor();
mWeekPixmap.resize( pixWid , pixHei );
mWeekPixmap.fill( mWeekBgColor );
icon = mWeekPixmap;
mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
if ( p-> mShowIconWeekNum )
mWeekAction->addTo( iconToolBar );
mWeekFont = font();
@@ -663,16 +665,26 @@ void MainWindow::initActions()
fontWid = f.width( "30" );
//qDebug("dec-- ");
}
connect( mWeekAction, SIGNAL( activated() ),
this, SLOT( weekAction() ) );
connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
+ if ( p->mShowIconFilterview ) {
+ icon = loadPixmap( pathString + "filter" );
+ actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
+ connect( actionFilterMenuTB, SIGNAL( activated() ),
+ this, SLOT( fillFilterMenuTB() ) );
+ actionFilterMenuTB->addTo( iconToolBar );
+ selectFilterMenuTB = new QPopupMenu( this );
+ selectFilterMenuTB->setCheckable( true );
+ connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
+ }
//#endif
// ******************
QAction *action;
// QPopupMenu *configureMenu= new QPopupMenu( menuBar );
configureToolBarMenu->setCheckable( true );
@@ -773,25 +785,17 @@ void MainWindow::initActions()
connect( action, SIGNAL( activated() ),
mView, SLOT( showDatePicker() ) );
action->addTo( iconToolBar );
viewMenu->insertSeparator();
if ( p-> mShowIconToggleFull )
FSaction->addTo( iconToolBar );
if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
- if ( p->mShowIconFilterview ) {
- icon = loadPixmap( pathString + "filter" );
- QPEMenuBar *menuBar111 = new QPEMenuBar( iconToolBar );
- menuBar111->insertItem( icon.pixmap(), selectFilterMenu);
- int isi = 24;
- if ( QApplication::desktop()->width() < 480 )
- isi = 18;
- menuBar111->setFixedSize( QSize( isi, isi )) ;
- }
+
//********************
if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
icon = loadPixmap( pathString + "whatsnext" );
configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
whatsnext_action->addTo( viewMenu );
@@ -1958,17 +1962,61 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
if ( pro > 0 ) {
mView->selectFilter( pro-1 );
}
if ( showSelectedDates ) {
;// setCaptionToDates();
}
}
+void MainWindow::fillFilterMenuTB()
+{
+ selectFilterMenuTB->clear();
+ selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
+ selectFilterMenuTB->insertSeparator();
+ selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
+
+ selectFilterMenuTB->insertSeparator();
+ QPtrList<CalFilter> fili = mView->filters();
+ CalFilter *curfilter = mView->filterView()->selectedFilter();
+ CalFilter *filter = fili.first();
+ int iii = 2;
+ bool checkitem = mView->filterView()->filtersEnabled();
+ while(filter) {
+ selectFilterMenuTB->insertItem( filter->name(), iii );
+ if ( filter == curfilter)
+ selectFilterMenuTB->setItemChecked( iii, checkitem );
+ filter = fili.next();
+ ++iii;
+ }
+ if ( !checkitem )
+ selectFilterMenuTB->setItemChecked( 1, true );
+ int x = 0;
+ int y = iconToolBar->height();
+ int dX = 0;
+ int dY = 0;
+ if ( iconToolBar->orientation () == Qt:: Horizontal ) {
+ if ( iconToolBar->y() > height()/2 ) {
+ dY = selectFilterMenuTB->sizeHint().height()+8;
+ y = 0;
+ }
+ } else {
+ if ( iconToolBar->x() > width()/2 ) { // right side
+ x=0;
+ dX= selectFilterMenuTB->sizeHint().width()+8;
+ y = 0;
+ } else {
+ x= iconToolBar->width();
+ y = 0;
+ }
+ }
+ //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
+ selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
+}
void MainWindow::fillFilterMenu()
{
selectFilterMenu->clear();
selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
selectFilterMenu->insertSeparator();
selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
selectFilterMenu->insertSeparator();
@@ -2306,16 +2354,17 @@ void MainWindow::printSel( )
void MainWindow::printCal()
{
mView->print();//mCp->showDialog();
}
#include "libkdepim/kdatepicker.h"
#include <kdatetbl.h>
+
void MainWindow::weekAction()
{
int month;
KPopupFrame* popup = new KPopupFrame(this);
KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
// -----
picker->resize(picker->sizeHint());
popup->setMainWidget(picker);
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 79fb305..7c16aeb 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -89,16 +89,17 @@ class MainWindow : public QMainWindow
void saveStopTimer();
void configureToolBar( int );
void printSel();
void printCal();
void saveCalendar();
void loadCalendar();
void exportVCalendar();
void fillFilterMenu();
+ void fillFilterMenuTB();
void selectFilter( int );
void fillFilterMenuPopup();
void selectFilterPopup( int );
void exportToPhone( int );
void toggleBeamReceive();
void disableBR(bool);
signals:
void selectWeek ( int );
@@ -131,16 +132,17 @@ class MainWindow : public QMainWindow
QPEMenuBar *filterMenubar;
QPopupMenu * filterPopupMenu;
void initActions();
void setDefaultPreferences();
void keyPressEvent ( QKeyEvent * ) ;
void keyReleaseEvent ( QKeyEvent * ) ;
QPopupMenu *configureToolBarMenu;
QPopupMenu *selectFilterMenu;
+ QPopupMenu *selectFilterMenuTB;
QPopupMenu *configureAgendaMenu, *syncMenu;
CalendarLocal *mCalendar;
CalendarView *mView;
QAction *mNewSubTodoAction;
QAction *mWeekAction;
QFont mWeekFont;
QPixmap mWeekPixmap;
QColor mWeekBgColor;
@@ -151,17 +153,17 @@ class MainWindow : public QMainWindow
QAction *mCloneAction;
QAction *mMoveAction;
QAction *mBeamAction;
QAction *mCancelAction;
QAction *mToggleNav;
QAction *mToggleFilter;
QAction *mToggleAllday;
-
+ QAction *actionFilterMenuTB;
void closeEvent( QCloseEvent* ce );
SimpleAlarmClient mAlarmClient;
QTimer mSaveTimer;
//bool mBlockSaveFlag;
bool mCalendarModifiedFlag;
QPixmap loadPixmap( QString );
};
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
@@ -138,20 +138,27 @@ void KDEPIMConfigWidget::setupStoreTab()
void KDEPIMConfigWidget::setStandardStore()
{
mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
saveStoreSettings();
}
void KDEPIMConfigWidget::saveStoreSettings()
{
if ( !mStoreUrl->url().isEmpty() ) {
- KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
+ QString path = QDir::homeDirPath();
+ QString url = mStoreUrl->url();
+#ifdef DESKTOP_VERSION
+ if ( url.startsWith( "LOCAL:" ) ) {
+ path = qApp->applicationDirPath () ;
+ }
+#endif
+ KConfig cfg ( path + "/.microkdehome" );
cfg.setGroup("Global");
- cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() );
- qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); ");
+ cfg.writeEntry( "MICROKDEHOME", url );
+ qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
cfg.sync();
} else {
mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
saveStoreSettings();
}
}
void KDEPIMConfigWidget::setupExternalAppTab()
{