summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-10 10:31:22 (UTC)
committer zautrix <zautrix>2005-06-10 10:31:22 (UTC)
commite5ca8e0d8d6d08b597253f43de401aa1a99a6abe (patch) (unidiff)
treec319ba89abbe5cd90647bc38deb0ab1ce46f48e5
parent89c5159208fd982f527117e49d67ea1f90553dbe (diff)
downloadkdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.zip
kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.gz
kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.bz2
config dialog fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp40
-rw-r--r--kaddressbook/kabcore.h2
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.h2
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--korganizer/kodialogmanager.cpp23
-rw-r--r--korganizer/koprefsdialog.cpp286
-rw-r--r--korganizer/koprefsdialog.h12
-rw-r--r--libkdepim/kprefsdialog.cpp30
-rw-r--r--libkdepim/kprefsdialog.h26
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
@@ -1,226 +1,227 @@
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 Async a special exception, permission is given to link this program 19 Async 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/*s 24/*s
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include "kabcore.h" 31#include "kabcore.h"
32 32
33#include <stdaddressbook.h> 33#include <stdaddressbook.h>
34#include <klocale.h> 34#include <klocale.h>
35#include <kfiledialog.h> 35#include <kfiledialog.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qprogressbar.h> 42#include <qprogressbar.h>
43#include <libkdepim/phoneaccess.h> 43#include <libkdepim/phoneaccess.h>
44 44
45#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
46#include <qclipboard.h> 46#include <qclipboard.h>
47#include <qdir.h> 47#include <qdir.h>
48#include <qfile.h> 48#include <qfile.h>
49#include <qapplicaton.h> 49#include <qapplicaton.h>
50#include <qprogressbar.h> 50#include <qprogressbar.h>
51#include <qlayout.h> 51#include <qlayout.h>
52#include <qregexp.h> 52#include <qregexp.h>
53#include <qvbox.h> 53#include <qvbox.h>
54#include <kabc/addresseelist.h> 54#include <kabc/addresseelist.h>
55#include <kabc/errorhandler.h> 55#include <kabc/errorhandler.h>
56#include <kabc/resource.h> 56#include <kabc/resource.h>
57#include <kabc/vcardconverter.h> 57#include <kabc/vcardconverter.h>
58#include <kapplication.h> 58#include <kapplication.h>
59#include <kactionclasses.h> 59#include <kactionclasses.h>
60#include <kcmultidialog.h> 60#include <kcmultidialog.h>
61#include <kdebug.h> 61#include <kdebug.h>
62#include <kdeversion.h> 62#include <kdeversion.h>
63#include <kkeydialog.h> 63#include <kkeydialog.h>
64#include <kmessagebox.h> 64#include <kmessagebox.h>
65#include <kprinter.h> 65#include <kprinter.h>
66#include <kprotocolinfo.h> 66#include <kprotocolinfo.h>
67#include <kresources/selectdialog.h> 67#include <kresources/selectdialog.h>
68#include <kstandarddirs.h> 68#include <kstandarddirs.h>
69#include <ktempfile.h> 69#include <ktempfile.h>
70#include <kxmlguiclient.h> 70#include <kxmlguiclient.h>
71#include <kaboutdata.h> 71#include <kaboutdata.h>
72#include <libkdepim/categoryselectdialog.h> 72#include <libkdepim/categoryselectdialog.h>
73 73
74#include "addresseeutil.h" 74#include "addresseeutil.h"
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>
123 124
124#include <picture.h> 125#include <picture.h>
125#include <resource.h> 126#include <resource.h>
126 127
127//US#include <qsplitter.h> 128//US#include <qsplitter.h>
128#include <qmap.h> 129#include <qmap.h>
129#include <qdir.h> 130#include <qdir.h>
130#include <qfile.h> 131#include <qfile.h>
131#include <qvbox.h> 132#include <qvbox.h>
132#include <qlayout.h> 133#include <qlayout.h>
133#include <qclipboard.h> 134#include <qclipboard.h>
134#include <qtextstream.h> 135#include <qtextstream.h>
135#include <qradiobutton.h> 136#include <qradiobutton.h>
136#include <qbuttongroup.h> 137#include <qbuttongroup.h>
137 138
138#include <libkdepim/categoryselectdialog.h> 139#include <libkdepim/categoryselectdialog.h>
139#include <libkdepim/categoryeditdialog.h> 140#include <libkdepim/categoryeditdialog.h>
140#include <kabc/vcardconverter.h> 141#include <kabc/vcardconverter.h>
141 142
142 143
143#include "addresseeutil.h" 144#include "addresseeutil.h"
144#include "undocmds.h" 145#include "undocmds.h"
145#include "addresseeeditordialog.h" 146#include "addresseeeditordialog.h"
146#include "viewmanager.h" 147#include "viewmanager.h"
147#include "details/detailsviewcontainer.h" 148#include "details/detailsviewcontainer.h"
148#include "kabprefs.h" 149#include "kabprefs.h"
149#include "xxportmanager.h" 150#include "xxportmanager.h"
150#include "incsearchwidget.h" 151#include "incsearchwidget.h"
151#include "jumpbuttonbar.h" 152#include "jumpbuttonbar.h"
152#include "extensionmanager.h" 153#include "extensionmanager.h"
153#include "addresseeconfig.h" 154#include "addresseeconfig.h"
154#include "nameeditdialog.h" 155#include "nameeditdialog.h"
155#include <kcmultidialog.h> 156#include <kcmultidialog.h>
156 157
157#ifdef _WIN32_ 158#ifdef _WIN32_
158#ifdef _OL_IMPORT_ 159#ifdef _OL_IMPORT_
159#include "kaimportoldialog.h" 160#include "kaimportoldialog.h"
160#endif 161#endif
161#else 162#else
162#include <unistd.h> 163#include <unistd.h>
163#endif 164#endif
164// sync includes 165// sync includes
165#include <libkdepim/ksyncprofile.h> 166#include <libkdepim/ksyncprofile.h>
166#include <libkdepim/ksyncprefsdialog.h> 167#include <libkdepim/ksyncprefsdialog.h>
167 168
168 169
169class KABCatPrefs : public QDialog 170class KABCatPrefs : public QDialog
170{ 171{
171 public: 172 public:
172 KABCatPrefs( QWidget *parent=0, const char *name=0 ) : 173 KABCatPrefs( QWidget *parent=0, const char *name=0 ) :
173 QDialog( parent, name, true ) 174 QDialog( parent, name, true )
174 { 175 {
175 setCaption( i18n("Manage new Categories") ); 176 setCaption( i18n("Manage new Categories") );
176 QVBoxLayout* lay = new QVBoxLayout( this ); 177 QVBoxLayout* lay = new QVBoxLayout( this );
177 lay->setSpacing( 3 ); 178 lay->setSpacing( 3 );
178 lay->setMargin( 3 ); 179 lay->setMargin( 3 );
179 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 180 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
180 lay->addWidget( lab ); 181 lay->addWidget( lab );
181 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 182 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
182 lay->addWidget( format ); 183 lay->addWidget( format );
183 format->setExclusive ( true ) ; 184 format->setExclusive ( true ) ;
184 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 185 addCatBut = new QRadioButton(i18n("Add to category list"), format );
185 new QRadioButton(i18n("Remove from addressees"), format ); 186 new QRadioButton(i18n("Remove from addressees"), format );
186 addCatBut->setChecked( true ); 187 addCatBut->setChecked( true );
187 QPushButton * ok = new QPushButton( i18n("OK"), this ); 188 QPushButton * ok = new QPushButton( i18n("OK"), this );
188 lay->addWidget( ok ); 189 lay->addWidget( ok );
189 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 190 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
190 lay->addWidget( cancel ); 191 lay->addWidget( cancel );
191 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 192 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
192 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 193 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
193 resize( 200, 200 ); 194 resize( 200, 200 );
194 } 195 }
195 196
196 bool addCat() { return addCatBut->isChecked(); } 197 bool addCat() { return addCatBut->isChecked(); }
197private: 198private:
198 QRadioButton* addCatBut; 199 QRadioButton* addCatBut;
199}; 200};
200 201
201class KABFormatPrefs : public QDialog 202class KABFormatPrefs : public QDialog
202{ 203{
203 public: 204 public:
204 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : 205 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) :
205 QDialog( parent, name, true ) 206 QDialog( parent, name, true )
206 { 207 {
207 setCaption( i18n("Set formatted name") ); 208 setCaption( i18n("Set formatted name") );
208 QVBoxLayout* lay = new QVBoxLayout( this ); 209 QVBoxLayout* lay = new QVBoxLayout( this );
209 lay->setSpacing( 3 ); 210 lay->setSpacing( 3 );
210 lay->setMargin( 3 ); 211 lay->setMargin( 3 );
211 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); 212 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this );
212 lay->addWidget( lab ); 213 lay->addWidget( lab );
213 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 214 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this );
214 lay->addWidget( format ); 215 lay->addWidget( format );
215 format->setExclusive ( true ) ; 216 format->setExclusive ( true ) ;
216 simple = new QRadioButton(i18n("Simple: James Bond"), format ); 217 simple = new QRadioButton(i18n("Simple: James Bond"), format );
217 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); 218 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format );
218 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 219 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
219 company = new QRadioButton(i18n("Organization: MI6"), format ); 220 company = new QRadioButton(i18n("Organization: MI6"), format );
220 simple->setChecked( true ); 221 simple->setChecked( true );
221 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); 222 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this);
222 lay->addWidget( setCompany ); 223 lay->addWidget( setCompany );
223 QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); 224 QPushButton * ok = new QPushButton( i18n("Select contact list"), this );
224 lay->addWidget( ok ); 225 lay->addWidget( ok );
225 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 226 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
226 lay->addWidget( cancel ); 227 lay->addWidget( cancel );
@@ -1486,271 +1487,282 @@ void KABCore::setDetailsToggle()
1486void KABCore::setDetailsVisible( bool visible ) 1487void KABCore::setDetailsVisible( bool visible )
1487{ 1488{
1488 if (visible && mDetails->isHidden()) 1489 if (visible && mDetails->isHidden())
1489 { 1490 {
1490 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1491 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1491 if ( addrList.count() > 0 ) 1492 if ( addrList.count() > 0 )
1492 mDetails->setAddressee( addrList[ 0 ] ); 1493 mDetails->setAddressee( addrList[ 0 ] );
1493 } 1494 }
1494 1495
1495 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between 1496 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between
1496 // the listview and the detailview. We do that by changing the splitbar size. 1497 // the listview and the detailview. We do that by changing the splitbar size.
1497 if (mMultipleViewsAtOnce) 1498 if (mMultipleViewsAtOnce)
1498 { 1499 {
1499 if ( visible ) 1500 if ( visible )
1500 mDetails->show(); 1501 mDetails->show();
1501 else 1502 else
1502 mDetails->hide(); 1503 mDetails->hide();
1503 } 1504 }
1504 else 1505 else
1505 { 1506 {
1506 if ( visible ) { 1507 if ( visible ) {
1507 mViewManager->hide(); 1508 mViewManager->hide();
1508 mDetails->show(); 1509 mDetails->show();
1509 mIncSearchWidget->setFocus(); 1510 mIncSearchWidget->setFocus();
1510 } 1511 }
1511 else { 1512 else {
1512 mViewManager->show(); 1513 mViewManager->show();
1513 mDetails->hide(); 1514 mDetails->hide();
1514 mViewManager->setFocusAV(); 1515 mViewManager->setFocusAV();
1515 } 1516 }
1516 setJumpButtonBarVisible( !visible ); 1517 setJumpButtonBarVisible( !visible );
1517 } 1518 }
1518 1519
1519} 1520}
1520 1521
1521void KABCore::extensionChanged( int id ) 1522void KABCore::extensionChanged( int id )
1522{ 1523{
1523 //change the details view only for non desktop systems 1524 //change the details view only for non desktop systems
1524#ifndef DESKTOP_VERSION 1525#ifndef DESKTOP_VERSION
1525 1526
1526 if (id == 0) 1527 if (id == 0)
1527 { 1528 {
1528 //the user disabled the extension. 1529 //the user disabled the extension.
1529 1530
1530 if (mMultipleViewsAtOnce) 1531 if (mMultipleViewsAtOnce)
1531 { // enable detailsview again 1532 { // enable detailsview again
1532 setDetailsVisible( true ); 1533 setDetailsVisible( true );
1533 mActionDetails->setChecked( true ); 1534 mActionDetails->setChecked( true );
1534 } 1535 }
1535 else 1536 else
1536 { //go back to the listview 1537 { //go back to the listview
1537 setDetailsVisible( false ); 1538 setDetailsVisible( false );
1538 mActionDetails->setChecked( false ); 1539 mActionDetails->setChecked( false );
1539 mActionDetails->setEnabled(true); 1540 mActionDetails->setEnabled(true);
1540 } 1541 }
1541 1542
1542 } 1543 }
1543 else 1544 else
1544 { 1545 {
1545 //the user enabled the extension. 1546 //the user enabled the extension.
1546 setDetailsVisible( false ); 1547 setDetailsVisible( false );
1547 mActionDetails->setChecked( false ); 1548 mActionDetails->setChecked( false );
1548 1549
1549 if (!mMultipleViewsAtOnce) 1550 if (!mMultipleViewsAtOnce)
1550 { 1551 {
1551 mActionDetails->setEnabled(false); 1552 mActionDetails->setEnabled(false);
1552 } 1553 }
1553 1554
1554 mExtensionManager->setSelectionChanged(); 1555 mExtensionManager->setSelectionChanged();
1555 1556
1556 } 1557 }
1557 1558
1558#endif// DESKTOP_VERSION 1559#endif// DESKTOP_VERSION
1559 1560
1560} 1561}
1561 1562
1562 1563
1563void KABCore::extensionModified( const KABC::Addressee::List &list ) 1564void KABCore::extensionModified( const KABC::Addressee::List &list )
1564{ 1565{
1565 1566
1566 if ( list.count() != 0 ) { 1567 if ( list.count() != 0 ) {
1567 KABC::Addressee::List::ConstIterator it; 1568 KABC::Addressee::List::ConstIterator it;
1568 for ( it = list.begin(); it != list.end(); ++it ) 1569 for ( it = list.begin(); it != list.end(); ++it )
1569 mAddressBook->insertAddressee( *it ); 1570 mAddressBook->insertAddressee( *it );
1570 if ( list.count() > 1 ) 1571 if ( list.count() > 1 )
1571 setModified(); 1572 setModified();
1572 else 1573 else
1573 setModifiedWOrefresh(); 1574 setModifiedWOrefresh();
1574 } 1575 }
1575 if ( list.count() == 0 ) 1576 if ( list.count() == 0 )
1576 mViewManager->refreshView(); 1577 mViewManager->refreshView();
1577 else 1578 else
1578 mViewManager->refreshView( list[ 0 ].uid() ); 1579 mViewManager->refreshView( list[ 0 ].uid() );
1579 1580
1580 1581
1581 1582
1582} 1583}
1583 1584
1584QString KABCore::getNameByPhone( const QString &phone ) 1585QString KABCore::getNameByPhone( const QString &phone )
1585{ 1586{
1586#ifndef KAB_EMBEDDED 1587#ifndef KAB_EMBEDDED
1587 QRegExp r( "[/*/-/ ]" ); 1588 QRegExp r( "[/*/-/ ]" );
1588 QString localPhone( phone ); 1589 QString localPhone( phone );
1589 1590
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 1615void KABCore::openConfigGlobalDialog()
1616{
1617 KPimPrefsGlobalDialog gc ( this );
1618 gc.exec();
1619}
1615void KABCore::openConfigDialog() 1620void 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
1636void KABCore::openLDAPDialog() 1648void 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
1653} 1665}
1654 1666
1655void KABCore::print() 1667void KABCore::print()
1656{ 1668{
1657#ifndef KAB_EMBEDDED 1669#ifndef KAB_EMBEDDED
1658 KPrinter printer; 1670 KPrinter printer;
1659 if ( !printer.setup( this ) ) 1671 if ( !printer.setup( this ) )
1660 return; 1672 return;
1661 1673
1662 KABPrinting::PrintingWizard wizard( &printer, mAddressBook, 1674 KABPrinting::PrintingWizard wizard( &printer, mAddressBook,
1663 mViewManager->selectedUids(), this ); 1675 mViewManager->selectedUids(), this );
1664 1676
1665 wizard.exec(); 1677 wizard.exec();
1666#else //KAB_EMBEDDED 1678#else //KAB_EMBEDDED
1667 qDebug("KABCore::print() finsih method"); 1679 qDebug("KABCore::print() finsih method");
1668#endif //KAB_EMBEDDED 1680#endif //KAB_EMBEDDED
1669 1681
1670} 1682}
1671 1683
1672 1684
1673void KABCore::addGUIClient( KXMLGUIClient *client ) 1685void KABCore::addGUIClient( KXMLGUIClient *client )
1674{ 1686{
1675 if ( mGUIClient ) 1687 if ( mGUIClient )
1676 mGUIClient->insertChildClient( client ); 1688 mGUIClient->insertChildClient( client );
1677 else 1689 else
1678 KMessageBox::error( this, "no KXMLGUICLient"); 1690 KMessageBox::error( this, "no KXMLGUICLient");
1679} 1691}
1680 1692
1681 1693
1682void KABCore::configurationChanged() 1694void KABCore::configurationChanged()
1683{ 1695{
1684 mExtensionManager->reconfigure(); 1696 mExtensionManager->reconfigure();
1685} 1697}
1686 1698
1687void KABCore::addressBookChanged() 1699void KABCore::addressBookChanged()
1688{ 1700{
1689/*US 1701/*US
1690 QDictIterator<AddresseeEditorDialog> it( mEditorDict ); 1702 QDictIterator<AddresseeEditorDialog> it( mEditorDict );
1691 while ( it.current() ) { 1703 while ( it.current() ) {
1692 if ( it.current()->dirty() ) { 1704 if ( it.current()->dirty() ) {
1693 QString text = i18n( "Data has been changed externally. Unsaved " 1705 QString text = i18n( "Data has been changed externally. Unsaved "
1694 "changes will be lost." ); 1706 "changes will be lost." );
1695 KMessageBox::information( this, text ); 1707 KMessageBox::information( this, text );
1696 } 1708 }
1697 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); 1709 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
1698 ++it; 1710 ++it;
1699 } 1711 }
1700*/ 1712*/
1701 if (mEditorDialog) 1713 if (mEditorDialog)
1702 { 1714 {
1703 if (mEditorDialog->dirty()) 1715 if (mEditorDialog->dirty())
1704 { 1716 {
1705 QString text = i18n( "Data has been changed externally. Unsaved " 1717 QString text = i18n( "Data has been changed externally. Unsaved "
1706 "changes will be lost." ); 1718 "changes will be lost." );
1707 KMessageBox::information( this, text ); 1719 KMessageBox::information( this, text );
1708 } 1720 }
1709 QString currentuid = mEditorDialog->addressee().uid(); 1721 QString currentuid = mEditorDialog->addressee().uid();
1710 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); 1722 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) );
1711 } 1723 }
1712 mViewManager->refreshView(); 1724 mViewManager->refreshView();
1713 1725
1714 1726
1715} 1727}
1716 1728
1717AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1729AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1718 const char *name ) 1730 const char *name )
1719{ 1731{
1720 1732
1721 if ( mEditorDialog == 0 ) { 1733 if ( mEditorDialog == 0 ) {
1722 mEditorDialog = new AddresseeEditorDialog( this, parent, 1734 mEditorDialog = new AddresseeEditorDialog( this, parent,
1723 name ? name : "editorDialog" ); 1735 name ? name : "editorDialog" );
1724 1736
1725 1737
1726 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1738 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1727 SLOT( contactModified( const KABC::Addressee& ) ) ); 1739 SLOT( contactModified( const KABC::Addressee& ) ) );
1728 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), 1740 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
1729 // SLOT( slotEditorDestroyed( const QString& ) ) ; 1741 // SLOT( slotEditorDestroyed( const QString& ) ) ;
1730 } 1742 }
1731 1743
1732 return mEditorDialog; 1744 return mEditorDialog;
1733} 1745}
1734 1746
1735void KABCore::slotEditorDestroyed( const QString &uid ) 1747void KABCore::slotEditorDestroyed( const QString &uid )
1736{ 1748{
1737 //mEditorDict.remove( uid ); 1749 //mEditorDict.remove( uid );
1738} 1750}
1739 1751
1740void KABCore::initGUI() 1752void KABCore::initGUI()
1741{ 1753{
1742#ifndef KAB_EMBEDDED 1754#ifndef KAB_EMBEDDED
1743 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1755 QHBoxLayout *topLayout = new QHBoxLayout( this );
1744 topLayout->setSpacing( KDialogBase::spacingHint() ); 1756 topLayout->setSpacing( KDialogBase::spacingHint() );
1745 1757
1746 mExtensionBarSplitter = new QSplitter( this ); 1758 mExtensionBarSplitter = new QSplitter( this );
1747 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1759 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1748 1760
1749 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1761 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1750 1762
1751 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1763 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1752 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1764 mIncSearchWidget = new IncSearchWidget( viewSpace );
1753 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1765 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1754 SLOT( incrementalSearch( const QString& ) ) ); 1766 SLOT( incrementalSearch( const QString& ) ) );
1755 1767
1756 mViewManager = new ViewManager( this, viewSpace ); 1768 mViewManager = new ViewManager( this, viewSpace );
@@ -1900,476 +1912,478 @@ void KABCore::initGUI()
1900 topLayout->addWidget( mJumpButtonBar ); 1912 topLayout->addWidget( mJumpButtonBar );
1901//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1913//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
1902 1914
1903// mMainWindow->getIconToolBar()->raise(); 1915// mMainWindow->getIconToolBar()->raise();
1904 1916
1905#endif //KAB_EMBEDDED 1917#endif //KAB_EMBEDDED
1906 1918
1907} 1919}
1908void KABCore::initActions() 1920void KABCore::initActions()
1909{ 1921{
1910//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1922//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1911 1923
1912#ifndef KAB_EMBEDDED 1924#ifndef KAB_EMBEDDED
1913 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 1925 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
1914 SLOT( clipboardDataChanged() ) ); 1926 SLOT( clipboardDataChanged() ) );
1915#endif //KAB_EMBEDDED 1927#endif //KAB_EMBEDDED
1916 1928
1917 // file menu 1929 // file menu
1918 1930
1919 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 1931 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
1920 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 1932 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
1921 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 1933 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager,
1922 SLOT( printView() ), actionCollection(), "kaddressbook_print" ); 1934 SLOT( printView() ), actionCollection(), "kaddressbook_print" );
1923 1935
1924 1936
1925 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, 1937 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails,
1926 SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); 1938 SLOT( printView() ), actionCollection(), "kaddressbook_print2" );
1927 1939
1928 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 1940 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this,
1929 SLOT( save() ), actionCollection(), "file_sync" ); 1941 SLOT( save() ), actionCollection(), "file_sync" );
1930 1942
1931 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 1943 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this,
1932 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 1944 SLOT( newContact() ), actionCollection(), "file_new_contact" );
1933 1945
1934 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 1946 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
1935 this, SLOT( mailVCard() ), 1947 this, SLOT( mailVCard() ),
1936 actionCollection(), "file_mail_vcard"); 1948 actionCollection(), "file_mail_vcard");
1937 1949
1938 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, 1950 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
1939 SLOT( export2phone() ), actionCollection(), 1951 SLOT( export2phone() ), actionCollection(),
1940 "kaddressbook_ex2phone" ); 1952 "kaddressbook_ex2phone" );
1941 1953
1942 mActionBeamVCard = 0; 1954 mActionBeamVCard = 0;
1943 mActionBeam = 0; 1955 mActionBeam = 0;
1944 1956
1945#ifndef DESKTOP_VERSION 1957#ifndef DESKTOP_VERSION
1946 if ( Ir::supported() ) { 1958 if ( Ir::supported() ) {
1947 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this, 1959 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this,
1948 SLOT( beamVCard() ), actionCollection(), 1960 SLOT( beamVCard() ), actionCollection(),
1949 "kaddressbook_beam_vcard" ); 1961 "kaddressbook_beam_vcard" );
1950 1962
1951 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1963 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1952 SLOT( beamMySelf() ), actionCollection(), 1964 SLOT( beamMySelf() ), actionCollection(),
1953 "kaddressbook_beam_myself" ); 1965 "kaddressbook_beam_myself" );
1954 } 1966 }
1955#endif 1967#endif
1956 1968
1957 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1969 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1958 this, SLOT( editContact2() ), 1970 this, SLOT( editContact2() ),
1959 actionCollection(), "file_properties" ); 1971 actionCollection(), "file_properties" );
1960 1972
1961#ifdef KAB_EMBEDDED 1973#ifdef KAB_EMBEDDED
1962 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 1974 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
1963 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 1975 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
1964 mMainWindow, SLOT( exit() ), 1976 mMainWindow, SLOT( exit() ),
1965 actionCollection(), "quit" ); 1977 actionCollection(), "quit" );
1966#endif //KAB_EMBEDDED 1978#endif //KAB_EMBEDDED
1967 1979
1968 // edit menu 1980 // edit menu
1969 if ( mIsPart ) { 1981 if ( mIsPart ) {
1970 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1982 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1971 SLOT( copyContacts() ), actionCollection(), 1983 SLOT( copyContacts() ), actionCollection(),
1972 "kaddressbook_copy" ); 1984 "kaddressbook_copy" );
1973 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1985 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1974 SLOT( cutContacts() ), actionCollection(), 1986 SLOT( cutContacts() ), actionCollection(),
1975 "kaddressbook_cut" ); 1987 "kaddressbook_cut" );
1976 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1988 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1977 SLOT( pasteContacts() ), actionCollection(), 1989 SLOT( pasteContacts() ), actionCollection(),
1978 "kaddressbook_paste" ); 1990 "kaddressbook_paste" );
1979 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1991 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1980 SLOT( selectAllContacts() ), actionCollection(), 1992 SLOT( selectAllContacts() ), actionCollection(),
1981 "kaddressbook_select_all" ); 1993 "kaddressbook_select_all" );
1982 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1994 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1983 SLOT( undo() ), actionCollection(), 1995 SLOT( undo() ), actionCollection(),
1984 "kaddressbook_undo" ); 1996 "kaddressbook_undo" );
1985 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1997 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1986 this, SLOT( redo() ), actionCollection(), 1998 this, SLOT( redo() ), actionCollection(),
1987 "kaddressbook_redo" ); 1999 "kaddressbook_redo" );
1988 } else { 2000 } else {
1989 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 2001 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1990 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 2002 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1991 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 2003 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1992 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 2004 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1993 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 2005 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1994 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 2006 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1995 } 2007 }
1996 2008
1997 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 2009 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
1998 Key_Delete, this, SLOT( deleteContacts() ), 2010 Key_Delete, this, SLOT( deleteContacts() ),
1999 actionCollection(), "edit_delete" ); 2011 actionCollection(), "edit_delete" );
2000 2012
2001 mActionUndo->setEnabled( false ); 2013 mActionUndo->setEnabled( false );
2002 mActionRedo->setEnabled( false ); 2014 mActionRedo->setEnabled( false );
2003 2015
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");
2058#endif //KAB_EMBEDDED 2071#endif //KAB_EMBEDDED
2059 2072
2060 2073
2061 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 2074 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
2062 SLOT( setWhoAmI() ), actionCollection(), 2075 SLOT( setWhoAmI() ), actionCollection(),
2063 "set_personal" ); 2076 "set_personal" );
2064 2077
2065 2078
2066 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this, 2079 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this,
2067 SLOT( setCategories() ), actionCollection(), 2080 SLOT( setCategories() ), actionCollection(),
2068 "edit_set_categories" ); 2081 "edit_set_categories" );
2069 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this, 2082 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this,
2070 SLOT( editCategories() ), actionCollection(), 2083 SLOT( editCategories() ), actionCollection(),
2071 "edit__categories" ); 2084 "edit__categories" );
2072 2085
2073 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 2086 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
2074 SLOT( removeVoice() ), actionCollection(), 2087 SLOT( removeVoice() ), actionCollection(),
2075 "remove_voice" ); 2088 "remove_voice" );
2076 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this, 2089 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this,
2077 SLOT( setFormattedName() ), actionCollection(), 2090 SLOT( setFormattedName() ), actionCollection(),
2078 "set_formatted" ); 2091 "set_formatted" );
2079 2092
2080 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, 2093 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
2081 SLOT( manageCategories() ), actionCollection(), 2094 SLOT( manageCategories() ), actionCollection(),
2082 "remove_voice" ); 2095 "remove_voice" );
2083 2096
2084 2097
2085 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 2098 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
2086 SLOT( importFromOL() ), actionCollection(), 2099 SLOT( importFromOL() ), actionCollection(),
2087 "import_OL" ); 2100 "import_OL" );
2088#ifdef KAB_EMBEDDED 2101#ifdef KAB_EMBEDDED
2089 mActionLicence = new KAction( i18n( "Licence" ), 0, 2102 mActionLicence = new KAction( i18n( "Licence" ), 0,
2090 this, SLOT( showLicence() ), actionCollection(), 2103 this, SLOT( showLicence() ), actionCollection(),
2091 "licence_about_data" ); 2104 "licence_about_data" );
2092 mActionFaq = new KAction( i18n( "Faq" ), 0, 2105 mActionFaq = new KAction( i18n( "Faq" ), 0,
2093 this, SLOT( faq() ), actionCollection(), 2106 this, SLOT( faq() ), actionCollection(),
2094 "faq_about_data" ); 2107 "faq_about_data" );
2095 mActionWN = new KAction( i18n( "What's New?" ), 0, 2108 mActionWN = new KAction( i18n( "What's New?" ), 0,
2096 this, SLOT( whatsnew() ), actionCollection(), 2109 this, SLOT( whatsnew() ), actionCollection(),
2097 "wn" ); 2110 "wn" );
2098 2111
2099 2112
2100 2113
2101 mActionStorageHowto = new KAction( i18n( "Storage HowTo" ), 0, 2114 mActionStorageHowto = new KAction( i18n( "Storage HowTo" ), 0,
2102 this, SLOT( storagehowto() ), actionCollection(), 2115 this, SLOT( storagehowto() ), actionCollection(),
2103 "storage" ); 2116 "storage" );
2104 2117
2105 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2118 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2106 this, SLOT( synchowto() ), actionCollection(), 2119 this, SLOT( synchowto() ), actionCollection(),
2107 "sync" ); 2120 "sync" );
2108 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2121 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2109 this, SLOT( kdesynchowto() ), actionCollection(), 2122 this, SLOT( kdesynchowto() ), actionCollection(),
2110 "kdesync" ); 2123 "kdesync" );
2111 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2124 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2112 this, SLOT( multisynchowto() ), actionCollection(), 2125 this, SLOT( multisynchowto() ), actionCollection(),
2113 "multisync" ); 2126 "multisync" );
2114 2127
2115 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2128 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2116 this, SLOT( createAboutData() ), actionCollection(), 2129 this, SLOT( createAboutData() ), actionCollection(),
2117 "kaddressbook_about_data" ); 2130 "kaddressbook_about_data" );
2118#endif //KAB_EMBEDDED 2131#endif //KAB_EMBEDDED
2119 2132
2120 clipboardDataChanged(); 2133 clipboardDataChanged();
2121 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2134 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2122 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2135 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2123} 2136}
2124 2137
2125//US we need this function, to plug all actions into the correct menues. 2138//US we need this function, to plug all actions into the correct menues.
2126// KDE uses a XML format to plug the actions, but we work her without this overhead. 2139// KDE uses a XML format to plug the actions, but we work her without this overhead.
2127void KABCore::addActionsManually() 2140void KABCore::addActionsManually()
2128{ 2141{
2129//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2142//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2130 2143
2131#ifdef KAB_EMBEDDED 2144#ifdef KAB_EMBEDDED
2132 QPopupMenu *fileMenu = new QPopupMenu( this ); 2145 QPopupMenu *fileMenu = new QPopupMenu( this );
2133 QPopupMenu *editMenu = new QPopupMenu( this ); 2146 QPopupMenu *editMenu = new QPopupMenu( this );
2134 QPopupMenu *helpMenu = new QPopupMenu( this ); 2147 QPopupMenu *helpMenu = new QPopupMenu( this );
2135 2148
2136 KToolBar* tb = mMainWindow->toolBar(); 2149 KToolBar* tb = mMainWindow->toolBar();
2137 mMainWindow->setToolBarsMovable (false ); 2150 mMainWindow->setToolBarsMovable (false );
2138#ifndef DESKTOP_VERSION 2151#ifndef DESKTOP_VERSION
2139 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2152 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2140#endif 2153#endif
2141 QMenuBar* mb = mMainWindow->menuBar(); 2154 QMenuBar* mb = mMainWindow->menuBar();
2142 2155
2143 //US setup menubar. 2156 //US setup menubar.
2144 //Disable the following block if you do not want to have a menubar. 2157 //Disable the following block if you do not want to have a menubar.
2145 mb->insertItem( i18n("&File"), fileMenu ); 2158 mb->insertItem( i18n("&File"), fileMenu );
2146 mb->insertItem( i18n("&Edit"), editMenu ); 2159 mb->insertItem( i18n("&Edit"), editMenu );
2147 mb->insertItem( i18n("&View"), viewMenu ); 2160 mb->insertItem( i18n("&View"), viewMenu );
2148 mb->insertItem( i18n("&Settings"), settingsMenu ); 2161 mb->insertItem( i18n("&Settings"), settingsMenu );
2149#ifdef DESKTOP_VERSION 2162#ifdef DESKTOP_VERSION
2150 mb->insertItem( i18n("Synchronize"), syncMenu ); 2163 mb->insertItem( i18n("Synchronize"), syncMenu );
2151#else 2164#else
2152 mb->insertItem( i18n("Sync"), syncMenu ); 2165 mb->insertItem( i18n("Sync"), syncMenu );
2153#endif 2166#endif
2154 //mb->insertItem( i18n("&Change"), changeMenu ); 2167 //mb->insertItem( i18n("&Change"), changeMenu );
2155 mb->insertItem( i18n("&Help"), helpMenu ); 2168 mb->insertItem( i18n("&Help"), helpMenu );
2156 mIncSearchWidget = new IncSearchWidget( tb ); 2169 mIncSearchWidget = new IncSearchWidget( tb );
2157 // tb->insertWidget(-1, 0, mIncSearchWidget); 2170 // tb->insertWidget(-1, 0, mIncSearchWidget);
2158#ifndef DESKTOP_VERSION 2171#ifndef DESKTOP_VERSION
2159 } else { 2172 } else {
2160 //US setup toolbar 2173 //US setup toolbar
2161 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2174 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2162 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2175 QPopupMenu *popupBarTB = new QPopupMenu( this );
2163 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2176 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2164 tb->insertWidget(-1, 0, menuBarTB); 2177 tb->insertWidget(-1, 0, menuBarTB);
2165 mIncSearchWidget = new IncSearchWidget( tb ); 2178 mIncSearchWidget = new IncSearchWidget( tb );
2166 tb->enableMoving(false); 2179 tb->enableMoving(false);
2167 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2180 popupBarTB->insertItem( i18n("&File"), fileMenu );
2168 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2181 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2169 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2182 popupBarTB->insertItem( i18n("&View"), viewMenu );
2170 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2183 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2171 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2184 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2172 mViewManager->getFilterAction()->plug ( popupBarTB); 2185 mViewManager->getFilterAction()->plug ( popupBarTB);
2173 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2186 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2174 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2187 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2175 if (QApplication::desktop()->width() > 320 ) { 2188 if (QApplication::desktop()->width() > 320 ) {
2176 // mViewManager->getFilterAction()->plug ( tb); 2189 // mViewManager->getFilterAction()->plug ( tb);
2177 } 2190 }
2178 } 2191 }
2179#endif 2192#endif
2180 mIncSearchWidget->setSize(); 2193 mIncSearchWidget->setSize();
2181 // mActionQuit->plug ( mMainWindow->toolBar()); 2194 // mActionQuit->plug ( mMainWindow->toolBar());
2182 2195
2183 2196
2184 2197
2185 //US Now connect the actions with the menue entries. 2198 //US Now connect the actions with the menue entries.
2186#ifdef DESKTOP_VERSION 2199#ifdef DESKTOP_VERSION
2187 mActionPrint->plug( fileMenu ); 2200 mActionPrint->plug( fileMenu );
2188 mActionPrintDetails->plug( fileMenu ); 2201 mActionPrintDetails->plug( fileMenu );
2189 fileMenu->insertSeparator(); 2202 fileMenu->insertSeparator();
2190#endif 2203#endif
2191 mActionMail->plug( fileMenu ); 2204 mActionMail->plug( fileMenu );
2192 fileMenu->insertSeparator(); 2205 fileMenu->insertSeparator();
2193 2206
2194 mActionNewContact->plug( editMenu ); 2207 mActionNewContact->plug( editMenu );
2195 mActionNewContact->plug( tb ); 2208 mActionNewContact->plug( tb );
2196 2209
2197 mActionEditAddressee->plug( editMenu ); 2210 mActionEditAddressee->plug( editMenu );
2198 editMenu->insertSeparator(); 2211 editMenu->insertSeparator();
2199 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2212 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2200 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2213 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2201 mActionEditAddressee->plug( tb ); 2214 mActionEditAddressee->plug( tb );
2202 2215
2203 // fileMenu->insertSeparator(); 2216 // fileMenu->insertSeparator();
2204 mActionSave->plug( fileMenu ); 2217 mActionSave->plug( fileMenu );
2205 fileMenu->insertItem( "&Import", ImportMenu ); 2218 fileMenu->insertItem( "&Import", ImportMenu );
2206 fileMenu->insertItem( "&Export", ExportMenu ); 2219 fileMenu->insertItem( "&Export", ExportMenu );
2207 editMenu->insertItem( i18n("&Change"), changeMenu ); 2220 editMenu->insertItem( i18n("&Change"), changeMenu );
2208 editMenu->insertSeparator(); 2221 editMenu->insertSeparator();
2209#ifndef DESKTOP_VERSION 2222#ifndef DESKTOP_VERSION
2210 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); 2223 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu );
2211#endif 2224#endif
2212#if 0 2225#if 0
2213 // PENDING fix MailVCard 2226 // PENDING fix MailVCard
2214 fileMenu->insertSeparator(); 2227 fileMenu->insertSeparator();
2215 mActionMailVCard->plug( fileMenu ); 2228 mActionMailVCard->plug( fileMenu );
2216#endif 2229#endif
2217#ifndef DESKTOP_VERSION 2230#ifndef DESKTOP_VERSION
2218 if ( Ir::supported() ) mActionBR->plug( beamMenu ); 2231 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2219 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); 2232 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2220 if ( Ir::supported() ) mActionBeam->plug( beamMenu ); 2233 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2221#endif 2234#endif
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 );
2272 //mActionEditCategories->plug( changeMenu ); 2286 //mActionEditCategories->plug( changeMenu );
2273 mActionCategories->plug( changeMenu ); 2287 mActionCategories->plug( changeMenu );
2274 //mActionManageCategories->plug( changeMenu ); 2288 //mActionManageCategories->plug( changeMenu );
2275 2289
2276 //mActionCategories->plug( settingsMenu ); 2290 //mActionCategories->plug( settingsMenu );
2277 2291
2278 2292
2279 mActionWN->plug( helpMenu ); 2293 mActionWN->plug( helpMenu );
2280 mActionStorageHowto->plug( helpMenu ); 2294 mActionStorageHowto->plug( helpMenu );
2281 mActionSyncHowto->plug( helpMenu ); 2295 mActionSyncHowto->plug( helpMenu );
2282 mActionKdeSyncHowto->plug( helpMenu ); 2296 mActionKdeSyncHowto->plug( helpMenu );
2283 mActionMultiSyncHowto->plug( helpMenu ); 2297 mActionMultiSyncHowto->plug( helpMenu );
2284 mActionFaq->plug( helpMenu ); 2298 mActionFaq->plug( helpMenu );
2285 mActionLicence->plug( helpMenu ); 2299 mActionLicence->plug( helpMenu );
2286 mActionAboutKAddressbook->plug( helpMenu ); 2300 mActionAboutKAddressbook->plug( helpMenu );
2287 2301
2288 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2302 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2289 2303
2290 mActionSave->plug( tb ); 2304 mActionSave->plug( tb );
2291 mViewManager->getFilterAction()->plug ( tb); 2305 mViewManager->getFilterAction()->plug ( tb);
2292 //LR hide filteraction on started in 480x640 2306 //LR hide filteraction on started in 480x640
2293 if (QApplication::desktop()->width() == 480 ) { 2307 if (QApplication::desktop()->width() == 480 ) {
2294 mViewManager->getFilterAction()->setComboWidth( 0 ); 2308 mViewManager->getFilterAction()->setComboWidth( 0 );
2295 } 2309 }
2296 mActionUndo->plug( tb ); 2310 mActionUndo->plug( tb );
2297 mActionDelete->plug( tb ); 2311 mActionDelete->plug( tb );
2298 mActionRedo->plug( tb ); 2312 mActionRedo->plug( tb );
2299 } else { 2313 } else {
2300 mActionSave->plug( tb ); 2314 mActionSave->plug( tb );
2301 tb->enableMoving(false); 2315 tb->enableMoving(false);
2302 } 2316 }
2303 //mActionQuit->plug ( tb ); 2317 //mActionQuit->plug ( tb );
2304 //tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2318 //tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2305 2319
2306 //US link the searchwidget first to this. 2320 //US link the searchwidget first to this.
2307 // The real linkage to the toolbar happens later. 2321 // The real linkage to the toolbar happens later.
2308//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2322//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2309//US tb->insertItem( mIncSearchWidget ); 2323//US tb->insertItem( mIncSearchWidget );
2310/*US 2324/*US
2311 mIncSearchWidget = new IncSearchWidget( tb ); 2325 mIncSearchWidget = new IncSearchWidget( tb );
2312 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2326 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2313 SLOT( incrementalSearch( const QString& ) ) ); 2327 SLOT( incrementalSearch( const QString& ) ) );
2314 2328
2315 mJumpButtonBar = new JumpButtonBar( this, this ); 2329 mJumpButtonBar = new JumpButtonBar( this, this );
2316 2330
2317//US topLayout->addWidget( mJumpButtonBar ); 2331//US topLayout->addWidget( mJumpButtonBar );
2318 this->layout()->add( mJumpButtonBar ); 2332 this->layout()->add( mJumpButtonBar );
2319*/ 2333*/
2320 2334
2321#endif //KAB_EMBEDDED 2335#endif //KAB_EMBEDDED
2322 2336
2323 mActionExport2phone->plug( ExportMenu ); 2337 mActionExport2phone->plug( ExportMenu );
2324 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2338 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2325 syncManager->fillSyncMenu(); 2339 syncManager->fillSyncMenu();
2326 2340
2327} 2341}
2328void KABCore::showLicence() 2342void KABCore::showLicence()
2329{ 2343{
2330 KApplication::showLicence(); 2344 KApplication::showLicence();
2331} 2345}
2332 2346
2333void KABCore::manageCategories( ) 2347void KABCore::manageCategories( )
2334{ 2348{
2335 KABCatPrefs* cp = new KABCatPrefs(); 2349 KABCatPrefs* cp = new KABCatPrefs();
2336 cp->show(); 2350 cp->show();
2337 int w =cp->sizeHint().width() ; 2351 int w =cp->sizeHint().width() ;
2338 int h = cp->sizeHint().height() ; 2352 int h = cp->sizeHint().height() ;
2339 int dw = QApplication::desktop()->width(); 2353 int dw = QApplication::desktop()->width();
2340 int dh = QApplication::desktop()->height(); 2354 int dh = QApplication::desktop()->height();
2341 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2355 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2342 if ( !cp->exec() ) { 2356 if ( !cp->exec() ) {
2343 delete cp; 2357 delete cp;
2344 return; 2358 return;
2345 } 2359 }
2346 int count = 0; 2360 int count = 0;
2347 int cc = 0; 2361 int cc = 0;
2348 message( i18n("Please wait, processing categories...")); 2362 message( i18n("Please wait, processing categories..."));
2349 if ( cp->addCat() ) { 2363 if ( cp->addCat() ) {
2350 KABC::AddressBook::Iterator it; 2364 KABC::AddressBook::Iterator it;
2351 QStringList catList = KABPrefs::instance()->mCustomCategories; 2365 QStringList catList = KABPrefs::instance()->mCustomCategories;
2352 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2366 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2353 ++cc; 2367 ++cc;
2354 if ( cc %10 == 0) 2368 if ( cc %10 == 0)
2355 message(i18n("Processing contact #%1").arg(cc)); 2369 message(i18n("Processing contact #%1").arg(cc));
2356 QStringList catIncList = (*it).categories(); 2370 QStringList catIncList = (*it).categories();
2357 int i; 2371 int i;
2358 for( i = 0; i< catIncList.count(); ++i ) { 2372 for( i = 0; i< catIncList.count(); ++i ) {
2359 if ( !catList.contains (catIncList[i])) { 2373 if ( !catList.contains (catIncList[i])) {
2360 catList.append( catIncList[i] ); 2374 catList.append( catIncList[i] );
2361 //qDebug("add cat %s ", catIncList[i].latin1()); 2375 //qDebug("add cat %s ", catIncList[i].latin1());
2362 ++count; 2376 ++count;
2363 } 2377 }
2364 } 2378 }
2365 } 2379 }
2366 catList.sort(); 2380 catList.sort();
2367 KABPrefs::instance()->mCustomCategories = catList; 2381 KABPrefs::instance()->mCustomCategories = catList;
2368 KABPrefs::instance()->writeConfig(); 2382 KABPrefs::instance()->writeConfig();
2369 message(QString::number( count )+ i18n(" categories added to list! ")); 2383 message(QString::number( count )+ i18n(" categories added to list! "));
2370 } else { 2384 } else {
2371 QStringList catList = KABPrefs::instance()->mCustomCategories; 2385 QStringList catList = KABPrefs::instance()->mCustomCategories;
2372 QStringList catIncList; 2386 QStringList catIncList;
2373 QStringList newCatList; 2387 QStringList newCatList;
2374 KABC::AddressBook::Iterator it; 2388 KABC::AddressBook::Iterator it;
2375 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2389 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 80dbf08..6479a58 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -202,327 +202,329 @@ class KABCore : public QWidget, public KSyncInterface
202 void deleteContacts(); 202 void deleteContacts();
203 203
204 /** 204 /**
205 Deletes given contacts from the address book. 205 Deletes given contacts from the address book.
206 206
207 @param uids The uids of the contacts, which shall be deleted. 207 @param uids The uids of the contacts, which shall be deleted.
208 */ 208 */
209 void deleteContacts( const QStringList &uids ); 209 void deleteContacts( const QStringList &uids );
210 210
211 /** 211 /**
212 Copys the selected contacts into clipboard for later pasting. 212 Copys the selected contacts into clipboard for later pasting.
213 */ 213 */
214 void copyContacts(); 214 void copyContacts();
215 215
216 /** 216 /**
217 Cuts the selected contacts and stores them for later pasting. 217 Cuts the selected contacts and stores them for later pasting.
218 */ 218 */
219 void cutContacts(); 219 void cutContacts();
220 220
221 /** 221 /**
222 Paste contacts from clipboard into the address book. 222 Paste contacts from clipboard into the address book.
223 */ 223 */
224 void pasteContacts(); 224 void pasteContacts();
225 225
226 /** 226 /**
227 Paste given contacts into the address book. 227 Paste given contacts into the address book.
228 228
229 @param list The list of addressee, which shall be pasted. 229 @param list The list of addressee, which shall be pasted.
230 */ 230 */
231 void pasteContacts( KABC::Addressee::List &list ); 231 void pasteContacts( KABC::Addressee::List &list );
232 232
233 /** 233 /**
234 Sets the whoAmI contact, that is used by many other programs to 234 Sets the whoAmI contact, that is used by many other programs to
235 get personal information about the current user. 235 get personal information about the current user.
236 */ 236 */
237 void setWhoAmI(); 237 void setWhoAmI();
238 238
239 /** 239 /**
240 Displays the category dialog and applies the result to all 240 Displays the category dialog and applies the result to all
241 selected contacts. 241 selected contacts.
242 */ 242 */
243 void setCategories(); 243 void setCategories();
244 void manageCategories(); 244 void manageCategories();
245 void editCategories(); 245 void editCategories();
246 246
247 /** 247 /**
248 Sets the field list of the Incremental Search Widget. 248 Sets the field list of the Incremental Search Widget.
249 */ 249 */
250 void setSearchFields( const KABC::Field::List &fields ); 250 void setSearchFields( const KABC::Field::List &fields );
251 251
252 /** 252 /**
253 Search with the current search field for a contact, that matches 253 Search with the current search field for a contact, that matches
254 the given text, and selects it in the view. 254 the given text, and selects it in the view.
255 */ 255 */
256 void incrementalSearch( const QString& text ); 256 void incrementalSearch( const QString& text );
257 void incrementalSearchJump( const QString& text ); 257 void incrementalSearchJump( const QString& text );
258 258
259 /** 259 /**
260 Marks the address book as modified. 260 Marks the address book as modified.
261 */ 261 */
262 void setModified(); 262 void setModified();
263 /** 263 /**
264 Marks the address book as modified without refreshing the view. 264 Marks the address book as modified without refreshing the view.
265 */ 265 */
266 void setModifiedWOrefresh(); 266 void setModifiedWOrefresh();
267 267
268 /** 268 /**
269 Marks the address book as modified concerning the argument. 269 Marks the address book as modified concerning the argument.
270 */ 270 */
271 void setModified( bool modified ); 271 void setModified( bool modified );
272 272
273 /** 273 /**
274 Returns whether the address book is modified. 274 Returns whether the address book is modified.
275 */ 275 */
276 bool modified() const; 276 bool modified() const;
277 277
278 /** 278 /**
279 Called whenever an contact is modified in the contact editor 279 Called whenever an contact is modified in the contact editor
280 dialog or the quick edit. 280 dialog or the quick edit.
281 */ 281 */
282 void contactModified( const KABC::Addressee &addr ); 282 void contactModified( const KABC::Addressee &addr );
283 void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); 283 void addrModified( const KABC::Addressee &addr, bool updateDetails = true );
284 284
285 /** 285 /**
286 DCOP METHODS. 286 DCOP METHODS.
287 */ 287 */
288 void addEmail( QString addr ); 288 void addEmail( QString addr );
289 void importVCard( const KURL& url, bool showPreview ); 289 void importVCard( const KURL& url, bool showPreview );
290 void importVCard( const QString& vCard, bool showPreview ); 290 void importVCard( const QString& vCard, bool showPreview );
291 void newContact(); 291 void newContact();
292 QString getNameByPhone( const QString& phone ); 292 QString getNameByPhone( const QString& phone );
293 /** 293 /**
294 END DCOP METHODS 294 END DCOP METHODS
295 */ 295 */
296 296
297 /** 297 /**
298 Saves the contents of the AddressBook back to disk. 298 Saves the contents of the AddressBook back to disk.
299 */ 299 */
300 void save(); 300 void save();
301 301
302 /** 302 /**
303 Undos the last command using the undo stack. 303 Undos the last command using the undo stack.
304 */ 304 */
305 void undo(); 305 void undo();
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 );
354 void contactSelected( const QPixmap &pixmap ); 355 void contactSelected( const QPixmap &pixmap );
355 public slots: 356 public slots:
356 void recieve(QString cmsg ); 357 void recieve(QString cmsg );
357 void getFile( bool success ); 358 void getFile( bool success );
358 void syncFileRequest(); 359 void syncFileRequest();
359 void setDetailsVisible( bool visible ); 360 void setDetailsVisible( bool visible );
360 void setDetailsToState(); 361 void setDetailsToState();
361 362
362 void saveSettings(); 363 void saveSettings();
363 364
364 private slots: 365 private slots:
365 void updateToolBar(); 366 void updateToolBar();
366 void updateMainWindow(); 367 void updateMainWindow();
367 void receive( const QCString& cmsg, const QByteArray& data ); 368 void receive( const QCString& cmsg, const QByteArray& data );
368 void toggleBeamReceive( ); 369 void toggleBeamReceive( );
369 void disableBR(bool); 370 void disableBR(bool);
370 void setJumpButtonBarVisible( bool visible ); 371 void setJumpButtonBarVisible( bool visible );
371 void setJumpButtonBar( bool visible ); 372 void setJumpButtonBar( bool visible );
372 void setCaptionBack(); 373 void setCaptionBack();
373 void resizeAndCallContactdialog(); 374 void resizeAndCallContactdialog();
374 void callContactdialog(); 375 void callContactdialog();
375 376
376 void importFromOL(); 377 void importFromOL();
377 void extensionModified( const KABC::Addressee::List &list ); 378 void extensionModified( const KABC::Addressee::List &list );
378 void extensionChanged( int id ); 379 void extensionChanged( int id );
379 void clipboardDataChanged(); 380 void clipboardDataChanged();
380 void updateActionMenu(); 381 void updateActionMenu();
381 void configureKeyBindings(); 382 void configureKeyBindings();
382 void removeVoice(); 383 void removeVoice();
383 void setFormattedName(); 384 void setFormattedName();
384#ifdef KAB_EMBEDDED 385#ifdef KAB_EMBEDDED
385 void configureResources(); 386 void configureResources();
386#endif //KAB_EMBEDDED 387#endif //KAB_EMBEDDED
387 388
388 void slotEditorDestroyed( const QString &uid ); 389 void slotEditorDestroyed( const QString &uid );
389 void configurationChanged(); 390 void configurationChanged();
390 void addressBookChanged(); 391 void addressBookChanged();
391 392
392 private: 393 private:
393 QString mEmailSourceChannel; 394 QString mEmailSourceChannel;
394 QString mEmailSourceUID; 395 QString mEmailSourceUID;
395 void resizeEvent(QResizeEvent* e ); 396 void resizeEvent(QResizeEvent* e );
396 bool mBRdisabled; 397 bool mBRdisabled;
397#ifndef DESKTOP_VERSION 398#ifndef DESKTOP_VERSION
398 QCopChannel* infrared; 399 QCopChannel* infrared;
399#endif 400#endif
400 QTimer *mMessageTimer; 401 QTimer *mMessageTimer;
401 void initGUI(); 402 void initGUI();
402 void initActions(); 403 void initActions();
403 QString getPhoneFile(); 404 QString getPhoneFile();
404 405
405 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, 406 AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent,
406 const char *name = 0 ); 407 const char *name = 0 );
407 408
408 KXMLGUIClient *mGUIClient; 409 KXMLGUIClient *mGUIClient;
409 410
410 KABC::AddressBook *mAddressBook; 411 KABC::AddressBook *mAddressBook;
411 412
412 ViewManager *mViewManager; 413 ViewManager *mViewManager;
413 // QSplitter *mDetailsSplitter; 414 // QSplitter *mDetailsSplitter;
414 KDGanttMinimizeSplitter *mExtensionBarSplitter; 415 KDGanttMinimizeSplitter *mExtensionBarSplitter;
415 ViewContainer *mDetails; 416 ViewContainer *mDetails;
416 KDGanttMinimizeSplitter* mMiniSplitter; 417 KDGanttMinimizeSplitter* mMiniSplitter;
417 XXPortManager *mXXPortManager; 418 XXPortManager *mXXPortManager;
418 JumpButtonBar *mJumpButtonBar; 419 JumpButtonBar *mJumpButtonBar;
419 IncSearchWidget *mIncSearchWidget; 420 IncSearchWidget *mIncSearchWidget;
420 ExtensionManager *mExtensionManager; 421 ExtensionManager *mExtensionManager;
421 422
422 KCMultiDialog *mConfigureDialog; 423 KCMultiDialog *mConfigureDialog;
423 424
424#ifndef KAB_EMBEDDED 425#ifndef KAB_EMBEDDED
425 LDAPSearchDialog *mLdapSearchDialog; 426 LDAPSearchDialog *mLdapSearchDialog;
426#endif //KAB_EMBEDDED 427#endif //KAB_EMBEDDED
427 // QDict<AddresseeEditorDialog> mEditorDict; 428 // QDict<AddresseeEditorDialog> mEditorDict;
428 AddresseeEditorDialog *mEditorDialog; 429 AddresseeEditorDialog *mEditorDialog;
429 bool mReadWrite; 430 bool mReadWrite;
430 bool mModified; 431 bool mModified;
431 bool mIsPart; 432 bool mIsPart;
432 bool mMultipleViewsAtOnce; 433 bool mMultipleViewsAtOnce;
433 434
434 435
435 //US file menu 436 //US file menu
436 KAction *mActionMail; 437 KAction *mActionMail;
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;
485 QPopupMenu *changeMenu; 487 QPopupMenu *changeMenu;
486 QPopupMenu *beamMenu; 488 QPopupMenu *beamMenu;
487//US QAction *mActionSave; 489//US QAction *mActionSave;
488 QPopupMenu *ImportMenu; 490 QPopupMenu *ImportMenu;
489 QPopupMenu *ExportMenu; 491 QPopupMenu *ExportMenu;
490 //LR additional methods 492 //LR additional methods
491 KAction *mActionRemoveVoice; 493 KAction *mActionRemoveVoice;
492 KAction *mActionSetFormattedName; 494 KAction *mActionSetFormattedName;
493 KAction * mActionImportOL; 495 KAction * mActionImportOL;
494 496
495#ifndef KAB_EMBEDDED 497#ifndef KAB_EMBEDDED
496 KAddressBookService *mAddressBookService; 498 KAddressBookService *mAddressBookService;
497#endif //KAB_EMBEDDED 499#endif //KAB_EMBEDDED
498 500
499 class KABCorePrivate; 501 class KABCorePrivate;
500 KABCorePrivate *d; 502 KABCorePrivate *d;
501 //US bool mBlockSaveFlag; 503 //US bool mBlockSaveFlag;
502 504
503#ifdef KAB_EMBEDDED 505#ifdef KAB_EMBEDDED
504 KAddressBookMain *mMainWindow; // should be the same like mGUIClient 506 KAddressBookMain *mMainWindow; // should be the same like mGUIClient
505#endif //KAB_EMBEDDED 507#endif //KAB_EMBEDDED
506 508
507 //this are the overwritten callbackmethods from the syncinterface 509 //this are the overwritten callbackmethods from the syncinterface
508 virtual bool sync(KSyncManager* manager, QString filename, int mode); 510 virtual bool sync(KSyncManager* manager, QString filename, int mode);
509 virtual bool syncExternal(KSyncManager* manager, QString resource); 511 virtual bool syncExternal(KSyncManager* manager, QString resource);
510 virtual void removeSyncInfo( QString syncProfile); 512 virtual void removeSyncInfo( QString syncProfile);
511 bool syncPhone(); 513 bool syncPhone();
512 void message( QString m , bool startTimer = true); 514 void message( QString m , bool startTimer = true);
513 515
514 // LR ******************************* 516 // LR *******************************
515 // sync stuff! 517 // sync stuff!
516 QString sentSyncFile(); 518 QString sentSyncFile();
517 QPopupMenu *syncMenu; 519 QPopupMenu *syncMenu;
518 KSyncManager* syncManager; 520 KSyncManager* syncManager;
519 int mGlobalSyncMode; 521 int mGlobalSyncMode;
520 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); 522 bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode);
521 KABC::Addressee getLastSyncAddressee(); 523 KABC::Addressee getLastSyncAddressee();
522 QDateTime mLastAddressbookSync; 524 QDateTime mLastAddressbookSync;
523 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); 525 int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full );
524 // ********************* 526 // *********************
525 527
526}; 528};
527 529
528#endif 530#endif
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
@@ -1,47 +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
29class KABConfigWidget; 29class KABConfigWidget;
30class KABPrefs; 30class KABPrefs;
31 31
32class KCMKabConfig : public KCModule 32class 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
@@ -2406,256 +2406,257 @@ void CalendarView::changeEventDisplay(Event *which, int action)
2406 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2406 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2407 changeIncidenceDisplay((Incidence *)which, action); 2407 changeIncidenceDisplay((Incidence *)which, action);
2408 mDateNavigator->updateView(); 2408 mDateNavigator->updateView();
2409 //mDialogManager->updateSearchDialog(); 2409 //mDialogManager->updateSearchDialog();
2410 2410
2411 if (which) { 2411 if (which) {
2412 // If there is an event view visible update the display 2412 // If there is an event view visible update the display
2413 mViewManager->currentView()->changeEventDisplay(which,action); 2413 mViewManager->currentView()->changeEventDisplay(which,action);
2414 // TODO: check, if update needed 2414 // TODO: check, if update needed
2415 // if (which->getTodoStatus()) { 2415 // if (which->getTodoStatus()) {
2416 mTodoList->updateView(); 2416 mTodoList->updateView();
2417 // } 2417 // }
2418 } else { 2418 } else {
2419 mViewManager->currentView()->updateView(); 2419 mViewManager->currentView()->updateView();
2420 } 2420 }
2421} 2421}
2422 2422
2423 2423
2424void CalendarView::updateTodoViews() 2424void CalendarView::updateTodoViews()
2425{ 2425{
2426 mTodoList->updateView(); 2426 mTodoList->updateView();
2427 mViewManager->currentView()->updateView(); 2427 mViewManager->currentView()->updateView();
2428 2428
2429} 2429}
2430 2430
2431 2431
2432void CalendarView::updateView(const QDate &start, const QDate &end) 2432void CalendarView::updateView(const QDate &start, const QDate &end)
2433{ 2433{
2434 mTodoList->updateView(); 2434 mTodoList->updateView();
2435 mViewManager->updateView(start, end); 2435 mViewManager->updateView(start, end);
2436 //mDateNavigator->updateView(); 2436 //mDateNavigator->updateView();
2437} 2437}
2438 2438
2439void CalendarView::clearAllViews() 2439void CalendarView::clearAllViews()
2440{ 2440{
2441 mTodoList->clearList(); 2441 mTodoList->clearList();
2442 mViewManager->clearAllViews(); 2442 mViewManager->clearAllViews();
2443 SearchDialog * sd = mDialogManager->getSearchDialog(); 2443 SearchDialog * sd = mDialogManager->getSearchDialog();
2444 if ( sd ) { 2444 if ( sd ) {
2445 KOListView* kol = sd->listview(); 2445 KOListView* kol = sd->listview();
2446 if ( kol ) 2446 if ( kol )
2447 kol->clearList(); 2447 kol->clearList();
2448 } 2448 }
2449} 2449}
2450void CalendarView::updateView() 2450void CalendarView::updateView()
2451{ 2451{
2452 DateList tmpList = mNavigator->selectedDates(); 2452 DateList tmpList = mNavigator->selectedDates();
2453 2453
2454 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2454 if ( KOPrefs::instance()->mHideNonStartedTodos )
2455 mTodoList->updateView(); 2455 mTodoList->updateView();
2456 // We assume that the navigator only selects consecutive days. 2456 // We assume that the navigator only selects consecutive days.
2457 updateView( tmpList.first(), tmpList.last() ); 2457 updateView( tmpList.first(), tmpList.last() );
2458} 2458}
2459 2459
2460void CalendarView::updateUnmanagedViews() 2460void CalendarView::updateUnmanagedViews()
2461{ 2461{
2462 mDateNavigator->updateDayMatrix(); 2462 mDateNavigator->updateDayMatrix();
2463} 2463}
2464 2464
2465int CalendarView::msgItemDelete(const QString name) 2465int CalendarView::msgItemDelete(const QString name)
2466{ 2466{
2467 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2467 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2468 i18n("This item will be\npermanently deleted."), 2468 i18n("This item will be\npermanently deleted."),
2469 i18n("KO/Pi Confirmation"),i18n("Delete")); 2469 i18n("KO/Pi Confirmation"),i18n("Delete"));
2470} 2470}
2471 2471
2472 2472
2473void CalendarView::edit_cut() 2473void CalendarView::edit_cut()
2474{ 2474{
2475 Event *anEvent=0; 2475 Event *anEvent=0;
2476 2476
2477 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2477 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2478 2478
2479 if (mViewManager->currentView()->isEventView()) { 2479 if (mViewManager->currentView()->isEventView()) {
2480 if ( incidence && incidence->typeID() == eventID ) { 2480 if ( incidence && incidence->typeID() == eventID ) {
2481 anEvent = static_cast<Event *>(incidence); 2481 anEvent = static_cast<Event *>(incidence);
2482 } 2482 }
2483 } 2483 }
2484 2484
2485 if (!anEvent) { 2485 if (!anEvent) {
2486 KNotifyClient::beep(); 2486 KNotifyClient::beep();
2487 return; 2487 return;
2488 } 2488 }
2489 DndFactory factory( mCalendar ); 2489 DndFactory factory( mCalendar );
2490 factory.cutIncidence(anEvent); 2490 factory.cutIncidence(anEvent);
2491 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2491 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2492} 2492}
2493 2493
2494void CalendarView::edit_copy() 2494void CalendarView::edit_copy()
2495{ 2495{
2496 Event *anEvent=0; 2496 Event *anEvent=0;
2497 2497
2498 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2498 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2499 2499
2500 if (mViewManager->currentView()->isEventView()) { 2500 if (mViewManager->currentView()->isEventView()) {
2501 if ( incidence && incidence->typeID() == eventID ) { 2501 if ( incidence && incidence->typeID() == eventID ) {
2502 anEvent = static_cast<Event *>(incidence); 2502 anEvent = static_cast<Event *>(incidence);
2503 } 2503 }
2504 } 2504 }
2505 2505
2506 if (!anEvent) { 2506 if (!anEvent) {
2507 KNotifyClient::beep(); 2507 KNotifyClient::beep();
2508 return; 2508 return;
2509 } 2509 }
2510 DndFactory factory( mCalendar ); 2510 DndFactory factory( mCalendar );
2511 factory.copyIncidence(anEvent); 2511 factory.copyIncidence(anEvent);
2512} 2512}
2513 2513
2514void CalendarView::edit_paste() 2514void CalendarView::edit_paste()
2515{ 2515{
2516 QDate date = mNavigator->selectedDates().first(); 2516 QDate date = mNavigator->selectedDates().first();
2517 2517
2518 DndFactory factory( mCalendar ); 2518 DndFactory factory( mCalendar );
2519 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2519 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2520 2520
2521 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2521 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2522} 2522}
2523void CalendarView::edit_global_options() 2523void CalendarView::edit_global_options()
2524{ 2524{
2525 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2525 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2526 emit save(); 2526 emit save();
2527 emit saveStopTimer(); 2527 emit saveStopTimer();
2528 mDialogManager->showGlobalOptionsDialog(); 2528 mDialogManager->showGlobalOptionsDialog();
2529 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2529 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2530 emit saveStopTimer(); 2530 emit saveStopTimer();
2531 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), 2531 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
2532 i18n("Timezone settings"),i18n("Reload"))) { 2532 i18n("Timezone settings"),i18n("Reload"))) {
2533 qDebug("KO: TZ reload cancelled "); 2533 qDebug("KO: TZ reload cancelled ");
2534 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2534 return; 2535 return;
2535 } 2536 }
2536 qDebug("KO: Timezone change "); 2537 qDebug("KO: Timezone change ");
2537 openCalendar( MainWindow::defaultFileName() ); 2538 openCalendar( MainWindow::defaultFileName() );
2538 setModified(true); 2539 setModified(true);
2539 } 2540 }
2540 else 2541 else
2541 qDebug("KO: No tz change "); 2542 qDebug("KO: No tz change ");
2542} 2543}
2543void CalendarView::edit_options() 2544void CalendarView::edit_options()
2544{ 2545{
2545 mDialogManager->showOptionsDialog(); 2546 mDialogManager->showOptionsDialog();
2546} 2547}
2547 2548
2548 2549
2549void CalendarView::slotSelectPickerDate( QDate d) 2550void CalendarView::slotSelectPickerDate( QDate d)
2550{ 2551{
2551 mDateFrame->hide(); 2552 mDateFrame->hide();
2552 if ( mDatePickerMode == 1 ) { 2553 if ( mDatePickerMode == 1 ) {
2553 mNavigator->slotDaySelect( d ); 2554 mNavigator->slotDaySelect( d );
2554 } else if ( mDatePickerMode == 2 ) { 2555 } else if ( mDatePickerMode == 2 ) {
2555 if ( mMoveIncidence->typeID() == todoID ) { 2556 if ( mMoveIncidence->typeID() == todoID ) {
2556 Todo * to = (Todo *) mMoveIncidence; 2557 Todo * to = (Todo *) mMoveIncidence;
2557 QTime tim; 2558 QTime tim;
2558 int len = 0; 2559 int len = 0;
2559 if ( to->hasStartDate() && to->hasDueDate() ) 2560 if ( to->hasStartDate() && to->hasDueDate() )
2560 len = to->dtStart().secsTo( to->dtDue()); 2561 len = to->dtStart().secsTo( to->dtDue());
2561 if ( to->hasDueDate() ) 2562 if ( to->hasDueDate() )
2562 tim = to->dtDue().time(); 2563 tim = to->dtDue().time();
2563 else { 2564 else {
2564 tim = QTime ( 0,0,0 ); 2565 tim = QTime ( 0,0,0 );
2565 to->setFloats( true ); 2566 to->setFloats( true );
2566 to->setHasDueDate( true ); 2567 to->setHasDueDate( true );
2567 } 2568 }
2568 QDateTime dt ( d,tim ); 2569 QDateTime dt ( d,tim );
2569 to->setDtDue( dt ); 2570 to->setDtDue( dt );
2570 2571
2571 if ( to->hasStartDate() ) { 2572 if ( to->hasStartDate() ) {
2572 if ( len>0 ) 2573 if ( len>0 )
2573 to->setDtStart(to->dtDue().addSecs( -len )); 2574 to->setDtStart(to->dtDue().addSecs( -len ));
2574 else 2575 else
2575 if (to->dtStart() > to->dtDue() ) 2576 if (to->dtStart() > to->dtDue() )
2576 to->setDtStart(to->dtDue().addDays( -3 )); 2577 to->setDtStart(to->dtDue().addDays( -3 ));
2577 } 2578 }
2578 2579
2579 todoChanged( to ); 2580 todoChanged( to );
2580 } else { 2581 } else {
2581 if ( mMoveIncidence->doesRecur() ) { 2582 if ( mMoveIncidence->doesRecur() ) {
2582#if 0 2583#if 0
2583 // PENDING implement this 2584 // PENDING implement this
2584 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2585 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2585 mCalendar()->addIncidence( newInc ); 2586 mCalendar()->addIncidence( newInc );
2586 if ( mMoveIncidence->typeID() == todoID ) 2587 if ( mMoveIncidence->typeID() == todoID )
2587 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2588 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2588 else 2589 else
2589 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2590 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2590 mMoveIncidence = newInc; 2591 mMoveIncidence = newInc;
2591 2592
2592#endif 2593#endif
2593 } 2594 }
2594 QTime tim = mMoveIncidence->dtStart().time(); 2595 QTime tim = mMoveIncidence->dtStart().time();
2595 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2596 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2596 QDateTime dt ( d,tim ); 2597 QDateTime dt ( d,tim );
2597 mMoveIncidence->setDtStart( dt ); 2598 mMoveIncidence->setDtStart( dt );
2598 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2599 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2599 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2600 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2600 } 2601 }
2601 2602
2602 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2603 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2603 } 2604 }
2604} 2605}
2605 2606
2606void CalendarView::removeCategories() 2607void CalendarView::removeCategories()
2607{ 2608{
2608 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2609 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2609 QStringList catList = KOPrefs::instance()->mCustomCategories; 2610 QStringList catList = KOPrefs::instance()->mCustomCategories;
2610 QStringList catIncList; 2611 QStringList catIncList;
2611 QStringList newCatList; 2612 QStringList newCatList;
2612 Incidence* inc = incList.first(); 2613 Incidence* inc = incList.first();
2613 int i; 2614 int i;
2614 int count = 0; 2615 int count = 0;
2615 while ( inc ) { 2616 while ( inc ) {
2616 newCatList.clear(); 2617 newCatList.clear();
2617 catIncList = inc->categories() ; 2618 catIncList = inc->categories() ;
2618 for( i = 0; i< catIncList.count(); ++i ) { 2619 for( i = 0; i< catIncList.count(); ++i ) {
2619 if ( catList.contains (catIncList[i])) 2620 if ( catList.contains (catIncList[i]))
2620 newCatList.append( catIncList[i] ); 2621 newCatList.append( catIncList[i] );
2621 } 2622 }
2622 newCatList.sort(); 2623 newCatList.sort();
2623 inc->setCategories( newCatList.join(",") ); 2624 inc->setCategories( newCatList.join(",") );
2624 inc = incList.next(); 2625 inc = incList.next();
2625 } 2626 }
2626} 2627}
2627 2628
2628int CalendarView::addCategories() 2629int CalendarView::addCategories()
2629{ 2630{
2630 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2631 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2631 QStringList catList = KOPrefs::instance()->mCustomCategories; 2632 QStringList catList = KOPrefs::instance()->mCustomCategories;
2632 QStringList catIncList; 2633 QStringList catIncList;
2633 Incidence* inc = incList.first(); 2634 Incidence* inc = incList.first();
2634 int i; 2635 int i;
2635 int count = 0; 2636 int count = 0;
2636 while ( inc ) { 2637 while ( inc ) {
2637 catIncList = inc->categories() ; 2638 catIncList = inc->categories() ;
2638 for( i = 0; i< catIncList.count(); ++i ) { 2639 for( i = 0; i< catIncList.count(); ++i ) {
2639 if ( !catList.contains (catIncList[i])) { 2640 if ( !catList.contains (catIncList[i])) {
2640 catList.append( catIncList[i] ); 2641 catList.append( catIncList[i] );
2641 //qDebug("add cat %s ", catIncList[i].latin1()); 2642 //qDebug("add cat %s ", catIncList[i].latin1());
2642 ++count; 2643 ++count;
2643 } 2644 }
2644 } 2645 }
2645 inc = incList.next(); 2646 inc = incList.next();
2646 } 2647 }
2647 catList.sort(); 2648 catList.sort();
2648 KOPrefs::instance()->mCustomCategories = catList; 2649 KOPrefs::instance()->mCustomCategories = catList;
2649 return count; 2650 return count;
2650} 2651}
2651 2652
2652void CalendarView::manageCategories() 2653void CalendarView::manageCategories()
2653{ 2654{
2654 KOCatPrefs* cp = new KOCatPrefs(); 2655 KOCatPrefs* cp = new KOCatPrefs();
2655 cp->show(); 2656 cp->show();
2656 int w =cp->sizeHint().width() ; 2657 int w =cp->sizeHint().width() ;
2657 int h = cp->sizeHint().height() ; 2658 int h = cp->sizeHint().height() ;
2658 int dw = QApplication::desktop()->width(); 2659 int dw = QApplication::desktop()->width();
2659 int dh = QApplication::desktop()->height(); 2660 int dh = QApplication::desktop()->height();
2660 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2661 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2661 if ( !cp->exec() ) { 2662 if ( !cp->exec() ) {
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index aa30c52..3dfa344 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -1,253 +1,240 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2001 4 Copyright (c) 2001
5 Cornelius Schumacher <schumacher@kde.org> 5 Cornelius Schumacher <schumacher@kde.org>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <libkdepim/categoryeditdialog.h> 22#include <libkdepim/categoryeditdialog.h>
23 23
24#include "calendarview.h" 24#include "calendarview.h"
25#include "incomingdialog.h" 25#include "incomingdialog.h"
26#include "outgoingdialog.h" 26#include "outgoingdialog.h"
27#include "koprefsdialog.h" 27#include "koprefsdialog.h"
28#include "koeventeditor.h" 28#include "koeventeditor.h"
29#include "koprefs.h" 29#include "koprefs.h"
30#include "datenavigator.h" 30#include "datenavigator.h"
31#include "kotodoeditor.h" 31#include "kotodoeditor.h"
32#include "searchdialog.h" 32#include "searchdialog.h"
33#include "filtereditdialog.h" 33#include "filtereditdialog.h"
34#ifndef KORG_NOPLUGINS 34#ifndef KORG_NOPLUGINS
35#include "plugindialog.h" 35#include "plugindialog.h"
36#endif 36#endif
37#ifndef KORG_NOARCHIVE 37#ifndef KORG_NOARCHIVE
38#include "archivedialog.h" 38#include "archivedialog.h"
39#endif 39#endif
40 40
41#include "kconfig.h" 41#include "kconfig.h"
42#include "kodialogmanager.h" 42#include "kodialogmanager.h"
43#include <kapplication.h> 43#include <kapplication.h>
44 44
45KODialogManager::KODialogManager( CalendarView *mainView ) : 45KODialogManager::KODialogManager( CalendarView *mainView ) :
46 QObject(), mMainView( mainView ) 46 QObject(), mMainView( mainView )
47{ 47{
48 mOutgoingDialog = 0; 48 mOutgoingDialog = 0;
49 mIncomingDialog = 0; 49 mIncomingDialog = 0;
50 mOptionsDialog = 0; 50 mOptionsDialog = 0;
51 mSearchDialog = 0; 51 mSearchDialog = 0;
52 mArchiveDialog = 0; 52 mArchiveDialog = 0;
53 mFilterEditDialog = 0; 53 mFilterEditDialog = 0;
54 mPluginDialog = 0; 54 mPluginDialog = 0;
55 55
56 // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView); 56 // mCategoryEditDialog = new KPIM::CategoryEditDialog(KOPrefs::instance(),mMainView);
57 //KOGlobals::fitDialogToScreen( mCategoryEditDialog ); 57 //KOGlobals::fitDialogToScreen( mCategoryEditDialog );
58} 58}
59 59
60KODialogManager::~KODialogManager() 60KODialogManager::~KODialogManager()
61{ 61{
62 delete mOutgoingDialog; 62 delete mOutgoingDialog;
63 delete mIncomingDialog; 63 delete mIncomingDialog;
64 delete mOptionsDialog; 64 delete mOptionsDialog;
65 delete mSearchDialog; 65 delete mSearchDialog;
66#ifndef KORG_NOARCHIVE 66#ifndef KORG_NOARCHIVE
67 delete mArchiveDialog; 67 delete mArchiveDialog;
68#endif 68#endif
69 delete mFilterEditDialog; 69 delete mFilterEditDialog;
70#ifndef KORG_NOPLUGINS 70#ifndef KORG_NOPLUGINS
71 delete mPluginDialog; 71 delete mPluginDialog;
72#endif 72#endif
73} 73}
74 74
75OutgoingDialog *KODialogManager::outgoingDialog() 75OutgoingDialog *KODialogManager::outgoingDialog()
76{ 76{
77 createOutgoingDialog(); 77 createOutgoingDialog();
78 return mOutgoingDialog; 78 return mOutgoingDialog;
79} 79}
80 80
81void KODialogManager::createOutgoingDialog() 81void KODialogManager::createOutgoingDialog()
82{ 82{
83 if (!mOutgoingDialog) { 83 if (!mOutgoingDialog) {
84 mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView); 84 mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView);
85 if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog); 85 if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog);
86 connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)), 86 connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)),
87 mMainView,SIGNAL(numOutgoingChanged(int))); 87 mMainView,SIGNAL(numOutgoingChanged(int)));
88 } 88 }
89} 89}
90 90
91void KODialogManager::showGlobalOptionsDialog( bool showSync ) 91void KODialogManager::showGlobalOptionsDialog( bool showSync )
92{ 92{
93 if (!mOptionsDialog) { 93 KPimPrefsGlobalDialog gc ( mMainView );
94 mOptionsDialog = new KOPrefsDialog(0); 94 if ( showSync )
95 connect(mOptionsDialog,SIGNAL(configChanged()), 95 gc.showTZconfig();
96 mMainView,SLOT(updateConfig())); 96 gc.exec();
97 }
98 mOptionsDialog->readConfig();
99#ifndef DESKTOP_VERSION
100 mOptionsDialog->showMaximized();
101#else
102 mOptionsDialog->show();
103#endif
104 if ( showSync )
105 mOptionsDialog->showSyncPage();
106 mOptionsDialog->exec();
107 delete mOptionsDialog;
108 mOptionsDialog = 0;
109} 97}
110void KODialogManager::showOptionsDialog( bool showSync ) 98void KODialogManager::showOptionsDialog( bool showSync )
111{ 99{
112 100
113 if (!mOptionsDialog) { 101 if (!mOptionsDialog) {
114 mOptionsDialog = new KOPrefsDialog(mMainView); 102 mOptionsDialog = new KOPrefsDialog(mMainView);
115 connect(mOptionsDialog,SIGNAL(configChanged()), 103 connect(mOptionsDialog,SIGNAL(configChanged()),
116 mMainView,SLOT(updateConfig())); 104 mMainView,SLOT(updateConfig()));
117 } 105 }
118 mOptionsDialog->readConfig(); 106 mOptionsDialog->readConfig();
119#ifndef DESKTOP_VERSION 107#ifndef DESKTOP_VERSION
120 mOptionsDialog->showMaximized(); 108 mOptionsDialog->showMaximized();
121#else 109#else
122 mOptionsDialog->show(); 110 mOptionsDialog->show();
123#endif 111#endif
124 if ( showSync ) 112
125 mOptionsDialog->showSyncPage();
126 mOptionsDialog->exec(); 113 mOptionsDialog->exec();
127 delete mOptionsDialog; 114 delete mOptionsDialog;
128 mOptionsDialog = 0; 115 mOptionsDialog = 0;
129} 116}
130void KODialogManager::showSyncOptions() 117void KODialogManager::showSyncOptions()
131{ 118{
132 showGlobalOptionsDialog( true ); 119 showGlobalOptionsDialog( true );
133 120
134} 121}
135void KODialogManager::showOutgoingDialog() 122void KODialogManager::showOutgoingDialog()
136{ 123{
137 createOutgoingDialog(); 124 createOutgoingDialog();
138 mOutgoingDialog->show(); 125 mOutgoingDialog->show();
139 mOutgoingDialog->raise(); 126 mOutgoingDialog->raise();
140} 127}
141 128
142IncomingDialog *KODialogManager::incomingDialog() 129IncomingDialog *KODialogManager::incomingDialog()
143{ 130{
144 createOutgoingDialog(); 131 createOutgoingDialog();
145 if (!mIncomingDialog) { 132 if (!mIncomingDialog) {
146 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 133 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
147 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 134 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
148 mMainView,SIGNAL(numIncomingChanged(int))); 135 mMainView,SIGNAL(numIncomingChanged(int)));
149 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 136 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
150 mMainView,SLOT(updateView())); 137 mMainView,SLOT(updateView()));
151 } 138 }
152 return mIncomingDialog; 139 return mIncomingDialog;
153} 140}
154 141
155void KODialogManager::createIncomingDialog() 142void KODialogManager::createIncomingDialog()
156{ 143{
157 createOutgoingDialog(); 144 createOutgoingDialog();
158 if (!mIncomingDialog) { 145 if (!mIncomingDialog) {
159 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 146 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
160 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 147 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
161 mMainView,SIGNAL(numIncomingChanged(int))); 148 mMainView,SIGNAL(numIncomingChanged(int)));
162 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 149 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
163 mMainView,SLOT(updateView())); 150 mMainView,SLOT(updateView()));
164 } 151 }
165} 152}
166 153
167void KODialogManager::showIncomingDialog() 154void KODialogManager::showIncomingDialog()
168{ 155{
169 createIncomingDialog(); 156 createIncomingDialog();
170 mIncomingDialog->show(); 157 mIncomingDialog->show();
171 mIncomingDialog->raise(); 158 mIncomingDialog->raise();
172} 159}
173/* 160/*
174void KODialogManager::showCategoryEditDialog() 161void KODialogManager::showCategoryEditDialog()
175{ 162{
176 mCategoryEditDialog->show(); 163 mCategoryEditDialog->show();
177} 164}
178*/ 165*/
179void KODialogManager::hideSearchDialog() 166void KODialogManager::hideSearchDialog()
180{ 167{
181 if (mSearchDialog) 168 if (mSearchDialog)
182 mSearchDialog->hide(); 169 mSearchDialog->hide();
183} 170}
184 171
185void KODialogManager::showSearchDialog() 172void KODialogManager::showSearchDialog()
186{ 173{
187 if (!mSearchDialog) { 174 if (!mSearchDialog) {
188 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); 175 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView);
189 KOListView * lview = mSearchDialog->listview(); 176 KOListView * lview = mSearchDialog->listview();
190 177
191 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), 178 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)),
192 mMainView, SLOT(showIncidence(Incidence *))); 179 mMainView, SLOT(showIncidence(Incidence *)));
193 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), 180 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)),
194 mMainView, SLOT(editIncidence(Incidence *))); 181 mMainView, SLOT(editIncidence(Incidence *)));
195 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), 182 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)),
196 mMainView, SLOT(deleteIncidence(Incidence *))); 183 mMainView, SLOT(deleteIncidence(Incidence *)));
197 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), 184 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)),
198 mMainView, SLOT(cloneIncidence(Incidence *))); 185 mMainView, SLOT(cloneIncidence(Incidence *)));
199 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), 186 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)),
200 mMainView, SLOT(beamIncidence(Incidence *))); 187 mMainView, SLOT(beamIncidence(Incidence *)));
201 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), 188 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)),
202 mMainView, SLOT(moveIncidence(Incidence *))); 189 mMainView, SLOT(moveIncidence(Incidence *)));
203 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), 190 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )),
204 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); 191 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> )));
205 192
206 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); 193 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig()));
207 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); 194 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList()));
208 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), 195 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ),
209 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 196 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
210#ifndef DESKTOP_VERSION 197#ifndef DESKTOP_VERSION
211 mSearchDialog->setMaximumSize( QApplication::desktop()->size()); 198 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
212 mSearchDialog->showMaximized(); 199 mSearchDialog->showMaximized();
213#else 200#else
214 KConfig *config = KOGlobals::config(); 201 KConfig *config = KOGlobals::config();
215 config->setGroup("WidgetLayout"); 202 config->setGroup("WidgetLayout");
216 QStringList list; 203 QStringList list;
217 list = config->readListEntry("SearchLayout"); 204 list = config->readListEntry("SearchLayout");
218 int x,y,w,h; 205 int x,y,w,h;
219 if ( ! list.isEmpty() ) { 206 if ( ! list.isEmpty() ) {
220 x = list[0].toInt(); 207 x = list[0].toInt();
221 y = list[1].toInt(); 208 y = list[1].toInt();
222 w = list[2].toInt(); 209 w = list[2].toInt();
223 h = list[3].toInt(); 210 h = list[3].toInt();
224 KApplication::testCoords( &x,&y,&w,&h ); 211 KApplication::testCoords( &x,&y,&w,&h );
225 mSearchDialog->setGeometry(x,y,w,h); 212 mSearchDialog->setGeometry(x,y,w,h);
226 213
227 } 214 }
228 215
229#endif 216#endif
230 } 217 }
231 // make sure the widget is on top again 218 // make sure the widget is on top again
232#ifdef DESKTOP_VERSION 219#ifdef DESKTOP_VERSION
233 mSearchDialog->show(); 220 mSearchDialog->show();
234#else 221#else
235 mSearchDialog->setMaximumSize( QApplication::desktop()->size()); 222 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
236 mSearchDialog->showMaximized(); 223 mSearchDialog->showMaximized();
237#endif 224#endif
238 mSearchDialog->raiseAndSelect(); 225 mSearchDialog->raiseAndSelect();
239} 226}
240 227
241SearchDialog * KODialogManager::getSearchDialog() 228SearchDialog * KODialogManager::getSearchDialog()
242{ 229{
243 return mSearchDialog; 230 return mSearchDialog;
244} 231}
245void KODialogManager::showArchiveDialog() 232void KODialogManager::showArchiveDialog()
246{ 233{
247#ifndef KORG_NOARCHIVE 234#ifndef KORG_NOARCHIVE
248 if (!mArchiveDialog) { 235 if (!mArchiveDialog) {
249 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); 236 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView);
250 connect(mArchiveDialog,SIGNAL(eventsDeleted()), 237 connect(mArchiveDialog,SIGNAL(eventsDeleted()),
251 mMainView,SLOT(updateView())); 238 mMainView,SLOT(updateView()));
252 } 239 }
253 mArchiveDialog->show(); 240 mArchiveDialog->show();
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 4b5b66a..b782bb1 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,467 +1,363 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kglobalsettings.h> 56#include <kglobalsettings.h>
57 57
58#include <kurlrequester.h> 58#include <kurlrequester.h>
59#include <klineedit.h> 59#include <klineedit.h>
60 60
61#if defined(USE_SOLARIS) 61#if defined(USE_SOLARIS)
62#include <sys/param.h> 62#include <sys/param.h>
63 63
64#define ZONEINFODIR "/usr/share/lib/zoneinfo" 64#define ZONEINFODIR "/usr/share/lib/zoneinfo"
65#define INITFILE "/etc/default/init" 65#define INITFILE "/etc/default/init"
66#endif 66#endif
67 67
68#include "koprefs.h" 68#include "koprefs.h"
69 69
70#include "koprefsdialog.h" 70#include "koprefsdialog.h"
71#include "kpimglobalprefs.h" 71#include "kpimglobalprefs.h"
72 72
73 73
74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 74KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
75 KPrefsDialog(KOPrefs::instance(),parent,name,true) 75 KPrefsDialog(KOPrefs::instance(),parent,name,true)
76{ 76{
77 77
78 setFont( KGlobalSettings::generalMaxFont() ); 78 setFont( KGlobalSettings::generalMaxFont() );
79 setCaption( i18n("Preferences - some settings need a restart (nr)")); 79 setCaption( i18n("Preferences - some settings need a restart (nr)"));
80 mCategoryDict.setAutoDelete(true); 80 mCategoryDict.setAutoDelete(true);
81 81
82 KGlobal::locale()->insertCatalogue("timezones"); 82 KGlobal::locale()->insertCatalogue("timezones");
83 mSpacingHint = spacingHintSmall(); 83 mSpacingHint = spacingHintSmall();
84 mMarginHint = marginHintSmall(); 84 mMarginHint = marginHintSmall();
85#ifndef DESKTOP_VERSION 85#ifndef DESKTOP_VERSION
86 if ( QApplication::desktop()->height() == 480 ) 86 if ( QApplication::desktop()->height() == 480 )
87 hideButtons(); 87 hideButtons();
88#endif 88#endif
89 kdelibcfg = 0; 89
90 if ( !parent )
91 setupGlobalTab();
92 else {
93 setupMainTab(); 90 setupMainTab();
94 // setupLocaleTab(); 91 // setupLocaleTab();
95 //setupTimeZoneTab(); 92 //setupTimeZoneTab();
96 setupTimeTab(); 93 setupTimeTab();
97 //setupLocaleDateTab(); 94 //setupLocaleDateTab();
98 setupFontsTab(); 95 setupFontsTab();
99 setupColorsTab(); 96 setupColorsTab();
100 setupViewsTab(); 97 setupViewsTab();
101 //setupSyncTab(); 98 //setupSyncTab();
102 //setupSyncAlgTab(); 99 //setupSyncAlgTab();
103 //setupPrinterTab(); 100 //setupPrinterTab();
104 //setupGroupSchedulingTab(); 101 //setupGroupSchedulingTab();
105 //setupGroupAutomationTab(); 102 //setupGroupAutomationTab();
106 } 103
107 104
108} 105}
109 106
110 107
111KOPrefsDialog::~KOPrefsDialog() 108KOPrefsDialog::~KOPrefsDialog()
112{ 109{
113} 110}
114void KOPrefsDialog::setupGlobalTab() 111void KOPrefsDialog::setupGlobalTab()
115{ 112{
116 //QFrame *topFrame = addPage(i18n("Global"),0,0); 113
117 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" );
118 setMainWidget( kdelibcfg );
119 setCaption( i18n("KDE-Pim Global Settings"));
120
121 114
122} 115}
123void KOPrefsDialog::setupLocaleDateTab() 116void KOPrefsDialog::setupLocaleDateTab()
124{ 117{
125#if 0 118#if 0
126QFrame *topFrame = addPage(i18n("Date Format"),0,0); 119QFrame *topFrame = addPage(i18n("Date Format"),0,0);
127 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 120 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
128 topLayout->setSpacing(mSpacingHint); 121 topLayout->setSpacing(mSpacingHint);
129 topLayout->setMargin(mMarginHint); 122 topLayout->setMargin(mMarginHint);
130 int iii = 0; 123 int iii = 0;
131 124
132 125
133 KPrefsDialogWidRadios *syncPrefsGroup = 126 KPrefsDialogWidRadios *syncPrefsGroup =
134 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 127 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
135 QString format; 128 QString format;
136 if ( QApplication::desktop()->width() < 480 ) 129 if ( QApplication::desktop()->width() < 480 )
137 format = "(%d.%m.%Y)"; 130 format = "(%d.%m.%Y)";
138 else 131 else
139 format = "(%d.%m.%Y|%A %d %B %Y)"; 132 format = "(%d.%m.%Y|%A %d %B %Y)";
140 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 133 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
141 if ( QApplication::desktop()->width() < 480 ) 134 if ( QApplication::desktop()->width() < 480 )
142 format = "(%m.%d.%Y)"; 135 format = "(%m.%d.%Y)";
143 else 136 else
144 format = "(%m.%d.%Y|%A %B %d %Y)"; 137 format = "(%m.%d.%Y|%A %B %d %Y)";
145 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 138 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
146 if ( QApplication::desktop()->width() < 480 ) 139 if ( QApplication::desktop()->width() < 480 )
147 format = "(%Y-%m-%d)"; 140 format = "(%Y-%m-%d)";
148 else 141 else
149 format = "(%Y-%m-%d|%A %Y %B %d)"; 142 format = "(%Y-%m-%d|%A %Y %B %d)";
150 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 143 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
151 syncPrefsGroup->addRadio(i18n("User defined")); 144 syncPrefsGroup->addRadio(i18n("User defined"));
152 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 145 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
153 ++iii; 146 ++iii;
154 ++iii; 147 ++iii;
155 QLabel * lab; 148 QLabel * lab;
156 mUserDateFormatLong = new QLineEdit(topFrame); 149 mUserDateFormatLong = new QLineEdit(topFrame);
157 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 150 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
158 topLayout->addWidget(lab ,iii,0); 151 topLayout->addWidget(lab ,iii,0);
159 topLayout->addWidget(mUserDateFormatLong,iii,1); 152 topLayout->addWidget(mUserDateFormatLong,iii,1);
160 ++iii; 153 ++iii;
161 mUserDateFormatShort = new QLineEdit(topFrame); 154 mUserDateFormatShort = new QLineEdit(topFrame);
162 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 155 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
163 topLayout->addWidget(lab ,iii,0); 156 topLayout->addWidget(lab ,iii,0);
164 topLayout->addWidget(mUserDateFormatShort,iii,1); 157 topLayout->addWidget(mUserDateFormatShort,iii,1);
165 ++iii; 158 ++iii;
166 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 159 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
167 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
168 ++iii; 161 ++iii;
169 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 162 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
170 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 163 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
171 ++iii; 164 ++iii;
172 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 165 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
173 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 166 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
174 ++iii; 167 ++iii;
175#endif 168#endif
176 169
177} 170}
178 171
179void KOPrefsDialog::setupLocaleTab() 172void KOPrefsDialog::setupLocaleTab()
180{ 173{
181#if 0 174#if 0
182 QFrame *topFrame = addPage(i18n("Locale"),0,0); 175 QFrame *topFrame = addPage(i18n("Locale"),0,0);
183 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 176 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
184 topLayout->setSpacing(mSpacingHint); 177 topLayout->setSpacing(mSpacingHint);
185 topLayout->setMargin(mMarginHint); 178 topLayout->setMargin(mMarginHint);
186 int iii = 0; 179 int iii = 0;
187 KPrefsDialogWidRadios *syncPrefsGroup = 180 KPrefsDialogWidRadios *syncPrefsGroup =
188 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 181 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
189 syncPrefsGroup->addRadio(i18n("English")); 182 syncPrefsGroup->addRadio(i18n("English"));
190 syncPrefsGroup->addRadio(i18n("German")); 183 syncPrefsGroup->addRadio(i18n("German"));
191 syncPrefsGroup->addRadio(i18n("French")); 184 syncPrefsGroup->addRadio(i18n("French"));
192 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 185 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
193 if ( QApplication::desktop()->width() < 300 ) 186 if ( QApplication::desktop()->width() < 300 )
194 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 187 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
195 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 188 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
196 ++iii; 189 ++iii;
197 190
198 syncPrefsGroup = 191 syncPrefsGroup =
199 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 192 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
200 if ( QApplication::desktop()->width() > 300 ) 193 if ( QApplication::desktop()->width() > 300 )
201 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 194 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
202 syncPrefsGroup->addRadio(i18n("24:00")); 195 syncPrefsGroup->addRadio(i18n("24:00"));
203 syncPrefsGroup->addRadio(i18n("12:00am")); 196 syncPrefsGroup->addRadio(i18n("12:00am"));
204 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 197 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
205 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 198 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
206 ++iii; 199 ++iii;
207 KPrefsDialogWidBool *sb; 200 KPrefsDialogWidBool *sb;
208 if ( QApplication::desktop()->width() < 300 ) { 201 if ( QApplication::desktop()->width() < 300 ) {
209 sb = 202 sb =
210 addWidBool(i18n("Week starts on Sunday"), 203 addWidBool(i18n("Week starts on Sunday"),
211 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 204 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
212 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
213 ++iii; 206 ++iii;
214 sb = 207 sb =
215 addWidBool(i18n("Use short date in (WN/E) view"), 208 addWidBool(i18n("Use short date in (WN/E) view"),
216 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 209 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
217 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 210 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
218 } 211 }
219 else { 212 else {
220 QWidget * hb = new QWidget( topFrame ); 213 QWidget * hb = new QWidget( topFrame );
221 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 214 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
222 sb = 215 sb =
223 addWidBool(i18n("Week starts on Sunday"), 216 addWidBool(i18n("Week starts on Sunday"),
224 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 217 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
225 hbLayout->addWidget(sb->checkBox() ); 218 hbLayout->addWidget(sb->checkBox() );
226 sb = 219 sb =
227 addWidBool(i18n("Use short date in (WN/E) view"), 220 addWidBool(i18n("Use short date in (WN/E) view"),
228 &(KOPrefs::instance()->mShortDateInViewer),hb); 221 &(KOPrefs::instance()->mShortDateInViewer),hb);
229 hbLayout->addWidget(sb->checkBox() ); 222 hbLayout->addWidget(sb->checkBox() );
230 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 223 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
231 224
232 } 225 }
233 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 226 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
234#if 0 227#if 0
235 ++iii; 228 ++iii;
236 sb = 229 sb =
237 addWidBool(i18n("Quick load/save (w/o Unicode)"), 230 addWidBool(i18n("Quick load/save (w/o Unicode)"),
238 &(KOPrefs::instance()->mUseQuicksave),topFrame); 231 &(KOPrefs::instance()->mUseQuicksave),topFrame);
239 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 232 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
240#endif 233#endif
241#endif 234#endif
242} 235}
243void KOPrefsDialog::showSyncPage()
244{
245 // showPage ( 0 ) ;
246 kdelibcfg->showTimeZoneTab() ;
247
248}
249void KOPrefsDialog::setupSyncAlgTab()
250{
251#if 0
252 QLabel * lab;
253 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
254 mSetupSyncAlgTab = topFrame;
255 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
256 topLayout->setSpacing(mSpacingHint);
257 topLayout->setMargin(mMarginHint);
258 int iii = 0;
259
260 KPrefsDialogWidBool *sb =
261 addWidBool(i18n("Ask for preferences before syncing"),
262 &(KOPrefs::instance()->mAskForPreferences),topFrame);
263 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
264
265 ++iii;
266
267 KPrefsDialogWidRadios *syncPrefsGroup =
268 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
269 topFrame);
270 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
271 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
272 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
273 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
274 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
275 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
276 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
277 ++iii;
278 sb =
279 addWidBool(i18n("Show summary after syncing"),
280 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
281 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
282
283 ++iii;
284#endif
285
286
287
288}
289
290
291void KOPrefsDialog::setupSyncTab()
292{
293#if 0
294 QLabel * lab;
295 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
296 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
297 topLayout->setSpacing(mSpacingHint);
298 topLayout->setMargin(mMarginHint);
299 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
300 int iii = 0;
301 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
302 ++iii;
303
304 mRemoteIPEdit = new QLineEdit(topFrame);
305 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
306 topLayout->addWidget(lab ,iii,0);
307 topLayout->addWidget(mRemoteIPEdit,iii,1);
308 ++iii;
309 mRemoteUser = new QLineEdit(topFrame);
310 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
311 topLayout->addWidget(lab ,iii,0);
312 topLayout->addWidget(mRemoteUser, iii,1);
313 ++iii;
314
315 mRemoteFile = new QLineEdit(topFrame);
316 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
317 topLayout->addWidget(lab ,iii,0);
318 topLayout->addWidget(mRemoteFile,iii,1);
319 ++iii;
320
321 mLocalTempFile = new QLineEdit(topFrame);
322 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
323 topLayout->addWidget(lab ,iii,0);
324 topLayout->addWidget(mLocalTempFile,iii,1);
325 ++iii;
326
327 KPrefsDialogWidBool *wb =
328 addWidBool(i18n("Write back synced file"),
329 &(KOPrefs::instance()->mWriteBackFile),topFrame);
330 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
331 ++iii;
332 wb =
333 addWidBool(i18n("Write back existing entries only"),
334 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
335 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
336 ++iii;
337
338#endif
339}
340 236
341void KOPrefsDialog::setupMainTab() 237void KOPrefsDialog::setupMainTab()
342{ 238{
343 QFrame *topFrame = addPage(i18n("General"),0,0); 239 QFrame *topFrame = addPage(i18n("General"),0,0);
344 // DesktopIcon("identity",KIcon::SizeMedium)); 240 // DesktopIcon("identity",KIcon::SizeMedium));
345 241
346 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 242 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
347 topLayout->setSpacing(mSpacingHint); 243 topLayout->setSpacing(mSpacingHint);
348 topLayout->setMargin(mMarginHint); 244 topLayout->setMargin(mMarginHint);
349 245
350 // KPrefsDialogWidBool *emailControlCenter = 246 // KPrefsDialogWidBool *emailControlCenter =
351// addWidBool(i18n("&Use email settings from Control Center"), 247// addWidBool(i18n("&Use email settings from Control Center"),
352// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 248// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
353// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 249// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
354 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 250 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
355 // SLOT(toggleEmailSettings(bool))); 251 // SLOT(toggleEmailSettings(bool)));
356 252
357 mNameEdit = new QLineEdit(topFrame); 253 mNameEdit = new QLineEdit(topFrame);
358 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 254 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
359 topLayout->addWidget(mNameLabel,0,0); 255 topLayout->addWidget(mNameLabel,0,0);
360 topLayout->addWidget(mNameEdit,0,1); 256 topLayout->addWidget(mNameEdit,0,1);
361 257
362 mEmailEdit = new QLineEdit(topFrame); 258 mEmailEdit = new QLineEdit(topFrame);
363 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 259 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
364 topLayout->addWidget(mEmailLabel,1,0); 260 topLayout->addWidget(mEmailLabel,1,0);
365 topLayout->addWidget(mEmailEdit,1,1); 261 topLayout->addWidget(mEmailEdit,1,1);
366 KPrefsDialogWidBool *wb; 262 KPrefsDialogWidBool *wb;
367 263
368 264
369 265
370 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), 266 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
371 &(KOPrefs::instance()->mShowFullMenu),topFrame); 267 &(KOPrefs::instance()->mShowFullMenu),topFrame);
372 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); 268 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1);
373 269
374 270
375 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), 271 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"),
376 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); 272 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame);
377 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); 273 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1);
378 274
379 275
380 KPrefsDialogWidBool *verticalScreen = 276 KPrefsDialogWidBool *verticalScreen =
381 addWidBool(i18n("Show vertical screen (Needs restart)"), 277 addWidBool(i18n("Show vertical screen (Needs restart)"),
382 &(KOPrefs::instance()->mVerticalScreen),topFrame); 278 &(KOPrefs::instance()->mVerticalScreen),topFrame);
383 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 279 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
384 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); 280 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
385 281
386 282
387 int iii = 5; 283 int iii = 5;
388 widbool = addWidBool(i18n("Block popup until mouse button release"), 284 widbool = addWidBool(i18n("Block popup until mouse button release"),
389 &(KOPrefs::instance()->mBlockPopupMenu),topFrame); 285 &(KOPrefs::instance()->mBlockPopupMenu),topFrame);
390 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); 286 topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1);
391 ++iii; 287 ++iii;
392 QHBox *dummy = new QHBox(topFrame); 288 QHBox *dummy = new QHBox(topFrame);
393 new QLabel(i18n("Days in Next-X-Days:"),dummy); 289 new QLabel(i18n("Days in Next-X-Days:"),dummy);
394 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 290 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
395 291
396 topLayout->addMultiCellWidget(dummy,iii,iii,0,1); 292 topLayout->addMultiCellWidget(dummy,iii,iii,0,1);
397 293
398 ++iii; 294 ++iii;
399 295
400 296
401 // KPrefsDialogWidBool *bcc = 297 // KPrefsDialogWidBool *bcc =
402// addWidBool(i18n("Send copy to owner when mailing events"), 298// addWidBool(i18n("Send copy to owner when mailing events"),
403// &(KOPrefs::instance()->mBcc),topFrame); 299// &(KOPrefs::instance()->mBcc),topFrame);
404// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 300// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
405 301
406 302
407 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 303 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
408 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 304 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
409 305
410 // addWidBool(i18n("Enable automatic saving of calendar"), 306 // addWidBool(i18n("Enable automatic saving of calendar"),
411 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 307 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
412 308
413 QHBox *intervalBox = new QHBox(topFrame); 309 QHBox *intervalBox = new QHBox(topFrame);
414 // intervalBox->setSpacing(mSpacingHint); 310 // intervalBox->setSpacing(mSpacingHint);
415 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); 311 topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1);
416 ++iii; 312 ++iii;
417 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 313 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
418 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 314 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
419 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 315 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
420 /* 316 /*
421 QHBox * agendasize = new QHBox ( topFrame ); 317 QHBox * agendasize = new QHBox ( topFrame );
422 318
423 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 319 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
424 320
425 321
426 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 322 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
427 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 323 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
428 */ 324 */
429 325
430 326
431 KPrefsDialogWidBool *ask = 327 KPrefsDialogWidBool *ask =
432 addWidBool(i18n("Ask for quit when closing KO/Pi"), 328 addWidBool(i18n("Ask for quit when closing KO/Pi"),
433 &(KOPrefs::instance()->mAskForQuit),topFrame); 329 &(KOPrefs::instance()->mAskForQuit),topFrame);
434 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); 330 topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1);
435 ++iii; 331 ++iii;
436 332
437 333
438 /* 334 /*
439 KPrefsDialogWidBool *confirmCheck = 335 KPrefsDialogWidBool *confirmCheck =
440 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 336 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
441 topFrame); 337 topFrame);
442 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 338 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
443 339
444 340
445 mEnableGroupScheduling = 341 mEnableGroupScheduling =
446 addWidBool(i18n("Enable group scheduling"), 342 addWidBool(i18n("Enable group scheduling"),
447 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 343 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
448 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 344 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
449 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 345 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
450 SLOT(warningGroupScheduling())); 346 SLOT(warningGroupScheduling()));
451 347
452 mEnableProjectView = 348 mEnableProjectView =
453 addWidBool(i18n("Enable project view"), 349 addWidBool(i18n("Enable project view"),
454 &(KOPrefs::instance()->mEnableProjectView),topFrame); 350 &(KOPrefs::instance()->mEnableProjectView),topFrame);
455 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 351 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
456 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 352 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
457 SLOT(warningProjectView())); 353 SLOT(warningProjectView()));
458 354
459 // Can't be disabled anymore 355 // Can't be disabled anymore
460 mEnableGroupScheduling->checkBox()->hide(); 356 mEnableGroupScheduling->checkBox()->hide();
461 357
462 // Disable setting, because this feature now becomes stable 358 // Disable setting, because this feature now becomes stable
463 mEnableProjectView->checkBox()->hide(); 359 mEnableProjectView->checkBox()->hide();
464 360
465 KPrefsDialogWidRadios *defaultFormatGroup = 361 KPrefsDialogWidRadios *defaultFormatGroup =
466 addWidRadios(i18n("Default Calendar Format"), 362 addWidRadios(i18n("Default Calendar Format"),
467 &(KOPrefs::instance()->mDefaultFormat),topFrame); 363 &(KOPrefs::instance()->mDefaultFormat),topFrame);
@@ -1335,421 +1231,267 @@ void KOPrefsDialog::setupPrinterTab()
1335} 1231}
1336 1232
1337void KOPrefsDialog::setupGroupSchedulingTab() 1233void KOPrefsDialog::setupGroupSchedulingTab()
1338{ 1234{
1339#if 0 1235#if 0
1340 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1236 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1341 DesktopIcon("personal",KIcon::SizeMedium)); 1237 DesktopIcon("personal",KIcon::SizeMedium));
1342 1238
1343 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1239 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1344 topLayout->setSpacing(mSpacingHint); 1240 topLayout->setSpacing(mSpacingHint);
1345 topLayout->setMargin(mMarginHint); 1241 topLayout->setMargin(mMarginHint);
1346 1242
1347#if 0 1243#if 0
1348 KPrefsDialogWidRadios *schedulerGroup = 1244 KPrefsDialogWidRadios *schedulerGroup =
1349 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1245 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1350 topFrame); 1246 topFrame);
1351 schedulerGroup->addRadio("Dummy"); // Only for debugging 1247 schedulerGroup->addRadio("Dummy"); // Only for debugging
1352 schedulerGroup->addRadio(i18n("Mail client")); 1248 schedulerGroup->addRadio(i18n("Mail client"));
1353 1249
1354 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1250 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1355#endif 1251#endif
1356 1252
1357 KPrefsDialogWidRadios *sendGroup = 1253 KPrefsDialogWidRadios *sendGroup =
1358 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1254 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1359 topFrame); 1255 topFrame);
1360 sendGroup->addRadio(i18n("Send to outbox")); 1256 sendGroup->addRadio(i18n("Send to outbox"));
1361 sendGroup->addRadio(i18n("Send directly")); 1257 sendGroup->addRadio(i18n("Send directly"));
1362 1258
1363 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1259 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1364 1260
1365 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1261 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1366 mAMails = new QListView(topFrame); 1262 mAMails = new QListView(topFrame);
1367 mAMails->addColumn(i18n("Email"),300); 1263 mAMails->addColumn(i18n("Email"),300);
1368 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1264 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1369 1265
1370 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1266 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1371 aEmailsEdit = new QLineEdit(topFrame); 1267 aEmailsEdit = new QLineEdit(topFrame);
1372 aEmailsEdit->setEnabled(false); 1268 aEmailsEdit->setEnabled(false);
1373 topLayout->addWidget(aEmailsEdit,4,1); 1269 topLayout->addWidget(aEmailsEdit,4,1);
1374 1270
1375 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1271 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1376 topLayout->addWidget(add,5,0); 1272 topLayout->addWidget(add,5,0);
1377 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1273 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1378 topLayout->addWidget(del,5,1); 1274 topLayout->addWidget(del,5,1);
1379 1275
1380 //topLayout->setRowStretch(2,1); 1276 //topLayout->setRowStretch(2,1);
1381 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1277 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1382 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1278 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1383 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1279 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1384 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1280 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1385#endif 1281#endif
1386} 1282}
1387 1283
1388void KOPrefsDialog::setupGroupAutomationTab() 1284void KOPrefsDialog::setupGroupAutomationTab()
1389{ 1285{
1390 return; 1286 return;
1391 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1287 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1392 DesktopIcon("personal",KIcon::SizeMedium)); 1288 DesktopIcon("personal",KIcon::SizeMedium));
1393 1289
1394 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1290 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1395 topLayout->setSpacing(mSpacingHint); 1291 topLayout->setSpacing(mSpacingHint);
1396 topLayout->setMargin(mMarginHint); 1292 topLayout->setMargin(mMarginHint);
1397 1293
1398 KPrefsDialogWidRadios *autoRefreshGroup = 1294 KPrefsDialogWidRadios *autoRefreshGroup =
1399 addWidRadios(i18n("Auto Send Refresh"), 1295 addWidRadios(i18n("Auto Send Refresh"),
1400 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1296 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1401 autoRefreshGroup->addRadio(i18n("Never")); 1297 autoRefreshGroup->addRadio(i18n("Never"));
1402 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1298 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1403 //autoRefreshGroup->addRadio(i18n("selected emails")); 1299 //autoRefreshGroup->addRadio(i18n("selected emails"));
1404 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1300 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1405 1301
1406 KPrefsDialogWidRadios *autoInsertGroup = 1302 KPrefsDialogWidRadios *autoInsertGroup =
1407 addWidRadios(i18n("Auto Insert IMIP Replies"), 1303 addWidRadios(i18n("Auto Insert IMIP Replies"),
1408 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1304 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1409 autoInsertGroup->addRadio(i18n("Never")); 1305 autoInsertGroup->addRadio(i18n("Never"));
1410 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1306 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1411 //autoInsertGroup->addRadio(i18n("selected emails")); 1307 //autoInsertGroup->addRadio(i18n("selected emails"));
1412 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1308 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1413 1309
1414 KPrefsDialogWidRadios *autoRequestGroup = 1310 KPrefsDialogWidRadios *autoRequestGroup =
1415 addWidRadios(i18n("Auto Insert IMIP Requests"), 1311 addWidRadios(i18n("Auto Insert IMIP Requests"),
1416 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1312 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1417 autoRequestGroup->addRadio(i18n("Never")); 1313 autoRequestGroup->addRadio(i18n("Never"));
1418 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1314 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1419 //autoInsertGroup->addRadio(i18n("selected emails")); 1315 //autoInsertGroup->addRadio(i18n("selected emails"));
1420 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1316 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1421 1317
1422 KPrefsDialogWidRadios *autoFreeBusyGroup = 1318 KPrefsDialogWidRadios *autoFreeBusyGroup =
1423 addWidRadios(i18n("Auto Send FreeBusy Information"), 1319 addWidRadios(i18n("Auto Send FreeBusy Information"),
1424 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1320 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1425 autoFreeBusyGroup->addRadio(i18n("Never")); 1321 autoFreeBusyGroup->addRadio(i18n("Never"));
1426 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1322 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1427 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1323 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1428 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1324 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1429 1325
1430 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1326 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1431 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1327 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1432 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1328 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1433 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1329 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1434 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1330 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1435 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1331 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1436 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1332 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1437} 1333}
1438 1334
1439void KOPrefsDialog::showPrinterTab() 1335void KOPrefsDialog::showPrinterTab()
1440{ 1336{
1441 showPage(pageIndex(mPrinterTab)); 1337 showPage(pageIndex(mPrinterTab));
1442} 1338}
1443 1339
1444 1340
1445void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1341void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1446 const QStringList *tags) 1342 const QStringList *tags)
1447{ 1343{
1448 if (tags) { 1344 if (tags) {
1449 int i = tags->findIndex(text); 1345 int i = tags->findIndex(text);
1450 if (i > 0) combo->setCurrentItem(i); 1346 if (i > 0) combo->setCurrentItem(i);
1451 } else { 1347 } else {
1452 for(int i=0;i<combo->count();++i) { 1348 for(int i=0;i<combo->count();++i) {
1453 if (combo->text(i) == text) { 1349 if (combo->text(i) == text) {
1454 combo->setCurrentItem(i); 1350 combo->setCurrentItem(i);
1455 break; 1351 break;
1456 } 1352 }
1457 } 1353 }
1458 } 1354 }
1459} 1355}
1460 1356
1461void KOPrefsDialog::usrReadConfig() 1357void KOPrefsDialog::usrReadConfig()
1462{ 1358{
1463 if ( kdelibcfg ) 1359
1464 kdelibcfg->readConfig();
1465 else {
1466 mNameEdit->setText(KOPrefs::instance()->fullName()); 1360 mNameEdit->setText(KOPrefs::instance()->fullName());
1467 mEmailEdit->setText(KOPrefs::instance()->email()); 1361 mEmailEdit->setText(KOPrefs::instance()->email());
1468 1362
1469 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1363 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1470 // QDate current ( 2001, 1,1); 1364
1471 //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1472 //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1473 //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1474 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1475 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1365 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1476 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1366 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1477 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1367 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1478 // if (KOPrefs::instance()->mAllDaySize > 47 )
1479 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1480 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1481 1368
1482 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1369 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1483 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1370 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1484 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1371 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1485 // mAMails->clear(); 1372 // mAMails->clear();
1486 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1373 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1487// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1374// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1488// QListViewItem *item = new QListViewItem(mAMails); 1375// QListViewItem *item = new QListViewItem(mAMails);
1489// item->setText(0,*it); 1376// item->setText(0,*it);
1490// mAMails->insertItem(item); 1377// mAMails->insertItem(item);
1491// } 1378// }
1492 1379
1493 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1494 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1495 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1496 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1497
1498 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1380 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1499 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1381 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1500 //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1501 //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1502 //dummy = KOPrefs::instance()->mUserDateFormatShort;
1503 //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1504 updateCategories(); 1382 updateCategories();
1505 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1383 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1506 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1384 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1507 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1385 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1508 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1386 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1509 } 1387
1510} 1388}
1511 1389
1512 1390
1513void KOPrefsDialog::usrWriteConfig() 1391void KOPrefsDialog::usrWriteConfig()
1514{ 1392{
1515 if ( kdelibcfg ) 1393
1516 kdelibcfg->writeConfig(); 1394
1517 else {
1518 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1519 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1520 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1521 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1522 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1523 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1395 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1524
1525 //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1526 //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1527 KOPrefs::instance()->setFullName(mNameEdit->text()); 1396 KOPrefs::instance()->setFullName(mNameEdit->text());
1528 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1397 KOPrefs::instance()->setEmail(mEmailEdit->text());
1529 1398
1530 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1399 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1531
1532 // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1533 //QDate date;
1534 //date = mStartDateSavingEdit->date();
1535 //int sub = 0;
1536 //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1537 // sub = 1;
1538// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1539// date = mEndDateSavingEdit->date();
1540// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1541// sub = 1;
1542// else
1543// sub = 0;
1544// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1545// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1546
1547 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1400 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1548 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1401 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1549 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1402 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1550 1403
1551 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1552
1553 QDictIterator<QColor> it(mCategoryDict); 1404 QDictIterator<QColor> it(mCategoryDict);
1554 while (it.current()) { 1405 while (it.current()) {
1555 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1406 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1556 ++it; 1407 ++it;
1557 } 1408 }
1558 1409
1559 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1410 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1560 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1411 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1561 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1412 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1562 1413
1563 KOPrefs::instance()->mAdditionalMails.clear(); 1414 KOPrefs::instance()->mAdditionalMails.clear();
1564 // QListViewItem *item; 1415 // QListViewItem *item;
1565 // item = mAMails->firstChild(); 1416 // item = mAMails->firstChild();
1566 // while (item) 1417 // while (item)
1567 // { 1418 // {
1568 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1419 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1569 // item = item->nextSibling(); 1420 // item = item->nextSibling();
1570 // } 1421 // }
1571 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1422 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1572 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1423 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1573 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1424 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1574 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1425 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1575 } 1426
1576} 1427}
1577 1428
1578void KOPrefsDialog::updateCategories() 1429void KOPrefsDialog::updateCategories()
1579{ 1430{
1580 mCategoryCombo->clear(); 1431 mCategoryCombo->clear();
1581 mCategoryDict.clear(); 1432 mCategoryDict.clear();
1582 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1433 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1583 updateCategoryColor(); 1434 updateCategoryColor();
1584} 1435}
1585 1436
1586void KOPrefsDialog::warningGroupScheduling()
1587{
1588 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1589}
1590
1591void KOPrefsDialog::warningProjectView()
1592{
1593 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1594}
1595
1596void KOPrefsDialog::warningExperimental(bool on)
1597{
1598 if (on) {
1599 KMessageBox::information(this,i18n("This is an experimental feature. "
1600 "It may not work, it may do nothing useful and it may cause data loss. "
1601 "Use with care.\n"
1602 "You have to restart KOrganizer for this setting to take effect."));
1603 } else {
1604 KMessageBox::information(this,
1605 i18n("You have to restart KOrganizer for this setting to take effect."));
1606 }
1607}
1608
1609void KOPrefsDialog::toggleEmailSettings(bool on) 1437void KOPrefsDialog::toggleEmailSettings(bool on)
1610{ 1438{
1611 if (on) { 1439 if (on) {
1612 mEmailEdit->setEnabled(false); 1440 mEmailEdit->setEnabled(false);
1613 mNameEdit->setEnabled(false); 1441 mNameEdit->setEnabled(false);
1614 mEmailLabel->setEnabled(false); 1442 mEmailLabel->setEnabled(false);
1615 mNameLabel->setEnabled(false); 1443 mNameLabel->setEnabled(false);
1616 1444
1617 KEMailSettings settings; 1445 KEMailSettings settings;
1618 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1446 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1619 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1447 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1620 } else { 1448 } else {
1621 mEmailEdit->setEnabled(true); 1449 mEmailEdit->setEnabled(true);
1622 mNameEdit->setEnabled(true); 1450 mNameEdit->setEnabled(true);
1623 mEmailLabel->setEnabled(true); 1451 mEmailLabel->setEnabled(true);
1624 mNameLabel->setEnabled(true); 1452 mNameLabel->setEnabled(true);
1625 } 1453 }
1626} 1454}
1627 1455
1628void KOPrefsDialog::addItem() 1456void KOPrefsDialog::addItem()
1629{ 1457{
1630 // aEmailsEdit->setEnabled(true); 1458 // aEmailsEdit->setEnabled(true);
1631// QListViewItem *item = new QListViewItem(mAMails); 1459// QListViewItem *item = new QListViewItem(mAMails);
1632// mAMails->insertItem(item); 1460// mAMails->insertItem(item);
1633// mAMails->setSelected(item,true); 1461// mAMails->setSelected(item,true);
1634// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1462// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1635} 1463}
1636 1464
1637void KOPrefsDialog::removeItem() 1465void KOPrefsDialog::removeItem()
1638{ 1466{
1639// QListViewItem *item; 1467// QListViewItem *item;
1640// item = mAMails->selectedItem(); 1468// item = mAMails->selectedItem();
1641// if (!item) return; 1469// if (!item) return;
1642// mAMails->takeItem(item); 1470// mAMails->takeItem(item);
1643// item = mAMails->selectedItem(); 1471// item = mAMails->selectedItem();
1644// if (!item) { 1472// if (!item) {
1645// aEmailsEdit->setText(""); 1473// aEmailsEdit->setText("");
1646// aEmailsEdit->setEnabled(false); 1474// aEmailsEdit->setEnabled(false);
1647// } 1475// }
1648// if (mAMails->childCount() == 0) { 1476// if (mAMails->childCount() == 0) {
1649// aEmailsEdit->setEnabled(false); 1477// aEmailsEdit->setEnabled(false);
1650// } 1478// }
1651} 1479}
1652 1480
1653void KOPrefsDialog::updateItem() 1481void KOPrefsDialog::updateItem()
1654{ 1482{
1655 // QListViewItem *item; 1483 // QListViewItem *item;
1656// item = mAMails->selectedItem(); 1484// item = mAMails->selectedItem();
1657// if (!item) return; 1485// if (!item) return;
1658// item->setText(0,aEmailsEdit->text()); 1486// item->setText(0,aEmailsEdit->text());
1659} 1487}
1660 1488
1661void KOPrefsDialog::updateInput() 1489void KOPrefsDialog::updateInput()
1662{ 1490{
1663// QListViewItem *item; 1491// QListViewItem *item;
1664// item = mAMails->selectedItem(); 1492// item = mAMails->selectedItem();
1665// if (!item) return; 1493// if (!item) return;
1666// aEmailsEdit->setEnabled(true); 1494// aEmailsEdit->setEnabled(true);
1667// aEmailsEdit->setText(item->text(0)); 1495// aEmailsEdit->setText(item->text(0));
1668} 1496}
1669void KOPrefsDialog::updateTimezoneOffset( int index )
1670{
1671 /*
1672 qDebug("updateTimezoneOffset %d ", index);
1673 if ( index < 24 ) {
1674 mTimezoneOffsetSpin->setEnabled ( false );
1675 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
1676
1677
1678 } else {
1679 if ( index == 24 ) {
1680 mTimezoneOffsetSpin->setEnabled ( true );
1681 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1682
1683 } else {
1684 mTimezoneOffsetSpin->setEnabled ( false );
1685 mTimezoneOffsetSpin->setValue( 0 );
1686 }
1687 }
1688 */
1689}
1690
1691void KOPrefsDialog::setupTimeZoneTab()
1692{
1693#if 0
1694 QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
1695 // DesktopIcon("clock",KIcon::SizeMedium));
1696
1697 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1698 topLayout->setSpacing(mSpacingHint);
1699 topLayout->setMargin(mMarginHint);
1700
1701 QHBox *timeZoneBox = new QHBox( topFrame );
1702 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1703
1704 new QLabel( i18n("Timezone:"), timeZoneBox );
1705 mTimeZoneCombo = new QComboBox( timeZoneBox );
1706 if ( QApplication::desktop()->width() < 300 ) {
1707 mTimeZoneCombo->setMaximumWidth(150);
1708 }
1709
1710 QStringList list;
1711 list = KGlobal::locale()->timeZoneList();
1712 mTimeZoneCombo->insertStringList(list);
1713
1714 // find the currently set time zone and select it
1715 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
1716 int nCurrentlySet = 11;
1717 for (int i = 0; i < mTimeZoneCombo->count(); i++)
1718 {
1719 if (mTimeZoneCombo->text(i) == sCurrentlySet)
1720 {
1721 nCurrentlySet = i;
1722 break;
1723 }
1724 }
1725 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
1726 int iii = 1;
1727 KPrefsDialogWidBool *sb =
1728 addWidBool(i18n("Timezone has daylight saving"),
1729 &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
1730 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
1731 ++iii;
1732 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
1733 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1734 ++iii;
1735 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
1736 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1737 ++iii;
1738 lab = new QLabel( i18n("Daylight start:"), topFrame );
1739 topLayout->addWidget(lab, iii,0);
1740 mStartDateSavingEdit = new KDateEdit(topFrame);
1741 topLayout->addWidget(mStartDateSavingEdit, iii,1);
1742 ++iii;
1743
1744 lab = new QLabel( i18n("Daylight end:"), topFrame );
1745 topLayout->addWidget(lab, iii,0);
1746 mEndDateSavingEdit = new KDateEdit(topFrame);
1747 topLayout->addWidget(mEndDateSavingEdit, iii,1);
1748 ++iii;
1749 QDate current ( 2001, 1,1);
1750 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1751 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1752#endif
1753
1754}
1755 1497
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index 6892028..80d6545 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -1,166 +1,154 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOPREFSDIALOG_H 23#ifndef _KOPREFSDIALOG_H
24#define _KOPREFSDIALOG_H 24#define _KOPREFSDIALOG_H
25 25
26#include <qframe.h> 26#include <qframe.h>
27#include <qdict.h> 27#include <qdict.h>
28#include <qcolor.h> 28#include <qcolor.h>
29#include <qlistview.h> 29#include <qlistview.h>
30 30
31#include <kdialogbase.h> 31#include <kdialogbase.h>
32 32
33#include <libkdepim/kprefsdialog.h> 33#include <libkdepim/kprefsdialog.h>
34#include <libkdepim/kdateedit.h> 34#include <libkdepim/kdateedit.h>
35#include <kcmconfigs/kdepimconfigwidget.h> 35#include <kcmconfigs/kdepimconfigwidget.h>
36 36
37class KColorButton; 37class KColorButton;
38class QSpinBox; 38class QSpinBox;
39class QSlider; 39class QSlider;
40class KURLRequester; 40class KURLRequester;
41class QComboBox; 41class QComboBox;
42class QLineEdit; 42class QLineEdit;
43class QStringList; 43class QStringList;
44 44
45/** Dialog to change the korganizer configuration. 45/** Dialog to change the korganizer configuration.
46 */ 46 */
47class KOPrefsDialog : public KPrefsDialog 47class KOPrefsDialog : public KPrefsDialog
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 /** Initialize dialog and pages */ 51 /** Initialize dialog and pages */
52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); 52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
53 ~KOPrefsDialog(); 53 ~KOPrefsDialog();
54 54
55 public slots: 55 public slots:
56 void showPrinterTab(); 56 void showPrinterTab();
57 57
58 /** Update controls for categories */ 58 /** Update controls for categories */
59 void updateCategories(); 59 void updateCategories();
60 void showSyncPage();
61 protected slots: 60 protected slots:
62 void selectSoundFile(); 61 void selectSoundFile();
63 void setCategoryColor(); 62 void setCategoryColor();
64 void updateCategoryColor(); 63 void updateCategoryColor();
65 void updateTimezoneOffset( int );
66
67
68 void warningExperimental(bool on);
69 void warningGroupScheduling();
70 void warningProjectView();
71
72 void toggleEmailSettings(bool); 64 void toggleEmailSettings(bool);
73 65
74 //additional emails 66 //additional emails
75 void addItem(); 67 void addItem();
76 void removeItem(); 68 void removeItem();
77 void updateItem(); 69 void updateItem();
78 void updateInput(); 70 void updateInput();
79 71
80 protected: 72 protected:
81 void usrReadConfig(); 73 void usrReadConfig();
82 void usrWriteConfig(); 74 void usrWriteConfig();
83 void setupGlobalTab(); 75 void setupGlobalTab();
84 76
85 void setupMainTab(); 77 void setupMainTab();
86 void setupTimeTab(); 78 void setupTimeTab();
87 void setupTimeZoneTab();
88 void setupLocaleTab(); 79 void setupLocaleTab();
89 void setupLocaleDateTab(); 80 void setupLocaleDateTab();
90 void setupFontsTab(); 81 void setupFontsTab();
91 void setupColorsTab(); 82 void setupColorsTab();
92 void setupViewsTab(); 83 void setupViewsTab();
93 void setupDisplayTab(); 84 void setupDisplayTab();
94 void setupPrinterTab(); 85 void setupPrinterTab();
95 void setupGroupSchedulingTab(); 86 void setupGroupSchedulingTab();
96 void setupGroupAutomationTab(); 87 void setupGroupAutomationTab();
97 void setupSyncTab();
98 void setupSyncAlgTab();
99 88
100 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 89 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
101 90
102 91
103 private: 92 private:
104 KDEPIMConfigWidget* kdelibcfg;
105 KPrefsDialogWidBool *mEnableGroupScheduling; 93 KPrefsDialogWidBool *mEnableGroupScheduling;
106 KPrefsDialogWidBool *mEnableProjectView; 94 KPrefsDialogWidBool *mEnableProjectView;
107 95
108 QFrame *mPrinterTab; 96 QFrame *mPrinterTab;
109 97
110 QLineEdit *nameEdit; 98 QLineEdit *nameEdit;
111 QLineEdit *emailEdit; 99 QLineEdit *emailEdit;
112 100
113 QComboBox *timeCombo; 101 QComboBox *timeCombo;
114 QComboBox *tzCombo; 102 QComboBox *tzCombo;
115 103
116 // widgets holding preferences data 104 // widgets holding preferences data
117 QLineEdit *mNameEdit; 105 QLineEdit *mNameEdit;
118 QLineEdit *mEmailEdit; 106 QLineEdit *mEmailEdit;
119 QLabel *mNameLabel; 107 QLabel *mNameLabel;
120 QLabel *mEmailLabel; 108 QLabel *mEmailLabel;
121 QLineEdit *mAdditionalEdit; 109 QLineEdit *mAdditionalEdit;
122 QSpinBox *mAutoSaveIntervalSpin; 110 QSpinBox *mAutoSaveIntervalSpin;
123 QSpinBox *mPrioSpin; 111 QSpinBox *mPrioSpin;
124 // QListView *mAMails; 112 // QListView *mAMails;
125 QLineEdit *aEmailsEdit; 113 QLineEdit *aEmailsEdit;
126 114
127 QComboBox *mTimeZoneCombo; 115 QComboBox *mTimeZoneCombo;
128 QStringList tzonenames; 116 QStringList tzonenames;
129 QSpinBox *mStartTimeSpin; 117 QSpinBox *mStartTimeSpin;
130 QSpinBox *mDefaultDurationSpin; 118 QSpinBox *mDefaultDurationSpin;
131 QComboBox *mAlarmTimeCombo; 119 QComboBox *mAlarmTimeCombo;
132 120
133 QComboBox *mCategoryCombo; 121 QComboBox *mCategoryCombo;
134 KColorButton *mCategoryButton; 122 KColorButton *mCategoryButton;
135 QDict<QColor> mCategoryDict; 123 QDict<QColor> mCategoryDict;
136 124
137 QSlider *mHourSizeSlider; 125 QSlider *mHourSizeSlider;
138 126
139 QSpinBox *mNextXDaysSpin; 127 QSpinBox *mNextXDaysSpin;
140 QSpinBox *mWhatsNextSpin; 128 QSpinBox *mWhatsNextSpin;
141 129
142 QLineEdit * mRemoteIPEdit; 130 QLineEdit * mRemoteIPEdit;
143 QLineEdit * mRemoteUser; 131 QLineEdit * mRemoteUser;
144 QLineEdit * mRemotePassWd; 132 QLineEdit * mRemotePassWd;
145 QLineEdit * mRemoteFile; 133 QLineEdit * mRemoteFile;
146 QLineEdit * mLocalTempFile; 134 QLineEdit * mLocalTempFile;
147 QWidget* mSetupSyncAlgTab; 135 QWidget* mSetupSyncAlgTab;
148 QLineEdit * mUserDateFormatLong; 136 QLineEdit * mUserDateFormatLong;
149 QLineEdit * mUserDateFormatShort; 137 QLineEdit * mUserDateFormatShort;
150 138
151 QSpinBox *mTimezoneOffsetSpin; 139 QSpinBox *mTimezoneOffsetSpin;
152 QSpinBox *mDaylightsavingStart; 140 QSpinBox *mDaylightsavingStart;
153 QSpinBox *mDaylightsavingEnd; 141 QSpinBox *mDaylightsavingEnd;
154 KDateEdit* mStartDateSavingEdit; 142 KDateEdit* mStartDateSavingEdit;
155 KDateEdit* mEndDateSavingEdit; 143 KDateEdit* mEndDateSavingEdit;
156 QSpinBox * mAlarmPlayBeeps; 144 QSpinBox * mAlarmPlayBeeps;
157 QSpinBox * mAlarmSuspendTime; 145 QSpinBox * mAlarmSuspendTime;
158 QSpinBox * mAlarmSuspendCount; 146 QSpinBox * mAlarmSuspendCount;
159 QSpinBox * mAlarmBeepInterval; 147 QSpinBox * mAlarmBeepInterval;
160 148
161 QLineEdit * mDefaultAlarmFile; 149 QLineEdit * mDefaultAlarmFile;
162 int mSpacingHint; 150 int mSpacingHint;
163 int mMarginHint; 151 int mMarginHint;
164}; 152};
165 153
166#endif 154#endif
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp
index b6ae775..6dc741d 100644
--- a/libkdepim/kprefsdialog.cpp
+++ b/libkdepim/kprefsdialog.cpp
@@ -1,183 +1,185 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// $Id$ 24// $Id$
25 25
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
60KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference, 62KPrefsDialogWidBool::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
68void KPrefsDialogWidBool::readConfig() 70void KPrefsDialogWidBool::readConfig()
69{ 71{
70 mCheck->setChecked(*mReference); 72 mCheck->setChecked(*mReference);
71} 73}
72 74
73void KPrefsDialogWidBool::writeConfig() 75void KPrefsDialogWidBool::writeConfig()
74{ 76{
75 *mReference = mCheck->isChecked(); 77 *mReference = mCheck->isChecked();
76} 78}
77 79
78QCheckBox *KPrefsDialogWidBool::checkBox() 80QCheckBox *KPrefsDialogWidBool::checkBox()
79{ 81{
80 return mCheck; 82 return mCheck;
81} 83}
82 84
83 85
84KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference, 86KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference,
85 QWidget *parent) 87 QWidget *parent)
86{ 88{
87 mReference = reference; 89 mReference = reference;
88 90
89 mButton = new KColorButton(parent); 91 mButton = new KColorButton(parent);
90 mLabel = new QLabel(mButton, text, parent); 92 mLabel = new QLabel(mButton, text, parent);
91 mButton->setColor( *mReference ); 93 mButton->setColor( *mReference );
92 mButton->setColor( Qt::red ); 94 mButton->setColor( Qt::red );
93 95
94} 96}
95 97
96KPrefsDialogWidColor::~KPrefsDialogWidColor() 98KPrefsDialogWidColor::~KPrefsDialogWidColor()
97{ 99{
98// kdDebug(5300) << "KPrefsDialogWidColor::~KPrefsDialogWidColor()" << endl; 100// kdDebug(5300) << "KPrefsDialogWidColor::~KPrefsDialogWidColor()" << endl;
99} 101}
100 102
101void KPrefsDialogWidColor::readConfig() 103void KPrefsDialogWidColor::readConfig()
102{ 104{
103 mButton->setColor(*mReference); 105 mButton->setColor(*mReference);
104} 106}
105 107
106void KPrefsDialogWidColor::writeConfig() 108void KPrefsDialogWidColor::writeConfig()
107{ 109{
108 *mReference = mButton->color(); 110 *mReference = mButton->color();
109} 111}
110 112
111QLabel *KPrefsDialogWidColor::label() 113QLabel *KPrefsDialogWidColor::label()
112{ 114{
113 return mLabel; 115 return mLabel;
114} 116}
115 117
116KColorButton *KPrefsDialogWidColor::button() 118KColorButton *KPrefsDialogWidColor::button()
117{ 119{
118 return mButton; 120 return mButton;
119} 121}
120 122
121KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString &labelText, 123KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString &labelText,
122 QFont *reference,QWidget *parent) 124 QFont *reference,QWidget *parent)
123{ 125{
124 mReference = reference; 126 mReference = reference;
125 127
126 mLabel = new QLabel(labelText, parent); 128 mLabel = new QLabel(labelText, parent);
127 129
128 mPreview = new QLabel(sampleText,parent); 130 mPreview = new QLabel(sampleText,parent);
129 mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); 131 mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken);
130 132
131 mButton = new QPushButton(i18n("Choose..."), parent); 133 mButton = new QPushButton(i18n("Choose..."), parent);
132 connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); 134 connect(mButton,SIGNAL(clicked()),SLOT(selectFont()));
133 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); 135 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 );
134 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); 136 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 );
135} 137}
136 138
137KPrefsDialogWidFont::~KPrefsDialogWidFont() 139KPrefsDialogWidFont::~KPrefsDialogWidFont()
138{ 140{
139} 141}
140 142
141void KPrefsDialogWidFont::readConfig() 143void KPrefsDialogWidFont::readConfig()
142{ 144{
143 mPreview->setFont(*mReference); 145 mPreview->setFont(*mReference);
144} 146}
145 147
146void KPrefsDialogWidFont::writeConfig() 148void KPrefsDialogWidFont::writeConfig()
147{ 149{
148 *mReference = mPreview->font(); 150 *mReference = mPreview->font();
149} 151}
150 152
151QLabel *KPrefsDialogWidFont::label() 153QLabel *KPrefsDialogWidFont::label()
152{ 154{
153 return mLabel; 155 return mLabel;
154} 156}
155 157
156QLabel *KPrefsDialogWidFont::preview() 158QLabel *KPrefsDialogWidFont::preview()
157{ 159{
158 return mPreview; 160 return mPreview;
159} 161}
160 162
161QPushButton *KPrefsDialogWidFont::button() 163QPushButton *KPrefsDialogWidFont::button()
162{ 164{
163 return mButton; 165 return mButton;
164} 166}
165 167
166void KPrefsDialogWidFont::selectFont() 168void KPrefsDialogWidFont::selectFont()
167{ 169{
168 QFont myFont(mPreview->font()); 170 QFont myFont(mPreview->font());
169 bool ok; 171 bool ok;
170 myFont = KFontDialog::getFont(myFont, ok); 172 myFont = KFontDialog::getFont(myFont, ok);
171 if ( ok ) { 173 if ( ok ) {
172 mPreview->setFont(myFont); 174 mPreview->setFont(myFont);
173 } 175 }
174} 176}
175 177
176 178
177KPrefsDialogWidTime::KPrefsDialogWidTime(const QString &text,int *reference, 179KPrefsDialogWidTime::KPrefsDialogWidTime(const QString &text,int *reference,
178 QWidget *parent) 180 QWidget *parent)
179{ 181{
180 mReference = reference; 182 mReference = reference;
181 183
182 mLabel = new QLabel(text,parent); 184 mLabel = new QLabel(text,parent);
183 mSpin = new QSpinBox(0,23,1,parent); 185 mSpin = new QSpinBox(0,23,1,parent);
@@ -283,128 +285,156 @@ KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal)
283 mPrefsWids.setAutoDelete(true); 285 mPrefsWids.setAutoDelete(true);
284 286
285 connect(this,SIGNAL(defaultClicked()),SLOT(slotDefault())); 287 connect(this,SIGNAL(defaultClicked()),SLOT(slotDefault()));
286 //connect(this,SIGNAL(cancelClicked()),SLOT(slotDefault())); 288 //connect(this,SIGNAL(cancelClicked()),SLOT(slotDefault()));
287 //connect(this,SIGNAL(cancelClicked()),SLOT(reject())); 289 //connect(this,SIGNAL(cancelClicked()),SLOT(reject()));
288} 290}
289 291
290KPrefsDialog::~KPrefsDialog() 292KPrefsDialog::~KPrefsDialog()
291{ 293{
292} 294}
293 295
294void KPrefsDialog::addWid(KPrefsDialogWid *wid) 296void KPrefsDialog::addWid(KPrefsDialogWid *wid)
295{ 297{
296 mPrefsWids.append(wid); 298 mPrefsWids.append(wid);
297} 299}
298 300
299KPrefsDialogWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent) 301KPrefsDialogWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent)
300{ 302{
301 KPrefsDialogWidBool *w = new KPrefsDialogWidBool(text,reference,parent); 303 KPrefsDialogWidBool *w = new KPrefsDialogWidBool(text,reference,parent);
302 addWid(w); 304 addWid(w);
303 return w; 305 return w;
304} 306}
305 307
306KPrefsDialogWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidget *parent) 308KPrefsDialogWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidget *parent)
307{ 309{
308 KPrefsDialogWidTime *w = new KPrefsDialogWidTime(text,reference,parent); 310 KPrefsDialogWidTime *w = new KPrefsDialogWidTime(text,reference,parent);
309 addWid(w); 311 addWid(w);
310 return w; 312 return w;
311} 313}
312 314
313KPrefsDialogWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,QWidget *parent) 315KPrefsDialogWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,QWidget *parent)
314{ 316{
315 KPrefsDialogWidColor *w = new KPrefsDialogWidColor(text,reference,parent); 317 KPrefsDialogWidColor *w = new KPrefsDialogWidColor(text,reference,parent);
316 addWid(w); 318 addWid(w);
317 return w; 319 return w;
318} 320}
319 321
320KPrefsDialogWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,QWidget *parent) 322KPrefsDialogWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,QWidget *parent)
321{ 323{
322 KPrefsDialogWidRadios *w = new KPrefsDialogWidRadios(text,reference,parent); 324 KPrefsDialogWidRadios *w = new KPrefsDialogWidRadios(text,reference,parent);
323 addWid(w); 325 addWid(w);
324 return w; 326 return w;
325} 327}
326 328
327KPrefsDialogWidString *KPrefsDialog::addWidString(const QString &text,QString *reference,QWidget *parent) 329KPrefsDialogWidString *KPrefsDialog::addWidString(const QString &text,QString *reference,QWidget *parent)
328{ 330{
329 KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent); 331 KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent);
330 addWid(w); 332 addWid(w);
331 return w; 333 return w;
332} 334}
333 335
334KPrefsDialogWidString *KPrefsDialog::addWidPassword(const QString &text,QString *reference,QWidget *parent) 336KPrefsDialogWidString *KPrefsDialog::addWidPassword(const QString &text,QString *reference,QWidget *parent)
335{ 337{
336 KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent,QLineEdit::Password); 338 KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent,QLineEdit::Password);
337 addWid(w); 339 addWid(w);
338 return w; 340 return w;
339} 341}
340 342
341KPrefsDialogWidFont *KPrefsDialog::addWidFont(const QString &sampleText,const QString &buttonText, 343KPrefsDialogWidFont *KPrefsDialog::addWidFont(const QString &sampleText,const QString &buttonText,
342 QFont *reference,QWidget *parent) 344 QFont *reference,QWidget *parent)
343{ 345{
344 KPrefsDialogWidFont *w = new KPrefsDialogWidFont(sampleText,buttonText,reference,parent); 346 KPrefsDialogWidFont *w = new KPrefsDialogWidFont(sampleText,buttonText,reference,parent);
345 addWid(w); 347 addWid(w);
346 return w; 348 return w;
347} 349}
348 350
349void KPrefsDialog::setDefaults() 351void KPrefsDialog::setDefaults()
350{ 352{
351 mPrefs->setDefaults(); 353 mPrefs->setDefaults();
352 354
353 readConfig(); 355 readConfig();
354} 356}
355 357
356void KPrefsDialog::readConfig() 358void KPrefsDialog::readConfig()
357{ 359{
358// kdDebug(5300) << "KPrefsDialog::readConfig()" << endl; 360// kdDebug(5300) << "KPrefsDialog::readConfig()" << endl;
359 361
360 KPrefsDialogWid *wid; 362 KPrefsDialogWid *wid;
361 for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { 363 for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) {
362 wid->readConfig(); 364 wid->readConfig();
363 } 365 }
364 366
365 usrReadConfig(); 367 usrReadConfig();
366} 368}
367 369
368void KPrefsDialog::writeConfig() 370void KPrefsDialog::writeConfig()
369{ 371{
370// kdDebug(5300) << "KPrefsDialog::writeConfig()" << endl; 372// kdDebug(5300) << "KPrefsDialog::writeConfig()" << endl;
371 373
372 KPrefsDialogWid *wid; 374 KPrefsDialogWid *wid;
373 for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { 375 for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) {
374 wid->writeConfig(); 376 wid->writeConfig();
375 } 377 }
376 378
377 usrWriteConfig(); 379 usrWriteConfig();
378 380
379// kdDebug(5300) << "KPrefsDialog::writeConfig() now writing..." << endl; 381// kdDebug(5300) << "KPrefsDialog::writeConfig() now writing..." << endl;
380 382
381 mPrefs->writeConfig(); 383 mPrefs->writeConfig();
382 384
383// kdDebug(5300) << "KPrefsDialog::writeConfig() done" << endl; 385// kdDebug(5300) << "KPrefsDialog::writeConfig() done" << endl;
384} 386}
385 387
386 388
387void KPrefsDialog::slotApply() 389void KPrefsDialog::slotApply()
388{ 390{
389 writeConfig(); 391 writeConfig();
390 emit configChanged(); 392 emit configChanged();
391} 393}
392 394
393void KPrefsDialog::slotOk() 395void KPrefsDialog::slotOk()
394{ 396{
395 slotApply(); 397 slotApply();
396 QDialog::accept(); 398 QDialog::accept();
397} 399}
398void KPrefsDialog::accept() 400void KPrefsDialog::accept()
399{ 401{
400 slotOk(); 402 slotOk();
401} 403}
402 404
403void KPrefsDialog::slotDefault() 405void 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
414KPimPrefsGlobalDialog::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}
427void KPimPrefsGlobalDialog::showTZconfig()
428{
429 kdelibcfg->showTimeZoneTab() ;
430}
431void KPimPrefsGlobalDialog::usrReadConfig()
432{
433 kdelibcfg->readConfig();
434}
435
436void 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
@@ -317,129 +317,155 @@ class KPrefsDialogWidString : public KPrefsDialogWid
317 317
318 This class provides the framework for a preferences dialog. You have to 318 This class provides the framework for a preferences dialog. You have to
319 subclass it and add the code to create the actual configuration widgets and 319 subclass it and add the code to create the actual configuration widgets and
320 do the layout management. 320 do the layout management.
321 321
322 KPrefsDialog provides functions to add subclasses of @ref KPrefsDialogWid. For 322 KPrefsDialog provides functions to add subclasses of @ref KPrefsDialogWid. For
323 these widgets the reading, writing and setting to default values is handled 323 these widgets the reading, writing and setting to default values is handled
324 automatically. Custom widgets have to be handled in the functions @ref 324 automatically. Custom widgets have to be handled in the functions @ref
325 usrReadConfig() and @ref usrWriteConfig(). 325 usrReadConfig() and @ref usrWriteConfig().
326*/ 326*/
327class KPrefsDialog : public KDialogBase 327class KPrefsDialog : public KDialogBase
328{ 328{
329 Q_OBJECT 329 Q_OBJECT
330 public: 330 public:
331 /** 331 /**
332 Create a KPrefsDialog for a KPrefs object. 332 Create a KPrefsDialog for a KPrefs object.
333 333
334 @param prefs KPrefs object used to access te configuration. 334 @param prefs KPrefs object used to access te configuration.
335 @param parent Parent widget. 335 @param parent Parent widget.
336 @param name Widget name. 336 @param name Widget name.
337 @param modal true, if dialog has to be modal, false for non-modal. 337 @param modal true, if dialog has to be modal, false for non-modal.
338 */ 338 */
339 KPrefsDialog(KPrefs *prefs,QWidget *parent=0,char *name=0,bool modal=false); 339 KPrefsDialog(KPrefs *prefs,QWidget *parent=0,char *name=0,bool modal=false);
340 /** 340 /**
341 Destructor. 341 Destructor.
342 */ 342 */
343 virtual ~KPrefsDialog(); 343 virtual ~KPrefsDialog();
344 344
345 /** 345 /**
346 Register a custom KPrefsDialogWid object. 346 Register a custom KPrefsDialogWid object.
347 */ 347 */
348 void addWid(KPrefsDialogWid *); 348 void addWid(KPrefsDialogWid *);
349 /** 349 /**
350 Register a @ref KPrefsDialogWidBool object. 350 Register a @ref KPrefsDialogWidBool object.
351 351
352 @param text Text of bool widget. 352 @param text Text of bool widget.
353 @param reference Reference to variable storing the setting. 353 @param reference Reference to variable storing the setting.
354 @param parent Parent widget. 354 @param parent Parent widget.
355 */ 355 */
356 KPrefsDialogWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); 356 KPrefsDialogWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent);
357 /** 357 /**
358 Register a @ref KPrefsDialogWidTime object. 358 Register a @ref KPrefsDialogWidTime object.
359 359
360 @param text Text of time widget. 360 @param text Text of time widget.
361 @param reference Reference to variable storing the setting. 361 @param reference Reference to variable storing the setting.
362 @param parent Parent widget. 362 @param parent Parent widget.
363 */ 363 */
364 KPrefsDialogWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); 364 KPrefsDialogWidTime *addWidTime(const QString &text,int *reference,QWidget *parent);
365 /** 365 /**
366 Register a @ref KPrefsDialogWidColor object. 366 Register a @ref KPrefsDialogWidColor object.
367 367
368 @param text Text of color widget. 368 @param text Text of color widget.
369 @param reference Reference to variable storing the setting. 369 @param reference Reference to variable storing the setting.
370 @param parent Parent widget. 370 @param parent Parent widget.
371 */ 371 */
372 KPrefsDialogWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); 372 KPrefsDialogWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent);
373 /** 373 /**
374 Register a @ref KPrefsDialogWidRadios object. 374 Register a @ref KPrefsDialogWidRadios object.
375 375
376 @param text Text of radio button box widget. 376 @param text Text of radio button box widget.
377 @param reference Reference to variable storing the setting. 377 @param reference Reference to variable storing the setting.
378 @param parent Parent widget. 378 @param parent Parent widget.
379 */ 379 */
380 KPrefsDialogWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); 380 KPrefsDialogWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent);
381 /** 381 /**
382 Register a @ref KPrefsDialogWidString object. 382 Register a @ref KPrefsDialogWidString object.
383 383
384 @param text Text of string widget. 384 @param text Text of string widget.
385 @param reference Reference to variable storing the setting. 385 @param reference Reference to variable storing the setting.
386 @param parent Parent widget. 386 @param parent Parent widget.
387 */ 387 */
388 KPrefsDialogWidString *addWidString(const QString &text,QString *reference,QWidget *parent); 388 KPrefsDialogWidString *addWidString(const QString &text,QString *reference,QWidget *parent);
389 /** 389 /**
390 Register a password @ref KPrefsDialogWidString object, with echomode set to QLineEdit::Password. 390 Register a password @ref KPrefsDialogWidString object, with echomode set to QLineEdit::Password.
391 391
392 @param text Text of string widget. 392 @param text Text of string widget.
393 @param reference Reference to variable storing the setting. 393 @param reference Reference to variable storing the setting.
394 @param parent Parent widget. 394 @param parent Parent widget.
395 */ 395 */
396 KPrefsDialogWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); 396 KPrefsDialogWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent);
397 /** 397 /**
398 Register a @ref KPrefsDialogWidFont object. 398 Register a @ref KPrefsDialogWidFont object.
399 399
400 @param sampleText Sample text of font widget. 400 @param sampleText Sample text of font widget.
401 @param buttonText Button text of font widget. 401 @param buttonText Button text of font widget.
402 @param reference Reference to variable storing the setting. 402 @param reference Reference to variable storing the setting.
403 @param parent Parent widget. 403 @param parent Parent widget.
404 */ 404 */
405 KPrefsDialogWidFont *addWidFont(const QString &sampleText,const QString &buttonText, 405 KPrefsDialogWidFont *addWidFont(const QString &sampleText,const QString &buttonText,
406 QFont *reference,QWidget *parent); 406 QFont *reference,QWidget *parent);
407 407
408 public slots: 408 public slots:
409 /** Set all widgets to default values. */ 409 /** Set all widgets to default values. */
410 void setDefaults(); 410 void setDefaults();
411 411
412 /** Read preferences from config file. */ 412 /** Read preferences from config file. */
413 void readConfig(); 413 void readConfig();
414 414
415 /** Write preferences to config file. */ 415 /** Write preferences to config file. */
416 void writeConfig(); 416 void writeConfig();
417 417
418 signals: 418 signals:
419 /** Emitted when the a changed configuration has been stored. */ 419 /** Emitted when the a changed configuration has been stored. */
420 void configChanged(); 420 void configChanged();
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"
447class 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