kontact
prefs.cpp
Go to the documentation of this file.00001
00002
00003
00004 #include "prefs.h"
00005
00006 #include <klocale.h>
00007
00008 #include <kglobal.h>
00009 #include <QtCore/QFile>
00010
00011 using namespace Kontact;
00012
00013 namespace Kontact {
00014 class PrefsHelper
00015 {
00016 public:
00017 PrefsHelper() : q(0) {}
00018 ~PrefsHelper() { delete q; }
00019 Prefs *q;
00020 };
00021 }
00022 K_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
00023 Prefs *Prefs::self()
00024 {
00025 if (!s_globalPrefs->q) {
00026 new Prefs;
00027 s_globalPrefs->q->readConfig();
00028 }
00029
00030 return s_globalPrefs->q;
00031 }
00032
00033 Prefs::Prefs( )
00034 : KConfigSkeleton( QLatin1String( "kontactrc" ) )
00035 {
00036 Q_ASSERT(!s_globalPrefs->q);
00037 s_globalPrefs->q = this;
00038 setCurrentGroup( QLatin1String( "View" ) );
00039
00040 mActivePluginItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "ActivePlugin" ), mActivePlugin, QLatin1String( "kontact_summaryplugin" ) );
00041 mActivePluginItem->setLabel( i18n("ActivePlugin") );
00042 addItem( mActivePluginItem, QLatin1String( "ActivePlugin" ) );
00043 mForceStartupPluginItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ForceStartupPlugin" ), mForceStartupPlugin, false );
00044 mForceStartupPluginItem->setLabel( i18n("Always start with specified component:") );
00045 mForceStartupPluginItem->setWhatsThis( i18n("Usually Kontact will come up with the component used before shutdown. Check this box if you would like a specific component to come up on start instead.") );
00046 addItem( mForceStartupPluginItem, QLatin1String( "ForceStartupPlugin" ) );
00047 mForcedStartupPluginItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "ForcedStartupPlugin" ), mForcedStartupPlugin );
00048 mForcedStartupPluginItem->setLabel( i18n("ForcedStartupPlugin") );
00049 addItem( mForcedStartupPluginItem, QLatin1String( "ForcedStartupPlugin" ) );
00050 QList<int> defaultSidePaneSplitter;
00051 defaultSidePaneSplitter.append( 1 );
00052
00053 mSidePaneSplitterItem = new KConfigSkeleton::ItemIntList( currentGroup(), QLatin1String( "SidePaneSplitter" ), mSidePaneSplitter, defaultSidePaneSplitter );
00054 mSidePaneSplitterItem->setLabel( i18n("SidePaneSplitter") );
00055 addItem( mSidePaneSplitterItem, QLatin1String( "SidePaneSplitter" ) );
00056 mSidePaneIconSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "SidePaneIconSize" ), mSidePaneIconSize, 32 );
00057 mSidePaneIconSizeItem->setLabel( i18n("SidePaneIconSize") );
00058 addItem( mSidePaneIconSizeItem, QLatin1String( "SidePaneIconSize" ) );
00059 mSidePaneShowIconsItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "SidePaneShowIcons" ), mSidePaneShowIcons, true );
00060 mSidePaneShowIconsItem->setLabel( i18n("SidePaneShowIcons") );
00061 addItem( mSidePaneShowIconsItem, QLatin1String( "SidePaneShowIcons" ) );
00062 mSidePaneShowTextItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "SidePaneShowText" ), mSidePaneShowText, true );
00063 mSidePaneShowTextItem->setLabel( i18n("SidePaneShowText") );
00064 addItem( mSidePaneShowTextItem, QLatin1String( "SidePaneShowText" ) );
00065 mLastVersionSeenItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "LastVersionSeen" ), mLastVersionSeen );
00066 mLastVersionSeenItem->setLabel( i18n("LastVersionSeen") );
00067 addItem( mLastVersionSeenItem, QLatin1String( "LastVersionSeen" ) );
00068 }
00069
00070 Prefs::~Prefs()
00071 {
00072 }
00073