-rw-r--r-- | kaddressbook/kabcore.cpp | 40 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.h | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 23 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 286 | ||||
-rw-r--r-- | korganizer/koprefsdialog.h | 12 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.cpp | 30 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.h | 26 |
9 files changed, 106 insertions, 316 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index cba5850..cd833cf 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -75,48 +75,49 @@ $Id$ | |||
75 | #include "addresseeeditordialog.h" | 75 | #include "addresseeeditordialog.h" |
76 | #include "extensionmanager.h" | 76 | #include "extensionmanager.h" |
77 | #include "kstdaction.h" | 77 | #include "kstdaction.h" |
78 | #include "kaddressbookservice.h" | 78 | #include "kaddressbookservice.h" |
79 | #include "ldapsearchdialog.h" | 79 | #include "ldapsearchdialog.h" |
80 | #include "printing/printingwizard.h" | 80 | #include "printing/printingwizard.h" |
81 | #else // KAB_EMBEDDED | 81 | #else // KAB_EMBEDDED |
82 | 82 | ||
83 | #include <kapplication.h> | 83 | #include <kapplication.h> |
84 | #include "KDGanttMinimizeSplitter.h" | 84 | #include "KDGanttMinimizeSplitter.h" |
85 | #include "kaddressbookmain.h" | 85 | #include "kaddressbookmain.h" |
86 | #include "kactioncollection.h" | 86 | #include "kactioncollection.h" |
87 | #include "addresseedialog.h" | 87 | #include "addresseedialog.h" |
88 | //US | 88 | //US |
89 | #include <addresseeview.h> | 89 | #include <addresseeview.h> |
90 | 90 | ||
91 | #include <qapp.h> | 91 | #include <qapp.h> |
92 | #include <qmenubar.h> | 92 | #include <qmenubar.h> |
93 | //#include <qtoolbar.h> | 93 | //#include <qtoolbar.h> |
94 | #include <qmessagebox.h> | 94 | #include <qmessagebox.h> |
95 | #include <kdebug.h> | 95 | #include <kdebug.h> |
96 | #include <kiconloader.h> // needed for SmallIcon | 96 | #include <kiconloader.h> // needed for SmallIcon |
97 | #include <kresources/kcmkresources.h> | 97 | #include <kresources/kcmkresources.h> |
98 | #include <ktoolbar.h> | 98 | #include <ktoolbar.h> |
99 | #include <kprefsdialog.h> | ||
99 | 100 | ||
100 | 101 | ||
101 | //#include <qlabel.h> | 102 | //#include <qlabel.h> |
102 | 103 | ||
103 | 104 | ||
104 | #ifndef DESKTOP_VERSION | 105 | #ifndef DESKTOP_VERSION |
105 | #include <qpe/ir.h> | 106 | #include <qpe/ir.h> |
106 | #include <qpe/qpemenubar.h> | 107 | #include <qpe/qpemenubar.h> |
107 | #include <qtopia/qcopenvelope_qws.h> | 108 | #include <qtopia/qcopenvelope_qws.h> |
108 | #else | 109 | #else |
109 | 110 | ||
110 | #include <qmenubar.h> | 111 | #include <qmenubar.h> |
111 | #endif | 112 | #endif |
112 | 113 | ||
113 | #endif // KAB_EMBEDDED | 114 | #endif // KAB_EMBEDDED |
114 | #include "kcmconfigs/kcmkabconfig.h" | 115 | #include "kcmconfigs/kcmkabconfig.h" |
115 | #include "kcmconfigs/kcmkdepimconfig.h" | 116 | #include "kcmconfigs/kcmkdepimconfig.h" |
116 | #include "kpimglobalprefs.h" | 117 | #include "kpimglobalprefs.h" |
117 | #include "externalapphandler.h" | 118 | #include "externalapphandler.h" |
118 | #include "xxportselectdialog.h" | 119 | #include "xxportselectdialog.h" |
119 | 120 | ||
120 | 121 | ||
121 | #include <kresources/selectdialog.h> | 122 | #include <kresources/selectdialog.h> |
122 | #include <kmessagebox.h> | 123 | #include <kmessagebox.h> |
@@ -1590,63 +1591,74 @@ QString KABCore::getNameByPhone( const QString &phone ) | |||
1590 | bool found = false; | 1591 | bool found = false; |
1591 | QString ownerName = ""; | 1592 | QString ownerName = ""; |
1592 | KABC::AddressBook::Iterator iter; | 1593 | KABC::AddressBook::Iterator iter; |
1593 | KABC::PhoneNumber::List::Iterator phoneIter; | 1594 | KABC::PhoneNumber::List::Iterator phoneIter; |
1594 | KABC::PhoneNumber::List phoneList; | 1595 | KABC::PhoneNumber::List phoneList; |
1595 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { | 1596 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { |
1596 | phoneList = (*iter).phoneNumbers(); | 1597 | phoneList = (*iter).phoneNumbers(); |
1597 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); | 1598 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); |
1598 | ++phoneIter) { | 1599 | ++phoneIter) { |
1599 | // Get rid of separator chars so just the numbers are compared. | 1600 | // Get rid of separator chars so just the numbers are compared. |
1600 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { | 1601 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { |
1601 | ownerName = (*iter).formattedName(); | 1602 | ownerName = (*iter).formattedName(); |
1602 | found = true; | 1603 | found = true; |
1603 | } | 1604 | } |
1604 | } | 1605 | } |
1605 | } | 1606 | } |
1606 | 1607 | ||
1607 | return ownerName; | 1608 | return ownerName; |
1608 | #else //KAB_EMBEDDED | 1609 | #else //KAB_EMBEDDED |
1609 | qDebug("KABCore::getNameByPhone finsih method"); | 1610 | qDebug("KABCore::getNameByPhone finsih method"); |
1610 | return ""; | 1611 | return ""; |
1611 | #endif //KAB_EMBEDDED | 1612 | #endif //KAB_EMBEDDED |
1612 | 1613 | ||
1613 | } | 1614 | } |
1614 | 1615 | void KABCore::openConfigGlobalDialog() | |
1616 | { | ||
1617 | KPimPrefsGlobalDialog gc ( this ); | ||
1618 | gc.exec(); | ||
1619 | } | ||
1615 | void KABCore::openConfigDialog() | 1620 | void KABCore::openConfigDialog() |
1616 | { | 1621 | { |
1617 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | 1622 | KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true); |
1618 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | ||
1619 | ConfigureDialog->addModule(kabcfg ); | ||
1620 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); | ||
1621 | ConfigureDialog->addModule(kdelibcfg ); | ||
1622 | 1623 | ||
1624 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog , "KCMKabConfig" ); | ||
1625 | ConfigureDialog->setMainWidget( kabcfg ); | ||
1623 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | 1626 | connect( ConfigureDialog, SIGNAL( applyClicked() ), |
1624 | this, SLOT( configurationChanged() ) ); | 1627 | this, SLOT( configurationChanged() ) ); |
1628 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | ||
1629 | kabcfg, SLOT( save() ) ); | ||
1625 | connect( ConfigureDialog, SIGNAL( okClicked() ), | 1630 | connect( ConfigureDialog, SIGNAL( okClicked() ), |
1626 | this, SLOT( configurationChanged() ) ); | 1631 | this, SLOT( configurationChanged() ) ); |
1632 | connect( ConfigureDialog, SIGNAL( okClicked() ), | ||
1633 | kabcfg, SLOT( save() ) ); | ||
1634 | connect( ConfigureDialog, SIGNAL( defaultClicked() ), | ||
1635 | kabcfg, SLOT( defaults() ) ); | ||
1627 | saveSettings(); | 1636 | saveSettings(); |
1637 | kabcfg->load(); | ||
1628 | #ifndef DESKTOP_VERSION | 1638 | #ifndef DESKTOP_VERSION |
1639 | if ( QApplication::desktop()->height() <= 480 ) | ||
1640 | ConfigureDialog->hideButtons(); | ||
1629 | ConfigureDialog->showMaximized(); | 1641 | ConfigureDialog->showMaximized(); |
1630 | #endif | 1642 | #endif |
1631 | if ( ConfigureDialog->exec() ) | 1643 | if ( ConfigureDialog->exec() ) |
1632 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); | 1644 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); |
1633 | delete ConfigureDialog; | 1645 | delete ConfigureDialog; |
1634 | } | 1646 | } |
1635 | 1647 | ||
1636 | void KABCore::openLDAPDialog() | 1648 | void KABCore::openLDAPDialog() |
1637 | { | 1649 | { |
1638 | #ifndef KAB_EMBEDDED | 1650 | #ifndef KAB_EMBEDDED |
1639 | if ( !mLdapSearchDialog ) { | 1651 | if ( !mLdapSearchDialog ) { |
1640 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); | 1652 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); |
1641 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, | 1653 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, |
1642 | SLOT( refreshView() ) ); | 1654 | SLOT( refreshView() ) ); |
1643 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, | 1655 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, |
1644 | SLOT( setModified() ) ); | 1656 | SLOT( setModified() ) ); |
1645 | } else | 1657 | } else |
1646 | mLdapSearchDialog->restoreSettings(); | 1658 | mLdapSearchDialog->restoreSettings(); |
1647 | 1659 | ||
1648 | if ( mLdapSearchDialog->isOK() ) | 1660 | if ( mLdapSearchDialog->isOK() ) |
1649 | mLdapSearchDialog->exec(); | 1661 | mLdapSearchDialog->exec(); |
1650 | #else //KAB_EMBEDDED | 1662 | #else //KAB_EMBEDDED |
1651 | qDebug("KABCore::openLDAPDialog() finsih method"); | 1663 | qDebug("KABCore::openLDAPDialog() finsih method"); |
1652 | #endif //KAB_EMBEDDED | 1664 | #endif //KAB_EMBEDDED |
@@ -2004,54 +2016,55 @@ void KABCore::initActions() | |||
2004 | // settings menu | 2016 | // settings menu |
2005 | #ifdef KAB_EMBEDDED | 2017 | #ifdef KAB_EMBEDDED |
2006 | //US special menuentry to configure the addressbook resources. On KDE | 2018 | //US special menuentry to configure the addressbook resources. On KDE |
2007 | // you do that through the control center !!! | 2019 | // you do that through the control center !!! |
2008 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, | 2020 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, |
2009 | SLOT( configureResources() ), actionCollection(), | 2021 | SLOT( configureResources() ), actionCollection(), |
2010 | "kaddressbook_configure_resources" ); | 2022 | "kaddressbook_configure_resources" ); |
2011 | #endif //KAB_EMBEDDED | 2023 | #endif //KAB_EMBEDDED |
2012 | 2024 | ||
2013 | if ( mIsPart ) { | 2025 | if ( mIsPart ) { |
2014 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, | 2026 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, |
2015 | SLOT( openConfigDialog() ), actionCollection(), | 2027 | SLOT( openConfigDialog() ), actionCollection(), |
2016 | "kaddressbook_configure" ); | 2028 | "kaddressbook_configure" ); |
2017 | 2029 | ||
2018 | //US not implemented yet | 2030 | //US not implemented yet |
2019 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, | 2031 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, |
2020 | // this, SLOT( configureKeyBindings() ), actionCollection(), | 2032 | // this, SLOT( configureKeyBindings() ), actionCollection(), |
2021 | // "kaddressbook_configure_shortcuts" ); | 2033 | // "kaddressbook_configure_shortcuts" ); |
2022 | #ifdef KAB_EMBEDDED | 2034 | #ifdef KAB_EMBEDDED |
2023 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); | 2035 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); |
2024 | mActionConfigureToolbars->setEnabled( false ); | 2036 | mActionConfigureToolbars->setEnabled( false ); |
2025 | #endif //KAB_EMBEDDED | 2037 | #endif //KAB_EMBEDDED |
2026 | 2038 | ||
2027 | } else { | 2039 | } else { |
2028 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); | 2040 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KA/Pi..." ), "configure", 0, this, |
2029 | 2041 | SLOT( openConfigDialog() ), actionCollection(), | |
2030 | //US not implemented yet | 2042 | "kaddressbook_configure" ); |
2031 | //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 2043 | mActionConfigGlobal = new KAction( i18n( "Global Settings..." ), "configure", 0, this, |
2044 | SLOT( openConfigGlobalDialog() ), actionCollection(), | ||
2045 | "kaddressbook_configure" ); | ||
2032 | } | 2046 | } |
2033 | |||
2034 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 2047 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
2035 | actionCollection(), "options_show_jump_bar" ); | 2048 | actionCollection(), "options_show_jump_bar" ); |
2036 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); | 2049 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); |
2037 | 2050 | ||
2038 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, | 2051 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, |
2039 | actionCollection(), "options_show_details" ); | 2052 | actionCollection(), "options_show_details" ); |
2040 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 2053 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
2041 | 2054 | ||
2042 | 2055 | ||
2043 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, | 2056 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, |
2044 | SLOT( toggleBeamReceive() ), actionCollection(), | 2057 | SLOT( toggleBeamReceive() ), actionCollection(), |
2045 | "kaddressbook_beam_rec" ); | 2058 | "kaddressbook_beam_rec" ); |
2046 | 2059 | ||
2047 | 2060 | ||
2048 | // misc | 2061 | // misc |
2049 | // only enable LDAP lookup if we can handle the protocol | 2062 | // only enable LDAP lookup if we can handle the protocol |
2050 | #ifndef KAB_EMBEDDED | 2063 | #ifndef KAB_EMBEDDED |
2051 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 2064 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
2052 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 2065 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
2053 | this, SLOT( openLDAPDialog() ), actionCollection(), | 2066 | this, SLOT( openLDAPDialog() ), actionCollection(), |
2054 | "ldap_lookup" ); | 2067 | "ldap_lookup" ); |
2055 | } | 2068 | } |
2056 | #else //KAB_EMBEDDED | 2069 | #else //KAB_EMBEDDED |
2057 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 2070 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
@@ -2222,50 +2235,51 @@ void KABCore::addActionsManually() | |||
2222 | fileMenu->insertSeparator(); | 2235 | fileMenu->insertSeparator(); |
2223 | mActionQuit->plug( fileMenu ); | 2236 | mActionQuit->plug( fileMenu ); |
2224 | #ifdef _OL_IMPORT_ | 2237 | #ifdef _OL_IMPORT_ |
2225 | mActionImportOL->plug( ImportMenu ); | 2238 | mActionImportOL->plug( ImportMenu ); |
2226 | #endif | 2239 | #endif |
2227 | // edit menu | 2240 | // edit menu |
2228 | mActionUndo->plug( editMenu ); | 2241 | mActionUndo->plug( editMenu ); |
2229 | mActionRedo->plug( editMenu ); | 2242 | mActionRedo->plug( editMenu ); |
2230 | editMenu->insertSeparator(); | 2243 | editMenu->insertSeparator(); |
2231 | mActionCut->plug( editMenu ); | 2244 | mActionCut->plug( editMenu ); |
2232 | mActionCopy->plug( editMenu ); | 2245 | mActionCopy->plug( editMenu ); |
2233 | mActionPaste->plug( editMenu ); | 2246 | mActionPaste->plug( editMenu ); |
2234 | mActionDelete->plug( editMenu ); | 2247 | mActionDelete->plug( editMenu ); |
2235 | editMenu->insertSeparator(); | 2248 | editMenu->insertSeparator(); |
2236 | mActionSelectAll->plug( editMenu ); | 2249 | mActionSelectAll->plug( editMenu ); |
2237 | 2250 | ||
2238 | mActionSetFormattedName->plug( changeMenu ); | 2251 | mActionSetFormattedName->plug( changeMenu ); |
2239 | mActionRemoveVoice->plug( changeMenu ); | 2252 | mActionRemoveVoice->plug( changeMenu ); |
2240 | // settingsmings menu | 2253 | // settingsmings menu |
2241 | //US special menuentry to configure the addressbook resources. On KDE | 2254 | //US special menuentry to configure the addressbook resources. On KDE |
2242 | // you do that through the control center !!! | 2255 | // you do that through the control center !!! |
2243 | // settingsMenu->insertSeparator(); | 2256 | // settingsMenu->insertSeparator(); |
2244 | 2257 | ||
2245 | mActionConfigKAddressbook->plug( settingsMenu, 0 ); | 2258 | mActionConfigKAddressbook->plug( settingsMenu, 0 ); |
2246 | mActionConfigResources->plug( settingsMenu,1 ); | 2259 | mActionConfigGlobal->plug( settingsMenu, 1 ); |
2247 | settingsMenu->insertSeparator(2); | 2260 | mActionConfigResources->plug( settingsMenu,2 ); |
2261 | settingsMenu->insertSeparator(3); | ||
2248 | 2262 | ||
2249 | if ( mIsPart ) { | 2263 | if ( mIsPart ) { |
2250 | //US not implemented yet | 2264 | //US not implemented yet |
2251 | //mActionConfigShortcuts->plug( settingsMenu ); | 2265 | //mActionConfigShortcuts->plug( settingsMenu ); |
2252 | //mActionConfigureToolbars->plug( settingsMenu ); | 2266 | //mActionConfigureToolbars->plug( settingsMenu ); |
2253 | 2267 | ||
2254 | } else { | 2268 | } else { |
2255 | //US not implemented yet | 2269 | //US not implemented yet |
2256 | //mActionKeyBindings->plug( settingsMenu ); | 2270 | //mActionKeyBindings->plug( settingsMenu ); |
2257 | } | 2271 | } |
2258 | 2272 | ||
2259 | mActionEditCategories->plug( settingsMenu ); | 2273 | mActionEditCategories->plug( settingsMenu ); |
2260 | mActionManageCategories->plug( settingsMenu ); | 2274 | mActionManageCategories->plug( settingsMenu ); |
2261 | mActionJumpBar->plug( viewMenu,0 ); | 2275 | mActionJumpBar->plug( viewMenu,0 ); |
2262 | mActionDetails->plug( viewMenu,0 ); | 2276 | mActionDetails->plug( viewMenu,0 ); |
2263 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2277 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
2264 | mActionDetails->plug( tb ); | 2278 | mActionDetails->plug( tb ); |
2265 | settingsMenu->insertSeparator(); | 2279 | settingsMenu->insertSeparator(); |
2266 | #ifndef DESKTOP_VERSION | 2280 | #ifndef DESKTOP_VERSION |
2267 | if ( Ir::supported() ) mActionBR->plug(settingsMenu ); | 2281 | if ( Ir::supported() ) mActionBR->plug(settingsMenu ); |
2268 | settingsMenu->insertSeparator(); | 2282 | settingsMenu->insertSeparator(); |
2269 | #endif | 2283 | #endif |
2270 | 2284 | ||
2271 | mActionWhoAmI->plug( settingsMenu ); | 2285 | mActionWhoAmI->plug( settingsMenu ); |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 80dbf08..6479a58 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -306,48 +306,49 @@ class KABCore : public QWidget, public KSyncInterface | |||
306 | 306 | ||
307 | /** | 307 | /** |
308 | Redos the last command that was undone, using the redo stack. | 308 | Redos the last command that was undone, using the redo stack. |
309 | */ | 309 | */ |
310 | void redo(); | 310 | void redo(); |
311 | 311 | ||
312 | /** | 312 | /** |
313 | Shows the edit dialog for the given uid. If the uid is QString::null, | 313 | Shows the edit dialog for the given uid. If the uid is QString::null, |
314 | the method will try to find a selected addressee in the view. | 314 | the method will try to find a selected addressee in the view. |
315 | */ | 315 | */ |
316 | void editContact( const QString &uid /*US = QString::null*/ ); | 316 | void editContact( const QString &uid /*US = QString::null*/ ); |
317 | //US added a second method without defaultparameter | 317 | //US added a second method without defaultparameter |
318 | void editContact2(); | 318 | void editContact2(); |
319 | 319 | ||
320 | /** | 320 | /** |
321 | Shows or edits the detail view for the given uid. If the uid is QString::null, | 321 | Shows or edits the detail view for the given uid. If the uid is QString::null, |
322 | the method will try to find a selected addressee in the view. | 322 | the method will try to find a selected addressee in the view. |
323 | */ | 323 | */ |
324 | void executeContact( const QString &uid /*US = QString::null*/ ); | 324 | void executeContact( const QString &uid /*US = QString::null*/ ); |
325 | 325 | ||
326 | /** | 326 | /** |
327 | Launches the configuration dialog. | 327 | Launches the configuration dialog. |
328 | */ | 328 | */ |
329 | void openConfigDialog(); | 329 | void openConfigDialog(); |
330 | void openConfigGlobalDialog(); | ||
330 | 331 | ||
331 | /** | 332 | /** |
332 | Launches the ldap search dialog. | 333 | Launches the ldap search dialog. |
333 | */ | 334 | */ |
334 | void openLDAPDialog(); | 335 | void openLDAPDialog(); |
335 | 336 | ||
336 | /** | 337 | /** |
337 | Creates a KAddressBookPrinter, which will display the print | 338 | Creates a KAddressBookPrinter, which will display the print |
338 | dialog and do the printing. | 339 | dialog and do the printing. |
339 | */ | 340 | */ |
340 | void print(); | 341 | void print(); |
341 | 342 | ||
342 | /** | 343 | /** |
343 | Registers a new GUI client, so plugins can register its actions. | 344 | Registers a new GUI client, so plugins can register its actions. |
344 | */ | 345 | */ |
345 | void addGUIClient( KXMLGUIClient *client ); | 346 | void addGUIClient( KXMLGUIClient *client ); |
346 | 347 | ||
347 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); | 348 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); |
348 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 349 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); |
349 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); | 350 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); |
350 | 351 | ||
351 | 352 | ||
352 | signals: | 353 | signals: |
353 | void contactSelected( const QString &name ); | 354 | void contactSelected( const QString &name ); |
@@ -437,48 +438,49 @@ class KABCore : public QWidget, public KSyncInterface | |||
437 | KAction *mActionBeam; | 438 | KAction *mActionBeam; |
438 | KToggleAction *mActionBR; | 439 | KToggleAction *mActionBR; |
439 | KAction *mActionExport2phone; | 440 | KAction *mActionExport2phone; |
440 | KAction* mActionPrint; | 441 | KAction* mActionPrint; |
441 | KAction* mActionPrintDetails; | 442 | KAction* mActionPrintDetails; |
442 | KAction* mActionNewContact; | 443 | KAction* mActionNewContact; |
443 | KAction *mActionSave; | 444 | KAction *mActionSave; |
444 | KAction *mActionEditAddressee; | 445 | KAction *mActionEditAddressee; |
445 | KAction *mActionMailVCard; | 446 | KAction *mActionMailVCard; |
446 | KAction *mActionBeamVCard; | 447 | KAction *mActionBeamVCard; |
447 | 448 | ||
448 | KAction *mActionQuit; | 449 | KAction *mActionQuit; |
449 | 450 | ||
450 | //US edit menu | 451 | //US edit menu |
451 | KAction *mActionCopy; | 452 | KAction *mActionCopy; |
452 | KAction *mActionCut; | 453 | KAction *mActionCut; |
453 | KAction *mActionPaste; | 454 | KAction *mActionPaste; |
454 | KAction *mActionSelectAll; | 455 | KAction *mActionSelectAll; |
455 | KAction *mActionUndo; | 456 | KAction *mActionUndo; |
456 | KAction *mActionRedo; | 457 | KAction *mActionRedo; |
457 | KAction *mActionDelete; | 458 | KAction *mActionDelete; |
458 | 459 | ||
459 | //US settings menu | 460 | //US settings menu |
460 | KAction *mActionConfigResources; | 461 | KAction *mActionConfigResources; |
462 | KAction *mActionConfigGlobal; | ||
461 | KAction *mActionConfigKAddressbook; | 463 | KAction *mActionConfigKAddressbook; |
462 | KAction *mActionConfigShortcuts; | 464 | KAction *mActionConfigShortcuts; |
463 | KAction *mActionConfigureToolbars; | 465 | KAction *mActionConfigureToolbars; |
464 | KAction *mActionKeyBindings; | 466 | KAction *mActionKeyBindings; |
465 | KToggleAction *mActionJumpBar; | 467 | KToggleAction *mActionJumpBar; |
466 | KToggleAction *mActionDetails; | 468 | KToggleAction *mActionDetails; |
467 | KAction *mActionWhoAmI; | 469 | KAction *mActionWhoAmI; |
468 | KAction *mActionCategories; | 470 | KAction *mActionCategories; |
469 | KAction *mActionEditCategories; | 471 | KAction *mActionEditCategories; |
470 | KAction *mActionManageCategories; | 472 | KAction *mActionManageCategories; |
471 | KAction *mActionAboutKAddressbook; | 473 | KAction *mActionAboutKAddressbook; |
472 | KAction *mActionLicence; | 474 | KAction *mActionLicence; |
473 | KAction *mActionFaq; | 475 | KAction *mActionFaq; |
474 | KAction *mActionWN; | 476 | KAction *mActionWN; |
475 | KAction *mActionSyncHowto; | 477 | KAction *mActionSyncHowto; |
476 | KAction *mActionStorageHowto; | 478 | KAction *mActionStorageHowto; |
477 | KAction *mActionKdeSyncHowto; | 479 | KAction *mActionKdeSyncHowto; |
478 | KAction *mActionMultiSyncHowto; | 480 | KAction *mActionMultiSyncHowto; |
479 | 481 | ||
480 | KAction *mActionDeleteView; | 482 | KAction *mActionDeleteView; |
481 | 483 | ||
482 | QPopupMenu *viewMenu; | 484 | QPopupMenu *viewMenu; |
483 | QPopupMenu *filterMenu; | 485 | QPopupMenu *filterMenu; |
484 | QPopupMenu *settingsMenu; | 486 | QPopupMenu *settingsMenu; |
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h index 2ecbfef..2af10d7 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.h +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h | |||
@@ -14,34 +14,34 @@ | |||
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 | #ifndef KCMKABCONFIG_H | 24 | #ifndef KCMKABCONFIG_H |
25 | #define KCMKABCONFIG_H | 25 | #define KCMKABCONFIG_H |
26 | 26 | ||
27 | #include <kcmodule.h> | 27 | #include <kcmodule.h> |
28 | 28 | ||
29 | class KABConfigWidget; | 29 | class KABConfigWidget; |
30 | class KABPrefs; | 30 | class KABPrefs; |
31 | 31 | ||
32 | class KCMKabConfig : public KCModule | 32 | class KCMKabConfig : public KCModule |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | 35 | ||
36 | public: | 36 | public: |
37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); | 37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); |
38 | 38 | public slots: | |
39 | virtual void load(); | 39 | virtual void load(); |
40 | virtual void save(); | 40 | virtual void save(); |
41 | virtual void defaults(); | 41 | virtual void defaults(); |
42 | 42 | ||
43 | private: | 43 | private: |
44 | KABConfigWidget *mConfigWidget; | 44 | KABConfigWidget *mConfigWidget; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #endif | 47 | #endif |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 4794414..2a55127 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2510,48 +2510,49 @@ void CalendarView::edit_copy() | |||
2510 | DndFactory factory( mCalendar ); | 2510 | DndFactory factory( mCalendar ); |
2511 | factory.copyIncidence(anEvent); | 2511 | factory.copyIncidence(anEvent); |
2512 | } | 2512 | } |
2513 | 2513 | ||
2514 | void CalendarView::edit_paste() | 2514 | void 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 | } |
2523 | void CalendarView::edit_global_options() | 2523 | void 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 | } |
2543 | void CalendarView::edit_options() | 2544 | void CalendarView::edit_options() |
2544 | { | 2545 | { |
2545 | mDialogManager->showOptionsDialog(); | 2546 | mDialogManager->showOptionsDialog(); |
2546 | } | 2547 | } |
2547 | 2548 | ||
2548 | 2549 | ||
2549 | void CalendarView::slotSelectPickerDate( QDate d) | 2550 | void 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; |
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index aa30c52..3dfa344 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -69,81 +69,68 @@ KODialogManager::~KODialogManager() | |||
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 | ||
75 | OutgoingDialog *KODialogManager::outgoingDialog() | 75 | OutgoingDialog *KODialogManager::outgoingDialog() |
76 | { | 76 | { |
77 | createOutgoingDialog(); | 77 | createOutgoingDialog(); |
78 | return mOutgoingDialog; | 78 | return mOutgoingDialog; |
79 | } | 79 | } |
80 | 80 | ||
81 | void KODialogManager::createOutgoingDialog() | 81 | void 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 | ||
91 | void KODialogManager::showGlobalOptionsDialog( bool showSync ) | 91 | void 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 | } |
110 | void KODialogManager::showOptionsDialog( bool showSync ) | 98 | void 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 | } |
130 | void KODialogManager::showSyncOptions() | 117 | void KODialogManager::showSyncOptions() |
131 | { | 118 | { |
132 | showGlobalOptionsDialog( true ); | 119 | showGlobalOptionsDialog( true ); |
133 | 120 | ||
134 | } | 121 | } |
135 | void KODialogManager::showOutgoingDialog() | 122 | void KODialogManager::showOutgoingDialog() |
136 | { | 123 | { |
137 | createOutgoingDialog(); | 124 | createOutgoingDialog(); |
138 | mOutgoingDialog->show(); | 125 | mOutgoingDialog->show(); |
139 | mOutgoingDialog->raise(); | 126 | mOutgoingDialog->raise(); |
140 | } | 127 | } |
141 | 128 | ||
142 | IncomingDialog *KODialogManager::incomingDialog() | 129 | IncomingDialog *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()), |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 4b5b66a..b782bb1 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -65,80 +65,73 @@ | |||
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 | ||
74 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 74 | KOPrefsDialog::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 | ||
111 | KOPrefsDialog::~KOPrefsDialog() | 108 | KOPrefsDialog::~KOPrefsDialog() |
112 | { | 109 | { |
113 | } | 110 | } |
114 | void KOPrefsDialog::setupGlobalTab() | 111 | void 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 | } |
123 | void KOPrefsDialog::setupLocaleDateTab() | 116 | void KOPrefsDialog::setupLocaleDateTab() |
124 | { | 117 | { |
125 | #if 0 | 118 | #if 0 |
126 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 119 | QFrame *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)"; |
@@ -219,145 +212,48 @@ void KOPrefsDialog::setupLocaleTab() | |||
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 | } |
243 | void KOPrefsDialog::showSyncPage() | ||
244 | { | ||
245 | // showPage ( 0 ) ; | ||
246 | kdelibcfg->showTimeZoneTab() ; | ||
247 | |||
248 | } | ||
249 | void 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 | |||
291 | void 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 | ||
341 | void KOPrefsDialog::setupMainTab() | 237 | void 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); |
@@ -1439,194 +1335,126 @@ void KOPrefsDialog::setupGroupAutomationTab() | |||
1439 | void KOPrefsDialog::showPrinterTab() | 1335 | void KOPrefsDialog::showPrinterTab() |
1440 | { | 1336 | { |
1441 | showPage(pageIndex(mPrinterTab)); | 1337 | showPage(pageIndex(mPrinterTab)); |
1442 | } | 1338 | } |
1443 | 1339 | ||
1444 | 1340 | ||
1445 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, | 1341 | void 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 | ||
1461 | void KOPrefsDialog::usrReadConfig() | 1357 | void 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 | ||
1513 | void KOPrefsDialog::usrWriteConfig() | 1391 | void 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 | ||
1578 | void KOPrefsDialog::updateCategories() | 1429 | void 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 | ||
1586 | void KOPrefsDialog::warningGroupScheduling() | ||
1587 | { | ||
1588 | warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); | ||
1589 | } | ||
1590 | |||
1591 | void KOPrefsDialog::warningProjectView() | ||
1592 | { | ||
1593 | warningExperimental(mEnableProjectView->checkBox()->isChecked()); | ||
1594 | } | ||
1595 | |||
1596 | void 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 | |||
1609 | void KOPrefsDialog::toggleEmailSettings(bool on) | 1437 | void 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 | ||
1628 | void KOPrefsDialog::addItem() | 1456 | void 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); |
@@ -1645,111 +1473,25 @@ void KOPrefsDialog::removeItem() | |||
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 | ||
1653 | void KOPrefsDialog::updateItem() | 1481 | void 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 | ||
1661 | void KOPrefsDialog::updateInput() | 1489 | void 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 | } |
1669 | void 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 | |||
1691 | void 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 | |||
@@ -36,93 +36,81 @@ | |||
36 | 36 | ||
37 | class KColorButton; | 37 | class KColorButton; |
38 | class QSpinBox; | 38 | class QSpinBox; |
39 | class QSlider; | 39 | class QSlider; |
40 | class KURLRequester; | 40 | class KURLRequester; |
41 | class QComboBox; | 41 | class QComboBox; |
42 | class QLineEdit; | 42 | class QLineEdit; |
43 | class QStringList; | 43 | class QStringList; |
44 | 44 | ||
45 | /** Dialog to change the korganizer configuration. | 45 | /** Dialog to change the korganizer configuration. |
46 | */ | 46 | */ |
47 | class KOPrefsDialog : public KPrefsDialog | 47 | class 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; |
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index b6ae775..6dc741d 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp | |||
@@ -26,54 +26,56 @@ | |||
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qgroupbox.h> | 28 | #include <qgroupbox.h> |
29 | #include <qbuttongroup.h> | 29 | #include <qbuttongroup.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qfont.h> | 31 | #include <qfont.h> |
32 | #include <qslider.h> | 32 | #include <qslider.h> |
33 | #include <qfile.h> | 33 | #include <qfile.h> |
34 | #include <qtextstream.h> | 34 | #include <qtextstream.h> |
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | #include <qhbox.h> | 36 | #include <qhbox.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qframe.h> | 39 | #include <qframe.h> |
40 | #include <qcombobox.h> | 40 | #include <qcombobox.h> |
41 | #include <qcheckbox.h> | 41 | #include <qcheckbox.h> |
42 | #include <qradiobutton.h> | 42 | #include <qradiobutton.h> |
43 | #include <qpushbutton.h> | 43 | #include <qpushbutton.h> |
44 | #include <qapplication.h> | 44 | #include <qapplication.h> |
45 | 45 | ||
46 | #include <kcolorbutton.h> | 46 | #include <kcolorbutton.h> |
47 | #include <kdebug.h> | 47 | #include <kdebug.h> |
48 | #include <klocale.h> | 48 | #include <klocale.h> |
49 | #include <kglobal.h> | 49 | #include <kglobal.h> |
50 | #include <kglobalsettings.h> | ||
50 | #include <kfontdialog.h> | 51 | #include <kfontdialog.h> |
51 | #include <kmessagebox.h> | 52 | #include <kmessagebox.h> |
52 | #include <kcolordialog.h> | 53 | #include <kcolordialog.h> |
53 | #include <kiconloader.h> | 54 | #include <kiconloader.h> |
54 | 55 | ||
55 | #include "kprefs.h" | 56 | #include "kprefs.h" |
57 | #include "kpimglobalprefs.h" | ||
56 | 58 | ||
57 | #include "kprefsdialog.h" | 59 | #include "kprefsdialog.h" |
58 | //#include "kprefsdialog.moc" | 60 | //#include "kprefsdialog.moc" |
59 | 61 | ||
60 | KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference, | 62 | KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference, |
61 | QWidget *parent) | 63 | QWidget *parent) |
62 | { | 64 | { |
63 | mReference = reference; | 65 | mReference = reference; |
64 | 66 | ||
65 | mCheck = new QCheckBox(text,parent); | 67 | mCheck = new QCheckBox(text,parent); |
66 | } | 68 | } |
67 | 69 | ||
68 | void KPrefsDialogWidBool::readConfig() | 70 | void KPrefsDialogWidBool::readConfig() |
69 | { | 71 | { |
70 | mCheck->setChecked(*mReference); | 72 | mCheck->setChecked(*mReference); |
71 | } | 73 | } |
72 | 74 | ||
73 | void KPrefsDialogWidBool::writeConfig() | 75 | void KPrefsDialogWidBool::writeConfig() |
74 | { | 76 | { |
75 | *mReference = mCheck->isChecked(); | 77 | *mReference = mCheck->isChecked(); |
76 | } | 78 | } |
77 | 79 | ||
78 | QCheckBox *KPrefsDialogWidBool::checkBox() | 80 | QCheckBox *KPrefsDialogWidBool::checkBox() |
79 | { | 81 | { |
@@ -387,24 +389,52 @@ void KPrefsDialog::writeConfig() | |||
387 | void KPrefsDialog::slotApply() | 389 | void KPrefsDialog::slotApply() |
388 | { | 390 | { |
389 | writeConfig(); | 391 | writeConfig(); |
390 | emit configChanged(); | 392 | emit configChanged(); |
391 | } | 393 | } |
392 | 394 | ||
393 | void KPrefsDialog::slotOk() | 395 | void KPrefsDialog::slotOk() |
394 | { | 396 | { |
395 | slotApply(); | 397 | slotApply(); |
396 | QDialog::accept(); | 398 | QDialog::accept(); |
397 | } | 399 | } |
398 | void KPrefsDialog::accept() | 400 | void KPrefsDialog::accept() |
399 | { | 401 | { |
400 | slotOk(); | 402 | slotOk(); |
401 | } | 403 | } |
402 | 404 | ||
403 | void KPrefsDialog::slotDefault() | 405 | void KPrefsDialog::slotDefault() |
404 | { | 406 | { |
405 | if (KMessageBox::warningContinueCancel(this, | 407 | if (KMessageBox::warningContinueCancel(this, |
406 | i18n("You are about to set all\npreferences to default values.\nAll " | 408 | i18n("You are about to set all\npreferences to default values.\nAll " |
407 | "custom modifications will be lost."),i18n("Setting Default Preferences"), | 409 | "custom modifications will be lost."),i18n("Setting Default Preferences"), |
408 | i18n("Continue")) | 410 | i18n("Continue")) |
409 | == KMessageBox::Continue) setDefaults(); | 411 | == KMessageBox::Continue) setDefaults(); |
410 | } | 412 | } |
413 | |||
414 | KPimPrefsGlobalDialog::KPimPrefsGlobalDialog(QWidget *parent,char *name,bool modal): KPrefsDialog( KPimGlobalPrefs::instance() ,parent, name, modal ) | ||
415 | { | ||
416 | setFont( KGlobalSettings::generalMaxFont() ); | ||
417 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KPrefsGlobalDialog" ); | ||
418 | setMainWidget( kdelibcfg ); | ||
419 | setCaption( i18n("KDE-Pim Global Settings")); | ||
420 | kdelibcfg->readConfig(); | ||
421 | #ifndef DESKTOP_VERSION | ||
422 | if ( QApplication::desktop()->height() <= 480 ) | ||
423 | hideButtons(); | ||
424 | showMaximized(); | ||
425 | #endif | ||
426 | } | ||
427 | void KPimPrefsGlobalDialog::showTZconfig() | ||
428 | { | ||
429 | kdelibcfg->showTimeZoneTab() ; | ||
430 | } | ||
431 | void KPimPrefsGlobalDialog::usrReadConfig() | ||
432 | { | ||
433 | kdelibcfg->readConfig(); | ||
434 | } | ||
435 | |||
436 | void KPimPrefsGlobalDialog::usrWriteConfig() | ||
437 | { | ||
438 | kdelibcfg->writeConfig(); | ||
439 | } | ||
440 | |||
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index efcb86a..52ec809 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h | |||
@@ -421,25 +421,51 @@ class KPrefsDialog : public KDialogBase | |||
421 | 421 | ||
422 | protected slots: | 422 | protected slots: |
423 | /** Apply changes to preferences */ | 423 | /** Apply changes to preferences */ |
424 | void slotApply(); | 424 | void slotApply(); |
425 | 425 | ||
426 | void accept(); | 426 | void accept(); |
427 | /** Accept changes to preferences and close dialog */ | 427 | /** Accept changes to preferences and close dialog */ |
428 | void slotOk(); | 428 | void slotOk(); |
429 | 429 | ||
430 | /** Set preferences to default values */ | 430 | /** Set preferences to default values */ |
431 | void slotDefault(); | 431 | void slotDefault(); |
432 | 432 | ||
433 | protected: | 433 | protected: |
434 | /** Implement this to read custom configuration widgets. */ | 434 | /** Implement this to read custom configuration widgets. */ |
435 | virtual void usrReadConfig() {} | 435 | virtual void usrReadConfig() {} |
436 | /** Implement this to write custom configuration widgets. */ | 436 | /** Implement this to write custom configuration widgets. */ |
437 | virtual void usrWriteConfig() {} | 437 | virtual void usrWriteConfig() {} |
438 | 438 | ||
439 | private: | 439 | private: |
440 | KPrefs *mPrefs; | 440 | KPrefs *mPrefs; |
441 | 441 | ||
442 | QPtrList<KPrefsDialogWid> mPrefsWids; | 442 | QPtrList<KPrefsDialogWid> mPrefsWids; |
443 | }; | 443 | }; |
444 | 444 | ||
445 | |||
446 | #include "kcmconfigs/kdepimconfigwidget.h" | ||
447 | class KPimPrefsGlobalDialog : public KPrefsDialog | ||
448 | { | ||
449 | Q_OBJECT | ||
450 | public: | ||
451 | KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true); | ||
452 | /** | ||
453 | Destructor. | ||
454 | */ | ||
455 | void showTZconfig(); | ||
456 | |||
457 | public slots: | ||
458 | |||
459 | signals: | ||
460 | protected slots: | ||
461 | |||
462 | protected: | ||
463 | void usrReadConfig(); | ||
464 | virtual void usrWriteConfig() ; | ||
465 | |||
466 | private: | ||
467 | KDEPIMConfigWidget* kdelibcfg; | ||
468 | |||
469 | }; | ||
470 | |||
445 | #endif | 471 | #endif |