summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/configwnd.cpp
blob: 108c40feeaa53af9c28412a4a308e49ec755830b (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/****************************************************************************
** Form implementation generated from reading ui file 'configwnd.ui'
**
** Created: Tue Sep 14 15:20:58 2004
**      by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "configwnd.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a configWnd 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.
 */
configWnd::configWnd( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "configWnd" );

    okButton = new QPushButton( this, "okButton" );
    okButton->setGeometry( QRect( 10, 280, 107, 27 ) );

    cancelButton = new QPushButton( this, "cancelButton" );
    cancelButton->setGeometry( QRect( 370, 280, 107, 27 ) );

    tabWidget2 = new QTabWidget( this, "tabWidget2" );
    tabWidget2->setGeometry( QRect( 10, 10, 470, 260 ) );

    //////////////////////////////
    tab = new QWidget( tabWidget2, "tab" );

    windowStyleComboBox = new QComboBox( FALSE, tab, "windowStyleComboBox" );
    windowStyleComboBox->setGeometry( QRect( 220, 180, 210, 28 ) );

    textLabel1_5 = new QLabel( tab, "textLabel1_5" );
    textLabel1_5->setGeometry( QRect( 30, 180, 180, 20 ) );
    textLabel1_5->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    textLabel1_4 = new QLabel( tab, "textLabel1_4" );
    textLabel1_4->setGeometry( QRect( 30, 40, 400, 20 ) );

    selEntrFontButton = new QPushButton( tab, "selEntrFontButton" );
    selEntrFontButton->setGeometry( QRect( 30, 90, 160, 27 ) );

    currEntrFont = new QLabel( tab, "currEntrFont" );
    currEntrFont->setGeometry( QRect( 30, 70, 230, 20 ) );
    tabWidget2->insertTab( tab, QString("") );
    //////////////////////////////////////
    TabPage = new QWidget( tabWidget2, "TabPage" );

    compressionComboBox = new QComboBox( FALSE, TabPage, "compressionComboBox" );
    compressionComboBox->setGeometry( QRect( 290, 50, 150, 28 ) );

    textLabel1_6 = new QLabel( TabPage, "textLabel1_6" );
    textLabel1_6->setGeometry( QRect( 10, 50, 270, 20 ) );
    textLabel1_6->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    textLabel1_8 = new QLabel( TabPage, "textLabel1_8" );
    textLabel1_8->setGeometry( QRect( 10, 90, 270, 20 ) );
    textLabel1_8->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    permissionLineEdit = new QLineEdit( TabPage, "permissionLineEdit" );
    permissionLineEdit->setGeometry( QRect( 290, 90, 142, 27 ) );
    permissionLineEdit->setMaxLength( 3 );

    fileBackupCheckBox = new QCheckBox( TabPage, "fileBackupCheckBox" );
    fileBackupCheckBox->setGeometry( QRect( 80, 140, 360, 23 ) );
    tabWidget2->insertTab( TabPage, QString("") );
    //////////////////////////////////////
    tab_2 = new QWidget( tabWidget2, "tab_2" );

    pwTimeoutSpinBox = new QSpinBox( tab_2, "pwTimeoutSpinBox" );
    pwTimeoutSpinBox->setGeometry( QRect( 390, 50, 55, 23 ) );

    textLabel1 = new QLabel( tab_2, "textLabel1" );
    textLabel1->setGeometry( QRect( 10, 20, 370, 80 ) );
    textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );

    textLabel1_7 = new QLabel( tab_2, "textLabel1_7" );
    textLabel1_7->setGeometry( QRect( 10, 110, 370, 80 ) );
    textLabel1_7->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );

    lockTimeoutSpinBox = new QSpinBox( tab_2, "lockTimeoutSpinBox" );
    lockTimeoutSpinBox->setGeometry( QRect( 390, 140, 55, 23 ) );

    autoDeepLockCheckBox = new QCheckBox( tab_2, "autoDeepLockCheckBox" );
    autoDeepLockCheckBox->setGeometry( QRect( 60, 180, 380, 25 ) );
    tabWidget2->insertTab( tab_2, QString("") );
    ///////////////////////////////////////////
    tab_3 = new QWidget( tabWidget2, "tab_3" );

    textLabel1_3 = new QLabel( tab_3, "textLabel1_3" );
    textLabel1_3->setGeometry( QRect( 30, 30, 400, 20 ) );

    autoStartLineEdit = new QLineEdit( tab_3, "autoStartLineEdit" );
    autoStartLineEdit->setGeometry( QRect( 30, 50, 360, 20 ) );

    browseAutoStButton = new QPushButton( tab_3, "browseAutoStButton" );
    browseAutoStButton->setGeometry( QRect( 400, 50, 30, 20 ) );

    autostartDeeplockedCheckBox = new QCheckBox( tab_3, "autostartDeeplockedCheckBox" );
    autostartDeeplockedCheckBox->setGeometry( QRect( 40, 80, 390, 25 ) );
    tabWidget2->insertTab( tab_3, QString("") );
    ////////////////////////////////////////////
    tab_4 = new QWidget( tabWidget2, "tab_4" );

    textLabel2 = new QLabel( tab_4, "textLabel2" );
    textLabel2->setGeometry( QRect( 20, 40, 280, 20 ) );
    textLabel2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    browserLineEdit = new QLineEdit( tab_4, "browserLineEdit" );
    browserLineEdit->setGeometry( QRect( 310, 40, 130, 27 ) );

    xtermLineEdit = new QLineEdit( tab_4, "xtermLineEdit" );
    xtermLineEdit->setGeometry( QRect( 310, 100, 130, 27 ) );

    textLabel3 = new QLabel( tab_4, "textLabel3" );
    textLabel3->setGeometry( QRect( 20, 100, 280, 20 ) );
    textLabel3->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
    tabWidget2->insertTab( tab_4, QString("") );
    ///////////////////////////////////////////////
    tab_5 = new QWidget( tabWidget2, "tab_5" );

    trayCheckBox = new QCheckBox( tab_5, "trayCheckBox" );
    trayCheckBox->setGeometry( QRect( 30, 30, 400, 20 ) );

    openUnlockedCheckBox = new QCheckBox( tab_5, "openUnlockedCheckBox" );
    openUnlockedCheckBox->setGeometry( QRect( 30, 80, 400, 20 ) );

    autoMinimizeCheckBox = new QCheckBox( tab_5, "autoMinimizeCheckBox" );
    autoMinimizeCheckBox->setEnabled( FALSE );
    autoMinimizeCheckBox->setGeometry( QRect( 50, 50, 380, 25 ) );

    minimizeLockComboBox = new QComboBox( FALSE, tab_5, "minimizeLockComboBox" );
    minimizeLockComboBox->setGeometry( QRect( 310, 170, 120, 27 ) );

    textLabel1_9 = new QLabel( tab_5, "textLabel1_9" );
    textLabel1_9->setGeometry( QRect( 30, 180, 270, 20 ) );
    textLabel1_9->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    kwalletEmuCheckBox = new QCheckBox( tab_5, "kwalletEmuCheckBox" );
    kwalletEmuCheckBox->setGeometry( QRect( 30, 110, 400, 25 ) );

    wndCloseCheckBox = new QCheckBox( tab_5, "wndCloseCheckBox" );
    wndCloseCheckBox->setGeometry( QRect( 30, 140, 430, 24 ) );
    tabWidget2->insertTab( tab_5, QString("") );
    languageChange();
    resize( QSize(490, 318).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( okButton, SIGNAL( clicked() ), this, SLOT( okButton_slot() ) );
    connect( cancelButton, SIGNAL( clicked() ), this, SLOT( cancelButton_slot() ) );
    connect( browseAutoStButton, SIGNAL( clicked() ), this, SLOT( browseAutoStButton_slot() ) );
    connect( selEntrFontButton, SIGNAL( clicked() ), this, SLOT( selEntrFontButton_slot() ) );
    connect( trayCheckBox, SIGNAL( toggled(bool) ), autoMinimizeCheckBox, SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( pwTimeoutSpinBox, trayCheckBox );
    setTabOrder( trayCheckBox, okButton );
    setTabOrder( okButton, cancelButton );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void configWnd::languageChange()
{
    setCaption( tr( "PwManager Configuration" ) );
    okButton->setText( tr( "&OK" ) );
    //US ENH    okButton->setAccel( QKeySequence( tr( "Alt+O" ) ) );
    cancelButton->setText( tr( "&Cancel" ) );
    //US ENH    cancelButton->setAccel( QKeySequence( tr( "Alt+C" ) ) );
    windowStyleComboBox->clear();
    windowStyleComboBox->insertItem( tr( "Category on top" ) );
    windowStyleComboBox->insertItem( tr( "Category-list left" ) );
    textLabel1_5->setText( tr( "Window-style:" ) );
    textLabel1_4->setText( tr( "Font for the password entries:" ) );
    selEntrFontButton->setText( tr( "select Font" ) );
    currEntrFont->setText( QString::null );
    tabWidget2->changeTab( tab, tr( "Look && feel" ) );
    compressionComboBox->clear();
    compressionComboBox->insertItem( tr( "none" ) );
    compressionComboBox->insertItem( tr( "gzip" ) );
    compressionComboBox->insertItem( tr( "bzip2" ) );
    textLabel1_6->setText( tr( "*.pwm file compression:" ) );
    textLabel1_8->setText( tr( "permissions:" ) );
    fileBackupCheckBox->setText( tr( "Make file backup before saving" ) );
    tabWidget2->changeTab( TabPage, tr( "File" ) );
    textLabel1->setText( tr( "Password timeout (timeout to hold password in memory, so you don't have to re-enter it, if you already have entered it) [set to 0 to disable]:" ) );
    textLabel1_7->setText( tr( "Auto-lock timeout (auto lock document after this amount of seconds) [set to 0 to disable]:" ) );
    autoDeepLockCheckBox->setText( tr( "deep-lock on autolock" ) );
    tabWidget2->changeTab( tab_2, tr( "Timeout" ) );
    textLabel1_3->setText( tr( "Open this file automatically on startup:" ) );
    browseAutoStButton->setText( tr( "..." ) );
    autostartDeeplockedCheckBox->setText( tr( "open deeplocked" ) );
    tabWidget2->changeTab( tab_3, tr( "Autostart" ) );
    textLabel2->setText( tr( "Favourite browser:" ) );
    textLabel3->setText( tr( "Favourite X-terminal:" ) );
    tabWidget2->changeTab( tab_4, tr( "External apps" ) );
    trayCheckBox->setText( tr( "Show icon in system-tray" ) );
    openUnlockedCheckBox->setText( tr( "Open document with passwords unlocked" ) );
    autoMinimizeCheckBox->setText( tr( "auto-minimize to tray on startup" ) );
    minimizeLockComboBox->clear();
    minimizeLockComboBox->insertItem( tr( "don't lock" ) );
    minimizeLockComboBox->insertItem( tr( "normal lock" ) );
    minimizeLockComboBox->insertItem( tr( "deep-lock" ) );
    textLabel1_9->setText( tr( "auto-lock on minimize:" ) );
    kwalletEmuCheckBox->setText( tr( "KWallet emulation" ) );
    wndCloseCheckBox->setText( tr( "Do not minimize windows into tray. (Close the window)" ) );
    tabWidget2->changeTab( tab_5, tr( "Miscellaneous" ) );
}

void configWnd::okButton_slot()
{
    qWarning( "configWnd::okButton_slot(): Not implemented yet" );
}

void configWnd::cancelButton_slot()
{
    qWarning( "configWnd::cancelButton_slot(): Not implemented yet" );
}

void configWnd::browseBgButton_slot()
{
    qWarning( "configWnd::browseBgButton_slot(): Not implemented yet" );
}

void configWnd::browseAutoStButton_slot()
{
    qWarning( "configWnd::browseAutoStButton_slot(): Not implemented yet" );
}

void configWnd::selEntrFontButton_slot()
{
    qWarning( "configWnd::selEntrFontButton_slot(): Not implemented yet" );
}