// This file is generated by kconfig_compiler_kf5 from konsole.kcfg.
// All changes you do to this file will be lost.

#include "KonsoleSettings.h"

#include <qglobal.h>
#include <QFile>

using namespace Konsole;

namespace Konsole {

class KonsoleSettingsHelper
{
  public:
    KonsoleSettingsHelper() : q(nullptr) {}
    ~KonsoleSettingsHelper() { delete q; q = nullptr; }
    KonsoleSettingsHelper(const KonsoleSettingsHelper&) = delete;
    KonsoleSettingsHelper& operator=(const KonsoleSettingsHelper&) = delete;
    KonsoleSettings *q;
};

}
Q_GLOBAL_STATIC(KonsoleSettingsHelper, s_globalKonsoleSettings)
KonsoleSettings *KonsoleSettings::self()
{
  if (!s_globalKonsoleSettings()->q) {
    new KonsoleSettings;
    s_globalKonsoleSettings()->q->read();
  }

  return s_globalKonsoleSettings()->q;
}

KonsoleSettings::KonsoleSettings( )
  : KConfigSkeleton( QStringLiteral( "konsolerc" ) )
{
  Q_ASSERT(!s_globalKonsoleSettings()->q);
  s_globalKonsoleSettings()->q = this;
  setCurrentGroup( QStringLiteral( "KonsoleWindow" ) );

  mRemoveWindowTitleBarAndFrameItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RemoveWindowTitleBarAndFrame" ), mRemoveWindowTitleBarAndFrame, false );
  mRemoveWindowTitleBarAndFrameItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Remove window titlebar and frame") );
  addItem( mRemoveWindowTitleBarAndFrameItem, QStringLiteral( "RemoveWindowTitleBarAndFrame" ) );
  mFocusFollowsMouseItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FocusFollowsMouse" ), mFocusFollowsMouse, false );
  mFocusFollowsMouseItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Focus terminals when the mouse pointer is moved over them") );
  addItem( mFocusFollowsMouseItem, QStringLiteral( "FocusFollowsMouse" ) );
  mShowWindowTitleOnTitleBarItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowWindowTitleOnTitleBar" ), mShowWindowTitleOnTitleBar, false );
  mShowWindowTitleOnTitleBarItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Show window title on the titlebar") );
  mShowWindowTitleOnTitleBarItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Show window title set by escape sequence on the titlebar") );
  addItem( mShowWindowTitleOnTitleBarItem, QStringLiteral( "ShowWindowTitleOnTitleBar" ) );
  mAllowMenuAcceleratorsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AllowMenuAccelerators" ), mAllowMenuAccelerators, false );
  mAllowMenuAcceleratorsItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Enable menu accelerators") );
  mAllowMenuAcceleratorsItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Allow users to access top menu through Alt+Key combination") );
  addItem( mAllowMenuAcceleratorsItem, QStringLiteral( "AllowMenuAccelerators" ) );
  mRememberWindowSizeItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "RememberWindowSize" ), mRememberWindowSize, true );
  mRememberWindowSizeItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Use current window size on next startup") );
  mRememberWindowSizeItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "The window size will be saved upon exiting Konsole") );
  addItem( mRememberWindowSizeItem, QStringLiteral( "RememberWindowSize" ) );
  mUseSingleInstanceItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "UseSingleInstance" ), mUseSingleInstance, false );
  mUseSingleInstanceItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Run all Konsole windows in a single process") );
  mUseSingleInstanceItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "When launching Konsole re-use existing process if possible") );
  addItem( mUseSingleInstanceItem, QStringLiteral( "UseSingleInstance" ) );

  setCurrentGroup( QStringLiteral( "ThumbnailsSettings" ) );

  mEnableThumbnailsItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "EnableThumbnails" ), mEnableThumbnails, true );
  mEnableThumbnailsItem->setLabel( QCoreApplication::translate("KonsoleSettings", "EnableThumbnails") );
  addItem( mEnableThumbnailsItem, QStringLiteral( "EnableThumbnails" ) );
  mThumbnailSizeItem = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ThumbnailSize" ), mThumbnailSize, 250 );
  mThumbnailSizeItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Thumbnail Width") );
  mThumbnailSizeItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Sets the width of the thumbnail") );
  addItem( mThumbnailSizeItem, QStringLiteral( "ThumbnailSize" ) );
  mThumbnailShiftItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ThumbnailShift" ), mThumbnailShift, false );
  mThumbnailShiftItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Use Shift to display a thumbnail") );
  mThumbnailShiftItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Use Shift to display a thumbnail") );
  addItem( mThumbnailShiftItem, QStringLiteral( "ThumbnailShift" ) );
  mThumbnailAltItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ThumbnailAlt" ), mThumbnailAlt, false );
  mThumbnailAltItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Use Alt to display a thumbnail") );
  mThumbnailAltItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Use Alt to display a thumbnail") );
  addItem( mThumbnailAltItem, QStringLiteral( "ThumbnailAlt" ) );
  mThumbnailCtrlItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ThumbnailCtrl" ), mThumbnailCtrl, false );
  mThumbnailCtrlItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Use Ctrl to display a thumbnail") );
  mThumbnailCtrlItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Use Ctrl to display a thumbnail") );
  addItem( mThumbnailCtrlItem, QStringLiteral( "ThumbnailCtrl" ) );

  setCurrentGroup( QStringLiteral( "SearchSettings" ) );

  mSearchCaseSensitiveItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SearchCaseSensitive" ), mSearchCaseSensitive, false );
  mSearchCaseSensitiveItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Search is case sensitive") );
  mSearchCaseSensitiveItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Sets whether the search is case sensitive") );
  addItem( mSearchCaseSensitiveItem, QStringLiteral( "SearchCaseSensitive" ) );
  mSearchRegExpressionItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SearchRegExpression" ), mSearchRegExpression, false );
  mSearchRegExpressionItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Match using regular expressions") );
  addItem( mSearchRegExpressionItem, QStringLiteral( "SearchRegExpression" ) );
  mSearchHighlightMatchesItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SearchHighlightMatches" ), mSearchHighlightMatches, true );
  mSearchHighlightMatchesItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Highlight all search matches") );
  mSearchHighlightMatchesItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Sets whether matching text should be highlighted") );
  addItem( mSearchHighlightMatchesItem, QStringLiteral( "SearchHighlightMatches" ) );
  mSearchReverseSearchItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "SearchReverseSearch" ), mSearchReverseSearch, true );
  mSearchReverseSearchItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Search backwards") );
  mSearchReverseSearchItem->setToolTip( QCoreApplication::translate("KonsoleSettings", "Sets whether search should start from the bottom") );
  addItem( mSearchReverseSearchItem, QStringLiteral( "SearchReverseSearch" ) );

  setCurrentGroup( QStringLiteral( "SplitView" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesSplitViewVisibility;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("AlwaysShowSplitHeader");
    valuesSplitViewVisibility.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ShowSplitHeaderWhenNeeded");
    valuesSplitViewVisibility.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("AlwaysHideSplitHeader");
    valuesSplitViewVisibility.append( choice );
  }
  mSplitViewVisibilityItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "SplitViewVisibility" ), mSplitViewVisibility, valuesSplitViewVisibility, ShowTabBarWhenNeeded );
  mSplitViewVisibilityItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control the visibility of the whole tab bar") );
  addItem( mSplitViewVisibilityItem, QStringLiteral( "SplitViewVisibility" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesSplitDragHandleSize;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SplitDragHandleSmall");
    valuesSplitDragHandleSize.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SplitDragHandleMedium");
    valuesSplitDragHandleSize.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("SplitDragHandleLarge");
    valuesSplitDragHandleSize.append( choice );
  }
  mSplitDragHandleSizeItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "SplitDragHandleSize" ), mSplitDragHandleSize, valuesSplitDragHandleSize, SplitDragHandleSmall );
  mSplitDragHandleSizeItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control the size of the handle between panels") );
  addItem( mSplitDragHandleSizeItem, QStringLiteral( "SplitDragHandleSize" ) );

  setCurrentGroup( QStringLiteral( "TabBar" ) );

  QList<KConfigSkeleton::ItemEnum::Choice> valuesTabBarVisibility;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("AlwaysShowTabBar");
    valuesTabBarVisibility.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("ShowTabBarWhenNeeded");
    valuesTabBarVisibility.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("AlwaysHideTabBar");
    valuesTabBarVisibility.append( choice );
  }
  mTabBarVisibilityItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "TabBarVisibility" ), mTabBarVisibility, valuesTabBarVisibility, ShowTabBarWhenNeeded );
  mTabBarVisibilityItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control the visibility of the whole tab bar") );
  addItem( mTabBarVisibilityItem, QStringLiteral( "TabBarVisibility" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesTabBarPosition;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Top");
    valuesTabBarPosition.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("Bottom");
    valuesTabBarPosition.append( choice );
  }
  mTabBarPositionItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "TabBarPosition" ), mTabBarPosition, valuesTabBarPosition, Bottom );
  mTabBarPositionItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control the position of the tab bar") );
  addItem( mTabBarPositionItem, QStringLiteral( "TabBarPosition" ) );
  mTabBarStyleSheetItem = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "TabBarStyleSheet" ), mTabBarStyleSheet, QStringLiteral( "QTabBar::tab { min-width: 2em ; max-width: 25em }" ) );
  mTabBarStyleSheetItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control the visual style of the tab bar") );
  addItem( mTabBarStyleSheetItem, QStringLiteral( "TabBarStyleSheet" ) );
  mTabBarUseUserStyleSheetItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TabBarUseUserStyleSheet" ), mTabBarUseUserStyleSheet, false );
  mTabBarUseUserStyleSheetItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Use a user-defined .css file for the tab bar") );
  addItem( mTabBarUseUserStyleSheetItem, QStringLiteral( "TabBarUseUserStyleSheet" ) );
  mTabBarUserStyleSheetFileItem = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "TabBarUserStyleSheetFile" ), mTabBarUserStyleSheetFile );
  mTabBarUserStyleSheetFileItem->setLabel( QCoreApplication::translate("KonsoleSettings", "The .css file to use for the tab bar style") );
  addItem( mTabBarUserStyleSheetFileItem, QStringLiteral( "TabBarUserStyleSheetFile" ) );
  mCloseTabOnMiddleMouseButtonItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "CloseTabOnMiddleMouseButton" ), mCloseTabOnMiddleMouseButton, false );
  mCloseTabOnMiddleMouseButtonItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Allow middle-clicking on open tabs to close them") );
  addItem( mCloseTabOnMiddleMouseButtonItem, QStringLiteral( "CloseTabOnMiddleMouseButton" ) );
  mNewTabButtonItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "NewTabButton" ), mNewTabButton, false );
  mNewTabButtonItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control the visibility of 'New Tab' button on the tab bar") );
  addItem( mNewTabButtonItem, QStringLiteral( "NewTabButton" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesCloseTabButton;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("OnEachTab");
    valuesCloseTabButton.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("OnTabBar");
    valuesCloseTabButton.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("None");
    valuesCloseTabButton.append( choice );
  }
  mCloseTabButtonItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "CloseTabButton" ), mCloseTabButton, valuesCloseTabButton, OnEachTab );
  mCloseTabButtonItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control where the \"Close tab\" button will be displayed") );
  addItem( mCloseTabButtonItem, QStringLiteral( "CloseTabButton" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesNewTabBehavior;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PutNewTabAtTheEnd");
    valuesNewTabBehavior.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("PutNewTabAfterCurrentTab");
    valuesNewTabBehavior.append( choice );
  }
  mNewTabBehaviorItem = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "NewTabBehavior" ), mNewTabBehavior, valuesNewTabBehavior, PutNewTabAtTheEnd );
  mNewTabBehaviorItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Control where to put the new tab") );
  addItem( mNewTabBehaviorItem, QStringLiteral( "NewTabBehavior" ) );
  mExpandTabWidthItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ExpandTabWidth" ), mExpandTabWidth, false );
  mExpandTabWidthItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Expand the tab widths") );
  addItem( mExpandTabWidthItem, QStringLiteral( "ExpandTabWidth" ) );

  setCurrentGroup( QStringLiteral( "PrintOptions" ) );

  mPrinterFriendlyItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "PrinterFriendly" ), mPrinterFriendly, true );
  mPrinterFriendlyItem->setLabel( QCoreApplication::translate("KonsoleSettings", "Printer &friendly mode (black text, no background)") );
  addItem( mPrinterFriendlyItem, QStringLiteral( "PrinterFriendly" ) );
  mScaleOutputItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ScaleOutput" ), mScaleOutput, true );
  mScaleOutputItem->setLabel( QCoreApplication::translate("KonsoleSettings", "&Scale output") );
  addItem( mScaleOutputItem, QStringLiteral( "ScaleOutput" ) );

  setCurrentGroup( QStringLiteral( "FileLocation" ) );

  mScrollbackUseSystemLocationItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "scrollbackUseSystemLocation" ), mScrollbackUseSystemLocation, true );
  mScrollbackUseSystemLocationItem->setLabel( QCoreApplication::translate("KonsoleSettings", "For scrollback files, use system-wide folder location") );
  addItem( mScrollbackUseSystemLocationItem, QStringLiteral( "scrollbackUseSystemLocation" ) );
  mScrollbackUseCacheLocationItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "scrollbackUseCacheLocation" ), mScrollbackUseCacheLocation, false );
  mScrollbackUseCacheLocationItem->setLabel( QCoreApplication::translate("KonsoleSettings", "For scrollback files, use user's specific folder location") );
  addItem( mScrollbackUseCacheLocationItem, QStringLiteral( "scrollbackUseCacheLocation" ) );
  mScrollbackUseSpecifiedLocationItem = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "scrollbackUseSpecifiedLocation" ), mScrollbackUseSpecifiedLocation, false );
  mScrollbackUseSpecifiedLocationItem->setLabel( QCoreApplication::translate("KonsoleSettings", "For scrollback files, use specified folder location") );
  addItem( mScrollbackUseSpecifiedLocationItem, QStringLiteral( "scrollbackUseSpecifiedLocation" ) );
  mScrollbackUseSpecifiedLocationDirectoryItem = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "scrollbackUseSpecifiedLocationDirectory" ), mScrollbackUseSpecifiedLocationDirectory );
  mScrollbackUseSpecifiedLocationDirectoryItem->setLabel( QCoreApplication::translate("KonsoleSettings", "For scrollback files, use this folder") );
  addItem( mScrollbackUseSpecifiedLocationDirectoryItem, QStringLiteral( "scrollbackUseSpecifiedLocationDirectory" ) );
}

KonsoleSettings::~KonsoleSettings()
{
  if (s_globalKonsoleSettings.exists() && !s_globalKonsoleSettings.isDestroyed()) {
    s_globalKonsoleSettings()->q = nullptr;
  }
}

