author | zautrix <zautrix> | 2005-03-30 23:17:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-30 23:17:42 (UTC) |
commit | 529c0fb8a8bf15e7bd375ddeb355c5802baf4c93 (patch) (side-by-side diff) | |
tree | 72ebca6de7e54f2cf89d3d6df61d3b40aa66a444 /korganizer | |
parent | 28ac86e2efbc10f210dbd2d5ac0053f4e6198d57 (diff) | |
download | kdepimpi-529c0fb8a8bf15e7bd375ddeb355c5802baf4c93.zip kdepimpi-529c0fb8a8bf15e7bd375ddeb355c5802baf4c93.tar.gz kdepimpi-529c0fb8a8bf15e7bd375ddeb355c5802baf4c93.tar.bz2 |
key fix
-rw-r--r-- | korganizer/komonthview.cpp | 19 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 26 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
4 files changed, 46 insertions, 3 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index ca35a86..b9ce4f4 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -995,16 +995,17 @@ void MonthViewCell::selection( QListBoxItem *item ) // ******************************************************************************* KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) : KOEventView( calendar, parent, name ), mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) { + mFlagKeyPressed = false; mShortDayLabelsM = false; mShortDayLabelsW = false; skipResize = false; clPending = true; mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); mWidStack = new QWidgetStack( this ); QVBoxLayout* hb = new QVBoxLayout( this ); mMonthView = new QWidget( mWidStack ); @@ -1832,19 +1833,35 @@ void KOMonthView::processSelectionChange() void KOMonthView::clearSelection() { if ( mSelectedCell ) { mSelectedCell->deselect(); mSelectedCell = 0; } } + +void KOMonthView::keyReleaseEvent ( QKeyEvent * e) +{ + if ( !e->isAutoRepeat() ) { + mFlagKeyPressed = false; + } +} + void KOMonthView::keyPressEvent ( QKeyEvent * e ) { - //qDebug("KOMonthView::keyPressEvent "); + + qApp->processEvents(); + if ( e->isAutoRepeat() && !mFlagKeyPressed ) { + //e->ignore(); + e->accept(); + return; + } + if (! e->isAutoRepeat() ) + mFlagKeyPressed = true; switch(e->key()) { case Key_Up: { if ( mShowWeekView ) { emit selectWeekNum ( currentWeek() - 1 ); } else { emit prevMonth(); diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index c1ca3d4..88050fe 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -306,15 +306,16 @@ class KOMonthView: public KOEventView bool mShortDayLabelsM; bool mShortDayLabelsW; int mWidthLongDayLabel; QDate mStartDate; MonthViewCell *mSelectedCell; - + bool mFlagKeyPressed; KOEventPopupMenu *mContextMenu; void keyPressEvent ( QKeyEvent * ) ; + void keyReleaseEvent ( QKeyEvent * ) ; }; #endif diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ae03a09..09a0880 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -161,17 +161,23 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : tbd = Left; } if ( KOPrefs::instance()->mUseAppColors ) QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); globalFlagBlockStartup = 1; iconToolBar = new QPEToolBar( this ); addToolBar (iconToolBar , tbd ); - if ( KOPrefs::instance()->mShowIconFilter ) { +#ifdef DESKTOP_VERSION + if ( KOPrefs::instance()->mShowIconFilter ) +#else + if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) +#endif + +{ if ( p->mToolBarHorF ) { if ( p->mToolBarUpF ) tbd = Bottom; else tbd = Top; } else { if ( p->mToolBarUpF ) @@ -188,25 +194,30 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : QString addTest = "Ax"; #ifdef DESKTOP_VERSION addTest = "AAAx"; #endif filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) ); addToolBar (filterToolBar , tbd ); connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); + if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) + filterToolBar->hide(); } else { filterToolBar = 0; filterMenubar = 0; filterPopupMenu = 0; } if ( p->mShowIconOnetoolbar ) { viewToolBar = iconToolBar ; navigatorToolBar = iconToolBar ; } else { +#ifndef DESKTOP_VERSION + setToolBarsMovable( false ); +#endif if ( p->mToolBarHorV ) { if ( p->mToolBarUpV ) tbd = Bottom; else tbd = Top; } else { if ( p->mToolBarUpV ) @@ -2405,8 +2416,21 @@ void MainWindow::hideEvent ( QHideEvent * ) QDateTime nextA = mCalendar->nextAlarmEventDateTime(); if ( nextA.isValid() ) { QString sum = mCalendar->nextSummary(); 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)); setCaption( message ); } } + +void MainWindow::resizeEvent( QResizeEvent* e) +{ +#ifndef DESKTOP_VERSION + if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar ) { + if (QApplication::desktop()->width() > QApplication::desktop()->height() ) + filterToolBar->hide(); + else + filterToolBar->show(); + } +#endif + QMainWindow::resizeEvent( e); +} diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7c16aeb..4d1753f 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -128,16 +128,17 @@ class MainWindow : public QMainWindow QPEToolBar *iconToolBar; QPEToolBar *viewToolBar; QPEToolBar *navigatorToolBar; QPEToolBar *filterToolBar; QPEMenuBar *filterMenubar; QPopupMenu * filterPopupMenu; void initActions(); void setDefaultPreferences(); + void resizeEvent( QResizeEvent* e); void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; QPopupMenu *configureToolBarMenu; QPopupMenu *selectFilterMenu; QPopupMenu *selectFilterMenuTB; QPopupMenu *configureAgendaMenu, *syncMenu; CalendarLocal *mCalendar; CalendarView *mView; |