⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kglookfeel.cpp

📁 LINUX 下, 以 QT/KDE 写的档案管理员
💻 CPP
📖 第 1 页 / 共 2 页
字号:
/***************************************************************************                        kglookfeel.cpp  -  description                             -------------------    copyright            : (C) 2003 by Csaba Karai    e-mail               : krusader@users.sourceforge.net    web site             : http://krusader.sourceforge.net ---------------------------------------------------------------------------  Description ***************************************************************************  A     db   dD d8888b. db    db .d8888.  .d8b.  d8888b. d88888b d8888b.     88 ,8P' 88  `8D 88    88 88'  YP d8' `8b 88  `8D 88'     88  `8D     88,8P   88oobY' 88    88 `8bo.   88ooo88 88   88 88ooooo 88oobY'     88`8b   88`8b   88    88   `Y8b. 88~~~88 88   88 88~~~~~ 88`8b     88 `88. 88 `88. 88b  d88 db   8D 88   88 88  .8D 88.     88 `88.     YP   YD 88   YD ~Y8888P' `8888Y' YP   YP Y8888D' Y88888P 88   YD                                                     S o u r c e    F i l e *************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include "kglookfeel.h"#include "../krusader.h"#include "../defaults.h"#include "../Dialogs/krdialogs.h"#include <qtabwidget.h>#include <klocale.h>#include <qwhatsthis.h>#include <qvalidator.h>#include <qlistview.h>#include <kmessagebox.h>#include <kfiledialog.h>#include <kglobal.h>#include <kstandarddirs.h>#include "../Panel/krselectionmode.h"#include "../Panel/listpanel.h"#define PAGE_OPERATION     0#define PAGE_PANEL         1#define PAGE_PANELTOOLBAR  2#define PAGE_MOUSE  3KgLookFeel::KgLookFeel( bool first, QWidget* parent,  const char* name ) :      KonfiguratorPage( first, parent, name ){  QGridLayout *kgLookAndFeelLayout = new QGridLayout( parent );  kgLookAndFeelLayout->setSpacing( 6 );  tabWidget = new QTabWidget( parent, "tabWidget" );  setupOperationTab();  setupPanelTab();  setupPanelToolbarTab();  setupMouseModeTab();  kgLookAndFeelLayout->addWidget( tabWidget, 0, 0 );}// ---------------------------------------------------------------------------------------//  ---------------------------- OPERATION TAB -------------------------------------// ---------------------------------------------------------------------------------------void KgLookFeel::setupOperationTab() {  QWidget *tab = new QWidget( tabWidget, "tab_operation" );  tabWidget->insertTab( tab, i18n( "Operation" ) );  QGridLayout *lookAndFeelLayout = new QGridLayout( tab );  lookAndFeelLayout->setSpacing( 6 );  lookAndFeelLayout->setMargin( 11 );  // -------------- General -----------------  QGroupBox *lookFeelGrp = createFrame( i18n( "Look && Feel" ), tab, "kgLookAndFeelGrp" );  QGridLayout *lookFeelGrid = createGridLayout( lookFeelGrp->layout() );  KONFIGURATOR_CHECKBOX_PARAM settings[] =    { //   cfg_class  cfg_name                default             text                              restart tooltip     {"Look&Feel","Warn On Exit",         _WarnOnExit,        i18n( "Warn on exit" ),           false,  i18n( "Display a warning when trying to close the main window." ) }, // KDE4: move warn on exit to the other confirmations     {"Look&Feel","Minimize To Tray",     _MinimizeToTray,    i18n( "Minimize to tray" ),       false,  i18n( "The icon will appear in the system tray instead of the taskbar, when Krusader is minimized." ) },     {"Look&Feel","Mark Dirs",            _MarkDirs,          i18n( "Autoselect directories" ),   false,  i18n( "When matching the select criteria, not only files will be selected, but also directories." ) },     {"Look&Feel","Rename Selects Extension",true,          i18n( "Rename selects extension" ),   false,  i18n( "When renaming a file, the whole text is selected. If you want Total-Commander like renaming of just the name, without extension, uncheck this option." ) },     {"Look&Feel","Fullpath Tab Names",   _FullPathTabNames,  i18n( "Use full path tab names" ), true ,  i18n( "Display the full path in the folder tabs. By default only the last part of the path is displayed." ) },     {"Look&Feel","Fullscreen Terminal Emulator", false, i18n( "Fullscreen terminal (mc-style)"  ), false,  i18n( "Terminal is shown instead of the Krusader window (full screen).") },    };  cbs = createCheckBoxGroup( 2, 0, settings, 6 /*count*/, lookFeelGrp, 0, PAGE_OPERATION );  lookFeelGrid->addWidget( cbs, 0, 0 );  lookAndFeelLayout->addWidget( lookFeelGrp, 0, 0 );  // -------------- Quicksearch -----------------  QGroupBox *quicksearchGroup = createFrame( i18n( "Quicksearch" ), tab, "kgQuicksearchGrp" );  QGridLayout *quicksearchGrid = createGridLayout( quicksearchGroup->layout() );  KONFIGURATOR_CHECKBOX_PARAM quicksearch[] =   { //   cfg_class  cfg_name                default             text                              restart tooltip     {"Look&Feel","New Style Quicksearch",  _NewStyleQuicksearch, i18n( "New style quicksearch" ), false,  i18n( "Opens a quick search dialog box." ) },     {"Look&Feel","Case Sensitive Quicksearch",  _CaseSensitiveQuicksearch, i18n( "Case sensitive quicksearch" ), false,  i18n( "All files beginning with capital letters appear before files beginning with non-capital letters (UNIX default)." ) },    };  quicksearchCheckboxes = createCheckBoxGroup( 2, 0, quicksearch, 2 /*count*/, quicksearchGroup, 0, PAGE_OPERATION );  quicksearchGrid->addWidget( quicksearchCheckboxes, 0, 0 );  connect( quicksearchCheckboxes->find( "New Style Quicksearch" ), SIGNAL( stateChanged( int ) ), this, SLOT( slotDisable() ) );  slotDisable();  lookAndFeelLayout->addWidget( quicksearchGroup, 1, 0 );}// ----------------------------------------------------------------------------------//  ---------------------------- PANEL TAB -------------------------------------// ----------------------------------------------------------------------------------void KgLookFeel::setupPanelTab() {  QWidget* tab_panel = new QWidget( tabWidget, "tab_panel" );  tabWidget->insertTab( tab_panel, i18n( "Panel" ) );  QGridLayout *panelLayout = new QGridLayout( tab_panel );  panelLayout->setSpacing( 6 );  panelLayout->setMargin( 11 );  QGroupBox *panelGrp = createFrame( i18n( "Panel settings" ), tab_panel, "kgPanelGrp" );  QGridLayout *panelGrid = createGridLayout( panelGrp->layout() );  QHBox *hbox = new QHBox( panelGrp, "lookAndFeelHBox1" );  new QLabel( i18n( "Panel font:" ), hbox, "lookAndFeelLabel" );  createFontChooser( "Look&Feel", "Filelist Font", _FilelistFont, hbox, true, PAGE_PANEL );  createSpacer ( hbox );  panelGrid->addWidget( hbox, 0, 0 );  QHBox *hbox2 = new QHBox( panelGrp, "lookAndFeelHBox2" );  QLabel *lbl1 = new QLabel( i18n( "Filelist icon size:" ), hbox2, "lookAndFeelLabel2" );  lbl1->setMinimumWidth( 230 );  KONFIGURATOR_NAME_VALUE_PAIR iconSizes[] =    {{ i18n( "16" ),  "16" },     { i18n( "22" ),  "22" },     { i18n( "32" ),  "32" },     { i18n( "48" ),  "48" }};  KonfiguratorComboBox *iconCombo = createComboBox( "Look&Feel", "Filelist Icon Size", _FilelistIconSize, iconSizes, 4, hbox2, true, true, PAGE_PANEL );  iconCombo->lineEdit()->setValidator( new QRegExpValidator( QRegExp( "[1-9]\\d{0,1}" ), iconCombo ) );  createSpacer ( hbox2 );  panelGrid->addWidget( hbox2, 1, 0 );  panelGrid->addWidget( createLine( panelGrp, "lookSep3" ), 2, 0 );  KONFIGURATOR_CHECKBOX_PARAM panelSettings[] =  //   cfg_class  cfg_name                default text                                  restart tooltip    {	 {"Look&Feel","With Icons",           _WithIcons,   i18n( "Use icons in the filenames" ), true ,  i18n( "Show the icons for filenames and folders." ) },	 {"Look&Feel","Human Readable Size",  _HumanReadableSize, i18n( "Use human-readable file size" ), true ,  i18n( "File sizes are displayed in B, KB, MB and GB, not just in bytes." ) },	 {"Look&Feel","Show Hidden",          _ShowHidden,        i18n( "Show hidden files" ),      false,  i18n( "Display files beginning with a dot." ) },	 {"Look&Feel","Case Sensative Sort",  _CaseSensativeSort, i18n( "Case sensitive sorting" ), true ,  i18n( "All files beginning with capital letters appear before files beginning with non-capital letters (UNIX default)." ) },	 {"Look&Feel","Always sort dirs by name",  false, i18n( "Always sort dirs by name"  ), true,  i18n( "Directories are sorted by name, regardless of the sort column.") },	 {"Look&Feel","Numeric permissions",  _NumericPermissions, i18n( "Numeric Permissions"  ), true,  i18n( "Show octal numbers (0755) instead of the standard permissions (rwxr-xr-x) in the permission column.") },    };  KonfiguratorCheckBoxGroup *panelSett = createCheckBoxGroup( 2, 0, panelSettings, 6 /*count*/, panelGrp, 0, PAGE_PANEL );    panelGrid->addWidget( panelSett, 3, 0 );  // ----------------------------------------------------------------------------------//  ---------------------------- DEFAULT PANEL TYPE -------------------------------------// ----------------------------------------------------------------------------------    panelGrid->addWidget( createLine( panelGrp, "lookSep4" ), 4, 0 );    QHBox *hbox3 = new QHBox( panelGrp, "lookAndFeelHBox3" );  QLabel *lbl2 = new QLabel( i18n( "Default panel type:" ), hbox3, "lookAndFeelLabel3" );  KONFIGURATOR_NAME_VALUE_PAIR panelTypes[] =    {{ i18n( "Detailed" ),  "Detailed" },     { i18n( "Brief" ),     "Brief" }};  KonfiguratorComboBox *panelCombo = createComboBox( "Look&Feel", "Default Panel Type", _DefaultPanelType, panelTypes, 2, hbox3, false, false, PAGE_PANEL );  createSpacer ( hbox3 );  panelGrid->addWidget( hbox3, 5, 0 );    panelLayout->addWidget( panelGrp, 0, 0 );}// -----------------------------------------------------------------------------------//  -------------------------- Panel Toolbar TAB ----------------------------------// -----------------------------------------------------------------------------------void KgLookFeel::setupPanelToolbarTab() {  QWidget     *tab_4 = new QWidget( tabWidget, "tab_4" );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -