summaryrefslogtreecommitdiffstats
path: root/krename/guimodeselector.cpp
blob: b81f9d9a692b6875358cf761ef04450195cb5ffd (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
/***************************************************************************
                          guimodeselector.cpp  -  description
                             -------------------
    begin                : Fre Jun 6 2003
    copyright            : (C) 2003 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.                                   *
 *                                                                         *
 ***************************************************************************/

#include "guimodeselector.h"

// TQt includes
#include <tqbuttongroup.h>
#include <tqframe.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqradiobutton.h>

// KDE includes
#include <tdelocale.h>

GUIModeSelector::GUIModeSelector()
{
    optionWizard = optionTabs = 0;
}

GUIModeSelector::~GUIModeSelector()
{
}

bool GUIModeSelector::useWizard() const
{
    return optionWizard->isChecked();
}

void GUIModeSelector::setUseWizard( bool b )
{
    optionWizard->setChecked( b );
    optionTabs->setChecked( !b );
}

const TQString GUIModeSelector::guiModeCaption() const
{
    return i18n("Look and Feel");
}

void GUIModeSelector::createFrame( TQFrame* frame )
{
    TQVBoxLayout* layout = new TQVBoxLayout( frame );
    TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );

    TQButtonGroup* group = new TQButtonGroup( frame );
    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 );   
}