summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/findwnd.cpp
blob: 7767665eb354355a011c219222541a75d71f3658 (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
/****************************************************************************
** Form implementation generated from reading ui file 'findwnd.ui'
**
** Created: Tue Sep 14 15:25:08 2004
**      by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "findwnd.h"

#include <qvariant.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

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

    textLabel1 = new QLabel( this, "textLabel1" );
    textLabel1->setGeometry( QRect( 20, 20, 340, 20 ) );
    textLabel1->setFrameShape( QLabel::NoFrame );
    textLabel1->setFrameShadow( QLabel::Plain );

    findLineEdit = new QLineEdit( this, "findLineEdit" );
    findLineEdit->setGeometry( QRect( 20, 40, 340, 20 ) );

    findButton = new QPushButton( this, "findButton" );
    findButton->setGeometry( QRect( 20, 230, 107, 27 ) );

    closeButton = new QPushButton( this, "closeButton" );
    closeButton->setGeometry( QRect( 250, 230, 107, 27 ) );

    exactCheckBox = new QCheckBox( this, "exactCheckBox" );
    exactCheckBox->setGeometry( QRect( 20, 200, 340, 20 ) );

    caseSensCheckBox = new QCheckBox( this, "caseSensCheckBox" );
    caseSensCheckBox->setGeometry( QRect( 20, 180, 340, 20 ) );

    buttonGroup1 = new QButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setGeometry( QRect( 20, 70, 340, 90 ) );

    descRadioButton = new QRadioButton( buttonGroup1, "descRadioButton" );
    descRadioButton->setGeometry( QRect( 30, 20, 150, 20 ) );
    descRadioButton->setChecked( TRUE );

    pwRadioButton = new QRadioButton( buttonGroup1, "pwRadioButton" );
    pwRadioButton->setGeometry( QRect( 180, 20, 150, 20 ) );

    commentRadioButton = new QRadioButton( buttonGroup1, "commentRadioButton" );
    commentRadioButton->setGeometry( QRect( 180, 40, 150, 20 ) );

    nameRadioButton = new QRadioButton( buttonGroup1, "nameRadioButton" );
    nameRadioButton->setGeometry( QRect( 30, 40, 150, 20 ) );

    urlRadioButton = new QRadioButton( buttonGroup1, "urlRadioButton" );
    urlRadioButton->setGeometry( QRect( 30, 60, 150, 20 ) );

    launcherRadioButton = new QRadioButton( buttonGroup1, "launcherRadioButton" );
    launcherRadioButton->setGeometry( QRect( 180, 60, 150, 20 ) );
    languageChange();
    resize( QSize(381, 269).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( findButton, SIGNAL( clicked() ), this, SLOT( findButton_slot() ) );
    connect( closeButton, SIGNAL( clicked() ), this, SLOT( closeButton_slot() ) );
    connect( descRadioButton, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
    connect( nameRadioButton, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
    connect( pwRadioButton, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
    connect( commentRadioButton, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
    connect( findLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( selectionChanged_slot() ) );
    connect( caseSensCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );
    connect( exactCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( selectionChanged_slot() ) );

    // tab order
    setTabOrder( findLineEdit, descRadioButton );
    setTabOrder( descRadioButton, caseSensCheckBox );
    setTabOrder( caseSensCheckBox, exactCheckBox );
    setTabOrder( exactCheckBox, findButton );
    setTabOrder( findButton, closeButton );
    setTabOrder( closeButton, nameRadioButton );
    setTabOrder( nameRadioButton, pwRadioButton );
    setTabOrder( pwRadioButton, commentRadioButton );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void findWnd::languageChange()
{
    setCaption( tr( "Find" ) );
    textLabel1->setText( tr( "Find:" ) );
    findButton->setText( tr( "&Find" ) );
    //US ENH    findButton->setAccel( QKeySequence( tr( "Alt+F" ) ) );
    closeButton->setText( tr( "&Close" ) );
//US ENH    closeButton->setAccel( QKeySequence( tr( "Alt+C" ) ) );
    exactCheckBox->setText( tr( "&Exact match" ) );
//US ENH    exactCheckBox->setAccel( QKeySequence( tr( "Alt+E" ) ) );
    caseSensCheckBox->setText( tr( "&Case sensitive" ) );
//US ENH    caseSensCheckBox->setAccel( QKeySequence( tr( "Alt+C" ) ) );
    buttonGroup1->setTitle( tr( "Search in Column" ) );
    descRadioButton->setText( tr( "&Description" ) );
    pwRadioButton->setText( tr( "&Password" ) );
    commentRadioButton->setText( tr( "C&omment" ) );
    nameRadioButton->setText( tr( "&Username" ) );
//US ENH    nameRadioButton->setAccel( QKeySequence( tr( "Alt+U" ) ) );
    urlRadioButton->setText( tr( "U&RL" ) );
//US ENH    urlRadioButton->setAccel( QKeySequence( tr( "Alt+R" ) ) );
    launcherRadioButton->setText( tr( "&Launcher" ) );
//US ENH    launcherRadioButton->setAccel( QKeySequence( tr( "Alt+L" ) ) );
}

void findWnd::findButton_slot()
{
    qWarning( "findWnd::findButton_slot(): Not implemented yet" );
}

void findWnd::selectionChanged_slot()
{
    qWarning( "findWnd::selectionChanged_slot(): Not implemented yet" );
}

void findWnd::closeButton_slot()
{
    qWarning( "findWnd::closeButton_slot(): Not implemented yet" );
}