• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kaddressbook

  • sources
  • kde-4.12
  • kdepim
  • kaddressbook
settings.cpp
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from kaddressbook.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "settings.h"
5 
6 #include <klocale.h>
7 
8 #include <kglobal.h>
9 #include <QtCore/QFile>
10 
11 class SettingsHelper
12 {
13  public:
14  SettingsHelper() : q(0) {}
15  ~SettingsHelper() { delete q; }
16  Settings *q;
17 };
18 K_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
19 Settings *Settings::self()
20 {
21  if (!s_globalSettings->q) {
22  new Settings;
23  s_globalSettings->q->readConfig();
24  }
25 
26  return s_globalSettings->q;
27 }
28 
29 Settings::Settings( )
30  : KConfigSkeleton( QLatin1String( "kaddressbookrc" ) )
31 {
32  Q_ASSERT(!s_globalSettings->q);
33  s_globalSettings->q = this;
34  setCurrentGroup( QLatin1String( "Window" ) );
35 
36  mUseSimpleModeItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "UseSimpleMode" ), mUseSimpleMode, false );
37  mUseSimpleModeItem->setLabel( i18n("UseSimpleMode") );
38  mUseSimpleModeItem->setToolTip( i18n("Set the view to \\\"Simple Mode\\\"") );
39  mUseSimpleModeItem->setWhatsThis( i18n("Set this option to true if you want to use the simple view mode instead of the normal view mode where a list of all your address books and contacts are shown on the display.") );
40  addItem( mUseSimpleModeItem, QLatin1String( "UseSimpleMode" ) );
41 
42  setCurrentGroup( QLatin1String( "Printing" ) );
43 
44  mDefaultFileNameItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "DefaultFileName" ), mDefaultFileName, QLatin1String( "addressbook.pdf" ) );
45  mDefaultFileNameItem->setLabel( i18n("DefaultFileName") );
46  mDefaultFileNameItem->setToolTip( i18n("Default print file name") );
47  mDefaultFileNameItem->setWhatsThis( i18n("Set the name of the default print file.") );
48  addItem( mDefaultFileNameItem, QLatin1String( "DefaultFileName" ) );
49  mPrintingStyleItem = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "PrintingStyle" ), mPrintingStyle, 0 );
50  mPrintingStyleItem->setLabel( i18n("Printing style") );
51  mPrintingStyleItem->setToolTip( i18n("Set the printing style") );
52  mPrintingStyleItem->setWhatsThis( i18n("KAddressBook can print the contacts in several styles. With this combobox you can choose one of these.") );
53  addItem( mPrintingStyleItem, QLatin1String( "PrintingStyle" ) );
54  QList<KConfigSkeleton::ItemEnum::Choice2> valuesSortOrder;
55  {
56  KConfigSkeleton::ItemEnum::Choice2 choice;
57  choice.name = QLatin1String("Ascending");
58  valuesSortOrder.append( choice );
59  }
60  {
61  KConfigSkeleton::ItemEnum::Choice2 choice;
62  choice.name = QLatin1String("Descending");
63  valuesSortOrder.append( choice );
64  }
65  mSortOrderItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "SortOrder" ), mSortOrder, valuesSortOrder, Ascending );
66  mSortOrderItem->setLabel( i18n("Default sort order") );
67  mSortOrderItem->setToolTip( i18n("Sort order") );
68  mSortOrderItem->setWhatsThis( i18n("Choose the sorting order for the printed contacts.") );
69  addItem( mSortOrderItem, QLatin1String( "SortOrder" ) );
70 
71  setCurrentGroup( QLatin1String( "Views" ) );
72 
73  QList<int> defaultContactModelColumns;
74  defaultContactModelColumns.append( 0 );
75 
76  mContactModelColumnsItem = new KConfigSkeleton::ItemIntList( currentGroup(), QLatin1String( "ContactModelColumns" ), mContactModelColumns, defaultContactModelColumns );
77  mContactModelColumnsItem->setLabel( i18n("ContactModelColumns") );
78  mContactModelColumnsItem->setToolTip( i18n("View columns") );
79  mContactModelColumnsItem->setWhatsThis( i18n("Set the number of contact model view columns.") );
80  addItem( mContactModelColumnsItem, QLatin1String( "ContactModelColumns" ) );
81  QList<KConfigSkeleton::ItemEnum::Choice2> valuesViewMode;
82  {
83  KConfigSkeleton::ItemEnum::Choice2 choice;
84  choice.name = QLatin1String("Dummy");
85  valuesViewMode.append( choice );
86  }
87  {
88  KConfigSkeleton::ItemEnum::Choice2 choice;
89  choice.name = QLatin1String("Simple");
90  valuesViewMode.append( choice );
91  }
92  {
93  KConfigSkeleton::ItemEnum::Choice2 choice;
94  choice.name = QLatin1String("TwoColumn");
95  valuesViewMode.append( choice );
96  }
97  {
98  KConfigSkeleton::ItemEnum::Choice2 choice;
99  choice.name = QLatin1String("ThreeColumn");
100  valuesViewMode.append( choice );
101  }
102  mViewModeItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "ViewMode" ), mViewMode, valuesViewMode, 3 );
103  mViewModeItem->setLabel( i18n("Viewing mode") );
104  mViewModeItem->setToolTip( i18n("Viewing mode (number of columns)") );
105  mViewModeItem->setWhatsThis( i18n("Choose the layout for the main view") );
106  addItem( mViewModeItem, QLatin1String( "ViewMode" ) );
107 }
108 
109 Settings::~Settings()
110 {
111  if (!s_globalSettings.isDestroyed()) {
112  s_globalSettings->q = 0;
113  }
114 }
115 
Settings::mDefaultFileName
QString mDefaultFileName
Definition: settings.h:189
Settings::mSortOrder
int mSortOrder
Definition: settings.h:191
Settings::mUseSimpleMode
bool mUseSimpleMode
Definition: settings.h:186
Settings::~Settings
~Settings()
Definition: settings.cpp:109
Settings::mPrintingStyle
int mPrintingStyle
Definition: settings.h:190
Settings::Ascending
Definition: settings.h:12
KConfigSkeleton
Settings::mViewMode
int mViewMode
Definition: settings.h:195
Settings::Settings
Settings()
Definition: settings.cpp:29
Settings
Definition: settings.h:9
settings.h
Settings::mContactModelColumns
QList< int > mContactModelColumns
Definition: settings.h:194
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal