summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-10 10:31:22 (UTC)
committer zautrix <zautrix>2005-06-10 10:31:22 (UTC)
commite5ca8e0d8d6d08b597253f43de401aa1a99a6abe (patch) (unidiff)
treec319ba89abbe5cd90647bc38deb0ab1ce46f48e5 /korganizer
parent89c5159208fd982f527117e49d67ea1f90553dbe (diff)
downloadkdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.zip
kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.gz
kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.bz2
config dialog fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--korganizer/kodialogmanager.cpp23
-rw-r--r--korganizer/koprefsdialog.cpp286
-rw-r--r--korganizer/koprefsdialog.h12
4 files changed, 20 insertions, 302 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 4794414..2a55127 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2150,768 +2150,769 @@ void CalendarView::writeSettings()
2150 //KOPrefs::instance()->usrWriteConfig(); 2150 //KOPrefs::instance()->usrWriteConfig();
2151 KOPrefs::instance()->writeConfig(); 2151 KOPrefs::instance()->writeConfig();
2152 2152
2153 writeFilterSettings(config); 2153 writeFilterSettings(config);
2154 config->setGroup( "AppRun" ); 2154 config->setGroup( "AppRun" );
2155 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2155 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2156 config->writeEntry( "LatestProgramStop", dt.secsTo( QDateTime::currentDateTime() ) ); 2156 config->writeEntry( "LatestProgramStop", dt.secsTo( QDateTime::currentDateTime() ) );
2157 config->setGroup( "Views" ); 2157 config->setGroup( "Views" );
2158 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2158 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2159 2159
2160 QValueList<int> listINT = mLeftFrame->sizes(); 2160 QValueList<int> listINT = mLeftFrame->sizes();
2161 config->writeEntry("Left Splitter Frame",listINT); 2161 config->writeEntry("Left Splitter Frame",listINT);
2162 QValueList<int> listINT2 = mMainFrame->sizes(); 2162 QValueList<int> listINT2 = mMainFrame->sizes();
2163 config->writeEntry("Main Splitter Frame",listINT2); 2163 config->writeEntry("Main Splitter Frame",listINT2);
2164#ifdef DESKTOP_VERSION 2164#ifdef DESKTOP_VERSION
2165 config->setGroup("WidgetLayout"); 2165 config->setGroup("WidgetLayout");
2166 QStringList list ;//= config->readListEntry("MainLayout"); 2166 QStringList list ;//= config->readListEntry("MainLayout");
2167 int x,y,w,h; 2167 int x,y,w,h;
2168 QWidget* wid; 2168 QWidget* wid;
2169 wid = topLevelWidget(); 2169 wid = topLevelWidget();
2170 x = wid->geometry().x(); 2170 x = wid->geometry().x();
2171 y = wid->geometry().y(); 2171 y = wid->geometry().y();
2172 w = wid->width(); 2172 w = wid->width();
2173 h = wid->height(); 2173 h = wid->height();
2174 list.clear(); 2174 list.clear();
2175 list << QString::number( x ); 2175 list << QString::number( x );
2176 list << QString::number( y ); 2176 list << QString::number( y );
2177 list << QString::number( w ); 2177 list << QString::number( w );
2178 list << QString::number( h ); 2178 list << QString::number( h );
2179 config->writeEntry("MainLayout",list ); 2179 config->writeEntry("MainLayout",list );
2180 2180
2181 wid = mEventEditor; 2181 wid = mEventEditor;
2182 x = wid->geometry().x(); 2182 x = wid->geometry().x();
2183 y = wid->geometry().y(); 2183 y = wid->geometry().y();
2184 w = wid->width(); 2184 w = wid->width();
2185 h = wid->height(); 2185 h = wid->height();
2186 list.clear(); 2186 list.clear();
2187 list << QString::number( x ); 2187 list << QString::number( x );
2188 list << QString::number( y ); 2188 list << QString::number( y );
2189 list << QString::number( w ); 2189 list << QString::number( w );
2190 list << QString::number( h ); 2190 list << QString::number( h );
2191 config->writeEntry("EditEventLayout",list ); 2191 config->writeEntry("EditEventLayout",list );
2192 2192
2193 wid = mTodoEditor; 2193 wid = mTodoEditor;
2194 x = wid->geometry().x(); 2194 x = wid->geometry().x();
2195 y = wid->geometry().y(); 2195 y = wid->geometry().y();
2196 w = wid->width(); 2196 w = wid->width();
2197 h = wid->height(); 2197 h = wid->height();
2198 list.clear(); 2198 list.clear();
2199 list << QString::number( x ); 2199 list << QString::number( x );
2200 list << QString::number( y ); 2200 list << QString::number( y );
2201 list << QString::number( w ); 2201 list << QString::number( w );
2202 list << QString::number( h ); 2202 list << QString::number( h );
2203 config->writeEntry("EditTodoLayout",list ); 2203 config->writeEntry("EditTodoLayout",list );
2204 wid = getEventViewerDialog(); 2204 wid = getEventViewerDialog();
2205 x = wid->geometry().x(); 2205 x = wid->geometry().x();
2206 y = wid->geometry().y(); 2206 y = wid->geometry().y();
2207 w = wid->width(); 2207 w = wid->width();
2208 h = wid->height(); 2208 h = wid->height();
2209 list.clear(); 2209 list.clear();
2210 list << QString::number( x ); 2210 list << QString::number( x );
2211 list << QString::number( y ); 2211 list << QString::number( y );
2212 list << QString::number( w ); 2212 list << QString::number( w );
2213 list << QString::number( h ); 2213 list << QString::number( h );
2214 config->writeEntry("ViewerLayout",list ); 2214 config->writeEntry("ViewerLayout",list );
2215 wid = mDialogManager->getSearchDialog(); 2215 wid = mDialogManager->getSearchDialog();
2216 if ( wid ) { 2216 if ( wid ) {
2217 x = wid->geometry().x(); 2217 x = wid->geometry().x();
2218 y = wid->geometry().y(); 2218 y = wid->geometry().y();
2219 w = wid->width(); 2219 w = wid->width();
2220 h = wid->height(); 2220 h = wid->height();
2221 list.clear(); 2221 list.clear();
2222 list << QString::number( x ); 2222 list << QString::number( x );
2223 list << QString::number( y ); 2223 list << QString::number( y );
2224 list << QString::number( w ); 2224 list << QString::number( w );
2225 list << QString::number( h ); 2225 list << QString::number( h );
2226 config->writeEntry("SearchLayout",list ); 2226 config->writeEntry("SearchLayout",list );
2227 } 2227 }
2228#endif 2228#endif
2229 2229
2230 2230
2231 config->sync(); 2231 config->sync();
2232} 2232}
2233 2233
2234void CalendarView::readFilterSettings(KConfig *config) 2234void CalendarView::readFilterSettings(KConfig *config)
2235{ 2235{
2236 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2236 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2237 2237
2238 mFilters.clear(); 2238 mFilters.clear();
2239 2239
2240 config->setGroup("General"); 2240 config->setGroup("General");
2241 QStringList filterList = config->readListEntry("CalendarFilters"); 2241 QStringList filterList = config->readListEntry("CalendarFilters");
2242 2242
2243 QStringList::ConstIterator it = filterList.begin(); 2243 QStringList::ConstIterator it = filterList.begin();
2244 QStringList::ConstIterator end = filterList.end(); 2244 QStringList::ConstIterator end = filterList.end();
2245 while(it != end) { 2245 while(it != end) {
2246 // kdDebug() << " filter: " << (*it) << endl; 2246 // kdDebug() << " filter: " << (*it) << endl;
2247 2247
2248 CalFilter *filter; 2248 CalFilter *filter;
2249 filter = new CalFilter(*it); 2249 filter = new CalFilter(*it);
2250 config->setGroup("Filter_" + (*it).utf8()); 2250 config->setGroup("Filter_" + (*it).utf8());
2251 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2251 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2252 filter->setCriteria(config->readNumEntry("Criteria",0)); 2252 filter->setCriteria(config->readNumEntry("Criteria",0));
2253 filter->setCategoryList(config->readListEntry("CategoryList")); 2253 filter->setCategoryList(config->readListEntry("CategoryList"));
2254 mFilters.append(filter); 2254 mFilters.append(filter);
2255 2255
2256 ++it; 2256 ++it;
2257 } 2257 }
2258 2258
2259 if (mFilters.count() == 0) { 2259 if (mFilters.count() == 0) {
2260 CalFilter *filter = new CalFilter(i18n("Default")); 2260 CalFilter *filter = new CalFilter(i18n("Default"));
2261 mFilters.append(filter); 2261 mFilters.append(filter);
2262 } 2262 }
2263 mFilterView->updateFilters(); 2263 mFilterView->updateFilters();
2264 config->setGroup("FilterView"); 2264 config->setGroup("FilterView");
2265 2265
2266 mFilterView->blockSignals(true); 2266 mFilterView->blockSignals(true);
2267 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2267 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2268 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2268 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2269 mFilterView->blockSignals(false); 2269 mFilterView->blockSignals(false);
2270 // We do it manually to avoid it being done twice by the above calls 2270 // We do it manually to avoid it being done twice by the above calls
2271 updateFilter(); 2271 updateFilter();
2272} 2272}
2273 2273
2274void CalendarView::writeFilterSettings(KConfig *config) 2274void CalendarView::writeFilterSettings(KConfig *config)
2275{ 2275{
2276 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2276 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2277 2277
2278 QStringList filterList; 2278 QStringList filterList;
2279 2279
2280 CalFilter *filter = mFilters.first(); 2280 CalFilter *filter = mFilters.first();
2281 while(filter) { 2281 while(filter) {
2282 // kdDebug() << " fn: " << filter->name() << endl; 2282 // kdDebug() << " fn: " << filter->name() << endl;
2283 filterList << filter->name(); 2283 filterList << filter->name();
2284 config->setGroup("Filter_" + filter->name().utf8()); 2284 config->setGroup("Filter_" + filter->name().utf8());
2285 config->writeEntry("Criteria",filter->criteria()); 2285 config->writeEntry("Criteria",filter->criteria());
2286 config->writeEntry("CategoryList",filter->categoryList()); 2286 config->writeEntry("CategoryList",filter->categoryList());
2287 filter = mFilters.next(); 2287 filter = mFilters.next();
2288 } 2288 }
2289 config->setGroup("General"); 2289 config->setGroup("General");
2290 config->writeEntry("CalendarFilters",filterList); 2290 config->writeEntry("CalendarFilters",filterList);
2291 2291
2292 config->setGroup("FilterView"); 2292 config->setGroup("FilterView");
2293 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2293 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2294 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2294 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2295} 2295}
2296 2296
2297 2297
2298void CalendarView::goToday() 2298void CalendarView::goToday()
2299{ 2299{
2300 if ( mViewManager->currentView()->isMonthView() ) 2300 if ( mViewManager->currentView()->isMonthView() )
2301 mNavigator->selectTodayMonth(); 2301 mNavigator->selectTodayMonth();
2302 else 2302 else
2303 mNavigator->selectToday(); 2303 mNavigator->selectToday();
2304} 2304}
2305 2305
2306void CalendarView::goNext() 2306void CalendarView::goNext()
2307{ 2307{
2308 mNavigator->selectNext(); 2308 mNavigator->selectNext();
2309} 2309}
2310 2310
2311void CalendarView::goPrevious() 2311void CalendarView::goPrevious()
2312{ 2312{
2313 mNavigator->selectPrevious(); 2313 mNavigator->selectPrevious();
2314} 2314}
2315void CalendarView::goNextMonth() 2315void CalendarView::goNextMonth()
2316{ 2316{
2317 mNavigator->selectNextMonth(); 2317 mNavigator->selectNextMonth();
2318} 2318}
2319 2319
2320void CalendarView::goPreviousMonth() 2320void CalendarView::goPreviousMonth()
2321{ 2321{
2322 mNavigator->selectPreviousMonth(); 2322 mNavigator->selectPreviousMonth();
2323} 2323}
2324void CalendarView::writeLocale() 2324void CalendarView::writeLocale()
2325{ 2325{
2326 //KPimGlobalPrefs::instance()->setGlobalConfig(); 2326 //KPimGlobalPrefs::instance()->setGlobalConfig();
2327#if 0 2327#if 0
2328 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); 2328 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
2329 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); 2329 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
2330 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); 2330 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
2331 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); 2331 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
2332 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 2332 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
2333 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 2333 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
2334 dummy = KOPrefs::instance()->mUserDateFormatShort; 2334 dummy = KOPrefs::instance()->mUserDateFormatShort;
2335 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 2335 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
2336 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, 2336 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
2337 KOPrefs::instance()->mDaylightsavingStart, 2337 KOPrefs::instance()->mDaylightsavingStart,
2338 KOPrefs::instance()->mDaylightsavingEnd ); 2338 KOPrefs::instance()->mDaylightsavingEnd );
2339 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); 2339 KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId );
2340#endif 2340#endif
2341} 2341}
2342void CalendarView::updateConfig() 2342void CalendarView::updateConfig()
2343{ 2343{
2344 writeLocale(); 2344 writeLocale();
2345 if ( KOPrefs::instance()->mUseAppColors ) 2345 if ( KOPrefs::instance()->mUseAppColors )
2346 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2346 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2347 emit configChanged(); 2347 emit configChanged();
2348 mTodoList->updateConfig(); 2348 mTodoList->updateConfig();
2349 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2349 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2350 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2350 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2351 // To make the "fill window" configurations work 2351 // To make the "fill window" configurations work
2352 //mViewManager->raiseCurrentView(); 2352 //mViewManager->raiseCurrentView();
2353} 2353}
2354 2354
2355 2355
2356void CalendarView::eventChanged(Event *event) 2356void CalendarView::eventChanged(Event *event)
2357{ 2357{
2358 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2358 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2359 //updateUnmanagedViews(); 2359 //updateUnmanagedViews();
2360} 2360}
2361 2361
2362void CalendarView::eventAdded(Event *event) 2362void CalendarView::eventAdded(Event *event)
2363{ 2363{
2364 changeEventDisplay(event,KOGlobals::EVENTADDED); 2364 changeEventDisplay(event,KOGlobals::EVENTADDED);
2365} 2365}
2366 2366
2367void CalendarView::eventToBeDeleted(Event *) 2367void CalendarView::eventToBeDeleted(Event *)
2368{ 2368{
2369 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2369 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2370} 2370}
2371 2371
2372void CalendarView::eventDeleted() 2372void CalendarView::eventDeleted()
2373{ 2373{
2374 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2374 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2375} 2375}
2376void CalendarView::changeTodoDisplay(Todo *which, int action) 2376void CalendarView::changeTodoDisplay(Todo *which, int action)
2377{ 2377{
2378 changeIncidenceDisplay((Incidence *)which, action); 2378 changeIncidenceDisplay((Incidence *)which, action);
2379 mDateNavigator->updateView(); //LR 2379 mDateNavigator->updateView(); //LR
2380 //mDialogManager->updateSearchDialog(); 2380 //mDialogManager->updateSearchDialog();
2381 2381
2382 if (which) { 2382 if (which) {
2383 mViewManager->updateWNview(); 2383 mViewManager->updateWNview();
2384 //mTodoList->updateView(); 2384 //mTodoList->updateView();
2385 } 2385 }
2386 2386
2387} 2387}
2388 2388
2389void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2389void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2390{ 2390{
2391 updateUnmanagedViews(); 2391 updateUnmanagedViews();
2392 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2392 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2393 if ( action == KOGlobals::EVENTDELETED ) { //delete 2393 if ( action == KOGlobals::EVENTDELETED ) { //delete
2394 mCalendar->checkAlarmForIncidence( 0, true ); 2394 mCalendar->checkAlarmForIncidence( 0, true );
2395 if ( mEventViewerDialog ) 2395 if ( mEventViewerDialog )
2396 mEventViewerDialog->hide(); 2396 mEventViewerDialog->hide();
2397 } 2397 }
2398 else 2398 else
2399 mCalendar->checkAlarmForIncidence( which , false ); 2399 mCalendar->checkAlarmForIncidence( which , false );
2400} 2400}
2401 2401
2402// most of the changeEventDisplays() right now just call the view's 2402// most of the changeEventDisplays() right now just call the view's
2403// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2403// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2404void CalendarView::changeEventDisplay(Event *which, int action) 2404void CalendarView::changeEventDisplay(Event *which, int action)
2405{ 2405{
2406 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2406 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2407 changeIncidenceDisplay((Incidence *)which, action); 2407 changeIncidenceDisplay((Incidence *)which, action);
2408 mDateNavigator->updateView(); 2408 mDateNavigator->updateView();
2409 //mDialogManager->updateSearchDialog(); 2409 //mDialogManager->updateSearchDialog();
2410 2410
2411 if (which) { 2411 if (which) {
2412 // If there is an event view visible update the display 2412 // If there is an event view visible update the display
2413 mViewManager->currentView()->changeEventDisplay(which,action); 2413 mViewManager->currentView()->changeEventDisplay(which,action);
2414 // TODO: check, if update needed 2414 // TODO: check, if update needed
2415 // if (which->getTodoStatus()) { 2415 // if (which->getTodoStatus()) {
2416 mTodoList->updateView(); 2416 mTodoList->updateView();
2417 // } 2417 // }
2418 } else { 2418 } else {
2419 mViewManager->currentView()->updateView(); 2419 mViewManager->currentView()->updateView();
2420 } 2420 }
2421} 2421}
2422 2422
2423 2423
2424void CalendarView::updateTodoViews() 2424void CalendarView::updateTodoViews()
2425{ 2425{
2426 mTodoList->updateView(); 2426 mTodoList->updateView();
2427 mViewManager->currentView()->updateView(); 2427 mViewManager->currentView()->updateView();
2428 2428
2429} 2429}
2430 2430
2431 2431
2432void CalendarView::updateView(const QDate &start, const QDate &end) 2432void CalendarView::updateView(const QDate &start, const QDate &end)
2433{ 2433{
2434 mTodoList->updateView(); 2434 mTodoList->updateView();
2435 mViewManager->updateView(start, end); 2435 mViewManager->updateView(start, end);
2436 //mDateNavigator->updateView(); 2436 //mDateNavigator->updateView();
2437} 2437}
2438 2438
2439void CalendarView::clearAllViews() 2439void CalendarView::clearAllViews()
2440{ 2440{
2441 mTodoList->clearList(); 2441 mTodoList->clearList();
2442 mViewManager->clearAllViews(); 2442 mViewManager->clearAllViews();
2443 SearchDialog * sd = mDialogManager->getSearchDialog(); 2443 SearchDialog * sd = mDialogManager->getSearchDialog();
2444 if ( sd ) { 2444 if ( sd ) {
2445 KOListView* kol = sd->listview(); 2445 KOListView* kol = sd->listview();
2446 if ( kol ) 2446 if ( kol )
2447 kol->clearList(); 2447 kol->clearList();
2448 } 2448 }
2449} 2449}
2450void CalendarView::updateView() 2450void CalendarView::updateView()
2451{ 2451{
2452 DateList tmpList = mNavigator->selectedDates(); 2452 DateList tmpList = mNavigator->selectedDates();
2453 2453
2454 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2454 if ( KOPrefs::instance()->mHideNonStartedTodos )
2455 mTodoList->updateView(); 2455 mTodoList->updateView();
2456 // We assume that the navigator only selects consecutive days. 2456 // We assume that the navigator only selects consecutive days.
2457 updateView( tmpList.first(), tmpList.last() ); 2457 updateView( tmpList.first(), tmpList.last() );
2458} 2458}
2459 2459
2460void CalendarView::updateUnmanagedViews() 2460void CalendarView::updateUnmanagedViews()
2461{ 2461{
2462 mDateNavigator->updateDayMatrix(); 2462 mDateNavigator->updateDayMatrix();
2463} 2463}
2464 2464
2465int CalendarView::msgItemDelete(const QString name) 2465int CalendarView::msgItemDelete(const QString name)
2466{ 2466{
2467 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2467 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2468 i18n("This item will be\npermanently deleted."), 2468 i18n("This item will be\npermanently deleted."),
2469 i18n("KO/Pi Confirmation"),i18n("Delete")); 2469 i18n("KO/Pi Confirmation"),i18n("Delete"));
2470} 2470}
2471 2471
2472 2472
2473void CalendarView::edit_cut() 2473void CalendarView::edit_cut()
2474{ 2474{
2475 Event *anEvent=0; 2475 Event *anEvent=0;
2476 2476
2477 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2477 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2478 2478
2479 if (mViewManager->currentView()->isEventView()) { 2479 if (mViewManager->currentView()->isEventView()) {
2480 if ( incidence && incidence->typeID() == eventID ) { 2480 if ( incidence && incidence->typeID() == eventID ) {
2481 anEvent = static_cast<Event *>(incidence); 2481 anEvent = static_cast<Event *>(incidence);
2482 } 2482 }
2483 } 2483 }
2484 2484
2485 if (!anEvent) { 2485 if (!anEvent) {
2486 KNotifyClient::beep(); 2486 KNotifyClient::beep();
2487 return; 2487 return;
2488 } 2488 }
2489 DndFactory factory( mCalendar ); 2489 DndFactory factory( mCalendar );
2490 factory.cutIncidence(anEvent); 2490 factory.cutIncidence(anEvent);
2491 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2491 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2492} 2492}
2493 2493
2494void CalendarView::edit_copy() 2494void CalendarView::edit_copy()
2495{ 2495{
2496 Event *anEvent=0; 2496 Event *anEvent=0;
2497 2497
2498 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2498 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2499 2499
2500 if (mViewManager->currentView()->isEventView()) { 2500 if (mViewManager->currentView()->isEventView()) {
2501 if ( incidence && incidence->typeID() == eventID ) { 2501 if ( incidence && incidence->typeID() == eventID ) {
2502 anEvent = static_cast<Event *>(incidence); 2502 anEvent = static_cast<Event *>(incidence);
2503 } 2503 }
2504 } 2504 }
2505 2505
2506 if (!anEvent) { 2506 if (!anEvent) {
2507 KNotifyClient::beep(); 2507 KNotifyClient::beep();
2508 return; 2508 return;
2509 } 2509 }
2510 DndFactory factory( mCalendar ); 2510 DndFactory factory( mCalendar );
2511 factory.copyIncidence(anEvent); 2511 factory.copyIncidence(anEvent);
2512} 2512}
2513 2513
2514void CalendarView::edit_paste() 2514void CalendarView::edit_paste()
2515{ 2515{
2516 QDate date = mNavigator->selectedDates().first(); 2516 QDate date = mNavigator->selectedDates().first();
2517 2517
2518 DndFactory factory( mCalendar ); 2518 DndFactory factory( mCalendar );
2519 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2519 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2520 2520
2521 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2521 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2522} 2522}
2523void CalendarView::edit_global_options() 2523void CalendarView::edit_global_options()
2524{ 2524{
2525 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2525 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2526 emit save(); 2526 emit save();
2527 emit saveStopTimer(); 2527 emit saveStopTimer();
2528 mDialogManager->showGlobalOptionsDialog(); 2528 mDialogManager->showGlobalOptionsDialog();
2529 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2529 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2530 emit saveStopTimer(); 2530 emit saveStopTimer();
2531 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), 2531 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
2532 i18n("Timezone settings"),i18n("Reload"))) { 2532 i18n("Timezone settings"),i18n("Reload"))) {
2533 qDebug("KO: TZ reload cancelled "); 2533 qDebug("KO: TZ reload cancelled ");
2534 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2534 return; 2535 return;
2535 } 2536 }
2536 qDebug("KO: Timezone change "); 2537 qDebug("KO: Timezone change ");
2537 openCalendar( MainWindow::defaultFileName() ); 2538 openCalendar( MainWindow::defaultFileName() );
2538 setModified(true); 2539 setModified(true);
2539 } 2540 }
2540 else 2541 else
2541 qDebug("KO: No tz change "); 2542 qDebug("KO: No tz change ");
2542} 2543}
2543void CalendarView::edit_options() 2544void CalendarView::edit_options()
2544{ 2545{
2545 mDialogManager->showOptionsDialog(); 2546 mDialogManager->showOptionsDialog();
2546} 2547}
2547 2548
2548 2549
2549void CalendarView::slotSelectPickerDate( QDate d) 2550void CalendarView::slotSelectPickerDate( QDate d)
2550{ 2551{
2551 mDateFrame->hide(); 2552 mDateFrame->hide();
2552 if ( mDatePickerMode == 1 ) { 2553 if ( mDatePickerMode == 1 ) {
2553 mNavigator->slotDaySelect( d ); 2554 mNavigator->slotDaySelect( d );
2554 } else if ( mDatePickerMode == 2 ) { 2555 } else if ( mDatePickerMode == 2 ) {
2555 if ( mMoveIncidence->typeID() == todoID ) { 2556 if ( mMoveIncidence->typeID() == todoID ) {
2556 Todo * to = (Todo *) mMoveIncidence; 2557 Todo * to = (Todo *) mMoveIncidence;
2557 QTime tim; 2558 QTime tim;
2558 int len = 0; 2559 int len = 0;
2559 if ( to->hasStartDate() && to->hasDueDate() ) 2560 if ( to->hasStartDate() && to->hasDueDate() )
2560 len = to->dtStart().secsTo( to->dtDue()); 2561 len = to->dtStart().secsTo( to->dtDue());
2561 if ( to->hasDueDate() ) 2562 if ( to->hasDueDate() )
2562 tim = to->dtDue().time(); 2563 tim = to->dtDue().time();
2563 else { 2564 else {
2564 tim = QTime ( 0,0,0 ); 2565 tim = QTime ( 0,0,0 );
2565 to->setFloats( true ); 2566 to->setFloats( true );
2566 to->setHasDueDate( true ); 2567 to->setHasDueDate( true );
2567 } 2568 }
2568 QDateTime dt ( d,tim ); 2569 QDateTime dt ( d,tim );
2569 to->setDtDue( dt ); 2570 to->setDtDue( dt );
2570 2571
2571 if ( to->hasStartDate() ) { 2572 if ( to->hasStartDate() ) {
2572 if ( len>0 ) 2573 if ( len>0 )
2573 to->setDtStart(to->dtDue().addSecs( -len )); 2574 to->setDtStart(to->dtDue().addSecs( -len ));
2574 else 2575 else
2575 if (to->dtStart() > to->dtDue() ) 2576 if (to->dtStart() > to->dtDue() )
2576 to->setDtStart(to->dtDue().addDays( -3 )); 2577 to->setDtStart(to->dtDue().addDays( -3 ));
2577 } 2578 }
2578 2579
2579 todoChanged( to ); 2580 todoChanged( to );
2580 } else { 2581 } else {
2581 if ( mMoveIncidence->doesRecur() ) { 2582 if ( mMoveIncidence->doesRecur() ) {
2582#if 0 2583#if 0
2583 // PENDING implement this 2584 // PENDING implement this
2584 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2585 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2585 mCalendar()->addIncidence( newInc ); 2586 mCalendar()->addIncidence( newInc );
2586 if ( mMoveIncidence->typeID() == todoID ) 2587 if ( mMoveIncidence->typeID() == todoID )
2587 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2588 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2588 else 2589 else
2589 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2590 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2590 mMoveIncidence = newInc; 2591 mMoveIncidence = newInc;
2591 2592
2592#endif 2593#endif
2593 } 2594 }
2594 QTime tim = mMoveIncidence->dtStart().time(); 2595 QTime tim = mMoveIncidence->dtStart().time();
2595 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2596 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2596 QDateTime dt ( d,tim ); 2597 QDateTime dt ( d,tim );
2597 mMoveIncidence->setDtStart( dt ); 2598 mMoveIncidence->setDtStart( dt );
2598 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2599 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2599 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2600 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2600 } 2601 }
2601 2602
2602 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2603 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2603 } 2604 }
2604} 2605}
2605 2606
2606void CalendarView::removeCategories() 2607void CalendarView::removeCategories()
2607{ 2608{
2608 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2609 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2609 QStringList catList = KOPrefs::instance()->mCustomCategories; 2610 QStringList catList = KOPrefs::instance()->mCustomCategories;
2610 QStringList catIncList; 2611 QStringList catIncList;
2611 QStringList newCatList; 2612 QStringList newCatList;
2612 Incidence* inc = incList.first(); 2613 Incidence* inc = incList.first();
2613 int i; 2614 int i;
2614 int count = 0; 2615 int count = 0;
2615 while ( inc ) { 2616 while ( inc ) {
2616 newCatList.clear(); 2617 newCatList.clear();
2617 catIncList = inc->categories() ; 2618 catIncList = inc->categories() ;
2618 for( i = 0; i< catIncList.count(); ++i ) { 2619 for( i = 0; i< catIncList.count(); ++i ) {
2619 if ( catList.contains (catIncList[i])) 2620 if ( catList.contains (catIncList[i]))
2620 newCatList.append( catIncList[i] ); 2621 newCatList.append( catIncList[i] );
2621 } 2622 }
2622 newCatList.sort(); 2623 newCatList.sort();
2623 inc->setCategories( newCatList.join(",") ); 2624 inc->setCategories( newCatList.join(",") );
2624 inc = incList.next(); 2625 inc = incList.next();
2625 } 2626 }
2626} 2627}
2627 2628
2628int CalendarView::addCategories() 2629int CalendarView::addCategories()
2629{ 2630{
2630 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2631 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2631 QStringList catList = KOPrefs::instance()->mCustomCategories; 2632 QStringList catList = KOPrefs::instance()->mCustomCategories;
2632 QStringList catIncList; 2633 QStringList catIncList;
2633 Incidence* inc = incList.first(); 2634 Incidence* inc = incList.first();
2634 int i; 2635 int i;
2635 int count = 0; 2636 int count = 0;
2636 while ( inc ) { 2637 while ( inc ) {
2637 catIncList = inc->categories() ; 2638 catIncList = inc->categories() ;
2638 for( i = 0; i< catIncList.count(); ++i ) { 2639 for( i = 0; i< catIncList.count(); ++i ) {
2639 if ( !catList.contains (catIncList[i])) { 2640 if ( !catList.contains (catIncList[i])) {
2640 catList.append( catIncList[i] ); 2641 catList.append( catIncList[i] );
2641 //qDebug("add cat %s ", catIncList[i].latin1()); 2642 //qDebug("add cat %s ", catIncList[i].latin1());
2642 ++count; 2643 ++count;
2643 } 2644 }
2644 } 2645 }
2645 inc = incList.next(); 2646 inc = incList.next();
2646 } 2647 }
2647 catList.sort(); 2648 catList.sort();
2648 KOPrefs::instance()->mCustomCategories = catList; 2649 KOPrefs::instance()->mCustomCategories = catList;
2649 return count; 2650 return count;
2650} 2651}
2651 2652
2652void CalendarView::manageCategories() 2653void CalendarView::manageCategories()
2653{ 2654{
2654 KOCatPrefs* cp = new KOCatPrefs(); 2655 KOCatPrefs* cp = new KOCatPrefs();
2655 cp->show(); 2656 cp->show();
2656 int w =cp->sizeHint().width() ; 2657 int w =cp->sizeHint().width() ;
2657 int h = cp->sizeHint().height() ; 2658 int h = cp->sizeHint().height() ;
2658 int dw = QApplication::desktop()->width(); 2659 int dw = QApplication::desktop()->width();
2659 int dh = QApplication::desktop()->height(); 2660 int dh = QApplication::desktop()->height();
2660 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2661 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2661 if ( !cp->exec() ) { 2662 if ( !cp->exec() ) {
2662 delete cp; 2663 delete cp;
2663 return; 2664 return;
2664 } 2665 }
2665 int count = 0; 2666 int count = 0;
2666 if ( cp->addCat() ) { 2667 if ( cp->addCat() ) {
2667 count = addCategories(); 2668 count = addCategories();
2668 if ( count ) { 2669 if ( count ) {
2669 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2670 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2670 writeSettings(); 2671 writeSettings();
2671 } else 2672 } else
2672 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 2673 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
2673 } else { 2674 } else {
2674 removeCategories(); 2675 removeCategories();
2675 updateView(); 2676 updateView();
2676 } 2677 }
2677 delete cp; 2678 delete cp;
2678} 2679}
2679 2680
2680void CalendarView::beamIncidence(Incidence * Inc) 2681void CalendarView::beamIncidence(Incidence * Inc)
2681{ 2682{
2682 QPtrList<Incidence> delSel ; 2683 QPtrList<Incidence> delSel ;
2683 delSel.append(Inc); 2684 delSel.append(Inc);
2684 beamIncidenceList( delSel ); 2685 beamIncidenceList( delSel );
2685} 2686}
2686void CalendarView::beamCalendar() 2687void CalendarView::beamCalendar()
2687{ 2688{
2688 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2689 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2689 //qDebug("beamCalendar() "); 2690 //qDebug("beamCalendar() ");
2690 beamIncidenceList( delSel ); 2691 beamIncidenceList( delSel );
2691} 2692}
2692void CalendarView::beamFilteredCalendar() 2693void CalendarView::beamFilteredCalendar()
2693{ 2694{
2694 QPtrList<Incidence> delSel = mCalendar->incidences(); 2695 QPtrList<Incidence> delSel = mCalendar->incidences();
2695 //qDebug("beamFilteredCalendar() "); 2696 //qDebug("beamFilteredCalendar() ");
2696 beamIncidenceList( delSel ); 2697 beamIncidenceList( delSel );
2697} 2698}
2698void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2699void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2699{ 2700{
2700 if ( beamDialog->exec () == QDialog::Rejected ) 2701 if ( beamDialog->exec () == QDialog::Rejected )
2701 return; 2702 return;
2702#ifdef DESKTOP_VERSION 2703#ifdef DESKTOP_VERSION
2703 QString fn = locateLocal( "tmp", "kopibeamfile" ); 2704 QString fn = locateLocal( "tmp", "kopibeamfile" );
2704#else 2705#else
2705 QString fn = "/tmp/kopibeamfile"; 2706 QString fn = "/tmp/kopibeamfile";
2706#endif 2707#endif
2707 QString mes; 2708 QString mes;
2708 bool createbup = true; 2709 bool createbup = true;
2709 if ( createbup ) { 2710 if ( createbup ) {
2710 QString description = "\n"; 2711 QString description = "\n";
2711 CalendarLocal* cal = new CalendarLocal(); 2712 CalendarLocal* cal = new CalendarLocal();
2712 if ( beamDialog->beamLocal() ) 2713 if ( beamDialog->beamLocal() )
2713 cal->setLocalTime(); 2714 cal->setLocalTime();
2714 else 2715 else
2715 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2716 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2716 Incidence *incidence = delSel.first(); 2717 Incidence *incidence = delSel.first();
2717 bool addText = false; 2718 bool addText = false;
2718 if ( delSel.count() < 10 ) 2719 if ( delSel.count() < 10 )
2719 addText = true; 2720 addText = true;
2720 else { 2721 else {
2721 description.sprintf(i18n(" %d items?"),delSel.count() ); 2722 description.sprintf(i18n(" %d items?"),delSel.count() );
2722 } 2723 }
2723 while ( incidence ) { 2724 while ( incidence ) {
2724 Incidence *in = incidence->clone(); 2725 Incidence *in = incidence->clone();
2725 if ( ! in->summary().isEmpty() ) { 2726 if ( ! in->summary().isEmpty() ) {
2726 in->setDescription(""); 2727 in->setDescription("");
2727 } else { 2728 } else {
2728 in->setSummary( in->description().left(20)); 2729 in->setSummary( in->description().left(20));
2729 in->setDescription(""); 2730 in->setDescription("");
2730 } 2731 }
2731 if ( addText ) 2732 if ( addText )
2732 description += in->summary() + "\n"; 2733 description += in->summary() + "\n";
2733 cal->addIncidence( in ); 2734 cal->addIncidence( in );
2734 incidence = delSel.next(); 2735 incidence = delSel.next();
2735 } 2736 }
2736 if ( beamDialog->beamVcal() ) { 2737 if ( beamDialog->beamVcal() ) {
2737 fn += ".vcs"; 2738 fn += ".vcs";
2738 FileStorage storage( cal, fn, new VCalFormat ); 2739 FileStorage storage( cal, fn, new VCalFormat );
2739 storage.save(); 2740 storage.save();
2740 } else { 2741 } else {
2741 fn += ".ics"; 2742 fn += ".ics";
2742 FileStorage storage( cal, fn, new ICalFormat( ) ); 2743 FileStorage storage( cal, fn, new ICalFormat( ) );
2743 storage.save(); 2744 storage.save();
2744 } 2745 }
2745 delete cal; 2746 delete cal;
2746 mes = i18n("KO/Pi: Ready for beaming"); 2747 mes = i18n("KO/Pi: Ready for beaming");
2747 topLevelWidget()->setCaption(mes); 2748 topLevelWidget()->setCaption(mes);
2748 KApplication::convert2latin1( fn ); 2749 KApplication::convert2latin1( fn );
2749#ifndef DESKTOP_VERSION 2750#ifndef DESKTOP_VERSION
2750 Ir *ir = new Ir( this ); 2751 Ir *ir = new Ir( this );
2751 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2752 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2752 ir->send( fn, description, "text/x-vCalendar" ); 2753 ir->send( fn, description, "text/x-vCalendar" );
2753#endif 2754#endif
2754 } 2755 }
2755} 2756}
2756void CalendarView::beamDone( Ir *ir ) 2757void CalendarView::beamDone( Ir *ir )
2757{ 2758{
2758#ifndef DESKTOP_VERSION 2759#ifndef DESKTOP_VERSION
2759 delete ir; 2760 delete ir;
2760#endif 2761#endif
2761 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2762 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2762 topLevelWidget()->raise(); 2763 topLevelWidget()->raise();
2763} 2764}
2764 2765
2765void CalendarView::moveIncidence(Incidence * inc ) 2766void CalendarView::moveIncidence(Incidence * inc )
2766{ 2767{
2767 if ( !inc ) return; 2768 if ( !inc ) return;
2768 showDatePickerPopup(); 2769 showDatePickerPopup();
2769 mDatePickerMode = 2; 2770 mDatePickerMode = 2;
2770 mMoveIncidence = inc ; 2771 mMoveIncidence = inc ;
2771 QDate da; 2772 QDate da;
2772 if ( mMoveIncidence->typeID() == todoID ) { 2773 if ( mMoveIncidence->typeID() == todoID ) {
2773 Todo * to = (Todo *) mMoveIncidence; 2774 Todo * to = (Todo *) mMoveIncidence;
2774 if ( to->hasDueDate() ) 2775 if ( to->hasDueDate() )
2775 da = to->dtDue().date(); 2776 da = to->dtDue().date();
2776 else 2777 else
2777 da = QDate::currentDate(); 2778 da = QDate::currentDate();
2778 } else { 2779 } else {
2779 da = mMoveIncidence->dtStart().date(); 2780 da = mMoveIncidence->dtStart().date();
2780 } 2781 }
2781 //PENDING set date for recurring incidence to date of recurrence 2782 //PENDING set date for recurring incidence to date of recurrence
2782 //mMoveIncidenceOldDate; 2783 //mMoveIncidenceOldDate;
2783 mDatePicker->setDate( da ); 2784 mDatePicker->setDate( da );
2784} 2785}
2785void CalendarView::showDatePickerPopup() 2786void CalendarView::showDatePickerPopup()
2786{ 2787{
2787 if ( mDateFrame->isVisible() ) 2788 if ( mDateFrame->isVisible() )
2788 mDateFrame->hide(); 2789 mDateFrame->hide();
2789 else { 2790 else {
2790 int offX = 0, offY = 0; 2791 int offX = 0, offY = 0;
2791#ifdef DESKTOP_VERSION 2792#ifdef DESKTOP_VERSION
2792 int w =mDatePicker->sizeHint().width() ; 2793 int w =mDatePicker->sizeHint().width() ;
2793 int h = mDatePicker->sizeHint().height() ; 2794 int h = mDatePicker->sizeHint().height() ;
2794 int dw = topLevelWidget()->width(); 2795 int dw = topLevelWidget()->width();
2795 int dh = topLevelWidget()->height(); 2796 int dh = topLevelWidget()->height();
2796 offX = topLevelWidget()->x(); 2797 offX = topLevelWidget()->x();
2797 offY = topLevelWidget()->y(); 2798 offY = topLevelWidget()->y();
2798#else 2799#else
2799 int w =mDatePicker->sizeHint().width() ; 2800 int w =mDatePicker->sizeHint().width() ;
2800 int h = mDatePicker->sizeHint().height() ; 2801 int h = mDatePicker->sizeHint().height() ;
2801 int dw = QApplication::desktop()->width(); 2802 int dw = QApplication::desktop()->width();
2802 int dh = QApplication::desktop()->height(); 2803 int dh = QApplication::desktop()->height();
2803#endif 2804#endif
2804 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); 2805 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
2805 mDateFrame->show(); 2806 mDateFrame->show();
2806 } 2807 }
2807} 2808}
2808void CalendarView::showDatePicker( ) 2809void CalendarView::showDatePicker( )
2809{ 2810{
2810 showDatePickerPopup(); 2811 showDatePickerPopup();
2811 mDatePickerMode = 1; 2812 mDatePickerMode = 1;
2812 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2813 mDatePicker->setDate( mNavigator->selectedDates().first() );
2813} 2814}
2814 2815
2815void CalendarView::showEventEditor() 2816void CalendarView::showEventEditor()
2816{ 2817{
2817#ifdef DESKTOP_VERSION 2818#ifdef DESKTOP_VERSION
2818 int x,y,w,h; 2819 int x,y,w,h;
2819 x = mEventEditor->geometry().x(); 2820 x = mEventEditor->geometry().x();
2820 y = mEventEditor->geometry().y(); 2821 y = mEventEditor->geometry().y();
2821 w = mEventEditor->width(); 2822 w = mEventEditor->width();
2822 h = mEventEditor->height(); 2823 h = mEventEditor->height();
2823 mEventEditor->show(); 2824 mEventEditor->show();
2824 mEventEditor->setGeometry(x,y,w,h); 2825 mEventEditor->setGeometry(x,y,w,h);
2825#else 2826#else
2826 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 2827 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
2827 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 2828 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2828 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 2829 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
2829 qApp->processEvents(); 2830 qApp->processEvents();
2830 delete mEventEditor; 2831 delete mEventEditor;
2831 mEventEditor = mDialogManager->getEventEditor(); 2832 mEventEditor = mDialogManager->getEventEditor();
2832 topLevelWidget()->setCaption( i18n("") ); 2833 topLevelWidget()->setCaption( i18n("") );
2833 } 2834 }
2834 mEventEditor->showMaximized(); 2835 mEventEditor->showMaximized();
2835#endif 2836#endif
2836} 2837}
2837void CalendarView::showTodoEditor() 2838void CalendarView::showTodoEditor()
2838{ 2839{
2839#ifdef DESKTOP_VERSION 2840#ifdef DESKTOP_VERSION
2840 int x,y,w,h; 2841 int x,y,w,h;
2841 x = mTodoEditor->geometry().x(); 2842 x = mTodoEditor->geometry().x();
2842 y = mTodoEditor->geometry().y(); 2843 y = mTodoEditor->geometry().y();
2843 w = mTodoEditor->width(); 2844 w = mTodoEditor->width();
2844 h = mTodoEditor->height(); 2845 h = mTodoEditor->height();
2845 mTodoEditor->show(); 2846 mTodoEditor->show();
2846 mTodoEditor->setGeometry(x,y,w,h); 2847 mTodoEditor->setGeometry(x,y,w,h);
2847#else 2848#else
2848 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 2849 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
2849 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 2850 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2850 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 2851 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
2851 qApp->processEvents(); 2852 qApp->processEvents();
2852 delete mTodoEditor; 2853 delete mTodoEditor;
2853 mTodoEditor = mDialogManager->getTodoEditor(); 2854 mTodoEditor = mDialogManager->getTodoEditor();
2854 topLevelWidget()->setCaption( i18n("") ); 2855 topLevelWidget()->setCaption( i18n("") );
2855 } 2856 }
2856 mTodoEditor->showMaximized(); 2857 mTodoEditor->showMaximized();
2857#endif 2858#endif
2858} 2859}
2859 2860
2860void CalendarView::cloneIncidence() 2861void CalendarView::cloneIncidence()
2861{ 2862{
2862 Incidence *incidence = currentSelection(); 2863 Incidence *incidence = currentSelection();
2863 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2864 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2864 if ( incidence ) { 2865 if ( incidence ) {
2865 cloneIncidence(incidence); 2866 cloneIncidence(incidence);
2866 } 2867 }
2867} 2868}
2868void CalendarView::moveIncidence() 2869void CalendarView::moveIncidence()
2869{ 2870{
2870 Incidence *incidence = currentSelection(); 2871 Incidence *incidence = currentSelection();
2871 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2872 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2872 if ( incidence ) { 2873 if ( incidence ) {
2873 moveIncidence(incidence); 2874 moveIncidence(incidence);
2874 } 2875 }
2875} 2876}
2876void CalendarView::beamIncidence() 2877void CalendarView::beamIncidence()
2877{ 2878{
2878 Incidence *incidence = currentSelection(); 2879 Incidence *incidence = currentSelection();
2879 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2880 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2880 if ( incidence ) { 2881 if ( incidence ) {
2881 beamIncidence(incidence); 2882 beamIncidence(incidence);
2882 } 2883 }
2883} 2884}
2884void CalendarView::toggleCancelIncidence() 2885void CalendarView::toggleCancelIncidence()
2885{ 2886{
2886 Incidence *incidence = currentSelection(); 2887 Incidence *incidence = currentSelection();
2887 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2888 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2888 if ( incidence ) { 2889 if ( incidence ) {
2889 cancelIncidence(incidence); 2890 cancelIncidence(incidence);
2890 } 2891 }
2891} 2892}
2892 2893
2893 2894
2894void CalendarView::cancelIncidence(Incidence * inc ) 2895void CalendarView::cancelIncidence(Incidence * inc )
2895{ 2896{
2896 inc->setCancelled( ! inc->cancelled() ); 2897 inc->setCancelled( ! inc->cancelled() );
2897 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 2898 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
2898 updateView(); 2899 updateView();
2899} 2900}
2900void CalendarView::cloneIncidence(Incidence * orgInc ) 2901void CalendarView::cloneIncidence(Incidence * orgInc )
2901{ 2902{
2902 Incidence * newInc = orgInc->clone(); 2903 Incidence * newInc = orgInc->clone();
2903 newInc->recreate(); 2904 newInc->recreate();
2904 2905
2905 if ( newInc->typeID() == todoID ) { 2906 if ( newInc->typeID() == todoID ) {
2906 Todo* t = (Todo*) newInc; 2907 Todo* t = (Todo*) newInc;
2907 bool cloneSub = false; 2908 bool cloneSub = false;
2908 if ( orgInc->relations().count() ) { 2909 if ( orgInc->relations().count() ) {
2909 int result = KMessageBox::warningYesNoCancel(this, 2910 int result = KMessageBox::warningYesNoCancel(this,
2910 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), 2911 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ),
2911 i18n("Todo has subtodos"), 2912 i18n("Todo has subtodos"),
2912 i18n("Yes"), 2913 i18n("Yes"),
2913 i18n("No")); 2914 i18n("No"));
2914 2915
2915 if ( result == KMessageBox::Cancel ) { 2916 if ( result == KMessageBox::Cancel ) {
2916 delete t; 2917 delete t;
2917 return; 2918 return;
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index aa30c52..3dfa344 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -1,368 +1,355 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2001 4 Copyright (c) 2001
5 Cornelius Schumacher <schumacher@kde.org> 5 Cornelius Schumacher <schumacher@kde.org>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <libkdepim/categoryeditdialog.h> 22#include <libkdepim/categoryeditdialog.h>
23 23
24#include "calendarview.h" 24#include "calendarview.h"
25#include "incomingdialog.h" 25#include "incomingdialog.h"
26#include "outgoingdialog.h" 26#include "outgoingdialog.h"
27#include "koprefsdialog.h" 27#include "koprefsdialog.h"
28#include "koeventeditor.h" 28#include "koeventeditor.h"
29#include "koprefs.h" 29#include "koprefs.h"
30#include "datenavigator.h" 30#include "datenavigator.h"
31#include "kotodoeditor.h" 31#include "kotodoeditor.h"
32#include "searchdialog.h" 32#include "searchdialog.h"
33#include "filtereditdialog.h" 33#include "filtereditdialog.h"
34#ifndef KORG_NOPLUGINS 34#ifndef KORG_NOPLUGINS
35#include "plugindialog.h" 35#include "plugindialog.h"
36#endif 36#endif
37#ifndef KORG_NOARCHIVE 37#ifndef KORG_NOARCHIVE
38#include "archivedialog.h" 38#include "archivedialog.h"
39#endif 39#endif
40 40
41#include "kconfig.h" 41#include "kconfig.h"
42#include "kodialogmanager.h" 42#include "kodialogmanager.h"
43#include <kapplication.h> 43#include <kapplication.h>
44 44
45KODialogManager::KODialogManager( CalendarView *mainView ) : 45KODialogManager::KODialogManager( CalendarView *mainView ) :
46 QObject(), mMainView( mainView ) 46 QObject(), mMainView( mainView )
47{ 47{
48 mOutgoingDialog = 0; 48 mOutgoingDialog = 0;
49 mIncomingDialog = 0; 49 mIncomingDialog = 0;
50 mOptionsDialog = 0; 50 mOptionsDialog = 0;
51 mSearchDialog = 0; 51 mSearchDialog = 0;
52 mArchiveDialog = 0; 52 mArchiveDialog = 0;
53 mFilterEditDialog = 0; 53 mFilterEditDialog = 0;
54 mPluginDialog = 0; 54 mPluginDialog = 0;
55 55
56 // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); 56 // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView);
57 //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); 57 //KOGlobals::fitDialogToScreen( mCategoryEditDialog );
58} 58}
59 59
60KODialogManager::~KODialogManager() 60KODialogManager::~KODialogManager()
61{ 61{
62 delete mOutgoingDialog; 62 delete mOutgoingDialog;
63 delete mIncomingDialog; 63 delete mIncomingDialog;
64 delete mOptionsDialog; 64 delete mOptionsDialog;
65 delete mSearchDialog; 65 delete mSearchDialog;
66#ifndef KORG_NOARCHIVE 66#ifndef KORG_NOARCHIVE
67 delete mArchiveDialog; 67 delete mArchiveDialog;
68#endif 68#endif
69 delete mFilterEditDialog; 69 delete mFilterEditDialog;
70#ifndef KORG_NOPLUGINS 70#ifndef KORG_NOPLUGINS
71 delete mPluginDialog; 71 delete mPluginDialog;
72#endif 72#endif
73} 73}
74 74
75OutgoingDialog *KODialogManager::outgoingDialog() 75OutgoingDialog *KODialogManager::outgoingDialog()
76{ 76{
77 createOutgoingDialog(); 77 createOutgoingDialog();
78 return mOutgoingDialog; 78 return mOutgoingDialog;
79} 79}
80 80
81void KODialogManager::createOutgoingDialog() 81void KODialogManager::createOutgoingDialog()
82{ 82{
83 if (!mOutgoingDialog) { 83 if (!mOutgoingDialog) {
84 mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); 84 mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView);
85 if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); 85 if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog);
86 connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), 86 connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)),
87 mMainView,SIGNAL(numOutgoingChanged(int))); 87 mMainView,SIGNAL(numOutgoingChanged(int)));
88 } 88 }
89} 89}
90 90
91void KODialogManager::showGlobalOptionsDialog( bool showSync ) 91void KODialogManager::showGlobalOptionsDialog( bool showSync )
92{ 92{
93 if (!mOptionsDialog) { 93 KPimPrefsGlobalDialog gc ( mMainView );
94 mOptionsDialog = new KOPrefsDialog(0); 94 if ( showSync )
95 connect(mOptionsDialog,SIGNAL(configChanged()), 95 gc.showTZconfig();
96 mMainView,SLOT(updateConfig())); 96 gc.exec();
97 }
98 mOptionsDialog->readConfig();
99#ifndef DESKTOP_VERSION
100 mOptionsDialog->showMaximized();
101#else
102 mOptionsDialog->show();
103#endif
104 if ( showSync )
105 mOptionsDialog->showSyncPage();
106 mOptionsDialog->exec();
107 delete mOptionsDialog;
108 mOptionsDialog = 0;
109} 97}
110void KODialogManager::showOptionsDialog( bool showSync ) 98void KODialogManager::showOptionsDialog( bool showSync )
111{ 99{
112 100
113 if (!mOptionsDialog) { 101 if (!mOptionsDialog) {
114 mOptionsDialog = new KOPrefsDialog(mMainView); 102 mOptionsDialog = new KOPrefsDialog(mMainView);
115 connect(mOptionsDialog,SIGNAL(configChanged()), 103 connect(mOptionsDialog,SIGNAL(configChanged()),
116 mMainView,SLOT(updateConfig())); 104 mMainView,SLOT(updateConfig()));
117 } 105 }
118 mOptionsDialog->readConfig(); 106 mOptionsDialog->readConfig();
119#ifndef DESKTOP_VERSION 107#ifndef DESKTOP_VERSION
120 mOptionsDialog->showMaximized(); 108 mOptionsDialog->showMaximized();
121#else 109#else
122 mOptionsDialog->show(); 110 mOptionsDialog->show();
123#endif 111#endif
124 if ( showSync ) 112
125 mOptionsDialog->showSyncPage();
126 mOptionsDialog->exec(); 113 mOptionsDialog->exec();
127 delete mOptionsDialog; 114 delete mOptionsDialog;
128 mOptionsDialog = 0; 115 mOptionsDialog = 0;
129} 116}
130void KODialogManager::showSyncOptions() 117void KODialogManager::showSyncOptions()
131{ 118{
132 showGlobalOptionsDialog( true ); 119 showGlobalOptionsDialog( true );
133 120
134} 121}
135void KODialogManager::showOutgoingDialog() 122void KODialogManager::showOutgoingDialog()
136{ 123{
137 createOutgoingDialog(); 124 createOutgoingDialog();
138 mOutgoingDialog->show(); 125 mOutgoingDialog->show();
139 mOutgoingDialog->raise(); 126 mOutgoingDialog->raise();
140} 127}
141 128
142IncomingDialog *KODialogManager::incomingDialog() 129IncomingDialog *KODialogManager::incomingDialog()
143{ 130{
144 createOutgoingDialog(); 131 createOutgoingDialog();
145 if (!mIncomingDialog) { 132 if (!mIncomingDialog) {
146 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 133 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
147 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 134 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
148 mMainView,SIGNAL(numIncomingChanged(int))); 135 mMainView,SIGNAL(numIncomingChanged(int)));
149 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 136 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
150 mMainView,SLOT(updateView())); 137 mMainView,SLOT(updateView()));
151 } 138 }
152 return mIncomingDialog; 139 return mIncomingDialog;
153} 140}
154 141
155void KODialogManager::createIncomingDialog() 142void KODialogManager::createIncomingDialog()
156{ 143{
157 createOutgoingDialog(); 144 createOutgoingDialog();
158 if (!mIncomingDialog) { 145 if (!mIncomingDialog) {
159 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 146 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
160 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 147 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
161 mMainView,SIGNAL(numIncomingChanged(int))); 148 mMainView,SIGNAL(numIncomingChanged(int)));
162 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 149 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
163 mMainView,SLOT(updateView())); 150 mMainView,SLOT(updateView()));
164 } 151 }
165} 152}
166 153
167void KODialogManager::showIncomingDialog() 154void KODialogManager::showIncomingDialog()
168{ 155{
169 createIncomingDialog(); 156 createIncomingDialog();
170 mIncomingDialog->show(); 157 mIncomingDialog->show();
171 mIncomingDialog->raise(); 158 mIncomingDialog->raise();
172} 159}
173/* 160/*
174void KODialogManager::showCategoryEditDialog() 161void KODialogManager::showCategoryEditDialog()
175{ 162{
176 mCategoryEditDialog->show(); 163 mCategoryEditDialog->show();
177} 164}
178*/ 165*/
179void KODialogManager::hideSearchDialog() 166void KODialogManager::hideSearchDialog()
180{ 167{
181 if (mSearchDialog) 168 if (mSearchDialog)
182 mSearchDialog->hide(); 169 mSearchDialog->hide();
183} 170}
184 171
185void KODialogManager::showSearchDialog() 172void KODialogManager::showSearchDialog()
186{ 173{
187 if (!mSearchDialog) { 174 if (!mSearchDialog) {
188 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); 175 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView);
189 KOListView * lview = mSearchDialog->listview(); 176 KOListView * lview = mSearchDialog->listview();
190 177
191 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), 178 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)),
192 mMainView, SLOT(showIncidence(Incidence *))); 179 mMainView, SLOT(showIncidence(Incidence *)));
193 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), 180 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)),
194 mMainView, SLOT(editIncidence(Incidence *))); 181 mMainView, SLOT(editIncidence(Incidence *)));
195 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), 182 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)),
196 mMainView, SLOT(deleteIncidence(Incidence *))); 183 mMainView, SLOT(deleteIncidence(Incidence *)));
197 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), 184 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)),
198 mMainView, SLOT(cloneIncidence(Incidence *))); 185 mMainView, SLOT(cloneIncidence(Incidence *)));
199 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), 186 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)),
200 mMainView, SLOT(beamIncidence(Incidence *))); 187 mMainView, SLOT(beamIncidence(Incidence *)));
201 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), 188 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)),
202 mMainView, SLOT(moveIncidence(Incidence *))); 189 mMainView, SLOT(moveIncidence(Incidence *)));
203 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), 190 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )),
204 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); 191 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> )));
205 192
206 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); 193 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig()));
207 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); 194 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList()));
208 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), 195 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ),
209 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 196 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
210#ifndef DESKTOP_VERSION 197#ifndef DESKTOP_VERSION
211 mSearchDialog->setMaximumSize( QApplication::desktop()->size()); 198 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
212 mSearchDialog->showMaximized(); 199 mSearchDialog->showMaximized();
213#else 200#else
214 KConfig *config = KOGlobals::config(); 201 KConfig *config = KOGlobals::config();
215 config->setGroup("WidgetLayout"); 202 config->setGroup("WidgetLayout");
216 QStringList list; 203 QStringList list;
217 list = config->readListEntry("SearchLayout"); 204 list = config->readListEntry("SearchLayout");
218 int x,y,w,h; 205 int x,y,w,h;
219 if ( ! list.isEmpty() ) { 206 if ( ! list.isEmpty() ) {
220 x = list[0].toInt(); 207 x = list[0].toInt();
221 y = list[1].toInt(); 208 y = list[1].toInt();
222 w = list[2].toInt(); 209 w = list[2].toInt();
223 h = list[3].toInt(); 210 h = list[3].toInt();
224 KApplication::testCoords( &x,&y,&w,&h ); 211 KApplication::testCoords( &x,&y,&w,&h );
225 mSearchDialog->setGeometry(x,y,w,h); 212 mSearchDialog->setGeometry(x,y,w,h);
226 213
227 } 214 }
228 215
229#endif 216#endif
230 } 217 }
231 // make sure the widget is on top again 218 // make sure the widget is on top again
232#ifdef DESKTOP_VERSION 219#ifdef DESKTOP_VERSION
233 mSearchDialog->show(); 220 mSearchDialog->show();
234#else 221#else
235 mSearchDialog->setMaximumSize( QApplication::desktop()->size()); 222 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
236 mSearchDialog->showMaximized(); 223 mSearchDialog->showMaximized();
237#endif 224#endif
238 mSearchDialog->raiseAndSelect(); 225 mSearchDialog->raiseAndSelect();
239} 226}
240 227
241SearchDialog * KODialogManager::getSearchDialog() 228SearchDialog * KODialogManager::getSearchDialog()
242{ 229{
243 return mSearchDialog; 230 return mSearchDialog;
244} 231}
245void KODialogManager::showArchiveDialog() 232void KODialogManager::showArchiveDialog()
246{ 233{
247#ifndef KORG_NOARCHIVE 234#ifndef KORG_NOARCHIVE
248 if (!mArchiveDialog) { 235 if (!mArchiveDialog) {
249 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); 236 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView);
250 connect(mArchiveDialog,SIGNAL(eventsDeleted()), 237 connect(mArchiveDialog,SIGNAL(eventsDeleted()),
251 mMainView,SLOT(updateView())); 238 mMainView,SLOT(updateView()));
252 } 239 }
253 mArchiveDialog->show(); 240 mArchiveDialog->show();
254 mArchiveDialog->raise(); 241 mArchiveDialog->raise();
255 242
256 // Workaround. 243 // Workaround.
257 QApplication::restoreOverrideCursor(); 244 QApplication::restoreOverrideCursor();
258#endif 245#endif
259} 246}
260 247
261void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) 248void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters)
262{ 249{
263 if (!mFilterEditDialog) { 250 if (!mFilterEditDialog) {
264 mFilterEditDialog = new FilterEditDialog(filters,mMainView); 251 mFilterEditDialog = new FilterEditDialog(filters,mMainView);
265 connect(mFilterEditDialog,SIGNAL(filterChanged()), 252 connect(mFilterEditDialog,SIGNAL(filterChanged()),
266 mMainView,SLOT(filterEdited())); 253 mMainView,SLOT(filterEdited()));
267 254
268 } 255 }
269 256
270#ifndef DESKTOP_VERSION 257#ifndef DESKTOP_VERSION
271 mFilterEditDialog->showMaximized(); 258 mFilterEditDialog->showMaximized();
272#else 259#else
273 mFilterEditDialog->show(); 260 mFilterEditDialog->show();
274#endif 261#endif
275 mFilterEditDialog->raise(); 262 mFilterEditDialog->raise();
276} 263}
277 264
278void KODialogManager::showPluginDialog() 265void KODialogManager::showPluginDialog()
279{ 266{
280#ifndef KORG_NOPLUGINS 267#ifndef KORG_NOPLUGINS
281 if (!mPluginDialog) { 268 if (!mPluginDialog) {
282 mPluginDialog = new PluginDialog(mMainView); 269 mPluginDialog = new PluginDialog(mMainView);
283 connect(mPluginDialog,SIGNAL(configChanged()), 270 connect(mPluginDialog,SIGNAL(configChanged()),
284 mMainView,SLOT(updateConfig())); 271 mMainView,SLOT(updateConfig()));
285 } 272 }
286 mPluginDialog->show(); 273 mPluginDialog->show();
287 mPluginDialog->raise(); 274 mPluginDialog->raise();
288#endif 275#endif
289} 276}
290 277
291KOEventEditor *KODialogManager::getEventEditor() 278KOEventEditor *KODialogManager::getEventEditor()
292{ 279{
293 KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), 280 KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(),
294 mMainView ); 281 mMainView );
295 282
296 connect(eventEditor,SIGNAL(eventAdded(Event *)), 283 connect(eventEditor,SIGNAL(eventAdded(Event *)),
297 mMainView,SLOT(eventAdded(Event *))); 284 mMainView,SLOT(eventAdded(Event *)));
298 connect(eventEditor,SIGNAL(eventChanged(Event *)), 285 connect(eventEditor,SIGNAL(eventChanged(Event *)),
299 mMainView,SLOT(eventChanged(Event *))); 286 mMainView,SLOT(eventChanged(Event *)));
300 connect(eventEditor,SIGNAL(eventDeleted()), 287 connect(eventEditor,SIGNAL(eventDeleted()),
301 mMainView,SLOT(eventDeleted())); 288 mMainView,SLOT(eventDeleted()));
302 connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), 289 connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)),
303 mMainView,SLOT(schedule_cancel(Incidence *))); 290 mMainView,SLOT(schedule_cancel(Incidence *)));
304 connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), 291 connect( eventEditor, SIGNAL(jumpToTime( const QDate &)),
305 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 292 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
306 connect( eventEditor, SIGNAL( showAgendaView( bool)), 293 connect( eventEditor, SIGNAL( showAgendaView( bool)),
307 mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); 294 mMainView->viewManager(), SLOT( showAgendaView( bool) ) );
308 295
309 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), 296 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
310 // eventEditor,SLOT(updateCategoryConfig())); 297 // eventEditor,SLOT(updateCategoryConfig()));
311 // connect(eventEditor,SIGNAL(editCategories()), 298 // connect(eventEditor,SIGNAL(editCategories()),
312 // mCategoryEditDialog,SLOT(show())); 299 // mCategoryEditDialog,SLOT(show()));
313 connect(eventEditor,SIGNAL(dialogClose(Incidence*)), 300 connect(eventEditor,SIGNAL(dialogClose(Incidence*)),
314 mMainView,SLOT(dialogClosing(Incidence*))); 301 mMainView,SLOT(dialogClosing(Incidence*)));
315 302
316 //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); 303 //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject()));
317 304
318#ifndef DESKTOP_VERSION 305#ifndef DESKTOP_VERSION
319 eventEditor->resize( QApplication::desktop()->width() -20, 100 ); 306 eventEditor->resize( QApplication::desktop()->width() -20, 100 );
320#endif 307#endif
321 return eventEditor; 308 return eventEditor;
322} 309}
323 310
324KOTodoEditor *KODialogManager::getTodoEditor() 311KOTodoEditor *KODialogManager::getTodoEditor()
325{ 312{
326 KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), 313 KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(),
327 mMainView ); 314 mMainView );
328 315
329 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), 316 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
330 // todoEditor,SLOT(updateCategoryConfig())); 317 // todoEditor,SLOT(updateCategoryConfig()));
331 // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); 318 // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show()));
332 319
333 connect(todoEditor,SIGNAL(todoAdded(Todo *)), 320 connect(todoEditor,SIGNAL(todoAdded(Todo *)),
334 mMainView,SLOT(todoAdded(Todo *))); 321 mMainView,SLOT(todoAdded(Todo *)));
335 connect(todoEditor,SIGNAL(todoChanged(Todo *)), 322 connect(todoEditor,SIGNAL(todoChanged(Todo *)),
336 mMainView,SLOT(todoChanged(Todo *))); 323 mMainView,SLOT(todoChanged(Todo *)));
337 connect(todoEditor,SIGNAL(todoDeleted()), 324 connect(todoEditor,SIGNAL(todoDeleted()),
338 mMainView,SLOT(todoDeleted())); 325 mMainView,SLOT(todoDeleted()));
339 connect(todoEditor,SIGNAL(dialogClose(Incidence*)), 326 connect(todoEditor,SIGNAL(dialogClose(Incidence*)),
340 mMainView,SLOT(dialogClosing(Incidence*))); 327 mMainView,SLOT(dialogClosing(Incidence*)));
341 connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), 328 connect( todoEditor, SIGNAL(jumpToTime( const QDate &)),
342 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 329 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
343 connect( todoEditor, SIGNAL( showAgendaView( bool)), 330 connect( todoEditor, SIGNAL( showAgendaView( bool)),
344 mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); 331 mMainView->viewManager(), SLOT( showAgendaView( bool) ) );
345 // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), 332 // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)),
346 // mMainView,SLOT(schedule_cancel(Incidence *))); 333 // mMainView,SLOT(schedule_cancel(Incidence *)));
347 //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); 334 //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject()));
348#ifndef DESKTOP_VERSION 335#ifndef DESKTOP_VERSION
349 todoEditor->resize( QApplication::desktop()->width() -20, 100 ); 336 todoEditor->resize( QApplication::desktop()->width() -20, 100 );
350#endif 337#endif
351 return todoEditor; 338 return todoEditor;
352} 339}
353 340
354void KODialogManager::updateSearchDialog() 341void KODialogManager::updateSearchDialog()
355{ 342{
356 if (mSearchDialog) mSearchDialog->updateView(); 343 if (mSearchDialog) mSearchDialog->updateView();
357} 344}
358 345
359void KODialogManager::setDocumentId( const QString &id ) 346void KODialogManager::setDocumentId( const QString &id )
360{ 347{
361 if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id ); 348 if (mOutgoingDialog) mOutgoingDialog->setDocumentId( id );
362} 349}
363 350
364void KODialogManager::writeSettings( KConfig *config ) 351void KODialogManager::writeSettings( KConfig *config )
365{ 352{
366 if (mSearchDialog) 353 if (mSearchDialog)
367 mSearchDialog->listview()->writeSettings(config,"SearchListView Layout"); 354 mSearchDialog->listview()->writeSettings(config,"SearchListView Layout");
368} 355}
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 4b5b66a..b782bb1 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,723 +1,619 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kglobalsettings.h> 56#include <kglobalsettings.h>
57 57
58#include <kurlrequester.h> 58#include <kurlrequester.h>
59#include <klineedit.h> 59#include <klineedit.h>
60 60
61#if defined(USE_SOLARIS) 61#if defined(USE_SOLARIS)
62#include <sys/param.h> 62#include <sys/param.h>
63 63
64#define ZONEINFODIR "/usr/share/lib/zoneinfo" 64#define ZONEINFODIR "/usr/share/lib/zoneinfo"
65#define INITFILE "/etc/default/init" 65#define INITFILE "/etc/default/init"
66#endif 66#endif
67 67
68#include "koprefs.h" 68#include "koprefs.h"
69 69
70#include "koprefsdialog.h" 70#include "koprefsdialog.h"
71#include "kpimglobalprefs.h" 71#include "kpimglobalprefs.h"
72 72
73 73
74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
75 KPrefsDialog(KOPrefs::instance(),parent,name,true) 75 KPrefsDialog(KOPrefs::instance(),parent,name,true)
76{ 76{
77 77
78 setFont( KGlobalSettings::generalMaxFont() ); 78 setFont( KGlobalSettings::generalMaxFont() );
79 setCaption( i18n("Preferences - some settings need a restart (nr)")); 79 setCaption( i18n("Preferences - some settings need a restart (nr)"));
80 mCategoryDict.setAutoDelete(true); 80 mCategoryDict.setAutoDelete(true);
81 81
82 KGlobal::locale()->insertCatalogue("timezones"); 82 KGlobal::locale()->insertCatalogue("timezones");
83 mSpacingHint = spacingHintSmall(); 83 mSpacingHint = spacingHintSmall();
84 mMarginHint = marginHintSmall(); 84 mMarginHint = marginHintSmall();
85#ifndef DESKTOP_VERSION 85#ifndef DESKTOP_VERSION
86 if ( QApplication::desktop()->height() == 480 ) 86 if ( QApplication::desktop()->height() == 480 )
87 hideButtons(); 87 hideButtons();
88#endif 88#endif
89 kdelibcfg = 0; 89
90 if ( !parent )
91 setupGlobalTab();
92 else {
93 setupMainTab(); 90 setupMainTab();
94 // setupLocaleTab(); 91 // setupLocaleTab();
95 //setupTimeZoneTab(); 92 //setupTimeZoneTab();
96 setupTimeTab(); 93 setupTimeTab();
97 //setupLocaleDateTab(); 94 //setupLocaleDateTab();
98 setupFontsTab(); 95 setupFontsTab();
99 setupColorsTab(); 96 setupColorsTab();
100 setupViewsTab(); 97 setupViewsTab();
101 //setupSyncTab(); 98 //setupSyncTab();
102 //setupSyncAlgTab(); 99 //setupSyncAlgTab();
103 //setupPrinterTab(); 100 //setupPrinterTab();
104 //setupGroupSchedulingTab(); 101 //setupGroupSchedulingTab();
105 //setupGroupAutomationTab(); 102 //setupGroupAutomationTab();
106 } 103
107 104
108} 105}
109 106
110 107
111KOPrefsDialog::~KOPrefsDialog() 108KOPrefsDialog::~KOPrefsDialog()
112{ 109{
113} 110}
114void KOPrefsDialog::setupGlobalTab() 111void KOPrefsDialog::setupGlobalTab()
115{ 112{
116 //QFrame *topFrame = addPage(i18n("Global"),0,0); 113
117 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" );
118 setMainWidget( kdelibcfg );
119 setCaption( i18n("KDE-Pim Global Settings"));
120
121 114
122} 115}
123void KOPrefsDialog::setupLocaleDateTab() 116void KOPrefsDialog::setupLocaleDateTab()
124{ 117{
125#if 0 118#if 0
126QFrame *topFrame = addPage(i18n("Date Format"),0,0); 119QFrame *topFrame = addPage(i18n("Date Format"),0,0);
127 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
128 topLayout->setSpacing(mSpacingHint); 121 topLayout->setSpacing(mSpacingHint);
129 topLayout->setMargin(mMarginHint); 122 topLayout->setMargin(mMarginHint);
130 int iii = 0; 123 int iii = 0;
131 124
132 125
133 KPrefsDialogWidRadios *syncPrefsGroup = 126 KPrefsDialogWidRadios *syncPrefsGroup =
134 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
135 QString format; 128 QString format;
136 if ( QApplication::desktop()->width() < 480 ) 129 if ( QApplication::desktop()->width() < 480 )
137 format = "(%d.%m.%Y)"; 130 format = "(%d.%m.%Y)";
138 else 131 else
139 format = "(%d.%m.%Y|%A %d %B %Y)"; 132 format = "(%d.%m.%Y|%A %d %B %Y)";
140 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
141 if ( QApplication::desktop()->width() < 480 ) 134 if ( QApplication::desktop()->width() < 480 )
142 format = "(%m.%d.%Y)"; 135 format = "(%m.%d.%Y)";
143 else 136 else
144 format = "(%m.%d.%Y|%A %B %d %Y)"; 137 format = "(%m.%d.%Y|%A %B %d %Y)";
145 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
146 if ( QApplication::desktop()->width() < 480 ) 139 if ( QApplication::desktop()->width() < 480 )
147 format = "(%Y-%m-%d)"; 140 format = "(%Y-%m-%d)";
148 else 141 else
149 format = "(%Y-%m-%d|%A %Y %B %d)"; 142 format = "(%Y-%m-%d|%A %Y %B %d)";
150 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
151 syncPrefsGroup->addRadio(i18n("User defined")); 144 syncPrefsGroup->addRadio(i18n("User defined"));
152 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
153 ++iii; 146 ++iii;
154 ++iii; 147 ++iii;
155 QLabel * lab; 148 QLabel * lab;
156 mUserDateFormatLong = new QLineEdit(topFrame); 149 mUserDateFormatLong = new QLineEdit(topFrame);
157 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
158 topLayout->addWidget(lab ,iii,0); 151 topLayout->addWidget(lab ,iii,0);
159 topLayout->addWidget(mUserDateFormatLong,iii,1); 152 topLayout->addWidget(mUserDateFormatLong,iii,1);
160 ++iii; 153 ++iii;
161 mUserDateFormatShort = new QLineEdit(topFrame); 154 mUserDateFormatShort = new QLineEdit(topFrame);
162 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
163 topLayout->addWidget(lab ,iii,0); 156 topLayout->addWidget(lab ,iii,0);
164 topLayout->addWidget(mUserDateFormatShort,iii,1); 157 topLayout->addWidget(mUserDateFormatShort,iii,1);
165 ++iii; 158 ++iii;
166 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
167 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
168 ++iii; 161 ++iii;
169 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
170 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
171 ++iii; 164 ++iii;
172 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
173 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
174 ++iii; 167 ++iii;
175#endif 168#endif
176 169
177} 170}
178 171
179void KOPrefsDialog::setupLocaleTab() 172void KOPrefsDialog::setupLocaleTab()
180{ 173{
181#if 0 174#if 0
182 QFrame *topFrame = addPage(i18n("Locale"),0,0); 175 QFrame *topFrame = addPage(i18n("Locale"),0,0);
183 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
184 topLayout->setSpacing(mSpacingHint); 177 topLayout->setSpacing(mSpacingHint);
185 topLayout->setMargin(mMarginHint); 178 topLayout->setMargin(mMarginHint);
186 int iii = 0; 179 int iii = 0;
187 KPrefsDialogWidRadios *syncPrefsGroup = 180 KPrefsDialogWidRadios *syncPrefsGroup =
188 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
189 syncPrefsGroup->addRadio(i18n("English")); 182 syncPrefsGroup->addRadio(i18n("English"));
190 syncPrefsGroup->addRadio(i18n("German")); 183 syncPrefsGroup->addRadio(i18n("German"));
191 syncPrefsGroup->addRadio(i18n("French")); 184 syncPrefsGroup->addRadio(i18n("French"));
192 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
193 if ( QApplication::desktop()->width() < 300 ) 186 if ( QApplication::desktop()->width() < 300 )
194 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
195 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
196 ++iii; 189 ++iii;
197 190
198 syncPrefsGroup = 191 syncPrefsGroup =
199 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
200 if ( QApplication::desktop()->width() > 300 ) 193 if ( QApplication::desktop()->width() > 300 )
201 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
202 syncPrefsGroup->addRadio(i18n("24:00")); 195 syncPrefsGroup->addRadio(i18n("24:00"));
203 syncPrefsGroup->addRadio(i18n("12:00am")); 196 syncPrefsGroup->addRadio(i18n("12:00am"));
204 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
205 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
206 ++iii; 199 ++iii;
207 KPrefsDialogWidBool *sb; 200 KPrefsDialogWidBool *sb;
208 if ( QApplication::desktop()->width() < 300 ) { 201 if ( QApplication::desktop()->width() < 300 ) {
209 sb = 202 sb =
210 addWidBool(i18n("Week starts on Sunday"), 203 addWidBool(i18n("Week starts on Sunday"),
211 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
212 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
213 ++iii; 206 ++iii;
214 sb = 207 sb =
215 addWidBool(i18n("Use short date in (WN/E) view"), 208 addWidBool(i18n("Use short date in (WN/E) view"),
216 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 209 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
217 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
218 } 211 }
219 else { 212 else {
220 QWidget * hb = new QWidget( topFrame ); 213 QWidget * hb = new QWidget( topFrame );
221 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 214 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
222 sb = 215 sb =
223 addWidBool(i18n("Week starts on Sunday"), 216 addWidBool(i18n("Week starts on Sunday"),
224 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
225 hbLayout->addWidget(sb->checkBox() ); 218 hbLayout->addWidget(sb->checkBox() );
226 sb = 219 sb =
227 addWidBool(i18n("Use short date in (WN/E) view"), 220 addWidBool(i18n("Use short date in (WN/E) view"),
228 &(KOPrefs::instance()->mShortDateInViewer),hb); 221 &(KOPrefs::instance()->mShortDateInViewer),hb);
229 hbLayout->addWidget(sb->checkBox() ); 222 hbLayout->addWidget(sb->checkBox() );
230 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 223 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
231 224
232 } 225 }
233 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
234#if 0 227#if 0
235 ++iii; 228 ++iii;
236 sb = 229 sb =
237 addWidBool(i18n("Quick load/save (w/o Unicode)"), 230 addWidBool(i18n("Quick load/save (w/o Unicode)"),
238 &(KOPrefs::instance()->mUseQuicksave),topFrame); 231 &(KOPrefs::instance()->mUseQuicksave),topFrame);
239 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
240#endif 233#endif
241#endif 234#endif
242} 235}
243void KOPrefsDialog::showSyncPage()
244{
245 // showPage ( 0 ) ;
246 kdelibcfg->showTimeZoneTab() ;
247
248}
249void KOPrefsDialog::setupSyncAlgTab()
250{
251#if 0
252 QLabel * lab;
253 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
254 mSetupSyncAlgTab = topFrame;
255 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
256 topLayout->setSpacing(mSpacingHint);
257 topLayout->setMargin(mMarginHint);
258 int iii = 0;
259
260 KPrefsDialogWidBool *sb =
261 addWidBool(i18n("Ask for preferences before syncing"),
262 &(KOPrefs::instance()->mAskForPreferences),topFrame);
263 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
264
265 ++iii;
266
267 KPrefsDialogWidRadios *syncPrefsGroup =
268 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
269 topFrame);
270 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
271 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
272 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
273 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
274 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
275 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
276 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
277 ++iii;
278 sb =
279 addWidBool(i18n("Show summary after syncing"),
280 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
281 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
282
283 ++iii;
284#endif
285
286
287
288}
289
290
291void KOPrefsDialog::setupSyncTab()
292{
293#if 0
294 QLabel * lab;
295 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
296 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
297 topLayout->setSpacing(mSpacingHint);
298 topLayout->setMargin(mMarginHint);
299 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
300 int iii = 0;
301 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
302 ++iii;
303
304 mRemoteIPEdit = new QLineEdit(topFrame);
305 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
306 topLayout->addWidget(lab ,iii,0);
307 topLayout->addWidget(mRemoteIPEdit,iii,1);
308 ++iii;
309 mRemoteUser = new QLineEdit(topFrame);
310 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
311 topLayout->addWidget(lab ,iii,0);
312 topLayout->addWidget(mRemoteUser, iii,1);
313 ++iii;
314
315 mRemoteFile = new QLineEdit(topFrame);
316 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
317 topLayout->addWidget(lab ,iii,0);
318 topLayout->addWidget(mRemoteFile,iii,1);
319 ++iii;
320
321 mLocalTempFile = new QLineEdit(topFrame);
322 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
323 topLayout->addWidget(lab ,iii,0);
324 topLayout->addWidget(mLocalTempFile,iii,1);
325 ++iii;
326
327 KPrefsDialogWidBool *wb =
328 addWidBool(i18n("Write back synced file"),
329 &(KOPrefs::instance()->mWriteBackFile),topFrame);
330 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
331 ++iii;
332 wb =
333 addWidBool(i18n("Write back existing entries only"),
334 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
335 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
336 ++iii;
337
338#endif
339}
340 236
341void KOPrefsDialog::setupMainTab() 237void KOPrefsDialog::setupMainTab()
342{ 238{
343 QFrame *topFrame = addPage(i18n("General"),0,0); 239 QFrame *topFrame = addPage(i18n("General"),0,0);
344 // DesktopIcon("identity",KIcon::SizeMedium)); 240 // DesktopIcon("identity",KIcon::SizeMedium));
345 241
346 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 242 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
347 topLayout->setSpacing(mSpacingHint); 243 topLayout->setSpacing(mSpacingHint);
348 topLayout->setMargin(mMarginHint); 244 topLayout->setMargin(mMarginHint);
349 245
350 // KPrefsDialogWidBool *emailControlCenter = 246 // KPrefsDialogWidBool *emailControlCenter =
351// addWidBool(i18n("&Use email settings from Control Center"), 247// addWidBool(i18n("&Use email settings from Control Center"),
352// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 248// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
353// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 249// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
354 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 250 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
355 // SLOT(toggleEmailSettings(bool))); 251 // SLOT(toggleEmailSettings(bool)));
356 252
357 mNameEdit = new QLineEdit(topFrame); 253 mNameEdit = new QLineEdit(topFrame);
358 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 254 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
359 topLayout->addWidget(mNameLabel,0,0); 255 topLayout->addWidget(mNameLabel,0,0);
360 topLayout->addWidget(mNameEdit,0,1); 256 topLayout->addWidget(mNameEdit,0,1);
361 257
362 mEmailEdit = new QLineEdit(topFrame); 258 mEmailEdit = new QLineEdit(topFrame);
363 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 259 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
364 topLayout->addWidget(mEmailLabel,1,0); 260 topLayout->addWidget(mEmailLabel,1,0);
365 topLayout->addWidget(mEmailEdit,1,1); 261 topLayout->addWidget(mEmailEdit,1,1);
366 KPrefsDialogWidBool *wb; 262 KPrefsDialogWidBool *wb;
367 263
368 264
369 265
370 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), 266 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
371 &(KOPrefs::instance()->mShowFullMenu),topFrame); 267 &(KOPrefs::instance()->mShowFullMenu),topFrame);
372 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); 268 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1);
373 269
374 270
375 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), 271 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"),
376 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); 272 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame);
377 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); 273 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1);
378 274
379 275
380 KPrefsDialogWidBool *verticalScreen = 276 KPrefsDialogWidBool *verticalScreen =
381 addWidBool(i18n("Show vertical screen (Needs restart)"), 277 addWidBool(i18n("Show vertical screen (Needs restart)"),
382 &(KOPrefs::instance()->mVerticalScreen),topFrame); 278 &(KOPrefs::instance()->mVerticalScreen),topFrame);
383 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 279 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
384 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); 280 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
385 281
386 282
387 int iii = 5; 283 int iii = 5;
388 widbool = addWidBool(i18n("Block popup until mouse button release"), 284 widbool = addWidBool(i18n("Block popup until mouse button release"),
389 &(KOPrefs::instance()->mBlockPopupMenu),topFrame); 285 &(KOPrefs::instance()->mBlockPopupMenu),topFrame);
390 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); 286 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1);
391 ++iii; 287 ++iii;
392 QHBox *dummy = new QHBox(topFrame); 288 QHBox *dummy = new QHBox(topFrame);
393 new QLabel(i18n("Days in Next-X-Days:"),dummy); 289 new QLabel(i18n("Days in Next-X-Days:"),dummy);
394 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 290 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
395 291
396 topLayout->addMultiCellWidget(dummy,iii,iii,0,1); 292 topLayout->addMultiCellWidget(dummy,iii,iii,0,1);
397 293
398 ++iii; 294 ++iii;
399 295
400 296
401 // KPrefsDialogWidBool *bcc = 297 // KPrefsDialogWidBool *bcc =
402// addWidBool(i18n("Send copy to owner when mailing events"), 298// addWidBool(i18n("Send copy to owner when mailing events"),
403// &(KOPrefs::instance()->mBcc),topFrame); 299// &(KOPrefs::instance()->mBcc),topFrame);
404// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 300// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
405 301
406 302
407 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 303 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
408 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 304 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
409 305
410 // addWidBool(i18n("Enable automatic saving of calendar"), 306 // addWidBool(i18n("Enable automatic saving of calendar"),
411 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 307 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
412 308
413 QHBox *intervalBox = new QHBox(topFrame); 309 QHBox *intervalBox = new QHBox(topFrame);
414 // intervalBox->setSpacing(mSpacingHint); 310 // intervalBox->setSpacing(mSpacingHint);
415 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); 311 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1);
416 ++iii; 312 ++iii;
417 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 313 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
418 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 314 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
419 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 315 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
420 /* 316 /*
421 QHBox * agendasize = new QHBox ( topFrame ); 317 QHBox * agendasize = new QHBox ( topFrame );
422 318
423 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 319 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
424 320
425 321
426 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 322 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
427 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 323 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
428 */ 324 */
429 325
430 326
431 KPrefsDialogWidBool *ask = 327 KPrefsDialogWidBool *ask =
432 addWidBool(i18n("Ask for quit when closing KO/Pi"), 328 addWidBool(i18n("Ask for quit when closing KO/Pi"),
433 &(KOPrefs::instance()->mAskForQuit),topFrame); 329 &(KOPrefs::instance()->mAskForQuit),topFrame);
434 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); 330 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1);
435 ++iii; 331 ++iii;
436 332
437 333
438 /* 334 /*
439 KPrefsDialogWidBool *confirmCheck = 335 KPrefsDialogWidBool *confirmCheck =
440 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 336 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
441 topFrame); 337 topFrame);
442 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 338 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
443 339
444 340
445 mEnableGroupScheduling = 341 mEnableGroupScheduling =
446 addWidBool(i18n("Enable group scheduling"), 342 addWidBool(i18n("Enable group scheduling"),
447 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 343 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
448 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 344 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
449 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 345 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
450 SLOT(warningGroupScheduling())); 346 SLOT(warningGroupScheduling()));
451 347
452 mEnableProjectView = 348 mEnableProjectView =
453 addWidBool(i18n("Enable project view"), 349 addWidBool(i18n("Enable project view"),
454 &(KOPrefs::instance()->mEnableProjectView),topFrame); 350 &(KOPrefs::instance()->mEnableProjectView),topFrame);
455 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 351 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
456 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 352 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
457 SLOT(warningProjectView())); 353 SLOT(warningProjectView()));
458 354
459 // Can't be disabled anymore 355 // Can't be disabled anymore
460 mEnableGroupScheduling->checkBox()->hide(); 356 mEnableGroupScheduling->checkBox()->hide();
461 357
462 // Disable setting, because this feature now becomes stable 358 // Disable setting, because this feature now becomes stable
463 mEnableProjectView->checkBox()->hide(); 359 mEnableProjectView->checkBox()->hide();
464 360
465 KPrefsDialogWidRadios *defaultFormatGroup = 361 KPrefsDialogWidRadios *defaultFormatGroup =
466 addWidRadios(i18n("Default Calendar Format"), 362 addWidRadios(i18n("Default Calendar Format"),
467 &(KOPrefs::instance()->mDefaultFormat),topFrame); 363 &(KOPrefs::instance()->mDefaultFormat),topFrame);
468 defaultFormatGroup->addRadio(i18n("vCalendar")); 364 defaultFormatGroup->addRadio(i18n("vCalendar"));
469 defaultFormatGroup->addRadio(i18n("iCalendar")); 365 defaultFormatGroup->addRadio(i18n("iCalendar"));
470 366
471 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 367 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
472 368
473 // Default format unconditionally is iCalendar 369 // Default format unconditionally is iCalendar
474 defaultFormatGroup->groupBox()->hide(); 370 defaultFormatGroup->groupBox()->hide();
475 371
476 KPrefsDialogWidRadios *mailClientGroup = 372 KPrefsDialogWidRadios *mailClientGroup =
477 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 373 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
478 topFrame); 374 topFrame);
479 mailClientGroup->addRadio(i18n("KMail")); 375 mailClientGroup->addRadio(i18n("KMail"));
480 mailClientGroup->addRadio(i18n("Sendmail")); 376 mailClientGroup->addRadio(i18n("Sendmail"));
481 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 377 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
482 378
483 KPrefsDialogWidBool *htmlsave = 379 KPrefsDialogWidBool *htmlsave =
484 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 380 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
485 topFrame); 381 topFrame);
486 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 382 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
487 383
488 KPrefsDialogWidRadios *destinationGroup = 384 KPrefsDialogWidRadios *destinationGroup =
489 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 385 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
490 topFrame); 386 topFrame);
491 destinationGroup->addRadio(i18n("be added to the standard resource")); 387 destinationGroup->addRadio(i18n("be added to the standard resource"));
492 destinationGroup->addRadio(i18n("be asked which resource to use")); 388 destinationGroup->addRadio(i18n("be asked which resource to use"));
493 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 389 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
494 390
495 topLayout->setRowStretch(14,1); 391 topLayout->setRowStretch(14,1);
496 */ 392 */
497} 393}
498 394
499 395
500void KOPrefsDialog::setupTimeTab() 396void KOPrefsDialog::setupTimeTab()
501{ 397{
502 QFrame *topFrame = addPage(i18n("Time"),0,0); 398 QFrame *topFrame = addPage(i18n("Time"),0,0);
503 // DesktopIcon("clock",KIcon::SizeMedium)); 399 // DesktopIcon("clock",KIcon::SizeMedium));
504 400
505 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 401 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
506 topLayout->setSpacing(mSpacingHint); 402 topLayout->setSpacing(mSpacingHint);
507 topLayout->setMargin(mMarginHint); 403 topLayout->setMargin(mMarginHint);
508 404
509 QHBox *dummy = new QHBox(topFrame); 405 QHBox *dummy = new QHBox(topFrame);
510 KPrefsDialogWidTime *dayBegins = 406 KPrefsDialogWidTime *dayBegins =
511 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 407 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
512 dummy); 408 dummy);
513 //topLayout->addWidget(dayBegins->label(),2,0); 409 //topLayout->addWidget(dayBegins->label(),2,0);
514 410
515 //topLayout->addWidget(dayBegins->spinBox(),2,1); 411 //topLayout->addWidget(dayBegins->spinBox(),2,1);
516 topLayout->addMultiCellWidget(dummy,0,0,0,1); 412 topLayout->addMultiCellWidget(dummy,0,0,0,1);
517 413
518 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 414 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
519 topFrame),1,0); 415 topFrame),1,0);
520 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 416 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
521 mStartTimeSpin->setSuffix(":00"); 417 mStartTimeSpin->setSuffix(":00");
522 topLayout->addWidget(mStartTimeSpin,1,1); 418 topLayout->addWidget(mStartTimeSpin,1,1);
523 419
524 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 420 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
525 topFrame),2,0); 421 topFrame),2,0);
526 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 422 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
527 mDefaultDurationSpin->setSuffix(":00"); 423 mDefaultDurationSpin->setSuffix(":00");
528 topLayout->addWidget(mDefaultDurationSpin,2,1); 424 topLayout->addWidget(mDefaultDurationSpin,2,1);
529 425
530 QStringList alarmList; 426 QStringList alarmList;
531 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 427 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
532 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 428 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
533 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 429 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
534 3,0); 430 3,0);
535 mAlarmTimeCombo = new QComboBox(topFrame); 431 mAlarmTimeCombo = new QComboBox(topFrame);
536 mAlarmTimeCombo->insertStringList(alarmList); 432 mAlarmTimeCombo->insertStringList(alarmList);
537 topLayout->addWidget(mAlarmTimeCombo,3,1); 433 topLayout->addWidget(mAlarmTimeCombo,3,1);
538 434
539 435
540 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 436 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
541 i18n("Working Hours"), 437 i18n("Working Hours"),
542 topFrame); 438 topFrame);
543 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 439 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
544 workingHoursGroup->layout()->setSpacing( 0 ); 440 workingHoursGroup->layout()->setSpacing( 0 );
545 workingHoursGroup->layout()->setMargin( 4 ); 441 workingHoursGroup->layout()->setMargin( 4 );
546 QHBox *workStartBox = new QHBox(workingHoursGroup); 442 QHBox *workStartBox = new QHBox(workingHoursGroup);
547 // workStartBox->setMargin( 0 ); 443 // workStartBox->setMargin( 0 );
548 addWidTime(i18n("Daily starting hour:"), 444 addWidTime(i18n("Daily starting hour:"),
549 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 445 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
550 446
551 QHBox *workEndBox = new QHBox(workingHoursGroup); 447 QHBox *workEndBox = new QHBox(workingHoursGroup);
552 //workEndBox->setMargin( 0 ); 448 //workEndBox->setMargin( 0 );
553 addWidTime(i18n("Daily ending hour:"), 449 addWidTime(i18n("Daily ending hour:"),
554 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 450 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
555 QVBox *excludeBox = new QVBox(workingHoursGroup); 451 QVBox *excludeBox = new QVBox(workingHoursGroup);
556 //excludeBox->setMargin( 0 ); 452 //excludeBox->setMargin( 0 );
557 addWidBool(i18n("Exclude holidays"), 453 addWidBool(i18n("Exclude holidays"),
558 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 454 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
559 455
560 addWidBool(i18n("Exclude Saturdays"), 456 addWidBool(i18n("Exclude Saturdays"),
561 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 457 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
562 458
563// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 459// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
564 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 460 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
565 // topFrame); 461 // topFrame);
566// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 462// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
567 463
568 // topLayout->setRowStretch(6,1); 464 // topLayout->setRowStretch(6,1);
569} 465}
570 466
571 467
572void KOPrefsDialog::setupViewsTab() 468void KOPrefsDialog::setupViewsTab()
573{ 469{
574 470
575 QFrame *topFrame = addPage(i18n("Views"),0,0); 471 QFrame *topFrame = addPage(i18n("Views"),0,0);
576 // DesktopIcon("viewmag",KIcon::SizeMedium)); 472 // DesktopIcon("viewmag",KIcon::SizeMedium));
577 473
578 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 474 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
579 topLayout->setSpacing(mSpacingHint); 475 topLayout->setSpacing(mSpacingHint);
580 topLayout->setMargin(mMarginHint); 476 topLayout->setMargin(mMarginHint);
581 477
582// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 478// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
583// topLayout->addLayout(dayBeginsLayout,0,0); 479// topLayout->addLayout(dayBeginsLayout,0,0);
584 480
585// KPrefsDialogWidTime *dayBegins = 481// KPrefsDialogWidTime *dayBegins =
586// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 482// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
587// topFrame); 483// topFrame);
588// dayBeginsLayout->addWidget(dayBegins->label()); 484// dayBeginsLayout->addWidget(dayBegins->label());
589// dayBeginsLayout->addStretch(1); 485// dayBeginsLayout->addStretch(1);
590// dayBeginsLayout->addWidget(dayBegins->spinBox()); 486// dayBeginsLayout->addWidget(dayBegins->spinBox());
591 487
592// QBoxLayout *nextDaysLayout = new QHBoxLayout; 488// QBoxLayout *nextDaysLayout = new QHBoxLayout;
593// topLayout->addLayout(nextDaysLayout,1,0); 489// topLayout->addLayout(nextDaysLayout,1,0);
594// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 490// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
595// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 491// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
596// nextDaysLayout->addStretch(1); 492// nextDaysLayout->addStretch(1);
597// nextDaysLayout->addWidget(mNextXDaysSpin); 493// nextDaysLayout->addWidget(mNextXDaysSpin);
598 494
599 495
600 int ii = 0; 496 int ii = 0;
601 KPrefsDialogWidBool *dummy = 497 KPrefsDialogWidBool *dummy =
602 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 498 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
603 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 499 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
604 topLayout->addWidget(dummy->checkBox(),ii++,0); 500 topLayout->addWidget(dummy->checkBox(),ii++,0);
605 501
606 502
607 503
608 504
609 505
610 506
611 // topLayout->addWidget(hourSizeGroup,ii++,0); 507 // topLayout->addWidget(hourSizeGroup,ii++,0);
612 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 508 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
613 //topLayout->setRowStretch(11,1); 509 //topLayout->setRowStretch(11,1);
614 510
615 511
616 512
617 513
618#if 0 514#if 0
619 515
620 topFrame = addPage(i18n("ViewChange"),0,0); 516 topFrame = addPage(i18n("ViewChange"),0,0);
621 // DesktopIcon("viewmag",KIcon::SizeMedium)); 517 // DesktopIcon("viewmag",KIcon::SizeMedium));
622 518
623 topLayout = new QGridLayout(topFrame,6,1); 519 topLayout = new QGridLayout(topFrame,6,1);
624 topLayout->setSpacing(mSpacingHint); 520 topLayout->setSpacing(mSpacingHint);
625 topLayout->setMargin(mMarginHint); 521 topLayout->setMargin(mMarginHint);
626 ii = 0; 522 ii = 0;
627 523
628#endif 524#endif
629 525
630 dummy = 526 dummy =
631 addWidBool(i18n("Hold fullscreen on view change"), 527 addWidBool(i18n("Hold fullscreen on view change"),
632 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 528 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
633 topLayout->addWidget(dummy->checkBox(),ii++,0); 529 topLayout->addWidget(dummy->checkBox(),ii++,0);
634 530
635 dummy = 531 dummy =
636 addWidBool(i18n("Hold non-fullscreen on view change"), 532 addWidBool(i18n("Hold non-fullscreen on view change"),
637 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 533 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
638 topLayout->addWidget(dummy->checkBox(),ii++,0); 534 topLayout->addWidget(dummy->checkBox(),ii++,0);
639 535
640 536
641 537
642 KPrefsDialogWidBool *fullViewMonth = 538 KPrefsDialogWidBool *fullViewMonth =
643 addWidBool(i18n("Next days view uses full window"), 539 addWidBool(i18n("Next days view uses full window"),
644 &(KOPrefs::instance()->mFullViewMonth),topFrame); 540 &(KOPrefs::instance()->mFullViewMonth),topFrame);
645 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 541 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
646 542
647 543
648 KPrefsDialogWidBool *fullViewTodo = 544 KPrefsDialogWidBool *fullViewTodo =
649 addWidBool(i18n("Event list view uses full window"), 545 addWidBool(i18n("Event list view uses full window"),
650 &(KOPrefs::instance()->mFullViewTodo),topFrame); 546 &(KOPrefs::instance()->mFullViewTodo),topFrame);
651 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 547 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
652 dummy = 548 dummy =
653 addWidBool(i18n("Listview uses monthly timespan"), 549 addWidBool(i18n("Listview uses monthly timespan"),
654 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 550 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
655 topLayout->addWidget(dummy->checkBox(),ii++,0); 551 topLayout->addWidget(dummy->checkBox(),ii++,0);
656 dummy = 552 dummy =
657 addWidBool(i18n("Highlight selection in Time Edit"), 553 addWidBool(i18n("Highlight selection in Time Edit"),
658 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 554 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
659 topLayout->addWidget( dummy->checkBox(), ii++,0); 555 topLayout->addWidget( dummy->checkBox(), ii++,0);
660 556
661 KPrefsDialogWidBool *dailyRecur = 557 KPrefsDialogWidBool *dailyRecur =
662 addWidBool(i18n("Show events that recur daily in date nav."), 558 addWidBool(i18n("Show events that recur daily in date nav."),
663 &(KOPrefs::instance()->mDailyRecur),topFrame); 559 &(KOPrefs::instance()->mDailyRecur),topFrame);
664 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 560 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
665 561
666 KPrefsDialogWidBool *weeklyRecur = 562 KPrefsDialogWidBool *weeklyRecur =
667 addWidBool(i18n("Show ev. that recur weekly in date nav."), 563 addWidBool(i18n("Show ev. that recur weekly in date nav."),
668 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 564 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
669 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 565 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
670 566
671#ifdef DESKTOP_VERSION 567#ifdef DESKTOP_VERSION
672 KPrefsDialogWidBool *enableToolTips = 568 KPrefsDialogWidBool *enableToolTips =
673 addWidBool(i18n("Enable tooltips displaying summary of ev."), 569 addWidBool(i18n("Enable tooltips displaying summary of ev."),
674 &(KOPrefs::instance()->mEnableToolTips),topFrame); 570 &(KOPrefs::instance()->mEnableToolTips),topFrame);
675 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 571 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
676#endif 572#endif
677 // ********************************************************* 573 // *********************************************************
678 574
679 topFrame = addPage(i18n("Agenda View"),0,0); 575 topFrame = addPage(i18n("Agenda View"),0,0);
680 // DesktopIcon("viewmag",KIcon::SizeMedium)); 576 // DesktopIcon("viewmag",KIcon::SizeMedium));
681 577
682 topLayout = new QGridLayout(topFrame,5,1); 578 topLayout = new QGridLayout(topFrame,5,1);
683 topLayout->setSpacing(mSpacingHint); 579 topLayout->setSpacing(mSpacingHint);
684 topLayout->setMargin(mMarginHint); 580 topLayout->setMargin(mMarginHint);
685 ii = 0; 581 ii = 0;
686 582
687 583
688 dummy = 584 dummy =
689 addWidBool(i18n("Show time in agenda items"), 585 addWidBool(i18n("Show time in agenda items"),
690 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 586 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
691 topLayout->addWidget(dummy->checkBox(),ii++,0); 587 topLayout->addWidget(dummy->checkBox(),ii++,0);
692 588
693 dummy = 589 dummy =
694 addWidBool(i18n("Highlight current day in agenda"), 590 addWidBool(i18n("Highlight current day in agenda"),
695 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 591 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
696 topLayout->addWidget(dummy->checkBox(),ii++,0); 592 topLayout->addWidget(dummy->checkBox(),ii++,0);
697 593
698 dummy = 594 dummy =
699 addWidBool(i18n("Use light color for highlight current day"), 595 addWidBool(i18n("Use light color for highlight current day"),
700 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 596 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
701 topLayout->addWidget(dummy->checkBox(),ii++,0); 597 topLayout->addWidget(dummy->checkBox(),ii++,0);
702 598
703 599
704 KPrefsDialogWidBool *marcusBainsEnabled = 600 KPrefsDialogWidBool *marcusBainsEnabled =
705 addWidBool(i18n("Show current time"), 601 addWidBool(i18n("Show current time"),
706 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 602 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
707 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 603 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
708 604
709 605
710 dummy = 606 dummy =
711 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 607 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
712 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 608 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
713 topLayout->addWidget(dummy->checkBox(),ii++,0); 609 topLayout->addWidget(dummy->checkBox(),ii++,0);
714 610
715 dummy = 611 dummy =
716 addWidBool(i18n("Set agenda to current time on change"), 612 addWidBool(i18n("Set agenda to current time on change"),
717 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 613 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
718 topLayout->addWidget(dummy->checkBox(),ii++,0); 614 topLayout->addWidget(dummy->checkBox(),ii++,0);
719 615
720 616
721 dummy = 617 dummy =
722 addWidBool(i18n("Allday Agenda view shows todos"), 618 addWidBool(i18n("Allday Agenda view shows todos"),
723 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 619 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
@@ -1079,677 +975,523 @@ void KOPrefsDialog::setupFontsTab()
1079 975
1080 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 976 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1081 // DesktopIcon("fonts",KIcon::SizeMedium)); 977 // DesktopIcon("fonts",KIcon::SizeMedium));
1082 978
1083 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 979 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1084 topLayout->setSpacing(1); 980 topLayout->setSpacing(1);
1085 topLayout->setMargin(3); 981 topLayout->setMargin(3);
1086 KPrefsDialogWidFont * tVFont; 982 KPrefsDialogWidFont * tVFont;
1087 int i = 0; 983 int i = 0;
1088 KPrefsDialogWidFont *timeLabelsFont = 984 KPrefsDialogWidFont *timeLabelsFont =
1089 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 985 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1090 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 986 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1091 topLayout->addWidget(timeLabelsFont->label(),i,0); 987 topLayout->addWidget(timeLabelsFont->label(),i,0);
1092 topLayout->addWidget(timeLabelsFont->preview(),i,1); 988 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1093 topLayout->addWidget(timeLabelsFont->button(),i,2); 989 topLayout->addWidget(timeLabelsFont->button(),i,2);
1094 ++i; 990 ++i;
1095 991
1096 992
1097 timeLabelsFont = 993 timeLabelsFont =
1098 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 994 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1099 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 995 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1100 topLayout->addWidget(timeLabelsFont->label(),i,0); 996 topLayout->addWidget(timeLabelsFont->label(),i,0);
1101 topLayout->addWidget(timeLabelsFont->preview(),i,1); 997 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1102 topLayout->addWidget(timeLabelsFont->button(),i,2); 998 topLayout->addWidget(timeLabelsFont->button(),i,2);
1103 ++i; 999 ++i;
1104 1000
1105 KPrefsDialogWidFont *timeBarFont = 1001 KPrefsDialogWidFont *timeBarFont =
1106 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1002 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1107 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1003 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1108 topLayout->addWidget(timeBarFont->label(),i,0); 1004 topLayout->addWidget(timeBarFont->label(),i,0);
1109 topLayout->addWidget(timeBarFont->preview(),i,1); 1005 topLayout->addWidget(timeBarFont->preview(),i,1);
1110 topLayout->addWidget(timeBarFont->button(),i,2); 1006 topLayout->addWidget(timeBarFont->button(),i,2);
1111 ++i; 1007 ++i;
1112 1008
1113 1009
1114 KPrefsDialogWidFont *marcusBainsFont = 1010 KPrefsDialogWidFont *marcusBainsFont =
1115 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1011 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1116 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1012 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1117 topLayout->addWidget(marcusBainsFont->label(),i,0); 1013 topLayout->addWidget(marcusBainsFont->label(),i,0);
1118 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1014 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1119 topLayout->addWidget(marcusBainsFont->button(),i,2); 1015 topLayout->addWidget(marcusBainsFont->button(),i,2);
1120 ++i; 1016 ++i;
1121 1017
1122 tVFont = 1018 tVFont =
1123 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1019 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1124 &(KOPrefs::instance()->mEventViewFont),topFrame); 1020 &(KOPrefs::instance()->mEventViewFont),topFrame);
1125 topLayout->addWidget(tVFont->label(),i,0); 1021 topLayout->addWidget(tVFont->label(),i,0);
1126 topLayout->addWidget(tVFont->preview(),i,1); 1022 topLayout->addWidget(tVFont->preview(),i,1);
1127 topLayout->addWidget(tVFont->button(),i,2); 1023 topLayout->addWidget(tVFont->button(),i,2);
1128 ++i; 1024 ++i;
1129 1025
1130 1026
1131 1027
1132 tVFont = 1028 tVFont =
1133 addWidFont(i18n("Details"),i18n("EditorBox:"), 1029 addWidFont(i18n("Details"),i18n("EditorBox:"),
1134 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1030 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1135 topLayout->addWidget(tVFont->label(),i,0); 1031 topLayout->addWidget(tVFont->label(),i,0);
1136 topLayout->addWidget(tVFont->preview(),i,1); 1032 topLayout->addWidget(tVFont->preview(),i,1);
1137 topLayout->addWidget(tVFont->button(),i,2); 1033 topLayout->addWidget(tVFont->button(),i,2);
1138 ++i; 1034 ++i;
1139 1035
1140 1036
1141 1037
1142 topLayout->setColStretch(1,1); 1038 topLayout->setColStretch(1,1);
1143 topLayout->setRowStretch(4,1); 1039 topLayout->setRowStretch(4,1);
1144 1040
1145 1041
1146 i = 0; 1042 i = 0;
1147 topFrame = addPage(i18n("View Fonts"),0, 1043 topFrame = addPage(i18n("View Fonts"),0,
1148 DesktopIcon("fonts",KIcon::SizeMedium)); 1044 DesktopIcon("fonts",KIcon::SizeMedium));
1149 1045
1150 topLayout = new QGridLayout(topFrame,7,3); 1046 topLayout = new QGridLayout(topFrame,7,3);
1151 topLayout->setSpacing(1); 1047 topLayout->setSpacing(1);
1152 topLayout->setMargin(3); 1048 topLayout->setMargin(3);
1153 1049
1154 tVFont = 1050 tVFont =
1155 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1051 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1156 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1052 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1157 topLayout->addWidget(tVFont->label(),i,0); 1053 topLayout->addWidget(tVFont->label(),i,0);
1158 topLayout->addWidget(tVFont->preview(),i,1); 1054 topLayout->addWidget(tVFont->preview(),i,1);
1159 topLayout->addWidget(tVFont->button(),i,2); 1055 topLayout->addWidget(tVFont->button(),i,2);
1160 ++i; 1056 ++i;
1161 KPrefsDialogWidFont *agendaViewFont = 1057 KPrefsDialogWidFont *agendaViewFont =
1162 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1058 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1163 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1059 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1164 topLayout->addWidget(agendaViewFont->label(),i,0); 1060 topLayout->addWidget(agendaViewFont->label(),i,0);
1165 topLayout->addWidget(agendaViewFont->preview(),i,1); 1061 topLayout->addWidget(agendaViewFont->preview(),i,1);
1166 topLayout->addWidget(agendaViewFont->button(),i,2); 1062 topLayout->addWidget(agendaViewFont->button(),i,2);
1167 ++i; 1063 ++i;
1168 1064
1169 1065
1170 KPrefsDialogWidFont *monthViewFont = 1066 KPrefsDialogWidFont *monthViewFont =
1171 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1067 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1172 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1068 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1173 topLayout->addWidget(monthViewFont->label(),i,0); 1069 topLayout->addWidget(monthViewFont->label(),i,0);
1174 topLayout->addWidget(monthViewFont->preview(),i,1); 1070 topLayout->addWidget(monthViewFont->preview(),i,1);
1175 topLayout->addWidget(monthViewFont->button(),i,2); 1071 topLayout->addWidget(monthViewFont->button(),i,2);
1176 ++i; 1072 ++i;
1177 1073
1178 1074
1179 KPrefsDialogWidFont *lVFont = 1075 KPrefsDialogWidFont *lVFont =
1180 addWidFont(i18n("Event"),i18n("List View:"), 1076 addWidFont(i18n("Event"),i18n("List View:"),
1181 &(KOPrefs::instance()->mListViewFont),topFrame); 1077 &(KOPrefs::instance()->mListViewFont),topFrame);
1182 topLayout->addWidget(lVFont->label(),i,0); 1078 topLayout->addWidget(lVFont->label(),i,0);
1183 topLayout->addWidget(lVFont->preview(),i,1); 1079 topLayout->addWidget(lVFont->preview(),i,1);
1184 topLayout->addWidget(lVFont->button(),i,2); 1080 topLayout->addWidget(lVFont->button(),i,2);
1185 ++i; 1081 ++i;
1186 1082
1187 1083
1188 tVFont = 1084 tVFont =
1189 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1085 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1190 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1086 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1191 topLayout->addWidget(tVFont->label(),i,0); 1087 topLayout->addWidget(tVFont->label(),i,0);
1192 topLayout->addWidget(tVFont->preview(),i,1); 1088 topLayout->addWidget(tVFont->preview(),i,1);
1193 topLayout->addWidget(tVFont->button(),i,2); 1089 topLayout->addWidget(tVFont->button(),i,2);
1194 ++i; 1090 ++i;
1195 1091
1196 1092
1197 tVFont = 1093 tVFont =
1198 addWidFont(i18n("Today"),i18n("JournalView:"), 1094 addWidFont(i18n("Today"),i18n("JournalView:"),
1199 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1095 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1200 topLayout->addWidget(tVFont->label(),i,0); 1096 topLayout->addWidget(tVFont->label(),i,0);
1201 topLayout->addWidget(tVFont->preview(),i,1); 1097 topLayout->addWidget(tVFont->preview(),i,1);
1202 topLayout->addWidget(tVFont->button(),i,2); 1098 topLayout->addWidget(tVFont->button(),i,2);
1203 ++i; 1099 ++i;
1204 1100
1205 1101
1206 1102
1207 1103
1208 topLayout->setColStretch(1,1); 1104 topLayout->setColStretch(1,1);
1209 topLayout->setRowStretch(4,1); 1105 topLayout->setRowStretch(4,1);
1210 1106
1211 1107
1212 1108
1213 1109
1214} 1110}
1215 1111
1216void KOPrefsDialog::setupColorsTab() 1112void KOPrefsDialog::setupColorsTab()
1217{ 1113{
1218 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1114 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1219 // DesktopIcon("colorize",KIcon::SizeMedium)); 1115 // DesktopIcon("colorize",KIcon::SizeMedium));
1220 1116
1221 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1117 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1222 // topLayout->setSpacing(mSpacingHint); 1118 // topLayout->setSpacing(mSpacingHint);
1223 // topLayout->setMargin(mMarginHint); 1119 // topLayout->setMargin(mMarginHint);
1224 1120
1225 topLayout->setSpacing(2); 1121 topLayout->setSpacing(2);
1226 topLayout->setMargin(3); 1122 topLayout->setMargin(3);
1227 1123
1228 int ii = 1; 1124 int ii = 1;
1229 QGroupBox *categoryGroup ; 1125 QGroupBox *categoryGroup ;
1230 1126
1231 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1127 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1232 topFrame); 1128 topFrame);
1233 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1129 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1234 1130
1235 mCategoryCombo = new QComboBox(categoryGroup); 1131 mCategoryCombo = new QComboBox(categoryGroup);
1236 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1132 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1237 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1133 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1238 1134
1239 mCategoryButton = new KColorButton(categoryGroup); 1135 mCategoryButton = new KColorButton(categoryGroup);
1240 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1136 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1241 updateCategoryColor(); 1137 updateCategoryColor();
1242 1138
1243 1139
1244 // Holiday Color 1140 // Holiday Color
1245 1141
1246 KPrefsDialogWidColor *holidayColor = 1142 KPrefsDialogWidColor *holidayColor =
1247 addWidColor(i18n("Holiday color:"), 1143 addWidColor(i18n("Holiday color:"),
1248 &(KOPrefs::instance()->mHolidayColor),topFrame); 1144 &(KOPrefs::instance()->mHolidayColor),topFrame);
1249 topLayout->addWidget(holidayColor->label(),ii,0); 1145 topLayout->addWidget(holidayColor->label(),ii,0);
1250 topLayout->addWidget(holidayColor->button(),ii++,1); 1146 topLayout->addWidget(holidayColor->button(),ii++,1);
1251 1147
1252 // Highlight Color 1148 // Highlight Color
1253 KPrefsDialogWidColor *highlightColor = 1149 KPrefsDialogWidColor *highlightColor =
1254 addWidColor(i18n("Highlight color:"), 1150 addWidColor(i18n("Highlight color:"),
1255 &(KOPrefs::instance()->mHighlightColor),topFrame); 1151 &(KOPrefs::instance()->mHighlightColor),topFrame);
1256 topLayout->addWidget(highlightColor->label(),ii,0); 1152 topLayout->addWidget(highlightColor->label(),ii,0);
1257 topLayout->addWidget(highlightColor->button(),ii++,1); 1153 topLayout->addWidget(highlightColor->button(),ii++,1);
1258 1154
1259 // Event color 1155 // Event color
1260 KPrefsDialogWidColor *eventColor = 1156 KPrefsDialogWidColor *eventColor =
1261 addWidColor(i18n("Default event color:"), 1157 addWidColor(i18n("Default event color:"),
1262 &(KOPrefs::instance()->mEventColor),topFrame); 1158 &(KOPrefs::instance()->mEventColor),topFrame);
1263 topLayout->addWidget(eventColor->label(),ii,0); 1159 topLayout->addWidget(eventColor->label(),ii,0);
1264 topLayout->addWidget(eventColor->button(),ii++,1); 1160 topLayout->addWidget(eventColor->button(),ii++,1);
1265 eventColor = 1161 eventColor =
1266 addWidColor(i18n("Default todo done color:"), 1162 addWidColor(i18n("Default todo done color:"),
1267 &(KOPrefs::instance()->mTodoDoneColor),topFrame); 1163 &(KOPrefs::instance()->mTodoDoneColor),topFrame);
1268 topLayout->addWidget(eventColor->label(),ii,0); 1164 topLayout->addWidget(eventColor->label(),ii,0);
1269 topLayout->addWidget(eventColor->button(),ii++,1); 1165 topLayout->addWidget(eventColor->button(),ii++,1);
1270 1166
1271 1167
1272 // agenda view background color 1168 // agenda view background color
1273 KPrefsDialogWidColor *agendaBgColor = 1169 KPrefsDialogWidColor *agendaBgColor =
1274 addWidColor(i18n("Agenda view background color:"), 1170 addWidColor(i18n("Agenda view background color:"),
1275 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1171 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1276 topLayout->addWidget(agendaBgColor->label(),ii,0); 1172 topLayout->addWidget(agendaBgColor->label(),ii,0);
1277 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1173 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1278 1174
1279 // working hours color 1175 // working hours color
1280 KPrefsDialogWidColor *workingHoursColor = 1176 KPrefsDialogWidColor *workingHoursColor =
1281 addWidColor(i18n("Working hours color:"), 1177 addWidColor(i18n("Working hours color:"),
1282 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1178 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1283 topLayout->addWidget(workingHoursColor->label(),ii,0); 1179 topLayout->addWidget(workingHoursColor->label(),ii,0);
1284 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1180 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1285 1181
1286 KPrefsDialogWidBool *sb = 1182 KPrefsDialogWidBool *sb =
1287 addWidBool(i18n("Use colors for application:"), 1183 addWidBool(i18n("Use colors for application:"),
1288 &(KOPrefs::instance()->mUseAppColors),topFrame); 1184 &(KOPrefs::instance()->mUseAppColors),topFrame);
1289 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1185 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1290 1186
1291 ii++; 1187 ii++;
1292 KPrefsDialogWidColor * workingHoursColor1 = 1188 KPrefsDialogWidColor * workingHoursColor1 =
1293 addWidColor(i18n("Buttons, menus, etc.:"), 1189 addWidColor(i18n("Buttons, menus, etc.:"),
1294 &(KOPrefs::instance()->mAppColor1),topFrame); 1190 &(KOPrefs::instance()->mAppColor1),topFrame);
1295 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1191 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1296 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1192 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1297 1193
1298 KPrefsDialogWidColor * workingHoursColor2 = 1194 KPrefsDialogWidColor * workingHoursColor2 =
1299 addWidColor(i18n("Frames, labels, etc.:"), 1195 addWidColor(i18n("Frames, labels, etc.:"),
1300 &(KOPrefs::instance()->mAppColor2),topFrame); 1196 &(KOPrefs::instance()->mAppColor2),topFrame);
1301 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1197 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1302 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1198 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1303 1199
1304 1200
1305 1201
1306} 1202}
1307 1203
1308void KOPrefsDialog::setCategoryColor() 1204void KOPrefsDialog::setCategoryColor()
1309{ 1205{
1310 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1206 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1311} 1207}
1312 1208
1313void KOPrefsDialog::updateCategoryColor() 1209void KOPrefsDialog::updateCategoryColor()
1314{ 1210{
1315 QString cat = mCategoryCombo->currentText(); 1211 QString cat = mCategoryCombo->currentText();
1316 QColor *color = mCategoryDict.find(cat); 1212 QColor *color = mCategoryDict.find(cat);
1317 if (!color) { 1213 if (!color) {
1318 color = KOPrefs::instance()->categoryColor(cat); 1214 color = KOPrefs::instance()->categoryColor(cat);
1319 } 1215 }
1320 if (color) { 1216 if (color) {
1321 mCategoryButton->setColor(*color); 1217 mCategoryButton->setColor(*color);
1322 } 1218 }
1323} 1219}
1324 1220
1325void KOPrefsDialog::setupPrinterTab() 1221void KOPrefsDialog::setupPrinterTab()
1326{ 1222{
1327 mPrinterTab = addPage(i18n("Printing"),0, 1223 mPrinterTab = addPage(i18n("Printing"),0,
1328 DesktopIcon("fileprint",KIcon::SizeMedium)); 1224 DesktopIcon("fileprint",KIcon::SizeMedium));
1329 1225
1330 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1226 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1331 topLayout->setSpacing(mSpacingHint); 1227 topLayout->setSpacing(mSpacingHint);
1332 topLayout->setMargin(mMarginHint); 1228 topLayout->setMargin(mMarginHint);
1333 1229
1334 topLayout->setRowStretch(4,1); 1230 topLayout->setRowStretch(4,1);
1335} 1231}
1336 1232
1337void KOPrefsDialog::setupGroupSchedulingTab() 1233void KOPrefsDialog::setupGroupSchedulingTab()
1338{ 1234{
1339#if 0 1235#if 0
1340 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1236 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1341 DesktopIcon("personal",KIcon::SizeMedium)); 1237 DesktopIcon("personal",KIcon::SizeMedium));
1342 1238
1343 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1239 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1344 topLayout->setSpacing(mSpacingHint); 1240 topLayout->setSpacing(mSpacingHint);
1345 topLayout->setMargin(mMarginHint); 1241 topLayout->setMargin(mMarginHint);
1346 1242
1347#if 0 1243#if 0
1348 KPrefsDialogWidRadios *schedulerGroup = 1244 KPrefsDialogWidRadios *schedulerGroup =
1349 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1245 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1350 topFrame); 1246 topFrame);
1351 schedulerGroup->addRadio("Dummy"); // Only for debugging 1247 schedulerGroup->addRadio("Dummy"); // Only for debugging
1352 schedulerGroup->addRadio(i18n("Mail client")); 1248 schedulerGroup->addRadio(i18n("Mail client"));
1353 1249
1354 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1250 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1355#endif 1251#endif
1356 1252
1357 KPrefsDialogWidRadios *sendGroup = 1253 KPrefsDialogWidRadios *sendGroup =
1358 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1254 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1359 topFrame); 1255 topFrame);
1360 sendGroup->addRadio(i18n("Send to outbox")); 1256 sendGroup->addRadio(i18n("Send to outbox"));
1361 sendGroup->addRadio(i18n("Send directly")); 1257 sendGroup->addRadio(i18n("Send directly"));
1362 1258
1363 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1259 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1364 1260
1365 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1261 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1366 mAMails = new QListView(topFrame); 1262 mAMails = new QListView(topFrame);
1367 mAMails->addColumn(i18n("Email"),300); 1263 mAMails->addColumn(i18n("Email"),300);
1368 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1264 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1369 1265
1370 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1266 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1371 aEmailsEdit = new QLineEdit(topFrame); 1267 aEmailsEdit = new QLineEdit(topFrame);
1372 aEmailsEdit->setEnabled(false); 1268 aEmailsEdit->setEnabled(false);
1373 topLayout->addWidget(aEmailsEdit,4,1); 1269 topLayout->addWidget(aEmailsEdit,4,1);
1374 1270
1375 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1271 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1376 topLayout->addWidget(add,5,0); 1272 topLayout->addWidget(add,5,0);
1377 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1273 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1378 topLayout->addWidget(del,5,1); 1274 topLayout->addWidget(del,5,1);
1379 1275
1380 //topLayout->setRowStretch(2,1); 1276 //topLayout->setRowStretch(2,1);
1381 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1277 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1382 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1278 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1383 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1279 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1384 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1280 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1385#endif 1281#endif
1386} 1282}
1387 1283
1388void KOPrefsDialog::setupGroupAutomationTab() 1284void KOPrefsDialog::setupGroupAutomationTab()
1389{ 1285{
1390 return; 1286 return;
1391 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1287 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1392 DesktopIcon("personal",KIcon::SizeMedium)); 1288 DesktopIcon("personal",KIcon::SizeMedium));
1393 1289
1394 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1290 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1395 topLayout->setSpacing(mSpacingHint); 1291 topLayout->setSpacing(mSpacingHint);
1396 topLayout->setMargin(mMarginHint); 1292 topLayout->setMargin(mMarginHint);
1397 1293
1398 KPrefsDialogWidRadios *autoRefreshGroup = 1294 KPrefsDialogWidRadios *autoRefreshGroup =
1399 addWidRadios(i18n("Auto Send Refresh"), 1295 addWidRadios(i18n("Auto Send Refresh"),
1400 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1296 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1401 autoRefreshGroup->addRadio(i18n("Never")); 1297 autoRefreshGroup->addRadio(i18n("Never"));
1402 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1298 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1403 //autoRefreshGroup->addRadio(i18n("selected emails")); 1299 //autoRefreshGroup->addRadio(i18n("selected emails"));
1404 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1300 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1405 1301
1406 KPrefsDialogWidRadios *autoInsertGroup = 1302 KPrefsDialogWidRadios *autoInsertGroup =
1407 addWidRadios(i18n("Auto Insert IMIP Replies"), 1303 addWidRadios(i18n("Auto Insert IMIP Replies"),
1408 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1304 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1409 autoInsertGroup->addRadio(i18n("Never")); 1305 autoInsertGroup->addRadio(i18n("Never"));
1410 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1306 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1411 //autoInsertGroup->addRadio(i18n("selected emails")); 1307 //autoInsertGroup->addRadio(i18n("selected emails"));
1412 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1308 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1413 1309
1414 KPrefsDialogWidRadios *autoRequestGroup = 1310 KPrefsDialogWidRadios *autoRequestGroup =
1415 addWidRadios(i18n("Auto Insert IMIP Requests"), 1311 addWidRadios(i18n("Auto Insert IMIP Requests"),
1416 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1312 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1417 autoRequestGroup->addRadio(i18n("Never")); 1313 autoRequestGroup->addRadio(i18n("Never"));
1418 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1314 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1419 //autoInsertGroup->addRadio(i18n("selected emails")); 1315 //autoInsertGroup->addRadio(i18n("selected emails"));
1420 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1316 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1421 1317
1422 KPrefsDialogWidRadios *autoFreeBusyGroup = 1318 KPrefsDialogWidRadios *autoFreeBusyGroup =
1423 addWidRadios(i18n("Auto Send FreeBusy Information"), 1319 addWidRadios(i18n("Auto Send FreeBusy Information"),
1424 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1320 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1425 autoFreeBusyGroup->addRadio(i18n("Never")); 1321 autoFreeBusyGroup->addRadio(i18n("Never"));
1426 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1322 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1427 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1323 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1428 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1324 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1429 1325
1430 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1326 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1431 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1327 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1432 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1328 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1433 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1329 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1434 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1330 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1435 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1331 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1436 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1332 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1437} 1333}
1438 1334
1439void KOPrefsDialog::showPrinterTab() 1335void KOPrefsDialog::showPrinterTab()
1440{ 1336{
1441 showPage(pageIndex(mPrinterTab)); 1337 showPage(pageIndex(mPrinterTab));
1442} 1338}
1443 1339
1444 1340
1445void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1341void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1446 const QStringList *tags) 1342 const QStringList *tags)
1447{ 1343{
1448 if (tags) { 1344 if (tags) {
1449 int i = tags->findIndex(text); 1345 int i = tags->findIndex(text);
1450 if (i > 0) combo->setCurrentItem(i); 1346 if (i > 0) combo->setCurrentItem(i);
1451 } else { 1347 } else {
1452 for(int i=0;i<combo->count();++i) { 1348 for(int i=0;i<combo->count();++i) {
1453 if (combo->text(i) == text) { 1349 if (combo->text(i) == text) {
1454 combo->setCurrentItem(i); 1350 combo->setCurrentItem(i);
1455 break; 1351 break;
1456 } 1352 }
1457 } 1353 }
1458 } 1354 }
1459} 1355}
1460 1356
1461void KOPrefsDialog::usrReadConfig() 1357void KOPrefsDialog::usrReadConfig()
1462{ 1358{
1463 if ( kdelibcfg ) 1359
1464 kdelibcfg->readConfig();
1465 else {
1466 mNameEdit->setText(KOPrefs::instance()->fullName()); 1360 mNameEdit->setText(KOPrefs::instance()->fullName());
1467 mEmailEdit->setText(KOPrefs::instance()->email()); 1361 mEmailEdit->setText(KOPrefs::instance()->email());
1468 1362
1469 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1363 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1470 // QDate current ( 2001, 1,1); 1364
1471 //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1472 //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1473 //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1474 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1475 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1365 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1476 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1366 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1477 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1367 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1478 // if (KOPrefs::instance()->mAllDaySize > 47 )
1479 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1480 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1481 1368
1482 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1369 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1483 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1370 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1484 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1371 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1485 // mAMails->clear(); 1372 // mAMails->clear();
1486 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1373 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1487// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1374// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1488// QListViewItem *item = new QListViewItem(mAMails); 1375// QListViewItem *item = new QListViewItem(mAMails);
1489// item->setText(0,*it); 1376// item->setText(0,*it);
1490// mAMails->insertItem(item); 1377// mAMails->insertItem(item);
1491// } 1378// }
1492 1379
1493 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1494 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1495 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1496 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1497
1498 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1380 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1499 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1381 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1500 //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1501 //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1502 //dummy = KOPrefs::instance()->mUserDateFormatShort;
1503 //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1504 updateCategories(); 1382 updateCategories();
1505 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1383 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1506 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1384 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1507 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1385 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1508 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1386 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1509 } 1387
1510} 1388}
1511 1389
1512 1390
1513void KOPrefsDialog::usrWriteConfig() 1391void KOPrefsDialog::usrWriteConfig()
1514{ 1392{
1515 if ( kdelibcfg ) 1393
1516 kdelibcfg->writeConfig(); 1394
1517 else {
1518 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1519 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1520 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1521 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1522 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1523 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1395 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1524
1525 //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1526 //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1527 KOPrefs::instance()->setFullName(mNameEdit->text()); 1396 KOPrefs::instance()->setFullName(mNameEdit->text());
1528 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1397 KOPrefs::instance()->setEmail(mEmailEdit->text());
1529 1398
1530 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1399 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1531
1532 // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1533 //QDate date;
1534 //date = mStartDateSavingEdit->date();
1535 //int sub = 0;
1536 //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1537 // sub = 1;
1538// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1539// date = mEndDateSavingEdit->date();
1540// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1541// sub = 1;
1542// else
1543// sub = 0;
1544// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1545// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1546
1547 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1400 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1548 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1401 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1549 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1402 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1550 1403
1551 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1552
1553 QDictIterator<QColor> it(mCategoryDict); 1404 QDictIterator<QColor> it(mCategoryDict);
1554 while (it.current()) { 1405 while (it.current()) {
1555 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1406 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1556 ++it; 1407 ++it;
1557 } 1408 }
1558 1409
1559 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1410 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1560 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1411 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1561 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1412 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1562 1413
1563 KOPrefs::instance()->mAdditionalMails.clear(); 1414 KOPrefs::instance()->mAdditionalMails.clear();
1564 // QListViewItem *item; 1415 // QListViewItem *item;
1565 // item = mAMails->firstChild(); 1416 // item = mAMails->firstChild();
1566 // while (item) 1417 // while (item)
1567 // { 1418 // {
1568 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1419 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1569 // item = item->nextSibling(); 1420 // item = item->nextSibling();
1570 // } 1421 // }
1571 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1422 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1572 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1423 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1573 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1424 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1574 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1425 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1575 } 1426
1576} 1427}
1577 1428
1578void KOPrefsDialog::updateCategories() 1429void KOPrefsDialog::updateCategories()
1579{ 1430{
1580 mCategoryCombo->clear(); 1431 mCategoryCombo->clear();
1581 mCategoryDict.clear(); 1432 mCategoryDict.clear();
1582 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1433 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1583 updateCategoryColor(); 1434 updateCategoryColor();
1584} 1435}
1585 1436
1586void KOPrefsDialog::warningGroupScheduling()
1587{
1588 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1589}
1590
1591void KOPrefsDialog::warningProjectView()
1592{
1593 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1594}
1595
1596void KOPrefsDialog::warningExperimental(bool on)
1597{
1598 if (on) {
1599 KMessageBox::information(this,i18n("This is an experimental feature. "
1600 "It may not work, it may do nothing useful and it may cause data loss. "
1601 "Use with care.\n"
1602 "You have to restart KOrganizer for this setting to take effect."));
1603 } else {
1604 KMessageBox::information(this,
1605 i18n("You have to restart KOrganizer for this setting to take effect."));
1606 }
1607}
1608
1609void KOPrefsDialog::toggleEmailSettings(bool on) 1437void KOPrefsDialog::toggleEmailSettings(bool on)
1610{ 1438{
1611 if (on) { 1439 if (on) {
1612 mEmailEdit->setEnabled(false); 1440 mEmailEdit->setEnabled(false);
1613 mNameEdit->setEnabled(false); 1441 mNameEdit->setEnabled(false);
1614 mEmailLabel->setEnabled(false); 1442 mEmailLabel->setEnabled(false);
1615 mNameLabel->setEnabled(false); 1443 mNameLabel->setEnabled(false);
1616 1444
1617 KEMailSettings settings; 1445 KEMailSettings settings;
1618 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1446 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1619 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1447 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1620 } else { 1448 } else {
1621 mEmailEdit->setEnabled(true); 1449 mEmailEdit->setEnabled(true);
1622 mNameEdit->setEnabled(true); 1450 mNameEdit->setEnabled(true);
1623 mEmailLabel->setEnabled(true); 1451 mEmailLabel->setEnabled(true);
1624 mNameLabel->setEnabled(true); 1452 mNameLabel->setEnabled(true);
1625 } 1453 }
1626} 1454}
1627 1455
1628void KOPrefsDialog::addItem() 1456void KOPrefsDialog::addItem()
1629{ 1457{
1630 // aEmailsEdit->setEnabled(true); 1458 // aEmailsEdit->setEnabled(true);
1631// QListViewItem *item = new QListViewItem(mAMails); 1459// QListViewItem *item = new QListViewItem(mAMails);
1632// mAMails->insertItem(item); 1460// mAMails->insertItem(item);
1633// mAMails->setSelected(item,true); 1461// mAMails->setSelected(item,true);
1634// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1462// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1635} 1463}
1636 1464
1637void KOPrefsDialog::removeItem() 1465void KOPrefsDialog::removeItem()
1638{ 1466{
1639// QListViewItem *item; 1467// QListViewItem *item;
1640// item = mAMails->selectedItem(); 1468// item = mAMails->selectedItem();
1641// if (!item) return; 1469// if (!item) return;
1642// mAMails->takeItem(item); 1470// mAMails->takeItem(item);
1643// item = mAMails->selectedItem(); 1471// item = mAMails->selectedItem();
1644// if (!item) { 1472// if (!item) {
1645// aEmailsEdit->setText(""); 1473// aEmailsEdit->setText("");
1646// aEmailsEdit->setEnabled(false); 1474// aEmailsEdit->setEnabled(false);
1647// } 1475// }
1648// if (mAMails->childCount() == 0) { 1476// if (mAMails->childCount() == 0) {
1649// aEmailsEdit->setEnabled(false); 1477// aEmailsEdit->setEnabled(false);
1650// } 1478// }
1651} 1479}
1652 1480
1653void KOPrefsDialog::updateItem() 1481void KOPrefsDialog::updateItem()
1654{ 1482{
1655 // QListViewItem *item; 1483 // QListViewItem *item;
1656// item = mAMails->selectedItem(); 1484// item = mAMails->selectedItem();
1657// if (!item) return; 1485// if (!item) return;
1658// item->setText(0,aEmailsEdit->text()); 1486// item->setText(0,aEmailsEdit->text());
1659} 1487}
1660 1488
1661void KOPrefsDialog::updateInput() 1489void KOPrefsDialog::updateInput()
1662{ 1490{
1663// QListViewItem *item; 1491// QListViewItem *item;
1664// item = mAMails->selectedItem(); 1492// item = mAMails->selectedItem();
1665// if (!item) return; 1493// if (!item) return;
1666// aEmailsEdit->setEnabled(true); 1494// aEmailsEdit->setEnabled(true);
1667// aEmailsEdit->setText(item->text(0)); 1495// aEmailsEdit->setText(item->text(0));
1668} 1496}
1669void KOPrefsDialog::updateTimezoneOffset( int index )
1670{
1671 /*
1672 qDebug("updateTimezoneOffset %d ", index);
1673 if ( index < 24 ) {
1674 mTimezoneOffsetSpin->setEnabled ( false );
1675 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
1676
1677
1678 } else {
1679 if ( index == 24 ) {
1680 mTimezoneOffsetSpin->setEnabled ( true );
1681 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1682
1683 } else {
1684 mTimezoneOffsetSpin->setEnabled ( false );
1685 mTimezoneOffsetSpin->setValue( 0 );
1686 }
1687 }
1688 */
1689}
1690
1691void KOPrefsDialog::setupTimeZoneTab()
1692{
1693#if 0
1694 QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
1695 // DesktopIcon("clock",KIcon::SizeMedium));
1696
1697 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1698 topLayout->setSpacing(mSpacingHint);
1699 topLayout->setMargin(mMarginHint);
1700
1701 QHBox *timeZoneBox = new QHBox( topFrame );
1702 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1703
1704 new QLabel( i18n("Timezone:"), timeZoneBox );
1705 mTimeZoneCombo = new QComboBox( timeZoneBox );
1706 if ( QApplication::desktop()->width() < 300 ) {
1707 mTimeZoneCombo->setMaximumWidth(150);
1708 }
1709
1710 QStringList list;
1711 list = KGlobal::locale()->timeZoneList();
1712 mTimeZoneCombo->insertStringList(list);
1713
1714 // find the currently set time zone and select it
1715 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
1716 int nCurrentlySet = 11;
1717 for (int i = 0; i < mTimeZoneCombo->count(); i++)
1718 {
1719 if (mTimeZoneCombo->text(i) == sCurrentlySet)
1720 {
1721 nCurrentlySet = i;
1722 break;
1723 }
1724 }
1725 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
1726 int iii = 1;
1727 KPrefsDialogWidBool *sb =
1728 addWidBool(i18n("Timezone has daylight saving"),
1729 &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
1730 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
1731 ++iii;
1732 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
1733 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1734 ++iii;
1735 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
1736 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1737 ++iii;
1738 lab = new QLabel( i18n("Daylight start:"), topFrame );
1739 topLayout->addWidget(lab, iii,0);
1740 mStartDateSavingEdit = new KDateEdit(topFrame);
1741 topLayout->addWidget(mStartDateSavingEdit, iii,1);
1742 ++iii;
1743
1744 lab = new QLabel( i18n("Daylight end:"), topFrame );
1745 topLayout->addWidget(lab, iii,0);
1746 mEndDateSavingEdit = new KDateEdit(topFrame);
1747 topLayout->addWidget(mEndDateSavingEdit, iii,1);
1748 ++iii;
1749 QDate current ( 2001, 1,1);
1750 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1751 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1752#endif
1753
1754}
1755 1497
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index 6892028..80d6545 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -1,166 +1,154 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOPREFSDIALOG_H 23#ifndef _KOPREFSDIALOG_H
24#define _KOPREFSDIALOG_H 24#define _KOPREFSDIALOG_H
25 25
26#include <qframe.h> 26#include <qframe.h>
27#include <qdict.h> 27#include <qdict.h>
28#include <qcolor.h> 28#include <qcolor.h>
29#include <qlistview.h> 29#include <qlistview.h>
30 30
31#include <kdialogbase.h> 31#include <kdialogbase.h>
32 32
33#include <libkdepim/kprefsdialog.h> 33#include <libkdepim/kprefsdialog.h>
34#include <libkdepim/kdateedit.h> 34#include <libkdepim/kdateedit.h>
35#include <kcmconfigs/kdepimconfigwidget.h> 35#include <kcmconfigs/kdepimconfigwidget.h>
36 36
37class KColorButton; 37class KColorButton;
38class QSpinBox; 38class QSpinBox;
39class QSlider; 39class QSlider;
40class KURLRequester; 40class KURLRequester;
41class QComboBox; 41class QComboBox;
42class QLineEdit; 42class QLineEdit;
43class QStringList; 43class QStringList;
44 44
45/** Dialog to change the korganizer configuration. 45/** Dialog to change the korganizer configuration.
46 */ 46 */
47class KOPrefsDialog : public KPrefsDialog 47class KOPrefsDialog : public KPrefsDialog
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 /** Initialize dialog and pages */ 51 /** Initialize dialog and pages */
52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); 52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
53 ~KOPrefsDialog(); 53 ~KOPrefsDialog();
54 54
55 public slots: 55 public slots:
56 void showPrinterTab(); 56 void showPrinterTab();
57 57
58 /** Update controls for categories */ 58 /** Update controls for categories */
59 void updateCategories(); 59 void updateCategories();
60 void showSyncPage();
61 protected slots: 60 protected slots:
62 void selectSoundFile(); 61 void selectSoundFile();
63 void setCategoryColor(); 62 void setCategoryColor();
64 void updateCategoryColor(); 63 void updateCategoryColor();
65 void updateTimezoneOffset( int );
66
67
68 void warningExperimental(bool on);
69 void warningGroupScheduling();
70 void warningProjectView();
71
72 void toggleEmailSettings(bool); 64 void toggleEmailSettings(bool);
73 65
74 //additional emails 66 //additional emails
75 void addItem(); 67 void addItem();
76 void removeItem(); 68 void removeItem();
77 void updateItem(); 69 void updateItem();
78 void updateInput(); 70 void updateInput();
79 71
80 protected: 72 protected:
81 void usrReadConfig(); 73 void usrReadConfig();
82 void usrWriteConfig(); 74 void usrWriteConfig();
83 void setupGlobalTab(); 75 void setupGlobalTab();
84 76
85 void setupMainTab(); 77 void setupMainTab();
86 void setupTimeTab(); 78 void setupTimeTab();
87 void setupTimeZoneTab();
88 void setupLocaleTab(); 79 void setupLocaleTab();
89 void setupLocaleDateTab(); 80 void setupLocaleDateTab();
90 void setupFontsTab(); 81 void setupFontsTab();
91 void setupColorsTab(); 82 void setupColorsTab();
92 void setupViewsTab(); 83 void setupViewsTab();
93 void setupDisplayTab(); 84 void setupDisplayTab();
94 void setupPrinterTab(); 85 void setupPrinterTab();
95 void setupGroupSchedulingTab(); 86 void setupGroupSchedulingTab();
96 void setupGroupAutomationTab(); 87 void setupGroupAutomationTab();
97 void setupSyncTab();
98 void setupSyncAlgTab();
99 88
100 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 89 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
101 90
102 91
103 private: 92 private:
104 KDEPIMConfigWidget* kdelibcfg;
105 KPrefsDialogWidBool *mEnableGroupScheduling; 93 KPrefsDialogWidBool *mEnableGroupScheduling;
106 KPrefsDialogWidBool *mEnableProjectView; 94 KPrefsDialogWidBool *mEnableProjectView;
107 95
108 QFrame *mPrinterTab; 96 QFrame *mPrinterTab;
109 97
110 QLineEdit *nameEdit; 98 QLineEdit *nameEdit;
111 QLineEdit *emailEdit; 99 QLineEdit *emailEdit;
112 100
113 QComboBox *timeCombo; 101 QComboBox *timeCombo;
114 QComboBox *tzCombo; 102 QComboBox *tzCombo;
115 103
116 // widgets holding preferences data 104 // widgets holding preferences data
117 QLineEdit *mNameEdit; 105 QLineEdit *mNameEdit;
118 QLineEdit *mEmailEdit; 106 QLineEdit *mEmailEdit;
119 QLabel *mNameLabel; 107 QLabel *mNameLabel;
120 QLabel *mEmailLabel; 108 QLabel *mEmailLabel;
121 QLineEdit *mAdditionalEdit; 109 QLineEdit *mAdditionalEdit;
122 QSpinBox *mAutoSaveIntervalSpin; 110 QSpinBox *mAutoSaveIntervalSpin;
123 QSpinBox *mPrioSpin; 111 QSpinBox *mPrioSpin;
124 // QListView *mAMails; 112 // QListView *mAMails;
125 QLineEdit *aEmailsEdit; 113 QLineEdit *aEmailsEdit;
126 114
127 QComboBox *mTimeZoneCombo; 115 QComboBox *mTimeZoneCombo;
128 QStringList tzonenames; 116 QStringList tzonenames;
129 QSpinBox *mStartTimeSpin; 117 QSpinBox *mStartTimeSpin;
130 QSpinBox *mDefaultDurationSpin; 118 QSpinBox *mDefaultDurationSpin;
131 QComboBox *mAlarmTimeCombo; 119 QComboBox *mAlarmTimeCombo;
132 120
133 QComboBox *mCategoryCombo; 121 QComboBox *mCategoryCombo;
134 KColorButton *mCategoryButton; 122 KColorButton *mCategoryButton;
135 QDict<QColor> mCategoryDict; 123 QDict<QColor> mCategoryDict;
136 124
137 QSlider *mHourSizeSlider; 125 QSlider *mHourSizeSlider;
138 126
139 QSpinBox *mNextXDaysSpin; 127 QSpinBox *mNextXDaysSpin;
140 QSpinBox *mWhatsNextSpin; 128 QSpinBox *mWhatsNextSpin;
141 129
142 QLineEdit * mRemoteIPEdit; 130 QLineEdit * mRemoteIPEdit;
143 QLineEdit * mRemoteUser; 131 QLineEdit * mRemoteUser;
144 QLineEdit * mRemotePassWd; 132 QLineEdit * mRemotePassWd;
145 QLineEdit * mRemoteFile; 133 QLineEdit * mRemoteFile;
146 QLineEdit * mLocalTempFile; 134 QLineEdit * mLocalTempFile;
147 QWidget* mSetupSyncAlgTab; 135 QWidget* mSetupSyncAlgTab;
148 QLineEdit * mUserDateFormatLong; 136 QLineEdit * mUserDateFormatLong;
149 QLineEdit * mUserDateFormatShort; 137 QLineEdit * mUserDateFormatShort;
150 138
151 QSpinBox *mTimezoneOffsetSpin; 139 QSpinBox *mTimezoneOffsetSpin;
152 QSpinBox *mDaylightsavingStart; 140 QSpinBox *mDaylightsavingStart;
153 QSpinBox *mDaylightsavingEnd; 141 QSpinBox *mDaylightsavingEnd;
154 KDateEdit* mStartDateSavingEdit; 142 KDateEdit* mStartDateSavingEdit;
155 KDateEdit* mEndDateSavingEdit; 143 KDateEdit* mEndDateSavingEdit;
156 QSpinBox * mAlarmPlayBeeps; 144 QSpinBox * mAlarmPlayBeeps;
157 QSpinBox * mAlarmSuspendTime; 145 QSpinBox * mAlarmSuspendTime;
158 QSpinBox * mAlarmSuspendCount; 146 QSpinBox * mAlarmSuspendCount;
159 QSpinBox * mAlarmBeepInterval; 147 QSpinBox * mAlarmBeepInterval;
160 148
161 QLineEdit * mDefaultAlarmFile; 149 QLineEdit * mDefaultAlarmFile;
162 int mSpacingHint; 150 int mSpacingHint;
163 int mMarginHint; 151 int mMarginHint;
164}; 152};
165 153
166#endif 154#endif