summaryrefslogtreecommitdiffabout
Side-by-side diff
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
@@ -67,64 +67,65 @@ $Id$
#include <kresources/selectdialog.h>
#include <kstandarddirs.h>
#include <ktempfile.h>
#include <kxmlguiclient.h>
#include <kaboutdata.h>
#include <libkdepim/categoryselectdialog.h>
#include "addresseeutil.h"
#include "addresseeeditordialog.h"
#include "extensionmanager.h"
#include "kstdaction.h"
#include "kaddressbookservice.h"
#include "ldapsearchdialog.h"
#include "printing/printingwizard.h"
#else // KAB_EMBEDDED
#include <kapplication.h>
#include "KDGanttMinimizeSplitter.h"
#include "kaddressbookmain.h"
#include "kactioncollection.h"
#include "addresseedialog.h"
//US
#include <addresseeview.h>
#include <qapp.h>
#include <qmenubar.h>
//#include <qtoolbar.h>
#include <qmessagebox.h>
#include <kdebug.h>
#include <kiconloader.h> // needed for SmallIcon
#include <kresources/kcmkresources.h>
#include <ktoolbar.h>
+#include <kprefsdialog.h>
//#include <qlabel.h>
#ifndef DESKTOP_VERSION
#include <qpe/ir.h>
#include <qpe/qpemenubar.h>
#include <qtopia/qcopenvelope_qws.h>
#else
#include <qmenubar.h>
#endif
#endif // KAB_EMBEDDED
#include "kcmconfigs/kcmkabconfig.h"
#include "kcmconfigs/kcmkdepimconfig.h"
#include "kpimglobalprefs.h"
#include "externalapphandler.h"
#include "xxportselectdialog.h"
#include <kresources/selectdialog.h>
#include <kmessagebox.h>
#include <picture.h>
#include <resource.h>
//US#include <qsplitter.h>
#include <qmap.h>
#include <qdir.h>
#include <qfile.h>
@@ -1582,79 +1583,90 @@ void KABCore::extensionModified( const KABC::Addressee::List &list )
}
QString KABCore::getNameByPhone( const QString &phone )
{
#ifndef KAB_EMBEDDED
QRegExp r( "[/*/-/ ]" );
QString localPhone( phone );
bool found = false;
QString ownerName = "";
KABC::AddressBook::Iterator iter;
KABC::PhoneNumber::List::Iterator phoneIter;
KABC::PhoneNumber::List phoneList;
for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) {
phoneList = (*iter).phoneNumbers();
for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() );
++phoneIter) {
// Get rid of separator chars so just the numbers are compared.
if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) {
ownerName = (*iter).formattedName();
found = true;
}
}
}
return ownerName;
#else //KAB_EMBEDDED
qDebug("KABCore::getNameByPhone finsih method");
return "";
#endif //KAB_EMBEDDED
}
-
+void KABCore::openConfigGlobalDialog()
+{
+ KPimPrefsGlobalDialog gc ( this );
+ gc.exec();
+}
void KABCore::openConfigDialog()
{
- KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true );
- KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" );
- ConfigureDialog->addModule(kabcfg );
- KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
- ConfigureDialog->addModule(kdelibcfg );
+ KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true);
+ KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog , "KCMKabConfig" );
+ ConfigureDialog->setMainWidget( kabcfg );
connect( ConfigureDialog, SIGNAL( applyClicked() ),
this, SLOT( configurationChanged() ) );
+ connect( ConfigureDialog, SIGNAL( applyClicked() ),
+ kabcfg, SLOT( save() ) );
connect( ConfigureDialog, SIGNAL( okClicked() ),
this, SLOT( configurationChanged() ) );
+ connect( ConfigureDialog, SIGNAL( okClicked() ),
+ kabcfg, SLOT( save() ) );
+ connect( ConfigureDialog, SIGNAL( defaultClicked() ),
+ kabcfg, SLOT( defaults() ) );
saveSettings();
+ kabcfg->load();
#ifndef DESKTOP_VERSION
+ if ( QApplication::desktop()->height() <= 480 )
+ ConfigureDialog->hideButtons();
ConfigureDialog->showMaximized();
#endif
if ( ConfigureDialog->exec() )
KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
delete ConfigureDialog;
}
void KABCore::openLDAPDialog()
{
#ifndef KAB_EMBEDDED
if ( !mLdapSearchDialog ) {
mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this );
connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager,
SLOT( refreshView() ) );
connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this,
SLOT( setModified() ) );
} else
mLdapSearchDialog->restoreSettings();
if ( mLdapSearchDialog->isOK() )
mLdapSearchDialog->exec();
#else //KAB_EMBEDDED
qDebug("KABCore::openLDAPDialog() finsih method");
#endif //KAB_EMBEDDED
}
void KABCore::print()
{
#ifndef KAB_EMBEDDED
KPrinter printer;
if ( !printer.setup( this ) )
return;
@@ -1996,70 +2008,71 @@ void KABCore::initActions()
mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
Key_Delete, this, SLOT( deleteContacts() ),
actionCollection(), "edit_delete" );
mActionUndo->setEnabled( false );
mActionRedo->setEnabled( false );
// settings menu
#ifdef KAB_EMBEDDED
//US special menuentry to configure the addressbook resources. On KDE
// you do that through the control center !!!
mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
SLOT( configureResources() ), actionCollection(),
"kaddressbook_configure_resources" );
#endif //KAB_EMBEDDED
if ( mIsPart ) {
mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
SLOT( openConfigDialog() ), actionCollection(),
"kaddressbook_configure" );
//US not implemented yet
//mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
// this, SLOT( configureKeyBindings() ), actionCollection(),
// "kaddressbook_configure_shortcuts" );
#ifdef KAB_EMBEDDED
mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
mActionConfigureToolbars->setEnabled( false );
#endif //KAB_EMBEDDED
} else {
- mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
-
- //US not implemented yet
- //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
+ mActionConfigKAddressbook = new KAction( i18n( "&Configure KA/Pi..." ), "configure", 0, this,
+ SLOT( openConfigDialog() ), actionCollection(),
+ "kaddressbook_configure" );
+ mActionConfigGlobal = new KAction( i18n( "Global Settings..." ), "configure", 0, this,
+ SLOT( openConfigGlobalDialog() ), actionCollection(),
+ "kaddressbook_configure" );
}
-
mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
actionCollection(), "options_show_jump_bar" );
connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) );
mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
actionCollection(), "options_show_details" );
connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
SLOT( toggleBeamReceive() ), actionCollection(),
"kaddressbook_beam_rec" );
// misc
// only enable LDAP lookup if we can handle the protocol
#ifndef KAB_EMBEDDED
if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
this, SLOT( openLDAPDialog() ), actionCollection(),
"ldap_lookup" );
}
#else //KAB_EMBEDDED
//qDebug("KABCore::initActions() LDAP has to be implemented");
#endif //KAB_EMBEDDED
mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
SLOT( setWhoAmI() ), actionCollection(),
"set_personal" );
@@ -2214,66 +2227,67 @@ void KABCore::addActionsManually()
fileMenu->insertSeparator();
mActionMailVCard->plug( fileMenu );
#endif
#ifndef DESKTOP_VERSION
if ( Ir::supported() ) mActionBR->plug( beamMenu );
if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
if ( Ir::supported() ) mActionBeam->plug( beamMenu );
#endif
fileMenu->insertSeparator();
mActionQuit->plug( fileMenu );
#ifdef _OL_IMPORT_
mActionImportOL->plug( ImportMenu );
#endif
// edit menu
mActionUndo->plug( editMenu );
mActionRedo->plug( editMenu );
editMenu->insertSeparator();
mActionCut->plug( editMenu );
mActionCopy->plug( editMenu );
mActionPaste->plug( editMenu );
mActionDelete->plug( editMenu );
editMenu->insertSeparator();
mActionSelectAll->plug( editMenu );
mActionSetFormattedName->plug( changeMenu );
mActionRemoveVoice->plug( changeMenu );
// settingsmings menu
//US special menuentry to configure the addressbook resources. On KDE
// you do that through the control center !!!
// settingsMenu->insertSeparator();
mActionConfigKAddressbook->plug( settingsMenu, 0 );
- mActionConfigResources->plug( settingsMenu,1 );
- settingsMenu->insertSeparator(2);
+ mActionConfigGlobal->plug( settingsMenu, 1 );
+ mActionConfigResources->plug( settingsMenu,2 );
+ settingsMenu->insertSeparator(3);
if ( mIsPart ) {
//US not implemented yet
//mActionConfigShortcuts->plug( settingsMenu );
//mActionConfigureToolbars->plug( settingsMenu );
} else {
//US not implemented yet
//mActionKeyBindings->plug( settingsMenu );
}
mActionEditCategories->plug( settingsMenu );
mActionManageCategories->plug( settingsMenu );
mActionJumpBar->plug( viewMenu,0 );
mActionDetails->plug( viewMenu,0 );
//if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
mActionDetails->plug( tb );
settingsMenu->insertSeparator();
#ifndef DESKTOP_VERSION
if ( Ir::supported() ) mActionBR->plug(settingsMenu );
settingsMenu->insertSeparator();
#endif
mActionWhoAmI->plug( settingsMenu );
//mActionEditCategories->plug( changeMenu );
mActionCategories->plug( changeMenu );
//mActionManageCategories->plug( changeMenu );
//mActionCategories->plug( settingsMenu );
mActionWN->plug( helpMenu );
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 80dbf08..6479a58 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -298,64 +298,65 @@ class KABCore : public QWidget, public KSyncInterface
Saves the contents of the AddressBook back to disk.
*/
void save();
/**
Undos the last command using the undo stack.
*/
void undo();
/**
Redos the last command that was undone, using the redo stack.
*/
void redo();
/**
Shows the edit dialog for the given uid. If the uid is QString::null,
the method will try to find a selected addressee in the view.
*/
void editContact( const QString &uid /*US = QString::null*/ );
//US added a second method without defaultparameter
void editContact2();
/**
Shows or edits the detail view for the given uid. If the uid is QString::null,
the method will try to find a selected addressee in the view.
*/
void executeContact( const QString &uid /*US = QString::null*/ );
/**
Launches the configuration dialog.
*/
void openConfigDialog();
+ void openConfigGlobalDialog();
/**
Launches the ldap search dialog.
*/
void openLDAPDialog();
/**
Creates a KAddressBookPrinter, which will display the print
dialog and do the printing.
*/
void print();
/**
Registers a new GUI client, so plugins can register its actions.
*/
void addGUIClient( KXMLGUIClient *client );
void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid);
void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid);
signals:
void contactSelected( const QString &name );
void contactSelected( const QPixmap &pixmap );
public slots:
void recieve(QString cmsg );
void getFile( bool success );
void syncFileRequest();
void setDetailsVisible( bool visible );
void setDetailsToState();
@@ -429,64 +430,65 @@ class KABCore : public QWidget, public KSyncInterface
bool mReadWrite;
bool mModified;
bool mIsPart;
bool mMultipleViewsAtOnce;
//US file menu
KAction *mActionMail;
KAction *mActionBeam;
KToggleAction *mActionBR;
KAction *mActionExport2phone;
KAction* mActionPrint;
KAction* mActionPrintDetails;
KAction* mActionNewContact;
KAction *mActionSave;
KAction *mActionEditAddressee;
KAction *mActionMailVCard;
KAction *mActionBeamVCard;
KAction *mActionQuit;
//US edit menu
KAction *mActionCopy;
KAction *mActionCut;
KAction *mActionPaste;
KAction *mActionSelectAll;
KAction *mActionUndo;
KAction *mActionRedo;
KAction *mActionDelete;
//US settings menu
KAction *mActionConfigResources;
+ KAction *mActionConfigGlobal;
KAction *mActionConfigKAddressbook;
KAction *mActionConfigShortcuts;
KAction *mActionConfigureToolbars;
KAction *mActionKeyBindings;
KToggleAction *mActionJumpBar;
KToggleAction *mActionDetails;
KAction *mActionWhoAmI;
KAction *mActionCategories;
KAction *mActionEditCategories;
KAction *mActionManageCategories;
KAction *mActionAboutKAddressbook;
KAction *mActionLicence;
KAction *mActionFaq;
KAction *mActionWN;
KAction *mActionSyncHowto;
KAction *mActionStorageHowto;
KAction *mActionKdeSyncHowto;
KAction *mActionMultiSyncHowto;
KAction *mActionDeleteView;
QPopupMenu *viewMenu;
QPopupMenu *filterMenu;
QPopupMenu *settingsMenu;
QPopupMenu *changeMenu;
QPopupMenu *beamMenu;
//US QAction *mActionSave;
QPopupMenu *ImportMenu;
QPopupMenu *ExportMenu;
//LR additional methods
KAction *mActionRemoveVoice;
KAction *mActionSetFormattedName;
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
@@ -6,42 +6,42 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef KCMKABCONFIG_H
#define KCMKABCONFIG_H
#include <kcmodule.h>
class KABConfigWidget;
class KABPrefs;
class KCMKabConfig : public KCModule
{
Q_OBJECT
public:
KCMKabConfig( QWidget *parent = 0, const char *name = 0 );
-
+ public slots:
virtual void load();
virtual void save();
virtual void defaults();
private:
KABConfigWidget *mConfigWidget;
};
#endif
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 4794414..2a55127 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2502,64 +2502,65 @@ void CalendarView::edit_copy()
anEvent = static_cast<Event *>(incidence);
}
}
if (!anEvent) {
KNotifyClient::beep();
return;
}
DndFactory factory( mCalendar );
factory.copyIncidence(anEvent);
}
void CalendarView::edit_paste()
{
QDate date = mNavigator->selectedDates().first();
DndFactory factory( mCalendar );
Event *pastedEvent = (Event *)factory.pasteIncidence( date );
changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
}
void CalendarView::edit_global_options()
{
QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
emit save();
emit saveStopTimer();
mDialogManager->showGlobalOptionsDialog();
if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
emit saveStopTimer();
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!"),
i18n("Timezone settings"),i18n("Reload"))) {
qDebug("KO: TZ reload cancelled ");
+ mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
return;
}
qDebug("KO: Timezone change ");
openCalendar( MainWindow::defaultFileName() );
setModified(true);
}
else
qDebug("KO: No tz change ");
}
void CalendarView::edit_options()
{
mDialogManager->showOptionsDialog();
}
void CalendarView::slotSelectPickerDate( QDate d)
{
mDateFrame->hide();
if ( mDatePickerMode == 1 ) {
mNavigator->slotDaySelect( d );
} else if ( mDatePickerMode == 2 ) {
if ( mMoveIncidence->typeID() == todoID ) {
Todo * to = (Todo *) mMoveIncidence;
QTime tim;
int len = 0;
if ( to->hasStartDate() && to->hasDueDate() )
len = to->dtStart().secsTo( to->dtDue());
if ( to->hasDueDate() )
tim = to->dtDue().time();
else {
tim = QTime ( 0,0,0 );
to->setFloats( true );
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index aa30c52..3dfa344 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -61,97 +61,84 @@ KODialogManager::~KODialogManager()
{
delete mOutgoingDialog;
delete mIncomingDialog;
delete mOptionsDialog;
delete mSearchDialog;
#ifndef KORG_NOARCHIVE
delete mArchiveDialog;
#endif
delete mFilterEditDialog;
#ifndef KORG_NOPLUGINS
delete mPluginDialog;
#endif
}
OutgoingDialog *KODialogManager::outgoingDialog()
{
createOutgoingDialog();
return mOutgoingDialog;
}
void KODialogManager::createOutgoingDialog()
{
if (!mOutgoingDialog) {
mOutgoingDialog = new OutgoingDialog(mMainView->calendar(),mMainView);
if (mIncomingDialog) mIncomingDialog->setOutgoingDialog(mOutgoingDialog);
connect(mOutgoingDialog,SIGNAL(numMessagesChanged(int)),
mMainView,SIGNAL(numOutgoingChanged(int)));
}
}
void KODialogManager::showGlobalOptionsDialog( bool showSync )
{
- if (!mOptionsDialog) {
- mOptionsDialog = new KOPrefsDialog(0);
- connect(mOptionsDialog,SIGNAL(configChanged()),
- mMainView,SLOT(updateConfig()));
- }
- mOptionsDialog->readConfig();
-#ifndef DESKTOP_VERSION
- mOptionsDialog->showMaximized();
-#else
- mOptionsDialog->show();
-#endif
- if ( showSync )
- mOptionsDialog->showSyncPage();
- mOptionsDialog->exec();
- delete mOptionsDialog;
- mOptionsDialog = 0;
+ KPimPrefsGlobalDialog gc ( mMainView );
+ if ( showSync )
+ gc.showTZconfig();
+ gc.exec();
}
void KODialogManager::showOptionsDialog( bool showSync )
{
if (!mOptionsDialog) {
mOptionsDialog = new KOPrefsDialog(mMainView);
connect(mOptionsDialog,SIGNAL(configChanged()),
mMainView,SLOT(updateConfig()));
}
mOptionsDialog->readConfig();
#ifndef DESKTOP_VERSION
mOptionsDialog->showMaximized();
#else
mOptionsDialog->show();
#endif
- if ( showSync )
- mOptionsDialog->showSyncPage();
+
mOptionsDialog->exec();
delete mOptionsDialog;
mOptionsDialog = 0;
}
void KODialogManager::showSyncOptions()
{
showGlobalOptionsDialog( true );
}
void KODialogManager::showOutgoingDialog()
{
createOutgoingDialog();
mOutgoingDialog->show();
mOutgoingDialog->raise();
}
IncomingDialog *KODialogManager::incomingDialog()
{
createOutgoingDialog();
if (!mIncomingDialog) {
mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
mMainView,SIGNAL(numIncomingChanged(int)));
connect(mIncomingDialog,SIGNAL(calendarUpdated()),
mMainView,SLOT(updateView()));
}
return mIncomingDialog;
}
void KODialogManager::createIncomingDialog()
{
createOutgoingDialog();
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 4b5b66a..b782bb1 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -57,96 +57,89 @@
#include <kurlrequester.h>
#include <klineedit.h>
#if defined(USE_SOLARIS)
#include <sys/param.h>
#define ZONEINFODIR "/usr/share/lib/zoneinfo"
#define INITFILE "/etc/default/init"
#endif
#include "koprefs.h"
#include "koprefsdialog.h"
#include "kpimglobalprefs.h"
KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
KPrefsDialog(KOPrefs::instance(),parent,name,true)
{
setFont( KGlobalSettings::generalMaxFont() );
setCaption( i18n("Preferences - some settings need a restart (nr)"));
mCategoryDict.setAutoDelete(true);
KGlobal::locale()->insertCatalogue("timezones");
mSpacingHint = spacingHintSmall();
mMarginHint = marginHintSmall();
#ifndef DESKTOP_VERSION
if ( QApplication::desktop()->height() == 480 )
hideButtons();
#endif
- kdelibcfg = 0;
- if ( !parent )
- setupGlobalTab();
- else {
+
setupMainTab();
// setupLocaleTab();
//setupTimeZoneTab();
setupTimeTab();
//setupLocaleDateTab();
setupFontsTab();
setupColorsTab();
setupViewsTab();
//setupSyncTab();
//setupSyncAlgTab();
//setupPrinterTab();
//setupGroupSchedulingTab();
//setupGroupAutomationTab();
- }
+
}
KOPrefsDialog::~KOPrefsDialog()
{
}
void KOPrefsDialog::setupGlobalTab()
{
- //QFrame *topFrame = addPage(i18n("Global"),0,0);
- kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" );
- setMainWidget( kdelibcfg );
- setCaption( i18n("KDE-Pim Global Settings"));
-
+
}
void KOPrefsDialog::setupLocaleDateTab()
{
#if 0
QFrame *topFrame = addPage(i18n("Date Format"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
int iii = 0;
KPrefsDialogWidRadios *syncPrefsGroup =
addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
QString format;
if ( QApplication::desktop()->width() < 480 )
format = "(%d.%m.%Y)";
else
format = "(%d.%m.%Y|%A %d %B %Y)";
syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%m.%d.%Y)";
else
format = "(%m.%d.%Y|%A %B %d %Y)";
syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%Y-%m-%d)";
else
format = "(%Y-%m-%d|%A %Y %B %d)";
syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
syncPrefsGroup->addRadio(i18n("User defined"));
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
@@ -211,161 +204,64 @@ void KOPrefsDialog::setupLocaleTab()
&(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
++iii;
sb =
addWidBool(i18n("Use short date in (WN/E) view"),
&(KOPrefs::instance()->mShortDateInViewer),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
}
else {
QWidget * hb = new QWidget( topFrame );
QHBoxLayout *hbLayout = new QHBoxLayout(hb);
sb =
addWidBool(i18n("Week starts on Sunday"),
&(KOPrefs::instance()->mWeekStartsOnSunday),hb);
hbLayout->addWidget(sb->checkBox() );
sb =
addWidBool(i18n("Use short date in (WN/E) view"),
&(KOPrefs::instance()->mShortDateInViewer),hb);
hbLayout->addWidget(sb->checkBox() );
topLayout->addMultiCellWidget(hb, iii,iii,0,1);
}
// KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
#if 0
++iii;
sb =
addWidBool(i18n("Quick load/save (w/o Unicode)"),
&(KOPrefs::instance()->mUseQuicksave),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
#endif
#endif
}
-void KOPrefsDialog::showSyncPage()
-{
- // showPage ( 0 ) ;
- kdelibcfg->showTimeZoneTab() ;
-
-}
-void KOPrefsDialog::setupSyncAlgTab()
-{
-#if 0
- QLabel * lab;
- QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
- mSetupSyncAlgTab = topFrame;
- QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
- topLayout->setSpacing(mSpacingHint);
- topLayout->setMargin(mMarginHint);
- int iii = 0;
-
- KPrefsDialogWidBool *sb =
- addWidBool(i18n("Ask for preferences before syncing"),
- &(KOPrefs::instance()->mAskForPreferences),topFrame);
- topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
-
- ++iii;
-
- KPrefsDialogWidRadios *syncPrefsGroup =
- addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
- topFrame);
- syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
- syncPrefsGroup->addRadio(i18n("Force take local entry always"));
- syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
- topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
- ++iii;
- sb =
- addWidBool(i18n("Show summary after syncing"),
- &(KOPrefs::instance()->mShowSyncSummary),topFrame);
- topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
-
- ++iii;
-#endif
-
-
-
-}
-
-
-void KOPrefsDialog::setupSyncTab()
-{
-#if 0
- QLabel * lab;
- QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
- QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
- topLayout->setSpacing(mSpacingHint);
- topLayout->setMargin(mMarginHint);
- lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
- int iii = 0;
- topLayout->addMultiCellWidget(lab , iii,iii,0,1);
- ++iii;
-
- mRemoteIPEdit = new QLineEdit(topFrame);
- lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mRemoteIPEdit,iii,1);
- ++iii;
- mRemoteUser = new QLineEdit(topFrame);
- lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mRemoteUser, iii,1);
- ++iii;
-
- mRemoteFile = new QLineEdit(topFrame);
- lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mRemoteFile,iii,1);
- ++iii;
-
- mLocalTempFile = new QLineEdit(topFrame);
- lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
- topLayout->addWidget(lab ,iii,0);
- topLayout->addWidget(mLocalTempFile,iii,1);
- ++iii;
-
- KPrefsDialogWidBool *wb =
- addWidBool(i18n("Write back synced file"),
- &(KOPrefs::instance()->mWriteBackFile),topFrame);
- topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
- ++iii;
- wb =
- addWidBool(i18n("Write back existing entries only"),
- &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
- topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
- ++iii;
-
-#endif
-}
void KOPrefsDialog::setupMainTab()
{
QFrame *topFrame = addPage(i18n("General"),0,0);
// DesktopIcon("identity",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
// KPrefsDialogWidBool *emailControlCenter =
// addWidBool(i18n("&Use email settings from Control Center"),
// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
// connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
// SLOT(toggleEmailSettings(bool)));
mNameEdit = new QLineEdit(topFrame);
mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
topLayout->addWidget(mNameLabel,0,0);
topLayout->addWidget(mNameEdit,0,1);
mEmailEdit = new QLineEdit(topFrame);
mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
topLayout->addWidget(mEmailLabel,1,0);
topLayout->addWidget(mEmailEdit,1,1);
KPrefsDialogWidBool *wb;
KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
&(KOPrefs::instance()->mShowFullMenu),topFrame);
@@ -1431,325 +1327,171 @@ void KOPrefsDialog::setupGroupAutomationTab()
addWidRadios(i18n("Auto Save FreeBusy Replies"),
&(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
autoFreeBusyReplyGroup->addRadio(i18n("Never"));
autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
//autoFreeBusyGroup->addRadio(i18n("selected emails"));
topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
}
void KOPrefsDialog::showPrinterTab()
{
showPage(pageIndex(mPrinterTab));
}
void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
const QStringList *tags)
{
if (tags) {
int i = tags->findIndex(text);
if (i > 0) combo->setCurrentItem(i);
} else {
for(int i=0;i<combo->count();++i) {
if (combo->text(i) == text) {
combo->setCurrentItem(i);
break;
}
}
}
}
void KOPrefsDialog::usrReadConfig()
{
- if ( kdelibcfg )
- kdelibcfg->readConfig();
- else {
+
mNameEdit->setText(KOPrefs::instance()->fullName());
mEmailEdit->setText(KOPrefs::instance()->email());
mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
- // QDate current ( 2001, 1,1);
- //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
- //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
- //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
- //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
+
mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
- // if (KOPrefs::instance()->mAllDaySize > 47 )
- // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
- //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
// mAMails->clear();
// for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
// QListViewItem *item = new QListViewItem(mAMails);
// item->setText(0,*it);
// mAMails->insertItem(item);
// }
- // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
- //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
- //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
- //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
-
//that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
- //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
- //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
- //dummy = KOPrefs::instance()->mUserDateFormatShort;
- //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
updateCategories();
mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
- }
+
}
void KOPrefsDialog::usrWriteConfig()
{
- if ( kdelibcfg )
- kdelibcfg->writeConfig();
- else {
- // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
- //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
- //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
- //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
- //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
+
+
KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
-
- //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
- //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
KOPrefs::instance()->setFullName(mNameEdit->text());
KOPrefs::instance()->setEmail(mEmailEdit->text());
KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
-
- // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
- //QDate date;
- //date = mStartDateSavingEdit->date();
- //int sub = 0;
- //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
- // sub = 1;
-// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
-// date = mEndDateSavingEdit->date();
-// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
-// sub = 1;
-// else
-// sub = 0;
-// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
-// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
-
KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
-
- //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
-
+
QDictIterator<QColor> it(mCategoryDict);
while (it.current()) {
KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
++it;
}
KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
KOPrefs::instance()->mAdditionalMails.clear();
// QListViewItem *item;
// item = mAMails->firstChild();
// while (item)
// {
// KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
// item = item->nextSibling();
// }
- KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
- KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
- KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
- KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
- }
+ KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
+ KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
+ KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
+ KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
+
}
void KOPrefsDialog::updateCategories()
{
mCategoryCombo->clear();
mCategoryDict.clear();
mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
updateCategoryColor();
}
-void KOPrefsDialog::warningGroupScheduling()
-{
- warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
-}
-
-void KOPrefsDialog::warningProjectView()
-{
- warningExperimental(mEnableProjectView->checkBox()->isChecked());
-}
-
-void KOPrefsDialog::warningExperimental(bool on)
-{
- if (on) {
- KMessageBox::information(this,i18n("This is an experimental feature. "
- "It may not work, it may do nothing useful and it may cause data loss. "
- "Use with care.\n"
- "You have to restart KOrganizer for this setting to take effect."));
- } else {
- KMessageBox::information(this,
- i18n("You have to restart KOrganizer for this setting to take effect."));
- }
-}
-
void KOPrefsDialog::toggleEmailSettings(bool on)
{
if (on) {
mEmailEdit->setEnabled(false);
mNameEdit->setEnabled(false);
mEmailLabel->setEnabled(false);
mNameLabel->setEnabled(false);
KEMailSettings settings;
mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
} else {
mEmailEdit->setEnabled(true);
mNameEdit->setEnabled(true);
mEmailLabel->setEnabled(true);
mNameLabel->setEnabled(true);
}
}
void KOPrefsDialog::addItem()
{
// aEmailsEdit->setEnabled(true);
// QListViewItem *item = new QListViewItem(mAMails);
// mAMails->insertItem(item);
// mAMails->setSelected(item,true);
// aEmailsEdit->setText(i18n("(EmptyEmail)"));
}
void KOPrefsDialog::removeItem()
{
// QListViewItem *item;
// item = mAMails->selectedItem();
// if (!item) return;
// mAMails->takeItem(item);
// item = mAMails->selectedItem();
// if (!item) {
// aEmailsEdit->setText("");
// aEmailsEdit->setEnabled(false);
// }
// if (mAMails->childCount() == 0) {
// aEmailsEdit->setEnabled(false);
// }
}
void KOPrefsDialog::updateItem()
{
// QListViewItem *item;
// item = mAMails->selectedItem();
// if (!item) return;
// item->setText(0,aEmailsEdit->text());
}
void KOPrefsDialog::updateInput()
{
// QListViewItem *item;
// item = mAMails->selectedItem();
// if (!item) return;
// aEmailsEdit->setEnabled(true);
// aEmailsEdit->setText(item->text(0));
}
-void KOPrefsDialog::updateTimezoneOffset( int index )
-{
- /*
- qDebug("updateTimezoneOffset %d ", index);
- if ( index < 24 ) {
- mTimezoneOffsetSpin->setEnabled ( false );
- mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
-
-
- } else {
- if ( index == 24 ) {
- mTimezoneOffsetSpin->setEnabled ( true );
- mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
-
- } else {
- mTimezoneOffsetSpin->setEnabled ( false );
- mTimezoneOffsetSpin->setValue( 0 );
- }
- }
- */
-}
-
-void KOPrefsDialog::setupTimeZoneTab()
-{
-#if 0
- QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
- // DesktopIcon("clock",KIcon::SizeMedium));
-
- QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
- topLayout->setSpacing(mSpacingHint);
- topLayout->setMargin(mMarginHint);
-
- QHBox *timeZoneBox = new QHBox( topFrame );
- topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
-
- new QLabel( i18n("Timezone:"), timeZoneBox );
- mTimeZoneCombo = new QComboBox( timeZoneBox );
- if ( QApplication::desktop()->width() < 300 ) {
- mTimeZoneCombo->setMaximumWidth(150);
- }
-
- QStringList list;
- list = KGlobal::locale()->timeZoneList();
- mTimeZoneCombo->insertStringList(list);
-
- // find the currently set time zone and select it
- QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
- int nCurrentlySet = 11;
- for (int i = 0; i < mTimeZoneCombo->count(); i++)
- {
- if (mTimeZoneCombo->text(i) == sCurrentlySet)
- {
- nCurrentlySet = i;
- break;
- }
- }
- mTimeZoneCombo->setCurrentItem(nCurrentlySet);
- int iii = 1;
- KPrefsDialogWidBool *sb =
- addWidBool(i18n("Timezone has daylight saving"),
- &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
- topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
- ++iii;
- QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
- topLayout->addMultiCellWidget(lab, iii,iii,0,1);
- ++iii;
- lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
- topLayout->addMultiCellWidget(lab, iii,iii,0,1);
- ++iii;
- lab = new QLabel( i18n("Daylight start:"), topFrame );
- topLayout->addWidget(lab, iii,0);
- mStartDateSavingEdit = new KDateEdit(topFrame);
- topLayout->addWidget(mStartDateSavingEdit, iii,1);
- ++iii;
-
- lab = new QLabel( i18n("Daylight end:"), topFrame );
- topLayout->addWidget(lab, iii,0);
- mEndDateSavingEdit = new KDateEdit(topFrame);
- topLayout->addWidget(mEndDateSavingEdit, iii,1);
- ++iii;
- QDate current ( 2001, 1,1);
- mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
- mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
-#endif
-
-}
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index 6892028..80d6545 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -28,109 +28,97 @@
#include <qcolor.h>
#include <qlistview.h>
#include <kdialogbase.h>
#include <libkdepim/kprefsdialog.h>
#include <libkdepim/kdateedit.h>
#include <kcmconfigs/kdepimconfigwidget.h>
class KColorButton;
class QSpinBox;
class QSlider;
class KURLRequester;
class QComboBox;
class QLineEdit;
class QStringList;
/** Dialog to change the korganizer configuration.
*/
class KOPrefsDialog : public KPrefsDialog
{
Q_OBJECT
public:
/** Initialize dialog and pages */
KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
~KOPrefsDialog();
public slots:
void showPrinterTab();
/** Update controls for categories */
void updateCategories();
- void showSyncPage();
protected slots:
void selectSoundFile();
void setCategoryColor();
void updateCategoryColor();
- void updateTimezoneOffset( int );
-
-
- void warningExperimental(bool on);
- void warningGroupScheduling();
- void warningProjectView();
-
void toggleEmailSettings(bool);
//additional emails
void addItem();
void removeItem();
void updateItem();
void updateInput();
protected:
void usrReadConfig();
void usrWriteConfig();
void setupGlobalTab();
void setupMainTab();
void setupTimeTab();
- void setupTimeZoneTab();
void setupLocaleTab();
void setupLocaleDateTab();
void setupFontsTab();
void setupColorsTab();
void setupViewsTab();
void setupDisplayTab();
void setupPrinterTab();
void setupGroupSchedulingTab();
void setupGroupAutomationTab();
- void setupSyncTab();
- void setupSyncAlgTab();
void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
private:
- KDEPIMConfigWidget* kdelibcfg;
KPrefsDialogWidBool *mEnableGroupScheduling;
KPrefsDialogWidBool *mEnableProjectView;
QFrame *mPrinterTab;
QLineEdit *nameEdit;
QLineEdit *emailEdit;
QComboBox *timeCombo;
QComboBox *tzCombo;
// widgets holding preferences data
QLineEdit *mNameEdit;
QLineEdit *mEmailEdit;
QLabel *mNameLabel;
QLabel *mEmailLabel;
QLineEdit *mAdditionalEdit;
QSpinBox *mAutoSaveIntervalSpin;
QSpinBox *mPrioSpin;
// QListView *mAMails;
QLineEdit *aEmailsEdit;
QComboBox *mTimeZoneCombo;
QStringList tzonenames;
QSpinBox *mStartTimeSpin;
QSpinBox *mDefaultDurationSpin;
QComboBox *mAlarmTimeCombo;
QComboBox *mCategoryCombo;
KColorButton *mCategoryButton;
QDict<QColor> mCategoryDict;
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp
index b6ae775..6dc741d 100644
--- a/libkdepim/kprefsdialog.cpp
+++ b/libkdepim/kprefsdialog.cpp
@@ -18,70 +18,72 @@
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
// $Id$
#include <qlayout.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include <qbuttongroup.h>
#include <qlineedit.h>
#include <qfont.h>
#include <qslider.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qspinbox.h>
#include <qdatetime.h>
#include <qframe.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qapplication.h>
#include <kcolorbutton.h>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
+#include <kglobalsettings.h>
#include <kfontdialog.h>
#include <kmessagebox.h>
#include <kcolordialog.h>
#include <kiconloader.h>
#include "kprefs.h"
+#include "kpimglobalprefs.h"
#include "kprefsdialog.h"
//#include "kprefsdialog.moc"
KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference,
QWidget *parent)
{
mReference = reference;
mCheck = new QCheckBox(text,parent);
}
void KPrefsDialogWidBool::readConfig()
{
mCheck->setChecked(*mReference);
}
void KPrefsDialogWidBool::writeConfig()
{
*mReference = mCheck->isChecked();
}
QCheckBox *KPrefsDialogWidBool::checkBox()
{
return mCheck;
}
KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference,
QWidget *parent)
{
mReference = reference;
@@ -379,32 +381,60 @@ void KPrefsDialog::writeConfig()
// kdDebug(5300) << "KPrefsDialog::writeConfig() now writing..." << endl;
mPrefs->writeConfig();
// kdDebug(5300) << "KPrefsDialog::writeConfig() done" << endl;
}
void KPrefsDialog::slotApply()
{
writeConfig();
emit configChanged();
}
void KPrefsDialog::slotOk()
{
slotApply();
QDialog::accept();
}
void KPrefsDialog::accept()
{
slotOk();
}
void KPrefsDialog::slotDefault()
{
if (KMessageBox::warningContinueCancel(this,
i18n("You are about to set all\npreferences to default values.\nAll "
"custom modifications will be lost."),i18n("Setting Default Preferences"),
i18n("Continue"))
== KMessageBox::Continue) setDefaults();
}
+
+KPimPrefsGlobalDialog::KPimPrefsGlobalDialog(QWidget *parent,char *name,bool modal): KPrefsDialog( KPimGlobalPrefs::instance() ,parent, name, modal )
+{
+ setFont( KGlobalSettings::generalMaxFont() );
+ kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KPrefsGlobalDialog" );
+ setMainWidget( kdelibcfg );
+ setCaption( i18n("KDE-Pim Global Settings"));
+ kdelibcfg->readConfig();
+#ifndef DESKTOP_VERSION
+ if ( QApplication::desktop()->height() <= 480 )
+ hideButtons();
+ showMaximized();
+#endif
+}
+void KPimPrefsGlobalDialog::showTZconfig()
+{
+ kdelibcfg->showTimeZoneTab() ;
+}
+void KPimPrefsGlobalDialog::usrReadConfig()
+{
+ kdelibcfg->readConfig();
+}
+
+void KPimPrefsGlobalDialog::usrWriteConfig()
+{
+ kdelibcfg->writeConfig();
+}
+
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h
index efcb86a..52ec809 100644
--- a/libkdepim/kprefsdialog.h
+++ b/libkdepim/kprefsdialog.h
@@ -413,33 +413,59 @@ class KPrefsDialog : public KDialogBase
void readConfig();
/** Write preferences to config file. */
void writeConfig();
signals:
/** Emitted when the a changed configuration has been stored. */
void configChanged();
protected slots:
/** Apply changes to preferences */
void slotApply();
void accept();
/** Accept changes to preferences and close dialog */
void slotOk();
/** Set preferences to default values */
void slotDefault();
protected:
/** Implement this to read custom configuration widgets. */
virtual void usrReadConfig() {}
/** Implement this to write custom configuration widgets. */
virtual void usrWriteConfig() {}
private:
KPrefs *mPrefs;
QPtrList<KPrefsDialogWid> mPrefsWids;
};
+
+#include "kcmconfigs/kdepimconfigwidget.h"
+class KPimPrefsGlobalDialog : public KPrefsDialog
+{
+ Q_OBJECT
+ public:
+ KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true);
+ /**
+ Destructor.
+ */
+ void showTZconfig();
+
+ public slots:
+
+ signals:
+ protected slots:
+
+ protected:
+ void usrReadConfig();
+ virtual void usrWriteConfig() ;
+
+ private:
+ KDEPIMConfigWidget* kdelibcfg;
+
+};
+
#endif