summaryrefslogtreecommitdiffstats
path: root/krusader/Konfigurator/kgadvanced.cpp
blob: cccc85fa2d2fa10442326f99d5b7d68a84c61378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/***************************************************************************
                         kgadvanced.cpp  -  description
                             -------------------
    copyright            : (C) 2004 + 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 "kgadvanced.h"
#include "../defaults.h"
#include <klocale.h>
#include <tqhbox.h>
#include <tqwhatsthis.h>
#include <sys/param.h>
#include <tdeversion.h>
#include <kprotocolinfo.h>

KgAdvanced::KgAdvanced( bool first, TQWidget* parent,  const char* name ) :
      KonfiguratorPage( first, parent, name )
{
  TQGridLayout *kgAdvancedLayout = new TQGridLayout( parent );
  kgAdvancedLayout->setSpacing( 6 );

  //  -------------------------- GENERAL GROUPBOX ----------------------------------
  
  TQGroupBox *generalGrp = createFrame( i18n( "General" ), parent, "kgAdvGeneralGrp" );
  TQGridLayout *generalGrid = createGridLayout( generalGrp->layout() );

#if KDE_IS_VERSION( 3,5,1 )
  bool dontUseMedia = false;
#else
  bool dontUseMedia = true;
#endif

  bool isMediaProtocolPresent = KProtocolInfo::isKnownProtocol( TQString( "media" ) );
  if( !isMediaProtocolPresent )
    dontUseMedia = true;

  KONFIGURATOR_CHECKBOX_PARAM generalSettings[] =
  //   cfg_class  cfg_name             default              text                                                        restart tooltip
    {{"Advanced","PreserveAttributes", _PreserveAttributes, i18n( "Preserve attributes for local copy/move (slower)" ), false,  i18n( "Krusader will try to preserve all attributes (time, owner, group) of the local files according to the source depending on your permissions:<ul><li>User preserving if you are root</li><li>Group preserving if you are root or member of the group</li><li>Preserving the timestamp</li></ul><b>Note</b>: This can slow down the copy process." ) },
     {"Advanced","AutoMount",          _AutoMount,          i18n( "Automount filesystems" ),                            false,  i18n( "When stepping into a directory which is defined as a mount point in the <b>fstab</b>, try mounting it with the defined parameters." )},
     {"Advanced","DontUseMediaProt",   dontUseMedia,        i18n( "Don't use KDE's media protocol for media button (if it's buggy or missing)" ),  false,  i18n( "Select if your media protocol is buggy (in some older KDE versions), or not present (no tdebase package installed)." )}};

  KonfiguratorCheckBoxGroup *generals = createCheckBoxGroup( 1, 0, generalSettings, 3, generalGrp );

  if( !isMediaProtocolPresent )
    generals->find( "DontUseMediaProt" )->setEnabled( false );

  generalGrid->addWidget( generals, 1, 0 );

  addLabel( generalGrid, 2, 0, i18n( "MountMan won't (un)mount the following mount-points:" ),
            generalGrp, "KgAdvLabel2" );
  KonfiguratorEditBox *nonMountPoints = createEditBox( "Advanced", "Nonmount Points", _NonMountPoints, generalGrp, false );
  generalGrid->addWidget( nonMountPoints, 2, 1 );
 
  
#ifdef BSD
  generals->find( "AutoMount" )->setEnabled( false ); /* disable AutoMount on BSD */
#endif
    
  kgAdvancedLayout->addWidget( generalGrp, 0 ,0 );

  //  ----------------------- CONFIRMATIONS GROUPBOX -------------------------------
  
  TQGroupBox *confirmGrp = createFrame( i18n( "Confirmations" ), parent, "confirmGrp" );
  TQGridLayout *confirmGrid = createGridLayout( confirmGrp->layout() );

  addLabel( confirmGrid, 0, 0, "\n"+i18n( "Request user confirmation for the following operations:" )+"\n",
            confirmGrp, "KgAdvLabel1" );

  KONFIGURATOR_CHECKBOX_PARAM confirmations[] =
  //   cfg_class  cfg_name                default             text                                          restart ToolTip
    {{"Advanced","Confirm Unempty Dir",   _ConfirmUnemptyDir, i18n( "Deleting non-empty directories" ),   false,  ""},
     {"Advanced","Confirm Delete",        _ConfirmDelete,     i18n( "Deleting files" ),                   false,  ""},
     {"Advanced","Confirm Copy",          _ConfirmCopy,       i18n( "Copying files" ),                    false,  ""},
     {"Advanced","Confirm Move",          _ConfirmMove,       i18n( "Moving files" ),                     false,  ""},
     {"Advanced","Confirm Feed to Listbox",  _ConfirmFeedToListbox, i18n( "Confirm feed to listbox" ), false, i18n("Ask for a result name when feeding items to the listbox. By default the standard value is used.")},
     {"Notification Messages","Confirm Remove UserAction", true, i18n( "Removing Useractions" ), false,  ""}};

  KonfiguratorCheckBoxGroup *confWnd = createCheckBoxGroup( 2, 0, confirmations, 6, confirmGrp );

  confirmGrid->addWidget( confWnd, 1, 0 );

  kgAdvancedLayout->addWidget( confirmGrp, 1 ,0 );


  //  ------------------------ FINE-TUNING GROUPBOX --------------------------------

  TQGroupBox *fineTuneGrp = createFrame( i18n( "Fine-Tuning" ), parent, "kgFineTuneGrp" );
  TQGridLayout *fineTuneGrid = createGridLayout( fineTuneGrp->layout() );
  fineTuneGrid->setAlignment( TQt::AlignLeft | TQt::AlignTop );
  
  TQLabel *label = new TQLabel( i18n( "Icon cache size (KB):" ), fineTuneGrp, "iconCacheLabel" );
  TQWhatsThis::add( label, i18n( "The icon cache size influences how fast the contents of a panel can be displayed. However, too large a cache might consume your memory." ) );
  fineTuneGrid->addWidget( label, 0, 0 );
  KonfiguratorSpinBox *spinBox = createSpinBox( "Advanced", "Icon Cache Size", _IconCacheSize,
                                                1, 8192, fineTuneGrp, false );
  TQWhatsThis::add( spinBox, i18n( "The icon cache size influences how fast the contents of a panel can be displayed. However, too large a cache might consume your memory." ) );
  spinBox->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed);
  fineTuneGrid->addWidget( spinBox, 0, 1 );

  addLabel( fineTuneGrid, 1, 0, i18n( "Arguments of updatedb:" ),
            fineTuneGrp, "KgAdvLabel1" );
  KonfiguratorEditBox *updatedbArgs = createEditBox( "Locate", "UpdateDB Arguments", "", fineTuneGrp, false );
  fineTuneGrid->addWidget( updatedbArgs, 1, 1 );
    
  kgAdvancedLayout->addWidget( fineTuneGrp, 2 ,0 );
}

#include "kgadvanced.moc"