@ -8,17 +8,17 @@
*/
# include < qbuttongroup.h>
# include < qcheckbox.h>
# include < qcombobox.h>
# include < qlabel.h>
# include < qlayout.h>
# include < qlineedit.h>
# include < qslider.h>
# include < qvbox.h>
# include < qhgroupbox.h>
# include < qvgroupbox.h>
# include < qspinbox.h>
# include < t qbuttongroup.h>
# include < t qcheckbox.h>
# include < t qcombobox.h>
# include < t qlabel.h>
# include < t qlayout.h>
# include < t qlineedit.h>
# include < t qslider.h>
# include < t qvbox.h>
# include < t qhgroupbox.h>
# include < t qvgroupbox.h>
# include < t qspinbox.h>
# include <kcolorbutton.h>
# include <klocale.h>
@ -37,31 +37,31 @@ KSettingsDialog::KSettingsDialog( KDirStatApp *mainWin )
i18n ( " Settings " ) , // caption
Ok | Apply | Default | Cancel | Help , // buttonMask
Ok , // defaultButton
0 , // parent
0 , // tq parent
0 , // name
false ) // modal
, _mainWin ( mainWin )
{
/**
* This may seem like overkill , but I didn ' t find any other way to get
* geometry management right with KDialogBase , yet maintain a modular and
* tq geometry management right with KDialogBase , yet maintain a modular and
* object - oriented design :
*
* Each individual settings page is added with ' addVBoxPage ( ) ' to get some
* initial geometry management . Only then can some generic widget be added
* initial tq geometry management . Only then can some generic widget be added
* into this - and I WANT my settings pages to be generic widgets . I want
* them to be self - sufficient - no monolithic mess of widget creation in my
* code , intermixed with all kinds of layout objects .
* code , intermixed with all kinds of tq layout objects .
*
* The ordinary KDialogBase : : addPage ( ) just creates a QFrame which is too
* dumb for any kind of geometry management - it cannot even handle one
* The ordinary KDialogBase : : addPage ( ) just creates a T QFrame which is too
* dumb for any kind of tq geometry management - it cannot even handle one
* single child right . So , let ' s have KDialogBase create something more
* intelligent : A QVBox ( which is derived from QFrame anyway ) . This QVBox
* intelligent : A T QVBox ( which is derived from T QFrame anyway ) . This T QVBox
* gets only one child - the KSettingsPage . This KSettingsPage handles its
* own layout.
* own tq layout.
* */
QWidget * page ;
T QWidget * page ;
page = addVBoxPage ( i18n ( " &Cleanups " ) ) ;
_cleanupsPageIndex = pageIndex ( page ) ;
@ -79,7 +79,7 @@ KSettingsDialog::KSettingsDialog( KDirStatApp *mainWin )
_generalSettingsPageIndex = pageIndex ( page ) ;
new KGeneralSettingsPage ( this , page , _mainWin ) ;
// resize( sizeHint() );
// resize( tq sizeHint() );
}
@ -116,7 +116,7 @@ KSettingsDialog::slotDefault()
void
KSettingsDialog : : slotHelp ( )
{
QString helpTopic = " " ;
T QString helpTopic = " " ;
if ( activePageIndex ( ) = = _cleanupsPageIndex ) helpTopic = " configuring_cleanups " ;
else if ( activePageIndex ( ) = = _treeColorsPageIndex ) helpTopic = " tree_colors " ;
@ -132,20 +132,20 @@ KSettingsDialog::slotHelp()
KSettingsPage : : KSettingsPage ( KSettingsDialog * dialog ,
QWidget * parent )
: QWidget( parent )
T QWidget * tq parent )
: T QWidget( tq parent )
{
connect ( dialog , SIGNAL( aboutToShow ( void ) ) ,
this , SLOT ( setup ( void ) ) ) ;
connect ( dialog , TQT_ SIGNAL( aboutToShow ( void ) ) ,
this , TQT_ SLOT ( setup ( void ) ) ) ;
connect ( dialog , SIGNAL( okClicked ( void ) ) ,
this , SLOT ( apply ( void ) ) ) ;
connect ( dialog , TQT_ SIGNAL( okClicked ( void ) ) ,
this , TQT_ SLOT ( apply ( void ) ) ) ;
connect ( dialog , SIGNAL( applyClicked ( void ) ) ,
this , SLOT ( apply ( void ) ) ) ;
connect ( dialog , TQT_ SIGNAL( applyClicked ( void ) ) ,
this , TQT_ SLOT ( apply ( void ) ) ) ;
connect ( dialog , SIGNAL( defaultClicked ( void ) ) ,
this , SLOT ( revertToDefaults ( void ) ) ) ;
connect ( dialog , TQT_ SIGNAL( defaultClicked ( void ) ) ,
this , TQT_ SLOT ( revertToDefaults ( void ) ) ) ;
}
@ -159,23 +159,23 @@ KSettingsPage::~KSettingsPage()
KTreeColorsPage : : KTreeColorsPage ( KSettingsDialog * dialog ,
QWidget * parent,
T QWidget * tq parent,
KDirStatApp * mainWin )
: KSettingsPage ( dialog , parent )
: KSettingsPage ( dialog , tq parent )
, _mainWin ( mainWin )
, _treeView ( mainWin - > treeView ( ) )
, _maxButtons ( KDirStatSettingsMaxColorButton )
{
// Outer layout box
// Outer tq layout box
QHBoxLayout * outerBox = new QHBoxLayout( this ,
T QHBoxLayout * outerBox = new T QHBoxLayout( this ,
0 , // border
dialog - > spacingHint ( ) ) ;
// Inner layout box with a column of color buttons
// Inner tq layout box with a column of color buttons
QGridLayout * grid = new QGridLayout( _maxButtons , // rows
T QGridLayout * grid = new T QGridLayout( _maxButtons , // rows
_maxButtons + 1 , // cols
dialog - > spacingHint ( ) ) ;
outerBox - > addLayout ( grid , 1 ) ;
@ -188,32 +188,32 @@ KTreeColorsPage::KTreeColorsPage( KSettingsDialog * dialog,
for ( int i = 0 ; i < _maxButtons ; i + + )
{
QString labelText ;
T QString labelText ;
labelText = i18n ( " Tree Level %1 " ) . arg( i + 1 ) ;
_colorLabel [ i ] = new QLabel( labelText , this ) ;
labelText = i18n ( " Tree Level %1 " ) . tq arg( i + 1 ) ;
_colorLabel [ i ] = new T QLabel( labelText , this ) ;
grid - > addWidget ( _colorLabel [ i ] , i , 0 ) ;
_colorButton [ i ] = new KColorButton ( this ) ;
_colorButton [ i ] - > setMinimumSize ( QSize( 80 , 10 ) ) ;
_colorButton [ i ] - > setMinimumSize ( T QSize( 80 , 10 ) ) ;
grid - > addMultiCellWidget ( _colorButton [ i ] , i , i , i + 1 , _maxButtons ) ;
grid - > setRowStretch ( i , 1 ) ;
}
// Vertical slider
// Qt:: Vertical slider
_slider = new QSlider( 1 , // minValue
_slider = new T QSlider( 1 , // minValue
_maxButtons , // maxValue
1 , // pageStep
1 , // value
Q Slider : : Vertical ,
Q t : : Vertical ,
this ) ;
outerBox - > addWidget ( _slider , 0 ) ;
outerBox - > activate ( ) ;
connect ( _slider , SIGNAL( valueChanged ( int ) ) ,
this , SLOT ( enableColors ( int ) ) ) ;
connect ( _slider , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , TQT_ SLOT ( enableColors ( int ) ) ) ;
}
@ -274,9 +274,9 @@ KTreeColorsPage::enableColors( int maxColors )
KCleanupPage : : KCleanupPage ( KSettingsDialog * dialog ,
QWidget * parent,
T QWidget * tq parent,
KDirStatApp * mainWin )
: KSettingsPage ( dialog , parent )
: KSettingsPage ( dialog , tq parent )
, _mainWin ( mainWin )
, _currentCleanup ( 0 )
{
@ -284,9 +284,9 @@ KCleanupPage::KCleanupPage( KSettingsDialog * dialog,
_workCleanupCollection = * mainWin - > cleanupCollection ( ) ;
// Create layout and widgets.
// Create tq layout and widgets.
QHBoxLayout * layout = new QHBoxLayout( this ,
T QHBoxLayout * tq layout = new T QHBoxLayout( this ,
0 , // border
dialog - > spacingHint ( ) ) ; // spacing
_listBox = new KCleanupListBox ( this ) ;
@ -298,21 +298,21 @@ KCleanupPage::KCleanupPage( KSettingsDialog * dialog,
// clicks on a different cleanup in the list, the properties page
// will display that cleanup's values.
connect ( _listBox , SIGNAL( selectCleanup ( KCleanup * ) ) ,
this , SLOT ( changeCleanup ( KCleanup * ) ) ) ;
connect ( _listBox , TQT_ SIGNAL( selectCleanup ( KCleanup * ) ) ,
this , TQT_ SLOT ( changeCleanup ( KCleanup * ) ) ) ;
// Fill list box so it can determine a reasonable startup geometry - that
// Fill list box so it can determine a reasonable startup tq geometry - that
// doesn't work if it happens only later.
setup ( ) ;
// Now that _listBox will (hopefully) have determined a reasonable
// default geometry, add the widgets to the layout.
// default tq geometry, add the widgets to the tq layout.
layout- > addWidget ( _listBox , 0 ) ;
layout- > addWidget ( _props , 1 ) ;
layout- > activate ( ) ;
tq layout- > addWidget ( _listBox , 0 ) ;
tq layout- > addWidget ( _props , 1 ) ;
tq layout- > activate ( ) ;
}
@ -370,7 +370,7 @@ KCleanupPage::setup()
// (Re-) Initialize list box.
// _listBox->resize( _listBox-> sizeHint() );
// _listBox->resize( _listBox-> tq sizeHint() );
_listBox - > setSelected ( 0 , true ) ;
}
@ -425,34 +425,34 @@ KCleanupPage::storeProps( KCleanup * cleanup )
/*--------------------------------------------------------------------------*/
KCleanupListBox : : KCleanupListBox ( QWidget * parent )
: QListBox( parent )
KCleanupListBox : : KCleanupListBox ( T QWidget * tq parent )
: T QListBox( tq parent )
{
_selection = 0 ;
connect ( this ,
SIGNAL( selectionChanged ( QListBoxItem * ) ) ,
SLOT ( selectCleanup ( QListBoxItem * ) ) ) ;
TQT_ SIGNAL( selectionChanged ( T QListBoxItem * ) ) ,
TQT_ SLOT ( selectCleanup ( T QListBoxItem * ) ) ) ;
}
QSize
KCleanupListBox : : sizeHint( ) const
T QSize
KCleanupListBox : : tq sizeHint( ) const
{
// FIXME: Is this still needed with Qt 2.x?
// FIXME: Is this still needed with T Qt 2.x?
if ( count ( ) < 1 )
{
// As long as the list is empty, sizeHint() would default to
// As long as the list is empty, tq sizeHint() would default to
// (0,0) which is ALWAYS just a pain in the ass. We'd rather
// have an absolutely random value than this.
return QSize( 100 , 100 ) ;
return T QSize( 100 , 100 ) ;
}
else
{
// Calculate the list contents and take 3D frames (2*2 pixels)
// into account.
return QSize ( maxItemWidth ( ) + 5 ,
return T QSize ( maxItemWidth ( ) + 5 ,
count ( ) * itemHeight ( 0 ) + 4 ) ;
}
}
@ -470,7 +470,7 @@ KCleanupListBox::insert( KCleanup * cleanup )
void
KCleanupListBox : : selectCleanup ( QListBoxItem * listBoxItem )
KCleanupListBox : : selectCleanup ( T QListBoxItem * listBoxItem )
{
KCleanupListBoxItem * item = ( KCleanupListBoxItem * ) listBoxItem ;
@ -499,7 +499,7 @@ KCleanupListBox::updateTitle( KCleanup * cleanup )
KCleanupListBoxItem : : KCleanupListBoxItem ( KCleanupListBox * listBox ,
KCleanup * cleanup )
: QListBoxText( listBox )
: T QListBoxText( listBox )
, _cleanup ( cleanup )
{
CHECK_PTR ( cleanup ) ;
@ -517,37 +517,37 @@ KCleanupListBoxItem::updateTitle()
/*--------------------------------------------------------------------------*/
KCleanupPropertiesPage : : KCleanupPropertiesPage ( QWidget * parent,
KCleanupPropertiesPage : : KCleanupPropertiesPage ( T QWidget * tq parent,
KDirStatApp * mainWin )
: QWidget( parent )
: T QWidget( tq parent )
, _mainWin ( mainWin )
{
QVBoxLayout * outerBox = new QVBoxLayout( this , 0 , 0 ) ; // border, spacing
T QVBoxLayout * outerBox = new T QVBoxLayout( this , 0 , 0 ) ; // border, spacing
// The topmost check box: "Enabled".
_enabled = new QCheckBox( i18n ( " &Enabled " ) , this ) ;
_enabled = new T QCheckBox( i18n ( " &Enabled " ) , this ) ;
outerBox - > addWidget ( _enabled , 0 ) ;
outerBox - > addSpacing ( 7 ) ;
outerBox - > addStretch ( ) ;
connect ( _enabled , SIGNAL( toggled ( bool ) ) ,
this , SLOT ( enableFields ( bool ) ) ) ;
connect ( _enabled , TQT_ SIGNAL( toggled ( bool ) ) ,
this , TQT_ SLOT ( enableFields ( bool ) ) ) ;
// All other widgets of this page are grouped together in a
// separate subwidget so they can all be enabled / disabled
// together.
_fields = new QWidget( this ) ;
_fields = new T QWidget( this ) ;
outerBox - > addWidget ( _fields , 1 ) ;
QVBoxLayout * fieldsBox = new QVBoxLayout( _fields ) ;
T QVBoxLayout * fieldsBox = new T QVBoxLayout( _fields ) ;
// Grid layout for the edit fields, their labels, some
// Grid tq layout for the edit fields, their labels, some
// explanatory text and the "recurse?" check box.
QGridLayout * grid = new QGridLayout( 7 , // rows
T QGridLayout * grid = new T QGridLayout( 7 , // rows
2 , // cols
4 ) ; // spacing
fieldsBox - > addLayout ( grid , 0 ) ;
@ -560,60 +560,60 @@ KCleanupPropertiesPage::KCleanupPropertiesPage( QWidget * parent,
// Edit fields for cleanup action title and command line.
QLabel * label ;
_title = new QLineEdit( _fields ) ; grid - > addWidget ( _title , 0 , 1 ) ;
_command = new QLineEdit( _fields ) ; grid - > addWidget ( _command , 1 , 1 ) ;
label = new QLabel( _title , i18n ( " &Title: " ) , _fields ) ; grid - > addWidget ( label , 0 , 0 ) ;
label = new QLabel( _command , i18n ( " &Command Line: " ) , _fields ) ; grid - > addWidget ( label , 1 , 0 ) ;
T QLabel * label ;
_title = new T QLineEdit( _fields ) ; grid - > addWidget ( _title , 0 , 1 ) ;
_command = new T QLineEdit( _fields ) ; grid - > addWidget ( _command , 1 , 1 ) ;
label = new T QLabel( _title , i18n ( " &Title: " ) , _fields ) ; grid - > addWidget ( label , 0 , 0 ) ;
label = new T QLabel( _command , i18n ( " &Command Line: " ) , _fields ) ; grid - > addWidget ( label , 1 , 0 ) ;
label = new QLabel( i18n ( " %p Full Path " ) , _fields ) ;
label = new T QLabel( i18n ( " %p Full Path " ) , _fields ) ;
grid - > addWidget ( label , 2 , 1 ) ;
label = new QLabel( i18n ( " %n File / Directory Name Without Path " ) , _fields ) ;
label = new T QLabel( i18n ( " %n File / Directory Name Without Path " ) , _fields ) ;
grid - > addWidget ( label , 3 , 1 ) ;
label = new QLabel( i18n ( " %t KDE Trash Directory " ) , _fields ) ;
label = new T QLabel( i18n ( " %t KDE Trash Directory " ) , _fields ) ;
grid - > addWidget ( label , 4 , 1 ) ;
// "Recurse into subdirs" check box
_recurse = new QCheckBox( i18n ( " &Recurse into Subdirectories " ) , _fields ) ;
_recurse = new T QCheckBox( i18n ( " &Recurse into Subdirectories " ) , _fields ) ;
grid - > addWidget ( _recurse , 5 , 1 ) ;
// "Ask for confirmation" check box
_askForConfirmation = new QCheckBox( i18n ( " &Ask for Confirmation " ) , _fields ) ;
_askForConfirmation = new T QCheckBox( i18n ( " &Ask for Confirmation " ) , _fields ) ;
grid - > addWidget ( _askForConfirmation , 6 , 1 ) ;
// The "Works for..." check boxes, grouped together in a button group.
QButtonGroup * worksFor = new QButtonGroup( i18n ( " Works for... " ) , _fields ) ;
QVBoxLayout * worksForBox = new QVBoxLayout( worksFor , 15 , 2 ) ;
T QButtonGroup * worksFor = new T QButtonGroup( i18n ( " Works for... " ) , _fields ) ;
T QVBoxLayout * worksForBox = new T QVBoxLayout( worksFor , 15 , 2 ) ;
fieldsBox - > addWidget ( worksFor , 0 ) ;
fieldsBox - > addSpacing ( 5 ) ;
fieldsBox - > addStretch ( ) ;
_worksForDir = new QCheckBox( i18n ( " &Directories " ) , worksFor ) ;
_worksForFile = new QCheckBox( i18n ( " &Files " ) , worksFor ) ;
_worksForDotEntry = new QCheckBox( i18n ( " <Files> P&seudo Entries " ) , worksFor ) ;
_worksForDir = new T QCheckBox( i18n ( " &Directories " ) , worksFor ) ;
_worksForFile = new T QCheckBox( i18n ( " &Files " ) , worksFor ) ;
_worksForDotEntry = new T QCheckBox( i18n ( " <Files> P&seudo Entries " ) , worksFor ) ;
worksForBox - > addWidget ( _worksForDir , 1 ) ;
worksForBox - > addWidget ( _worksForFile , 1 ) ;
worksForBox - > addWidget ( _worksForDotEntry , 1 ) ;
worksForBox - > addSpacing ( 5 ) ;
_worksForProtocols = new QComboBox( false , worksFor ) ;
_worksForProtocols = new T QComboBox( false , worksFor ) ;
worksForBox - > addWidget ( _worksForProtocols , 1 ) ;
_worksForProtocols - > insertItem ( i18n ( " On Local Machine Only ('file:/' Protocol) " ) ) ;
_worksForProtocols - > insertItem ( i18n ( " Network Transparent (ftp, smb, tar, ...) " ) ) ;
// Grid layout for combo boxes at the bottom
// Grid tq layout for combo boxes at the bottom
grid = new QGridLayout( 1 , // rows
grid = new T QGridLayout( 1 , // rows
2 , // cols
4 ) ; // spacing
@ -625,10 +625,10 @@ KCleanupPropertiesPage::KCleanupPropertiesPage( QWidget * parent,
// The "Refresh policy" combo box
_refreshPolicy = new QComboBox( false , _fields ) ;
_refreshPolicy = new T QComboBox( false , _fields ) ;
grid - > addWidget ( _refreshPolicy , row , 1 ) ;
label = new QLabel( _refreshPolicy , i18n ( " Refresh &Policy: " ) , _fields ) ;
label = new T QLabel( _refreshPolicy , i18n ( " Refresh &Policy: " ) , _fields ) ;
grid - > addWidget ( label , row + + , 0 ) ;
@ -646,7 +646,7 @@ KCleanupPropertiesPage::KCleanupPropertiesPage( QWidget * parent,
outerBox - > activate ( ) ;
setMinimumSize ( sizeHint( ) ) ;
setMinimumSize ( tq sizeHint( ) ) ;
}
@ -700,34 +700,34 @@ KCleanupPropertiesPage::fields() const
KGeneralSettingsPage : : KGeneralSettingsPage ( KSettingsDialog * dialog ,
QWidget * parent,
T QWidget * tq parent,
KDirStatApp * mainWin )
: KSettingsPage ( dialog , parent )
: KSettingsPage ( dialog , tq parent )
, _mainWin ( mainWin )
, _treeView ( mainWin - > treeView ( ) )
{
// Create layout and widgets.
// Create tq layout and widgets.
QVBoxLayout * layout = new QVBoxLayout( this , 5 , // border
T QVBoxLayout * tq layout = new T QVBoxLayout( this , 5 , // border
dialog - > spacingHint ( ) ) ; // spacing
QVGroupBox * gbox = new QVGroupBox( i18n ( " Directory Reading " ) , this ) ;
layout- > addWidget ( gbox ) ;
T QVGroupBox * gbox = new T QVGroupBox( i18n ( " Directory Reading " ) , this ) ;
tq layout- > addWidget ( gbox ) ;
_crossFileSystems = new QCheckBox( i18n ( " Cross &File System Boundaries " ) , gbox ) ;
_enableLocalDirReader = new QCheckBox( i18n ( " Use Optimized &Local Directory Read Methods " ) , gbox ) ;
_crossFileSystems = new T QCheckBox( i18n ( " Cross &File System Boundaries " ) , gbox ) ;
_enableLocalDirReader = new T QCheckBox( i18n ( " Use Optimized &Local Directory Read Methods " ) , gbox ) ;
connect ( _enableLocalDirReader , SIGNAL( stateChanged ( int ) ) ,
this , SLOT ( checkEnabledState ( ) ) ) ;
connect ( _enableLocalDirReader , TQT_ SIGNAL( stateChanged ( int ) ) ,
this , TQT_ SLOT ( checkEnabledState ( ) ) ) ;
layout- > addSpacing ( 10 ) ;
tq layout- > addSpacing ( 10 ) ;
gbox = new QVGroupBox( i18n ( " Animation " ) , this ) ;
layout- > addWidget ( gbox ) ;
gbox = new T QVGroupBox( i18n ( " Animation " ) , this ) ;
tq layout- > addWidget ( gbox ) ;
_enableToolBarAnimation = new QCheckBox( i18n ( " P@cM@n Animation in Tool &Bar " ) , gbox ) ;
_enableTreeViewAnimation = new QCheckBox( i18n ( " P@cM@n Animation in Directory &Tree " ) , gbox ) ;
_enableToolBarAnimation = new T QCheckBox( i18n ( " P@cM@n Animation in Tool &Bar " ) , gbox ) ;
_enableTreeViewAnimation = new T QCheckBox( i18n ( " P@cM@n Animation in Directory &Tree " ) , gbox ) ;
}
@ -793,95 +793,95 @@ KGeneralSettingsPage::checkEnabledState()
KTreemapPage : : KTreemapPage ( KSettingsDialog * dialog ,
QWidget * parent,
T QWidget * tq parent,
KDirStatApp * mainWin )
: KSettingsPage ( dialog , parent )
: KSettingsPage ( dialog , tq parent )
, _mainWin ( mainWin )
{
// kdDebug() << k_funcinfo << endl;
QVBoxLayout * layout = new QVBoxLayout( this , 0 , 0 ) ; // parent, border, spacing
T QVBoxLayout * tq layout = new T QVBoxLayout( this , 0 , 0 ) ; // tq parent, border, spacing
QVBox * vbox = new QVBox( this ) ;
T QVBox * vbox = new T QVBox( this ) ;
vbox - > setSpacing ( dialog - > spacingHint ( ) ) ;
layout- > addWidget ( vbox ) ;
tq layout- > addWidget ( vbox ) ;
_squarify = new QCheckBox( i18n ( " S&quarify Treemap " ) , vbox ) ;
_doCushionShading = new QCheckBox( i18n ( " Use C&ushion Shading " ) , vbox ) ;
_squarify = new T QCheckBox( i18n ( " S&quarify Treemap " ) , vbox ) ;
_doCushionShading = new T QCheckBox( i18n ( " Use C&ushion Shading " ) , vbox ) ;
// Cushion parameters
QVGroupBox * gbox = new QVGroupBox( i18n ( " Cushion Parameters " ) , vbox ) ;
T QVGroupBox * gbox = new T QVGroupBox( i18n ( " Cushion Parameters " ) , vbox ) ;
_cushionParams = gbox ;
gbox - > addSpace ( 7 ) ;
gbox - > setSizePolicy( QSizePolicy( QSizePolicy: : Expanding , QSizePolicy: : Expanding ) ) ;
gbox - > tq setSizePolicy( T QSizePolicy( T QSizePolicy: : Expanding , T QSizePolicy: : Expanding ) ) ;
QLabel * label = new QLabel( i18n ( " Ambient &Light " ) , gbox ) ;
QHBox * hbox = new QHBox( gbox ) ;
_ambientLight = new QSlider ( MinAmbientLight , MaxAmbientLight , 10 , // min, max, pageStep
DefaultAmbientLight , Horizontal , hbox ) ;
_ambientLightSB = new QSpinBox( MinAmbientLight , MaxAmbientLight , 1 , // min, max, step
T QLabel * label = new T QLabel( i18n ( " Ambient &Light " ) , gbox ) ;
T QHBox * hbox = new T QHBox( gbox ) ;
_ambientLight = new T QSlider ( MinAmbientLight , MaxAmbientLight , 10 , // min, max, pageStep
DefaultAmbientLight , Qt : : Horizontal , hbox ) ;
_ambientLightSB = new T QSpinBox( MinAmbientLight , MaxAmbientLight , 1 , // min, max, step
hbox ) ;
_ambientLightSB - > setSizePolicy( QSizePolicy( QSizePolicy: : Minimum , QSizePolicy: : Minimum ) ) ;
_ambientLightSB - > tq setSizePolicy( T QSizePolicy( T QSizePolicy: : Minimum , T QSizePolicy: : Minimum ) ) ;
label - > setBuddy ( _ambientLightSB ) ;
gbox - > addSpace ( 7 ) ;
label = new QLabel( i18n ( " &Height Scale " ) , gbox ) ;
hbox = new QHBox( gbox ) ;
_heightScalePercent = new QSlider( MinHeightScalePercent , MaxHeightScalePercent , 10 , // min, max, pageStep
DefaultHeightScalePercent , Horizontal , hbox ) ;
_heightScalePercentSB = new QSpinBox( MinHeightScalePercent , MaxHeightScalePercent , 1 , // min, max, step
label = new T QLabel( i18n ( " &Height Scale " ) , gbox ) ;
hbox = new T QHBox( gbox ) ;
_heightScalePercent = new T QSlider( MinHeightScalePercent , MaxHeightScalePercent , 10 , // min, max, pageStep
DefaultHeightScalePercent , Qt : : Horizontal , hbox ) ;
_heightScalePercentSB = new T QSpinBox( MinHeightScalePercent , MaxHeightScalePercent , 1 , // min, max, step
hbox ) ;
_heightScalePercentSB - > setSizePolicy( QSizePolicy( QSizePolicy: : Minimum , QSizePolicy: : Minimum ) ) ;
_heightScalePercentSB - > tq setSizePolicy( T QSizePolicy( T QSizePolicy: : Minimum , T QSizePolicy: : Minimum ) ) ;
label - > setBuddy ( _heightScalePercentSB ) ;
gbox - > addSpace ( 10 ) ;
_ensureContrast = new QCheckBox( i18n ( " Draw Lines if Lo&w Contrast " ) , gbox ) ;
_ensureContrast = new T QCheckBox( i18n ( " Draw Lines if Lo&w Contrast " ) , gbox ) ;
hbox = new QHBox( gbox ) ;
_forceCushionGrid = new QCheckBox( i18n ( " Always Draw &Grid " ) , hbox ) ;
hbox = new T QHBox( gbox ) ;
_forceCushionGrid = new T QCheckBox( i18n ( " Always Draw &Grid " ) , hbox ) ;
addHStretch ( hbox ) ;
_cushionGridColorL = new QLabel( " " + i18n ( " Gr&id Color: " ) , hbox ) ;
_cushionGridColorL = new T QLabel( " " + i18n ( " Gr&id Color: " ) , hbox ) ;
_cushionGridColor = new KColorButton ( hbox ) ;
_cushionGridColorL - > setBuddy ( _cushionGridColor ) ;
_cushionGridColorL - > setAlignment( AlignRight | AlignVCenter ) ;
_cushionGridColorL - > tq setAlignment( AlignRight | AlignVCenter ) ;
// addVStretch( vbox );
// Plain treemaps parameters
_plainTileParams = new QHGroupBox( i18n ( " Colors for Plain Treemaps " ) , vbox ) ;
_plainTileParams = new T QHGroupBox( i18n ( " Colors for Plain Treemaps " ) , vbox ) ;
_plainTileParams - > addSpace ( 7 ) ;
label = new QLabel( i18n ( " &Files: " ) , _plainTileParams ) ;
label = new T QLabel( i18n ( " &Files: " ) , _plainTileParams ) ;
_fileFillColor = new KColorButton ( _plainTileParams ) ;
label - > setBuddy ( _fileFillColor ) ;
label - > setAlignment( AlignRight | AlignVCenter ) ;
label - > tq setAlignment( AlignRight | AlignVCenter ) ;
label = new QLabel( " " + i18n ( " &Directories: " ) , _plainTileParams ) ;
label = new T QLabel( " " + i18n ( " &Directories: " ) , _plainTileParams ) ;
_dirFillColor = new KColorButton ( _plainTileParams ) ;
label - > setBuddy ( _dirFillColor ) ;
label - > setAlignment( AlignRight | AlignVCenter ) ;
label - > tq setAlignment( AlignRight | AlignVCenter ) ;
label = new QLabel( i18n ( " Gr&id: " ) , _plainTileParams ) ;
label = new T QLabel( i18n ( " Gr&id: " ) , _plainTileParams ) ;
_outlineColor = new KColorButton ( _plainTileParams ) ;
label - > setBuddy ( _outlineColor ) ;
label - > setAlignment( AlignRight | AlignVCenter ) ;
label - > tq setAlignment( AlignRight | AlignVCenter ) ;
// Misc
QWidget * gridBox = new QWidget( vbox ) ;
QGridLayout * grid = new QGridLayout( gridBox , 2 , 3 , dialog - > spacingHint ( ) ) ; // rows, cols, spacing
T QWidget * gridBox = new T QWidget( vbox ) ;
T QGridLayout * grid = new T QGridLayout( gridBox , 2 , 3 , dialog - > spacingHint ( ) ) ; // rows, cols, spacing
grid - > setColStretch ( 0 , 0 ) ; // (col, stretch) don't stretch this column
grid - > setColStretch ( 1 , 0 ) ; // don't stretch
grid - > setColStretch ( 2 , 1 ) ; // stretch this as you like
label = new QLabel( i18n ( " Hi&ghlight R&ectangle: " ) , gridBox ) ;
label = new T QLabel( i18n ( " Hi&ghlight R&ectangle: " ) , gridBox ) ;
_highlightColor = new KColorButton ( gridBox ) ;
label - > setBuddy ( _highlightColor ) ;
@ -889,35 +889,35 @@ KTreemapPage::KTreemapPage( KSettingsDialog * dialog,
grid - > addWidget ( _highlightColor , 0 , 1 ) ;
label = new QLabel( i18n ( " Minim&um Treemap Tile Size: " ) , gridBox ) ;
_minTileSize = new QSpinBox( 0 , 30 , 1 , gridBox ) ; // min, max, step, parent
label = new T QLabel( i18n ( " Minim&um Treemap Tile Size: " ) , gridBox ) ;
_minTileSize = new T QSpinBox( 0 , 30 , 1 , gridBox ) ; // min, max, step, tq parent
label - > setBuddy ( _minTileSize ) ;
grid - > addWidget ( label , 1 , 0 ) ;
grid - > addWidget ( _minTileSize , 1 , 1 ) ;
_autoResize = new QCheckBox( i18n ( " Auto-&Resize Treemap " ) , vbox ) ;
_autoResize = new T QCheckBox( i18n ( " Auto-&Resize Treemap " ) , vbox ) ;
// Connections
connect ( _ambientLight , SIGNAL( valueChanged ( int ) ) ,
_ambientLightSB , SLOT ( setValue ( int ) ) ) ;
connect ( _ambientLight , TQT_ SIGNAL( valueChanged ( int ) ) ,
_ambientLightSB , TQT_ SLOT ( setValue ( int ) ) ) ;
connect ( _ambientLightSB , SIGNAL( valueChanged ( int ) ) ,
_ambientLight , SLOT ( setValue ( int ) ) ) ;
connect ( _ambientLightSB , TQT_ SIGNAL( valueChanged ( int ) ) ,
_ambientLight , TQT_ SLOT ( setValue ( int ) ) ) ;
connect ( _heightScalePercent , SIGNAL( valueChanged ( int ) ) ,
_heightScalePercentSB , SLOT ( setValue ( int ) ) ) ;
connect ( _heightScalePercent , TQT_ SIGNAL( valueChanged ( int ) ) ,
_heightScalePercentSB , TQT_ SLOT ( setValue ( int ) ) ) ;
connect ( _heightScalePercentSB , SIGNAL( valueChanged ( int ) ) ,
_heightScalePercent , SLOT ( setValue ( int ) ) ) ;
connect ( _heightScalePercentSB , TQT_ SIGNAL( valueChanged ( int ) ) ,
_heightScalePercent , TQT_ SLOT ( setValue ( int ) ) ) ;
connect ( _doCushionShading , SIGNAL( stateChanged ( int ) ) , this , SLOT( checkEnabledState ( ) ) ) ;
connect ( _forceCushionGrid , SIGNAL( stateChanged ( int ) ) , this , SLOT( checkEnabledState ( ) ) ) ;
connect ( _doCushionShading , TQT_ SIGNAL( stateChanged ( int ) ) , this , TQT_ SLOT( checkEnabledState ( ) ) ) ;
connect ( _forceCushionGrid , TQT_ SIGNAL( stateChanged ( int ) ) , this , TQT_ SLOT( checkEnabledState ( ) ) ) ;
checkEnabledState ( ) ;
}
@ -971,10 +971,10 @@ KTreemapPage::revertToDefaults()
_minTileSize - > setValue ( DefaultMinTileSize ) ;
_autoResize - > setChecked ( true ) ;
_cushionGridColor - > setColor ( QColor( 0x80 , 0x80 , 0x80 ) ) ;
_cushionGridColor - > setColor ( T QColor( 0x80 , 0x80 , 0x80 ) ) ;
_outlineColor - > setColor ( black ) ;
_fileFillColor - > setColor ( QColor( 0xde , 0x8d , 0x53 ) ) ;
_dirFillColor - > setColor ( QColor( 0x10 , 0x7d , 0xb4 ) ) ;
_fileFillColor - > setColor ( T QColor( 0xde , 0x8d , 0x53 ) ) ;
_dirFillColor - > setColor ( T QColor( 0x10 , 0x7d , 0xb4 ) ) ;
_highlightColor - > setColor ( red ) ;
}
@ -995,10 +995,10 @@ KTreemapPage::setup()
_minTileSize - > setValue ( config - > readNumEntry ( " MinTileSize " , DefaultMinTileSize ) ) ;
_autoResize - > setChecked ( config - > readBoolEntry ( " AutoResize " , true ) ) ;
_cushionGridColor - > setColor ( readColorEntry ( config , " CushionGridColor " , QColor( 0x80 , 0x80 , 0x80 ) ) ) ;
_cushionGridColor - > setColor ( readColorEntry ( config , " CushionGridColor " , T QColor( 0x80 , 0x80 , 0x80 ) ) ) ;
_outlineColor - > setColor ( readColorEntry ( config , " OutlineColor " , black ) ) ;
_fileFillColor - > setColor ( readColorEntry ( config , " FileFillColor " , QColor( 0xde , 0x8d , 0x53 ) ) ) ;
_dirFillColor - > setColor ( readColorEntry ( config , " DirFillColor " , QColor( 0x10 , 0x7d , 0xb4 ) ) ) ;
_fileFillColor - > setColor ( readColorEntry ( config , " FileFillColor " , T QColor( 0xde , 0x8d , 0x53 ) ) ) ;
_dirFillColor - > setColor ( readColorEntry ( config , " DirFillColor " , T QColor( 0x10 , 0x7d , 0xb4 ) ) ) ;
_highlightColor - > setColor ( readColorEntry ( config , " HighlightColor " , red ) ) ;
_ambientLightSB - > setValue ( _ambientLight - > value ( ) ) ;
@ -1023,8 +1023,8 @@ KTreemapPage::checkEnabledState()
}
QColor
KTreemapPage : : readColorEntry ( KConfig * config , const char * entryName , QColor defaultColor )
T QColor
KTreemapPage : : readColorEntry ( KConfig * config , const char * entryName , T QColor defaultColor )
{
return config - > readColorEntry ( entryName , & defaultColor ) ;
}
@ -1032,22 +1032,22 @@ KTreemapPage::readColorEntry( KConfig * config, const char * entryName, QColor d
void
addHStretch ( QWidget * parent )
addHStretch ( T QWidget * tq parent )
{
QWidget * stretch = new QWidget( parent ) ;
stretch - > setSizePolicy( QSizePolicy( QSizePolicy: : Expanding , // hor
QSizePolicy: : Minimum , // vert
T QWidget * stretch = new T QWidget( tq parent ) ;
stretch - > tq setSizePolicy( T QSizePolicy( T QSizePolicy: : Expanding , // hor
T QSizePolicy: : Minimum , // vert
1 , // hstretch
0 ) ) ; // vstretch
}
void
addVStretch ( QWidget * parent )
addVStretch ( T QWidget * tq parent )
{
QWidget * stretch = new QWidget( parent ) ;
stretch - > setSizePolicy( QSizePolicy( QSizePolicy: : Minimum , // hor
QSizePolicy: : Expanding , // vert
T QWidget * stretch = new T QWidget( tq parent ) ;
stretch - > tq setSizePolicy( T QSizePolicy( T QSizePolicy: : Minimum , // hor
T QSizePolicy: : Expanding , // vert
0 , // hstretch
1 ) ) ; // vstretch
}