author | ulf69 <ulf69> | 2004-08-06 20:34:07 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-06 20:34:07 (UTC) |
commit | 4cbb59835b52b524c9fcbb377159d91a97e1b626 (patch) (unidiff) | |
tree | b2b4fe7fa037b1d4395f71873f086e11ac97e80f /kaddressbook | |
parent | 26697d027609149853b984874190e2624749b7e3 (diff) | |
download | kdepimpi-4cbb59835b52b524c9fcbb377159d91a97e1b626.zip kdepimpi-4cbb59835b52b524c9fcbb377159d91a97e1b626.tar.gz kdepimpi-4cbb59835b52b524c9fcbb377159d91a97e1b626.tar.bz2 |
kcmultidialog can now handle the configuration of multiple applications at once
-rw-r--r-- | kaddressbook/kabcore.cpp | 16 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 10 | ||||
-rw-r--r-- | kaddressbook/kaddressbook.pro | 2 | ||||
-rw-r--r-- | kaddressbook/kaddressbookE.pro | 2 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 110 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 10 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.cpp | 60 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.h | 50 |
9 files changed, 78 insertions, 184 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2494aa2..1667400 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -47,77 +47,77 @@ | |||
47 | #include <kmessagebox.h> | 47 | #include <kmessagebox.h> |
48 | #include <kprinter.h> | 48 | #include <kprinter.h> |
49 | #include <kprotocolinfo.h> | 49 | #include <kprotocolinfo.h> |
50 | #include <kresources/selectdialog.h> | 50 | #include <kresources/selectdialog.h> |
51 | #include <kstandarddirs.h> | 51 | #include <kstandarddirs.h> |
52 | #include <ktempfile.h> | 52 | #include <ktempfile.h> |
53 | #include <kxmlguiclient.h> | 53 | #include <kxmlguiclient.h> |
54 | #include <kaboutdata.h> | 54 | #include <kaboutdata.h> |
55 | #include <libkdepim/categoryselectdialog.h> | 55 | #include <libkdepim/categoryselectdialog.h> |
56 | 56 | ||
57 | #include "addresseeutil.h" | 57 | #include "addresseeutil.h" |
58 | #include "addresseeeditordialog.h" | 58 | #include "addresseeeditordialog.h" |
59 | #include "extensionmanager.h" | 59 | #include "extensionmanager.h" |
60 | #include "kstdaction.h" | 60 | #include "kstdaction.h" |
61 | #include "kaddressbookservice.h" | 61 | #include "kaddressbookservice.h" |
62 | #include "ldapsearchdialog.h" | 62 | #include "ldapsearchdialog.h" |
63 | #include "printing/printingwizard.h" | 63 | #include "printing/printingwizard.h" |
64 | #else // KAB_EMBEDDED | 64 | #else // KAB_EMBEDDED |
65 | 65 | ||
66 | #include <kapplication.h> | 66 | #include <kapplication.h> |
67 | #include "KDGanttMinimizeSplitter.h" | 67 | #include "KDGanttMinimizeSplitter.h" |
68 | #include "kaddressbookmain.h" | 68 | #include "kaddressbookmain.h" |
69 | #include "kactioncollection.h" | 69 | #include "kactioncollection.h" |
70 | #include <qapp.h> | 70 | #include <qapp.h> |
71 | #include <qmenubar.h> | 71 | #include <qmenubar.h> |
72 | //#include <qtoolbar.h> | 72 | //#include <qtoolbar.h> |
73 | #include <qmessagebox.h> | 73 | #include <qmessagebox.h> |
74 | #include <kdebug.h> | 74 | #include <kdebug.h> |
75 | #include <kiconloader.h> // needed for SmallIcon | 75 | #include <kiconloader.h> // needed for SmallIcon |
76 | #include <kresources/kcmkresources.h> | 76 | #include <kresources/kcmkresources.h> |
77 | #include <ktoolbar.h> | 77 | #include <ktoolbar.h> |
78 | 78 | ||
79 | #include <kcmkabconfig.h> | ||
80 | 79 | ||
81 | //#include <qlabel.h> | 80 | //#include <qlabel.h> |
82 | 81 | ||
83 | 82 | ||
84 | #ifdef Q_WS_QWS | 83 | #ifdef Q_WS_QWS |
85 | #include <qtopia/services.h> | 84 | #include <qtopia/services.h> |
86 | #include <qtopia/qcopenvelope_qws.h> | 85 | #include <qtopia/qcopenvelope_qws.h> |
87 | #endif | 86 | #endif |
88 | #include <qpe/ir.h> | 87 | #include <qpe/ir.h> |
89 | 88 | ||
90 | #endif // KAB_EMBEDDED | 89 | #endif // KAB_EMBEDDED |
91 | #include <kcmkabconfig.h> | 90 | #include "kcmconfigs/kcmkabconfig.h" |
91 | #include "kcmconfigs/kcmkdepimconfig.h" | ||
92 | 92 | ||
93 | 93 | ||
94 | #include <kresources/selectdialog.h> | 94 | #include <kresources/selectdialog.h> |
95 | #include <kmessagebox.h> | 95 | #include <kmessagebox.h> |
96 | 96 | ||
97 | #include <picture.h> | 97 | #include <picture.h> |
98 | #include <resource.h> | 98 | #include <resource.h> |
99 | 99 | ||
100 | //US#include <qsplitter.h> | 100 | //US#include <qsplitter.h> |
101 | #include <qmap.h> | 101 | #include <qmap.h> |
102 | #include <qdir.h> | 102 | #include <qdir.h> |
103 | #include <qfile.h> | 103 | #include <qfile.h> |
104 | #include <qvbox.h> | 104 | #include <qvbox.h> |
105 | #include <qlayout.h> | 105 | #include <qlayout.h> |
106 | #include <qclipboard.h> | 106 | #include <qclipboard.h> |
107 | #include <qtextstream.h> | 107 | #include <qtextstream.h> |
108 | 108 | ||
109 | #include <libkdepim/categoryselectdialog.h> | 109 | #include <libkdepim/categoryselectdialog.h> |
110 | #include <kabc/vcardconverter.h> | 110 | #include <kabc/vcardconverter.h> |
111 | 111 | ||
112 | 112 | ||
113 | #include "addresseeutil.h" | 113 | #include "addresseeutil.h" |
114 | #include "undocmds.h" | 114 | #include "undocmds.h" |
115 | #include "addresseeeditordialog.h" | 115 | #include "addresseeeditordialog.h" |
116 | #include "viewmanager.h" | 116 | #include "viewmanager.h" |
117 | #include "details/detailsviewcontainer.h" | 117 | #include "details/detailsviewcontainer.h" |
118 | #include "kabprefs.h" | 118 | #include "kabprefs.h" |
119 | #include "xxportmanager.h" | 119 | #include "xxportmanager.h" |
120 | #include "incsearchwidget.h" | 120 | #include "incsearchwidget.h" |
121 | #include "jumpbuttonbar.h" | 121 | #include "jumpbuttonbar.h" |
122 | #include "extensionmanager.h" | 122 | #include "extensionmanager.h" |
123 | #include "addresseeconfig.h" | 123 | #include "addresseeconfig.h" |
@@ -1168,67 +1168,73 @@ QString KABCore::getNameByPhone( const QString &phone ) | |||
1168 | { | 1168 | { |
1169 | #ifndef KAB_EMBEDDED | 1169 | #ifndef KAB_EMBEDDED |
1170 | QRegExp r( "[/*/-/ ]" ); | 1170 | QRegExp r( "[/*/-/ ]" ); |
1171 | QString localPhone( phone ); | 1171 | QString localPhone( phone ); |
1172 | 1172 | ||
1173 | bool found = false; | 1173 | bool found = false; |
1174 | QString ownerName = ""; | 1174 | QString ownerName = ""; |
1175 | KABC::AddressBook::Iterator iter; | 1175 | KABC::AddressBook::Iterator iter; |
1176 | KABC::PhoneNumber::List::Iterator phoneIter; | 1176 | KABC::PhoneNumber::List::Iterator phoneIter; |
1177 | KABC::PhoneNumber::List phoneList; | 1177 | KABC::PhoneNumber::List phoneList; |
1178 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { | 1178 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { |
1179 | phoneList = (*iter).phoneNumbers(); | 1179 | phoneList = (*iter).phoneNumbers(); |
1180 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); | 1180 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); |
1181 | ++phoneIter) { | 1181 | ++phoneIter) { |
1182 | // Get rid of separator chars so just the numbers are compared. | 1182 | // Get rid of separator chars so just the numbers are compared. |
1183 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { | 1183 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { |
1184 | ownerName = (*iter).formattedName(); | 1184 | ownerName = (*iter).formattedName(); |
1185 | found = true; | 1185 | found = true; |
1186 | } | 1186 | } |
1187 | } | 1187 | } |
1188 | } | 1188 | } |
1189 | 1189 | ||
1190 | return ownerName; | 1190 | return ownerName; |
1191 | #else //KAB_EMBEDDED | 1191 | #else //KAB_EMBEDDED |
1192 | qDebug("KABCore::getNameByPhone finsih method"); | 1192 | qDebug("KABCore::getNameByPhone finsih method"); |
1193 | return ""; | 1193 | return ""; |
1194 | #endif //KAB_EMBEDDED | 1194 | #endif //KAB_EMBEDDED |
1195 | 1195 | ||
1196 | } | 1196 | } |
1197 | 1197 | ||
1198 | void KABCore::openConfigDialog() | 1198 | void KABCore::openConfigDialog() |
1199 | { | 1199 | { |
1200 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | 1200 | KABPrefs* prefs = KABPrefs::instance(); |
1201 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( prefs, "PIM", this ,"kabconfigdialog", true ); | ||
1201 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | 1202 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); |
1202 | ConfigureDialog->addModule(kabcfg ); | 1203 | ConfigureDialog->addModule(kabcfg ); |
1204 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Pim")) , "KCMKdeLibConfig" ); | ||
1205 | ConfigureDialog->addModule(kdelibcfg ); | ||
1206 | |||
1207 | |||
1208 | |||
1203 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | 1209 | connect( ConfigureDialog, SIGNAL( applyClicked() ), |
1204 | this, SLOT( configurationChanged() ) ); | 1210 | this, SLOT( configurationChanged() ) ); |
1205 | connect( ConfigureDialog, SIGNAL( okClicked() ), | 1211 | connect( ConfigureDialog, SIGNAL( okClicked() ), |
1206 | this, SLOT( configurationChanged() ) ); | 1212 | this, SLOT( configurationChanged() ) ); |
1207 | saveSettings(); | 1213 | saveSettings(); |
1208 | ConfigureDialog->showMaximized(); | 1214 | ConfigureDialog->showMaximized(); |
1209 | if ( ConfigureDialog->exec() ) | 1215 | if ( ConfigureDialog->exec() ) |
1210 | KMessageBox::information( this, i18n("If you configured \nExtensions,\nplease restart!\n") ); | 1216 | KMessageBox::information( this, i18n("If you configured \nExtensions,\nplease restart!\n") ); |
1211 | delete ConfigureDialog; | 1217 | delete ConfigureDialog; |
1212 | } | 1218 | } |
1213 | 1219 | ||
1214 | void KABCore::openLDAPDialog() | 1220 | void KABCore::openLDAPDialog() |
1215 | { | 1221 | { |
1216 | #ifndef KAB_EMBEDDED | 1222 | #ifndef KAB_EMBEDDED |
1217 | if ( !mLdapSearchDialog ) { | 1223 | if ( !mLdapSearchDialog ) { |
1218 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); | 1224 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); |
1219 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, | 1225 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, |
1220 | SLOT( refreshView() ) ); | 1226 | SLOT( refreshView() ) ); |
1221 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, | 1227 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, |
1222 | SLOT( setModified() ) ); | 1228 | SLOT( setModified() ) ); |
1223 | } else | 1229 | } else |
1224 | mLdapSearchDialog->restoreSettings(); | 1230 | mLdapSearchDialog->restoreSettings(); |
1225 | 1231 | ||
1226 | if ( mLdapSearchDialog->isOK() ) | 1232 | if ( mLdapSearchDialog->isOK() ) |
1227 | mLdapSearchDialog->exec(); | 1233 | mLdapSearchDialog->exec(); |
1228 | #else //KAB_EMBEDDED | 1234 | #else //KAB_EMBEDDED |
1229 | qDebug("KABCore::openLDAPDialog() finsih method"); | 1235 | qDebug("KABCore::openLDAPDialog() finsih method"); |
1230 | #endif //KAB_EMBEDDED | 1236 | #endif //KAB_EMBEDDED |
1231 | } | 1237 | } |
1232 | 1238 | ||
1233 | void KABCore::print() | 1239 | void KABCore::print() |
1234 | { | 1240 | { |
@@ -1485,65 +1491,65 @@ void KABCore::initActions() | |||
1485 | // file menu | 1491 | // file menu |
1486 | if ( mIsPart ) { | 1492 | if ( mIsPart ) { |
1487 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, | 1493 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, |
1488 | SLOT( sendMail() ), actionCollection(), | 1494 | SLOT( sendMail() ), actionCollection(), |
1489 | "kaddressbook_mail" ); | 1495 | "kaddressbook_mail" ); |
1490 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, | 1496 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, |
1491 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); | 1497 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); |
1492 | 1498 | ||
1493 | } else { | 1499 | } else { |
1494 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); | 1500 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); |
1495 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); | 1501 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); |
1496 | } | 1502 | } |
1497 | 1503 | ||
1498 | 1504 | ||
1499 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, | 1505 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, |
1500 | SLOT( save() ), actionCollection(), "file_sync" ); | 1506 | SLOT( save() ), actionCollection(), "file_sync" ); |
1501 | 1507 | ||
1502 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, | 1508 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, |
1503 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); | 1509 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); |
1504 | 1510 | ||
1505 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, | 1511 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, |
1506 | this, SLOT( mailVCard() ), | 1512 | this, SLOT( mailVCard() ), |
1507 | actionCollection(), "file_mail_vcard"); | 1513 | actionCollection(), "file_mail_vcard"); |
1508 | 1514 | ||
1509 | mActionBeamVCard = 0; | 1515 | mActionBeamVCard = 0; |
1510 | mActionBeam = 0; | 1516 | mActionBeam = 0; |
1511 | 1517 | ||
1512 | #ifndef DESKTOP_VERSION | 1518 | #ifndef DESKTOP_VERSION |
1513 | if ( Ir::supported() ) { | 1519 | if ( Ir::supported() ) { |
1514 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, | 1520 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, |
1515 | SLOT( beamVCard() ), actionCollection(), | 1521 | SLOT( beamVCard() ), actionCollection(), |
1516 | "kaddressbook_beam_vcard" ); | 1522 | "kaddressbook_beam_vcard" ); |
1517 | 1523 | ||
1518 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, | 1524 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, |
1519 | SLOT( beamMySelf() ), actionCollection(), | 1525 | SLOT( beamMySelf() ), actionCollection(), |
1520 | "kaddressbook_beam_myself" ); | 1526 | "kaddressbook_beam_myself" ); |
1521 | } | 1527 | } |
1522 | #endif | 1528 | #endif |
1523 | 1529 | ||
1524 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, | 1530 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, |
1525 | this, SLOT( editContact2() ), | 1531 | this, SLOT( editContact2() ), |
1526 | actionCollection(), "file_properties" ); | 1532 | actionCollection(), "file_properties" ); |
1527 | 1533 | ||
1528 | #ifdef KAB_EMBEDDED | 1534 | #ifdef KAB_EMBEDDED |
1529 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); | 1535 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); |
1530 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, | 1536 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, |
1531 | mMainWindow, SLOT( exit() ), | 1537 | mMainWindow, SLOT( exit() ), |
1532 | actionCollection(), "quit" ); | 1538 | actionCollection(), "quit" ); |
1533 | #endif //KAB_EMBEDDED | 1539 | #endif //KAB_EMBEDDED |
1534 | 1540 | ||
1535 | // edit menu | 1541 | // edit menu |
1536 | if ( mIsPart ) { | 1542 | if ( mIsPart ) { |
1537 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, | 1543 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, |
1538 | SLOT( copyContacts() ), actionCollection(), | 1544 | SLOT( copyContacts() ), actionCollection(), |
1539 | "kaddressbook_copy" ); | 1545 | "kaddressbook_copy" ); |
1540 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, | 1546 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, |
1541 | SLOT( cutContacts() ), actionCollection(), | 1547 | SLOT( cutContacts() ), actionCollection(), |
1542 | "kaddressbook_cut" ); | 1548 | "kaddressbook_cut" ); |
1543 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, | 1549 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, |
1544 | SLOT( pasteContacts() ), actionCollection(), | 1550 | SLOT( pasteContacts() ), actionCollection(), |
1545 | "kaddressbook_paste" ); | 1551 | "kaddressbook_paste" ); |
1546 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, | 1552 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, |
1547 | SLOT( selectAllContacts() ), actionCollection(), | 1553 | SLOT( selectAllContacts() ), actionCollection(), |
1548 | "kaddressbook_select_all" ); | 1554 | "kaddressbook_select_all" ); |
1549 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, | 1555 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, |
@@ -1592,65 +1598,65 @@ void KABCore::initActions() | |||
1592 | 1598 | ||
1593 | } else { | 1599 | } else { |
1594 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); | 1600 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); |
1595 | 1601 | ||
1596 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 1602 | mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); |
1597 | } | 1603 | } |
1598 | 1604 | ||
1599 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 1605 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
1600 | actionCollection(), "options_show_jump_bar" ); | 1606 | actionCollection(), "options_show_jump_bar" ); |
1601 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); | 1607 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); |
1602 | 1608 | ||
1603 | mActionDetails = new KToggleAction( i18n( "Show Details" ), 0, 0, | 1609 | mActionDetails = new KToggleAction( i18n( "Show Details" ), 0, 0, |
1604 | actionCollection(), "options_show_details" ); | 1610 | actionCollection(), "options_show_details" ); |
1605 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 1611 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
1606 | 1612 | ||
1607 | // misc | 1613 | // misc |
1608 | // only enable LDAP lookup if we can handle the protocol | 1614 | // only enable LDAP lookup if we can handle the protocol |
1609 | #ifndef KAB_EMBEDDED | 1615 | #ifndef KAB_EMBEDDED |
1610 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 1616 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
1611 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 1617 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
1612 | this, SLOT( openLDAPDialog() ), actionCollection(), | 1618 | this, SLOT( openLDAPDialog() ), actionCollection(), |
1613 | "ldap_lookup" ); | 1619 | "ldap_lookup" ); |
1614 | } | 1620 | } |
1615 | #else //KAB_EMBEDDED | 1621 | #else //KAB_EMBEDDED |
1616 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1622 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1617 | #endif //KAB_EMBEDDED | 1623 | #endif //KAB_EMBEDDED |
1618 | 1624 | ||
1619 | 1625 | ||
1620 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1626 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1621 | SLOT( setWhoAmI() ), actionCollection(), | 1627 | SLOT( setWhoAmI() ), actionCollection(), |
1622 | "set_personal" ); | 1628 | "set_personal" ); |
1623 | 1629 | ||
1624 | 1630 | ||
1625 | 1631 | ||
1626 | 1632 | ||
1627 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1633 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1628 | SLOT( setCategories() ), actionCollection(), | 1634 | SLOT( setCategories() ), actionCollection(), |
1629 | "edit_set_categories" ); | 1635 | "edit_set_categories" ); |
1630 | 1636 | ||
1631 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1637 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1632 | SLOT( removeVoice() ), actionCollection(), | 1638 | SLOT( removeVoice() ), actionCollection(), |
1633 | "remove_voice" ); | 1639 | "remove_voice" ); |
1634 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, | 1640 | mActionImportOL = new KAction( i18n( "Import from OL..." ), 0, this, |
1635 | SLOT( importFromOL() ), actionCollection(), | 1641 | SLOT( importFromOL() ), actionCollection(), |
1636 | "import_OL" ); | 1642 | "import_OL" ); |
1637 | #ifdef KAB_EMBEDDED | 1643 | #ifdef KAB_EMBEDDED |
1638 | mActionLicence = new KAction( i18n( "Licence" ), "licence", 0, | 1644 | mActionLicence = new KAction( i18n( "Licence" ), "licence", 0, |
1639 | this, SLOT( showLicence() ), actionCollection(), | 1645 | this, SLOT( showLicence() ), actionCollection(), |
1640 | "licence_about_data" ); | 1646 | "licence_about_data" ); |
1641 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1647 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1642 | this, SLOT( createAboutData() ), actionCollection(), | 1648 | this, SLOT( createAboutData() ), actionCollection(), |
1643 | "kaddressbook_about_data" ); | 1649 | "kaddressbook_about_data" ); |
1644 | #endif //KAB_EMBEDDED | 1650 | #endif //KAB_EMBEDDED |
1645 | 1651 | ||
1646 | clipboardDataChanged(); | 1652 | clipboardDataChanged(); |
1647 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1653 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1648 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1654 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1649 | } | 1655 | } |
1650 | 1656 | ||
1651 | //US we need this function, to plug all actions into the correct menues. | 1657 | //US we need this function, to plug all actions into the correct menues. |
1652 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1658 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1653 | void KABCore::addActionsManually() | 1659 | void KABCore::addActionsManually() |
1654 | { | 1660 | { |
1655 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1661 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1656 | 1662 | ||
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 8bd4b15..0c192dd 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -21,66 +21,64 @@ | |||
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 | //US#ifdef KAB_EMBEDDED | 24 | //US#ifdef KAB_EMBEDDED |
25 | //#include <qstring.h> | 25 | //#include <qstring.h> |
26 | //#endif //KAB_EMBEDDED | 26 | //#endif //KAB_EMBEDDED |
27 | 27 | ||
28 | 28 | ||
29 | #include <kconfig.h> | 29 | #include <kconfig.h> |
30 | #include <klocale.h> | 30 | #include <klocale.h> |
31 | #include <kstaticdeleter.h> | 31 | #include <kstaticdeleter.h> |
32 | //US#include <kdebug.h> // defines kdDebug() | 32 | //US#include <kdebug.h> // defines kdDebug() |
33 | 33 | ||
34 | #include "kabprefs.h" | 34 | #include "kabprefs.h" |
35 | 35 | ||
36 | KABPrefs *KABPrefs::sInstance = 0; | 36 | KABPrefs *KABPrefs::sInstance = 0; |
37 | static KStaticDeleter<KABPrefs> staticDeleter; | 37 | static KStaticDeleter<KABPrefs> staticDeleter; |
38 | 38 | ||
39 | KABPrefs::KABPrefs() | 39 | KABPrefs::KABPrefs() |
40 | : KPimPrefs("kaddressbookrc") | 40 | : KPimPrefs("kaddressbookrc") |
41 | { | 41 | { |
42 | KPrefs::setCurrentGroup( "Views" ); | 42 | KPrefs::setCurrentGroup( "Views" ); |
43 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); | 43 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); |
44 | 44 | ||
45 | KPrefs::setCurrentGroup( "General" ); | 45 | KPrefs::setCurrentGroup( "General" ); |
46 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); | 46 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); |
47 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); | 47 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); |
48 | 48 | ||
49 | #ifdef KAB_EMBEDDED | 49 | #ifdef KAB_EMBEDDED |
50 | addItemBool("AskForQuit",&mAskForQuit,false); | 50 | addItemBool("AskForQuit",&mAskForQuit,false); |
51 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 51 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
52 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 52 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
53 | addItemInt( "EmailChannelType", &mEmailClient, OMPI ); | ||
54 | addItemString( "EmailChannelOther", &mEmailChannel, "" ); | ||
55 | 53 | ||
56 | #endif //KAB_EMBEDDED | 54 | #endif //KAB_EMBEDDED |
57 | 55 | ||
58 | KPrefs::setCurrentGroup( "MainWindow" ); | 56 | KPrefs::setCurrentGroup( "MainWindow" ); |
59 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); | 57 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); |
60 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); | 58 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); |
61 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); | 59 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); |
62 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); | 60 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); |
63 | 61 | ||
64 | KPrefs::setCurrentGroup( "Extensions_General" ); | 62 | KPrefs::setCurrentGroup( "Extensions_General" ); |
65 | QStringList defaultExtensions; | 63 | QStringList defaultExtensions; |
66 | defaultExtensions << "merge"; | 64 | defaultExtensions << "merge"; |
67 | defaultExtensions << "distribution_list_editor"; | 65 | defaultExtensions << "distribution_list_editor"; |
68 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); | 66 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); |
69 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); | 67 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); |
70 | 68 | ||
71 | KPrefs::setCurrentGroup( "Views" ); | 69 | KPrefs::setCurrentGroup( "Views" ); |
72 | QString defaultView = i18n( "Default Table View" ); | 70 | QString defaultView = i18n( "Default Table View" ); |
73 | addItemString( "CurrentView", &mCurrentView, defaultView ); | 71 | addItemString( "CurrentView", &mCurrentView, defaultView ); |
74 | addItemStringList( "ViewNames", &mViewNames, defaultView ); | 72 | addItemStringList( "ViewNames", &mViewNames, defaultView ); |
75 | 73 | ||
76 | KPrefs::setCurrentGroup( "Filters" ); | 74 | KPrefs::setCurrentGroup( "Filters" ); |
77 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); | 75 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); |
78 | 76 | ||
79 | } | 77 | } |
80 | 78 | ||
81 | KABPrefs::~KABPrefs() | 79 | KABPrefs::~KABPrefs() |
82 | { | 80 | { |
83 | } | 81 | } |
84 | 82 | ||
85 | KABPrefs *KABPrefs::instance() | 83 | KABPrefs *KABPrefs::instance() |
86 | { | 84 | { |
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index c81a9a9..8f149ac 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h | |||
@@ -8,87 +8,77 @@ | |||
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 | #ifndef KABPREFS_H | 24 | #ifndef KABPREFS_H |
25 | #define KABPREFS_H | 25 | #define KABPREFS_H |
26 | 26 | ||
27 | #include <qstringlist.h> | 27 | #include <qstringlist.h> |
28 | 28 | ||
29 | #include <libkdepim/kpimprefs.h> | 29 | #include <libkdepim/kpimprefs.h> |
30 | 30 | ||
31 | class KConfig; | 31 | class KConfig; |
32 | 32 | ||
33 | class KABPrefs : public KPimPrefs | 33 | class KABPrefs : public KPimPrefs |
34 | { | 34 | { |
35 | public: | 35 | public: |
36 | virtual ~KABPrefs(); | 36 | virtual ~KABPrefs(); |
37 | 37 | ||
38 | static KABPrefs *instance(); | 38 | static KABPrefs *instance(); |
39 | 39 | ||
40 | enum EMailClients { | ||
41 | OMPI = 0, | ||
42 | QTOPIA = 1, | ||
43 | OPIE = 2, | ||
44 | OTHER = 3 | ||
45 | }; | ||
46 | |||
47 | |||
48 | // General | 40 | // General |
49 | bool mHonorSingleClick; | 41 | bool mHonorSingleClick; |
50 | bool mAutomaticNameParsing; | 42 | bool mAutomaticNameParsing; |
51 | int mCurrentIncSearchField; | 43 | int mCurrentIncSearchField; |
52 | 44 | ||
53 | #ifdef KAB_EMBEDDED | 45 | #ifdef KAB_EMBEDDED |
54 | // US introduce a nonconst way to return the config object. | 46 | // US introduce a nonconst way to return the config object. |
55 | KConfig* getConfig(); | 47 | KConfig* getConfig(); |
56 | 48 | ||
57 | bool mToolBarHor; | 49 | bool mToolBarHor; |
58 | bool mToolBarUp; | 50 | bool mToolBarUp; |
59 | bool mAskForQuit; | 51 | bool mAskForQuit; |
60 | 52 | ||
61 | int mEmailClient; | ||
62 | QString mEmailChannel; | ||
63 | 53 | ||
64 | /** Set preferences to default values */ | 54 | /** Set preferences to default values */ |
65 | // void usrSetDefaults(); | 55 | // void usrSetDefaults(); |
66 | 56 | ||
67 | /** Read preferences from config file */ | 57 | /** Read preferences from config file */ |
68 | // void usrReadConfig(); | 58 | // void usrReadConfig(); |
69 | 59 | ||
70 | /** Write preferences to config file */ | 60 | /** Write preferences to config file */ |
71 | // void usrWriteConfig(); | 61 | // void usrWriteConfig(); |
72 | #endif //KAB_EMBEDDED | 62 | #endif //KAB_EMBEDDED |
73 | 63 | ||
74 | 64 | ||
75 | // GUI | 65 | // GUI |
76 | bool mJumpButtonBarVisible; | 66 | bool mJumpButtonBarVisible; |
77 | bool mDetailsPageVisible; | 67 | bool mDetailsPageVisible; |
78 | QValueList<int> mExtensionsSplitter; | 68 | QValueList<int> mExtensionsSplitter; |
79 | QValueList<int> mDetailsSplitter; | 69 | QValueList<int> mDetailsSplitter; |
80 | 70 | ||
81 | // Extensions stuff | 71 | // Extensions stuff |
82 | int mCurrentExtension; | 72 | int mCurrentExtension; |
83 | QStringList mActiveExtensions; | 73 | QStringList mActiveExtensions; |
84 | 74 | ||
85 | // Views stuff | 75 | // Views stuff |
86 | QString mCurrentView; | 76 | QString mCurrentView; |
87 | QStringList mViewNames; | 77 | QStringList mViewNames; |
88 | 78 | ||
89 | // Filter | 79 | // Filter |
90 | int mCurrentFilter; | 80 | int mCurrentFilter; |
91 | 81 | ||
92 | void setCategoryDefaults(); | 82 | void setCategoryDefaults(); |
93 | 83 | ||
94 | private: | 84 | private: |
diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro index 0da5842..b57317f 100644 --- a/kaddressbook/kaddressbook.pro +++ b/kaddressbook/kaddressbook.pro | |||
@@ -1,41 +1,41 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
3 | TARGET = kapi | 3 | TARGET = kapi |
4 | DESTDIR= ../bin | 4 | DESTDIR= ../bin |
5 | 5 | ||
6 | include( ../variables.pri ) | 6 | include( ../variables.pri ) |
7 | 7 | ||
8 | 8 | ||
9 | INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces | 9 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces |
10 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION | 10 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION |
11 | 11 | ||
12 | unix : { | 12 | unix : { |
13 | LIBS += ../bin/libmicrokdepim.so | 13 | LIBS += ../bin/libmicrokdepim.so |
14 | LIBS += ../bin/libmicrokde.so | 14 | LIBS += ../bin/libmicrokde.so |
15 | LIBS += ../bin/libmicrokabc.so | 15 | LIBS += ../bin/libmicrokabc.so |
16 | LIBS += ../bin/libmicrokcal.so | 16 | LIBS += ../bin/libmicrokcal.so |
17 | LIBS += -lldap | 17 | LIBS += -lldap |
18 | OBJECTS_DIR = obj/unix | 18 | OBJECTS_DIR = obj/unix |
19 | MOC_DIR = moc/unix | 19 | MOC_DIR = moc/unix |
20 | } | 20 | } |
21 | win32: { | 21 | win32: { |
22 | DEFINES += _WIN32_ | 22 | DEFINES += _WIN32_ |
23 | LIBS += ../bin/microkdepim.lib | 23 | LIBS += ../bin/microkdepim.lib |
24 | LIBS += ../bin/microkcal.lib | 24 | LIBS += ../bin/microkcal.lib |
25 | LIBS += ../bin/microkde.lib | 25 | LIBS += ../bin/microkde.lib |
26 | LIBS += ../bin/microkabc.lib | 26 | LIBS += ../bin/microkabc.lib |
27 | QMAKE_LINK += /NODEFAULTLIB:LIBC | 27 | QMAKE_LINK += /NODEFAULTLIB:LIBC |
28 | OBJECTS_DIR = obj/win | 28 | OBJECTS_DIR = obj/win |
29 | MOC_DIR = moc/win | 29 | MOC_DIR = moc/win |
30 | LIBS += mfc71u.lib | 30 | LIBS += mfc71u.lib |
31 | } | 31 | } |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | ||
38 | 38 | ||
39 | 39 | ||
40 | INTERFACES = \ | 40 | INTERFACES = \ |
41 | # filteredit_base.ui \ | 41 | # filteredit_base.ui \ |
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro index 95e6641..41f293d 100644 --- a/kaddressbook/kaddressbookE.pro +++ b/kaddressbook/kaddressbookE.pro | |||
@@ -1,45 +1,45 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | 3 | ||
4 | 4 | ||
5 | TARGET = kapi | 5 | TARGET = kapi |
6 | OBJECTS_DIR = obj/$(PLATFORM) | 6 | OBJECTS_DIR = obj/$(PLATFORM) |
7 | MOC_DIR = moc/$(PLATFORM) | 7 | MOC_DIR = moc/$(PLATFORM) |
8 | DESTDIR=$(QPEDIR)/bin | 8 | DESTDIR=$(QPEDIR)/bin |
9 | 9 | ||
10 | #LFLAGS += -Wl,-export-dynamic | 10 | #LFLAGS += -Wl,-export-dynamic |
11 | 11 | ||
12 | 12 | ||
13 | INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include | 13 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include |
14 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER | 14 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER |
15 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL | 15 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL |
16 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 16 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
17 | #DEFINES += KORG_NOLVALTERNATION | 17 | #DEFINES += KORG_NOLVALTERNATION |
18 | LIBS += -lmicrokdepim | 18 | LIBS += -lmicrokdepim |
19 | #LIBS += -lmicrokcal | 19 | #LIBS += -lmicrokcal |
20 | LIBS += -lmicrokde | 20 | LIBS += -lmicrokde |
21 | LIBS += -lmicrokcal | 21 | LIBS += -lmicrokcal |
22 | LIBS += -lmicroqtcompat | 22 | LIBS += -lmicroqtcompat |
23 | LIBS += -lmicrokabc | 23 | LIBS += -lmicrokabc |
24 | LIBS += -lqpe | 24 | LIBS += -lqpe |
25 | LIBS += -ljpeg | 25 | LIBS += -ljpeg |
26 | LIBS += $(QTOPIALIB) | 26 | LIBS += $(QTOPIALIB) |
27 | LIBS += -L$(QPEDIR)/lib | 27 | LIBS += -L$(QPEDIR)/lib |
28 | LIBS += -Wl,-export-dynamic | 28 | LIBS += -Wl,-export-dynamic |
29 | 29 | ||
30 | INTERFACES = \ | 30 | INTERFACES = \ |
31 | # filteredit_base.ui \ | 31 | # filteredit_base.ui \ |
32 | # kofilterview_base.ui \ | 32 | # kofilterview_base.ui \ |
33 | 33 | ||
34 | HEADERS = \ | 34 | HEADERS = \ |
35 | features/mergewidget.h \ | 35 | features/mergewidget.h \ |
36 | features/distributionlistwidget.h \ | 36 | features/distributionlistwidget.h \ |
37 | kcmconfigs/addresseewidget.h \ | 37 | kcmconfigs/addresseewidget.h \ |
38 | kcmconfigs/extensionconfigdialog.h \ | 38 | kcmconfigs/extensionconfigdialog.h \ |
39 | kcmconfigs/kcmkabconfig.h \ | 39 | kcmconfigs/kcmkabconfig.h \ |
40 | kcmconfigs/kabconfigwidget.h \ | 40 | kcmconfigs/kabconfigwidget.h \ |
41 | addresseeeditordialog.h \ | 41 | addresseeeditordialog.h \ |
42 | addresseeeditorwidget.h \ | 42 | addresseeeditorwidget.h \ |
43 | addresseditwidget.h \ | 43 | addresseditwidget.h \ |
44 | addresseeconfig.h \ | 44 | addresseeconfig.h \ |
45 | addresseeutil.h \ | 45 | addresseeutil.h \ |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 1bac26f..b5309c0 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp | |||
@@ -124,198 +124,104 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | |||
124 | groupBox->layout()->setMargin(1) ; | 124 | groupBox->layout()->setMargin(1) ; |
125 | groupBox->layout()->setSpacing(0); | 125 | groupBox->layout()->setSpacing(0); |
126 | mExtensionView = new KListView( groupBox ); | 126 | mExtensionView = new KListView( groupBox ); |
127 | mExtensionView->setAllColumnsShowFocus( true ); | 127 | mExtensionView->setAllColumnsShowFocus( true ); |
128 | mExtensionView->addColumn( i18n( "Name" ) ); | 128 | mExtensionView->addColumn( i18n( "Name" ) ); |
129 | mExtensionView->addColumn( i18n( "Description" ) ); | 129 | mExtensionView->addColumn( i18n( "Description" ) ); |
130 | mExtensionView->setMaximumHeight(80); | 130 | mExtensionView->setMaximumHeight(80); |
131 | 131 | ||
132 | boxLayout->addWidget( mExtensionView ); | 132 | boxLayout->addWidget( mExtensionView ); |
133 | 133 | ||
134 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); | 134 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); |
135 | mConfigureButton->setEnabled( false ); | 135 | mConfigureButton->setEnabled( false ); |
136 | boxLayout->addWidget( mConfigureButton ); | 136 | boxLayout->addWidget( mConfigureButton ); |
137 | 137 | ||
138 | layout->addWidget( groupBox ); | 138 | layout->addWidget( groupBox ); |
139 | 139 | ||
140 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 140 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
141 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 141 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
142 | connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), | 142 | connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), |
143 | SLOT( selectionChanged( QListViewItem* ) ) ); | 143 | SLOT( selectionChanged( QListViewItem* ) ) ); |
144 | connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), | 144 | connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), |
145 | SLOT( itemClicked( QListViewItem* ) ) ); | 145 | SLOT( itemClicked( QListViewItem* ) ) ); |
146 | connect( mConfigureButton, SIGNAL( clicked() ), | 146 | connect( mConfigureButton, SIGNAL( clicked() ), |
147 | SLOT( configureExtension() ) ); | 147 | SLOT( configureExtension() ) ); |
148 | 148 | ||
149 | tabWidget->addTab( generalPage, i18n( "General" ) ); | 149 | tabWidget->addTab( generalPage, i18n( "General" ) ); |
150 | 150 | ||
151 | // Addressee page | 151 | // Addressee page |
152 | mAddresseeWidget = new AddresseeWidget( this ); | 152 | mAddresseeWidget = new AddresseeWidget( this ); |
153 | tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); | 153 | tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); |
154 | connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); | 154 | connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); |
155 | 155 | ||
156 | // mailclient page | ||
157 | QWidget *mailclientPage = new QWidget( this ); | ||
158 | layout = new QVBoxLayout( mailclientPage, KDialog::marginHintSmall(), | ||
159 | KDialog::spacingHintSmall() ); | ||
160 | |||
161 | groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), mailclientPage ); | ||
162 | boxLayout = new QVBoxLayout( groupBox->layout() ); | ||
163 | boxLayout->setAlignment( Qt::AlignTop ); | ||
164 | // boxLayout->setMargin(KDialog::marginHintSmall() ); | ||
165 | // groupBox->layout()->setMargin(KDialog::marginHintSmall()) ; | ||
166 | // groupBox->layout()->setSpacing(KDialog::spacingHintSmall()); | ||
167 | // boxLayout->setSpacing( KDialog::spacingHintSmall() ); | ||
168 | |||
169 | mEmailClient = new QComboBox( groupBox ); | ||
170 | mEmailClient->insertItem( i18n("OM/Pi"), KABPrefs::OMPI ); | ||
171 | mEmailClient->insertItem( i18n("Qtopia mail"), KABPrefs::QTOPIA ); | ||
172 | mEmailClient->insertItem( i18n("Opie mail"), KABPrefs::OPIE ); | ||
173 | mEmailClient->insertItem( i18n("Other"), KABPrefs::OTHER ); | ||
174 | boxLayout->addWidget( mEmailClient ); | ||
175 | |||
176 | connect( mEmailClient, SIGNAL( activated( int ) ), | ||
177 | this, SLOT (emailclient_changed( int ) ) ); | ||
178 | |||
179 | QLabel* lab = new QLabel( i18n("Channel:"), groupBox); | ||
180 | boxLayout->addWidget( lab ); | ||
181 | mEmailChannel = new QLineEdit(groupBox); | ||
182 | mEmailChannel->setReadOnly(true); | ||
183 | boxLayout->addWidget( mEmailChannel ); | ||
184 | |||
185 | layout->addWidget( groupBox ); | ||
186 | tabWidget->addTab( mailclientPage, i18n( "Mail" ) ); | ||
187 | |||
188 | |||
189 | |||
190 | } | 156 | } |
191 | 157 | ||
192 | 158 | ||
193 | 159 | void KABConfigWidget::restoreSettings(KABPrefs* prefs) | |
194 | void KABConfigWidget::emailclient_changed( int newClient ) | ||
195 | { | 160 | { |
196 | if (newClient == KABPrefs::OTHER) | 161 | //US prefs was KABPrefs::instance() before |
197 | mEmailChannel->setReadOnly(false); | ||
198 | else | ||
199 | mEmailChannel->setReadOnly(true); | ||
200 | |||
201 | QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); | ||
202 | QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); | ||
203 | |||
204 | if (opiepath.isEmpty()) | ||
205 | opiepath = qtopiapath; | ||
206 | |||
207 | QString text = mEmailChannel->text(); | ||
208 | |||
209 | if (newClient == KABPrefs::OPIE) | ||
210 | { | ||
211 | if ( QFile::exists( opiepath + "/bin/opiemail" )) | ||
212 | text = "QPE/Application/opiemail"; | ||
213 | else | ||
214 | text = "FILENOTFOUND: " + opiepath + "/bin/opiemail"; | ||
215 | } | ||
216 | else if (newClient == KABPrefs::QTOPIA) | ||
217 | { | ||
218 | if ( QFile::exists( qtopiapath + "/bin/qtmail" )) | ||
219 | text = "QPE/Application/qtmail"; | ||
220 | else | ||
221 | text = "FILENOTFOUND: " + qtopiapath + "/bin/qtmail"; | ||
222 | 162 | ||
223 | } | ||
224 | else if (newClient == KABPrefs::OMPI) | ||
225 | { | ||
226 | if ( QFile::exists( qtopiapath + "/bin/ompi" )) | ||
227 | text = "QPE/Application/ompi"; | ||
228 | else if ( QFile::exists( opiepath + "/bin/ompi" )) | ||
229 | text = "QPE/Application/ompi"; | ||
230 | else | ||
231 | text = "FILENOTFOUND: " + qtopiapath + "/bin/ompi"; | ||
232 | |||
233 | } | ||
234 | else | ||
235 | { | ||
236 | //do nothing if we choosed other | ||
237 | } | ||
238 | |||
239 | mEmailChannel->setText( text ); | ||
240 | |||
241 | |||
242 | } | ||
243 | |||
244 | |||
245 | void KABConfigWidget::restoreSettings() | ||
246 | { | ||
247 | bool blocked = signalsBlocked(); | 163 | bool blocked = signalsBlocked(); |
248 | blockSignals( true ); | 164 | blockSignals( true ); |
249 | 165 | ||
250 | mNameParsing->setChecked( KABPrefs::instance()->mAutomaticNameParsing ); | 166 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); |
251 | mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick ); | 167 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); |
252 | |||
253 | mEmailChannel->setText( KABPrefs::instance()->mEmailChannel ); | ||
254 | mEmailClient->setCurrentItem(KABPrefs::instance()->mEmailClient); | ||
255 | 168 | ||
256 | mAddresseeWidget->restoreSettings(); | 169 | mAddresseeWidget->restoreSettings(); |
257 | 170 | ||
258 | restoreExtensionSettings(); | 171 | restoreExtensionSettings(); |
259 | 172 | ||
260 | blockSignals( blocked ); | 173 | blockSignals( blocked ); |
261 | 174 | ||
262 | emit changed( false ); | 175 | emit changed( false ); |
263 | } | 176 | } |
264 | 177 | ||
265 | void KABConfigWidget::saveSettings() | 178 | void KABConfigWidget::saveSettings(KABPrefs* prefs) |
266 | { | 179 | { |
267 | KABPrefs::instance()->mAutomaticNameParsing = mNameParsing->isChecked(); | 180 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); |
268 | KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked(); | 181 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); |
269 | |||
270 | KABPrefs::instance()->mEmailClient = mEmailClient->currentItem(); | ||
271 | KABPrefs::instance()->mEmailChannel = mEmailChannel->text(); | ||
272 | 182 | ||
273 | mAddresseeWidget->saveSettings(); | 183 | mAddresseeWidget->saveSettings(); |
274 | 184 | ||
275 | saveExtensionSettings(); | 185 | saveExtensionSettings(); |
276 | KABPrefs::instance()->writeConfig(); | 186 | KABPrefs::instance()->writeConfig(); |
277 | 187 | ||
278 | emit changed( false ); | 188 | emit changed( false ); |
279 | } | 189 | } |
280 | 190 | ||
281 | void KABConfigWidget::defaults() | 191 | void KABConfigWidget::defaults(KABPrefs* prefs) |
282 | { | 192 | { |
283 | mNameParsing->setChecked( true ); | 193 | mNameParsing->setChecked( true ); |
284 | mViewsSingleClickBox->setChecked( false ); | 194 | mViewsSingleClickBox->setChecked( false ); |
285 | 195 | ||
286 | mEmailClient->setCurrentItem(KABPrefs::OMPI); | ||
287 | emailclient_changed( KABPrefs::OMPI ); | ||
288 | |||
289 | |||
290 | emit changed( true ); | 196 | emit changed( true ); |
291 | } | 197 | } |
292 | 198 | ||
293 | void KABConfigWidget::modified() | 199 | void KABConfigWidget::modified() |
294 | { | 200 | { |
295 | emit changed( true ); | 201 | emit changed( true ); |
296 | } | 202 | } |
297 | 203 | ||
298 | void KABConfigWidget::restoreExtensionSettings() | 204 | void KABConfigWidget::restoreExtensionSettings() |
299 | { | 205 | { |
300 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; | 206 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; |
301 | 207 | ||
302 | mExtensionView->clear(); | 208 | mExtensionView->clear(); |
303 | 209 | ||
304 | #ifndef KAB_EMBEDDED | 210 | #ifndef KAB_EMBEDDED |
305 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); | 211 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); |
306 | KTrader::OfferList::ConstIterator it; | 212 | KTrader::OfferList::ConstIterator it; |
307 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { | 213 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { |
308 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) | 214 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) |
309 | continue; | 215 | continue; |
310 | 216 | ||
311 | ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); | 217 | ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); |
312 | item->setService( *it ); | 218 | item->setService( *it ); |
313 | if ( activeExtensions.contains( item->factory()->identifier() ) ) | 219 | if ( activeExtensions.contains( item->factory()->identifier() ) ) |
314 | item->setOn( true ); | 220 | item->setOn( true ); |
315 | } | 221 | } |
316 | #else //KAB_EMBEDDED | 222 | #else //KAB_EMBEDDED |
317 | ExtensionFactory *extensionFactory = new MergeFactory(); | 223 | ExtensionFactory *extensionFactory = new MergeFactory(); |
318 | 224 | ||
319 | ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); | 225 | ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); |
320 | 226 | ||
321 | item->setFactory( extensionFactory ); | 227 | item->setFactory( extensionFactory ); |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index 9d1363b..8c0c436 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h | |||
@@ -3,76 +3,74 @@ | |||
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@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 | #ifndef KABCONFIGWIDGET_H | 24 | #ifndef KABCONFIGWIDGET_H |
25 | #define KABCONFIGWIDGET_H | 25 | #define KABCONFIGWIDGET_H |
26 | 26 | ||
27 | #include <qwidget.h> | 27 | #include <qwidget.h> |
28 | 28 | ||
29 | class QCheckBox; | 29 | class QCheckBox; |
30 | class QListViewItem; | 30 | class QListViewItem; |
31 | class QPushButton; | 31 | class QPushButton; |
32 | class QComboBox; | 32 | class QComboBox; |
33 | class QLineEdit; | 33 | class QLineEdit; |
34 | class KListView; | 34 | class KListView; |
35 | class KABPrefs; | ||
35 | 36 | ||
36 | class AddresseeWidget; | 37 | class AddresseeWidget; |
37 | 38 | ||
38 | class KABConfigWidget : public QWidget | 39 | class KABConfigWidget : public QWidget |
39 | { | 40 | { |
40 | Q_OBJECT | 41 | Q_OBJECT |
41 | 42 | ||
42 | public: | 43 | public: |
43 | KABConfigWidget( QWidget *parent, const char *name = 0 ); | 44 | KABConfigWidget( QWidget *parent, const char *name = 0 ); |
44 | 45 | ||
45 | void restoreSettings(); | 46 | void restoreSettings(KABPrefs* prefs); |
46 | void saveSettings(); | 47 | void saveSettings(KABPrefs* prefs); |
47 | void defaults(); | 48 | void defaults(KABPrefs* prefs); |
48 | 49 | ||
49 | signals: | 50 | signals: |
50 | void changed( bool ); | 51 | void changed( bool ); |
51 | 52 | ||
52 | public slots: | 53 | public slots: |
53 | void modified(); | 54 | void modified(); |
54 | 55 | ||
55 | 56 | ||
56 | 57 | ||
57 | private slots: | 58 | private slots: |
58 | void configureExtension(); | 59 | void configureExtension(); |
59 | void selectionChanged( QListViewItem* ); | 60 | void selectionChanged( QListViewItem* ); |
60 | void itemClicked( QListViewItem* ); | 61 | void itemClicked( QListViewItem* ); |
61 | void emailclient_changed( int newClient ); | ||
62 | 62 | ||
63 | private: | 63 | private: |
64 | void restoreExtensionSettings(); | 64 | void restoreExtensionSettings(); |
65 | void saveExtensionSettings(); | 65 | void saveExtensionSettings(); |
66 | 66 | ||
67 | KListView *mExtensionView; | 67 | KListView *mExtensionView; |
68 | 68 | ||
69 | QCheckBox *mNameParsing; | 69 | QCheckBox *mNameParsing; |
70 | QCheckBox *mViewsSingleClickBox; | 70 | QCheckBox *mViewsSingleClickBox; |
71 | QPushButton *mConfigureButton; | 71 | QPushButton *mConfigureButton; |
72 | QComboBox* mEmailClient; | ||
73 | QLineEdit* mEmailChannel; | ||
74 | 72 | ||
75 | AddresseeWidget *mAddresseeWidget; | 73 | AddresseeWidget *mAddresseeWidget; |
76 | }; | 74 | }; |
77 | 75 | ||
78 | #endif | 76 | #endif |
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp index a278042..26398f8 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp +++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp | |||
@@ -1,90 +1,92 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@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 | 25 | ||
26 | #ifndef KAB_EMBEDDED | 26 | #ifndef KAB_EMBEDDED |
27 | #include <kaboutdata.h> | 27 | #include <kaboutdata.h> |
28 | #endif //KAB_EMBEDDED | 28 | #endif //KAB_EMBEDDED |
29 | #include <kdebug.h> | 29 | #include <kdebug.h> |
30 | #include <klocale.h> | 30 | //#include <klocale.h> |
31 | #include <stdlib.h> | 31 | //#include <stdlib.h> |
32 | 32 | ||
33 | #include "kabconfigwidget.h" | 33 | #include "kabconfigwidget.h" |
34 | 34 | ||
35 | #include "kcmkabconfig.h" | 35 | #include "kcmkabconfig.h" |
36 | 36 | ||
37 | #include "kabprefs.h" | ||
38 | #include "kprefs.h" | ||
39 | |||
37 | extern "C" | 40 | extern "C" |
38 | { | 41 | { |
39 | KCModule *create_kabconfig( QWidget *parent, const char * ) { | 42 | KCModule *create_kabconfig( QWidget *parent, const char * ) { |
40 | return new KCMKabConfig( parent, "kcmkabconfig" ); | 43 | return new KCMKabConfig( parent, "kcmkabconfig" ); |
41 | } | 44 | } |
42 | } | 45 | } |
43 | 46 | ||
44 | KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) | 47 | KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) |
45 | : KCModule( parent, name ) | 48 | : KCModule( parent, name ) |
46 | { | 49 | { |
47 | //abort(); | 50 | //abort(); |
48 | QVBoxLayout *layout = new QVBoxLayout( this ); | 51 | QVBoxLayout *layout = new QVBoxLayout( this ); |
49 | mConfigWidget = new KABConfigWidget( this, "mConfigWidget" ); | 52 | mConfigWidget = new KABConfigWidget( this, "mConfigWidget" ); |
50 | layout->addWidget( mConfigWidget ); | 53 | layout->addWidget( mConfigWidget ); |
51 | layout->setSpacing( 0 ); | 54 | layout->setSpacing( 0 ); |
52 | layout->setMargin( 0 ); | 55 | layout->setMargin( 0 ); |
53 | 56 | ||
54 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); | 57 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); |
55 | load(); | ||
56 | } | 58 | } |
57 | 59 | ||
58 | void KCMKabConfig::load() | 60 | void KCMKabConfig::load(KPrefs* prefs) |
59 | { | 61 | { |
60 | mConfigWidget->restoreSettings(); | 62 | mConfigWidget->restoreSettings((KABPrefs*)prefs); |
61 | } | 63 | } |
62 | 64 | ||
63 | void KCMKabConfig::save() | 65 | void KCMKabConfig::save(KPrefs* prefs) |
64 | { | 66 | { |
65 | mConfigWidget->saveSettings(); | 67 | mConfigWidget->saveSettings((KABPrefs*)prefs); |
66 | } | 68 | } |
67 | 69 | ||
68 | void KCMKabConfig::defaults() | 70 | void KCMKabConfig::defaults(KPrefs* prefs) |
69 | { | 71 | { |
70 | mConfigWidget->defaults(); | 72 | mConfigWidget->defaults((KABPrefs*)prefs); |
71 | } | 73 | } |
72 | 74 | ||
73 | #ifndef KAB_EMBEDDED | 75 | #ifndef KAB_EMBEDDED |
74 | const KAboutData* KCMKabConfig::aboutData() const | 76 | const KAboutData* KCMKabConfig::aboutData() const |
75 | { | 77 | { |
76 | KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ), | 78 | KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ), |
77 | I18N_NOOP( "KAddressBook Configure Dialog" ), | 79 | I18N_NOOP( "KAddressBook Configure Dialog" ), |
78 | 0, 0, KAboutData::License_GPL, | 80 | 0, 0, KAboutData::License_GPL, |
79 | I18N_NOOP( "(c), 2003 Tobias Koenig" ) ); | 81 | I18N_NOOP( "(c), 2003 Tobias Koenig" ) ); |
80 | 82 | ||
81 | about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); | 83 | about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); |
82 | 84 | ||
83 | return about; | 85 | return about; |
84 | 86 | ||
85 | } | 87 | } |
86 | #endif //KAB_EMBEDDED | 88 | #endif //KAB_EMBEDDED |
87 | 89 | ||
88 | #ifndef KAB_EMBEDDED | 90 | #ifndef KAB_EMBEDDED |
89 | #include "kcmkabconfig.moc" | 91 | #include "kcmkabconfig.moc" |
90 | #endif //KAB_EMBEDDED | 92 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h index be345b8..b4858c1 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.h +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h | |||
@@ -1,53 +1,47 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@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 | #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 | 30 | class KPrefs; | |
31 | #ifndef KAB_EMBEDDED | ||
32 | class KAboutData; | ||
33 | #endif //KAB_EMBEDDED | ||
34 | 31 | ||
35 | class KCMKabConfig : public KCModule | 32 | class KCMKabConfig : public KCModule |
36 | { | 33 | { |
37 | Q_OBJECT | 34 | Q_OBJECT |
38 | 35 | ||
39 | public: | 36 | public: |
40 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); | 37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); |
41 | 38 | ||
42 | virtual void load(); | 39 | virtual void load(KPrefs* prefs); |
43 | virtual void save(); | 40 | virtual void save(KPrefs* prefs); |
44 | virtual void defaults(); | 41 | virtual void defaults(KPrefs* prefs); |
45 | #ifndef KAB_EMBEDDED | ||
46 | virtual const KAboutData* aboutData() const; | ||
47 | #endif //KAB_EMBEDDED | ||
48 | 42 | ||
49 | private: | 43 | private: |
50 | KABConfigWidget *mConfigWidget; | 44 | KABConfigWidget *mConfigWidget; |
51 | }; | 45 | }; |
52 | 46 | ||
53 | #endif | 47 | #endif |