summaryrefslogtreecommitdiffstats
path: root/krename/confdialog.cpp
blob: 25a235a243b1e54e75475ac39f7f1a34daa6d316 (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
/***************************************************************************
                          confdialog.cpp  -  description
                             -------------------
    begin                : Sun Jan 27 2002
    copyright            : (C) 2002 by Dominik Seichter
    email                : domseichter@web.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

// Own includes
#include "confdialog.h"

// QT includes
#include <tqbuttongroup.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqradiobutton.h>
#include <tqtooltip.h>

// KDE includes
#include <kiconloader.h>
#include <tdelocale.h>

ConfDialog::ConfDialog( TQWidget* parent, const char* name )
    :  KDialogBase( KDialogBase::IconList, "KRename",
       KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Default, KDialogBase::Ok, parent, name, true, true ),
       GUIModeSelector()
{
    setupTab1();
    setupTab2();

    connect( this, TQT_SIGNAL( defaultClicked() ), this, TQT_SLOT( defaults() ) );
}

ConfDialog::~ConfDialog()
{
}

void ConfDialog::setupTab1()
{
    const TQString caption = i18n("Look and Feel");
    TQFrame* box = addPage( caption, caption, BarIcon("preferences-desktop") );
    TQVBoxLayout* layout = new TQVBoxLayout( box );
    TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );

    TQButtonGroup* group = new TQButtonGroup( box );
    group->setColumnLayout(0, Qt::Vertical );
    TQVBoxLayout* lgroup = new TQVBoxLayout( group->layout() );

    optionWizard = new TQRadioButton( group );
    optionWizard->setText( i18n("Use &wizard style GUI (beginners)") );
    optionTabs = new TQRadioButton( group );
    optionTabs->setText( i18n("Use &tabbed GUI (advanced users)") );

    lgroup->addWidget( new TQLabel( i18n("Configure the look and feel of the KRename GUI:<br>"), group ) );
    lgroup->addWidget( optionWizard );
    lgroup->addWidget( optionTabs );
    lgroup->addItem( spacer );
        
    layout->addWidget( group );
    layout->addItem( spacer );
}

void ConfDialog::setupTab2()
{
    const TQString caption = i18n("KRename");
    TQFrame* box = addPage( caption, caption, BarIcon("krename") );
    TQVBoxLayout* layout = new TQVBoxLayout( box );
    TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );

    checkPlugins = new TQCheckBox( i18n("&Load file plugins on start"), box );
    checkAutosize = new TQCheckBox( i18n("Auto &resize columns in preview"), box );

    spinSize = new KIntNumInput( box );
    spinSize->setRange( 20, 500, 1, false );
    spinSize->setLabel( i18n( "&Thumbnail size:" ), AlignLeft | AlignVCenter );

    spinHistory = new KIntNumInput( box );
    spinHistory->setRange( 2, 500, 1, false );
    spinHistory->setLabel( i18n( "&Number of template history items:" ), AlignLeft | AlignVCenter );

    layout->addWidget( checkPlugins );
    layout->addWidget( checkAutosize );
    layout->addItem( spacer );
    layout->addWidget( spinSize );
    layout->addWidget( spinHistory );
    layout->addItem( spacer );

    TQToolTip::add( checkPlugins, i18n("Disabling this option decreases KRename's startup time, because no KFilePlugins are loaded.") );
}

void ConfDialog::defaults()
{
    checkPlugins->setChecked( true );
    checkAutosize->setChecked( false );

    optionWizard->setChecked( true );

    spinSize->setValue( 80 );
}