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

Konsole

  • sources
  • kde-4.12
  • applications
  • konsole
  • src
  • settings
KonsoleSettings.cpp
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from konsole.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "KonsoleSettings.h"
5 
6 #include <klocale.h>
7 
8 #include <kglobal.h>
9 #include <QtCore/QFile>
10 
11 using namespace Konsole;
12 
13 namespace Konsole {
14 
15 class KonsoleSettingsHelper
16 {
17  public:
18  KonsoleSettingsHelper() : q(0) {}
19  ~KonsoleSettingsHelper() { delete q; }
20  KonsoleSettings *q;
21 };
22 }
23 
24 K_GLOBAL_STATIC(KonsoleSettingsHelper, s_globalKonsoleSettings)
25 KonsoleSettings *KonsoleSettings::self()
26 {
27  if (!s_globalKonsoleSettings->q) {
28  new KonsoleSettings;
29  s_globalKonsoleSettings->q->readConfig();
30  }
31 
32  return s_globalKonsoleSettings->q;
33 }
34 
35 KonsoleSettings::KonsoleSettings( )
36  : KConfigSkeleton( QLatin1String( "konsolerc" ) )
37 {
38  Q_ASSERT(!s_globalKonsoleSettings->q);
39  s_globalKonsoleSettings->q = this;
40  setCurrentGroup( QLatin1String( "KonsoleWindow" ) );
41 
42  mShowMenuBarByDefaultItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowMenuBarByDefault" ), mShowMenuBarByDefault, true );
43  mShowMenuBarByDefaultItem->setLabel( i18n("Show menubar by default") );
44  mShowMenuBarByDefaultItem->setToolTip( i18n("Show menubar by default in each Konsole window") );
45  addItem( mShowMenuBarByDefaultItem, QLatin1String( "ShowMenuBarByDefault" ) );
46  mShowWindowTitleOnTitleBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowWindowTitleOnTitleBar" ), mShowWindowTitleOnTitleBar, false );
47  mShowWindowTitleOnTitleBarItem->setLabel( i18n("Show window title on the titlebar") );
48  mShowWindowTitleOnTitleBarItem->setToolTip( i18n("Show window title set by escape sequence on the titlebar") );
49  addItem( mShowWindowTitleOnTitleBarItem, QLatin1String( "ShowWindowTitleOnTitleBar" ) );
50  mAllowMenuAcceleratorsItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "AllowMenuAccelerators" ), mAllowMenuAccelerators, false );
51  mAllowMenuAcceleratorsItem->setLabel( i18n("Enable menu accelerators") );
52  mAllowMenuAcceleratorsItem->setToolTip( i18n("Allow users to access top menu through Alt+Key combination") );
53  addItem( mAllowMenuAcceleratorsItem, QLatin1String( "AllowMenuAccelerators" ) );
54  mShowTerminalSizeHintItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowTerminalSizeHint" ), mShowTerminalSizeHint, true );
55  mShowTerminalSizeHintItem->setLabel( i18n("Show hint for terminal size after resizing") );
56  mShowTerminalSizeHintItem->setToolTip( i18n("Show terminal size in columns and lines in the center of window after resizing") );
57  addItem( mShowTerminalSizeHintItem, QLatin1String( "ShowTerminalSizeHint" ) );
58  mSaveGeometryOnExitItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "SaveGeometryOnExit" ), mSaveGeometryOnExit, true );
59  mSaveGeometryOnExitItem->setLabel( i18n("Save window size on exit") );
60  mSaveGeometryOnExitItem->setToolTip( i18n("The window size will be saved upon exiting Konsole") );
61  addItem( mSaveGeometryOnExitItem, QLatin1String( "SaveGeometryOnExit" ) );
62 
63  setCurrentGroup( QLatin1String( "TabBar" ) );
64 
65  QList<KConfigSkeleton::ItemEnum::Choice2> valuesTabBarVisibility;
66  {
67  KConfigSkeleton::ItemEnum::Choice2 choice;
68  choice.name = QLatin1String("AlwaysShowTabBar");
69  valuesTabBarVisibility.append( choice );
70  }
71  {
72  KConfigSkeleton::ItemEnum::Choice2 choice;
73  choice.name = QLatin1String("ShowTabBarWhenNeeded");
74  valuesTabBarVisibility.append( choice );
75  }
76  {
77  KConfigSkeleton::ItemEnum::Choice2 choice;
78  choice.name = QLatin1String("AlwaysHideTabBar");
79  valuesTabBarVisibility.append( choice );
80  }
81  mTabBarVisibilityItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "TabBarVisibility" ), mTabBarVisibility, valuesTabBarVisibility, AlwaysShowTabBar );
82  mTabBarVisibilityItem->setLabel( i18n("Control the visibility of the whole tab bar") );
83  addItem( mTabBarVisibilityItem, QLatin1String( "TabBarVisibility" ) );
84  QList<KConfigSkeleton::ItemEnum::Choice2> valuesTabBarPosition;
85  {
86  KConfigSkeleton::ItemEnum::Choice2 choice;
87  choice.name = QLatin1String("Top");
88  valuesTabBarPosition.append( choice );
89  }
90  {
91  KConfigSkeleton::ItemEnum::Choice2 choice;
92  choice.name = QLatin1String("Bottom");
93  valuesTabBarPosition.append( choice );
94  }
95  mTabBarPositionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "TabBarPosition" ), mTabBarPosition, valuesTabBarPosition, Bottom );
96  mTabBarPositionItem->setLabel( i18n("Control the position of the tab bar") );
97  addItem( mTabBarPositionItem, QLatin1String( "TabBarPosition" ) );
98  mTabBarStyleSheetItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "TabBarStyleSheet" ), mTabBarStyleSheet, QLatin1String( "QTabBar::tab { min-width: 2em ; max-width: 25em }" ) );
99  mTabBarStyleSheetItem->setLabel( i18n("Control the visual style of the tab bar") );
100  addItem( mTabBarStyleSheetItem, QLatin1String( "TabBarStyleSheet" ) );
101  mShowQuickButtonsItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowQuickButtons" ), mShowQuickButtons, false );
102  mShowQuickButtonsItem->setLabel( i18n("Control the visibility of quick buttons on the tab bar") );
103  addItem( mShowQuickButtonsItem, QLatin1String( "ShowQuickButtons" ) );
104  QList<KConfigSkeleton::ItemEnum::Choice2> valuesNewTabBehavior;
105  {
106  KConfigSkeleton::ItemEnum::Choice2 choice;
107  choice.name = QLatin1String("PutNewTabAtTheEnd");
108  valuesNewTabBehavior.append( choice );
109  }
110  {
111  KConfigSkeleton::ItemEnum::Choice2 choice;
112  choice.name = QLatin1String("PutNewTabAfterCurrentTab");
113  valuesNewTabBehavior.append( choice );
114  }
115  mNewTabBehaviorItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "NewTabBehavior" ), mNewTabBehavior, valuesNewTabBehavior, PutNewTabAtTheEnd );
116  mNewTabBehaviorItem->setLabel( i18n("Control where to put the new tab") );
117  addItem( mNewTabBehaviorItem, QLatin1String( "NewTabBehavior" ) );
118 
119  setCurrentGroup( QLatin1String( "PrintOptions" ) );
120 
121  mPrinterFriendlyItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "PrinterFriendly" ), mPrinterFriendly, true );
122  mPrinterFriendlyItem->setLabel( i18n("Printer &friendly mode (black text, no background)") );
123  addItem( mPrinterFriendlyItem, QLatin1String( "PrinterFriendly" ) );
124  mScaleOutputItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ScaleOutput" ), mScaleOutput, true );
125  mScaleOutputItem->setLabel( i18n("&Scale output") );
126  addItem( mScaleOutputItem, QLatin1String( "ScaleOutput" ) );
127 }
128 
129 KonsoleSettings::~KonsoleSettings()
130 {
131  if (!s_globalKonsoleSettings.isDestroyed()) {
132  s_globalKonsoleSettings->q = 0;
133  }
134 }
135 
Konsole::KonsoleSettings::PutNewTabAtTheEnd
Definition: KonsoleSettings.h:16
Konsole::KonsoleSettings::AlwaysShowTabBar
Definition: KonsoleSettings.h:14
Konsole::KonsoleSettings
Definition: KonsoleSettings.h:11
Konsole::KonsoleSettings::mNewTabBehavior
int mNewTabBehavior
Definition: KonsoleSettings.h:362
KConfigSkeleton
Konsole::KonsoleSettings::mAllowMenuAccelerators
bool mAllowMenuAccelerators
Definition: KonsoleSettings.h:353
Konsole::KonsoleSettings::mTabBarVisibility
int mTabBarVisibility
Definition: KonsoleSettings.h:358
Konsole::KonsoleSettings::mShowWindowTitleOnTitleBar
bool mShowWindowTitleOnTitleBar
Definition: KonsoleSettings.h:352
Konsole::KonsoleSettings::mShowMenuBarByDefault
bool mShowMenuBarByDefault
Definition: KonsoleSettings.h:351
Konsole::KonsoleSettings::mShowQuickButtons
bool mShowQuickButtons
Definition: KonsoleSettings.h:361
Konsole::KonsoleSettings::mScaleOutput
bool mScaleOutput
Definition: KonsoleSettings.h:366
Konsole::KonsoleSettings::mShowTerminalSizeHint
bool mShowTerminalSizeHint
Definition: KonsoleSettings.h:354
Konsole::KonsoleSettings::mTabBarPosition
int mTabBarPosition
Definition: KonsoleSettings.h:359
Konsole::KonsoleSettings::mSaveGeometryOnExit
bool mSaveGeometryOnExit
Definition: KonsoleSettings.h:355
Konsole::KonsoleSettings::KonsoleSettings
KonsoleSettings()
Definition: KonsoleSettings.cpp:35
Konsole::KonsoleSettings::mTabBarStyleSheet
QString mTabBarStyleSheet
Definition: KonsoleSettings.h:360
Konsole::KonsoleSettings::Bottom
Definition: KonsoleSettings.h:15
Konsole::KonsoleSettings::mPrinterFriendly
bool mPrinterFriendly
Definition: KonsoleSettings.h:365
Konsole::KonsoleSettings::~KonsoleSettings
~KonsoleSettings()
Definition: KonsoleSettings.cpp:129
KonsoleSettings.h
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Applications
  •   Libraries
  •     libkonq
  • Konsole

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