-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 | |||
@@ -991,24 +991,25 @@ void MonthViewCell::selection( QListBoxItem *item ) | |||
991 | 991 | ||
992 | 992 | ||
993 | // ******************************************************************************* | 993 | // ******************************************************************************* |
994 | // ******************************************************************************* | 994 | // ******************************************************************************* |
995 | // ******************************************************************************* | 995 | // ******************************************************************************* |
996 | 996 | ||
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 ); |
1009 | QVBoxLayout* hb = new QVBoxLayout( this ); | 1010 | QVBoxLayout* hb = new QVBoxLayout( this ); |
1010 | mMonthView = new QWidget( mWidStack ); | 1011 | mMonthView = new QWidget( mWidStack ); |
1011 | mWeekView = new QWidget( mWidStack ); | 1012 | mWeekView = new QWidget( mWidStack ); |
1012 | #if QT_VERSION >= 0x030000 | 1013 | #if QT_VERSION >= 0x030000 |
1013 | mWidStack->addWidget(mMonthView ); | 1014 | mWidStack->addWidget(mMonthView ); |
1014 | mWidStack->addWidget(mWeekView ); | 1015 | mWidStack->addWidget(mWeekView ); |
@@ -1828,27 +1829,43 @@ void KOMonthView::processSelectionChange() | |||
1828 | emit incidenceSelected( 0 ); | 1829 | emit incidenceSelected( 0 ); |
1829 | clearSelection(); | 1830 | clearSelection(); |
1830 | } | 1831 | } |
1831 | } | 1832 | } |
1832 | 1833 | ||
1833 | void KOMonthView::clearSelection() | 1834 | 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 | } |
1849 | else { | 1866 | else { |
1850 | emit prevMonth(); | 1867 | emit prevMonth(); |
1851 | } | 1868 | } |
1852 | } | 1869 | } |
1853 | e->accept(); | 1870 | e->accept(); |
1854 | break; | 1871 | break; |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index c1ca3d4..88050fe 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -302,19 +302,20 @@ class KOMonthView: public KOEventView | |||
302 | QPtrVector<KOWeekButton> mWeekLabels; | 302 | QPtrVector<KOWeekButton> mWeekLabels; |
303 | QPtrVector<MonthViewCell> mCellsW; | 303 | QPtrVector<MonthViewCell> mCellsW; |
304 | QPtrVector<QLabel> mDayLabelsW; | 304 | QPtrVector<QLabel> mDayLabelsW; |
305 | QPtrVector<KOWeekButton> mWeekLabelsW; | 305 | QPtrVector<KOWeekButton> mWeekLabelsW; |
306 | 306 | ||
307 | bool mShortDayLabelsM; | 307 | bool mShortDayLabelsM; |
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 | |||
@@ -157,25 +157,31 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
157 | else { | 157 | else { |
158 | if ( p->mToolBarUp ) | 158 | if ( p->mToolBarUp ) |
159 | tbd = Right; | 159 | tbd = Right; |
160 | else | 160 | else |
161 | tbd = Left; | 161 | tbd = Left; |
162 | } | 162 | } |
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 | } |
176 | else { | 182 | else { |
177 | if ( p->mToolBarUpF ) | 183 | if ( p->mToolBarUpF ) |
178 | tbd = Right; | 184 | tbd = Right; |
179 | else | 185 | else |
180 | tbd = Left; | 186 | tbd = Left; |
181 | } | 187 | } |
@@ -184,33 +190,38 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
184 | QFontMetrics fm ( filterMenubar->font() ); | 190 | QFontMetrics fm ( filterMenubar->font() ); |
185 | 191 | ||
186 | filterPopupMenu = new QPopupMenu( this ); | 192 | filterPopupMenu = new QPopupMenu( this ); |
187 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 193 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
188 | QString addTest = "Ax"; | 194 | QString addTest = "Ax"; |
189 | #ifdef DESKTOP_VERSION | 195 | #ifdef DESKTOP_VERSION |
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 | } |
211 | else { | 222 | else { |
212 | if ( p->mToolBarUpV ) | 223 | if ( p->mToolBarUpV ) |
213 | tbd = Right; | 224 | tbd = Right; |
214 | else | 225 | else |
215 | tbd = Left; | 226 | tbd = Left; |
216 | } | 227 | } |
@@ -2401,12 +2412,25 @@ void MainWindow::weekAction() | |||
2401 | 2412 | ||
2402 | void MainWindow::hideEvent ( QHideEvent * ) | 2413 | void MainWindow::hideEvent ( QHideEvent * ) |
2403 | { | 2414 | { |
2404 | QString message; | 2415 | QString message; |
2405 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); | 2416 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); |
2406 | if ( nextA.isValid() ) { | 2417 | if ( nextA.isValid() ) { |
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 | |||
@@ -124,24 +124,25 @@ class MainWindow : public QMainWindow | |||
124 | bool mClosed; | 124 | bool mClosed; |
125 | void saveOnClose(); | 125 | void saveOnClose(); |
126 | bool mFlagKeyPressed; | 126 | bool mFlagKeyPressed; |
127 | bool mBlockAtStartup; | 127 | bool mBlockAtStartup; |
128 | QPEToolBar *iconToolBar; | 128 | QPEToolBar *iconToolBar; |
129 | QPEToolBar *viewToolBar; | 129 | QPEToolBar *viewToolBar; |
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; |
142 | CalendarLocal *mCalendar; | 143 | CalendarLocal *mCalendar; |
143 | CalendarView *mView; | 144 | CalendarView *mView; |
144 | QAction *mNewSubTodoAction; | 145 | QAction *mNewSubTodoAction; |
145 | QAction *mWeekAction; | 146 | QAction *mWeekAction; |
146 | QFont mWeekFont; | 147 | QFont mWeekFont; |
147 | QPixmap mWeekPixmap; | 148 | QPixmap mWeekPixmap; |