prefs.cpp
00001
00002
00003
00004 #include "prefs.h"
00005
00006 #include <klocale.h>
00007
00008 #include <kstaticdeleter.h>
00009
00010 using namespace Kontact;
00011
00012 Prefs *Prefs::mSelf = 0;
00013 static KStaticDeleter<Prefs> staticPrefsDeleter;
00014
00015 Prefs *Prefs::self()
00016 {
00017 if ( !mSelf ) {
00018 staticPrefsDeleter.setObject( mSelf, new Prefs() );
00019 mSelf->readConfig();
00020 }
00021
00022 return mSelf;
00023 }
00024
00025 Prefs::Prefs( )
00026 : KConfigSkeleton( QString::fromLatin1( "kontactrc" ) )
00027 {
00028 mSelf = this;
00029 setCurrentGroup( QString::fromLatin1( "View" ) );
00030
00031 mActivePluginItem = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "ActivePlugin" ), mActivePlugin, "kontact_summaryplugin" );
00032 mActivePluginItem->setLabel( i18n("ActivePlugin") );
00033 addItem( mActivePluginItem, QString::fromLatin1( "ActivePlugin" ) );
00034 QValueList<int> defaultSidePaneSplitter;
00035
00036 mSidePaneSplitterItem = new KConfigSkeleton::ItemIntList( currentGroup(), QString::fromLatin1( "SidePaneSplitter" ), mSidePaneSplitter, defaultSidePaneSplitter );
00037 mSidePaneSplitterItem->setLabel( i18n("SidePaneSplitter") );
00038 addItem( mSidePaneSplitterItem, QString::fromLatin1( "SidePaneSplitter" ) );
00039 QValueList<KConfigSkeleton::ItemEnum::Choice> valuesSidePaneType;
00040 {
00041 KConfigSkeleton::ItemEnum::Choice choice;
00042 choice.name = QString::fromLatin1( "SidePaneBars" );
00043 choice.label = i18n("Button view with sidebar extension");
00044 valuesSidePaneType.append( choice );
00045 }
00046 {
00047 KConfigSkeleton::ItemEnum::Choice choice;
00048 choice.name = QString::fromLatin1( "SidePaneIcons" );
00049 choice.label = i18n("Icon view");
00050 valuesSidePaneType.append( choice );
00051 }
00052 mSidePaneTypeItem = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "SidePaneType" ), mSidePaneType, valuesSidePaneType, SidePaneIcons );
00053 mSidePaneTypeItem->setLabel( i18n("Side Pane Type") );
00054 addItem( mSidePaneTypeItem, QString::fromLatin1( "SidePaneType" ) );
00055 }
00056
00057 Prefs::~Prefs()
00058 {
00059 if ( mSelf == this )
00060 staticPrefsDeleter.setObject( mSelf, 0, false );
00061 }
00062
This file is part of the documentation for kontact Library Version 3.3.2.