summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-26 20:29:59 (UTC)
committer zautrix <zautrix>2005-03-26 20:29:59 (UTC)
commitc9c3f9e65a72a3c79d7f67eba68fca4537004808 (patch) (unidiff)
tree395970dbf2b5aad3cdafe195e7a9958f5cc8aa15 /korganizer
parent36dd498ad2f5a2cf43fc08c621669fe42198e5eb (diff)
downloadkdepimpi-c9c3f9e65a72a3c79d7f67eba68fca4537004808.zip
kdepimpi-c9c3f9e65a72a3c79d7f67eba68fca4537004808.tar.gz
kdepimpi-c9c3f9e65a72a3c79d7f67eba68fca4537004808.tar.bz2
better timer
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp1
-rw-r--r--korganizer/searchdialog.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 92fcd1c..b14ca43 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -140,96 +140,97 @@ void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
140 categoriesLayout->addWidget(mCategoriesLabel,1); 140 categoriesLayout->addWidget(mCategoriesLabel,1);
141} 141}
142 142
143void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 143void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
144{ 144{
145 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 145 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
146 146
147 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 147 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
148 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 148 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
149 secrecyLayout->addWidget(mCancelBox); 149 secrecyLayout->addWidget(mCancelBox);
150 secrecyLayout->addWidget(secrecyLabel); 150 secrecyLayout->addWidget(secrecyLabel);
151 151
152 mSecrecyCombo = new QComboBox(parent); 152 mSecrecyCombo = new QComboBox(parent);
153 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 153 mSecrecyCombo->insertStringList(Incidence::secrecyList());
154 secrecyLayout->addWidget(mSecrecyCombo); 154 secrecyLayout->addWidget(mSecrecyCombo);
155} 155}
156 156
157void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) 157void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout)
158{ 158{
159 mDescriptionEdit = new KTextEdit(parent); 159 mDescriptionEdit = new KTextEdit(parent);
160 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); 160 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
161 mDescriptionEdit->append(""); 161 mDescriptionEdit->append("");
162 mDescriptionEdit->setReadOnly(false); 162 mDescriptionEdit->setReadOnly(false);
163 mDescriptionEdit->setOverwriteMode(false); 163 mDescriptionEdit->setOverwriteMode(false);
164 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); 164 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
165 topLayout->addWidget(mDescriptionEdit); 165 topLayout->addWidget(mDescriptionEdit);
166#ifndef DESKTOP_VERSION 166#ifndef DESKTOP_VERSION
167 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); 167 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold );
168#endif 168#endif
169 169
170} 170}
171 171
172void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) 172void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
173{ 173{
174 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); 174 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout);
175 175
176 //mAlarmBell = new QLabel(parent); 176 //mAlarmBell = new QLabel(parent);
177 //mAlarmBell->setPixmap(SmallIcon("bell")); 177 //mAlarmBell->setPixmap(SmallIcon("bell"));
178 //alarmLayout->addWidget(mAlarmBell); 178 //alarmLayout->addWidget(mAlarmBell);
179 if ( QApplication::desktop()->width() < 320 ) 179 if ( QApplication::desktop()->width() < 320 )
180 mAlarmButton = new QCheckBox(i18n("Rem."),parent); 180 mAlarmButton = new QCheckBox(i18n("Rem."),parent);
181 else 181 else
182 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); 182 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
183 183
184 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); 184 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
185 alarmLayout->addWidget(mAlarmButton); 185 alarmLayout->addWidget(mAlarmButton);
186 186
187 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; 187 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
188 mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus );
188 alarmLayout->addWidget(mAlarmTimeEdit); 189 alarmLayout->addWidget(mAlarmTimeEdit);
189 mAlarmIncrCombo = new QComboBox(false, parent); 190 mAlarmIncrCombo = new QComboBox(false, parent);
190 if ( QApplication::desktop()->width() < 320 ) { 191 if ( QApplication::desktop()->width() < 320 ) {
191 mAlarmIncrCombo->insertItem(i18n("min")); 192 mAlarmIncrCombo->insertItem(i18n("min"));
192 mAlarmIncrCombo->insertItem(i18n("hou")); 193 mAlarmIncrCombo->insertItem(i18n("hou"));
193 mAlarmIncrCombo->insertItem(i18n("day")); 194 mAlarmIncrCombo->insertItem(i18n("day"));
194 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); 195 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() );
195 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); 196 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() );
196 } else { 197 } else {
197 mAlarmIncrCombo->insertItem(i18n("minute(s)")); 198 mAlarmIncrCombo->insertItem(i18n("minute(s)"));
198 mAlarmIncrCombo->insertItem(i18n("hour(s)")); 199 mAlarmIncrCombo->insertItem(i18n("hour(s)"));
199 mAlarmIncrCombo->insertItem(i18n("day(s)")); 200 mAlarmIncrCombo->insertItem(i18n("day(s)"));
200 } 201 }
201 202
202 // mAlarmIncrCombo->setMinimumHeight(20); 203 // mAlarmIncrCombo->setMinimumHeight(20);
203 alarmLayout->addWidget(mAlarmIncrCombo); 204 alarmLayout->addWidget(mAlarmIncrCombo);
204 mAlarmSoundButton = new QPushButton(parent); 205 mAlarmSoundButton = new QPushButton(parent);
205 mAlarmSoundButton->setPixmap(SmallIcon("playsound")); 206 mAlarmSoundButton->setPixmap(SmallIcon("playsound"));
206 mAlarmSoundButton->setToggleButton(true); 207 mAlarmSoundButton->setToggleButton(true);
207 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 208 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
208 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); 209 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound()));
209 alarmLayout->addWidget(mAlarmSoundButton); 210 alarmLayout->addWidget(mAlarmSoundButton);
210 211
211 mAlarmProgramButton = new QPushButton(parent); 212 mAlarmProgramButton = new QPushButton(parent);
212 mAlarmProgramButton->setPixmap(SmallIcon("run")); 213 mAlarmProgramButton->setPixmap(SmallIcon("run"));
213 mAlarmProgramButton->setToggleButton(true); 214 mAlarmProgramButton->setToggleButton(true);
214 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 215 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
215 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); 216 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram()));
216 alarmLayout->addWidget(mAlarmProgramButton); 217 alarmLayout->addWidget(mAlarmProgramButton);
217 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); 218 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 );
218 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); 219 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 );
219 // if ( KOPrefs::instance()->mCompactDialogs ) { 220 // if ( KOPrefs::instance()->mCompactDialogs ) {
220 // mAlarmSoundButton->hide(); 221 // mAlarmSoundButton->hide();
221 // mAlarmProgramButton->hide(); 222 // mAlarmProgramButton->hide();
222 // } 223 // }
223} 224}
224 225
225void KOEditorGeneral::pickAlarmSound() 226void KOEditorGeneral::pickAlarmSound()
226{ 227{
227 228
228 qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); 229 qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() );
229 //QString prefix = mAlarmSound; 230 //QString prefix = mAlarmSound;
230 if (!mAlarmSoundButton->isOn()) { 231 if (!mAlarmSoundButton->isOn()) {
231 mAlarmSoundButton->setOn(true); 232 mAlarmSoundButton->setOn(true);
232 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 233 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
233 } else { 234 } else {
234 QString fileName(KFileDialog::getOpenFileName(mAlarmSound, 235 QString fileName(KFileDialog::getOpenFileName(mAlarmSound,
235 i18n("*.wav|Wav Files"), 0)); 236 i18n("*.wav|Wav Files"), 0));
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 678e1bd..341a839 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -119,96 +119,101 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
119 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList())); 119 connect(searchEdit,SIGNAL(scrollDOWN()),SLOT(setFocusToList()));
120 120
121 setCaption( i18n("KO/Pi Find: ")); 121 setCaption( i18n("KO/Pi Find: "));
122#ifdef DESKTOP_VERSION 122#ifdef DESKTOP_VERSION
123 OkButton = new QPushButton( i18n("Close"), this ); 123 OkButton = new QPushButton( i18n("Close"), this );
124 connect(OkButton,SIGNAL(clicked()),SLOT(hide())); 124 connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
125#endif 125#endif
126} 126}
127 127
128SearchDialog::~SearchDialog() 128SearchDialog::~SearchDialog()
129{ 129{
130 130
131} 131}
132void SearchDialog::setFocusToList() 132void SearchDialog::setFocusToList()
133{ 133{
134 listView->resetFocus(); 134 listView->resetFocus();
135} 135}
136void SearchDialog::accept() 136void SearchDialog::accept()
137{ 137{
138 doSearch(); 138 doSearch();
139} 139}
140void SearchDialog::updateList() 140void SearchDialog::updateList()
141{ 141{
142 //listView->updateList(); 142 //listView->updateList();
143 if ( isVisible() ) { 143 if ( isVisible() ) {
144 updateView(); 144 updateView();
145 //qDebug("SearchDialog::updated "); 145 //qDebug("SearchDialog::updated ");
146 } 146 }
147 else { 147 else {
148 listView->clear(); 148 listView->clear();
149 //qDebug("SearchDialog::cleared "); 149 //qDebug("SearchDialog::cleared ");
150 150
151 } 151 }
152} 152}
153void SearchDialog::searchTextChanged( const QString &_text ) 153void SearchDialog::searchTextChanged( const QString &_text )
154{ 154{
155#if 0 155#if 0
156 enableButton( KDialogBase::User1, !_text.isEmpty() ); 156 enableButton( KDialogBase::User1, !_text.isEmpty() );
157#endif 157#endif
158} 158}
159 159
160void SearchDialog::doSearch() 160void SearchDialog::doSearch()
161{ 161{
162 QRegExp re; 162 QRegExp re;
163 163
164 re.setWildcard(true); // most people understand these better. 164 re.setWildcard(true); // most people understand these better.
165 re.setCaseSensitive(false); 165 re.setCaseSensitive(false);
166 re.setPattern(searchEdit->text()); 166 re.setPattern(searchEdit->text());
167 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) {
168 KMessageBox::sorry(this,
169 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals"));
170 return;
171 }
167 if (!re.isValid() ) { 172 if (!re.isValid() ) {
168 KMessageBox::sorry(this, 173 KMessageBox::sorry(this,
169 i18n("Invalid search expression,\ncannot perform " 174 i18n("Invalid search expression,\ncannot perform "
170 "the search.\nPlease enter a search expression\n" 175 "the search.\nPlease enter a search expression\n"
171 "using the wildcard characters\n '*' and '?'" 176 "using the wildcard characters\n '*' and '?'"
172 "where needed.")); 177 "where needed."));
173 return; 178 return;
174 } 179 }
175 180
176 search(re); 181 search(re);
177 182
178 listView->setStartDate( mStartDate->date() ); 183 listView->setStartDate( mStartDate->date() );
179 listView->showEvents(mMatchedEvents); 184 listView->showEvents(mMatchedEvents);
180 listView->addTodos(mMatchedTodos); 185 listView->addTodos(mMatchedTodos);
181 listView->addJournals(mMatchedJournals); 186 listView->addJournals(mMatchedJournals);
182 187
183 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { 188 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) {
184 setCaption(i18n("No items found. Use '*' and '?' where needed.")); 189 setCaption(i18n("No items found. Use '*' and '?' where needed."));
185 } else { 190 } else {
186 QString mess; 191 QString mess;
187 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); 192 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() );
188 setCaption( i18n("KO/Pi Find: ") + mess); 193 setCaption( i18n("KO/Pi Find: ") + mess);
189 194
190 } 195 }
191 searchEdit->setFocus(); 196 searchEdit->setFocus();
192} 197}
193void SearchDialog::updateConfig() 198void SearchDialog::updateConfig()
194{ 199{
195 listView->updateConfig(); 200 listView->updateConfig();
196} 201}
197void SearchDialog::updateView() 202void SearchDialog::updateView()
198{ 203{
199 204
200 QRegExp re; 205 QRegExp re;
201 re.setWildcard(true); // most people understand these better. 206 re.setWildcard(true); // most people understand these better.
202 re.setCaseSensitive(false); 207 re.setCaseSensitive(false);
203 re.setPattern(searchEdit->text()); 208 re.setPattern(searchEdit->text());
204 if (re.isValid()) { 209 if (re.isValid()) {
205 search(re); 210 search(re);
206 } else { 211 } else {
207 mMatchedEvents.clear(); 212 mMatchedEvents.clear();
208 mMatchedTodos.clear(); 213 mMatchedTodos.clear();
209 mMatchedJournals.clear(); 214 mMatchedJournals.clear();
210 } 215 }
211 listView->setStartDate( mStartDate->date() ); 216 listView->setStartDate( mStartDate->date() );
212 listView->showEvents(mMatchedEvents); 217 listView->showEvents(mMatchedEvents);
213 listView->addTodos(mMatchedTodos); 218 listView->addTodos(mMatchedTodos);
214 listView->addJournals(mMatchedJournals); 219 listView->addJournals(mMatchedJournals);