Logo Search packages:      
Sourcecode: filelight version File versions  Download package

dialog.cpp

#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/detritus/src/HEAD/kdenonbeta/filelight/src/part/dialog.ui'
**
** Created: Tue Nov 23 16:58:37 2004
**      by: The User Interface Compiler ()
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "dialog.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 Dialog 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.
 */
Dialog::Dialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
      setName( "Dialog" );
    DialogLayout = new QVBoxLayout( this, 11, 6, "DialogLayout"); 

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

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

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

    m_listBox = new QListBox( Widget2, "m_listBox" );
    Widget2Layout->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 );
    Widget2Layout->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 );
    Widget2Layout->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 );
    Widget2Layout->addLayout( layout7 );
    tabWidget->insertTab( Widget2, QString("") );

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

    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 );

    colourSchemeGroup = new QVButtonGroup( groupBox1, "colourSchemeGroup" );
    colourSchemeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, colourSchemeGroup->sizePolicy().hasHeightForWidth() ) );
    groupBox1Layout->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 );
    groupBox1Layout->addLayout( layout10 );
    Widget3Layout->addWidget( groupBox1 );

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

    layout10_2 = new QVBoxLayout( 0, 0, 0, "layout10_2"); 

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

    layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); 
    spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    layout9->addItem( spacer4 );

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

    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 );
    layout9->addWidget( minFontPitch );
    layout10_2->addLayout( layout9 );
    Widget3Layout->addLayout( layout10_2 );

    showSmallFiles = new QCheckBox( Widget3, "showSmallFiles" );
    Widget3Layout->addWidget( showSmallFiles );
    tabWidget->insertTab( Widget3, QString("") );
    DialogLayout->addWidget( tabWidget );

    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 );
    DialogLayout->addLayout( layout6 );
    languageChange();
    resize( QSize(415, 351).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
 */
Dialog::~Dialog()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void Dialog::languageChange()
{
    setCaption( tr2i18n( "Settings - Filelight" ) );
    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_addButton->setText( tr2i18n( "&Add..." ) );
    dontScanRemoteMounts->setText( tr2i18n( "Exclude re&mote filesystems" ) );
    QToolTip::add( dontScanRemoteMounts, QString::null );
    QWhatsThis::add( dontScanRemoteMounts, tr2i18n( "Prevents scanning of filesystems that aren't on this computer, e.g. NFS or Samba mounts." ) );
    scanAcrossMounts->setText( tr2i18n( "Scan across filesystem &boundaries" ) );
    QWhatsThis::add( scanAcrossMounts, tr2i18n( "Stops scans entering directories that are part of other filesystems. For example, this will usually prevent the contents of <b>/mnt</b> from being scanned if you scan <b>/</b>." ) );
    dontScanRemovableMedia->setText( tr2i18n( "Exclude remo&vable media" ) );
    QToolTip::add( dontScanRemovableMedia, QString::null );
    QWhatsThis::add( dontScanRemovableMedia, tr2i18n( "Prevents 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" ) );
    QWhatsThis::add( useAntialiasing, tr2i18n( "Anti-aliasing the filemap makes it clearer and prettier, unfortunately it also makes rendering very slow." ) );
    varyLabelFontSizes->setText( tr2i18n( "&Vary label font sizes" ) );
    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." ) );
    textLabel2->setText( tr2i18n( "Minimum &font size:" ) );
    QWhatsThis::add( textLabel2, tr2i18n( "The smallest font size Filelight can render labels." ) );
    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" ) );
    m_resetButton->setText( tr2i18n( "&Reset" ) );
    QWhatsThis::add( m_resetButton, tr2i18n( "Reset any changes you have made since you opened this dialog." ) );
    m_closeButton->setText( tr2i18n( "&Close" ) );
}

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

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

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

#include "dialog.moc"

Generated by  Doxygen 1.6.0   Back to index