author | zautrix <zautrix> | 2005-02-25 11:29:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-25 11:29:28 (UTC) |
commit | ff810f8f74f6928e664bf52f8e8d128edb8ac5ad (patch) (unidiff) | |
tree | d5473801c69b42d90879104fc4d05a5ad9b69e87 /korganizer | |
parent | ff8a2f593fae5ffe82f889ab70d32bf02a45f4fb (diff) | |
download | kdepimpi-ff810f8f74f6928e664bf52f8e8d128edb8ac5ad.zip kdepimpi-ff810f8f74f6928e664bf52f8e8d128edb8ac5ad.tar.gz kdepimpi-ff810f8f74f6928e664bf52f8e8d128edb8ac5ad.tar.bz2 |
many small fixes
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 6 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 2 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 9 | ||||
-rw-r--r-- | korganizer/searchdialog.h | 4 |
4 files changed, 18 insertions, 3 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index e2c8e6e..f606124 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -249,38 +249,44 @@ void KOEventViewerDialog::showIncidence() | |||
249 | } | 249 | } |
250 | } | 250 | } |
251 | void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) | 251 | void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) |
252 | { | 252 | { |
253 | switch ( e->key() ) { | 253 | switch ( e->key() ) { |
254 | 254 | ||
255 | case Qt::Key_A : | 255 | case Qt::Key_A : |
256 | case Qt::Key_L : | 256 | case Qt::Key_L : |
257 | showIncidence(); | 257 | showIncidence(); |
258 | break; | 258 | break; |
259 | case Qt::Key_E : | 259 | case Qt::Key_E : |
260 | case Qt::Key_R : | 260 | case Qt::Key_R : |
261 | editIncidence(); | 261 | editIncidence(); |
262 | break; | 262 | break; |
263 | case Qt::Key_C: | 263 | case Qt::Key_C: |
264 | case Qt::Key_Escape: | 264 | case Qt::Key_Escape: |
265 | sendSignalViewerClosed = true; | ||
265 | close(); | 266 | close(); |
266 | break; | 267 | break; |
267 | case Qt::Key_I: | 268 | case Qt::Key_I: |
269 | #ifndef DESKTOP_VERSION | ||
270 | sendSignalViewerClosed = true; | ||
271 | close(); | ||
272 | #else | ||
268 | sendSignalViewerClosed = true; | 273 | sendSignalViewerClosed = true; |
269 | slotViewerClosed(); | 274 | slotViewerClosed(); |
270 | //accept(); | 275 | //accept(); |
276 | #endif | ||
271 | break; | 277 | break; |
272 | default: | 278 | default: |
273 | KDialogBase::keyPressEvent ( e ); | 279 | KDialogBase::keyPressEvent ( e ); |
274 | break; | 280 | break; |
275 | } | 281 | } |
276 | 282 | ||
277 | } | 283 | } |
278 | void KOEventViewerDialog::hideEvent ( QHideEvent * e ) | 284 | void KOEventViewerDialog::hideEvent ( QHideEvent * e ) |
279 | { | 285 | { |
280 | KDialogBase::hideEvent ( e ); | 286 | KDialogBase::hideEvent ( e ); |
281 | QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); | 287 | QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); |
282 | } | 288 | } |
283 | 289 | ||
284 | void KOEventViewerDialog::slotViewerClosed() | 290 | void KOEventViewerDialog::slotViewerClosed() |
285 | { | 291 | { |
286 | if ( sendSignalViewerClosed ) { | 292 | if ( sendSignalViewerClosed ) { |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 6acee75..710a9f9 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -1070,34 +1070,34 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1070 | ensureItemVisible ( cn ); | 1070 | ensureItemVisible ( cn ); |
1071 | } else | 1071 | } else |
1072 | QListView::keyPressEvent ( e ) ; | 1072 | QListView::keyPressEvent ( e ) ; |
1073 | e->accept(); | 1073 | e->accept(); |
1074 | break; | 1074 | break; |
1075 | case Qt::Key_I: { | 1075 | case Qt::Key_I: { |
1076 | QListViewItem* cn; | 1076 | QListViewItem* cn; |
1077 | cn = currentItem(); | 1077 | cn = currentItem(); |
1078 | if ( cn ) { | 1078 | if ( cn ) { |
1079 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1079 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1080 | if ( ci ){ | 1080 | if ( ci ){ |
1081 | //emit showIncidence( ci->data()); | 1081 | //emit showIncidence( ci->data()); |
1082 | cn = cn->nextSibling(); | 1082 | cn = cn->nextSibling(); |
1083 | if ( cn ) { | 1083 | if ( cn ) { |
1084 | setCurrentItem ( cn ); | 1084 | setCurrentItem ( cn ); |
1085 | ensureItemVisible ( cn ); | 1085 | ensureItemVisible ( cn ); |
1086 | emit showIncidence( ci->data()); | ||
1087 | } | 1086 | } |
1087 | emit showIncidence( ci->data()); | ||
1088 | } | 1088 | } |
1089 | } | 1089 | } |
1090 | e->accept(); | 1090 | e->accept(); |
1091 | } | 1091 | } |
1092 | break; | 1092 | break; |
1093 | case Qt::Key_Return: | 1093 | case Qt::Key_Return: |
1094 | case Qt::Key_Enter: | 1094 | case Qt::Key_Enter: |
1095 | { | 1095 | { |
1096 | QListViewItem* cn; | 1096 | QListViewItem* cn; |
1097 | cn = currentItem(); | 1097 | cn = currentItem(); |
1098 | if ( cn ) { | 1098 | if ( cn ) { |
1099 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1099 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1100 | if ( ci ){ | 1100 | if ( ci ){ |
1101 | if ( e->state() == ShiftButton ) | 1101 | if ( e->state() == ShiftButton ) |
1102 | ci->setSelected( false ); | 1102 | ci->setSelected( false ); |
1103 | else | 1103 | else |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index cef59a2..678e1bd 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -13,64 +13,66 @@ | |||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qgroupbox.h> | 27 | #include <qgroupbox.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlistview.h> | ||
29 | #include <qwhatsthis.h> | 30 | #include <qwhatsthis.h> |
30 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
31 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
32 | 33 | ||
33 | #include <klocale.h> | 34 | #include <klocale.h> |
34 | #include <kmessagebox.h> | 35 | #include <kmessagebox.h> |
35 | 36 | ||
36 | #include <libkdepim/kdateedit.h> | 37 | #include <libkdepim/kdateedit.h> |
37 | 38 | ||
38 | #include "koglobals.h" | 39 | #include "koglobals.h" |
39 | #include "koprefs.h" | 40 | #include "koprefs.h" |
41 | #include "klineedit.h" | ||
40 | 42 | ||
41 | #include "calendarview.h" | 43 | #include "calendarview.h" |
42 | #include "koviewmanager.h" | 44 | #include "koviewmanager.h" |
43 | #include "searchdialog.h" | 45 | #include "searchdialog.h" |
44 | 46 | ||
45 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | 47 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) |
46 | : QVBox( 0 ) | 48 | : QVBox( 0 ) |
47 | 49 | ||
48 | { | 50 | { |
49 | mCalendar = calendar; | 51 | mCalendar = calendar; |
50 | QFrame *topFrame = new QFrame( this ) ;//plainPage(); | 52 | QFrame *topFrame = new QFrame( this ) ;//plainPage(); |
51 | QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); | 53 | QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); |
52 | 54 | ||
53 | // Search expression | 55 | // Search expression |
54 | QHBoxLayout *subLayout = new QHBoxLayout(); | 56 | QHBoxLayout *subLayout = new QHBoxLayout(); |
55 | layout->addLayout(subLayout); | 57 | layout->addLayout(subLayout); |
56 | searchLabel = new QLabel(topFrame); | 58 | searchLabel = new QLabel(topFrame); |
57 | searchLabel->setText(i18n("Search for:")); | 59 | searchLabel->setText(i18n("Search for:")); |
58 | subLayout->addWidget(searchLabel); | 60 | subLayout->addWidget(searchLabel); |
59 | 61 | ||
60 | searchEdit = new QLineEdit(topFrame); | 62 | searchEdit = new KLineEdit(topFrame); |
61 | subLayout->addWidget(searchEdit); | 63 | subLayout->addWidget(searchEdit); |
62 | QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); | 64 | QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); |
63 | //OkButton->setDefault( true ); | 65 | //OkButton->setDefault( true ); |
64 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); | 66 | connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); |
65 | subLayout->addWidget(OkButton); | 67 | subLayout->addWidget(OkButton); |
66 | searchEdit->setText("*"); // Find all events by default | 68 | searchEdit->setText("*"); // Find all events by default |
67 | searchEdit->setFocus(); | 69 | searchEdit->setFocus(); |
68 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 70 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
69 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 71 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
70 | // Subjects to search | 72 | // Subjects to search |
71 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), | 73 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), |
72 | // topFrame); | 74 | // topFrame); |
73 | 75 | ||
74 | QHBox *incidenceGroup = new QHBox( topFrame ); | 76 | QHBox *incidenceGroup = new QHBox( topFrame ); |
75 | layout->addWidget(incidenceGroup); | 77 | layout->addWidget(incidenceGroup); |
76 | 78 | ||
@@ -101,44 +103,49 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
101 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); | 103 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); |
102 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); | 104 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); |
103 | mStartDate = new KDateEdit(rangeWidget); | 105 | mStartDate = new KDateEdit(rangeWidget); |
104 | rangeLayout->addWidget(mStartDate); | 106 | rangeLayout->addWidget(mStartDate); |
105 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); | 107 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); |
106 | mEndDate = new KDateEdit(rangeWidget); | 108 | mEndDate = new KDateEdit(rangeWidget); |
107 | mEndDate->setDate(QDate::currentDate().addDays(365)); | 109 | mEndDate->setDate(QDate::currentDate().addDays(365)); |
108 | rangeLayout->addWidget(mEndDate); | 110 | rangeLayout->addWidget(mEndDate); |
109 | QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); | 111 | QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); |
110 | rangeLayout->addWidget( (QWidget*)wt ); | 112 | rangeLayout->addWidget( (QWidget*)wt ); |
111 | layout->addWidget(rangeWidget); | 113 | layout->addWidget(rangeWidget); |
112 | // Results list view | 114 | // Results list view |
113 | listView = new KOListView(mCalendar,topFrame); | 115 | listView = new KOListView(mCalendar,topFrame); |
114 | layout->addWidget(listView); | 116 | layout->addWidget(listView); |
115 | 117 | ||
116 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); | 118 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); |
119 | connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); | ||
117 | 120 | ||
118 | setCaption( i18n("KO/Pi Find: ")); | 121 | setCaption( i18n("KO/Pi Find: ")); |
119 | #ifdef DESKTOP_VERSION | 122 | #ifdef DESKTOP_VERSION |
120 | OkButton = new QPushButton( i18n("Close"), this ); | 123 | OkButton = new QPushButton( i18n("Close"), this ); |
121 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); | 124 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); |
122 | #endif | 125 | #endif |
123 | } | 126 | } |
124 | 127 | ||
125 | SearchDialog::~SearchDialog() | 128 | SearchDialog::~SearchDialog() |
126 | { | 129 | { |
127 | 130 | ||
128 | } | 131 | } |
132 | void SearchDialog::setFocusToList() | ||
133 | { | ||
134 | listView->resetFocus(); | ||
135 | } | ||
129 | void SearchDialog::accept() | 136 | void SearchDialog::accept() |
130 | { | 137 | { |
131 | doSearch(); | 138 | doSearch(); |
132 | } | 139 | } |
133 | void SearchDialog::updateList() | 140 | void SearchDialog::updateList() |
134 | { | 141 | { |
135 | //listView->updateList(); | 142 | //listView->updateList(); |
136 | if ( isVisible() ) { | 143 | if ( isVisible() ) { |
137 | updateView(); | 144 | updateView(); |
138 | //qDebug("SearchDialog::updated "); | 145 | //qDebug("SearchDialog::updated "); |
139 | } | 146 | } |
140 | else { | 147 | else { |
141 | listView->clear(); | 148 | listView->clear(); |
142 | //qDebug("SearchDialog::cleared "); | 149 | //qDebug("SearchDialog::cleared "); |
143 | 150 | ||
144 | } | 151 | } |
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index f4aad9e..b730ed5 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h | |||
@@ -23,70 +23,72 @@ | |||
23 | */ | 23 | */ |
24 | #ifndef SEARCHDIALOG_H | 24 | #ifndef SEARCHDIALOG_H |
25 | #define SEARCHDIALOG_H | 25 | #define SEARCHDIALOG_H |
26 | 26 | ||
27 | #include <qregexp.h> | 27 | #include <qregexp.h> |
28 | 28 | ||
29 | #include <kdialogbase.h> | 29 | #include <kdialogbase.h> |
30 | #include <qvbox.h> | 30 | #include <qvbox.h> |
31 | 31 | ||
32 | #include <libkcal/calendar.h> | 32 | #include <libkcal/calendar.h> |
33 | 33 | ||
34 | #include "kolistview.h" | 34 | #include "kolistview.h" |
35 | 35 | ||
36 | class KDateEdit; | 36 | class KDateEdit; |
37 | class QCheckBox; | 37 | class QCheckBox; |
38 | class QLineEdit; | 38 | class QLineEdit; |
39 | class KLineEdit; | ||
39 | class QLabel; | 40 | class QLabel; |
40 | class CalendarView; | 41 | class CalendarView; |
41 | 42 | ||
42 | using namespace KCal; | 43 | using namespace KCal; |
43 | class SearchDialog : public QVBox | 44 | class SearchDialog : public QVBox |
44 | { | 45 | { |
45 | Q_OBJECT | 46 | Q_OBJECT |
46 | public: | 47 | public: |
47 | SearchDialog(Calendar *calendar,CalendarView *parent=0); | 48 | SearchDialog(Calendar *calendar,CalendarView *parent=0); |
48 | virtual ~SearchDialog(); | 49 | virtual ~SearchDialog(); |
49 | KOListView *listview(){ return listView;} | 50 | KOListView *listview(){ return listView;} |
50 | void updateView(); | 51 | void updateView(); |
51 | 52 | ||
52 | public slots: | 53 | public slots: |
53 | void changeEventDisplay(Event *, int) { updateView(); } | 54 | void changeEventDisplay(Event *, int) { updateView(); } |
54 | void updateConfig(); | 55 | void updateConfig(); |
55 | void updateList(); | 56 | void updateList(); |
56 | protected slots: | 57 | protected slots: |
58 | void setFocusToList(); | ||
57 | void accept(); | 59 | void accept(); |
58 | void doSearch(); | 60 | void doSearch(); |
59 | void searchTextChanged( const QString &_text ); | 61 | void searchTextChanged( const QString &_text ); |
60 | 62 | ||
61 | signals: | 63 | signals: |
62 | void showEventSignal(Event *); | 64 | void showEventSignal(Event *); |
63 | void editEventSignal(Event *); | 65 | void editEventSignal(Event *); |
64 | void deleteEventSignal(Event *); | 66 | void deleteEventSignal(Event *); |
65 | 67 | ||
66 | private: | 68 | private: |
67 | void search(const QRegExp &); | 69 | void search(const QRegExp &); |
68 | 70 | ||
69 | Calendar *mCalendar; | 71 | Calendar *mCalendar; |
70 | 72 | ||
71 | QPtrList<Event> mMatchedEvents; | 73 | QPtrList<Event> mMatchedEvents; |
72 | QPtrList<Todo> mMatchedTodos; | 74 | QPtrList<Todo> mMatchedTodos; |
73 | QPtrList<Journal> mMatchedJournals; | 75 | QPtrList<Journal> mMatchedJournals; |
74 | 76 | ||
75 | QLabel *searchLabel; | 77 | QLabel *searchLabel; |
76 | QLineEdit *searchEdit; | 78 | KLineEdit *searchEdit; |
77 | KOListView *listView; | 79 | KOListView *listView; |
78 | 80 | ||
79 | KDateEdit *mStartDate; | 81 | KDateEdit *mStartDate; |
80 | KDateEdit *mEndDate; | 82 | KDateEdit *mEndDate; |
81 | QCheckBox *mSummaryCheck; | 83 | QCheckBox *mSummaryCheck; |
82 | QCheckBox *mDescriptionCheck; | 84 | QCheckBox *mDescriptionCheck; |
83 | QCheckBox *mCategoryCheck; | 85 | QCheckBox *mCategoryCheck; |
84 | QCheckBox *mSearchEvent; | 86 | QCheckBox *mSearchEvent; |
85 | QCheckBox *mSearchTodo; | 87 | QCheckBox *mSearchTodo; |
86 | QCheckBox *mSearchJournal; | 88 | QCheckBox *mSearchJournal; |
87 | QCheckBox *mSearchAName; | 89 | QCheckBox *mSearchAName; |
88 | QCheckBox *mSearchAEmail; | 90 | QCheckBox *mSearchAEmail; |
89 | void keyPressEvent ( QKeyEvent *e) ; | 91 | void keyPressEvent ( QKeyEvent *e) ; |
90 | }; | 92 | }; |
91 | 93 | ||
92 | #endif | 94 | #endif |