-rw-r--r-- | korganizer/searchdialog.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 74d48b9..5bd7c6f 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -1,139 +1,138 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 1998 Preston Brown | 3 | Copyright (c) 1998 Preston Brown |
4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | 31 | ||
32 | #include <klocale.h> | 32 | #include <klocale.h> |
33 | #include <kmessagebox.h> | 33 | #include <kmessagebox.h> |
34 | 34 | ||
35 | #include <libkdepim/kdateedit.h> | 35 | #include <libkdepim/kdateedit.h> |
36 | 36 | ||
37 | #include "koglobals.h" | 37 | #include "koglobals.h" |
38 | #include "koprefs.h" | 38 | #include "koprefs.h" |
39 | 39 | ||
40 | #include "calendarview.h" | 40 | #include "calendarview.h" |
41 | #include "koviewmanager.h" | 41 | #include "koviewmanager.h" |
42 | #include "searchdialog.h" | 42 | #include "searchdialog.h" |
43 | #include "searchdialog.moc" | ||
44 | 43 | ||
45 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | 44 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) |
46 | : KDialogBase(Plain,i18n("KO/Pi Find "),User1|Close,User1,parent,0,false,false, | 45 | : KDialogBase(Plain,i18n("KO/Pi Find "),User1|Close,User1,parent,0,false,false, |
47 | i18n("&Find")) | 46 | i18n("&Find")) |
48 | { | 47 | { |
49 | mCalendar = calendar; | 48 | mCalendar = calendar; |
50 | QFrame *topFrame = plainPage(); | 49 | QFrame *topFrame = plainPage(); |
51 | QVBoxLayout *layout = new QVBoxLayout(topFrame,0,spacingHint()); | 50 | QVBoxLayout *layout = new QVBoxLayout(topFrame,0,spacingHint()); |
52 | 51 | ||
53 | // Search expression | 52 | // Search expression |
54 | QHBoxLayout *subLayout = new QHBoxLayout(); | 53 | QHBoxLayout *subLayout = new QHBoxLayout(); |
55 | layout->addLayout(subLayout); | 54 | layout->addLayout(subLayout); |
56 | 55 | ||
57 | searchLabel = new QLabel(topFrame); | 56 | searchLabel = new QLabel(topFrame); |
58 | searchLabel->setText(i18n("Search for:")); | 57 | searchLabel->setText(i18n("Search for:")); |
59 | subLayout->addWidget(searchLabel); | 58 | subLayout->addWidget(searchLabel); |
60 | 59 | ||
61 | searchEdit = new QLineEdit(topFrame); | 60 | searchEdit = new QLineEdit(topFrame); |
62 | subLayout->addWidget(searchEdit); | 61 | subLayout->addWidget(searchEdit); |
63 | searchEdit->setText("*"); // Find all events by default | 62 | searchEdit->setText("*"); // Find all events by default |
64 | searchEdit->setFocus(); | 63 | searchEdit->setFocus(); |
65 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 64 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
66 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 65 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
67 | // Subjects to search | 66 | // Subjects to search |
68 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), | 67 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), |
69 | // topFrame); | 68 | // topFrame); |
70 | 69 | ||
71 | 70 | ||
72 | 71 | ||
73 | QHBox *incidenceGroup = new QHBox( topFrame ); | 72 | QHBox *incidenceGroup = new QHBox( topFrame ); |
74 | layout->addWidget(incidenceGroup); | 73 | layout->addWidget(incidenceGroup); |
75 | 74 | ||
76 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); | 75 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); |
77 | mSearchEvent->setChecked(true); | 76 | mSearchEvent->setChecked(true); |
78 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); | 77 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); |
79 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); | 78 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); |
80 | 79 | ||
81 | QHBox *subjectGroup = new QHBox( topFrame ); | 80 | QHBox *subjectGroup = new QHBox( topFrame ); |
82 | layout->addWidget(subjectGroup); | 81 | layout->addWidget(subjectGroup); |
83 | 82 | ||
84 | mSummaryCheck = new QCheckBox(i18n("Summaries"),subjectGroup); | 83 | mSummaryCheck = new QCheckBox(i18n("Summaries"),subjectGroup); |
85 | mSummaryCheck->setChecked(true); | 84 | mSummaryCheck->setChecked(true); |
86 | mDescriptionCheck = new QCheckBox(i18n("Descriptions"),subjectGroup); | 85 | mDescriptionCheck = new QCheckBox(i18n("Descriptions"),subjectGroup); |
87 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); | 86 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); |
88 | 87 | ||
89 | QHBox *attendeeGroup = new QHBox( topFrame ); | 88 | QHBox *attendeeGroup = new QHBox( topFrame ); |
90 | layout->addWidget(attendeeGroup ); | 89 | layout->addWidget(attendeeGroup ); |
91 | new QLabel( i18n("Attendee:"),attendeeGroup ); | 90 | new QLabel( i18n("Attendee:"),attendeeGroup ); |
92 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); | 91 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); |
93 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); | 92 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); |
94 | // Date range | 93 | // Date range |
95 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), | 94 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), |
96 | // topFrame); | 95 | // topFrame); |
97 | // layout->addWidget(rangeGroup); | 96 | // layout->addWidget(rangeGroup); |
98 | 97 | ||
99 | QWidget *rangeWidget = new QWidget(topFrame); | 98 | QWidget *rangeWidget = new QWidget(topFrame); |
100 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,spacingHint()); | 99 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,spacingHint()); |
101 | 100 | ||
102 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); | 101 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); |
103 | mStartDate = new KDateEdit(rangeWidget); | 102 | mStartDate = new KDateEdit(rangeWidget); |
104 | rangeLayout->addWidget(mStartDate); | 103 | rangeLayout->addWidget(mStartDate); |
105 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); | 104 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); |
106 | mEndDate = new KDateEdit(rangeWidget); | 105 | mEndDate = new KDateEdit(rangeWidget); |
107 | mEndDate->setDate(QDate::currentDate().addDays(365)); | 106 | mEndDate->setDate(QDate::currentDate().addDays(365)); |
108 | rangeLayout->addWidget(mEndDate); | 107 | rangeLayout->addWidget(mEndDate); |
109 | 108 | ||
110 | // mInclusiveCheck = new QCheckBox(i18n("Events have to be completely included"), topFrame); | 109 | // mInclusiveCheck = new QCheckBox(i18n("Events have to be completely included"), topFrame); |
111 | //mInclusiveCheck->setChecked(false); | 110 | //mInclusiveCheck->setChecked(false); |
112 | layout->addWidget(rangeWidget); | 111 | layout->addWidget(rangeWidget); |
113 | //layout->addWidget(mInclusiveCheck); | 112 | //layout->addWidget(mInclusiveCheck); |
114 | // Subjects to search | 113 | // Subjects to search |
115 | 114 | ||
116 | 115 | ||
117 | // Results list view | 116 | // Results list view |
118 | listView = new KOListView(mCalendar,topFrame); | 117 | listView = new KOListView(mCalendar,topFrame); |
119 | //listView->showDates(); | 118 | //listView->showDates(); |
120 | 119 | ||
121 | 120 | ||
122 | layout->addWidget(listView); | 121 | layout->addWidget(listView); |
123 | 122 | ||
124 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 123 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
125 | // KOGlobals::fitDialogToScreen( this, true ); | 124 | // KOGlobals::fitDialogToScreen( this, true ); |
126 | // } | 125 | // } |
127 | 126 | ||
128 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); | 127 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); |
129 | connect(this,SIGNAL(user1Clicked()),SLOT(doSearch())); | 128 | connect(this,SIGNAL(user1Clicked()),SLOT(doSearch())); |
130 | QPushButton *CloseButton = findButton( Close ); | 129 | QPushButton *CloseButton = findButton( Close ); |
131 | //connect(CloseButton,SIGNAL(clicked()),listView, SLOT(clear())); | 130 | //connect(CloseButton,SIGNAL(clicked()),listView, SLOT(clear())); |
132 | 131 | ||
133 | #ifndef DESKTOP_VERSION | 132 | #ifndef DESKTOP_VERSION |
134 | setCaption(i18n("Click OK to search ->")); | 133 | setCaption(i18n("Click OK to search ->")); |
135 | hideButtons(); | 134 | hideButtons(); |
136 | #endif | 135 | #endif |
137 | } | 136 | } |
138 | 137 | ||
139 | SearchDialog::~SearchDialog() | 138 | SearchDialog::~SearchDialog() |