Logo Search packages:      
Sourcecode: filelight version File versions

settingsdialog.cpp

#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './settingsdialog.ui'
**
** Created: Wed Jan 21 13:50:23 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.0-snapshot-20040113   edited Nov 24 13:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "settingsdialog.h"

#include <qvariant.h>
#include <qvbuttongroup.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qlistbox.h>
#include <qframe.h>
#include <qcheckbox.h>
#include <qgroupbox.h>
#include <qslider.h>
#include <knuminput.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a SettingsDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
      setName( "SettingsDialog" );
    SettingsDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "SettingsDialogLayout"); 

    layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); 

    m_resetButton = new QPushButton( this, "m_resetButton" );
    m_resetButton->setAutoDefault( FALSE );
    layout6->addWidget( m_resetButton );
    spacer1 = new QSpacerItem( 120, 30, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout6->addItem( spacer1 );

    m_closeButton = new QPushButton( this, "m_closeButton" );
    m_closeButton->setDefault( TRUE );
    layout6->addWidget( m_closeButton );

    SettingsDialogLayout->addLayout( layout6, 1, 0 );

    tabWidget = new QTabWidget( this, "tabWidget" );
    tabWidget->setAcceptDrops( FALSE );

    Widget2 = new QWidget( tabWidget, "Widget2" );
    Widget2Layout = new QGridLayout( Widget2, 1, 1, 11, 6, "Widget2Layout"); 

    layout8 = new QVBoxLayout( 0, 0, 6, "layout8"); 

    textLabel1 = new QLabel( Widget2, "textLabel1" );
    textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)4, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
    textLabel1->setTextFormat( QLabel::PlainText );
    layout8->addWidget( textLabel1 );

    m_listBox = new QListBox( Widget2, "m_listBox" );
    layout8->addWidget( m_listBox );

    layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); 
    spacer2 = new QSpacerItem( 180, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout4->addItem( spacer2 );

    m_removeButton = new QPushButton( Widget2, "m_removeButton" );
    m_removeButton->setEnabled( TRUE );
    m_removeButton->setAutoDefault( FALSE );
    layout4->addWidget( m_removeButton );

    m_addButton = new QPushButton( Widget2, "m_addButton" );
    m_addButton->setAutoDefault( FALSE );
    m_addButton->setDefault( FALSE );
    layout4->addWidget( m_addButton );
    layout8->addLayout( layout4 );

    line1 = new QFrame( Widget2, "line1" );
    line1->setMinimumSize( QSize( 0, 15 ) );
    line1->setFrameShape( QFrame::HLine );
    line1->setFrameShadow( QFrame::Sunken );
    line1->setLineWidth( 1 );
    line1->setMidLineWidth( 1 );
    line1->setFrameShape( QFrame::HLine );
    layout8->addWidget( line1 );

    layout7 = new QGridLayout( 0, 1, 1, 0, 6, "layout7"); 
    spacer3 = new QSpacerItem( 16, 50, QSizePolicy::Fixed, QSizePolicy::Minimum );
    layout7->addMultiCell( spacer3, 1, 2, 0, 0 );

    dontScanRemoteMounts = new QCheckBox( Widget2, "dontScanRemoteMounts" );
    dontScanRemoteMounts->setEnabled( FALSE );
    dontScanRemoteMounts->setMinimumSize( QSize( 0, 0 ) );
    dontScanRemoteMounts->setMaximumSize( QSize( 32767, 32767 ) );
    dontScanRemoteMounts->setAcceptDrops( FALSE );

    layout7->addWidget( dontScanRemoteMounts, 1, 1 );

    scanAcrossMounts = new QCheckBox( Widget2, "scanAcrossMounts" );

    layout7->addMultiCellWidget( scanAcrossMounts, 0, 0, 0, 1 );

    dontScanRemovableMedia = new QCheckBox( Widget2, "dontScanRemovableMedia" );
    dontScanRemovableMedia->setEnabled( FALSE );

    layout7->addWidget( dontScanRemovableMedia, 2, 1 );
    layout8->addLayout( layout7 );

    Widget2Layout->addLayout( layout8, 0, 0 );
    tabWidget->insertTab( Widget2, QString("") );

    Widget3 = new QWidget( tabWidget, "Widget3" );
    Widget3Layout = new QGridLayout( Widget3, 1, 1, 11, 6, "Widget3Layout"); 

    layout12 = new QVBoxLayout( 0, 0, 6, "layout12"); 

    groupBox1 = new QGroupBox( Widget3, "groupBox1" );
    groupBox1->setColumnLayout(0, Qt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( Qt::AlignTop );

    layout11 = new QVBoxLayout( 0, 0, 6, "layout11"); 

    colourSchemeGroup = new QVButtonGroup( groupBox1, "colourSchemeGroup" );
    colourSchemeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, colourSchemeGroup->sizePolicy().hasHeightForWidth() ) );
    layout11->addWidget( colourSchemeGroup );

    layout10 = new QHBoxLayout( 0, 0, 6, "layout10"); 

    textLabel3 = new QLabel( groupBox1, "textLabel3" );
    textLabel3->setTextFormat( QLabel::PlainText );
    layout10->addWidget( textLabel3 );

    contrastSlider = new QSlider( groupBox1, "contrastSlider" );
    contrastSlider->setMinValue( 1 );
    contrastSlider->setMaxValue( 100 );
    contrastSlider->setOrientation( QSlider::Horizontal );
    layout10->addWidget( contrastSlider );
    layout11->addLayout( layout10 );
    groupBox1Layout->addLayout( layout11 );
    layout12->addWidget( groupBox1 );

    useAntialiasing = new QCheckBox( Widget3, "useAntialiasing" );
    layout12->addWidget( useAntialiasing );

    layout11_2 = new QGridLayout( 0, 1, 1, 0, 6, "layout11_2"); 

    textLabel2 = new QLabel( Widget3, "textLabel2" );
    textLabel2->setEnabled( TRUE );
    textLabel2->setTextFormat( QLabel::PlainText );

    layout11_2->addWidget( textLabel2, 1, 1 );

    varyLabelFontSizes = new QCheckBox( Widget3, "varyLabelFontSizes" );
    varyLabelFontSizes->setEnabled( TRUE );

    layout11_2->addMultiCellWidget( varyLabelFontSizes, 0, 0, 0, 2 );
    spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    layout11_2->addItem( spacer4, 1, 0 );

    minFontPitch = new KIntSpinBox( Widget3, "minFontPitch" );
    minFontPitch->setEnabled( TRUE );
    minFontPitch->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, minFontPitch->sizePolicy().hasHeightForWidth() ) );
    minFontPitch->setMinimumSize( QSize( 80, 0 ) );
    minFontPitch->setMaxValue( 20 );
    minFontPitch->setMinValue( 1 );
    minFontPitch->setValue( 9 );

    layout11_2->addWidget( minFontPitch, 1, 2 );
    layout12->addLayout( layout11_2 );

    showSmallFiles = new QCheckBox( Widget3, "showSmallFiles" );
    layout12->addWidget( showSmallFiles );

    Widget3Layout->addLayout( layout12, 0, 0 );
    tabWidget->insertTab( Widget3, QString("") );

    SettingsDialogLayout->addWidget( tabWidget, 0, 0 );
    languageChange();
    resize( QSize(365, 544).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( scanAcrossMounts, SIGNAL( toggled(bool) ), this, SLOT( toggleScanAcrossMounts(bool) ) );
    connect( dontScanRemoteMounts, SIGNAL( toggled(bool) ), this, SLOT( toggleDontScanRemoteMounts(bool) ) );
    connect( dontScanRemovableMedia, SIGNAL( toggled(bool) ), this, SLOT( toggleDontScanRemovableMedia(bool) ) );

    // tab order
    setTabOrder( tabWidget, colourSchemeGroup );
    setTabOrder( colourSchemeGroup, contrastSlider );
    setTabOrder( contrastSlider, useAntialiasing );
    setTabOrder( useAntialiasing, varyLabelFontSizes );
    setTabOrder( varyLabelFontSizes, minFontPitch );
    setTabOrder( minFontPitch, m_resetButton );
    setTabOrder( m_resetButton, m_closeButton );
    setTabOrder( m_closeButton, m_listBox );
    setTabOrder( m_listBox, m_removeButton );
    setTabOrder( m_removeButton, m_addButton );
    setTabOrder( m_addButton, scanAcrossMounts );
    setTabOrder( scanAcrossMounts, dontScanRemoteMounts );
    setTabOrder( dontScanRemoteMounts, dontScanRemovableMedia );

    // buddies
    textLabel1->setBuddy( m_listBox );
    textLabel3->setBuddy( contrastSlider );
    textLabel2->setBuddy( minFontPitch );
}

