author | zautrix <zautrix> | 2005-03-30 23:17:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-30 23:17:42 (UTC) |
commit | 529c0fb8a8bf15e7bd375ddeb355c5802baf4c93 (patch) (unidiff) | |
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 | |||
@@ -997,12 +997,13 @@ void MonthViewCell::selection( QListBoxItem *item ) | |||
997 | 997 | ||
998 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | 998 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) |
999 | : KOEventView( calendar, parent, name ), | 999 | : KOEventView( calendar, parent, name ), |
1000 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), | 1000 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), |
1001 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) | 1001 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) |
1002 | { | 1002 | { |
1003 | mFlagKeyPressed = false; | ||
1003 | mShortDayLabelsM = false; | 1004 | mShortDayLabelsM = false; |
1004 | mShortDayLabelsW = false; | 1005 | mShortDayLabelsW = false; |
1005 | skipResize = false; | 1006 | skipResize = false; |
1006 | clPending = true; | 1007 | clPending = true; |
1007 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); | 1008 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); |
1008 | mWidStack = new QWidgetStack( this ); | 1009 | mWidStack = new QWidgetStack( this ); |
@@ -1834,15 +1835,31 @@ void KOMonthView::clearSelection() | |||
1834 | { | 1835 | { |
1835 | if ( mSelectedCell ) { | 1836 | if ( mSelectedCell ) { |
1836 | mSelectedCell->deselect(); | 1837 | mSelectedCell->deselect(); |
1837 | mSelectedCell = 0; | 1838 | mSelectedCell = 0; |
1838 | } | 1839 | } |
1839 | } | 1840 | } |
1841 | |||
1842 | void KOMonthView::keyReleaseEvent ( QKeyEvent * e) | ||
1843 | { | ||
1844 | if ( !e->isAutoRepeat() ) { | ||
1845 | mFlagKeyPressed = false; | ||
1846 | } | ||
1847 | } | ||
1848 | |||
1840 | void KOMonthView::keyPressEvent ( QKeyEvent * e ) | 1849 | void KOMonthView::keyPressEvent ( QKeyEvent * e ) |
1841 | { | 1850 | { |
1842 | //qDebug("KOMonthView::keyPressEvent "); | 1851 | |
1852 | qApp->processEvents(); | ||
1853 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | ||
1854 | //e->ignore(); | ||
1855 | e->accept(); | ||
1856 | return; | ||
1857 | } | ||
1858 | if (! e->isAutoRepeat() ) | ||
1859 | mFlagKeyPressed = true; | ||
1843 | switch(e->key()) { | 1860 | switch(e->key()) { |
1844 | case Key_Up: | 1861 | case Key_Up: |
1845 | { | 1862 | { |
1846 | if ( mShowWeekView ) { | 1863 | if ( mShowWeekView ) { |
1847 | emit selectWeekNum ( currentWeek() - 1 ); | 1864 | emit selectWeekNum ( currentWeek() - 1 ); |
1848 | } | 1865 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index c1ca3d4..88050fe 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -308,13 +308,14 @@ class KOMonthView: public KOEventView | |||
308 | bool mShortDayLabelsW; | 308 | bool mShortDayLabelsW; |
309 | int mWidthLongDayLabel; | 309 | int mWidthLongDayLabel; |
310 | 310 | ||
311 | QDate mStartDate; | 311 | QDate mStartDate; |
312 | 312 | ||
313 | MonthViewCell *mSelectedCell; | 313 | MonthViewCell *mSelectedCell; |
314 | 314 | bool mFlagKeyPressed; | |
315 | KOEventPopupMenu *mContextMenu; | 315 | KOEventPopupMenu *mContextMenu; |
316 | void keyPressEvent ( QKeyEvent * ) ; | 316 | void keyPressEvent ( QKeyEvent * ) ; |
317 | void keyReleaseEvent ( QKeyEvent * ) ; | ||
317 | 318 | ||
318 | }; | 319 | }; |
319 | 320 | ||
320 | #endif | 321 | #endif |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ae03a09..09a0880 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -163,13 +163,19 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
163 | if ( KOPrefs::instance()->mUseAppColors ) | 163 | if ( KOPrefs::instance()->mUseAppColors ) |
164 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 164 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
165 | globalFlagBlockStartup = 1; | 165 | globalFlagBlockStartup = 1; |
166 | iconToolBar = new QPEToolBar( this ); | 166 | iconToolBar = new QPEToolBar( this ); |
167 | addToolBar (iconToolBar , tbd ); | 167 | addToolBar (iconToolBar , tbd ); |
168 | 168 | ||
169 | if ( KOPrefs::instance()->mShowIconFilter ) { | 169 | #ifdef DESKTOP_VERSION |
170 | if ( KOPrefs::instance()->mShowIconFilter ) | ||
171 | #else | ||
172 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) | ||
173 | #endif | ||
174 | |||
175 | { | ||
170 | if ( p->mToolBarHorF ) { | 176 | if ( p->mToolBarHorF ) { |
171 | if ( p->mToolBarUpF ) | 177 | if ( p->mToolBarUpF ) |
172 | tbd = Bottom; | 178 | tbd = Bottom; |
173 | else | 179 | else |
174 | tbd = Top; | 180 | tbd = Top; |
175 | } | 181 | } |
@@ -190,21 +196,26 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
190 | addTest = "AAAx"; | 196 | addTest = "AAAx"; |
191 | #endif | 197 | #endif |
192 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) ); | 198 | filterMenubar->setFixedWidth( fm.width( i18n("No Filter")+addTest ) ); |
193 | addToolBar (filterToolBar , tbd ); | 199 | addToolBar (filterToolBar , tbd ); |
194 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 200 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
195 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 201 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
202 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | ||
203 | filterToolBar->hide(); | ||
196 | } else { | 204 | } else { |
197 | filterToolBar = 0; | 205 | filterToolBar = 0; |
198 | filterMenubar = 0; | 206 | filterMenubar = 0; |
199 | filterPopupMenu = 0; | 207 | filterPopupMenu = 0; |
200 | } | 208 | } |
201 | if ( p->mShowIconOnetoolbar ) { | 209 | if ( p->mShowIconOnetoolbar ) { |
202 | viewToolBar = iconToolBar ; | 210 | viewToolBar = iconToolBar ; |
203 | navigatorToolBar = iconToolBar ; | 211 | navigatorToolBar = iconToolBar ; |
204 | } else { | 212 | } else { |
213 | #ifndef DESKTOP_VERSION | ||
214 | setToolBarsMovable( false ); | ||
215 | #endif | ||
205 | if ( p->mToolBarHorV ) { | 216 | if ( p->mToolBarHorV ) { |
206 | if ( p->mToolBarUpV ) | 217 | if ( p->mToolBarUpV ) |
207 | tbd = Bottom; | 218 | tbd = Bottom; |
208 | else | 219 | else |
209 | tbd = Top; | 220 | tbd = Top; |
210 | } | 221 | } |
@@ -2407,6 +2418,19 @@ void MainWindow::hideEvent ( QHideEvent * ) | |||
2407 | QString sum = mCalendar->nextSummary(); | 2418 | QString sum = mCalendar->nextSummary(); |
2408 | 2419 | ||
2409 | 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)); | 2420 | 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)); |
2410 | setCaption( message ); | 2421 | setCaption( message ); |
2411 | } | 2422 | } |
2412 | } | 2423 | } |
2424 | |||
2425 | void MainWindow::resizeEvent( QResizeEvent* e) | ||
2426 | { | ||
2427 | #ifndef DESKTOP_VERSION | ||
2428 | if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar ) { | ||
2429 | if (QApplication::desktop()->width() > QApplication::desktop()->height() ) | ||
2430 | filterToolBar->hide(); | ||
2431 | else | ||
2432 | filterToolBar->show(); | ||
2433 | } | ||
2434 | #endif | ||
2435 | QMainWindow::resizeEvent( e); | ||
2436 | } | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7c16aeb..4d1753f 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -130,12 +130,13 @@ class MainWindow : public QMainWindow | |||
130 | QPEToolBar *navigatorToolBar; | 130 | QPEToolBar *navigatorToolBar; |
131 | QPEToolBar *filterToolBar; | 131 | QPEToolBar *filterToolBar; |
132 | QPEMenuBar *filterMenubar; | 132 | QPEMenuBar *filterMenubar; |
133 | QPopupMenu * filterPopupMenu; | 133 | QPopupMenu * filterPopupMenu; |
134 | void initActions(); | 134 | void initActions(); |
135 | void setDefaultPreferences(); | 135 | void setDefaultPreferences(); |
136 | void resizeEvent( QResizeEvent* e); | ||
136 | void keyPressEvent ( QKeyEvent * ) ; | 137 | void keyPressEvent ( QKeyEvent * ) ; |
137 | void keyReleaseEvent ( QKeyEvent * ) ; | 138 | void keyReleaseEvent ( QKeyEvent * ) ; |
138 | QPopupMenu *configureToolBarMenu; | 139 | QPopupMenu *configureToolBarMenu; |
139 | QPopupMenu *selectFilterMenu; | 140 | QPopupMenu *selectFilterMenu; |
140 | QPopupMenu *selectFilterMenuTB; | 141 | QPopupMenu *selectFilterMenuTB; |
141 | QPopupMenu *configureAgendaMenu, *syncMenu; | 142 | QPopupMenu *configureAgendaMenu, *syncMenu; |