-rw-r--r-- | korganizer/searchdialog.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index d0865c3..efe8774 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -79,97 +79,99 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
79 | mAddItems->setFont( fo ); | 79 | mAddItems->setFont( fo ); |
80 | mSubItems->setFont( fo ); | 80 | mSubItems->setFont( fo ); |
81 | mRefineItems->setFont( fo ); | 81 | mRefineItems->setFont( fo ); |
82 | connect( mAddItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_add( bool ))); | 82 | connect( mAddItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_add( bool ))); |
83 | connect( mSubItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_sub( bool ))); | 83 | connect( mSubItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_sub( bool ))); |
84 | connect( mRefineItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_refine( bool ))); | 84 | connect( mRefineItems , SIGNAL( toggled ( bool ) ),this,SLOT(slot_refine( bool ))); |
85 | 85 | ||
86 | QPushButton *togButton = new QPushButton( "", topFrame ); | 86 | QPushButton *togButton = new QPushButton( "", topFrame ); |
87 | subLayout->addWidget(togButton); | 87 | subLayout->addWidget(togButton); |
88 | connect(togButton,SIGNAL(clicked()),SLOT(toggleCheckboxes())); | 88 | connect(togButton,SIGNAL(clicked()),SLOT(toggleCheckboxes())); |
89 | togButton->setPixmap(SmallIcon("1updownarrow")); | 89 | togButton->setPixmap(SmallIcon("1updownarrow")); |
90 | togButton->setMinimumWidth( togButton->sizeHint().height() ); | 90 | togButton->setMinimumWidth( togButton->sizeHint().height() ); |
91 | 91 | ||
92 | searchEdit->setText("*"); // Find all events by default | 92 | searchEdit->setText("*"); // Find all events by default |
93 | searchEdit->setFocus(); | 93 | searchEdit->setFocus(); |
94 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 94 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
95 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 95 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
96 | // Subjects to search | 96 | // Subjects to search |
97 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), | 97 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), |
98 | // topFrame); | 98 | // topFrame); |
99 | 99 | ||
100 | incidenceGroup = new QHBox( topFrame ); | 100 | incidenceGroup = new QHBox( topFrame ); |
101 | layout->addWidget(incidenceGroup); | 101 | layout->addWidget(incidenceGroup); |
102 | 102 | ||
103 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); | 103 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); |
104 | //mSearchEvent->setChecked(true); | 104 | //mSearchEvent->setChecked(true); |
105 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); | 105 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); |
106 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); | 106 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); |
107 | 107 | ||
108 | subjectGroup = new QHBox( topFrame ); | 108 | subjectGroup = new QHBox( topFrame ); |
109 | layout->addWidget(subjectGroup); | 109 | layout->addWidget(subjectGroup); |
110 | 110 | ||
111 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); | 111 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); |
112 | mSummaryCheck->setChecked(true); | 112 | mSummaryCheck->setChecked(true); |
113 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); | 113 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); |
114 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); | 114 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); |
115 | 115 | ||
116 | attendeeGroup = new QHBox( topFrame ); | 116 | attendeeGroup = new QHBox( topFrame ); |
117 | layout->addWidget(attendeeGroup ); | 117 | layout->addWidget(attendeeGroup ); |
118 | new QLabel( i18n("Attendee:"),attendeeGroup ); | 118 | new QLabel( i18n("Attendee:"),attendeeGroup ); |
119 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); | 119 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); |
120 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); | 120 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); |
121 | // Date range | 121 | // Date range |
122 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), | 122 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), |
123 | // topFrame); | 123 | // topFrame); |
124 | // layout->addWidget(rangeGroup); | 124 | // layout->addWidget(rangeGroup); |
125 | 125 | ||
126 | QWidget *rangeWidget = new QWidget(topFrame); | 126 | QWidget *rangeWidget = new QWidget(topFrame); |
127 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()-3); | 127 | int space = KDialog::spacingHint(); |
128 | if ( QApplication::desktop()->width() <= 240 ) space = 1; | ||
129 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,space); | ||
128 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); | 130 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); |
129 | mStartDate = new KDateEdit(rangeWidget); | 131 | mStartDate = new KDateEdit(rangeWidget); |
130 | rangeLayout->addWidget(mStartDate); | 132 | rangeLayout->addWidget(mStartDate); |
131 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); | 133 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); |
132 | mEndDate = new KDateEdit(rangeWidget); | 134 | mEndDate = new KDateEdit(rangeWidget); |
133 | mEndDate->setDate(QDate::currentDate().addDays(365)); | 135 | mEndDate->setDate(QDate::currentDate().addDays(365)); |
134 | rangeLayout->addWidget(mEndDate); | 136 | rangeLayout->addWidget(mEndDate); |
135 | QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); | 137 | QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); |
136 | rangeLayout->addWidget( (QWidget*)wt ); | 138 | rangeLayout->addWidget( (QWidget*)wt ); |
137 | layout->addWidget(rangeWidget); | 139 | layout->addWidget(rangeWidget); |
138 | // Results list view | 140 | // Results list view |
139 | listView = new KOListView(mCalendar,topFrame); | 141 | listView = new KOListView(mCalendar,topFrame); |
140 | layout->addWidget(listView); | 142 | layout->addWidget(listView); |
141 | listView->showCompletedTodos(); | 143 | listView->showCompletedTodos(); |
142 | //layout->setStretchFactor( listView, 333 ); | 144 | //layout->setStretchFactor( listView, 333 ); |
143 | //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) ); | 145 | //listView->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Expanding) ); |
144 | //listView->setMaximumHeight( 50 ); | 146 | //listView->setMaximumHeight( 50 ); |
145 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); | 147 | listView->readSettings(KOGlobals::config(),"SearchListView Layout"); |
146 | connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); | 148 | connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); |
147 | 149 | ||
148 | setCaption( i18n("KO/Pi Find: ")); | 150 | setCaption( i18n("KO/Pi Find: ")); |
149 | #ifdef DESKTOP_VERSION | 151 | #ifdef DESKTOP_VERSION |
150 | OkButton = new QPushButton( i18n("Close"), this ); | 152 | OkButton = new QPushButton( i18n("Close"), this ); |
151 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); | 153 | connect(OkButton,SIGNAL(clicked()),SLOT(hide())); |
152 | #endif | 154 | #endif |
153 | } | 155 | } |
154 | 156 | ||
155 | SearchDialog::~SearchDialog() | 157 | SearchDialog::~SearchDialog() |
156 | { | 158 | { |
157 | 159 | ||
158 | } | 160 | } |
159 | void SearchDialog::slot_add( bool b ) | 161 | void SearchDialog::slot_add( bool b ) |
160 | { | 162 | { |
161 | if ( b ) { | 163 | if ( b ) { |
162 | if ( mSubItems->isOn() ) mSubItems->toggle(); | 164 | if ( mSubItems->isOn() ) mSubItems->toggle(); |
163 | if ( mRefineItems->isOn() ) mRefineItems->toggle(); | 165 | if ( mRefineItems->isOn() ) mRefineItems->toggle(); |
164 | setCaption( i18n("Matching items will be added to list")); | 166 | setCaption( i18n("Matching items will be added to list")); |
165 | } else | 167 | } else |
166 | setCaption( i18n("List will be cleared before search")); | 168 | setCaption( i18n("List will be cleared before search")); |
167 | } | 169 | } |
168 | void SearchDialog::slot_sub( bool b) | 170 | void SearchDialog::slot_sub( bool b) |
169 | { | 171 | { |
170 | if ( b ) { | 172 | if ( b ) { |
171 | if ( mRefineItems->isOn() ) mRefineItems->toggle(); | 173 | if ( mRefineItems->isOn() ) mRefineItems->toggle(); |
172 | if ( mAddItems->isOn() ) mAddItems->toggle(); | 174 | if ( mAddItems->isOn() ) mAddItems->toggle(); |
173 | setCaption( i18n("Matching items will be removed from list")); | 175 | setCaption( i18n("Matching items will be removed from list")); |
174 | } else | 176 | } else |
175 | setCaption( i18n("List will be cleared before search")); | 177 | setCaption( i18n("List will be cleared before search")); |