/*
 *  Destroys the object and frees any allocated resources
 */
SettingsDialog::~SettingsDialog()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SettingsDialog::languageChange()
{
    setCaption( tr2i18n( "Settings - Filelight" ) );
    m_resetButton->setText( tr2i18n( "&Reset" ) );
    m_resetButton->setAccel( QKeySequence( tr2i18n( "Alt+R" ) ) );
    QWhatsThis::add( m_resetButton, tr2i18n( "Reset any changes you have made since you opened this dialog." ) );
    m_closeButton->setText( tr2i18n( "&Close" ) );
    m_closeButton->setAccel( QKeySequence( tr2i18n( "Alt+C" ) ) );
    textLabel1->setText( tr2i18n( "&Don't scan these directories:" ) );
    QToolTip::add( m_listBox, QString::null );
    QWhatsThis::add( m_listBox, tr2i18n( "Filelight will not scan these directories unless you specifically request them." ) );
    m_removeButton->setText( tr2i18n( "R&emove" ) );
    m_removeButton->setAccel( QKeySequence( tr2i18n( "Alt+E" ) ) );
    m_addButton->setText( tr2i18n( "&Add..." ) );
    m_addButton->setAccel( QKeySequence( tr2i18n( "Alt+A" ) ) );
    dontScanRemoteMounts->setText( tr2i18n( "Exclude re&mote filesystems" ) );
    dontScanRemoteMounts->setAccel( QKeySequence( tr2i18n( "Alt+M" ) ) );
    QToolTip::add( dontScanRemoteMounts, QString::null );
    QWhatsThis::add( dontScanRemoteMounts, tr2i18n( "Selecting this option will prevent scanning of filesystems that aren't on this computer e.g. NFS or Samba mounts." ) );
    scanAcrossMounts->setText( tr2i18n( "Scan across filesystem &boundaries" ) );
    scanAcrossMounts->setAccel( QKeySequence( tr2i18n( "Alt+B" ) ) );
    QWhatsThis::add( scanAcrossMounts, tr2i18n( "Selecting this option will prevent Filelight from scanning directories that are not in the same filesystem the scan started." ) );
    dontScanRemovableMedia->setText( tr2i18n( "Exclude remo&vable media" ) );
    dontScanRemovableMedia->setAccel( QKeySequence( tr2i18n( "Alt+V" ) ) );
    QToolTip::add( dontScanRemovableMedia, QString::null );
    QWhatsThis::add( dontScanRemovableMedia, tr2i18n( "Selecting this option will prevent Filelight from scanning removable media (eg. CD-ROMs)." ) );
    tabWidget->changeTab( Widget2, tr2i18n( "&Scanning" ) );
    groupBox1->setTitle( tr2i18n( "Scheme" ) );
    textLabel3->setText( tr2i18n( "&Contrast" ) );
    QWhatsThis::add( contrastSlider, tr2i18n( "Here you can vary the contrast of the filemap in realtime." ) );
    useAntialiasing->setText( tr2i18n( "&Use anti-aliasing" ) );
    useAntialiasing->setAccel( QKeySequence( tr2i18n( "Alt+U" ) ) );
    QWhatsThis::add( useAntialiasing, tr2i18n( "Anti-aliasing the filemap makes it clearer and prettier, unfortunately it also makes rendering very slow." ) );
    textLabel2->setText( tr2i18n( "Minimum &font size:" ) );
    QWhatsThis::add( textLabel2, tr2i18n( "The smallest font size Filelight can render labels." ) );
    varyLabelFontSizes->setText( tr2i18n( "&Vary label font sizes" ) );
    varyLabelFontSizes->setAccel( QKeySequence( tr2i18n( "Alt+V" ) ) );
    QWhatsThis::add( varyLabelFontSizes, tr2i18n( "The font size of exploded labels can be varied relative to the depth of the directories they represent. This helps you spot the important labels more easily. Set a sensible minimum font size." ) );
    showSmallFiles->setText( tr2i18n( "Show small files" ) );
    QWhatsThis::add( showSmallFiles, tr2i18n( "Some files are too small to be rendered on the filemap. Selecting this option makes these files visible by merging them all into a single \"multi-segment\"." ) );
    tabWidget->changeTab( Widget3, tr2i18n( "&Appearance" ) );
}

void SettingsDialog::toggleDontScanRemovableMedia(bool)
{
    qWarning( "SettingsDialog::toggleDontScanRemovableMedia(bool): Not implemented yet" );
}

void SettingsDialog::toggleDontScanRemoteMounts(bool)
{
    qWarning( "SettingsDialog::toggleDontScanRemoteMounts(bool): Not implemented yet" );
}

void SettingsDialog::toggleScanAcrossMounts(bool)
{
    qWarning( "SettingsDialog::toggleScanAcrossMounts(bool): Not implemented yet" );
}

#include "settingsdialog.moc"

Generated by  Doxygen 1.6.0   Back to index