-rw-r--r-- | korganizer/calendarview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 4 | ||||
-rw-r--r-- | korganizer/koprefs.h | 11 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 20 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 1 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 47 | ||||
-rw-r--r-- | korganizer/searchdialog.h | 1 |
7 files changed, 75 insertions, 15 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 1e83236..beb19d9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1839,7 +1839,8 @@ void CalendarView::readSettings() | |||
1839 | x = list[0].toInt(); | 1839 | x = list[0].toInt(); |
1840 | y = list[1].toInt(); | 1840 | y = list[1].toInt(); |
1841 | w = list[2].toInt(); | 1841 | w = list[2].toInt(); |
1842 | h = list[3].toInt(); | 1842 | h = list[3].toInt(); |
1843 | KApplication::testCoords( &x,&y,&w,&h ); | ||
1843 | topLevelWidget()->setGeometry(x,y,w,h); | 1844 | topLevelWidget()->setGeometry(x,y,w,h); |
1844 | 1845 | ||
1845 | } else { | 1846 | } else { |
@@ -1851,6 +1852,7 @@ void CalendarView::readSettings() | |||
1851 | y = list[1].toInt(); | 1852 | y = list[1].toInt(); |
1852 | w = list[2].toInt(); | 1853 | w = list[2].toInt(); |
1853 | h = list[3].toInt(); | 1854 | h = list[3].toInt(); |
1855 | KApplication::testCoords( &x,&y,&w,&h ); | ||
1854 | mEventEditor->setGeometry(x,y,w,h); | 1856 | mEventEditor->setGeometry(x,y,w,h); |
1855 | 1857 | ||
1856 | } | 1858 | } |
@@ -1860,6 +1862,7 @@ void CalendarView::readSettings() | |||
1860 | y = list[1].toInt(); | 1862 | y = list[1].toInt(); |
1861 | w = list[2].toInt(); | 1863 | w = list[2].toInt(); |
1862 | h = list[3].toInt(); | 1864 | h = list[3].toInt(); |
1865 | KApplication::testCoords( &x,&y,&w,&h ); | ||
1863 | mTodoEditor->setGeometry(x,y,w,h); | 1866 | mTodoEditor->setGeometry(x,y,w,h); |
1864 | 1867 | ||
1865 | } | 1868 | } |
@@ -1869,6 +1872,7 @@ void CalendarView::readSettings() | |||
1869 | y = list[1].toInt(); | 1872 | y = list[1].toInt(); |
1870 | w = list[2].toInt(); | 1873 | w = list[2].toInt(); |
1871 | h = list[3].toInt(); | 1874 | h = list[3].toInt(); |
1875 | KApplication::testCoords( &x,&y,&w,&h ); | ||
1872 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1876 | getEventViewerDialog()->setGeometry(x,y,w,h); |
1873 | } | 1877 | } |
1874 | #endif | 1878 | #endif |
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index a8652ea..c927b37 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -40,6 +40,7 @@ | |||
40 | 40 | ||
41 | #include "kconfig.h" | 41 | #include "kconfig.h" |
42 | #include "kodialogmanager.h" | 42 | #include "kodialogmanager.h" |
43 | #include <kapplication.h> | ||
43 | 44 | ||
44 | KODialogManager::KODialogManager( CalendarView *mainView ) : | 45 | KODialogManager::KODialogManager( CalendarView *mainView ) : |
45 | QObject(), mMainView( mainView ) | 46 | QObject(), mMainView( mainView ) |
@@ -204,6 +205,7 @@ void KODialogManager::showSearchDialog() | |||
204 | y = list[1].toInt(); | 205 | y = list[1].toInt(); |
205 | w = list[2].toInt(); | 206 | w = list[2].toInt(); |
206 | h = list[3].toInt(); | 207 | h = list[3].toInt(); |
208 | KApplication::testCoords( &x,&y,&w,&h ); | ||
207 | mSearchDialog->setGeometry(x,y,w,h); | 209 | mSearchDialog->setGeometry(x,y,w,h); |
208 | 210 | ||
209 | } | 211 | } |
@@ -217,7 +219,7 @@ void KODialogManager::showSearchDialog() | |||
217 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); | 219 | mSearchDialog->setMaximumSize( QApplication::desktop()->size()); |
218 | mSearchDialog->showMaximized(); | 220 | mSearchDialog->showMaximized(); |
219 | #endif | 221 | #endif |
220 | mSearchDialog->raise(); | 222 | mSearchDialog->raiseAndSelect(); |
221 | } | 223 | } |
222 | 224 | ||
223 | SearchDialog * KODialogManager::getSearchDialog() | 225 | SearchDialog * KODialogManager::getSearchDialog() |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 3a07348..cf8dae6 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -32,6 +32,15 @@ class QFont; | |||
32 | class QColor; | 32 | class QColor; |
33 | class QStringList; | 33 | class QStringList; |
34 | 34 | ||
35 | #define VIEW_WN_VIEW 1 | ||
36 | #define VIEW_NX_VIEW 2 | ||
37 | #define VIEW_J_VIEW 3 | ||
38 | #define VIEW_A_VIEW 4 | ||
39 | #define VIEW_ML_VIEW 5 | ||
40 | #define VIEW_M_VIEW 6 | ||
41 | #define VIEW_L_VIEW 7 | ||
42 | #define VIEW_T_VIEW 8 | ||
43 | |||
35 | class KOPrefs : public KPimPrefs | 44 | class KOPrefs : public KPimPrefs |
36 | { | 45 | { |
37 | public: | 46 | public: |
@@ -290,6 +299,8 @@ class KOPrefs : public KPimPrefs | |||
290 | bool mWTshowCreated; | 299 | bool mWTshowCreated; |
291 | bool mWTshowChanged; | 300 | bool mWTshowChanged; |
292 | 301 | ||
302 | int mCurrentDisplayedView; | ||
303 | |||
293 | private: | 304 | private: |
294 | QDict<QColor> mCategoryColors; | 305 | QDict<QColor> mCategoryColors; |
295 | QColor mDefaultCategoryColor; | 306 | QColor mDefaultCategoryColor; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index c442d0b..406e741 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -227,15 +227,7 @@ void KOViewManager::showNextView() | |||
227 | if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;} | 227 | if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;} |
228 | NEXT_X: | 228 | NEXT_X: |
229 | if ( KOPrefs::instance()->mShowIconNextDays ) { | 229 | if ( KOPrefs::instance()->mShowIconNextDays ) { |
230 | globalFlagBlockAgenda = 1; | 230 | showNextXView(); |
231 | if ( mCurrentAgendaView != 3 ) | ||
232 | mCurrentAgendaView = -1; | ||
233 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | ||
234 | globalFlagBlockAgenda = 2; | ||
235 | mMainView->dateNavigator()->selectDates( baseCycleDate , | ||
236 | KOPrefs::instance()->mNextXDays ); | ||
237 | mFlagShowNextxDays = true; | ||
238 | mCurrentAgendaView = 3 ; | ||
239 | goto ENTE ; | 231 | goto ENTE ; |
240 | } | 232 | } |
241 | JOURNAL: | 233 | JOURNAL: |
@@ -407,7 +399,7 @@ void KOViewManager::showWhatsNextView() | |||
407 | globalFlagBlockAgenda = 1; | 399 | globalFlagBlockAgenda = 1; |
408 | showView(mWhatsNextView, true ); | 400 | showView(mWhatsNextView, true ); |
409 | //mWhatsNextView->updateView(); | 401 | //mWhatsNextView->updateView(); |
410 | 402 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW; | |
411 | } | 403 | } |
412 | 404 | ||
413 | void KOViewManager::slotprintWNV() | 405 | void KOViewManager::slotprintWNV() |
@@ -453,6 +445,7 @@ void KOViewManager::showListView() | |||
453 | } | 445 | } |
454 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 446 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
455 | //mFlagShowNextxDays = temp; | 447 | //mFlagShowNextxDays = temp; |
448 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW; | ||
456 | } | 449 | } |
457 | 450 | ||
458 | void KOViewManager::showAgendaView( bool fullScreen ) | 451 | void KOViewManager::showAgendaView( bool fullScreen ) |
@@ -518,7 +511,7 @@ void KOViewManager::showAgendaView( bool fullScreen ) | |||
518 | } | 511 | } |
519 | 512 | ||
520 | showView( mAgendaView, full); | 513 | showView( mAgendaView, full); |
521 | 514 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW; | |
522 | } | 515 | } |
523 | 516 | ||
524 | void KOViewManager::showDayView() | 517 | void KOViewManager::showDayView() |
@@ -592,6 +585,7 @@ void KOViewManager::showNextXView() | |||
592 | KOPrefs::instance()->mNextXDays ); | 585 | KOPrefs::instance()->mNextXDays ); |
593 | mFlagShowNextxDays = true; | 586 | mFlagShowNextxDays = true; |
594 | mCurrentAgendaView = 3 ; | 587 | mCurrentAgendaView = 3 ; |
588 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW; | ||
595 | } | 589 | } |
596 | bool KOViewManager::showsNextDays() | 590 | bool KOViewManager::showsNextDays() |
597 | { | 591 | { |
@@ -676,6 +670,7 @@ void KOViewManager::showMonthViewWeek() | |||
676 | mMainView->dateNavigator()->selectWeek(); | 670 | mMainView->dateNavigator()->selectWeek(); |
677 | showView(mMonthView, full ); | 671 | showView(mMonthView, full ); |
678 | mMonthView->setKeyBFocus(); | 672 | mMonthView->setKeyBFocus(); |
673 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ; | ||
679 | } | 674 | } |
680 | 675 | ||
681 | void KOViewManager::showMonth( const QDate & date ) | 676 | void KOViewManager::showMonth( const QDate & date ) |
@@ -706,6 +701,7 @@ void KOViewManager::showMonthView() | |||
706 | 701 | ||
707 | showView(mMonthView, full ); | 702 | showView(mMonthView, full ); |
708 | mMonthView->setKeyBFocus(); | 703 | mMonthView->setKeyBFocus(); |
704 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ; | ||
709 | 705 | ||
710 | } | 706 | } |
711 | 707 | ||
@@ -761,6 +757,7 @@ void KOViewManager::showTodoView() | |||
761 | 757 | ||
762 | globalFlagBlockAgenda = 1; | 758 | globalFlagBlockAgenda = 1; |
763 | showView( mTodoView, true ); | 759 | showView( mTodoView, true ); |
760 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ; | ||
764 | 761 | ||
765 | } | 762 | } |
766 | 763 | ||
@@ -778,6 +775,7 @@ void KOViewManager::showJournalView() | |||
778 | 775 | ||
779 | showView(mJournalView); | 776 | showView(mJournalView); |
780 | mMainView->dateNavigator()->selectDates( 1 ); | 777 | mMainView->dateNavigator()->selectDates( 1 ); |
778 | KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ; | ||
781 | } | 779 | } |
782 | 780 | ||
783 | void KOViewManager::showTimeSpanView() | 781 | void KOViewManager::showTimeSpanView() |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d98915b..357154e 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -145,6 +145,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
145 | setCaption("KO/Pi"); | 145 | setCaption("KO/Pi"); |
146 | KOPrefs *p = KOPrefs::instance(); | 146 | KOPrefs *p = KOPrefs::instance(); |
147 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 147 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
148 | p->mCurrentDisplayedView = 0; | ||
148 | if ( p->mHourSize > 22 ) | 149 | if ( p->mHourSize > 22 ) |
149 | p->mHourSize = 22; | 150 | p->mHourSize = 22; |
150 | QMainWindow::ToolBarDock tbd; | 151 | QMainWindow::ToolBarDock tbd; |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 341a839..db60383 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -77,7 +77,7 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
77 | layout->addWidget(incidenceGroup); | 77 | layout->addWidget(incidenceGroup); |
78 | 78 | ||
79 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); | 79 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); |
80 | mSearchEvent->setChecked(true); | 80 | //mSearchEvent->setChecked(true); |
81 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); | 81 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); |
82 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); | 82 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); |
83 | 83 | ||
@@ -129,6 +129,49 @@ SearchDialog::~SearchDialog() | |||
129 | { | 129 | { |
130 | 130 | ||
131 | } | 131 | } |
132 | void SearchDialog::raiseAndSelect() | ||
133 | { | ||
134 | |||
135 | static int currentState = 0; | ||
136 | |||
137 | if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) | ||
138 | currentState = 0; | ||
139 | int newState = 0; | ||
140 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | ||
141 | newState = VIEW_J_VIEW; | ||
142 | } | ||
143 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | ||
144 | newState = VIEW_T_VIEW; | ||
145 | } | ||
146 | else { | ||
147 | newState = VIEW_A_VIEW; | ||
148 | } | ||
149 | if ( newState != currentState ) { | ||
150 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | ||
151 | if ( ! mSearchJournal->isChecked() ) { | ||
152 | mSearchJournal->setChecked( true ); | ||
153 | mSearchTodo->setChecked( false ); | ||
154 | mSearchEvent->setChecked( false ); | ||
155 | } | ||
156 | } | ||
157 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | ||
158 | if ( ! mSearchTodo->isChecked() ) { | ||
159 | mSearchTodo->setChecked( true ); | ||
160 | mSearchJournal->setChecked( false ); | ||
161 | mSearchEvent->setChecked( false ); | ||
162 | } | ||
163 | } | ||
164 | else { | ||
165 | if ( ! mSearchEvent->isChecked() ) { | ||
166 | mSearchEvent->setChecked( true ); | ||
167 | mSearchJournal->setChecked( false ); | ||
168 | mSearchTodo->setChecked( false ); | ||
169 | } | ||
170 | } | ||
171 | } | ||
172 | currentState = newState; | ||
173 | raise(); | ||
174 | } | ||
132 | void SearchDialog::setFocusToList() | 175 | void SearchDialog::setFocusToList() |
133 | { | 176 | { |
134 | listView->resetFocus(); | 177 | listView->resetFocus(); |
@@ -201,7 +244,7 @@ void SearchDialog::updateConfig() | |||
201 | } | 244 | } |
202 | void SearchDialog::updateView() | 245 | void SearchDialog::updateView() |
203 | { | 246 | { |
204 | 247 | //qDebug("SearchDialog::updateView() %d ", isVisible()); | |
205 | QRegExp re; | 248 | QRegExp re; |
206 | re.setWildcard(true); // most people understand these better. | 249 | re.setWildcard(true); // most people understand these better. |
207 | re.setCaseSensitive(false); | 250 | re.setCaseSensitive(false); |
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index b730ed5..4559d20 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h | |||
@@ -49,6 +49,7 @@ class SearchDialog : public QVBox | |||
49 | virtual ~SearchDialog(); | 49 | virtual ~SearchDialog(); |
50 | KOListView *listview(){ return listView;} | 50 | KOListView *listview(){ return listView;} |
51 | void updateView(); | 51 | void updateView(); |
52 | void raiseAndSelect(); | ||
52 | 53 | ||
53 | public slots: | 54 | public slots: |
54 | void changeEventDisplay(Event *, int) { updateView(); } | 55 | void changeEventDisplay(Event *, int) { updateView(); } |