File: passwordlayout.cpp

package info (click to toggle)
basket 1.0.2-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 14,272 kB
  • ctags: 3,211
  • sloc: cpp: 28,424; sh: 9,518; perl: 2,730; makefile: 235
file content (99 lines) | stat: -rw-r--r-- 3,662 bytes parent folder | download
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
#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './passwordlayout.ui'
**
** Created: jeu avr 12 14:11:15 2007
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.6   edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "passwordlayout.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qcombobox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a PasswordLayout as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
PasswordLayout::PasswordLayout( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "PasswordLayout" );
    PasswordLayoutLayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "PasswordLayoutLayout"); 

    buttonGroup = new QButtonGroup( this, "buttonGroup" );
    buttonGroup->setLineWidth( 0 );
    buttonGroup->setColumnLayout(0, Qt::Vertical );
    buttonGroup->layout()->setSpacing( KDialog::spacingHint() );
    buttonGroup->layout()->setMargin( 0 );
    buttonGroupLayout = new QVBoxLayout( buttonGroup->layout() );
    buttonGroupLayout->setAlignment( Qt::AlignTop );

    noPasswordRadioButton = new QRadioButton( buttonGroup, "noPasswordRadioButton" );
    buttonGroupLayout->addWidget( noPasswordRadioButton );

    passwordRadioButton = new QRadioButton( buttonGroup, "passwordRadioButton" );
    buttonGroupLayout->addWidget( passwordRadioButton );

    layout2 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout2"); 

    publicPrivateRadioButton = new QRadioButton( buttonGroup, "publicPrivateRadioButton" );
    publicPrivateRadioButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, publicPrivateRadioButton->sizePolicy().hasHeightForWidth() ) );
    layout2->addWidget( publicPrivateRadioButton );

    keyCombo = new QComboBox( FALSE, buttonGroup, "keyCombo" );
    layout2->addWidget( keyCombo );
    buttonGroupLayout->addLayout( layout2 );
    PasswordLayoutLayout->addWidget( buttonGroup );
    spacer = new QSpacerItem( 20, 6, QSizePolicy::Minimum, QSizePolicy::Expanding );
    PasswordLayoutLayout->addItem( spacer );
    languageChange();
    resize( QSize(314, 69).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PasswordLayout::languageChange()
{
    setCaption( tr2i18n( "Password Protection" ) );
    buttonGroup->setTitle( QString::null );
    noPasswordRadioButton->setText( tr2i18n( "&No protection" ) );
    noPasswordRadioButton->setAccel( QKeySequence( tr2i18n( "Alt+N" ) ) );
    passwordRadioButton->setText( tr2i18n( "Protect basket with a &password" ) );
    passwordRadioButton->setAccel( QKeySequence( tr2i18n( "Alt+P" ) ) );
    publicPrivateRadioButton->setText( tr2i18n( "Protect basket with private &key:" ) );
    publicPrivateRadioButton->setAccel( QKeySequence( tr2i18n( "Alt+K" ) ) );
}

void PasswordLayout::changeKey()
{
    qWarning( "PasswordLayout::changeKey(): Not implemented yet" );
}

void PasswordLayout::clearKey()
{
    qWarning( "PasswordLayout::clearKey(): Not implemented yet" );
}

#include "passwordlayout.moc"