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

Konsole

  • kde-4.14
  • 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  mShowAppNameOnTitleBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowAppNameOnTitleBar" ), mShowAppNameOnTitleBar, true );
51  mShowAppNameOnTitleBarItem->setLabel( i18n("Show \"- Konsole\" on the titlebar") );
52  mShowAppNameOnTitleBarItem->setToolTip( i18n("Show \"- Konsole\" on the titlebar") );
53  addItem( mShowAppNameOnTitleBarItem, QLatin1String( "ShowAppNameOnTitleBar" ) );
54  mAllowMenuAcceleratorsItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "AllowMenuAccelerators" ), mAllowMenuAccelerators, false );
55  mAllowMenuAcceleratorsItem->setLabel( i18n("Enable menu accelerators") );
56  mAllowMenuAcceleratorsItem->setToolTip( i18n("Allow users to access top menu through Alt+Key combination") );
57  addItem( mAllowMenuAcceleratorsItem, QLatin1String( "AllowMenuAccelerators" ) );
58  mShowTerminalSizeHintItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowTerminalSizeHint" ), mShowTerminalSizeHint, true );
59  mShowTerminalSizeHintItem->setLabel( i18n("Show hint for terminal size after resizing") );
60  mShowTerminalSizeHintItem->setToolTip( i18n("Show terminal size in columns and lines in the center of window after resizing") );
61  addItem( mShowTerminalSizeHintItem, QLatin1String( "ShowTerminalSizeHint" ) );
62  mSaveGeometryOnExitItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "SaveGeometryOnExit" ), mSaveGeometryOnExit, true );
63  mSaveGeometryOnExitItem->setLabel( i18n("Use current window size on next startup") );
64  mSaveGeometryOnExitItem->setToolTip( i18n("The window size will be saved upon exiting Konsole") );
65  addItem( mSaveGeometryOnExitItem, QLatin1String( "SaveGeometryOnExit" ) );
66 
67  setCurrentGroup( QLatin1String( "TabBar" ) );
68 
69  QList<KConfigSkeleton::ItemEnum::Choice2> valuesTabBarVisibility;
70  {
71  KConfigSkeleton::ItemEnum::Choice2 choice;
72  choice.name = QLatin1String("AlwaysShowTabBar");
73  valuesTabBarVisibility.append( choice );
74  }
75  {
76  KConfigSkeleton::ItemEnum::Choice2 choice;
77  choice.name = QLatin1String("ShowTabBarWhenNeeded");
78  valuesTabBarVisibility.append( choice );
79  }
80  {
81  KConfigSkeleton::ItemEnum::Choice2 choice;
82  choice.name = QLatin1String("AlwaysHideTabBar");
83  valuesTabBarVisibility.append( choice );
84  }
85  mTabBarVisibilityItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "TabBarVisibility" ), mTabBarVisibility, valuesTabBarVisibility, AlwaysShowTabBar );
86  mTabBarVisibilityItem->setLabel( i18n("Control the visibility of the whole tab bar") );
87  addItem( mTabBarVisibilityItem, QLatin1String( "TabBarVisibility" ) );
88  QList<KConfigSkeleton::ItemEnum::Choice2> valuesTabBarPosition;
89  {
90  KConfigSkeleton::ItemEnum::Choice2 choice;
91  choice.name = QLatin1String("Top");
92  valuesTabBarPosition.append( choice );
93  }
94  {
95  KConfigSkeleton::ItemEnum::Choice2 choice;
96  choice.name = QLatin1String("Bottom");
97  valuesTabBarPosition.append( choice );
98  }
99  mTabBarPositionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "TabBarPosition" ), mTabBarPosition, valuesTabBarPosition, Bottom );
100  mTabBarPositionItem->setLabel( i18n("Control the position of the tab bar") );
101  addItem( mTabBarPositionItem, QLatin1String( "TabBarPosition" ) );
102  mTabBarStyleSheetItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "TabBarStyleSheet" ), mTabBarStyleSheet, QLatin1String( "QTabBar::tab { min-width: 2em ; max-width: 25em }" ) );
103  mTabBarStyleSheetItem->setLabel( i18n("Control the visual style of the tab bar") );
104  addItem( mTabBarStyleSheetItem, QLatin1String( "TabBarStyleSheet" ) );
105  mTabBarUseUserStyleSheetItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "TabBarUseUserStyleSheet" ), mTabBarUseUserStyleSheet, false );
106  mTabBarUseUserStyleSheetItem->setLabel( i18n("Use a user-defined .css file for the tab bar") );
107  addItem( mTabBarUseUserStyleSheetItem, QLatin1String( "TabBarUseUserStyleSheet" ) );
108  mTabBarUserStyleSheetFileItem = new KConfigSkeleton::ItemUrl( currentGroup(), QLatin1String( "TabBarUserStyleSheetFile" ), mTabBarUserStyleSheetFile );
109  mTabBarUserStyleSheetFileItem->setLabel( i18n("The .css file to use for the tab bar style") );
110  addItem( mTabBarUserStyleSheetFileItem, QLatin1String( "TabBarUserStyleSheetFile" ) );
111  mShowQuickButtonsItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowQuickButtons" ), mShowQuickButtons, false );
112  mShowQuickButtonsItem->setLabel( i18n("Control the visibility of quick buttons on the tab bar") );
113  addItem( mShowQuickButtonsItem, QLatin1String( "ShowQuickButtons" ) );
114  QList<KConfigSkeleton::ItemEnum::Choice2> valuesNewTabBehavior;
115  {
116  KConfigSkeleton::ItemEnum::Choice2 choice;
117  choice.name = QLatin1String("PutNewTabAtTheEnd");
118  valuesNewTabBehavior.append( choice );
119  }
120  {
121  KConfigSkeleton::ItemEnum::Choice2 choice;
122  choice.name = QLatin1String("PutNewTabAfterCurrentTab");
123  valuesNewTabBehavior.append( choice );
124  }
125  mNewTabBehaviorItem = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "NewTabBehavior" ), mNewTabBehavior, valuesNewTabBehavior, PutNewTabAtTheEnd );
126  mNewTabBehaviorItem->setLabel( i18n("Control where to put the new tab") );
127  addItem( mNewTabBehaviorItem, QLatin1String( "NewTabBehavior" ) );
128 
129  setCurrentGroup( QLatin1String( "PrintOptions" ) );
130 
131  mPrinterFriendlyItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "PrinterFriendly" ), mPrinterFriendly, true );
132  mPrinterFriendlyItem->setLabel( i18n("Printer &friendly mode (black text, no background)") );
133  addItem( mPrinterFriendlyItem, QLatin1String( "PrinterFriendly" ) );
134  mScaleOutputItem = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ScaleOutput" ), mScaleOutput, true );
135  mScaleOutputItem->setLabel( i18n("&Scale output") );
136  addItem( mScaleOutputItem, QLatin1String( "ScaleOutput" ) );
137 }
138 
139 KonsoleSettings::~KonsoleSettings()
140 {
141  if (!s_globalKonsoleSettings.isDestroyed()) {
142  s_globalKonsoleSettings->q = 0;
143  }
144 }
145 
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:446
Konsole::KonsoleSettings::mTabBarUserStyleSheetFile
KUrl mTabBarUserStyleSheetFile
Definition: KonsoleSettings.h:444
KConfigSkeleton
Konsole::KonsoleSettings::mAllowMenuAccelerators
bool mAllowMenuAccelerators
Definition: KonsoleSettings.h:435
Konsole::KonsoleSettings::mTabBarVisibility
int mTabBarVisibility
Definition: KonsoleSettings.h:440
Konsole::KonsoleSettings::mShowWindowTitleOnTitleBar
bool mShowWindowTitleOnTitleBar
Definition: KonsoleSettings.h:433
Konsole::KonsoleSettings::mShowMenuBarByDefault
bool mShowMenuBarByDefault
Definition: KonsoleSettings.h:432
QList::append
void append(const T &value)
Konsole::KonsoleSettings::mShowQuickButtons
bool mShowQuickButtons
Definition: KonsoleSettings.h:445
Konsole::KonsoleSettings::mShowAppNameOnTitleBar
bool mShowAppNameOnTitleBar
Definition: KonsoleSettings.h:434
Konsole::KonsoleSettings::mScaleOutput
bool mScaleOutput
Definition: KonsoleSettings.h:450
Konsole::KonsoleSettings::mShowTerminalSizeHint
bool mShowTerminalSizeHint
Definition: KonsoleSettings.h:436
Konsole::KonsoleSettings::mTabBarPosition
int mTabBarPosition
Definition: KonsoleSettings.h:441
QList
Konsole::KonsoleSettings::mSaveGeometryOnExit
bool mSaveGeometryOnExit
Definition: KonsoleSettings.h:437
Konsole::KonsoleSettings::KonsoleSettings
KonsoleSettings()
Definition: KonsoleSettings.cpp:35
QLatin1String
Konsole::KonsoleSettings::mTabBarStyleSheet
QString mTabBarStyleSheet
Definition: KonsoleSettings.h:442
Konsole::KonsoleSettings::Bottom
Definition: KonsoleSettings.h:15
Konsole::KonsoleSettings::mPrinterFriendly
bool mPrinterFriendly
Definition: KonsoleSettings.h:449
Konsole::KonsoleSettings::~KonsoleSettings
~KonsoleSettings()
Definition: KonsoleSettings.cpp:139
Konsole::KonsoleSettings::mTabBarUseUserStyleSheet
bool mTabBarUseUserStyleSheet
Definition: KonsoleSettings.h:443
KonsoleSettings.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 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
  • 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