[go: up one dir, main page]

File: tobrowserfilterui.cpp

package info (click to toggle)
tora 1.3.21-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 14,252 kB
  • ctags: 10,397
  • sloc: cpp: 108,822; sh: 10,861; makefile: 766; xml: 69; perl: 6
file content (209 lines) | stat: -rw-r--r-- 7,875 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
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
/****************************************************************************
** Form implementation generated from reading ui file 'tobrowserfilterui.ui'
**
** Created: Mon Feb 20 12:46:37 2006
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "tobrowserfilterui.h"

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

/*
 *  Constructs a toBrowserFilterUI 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.
 */
toBrowserFilterUI::toBrowserFilterUI( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "toBrowserFilterUI" );
    toBrowserFilterUILayout = new QGridLayout( this, 1, 1, 11, 6, "toBrowserFilterUILayout"); 
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    toBrowserFilterUILayout->addItem( Spacer1, 4, 0 );

    OkButton = new QPushButton( this, "OkButton" );
    OkButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, OkButton->sizePolicy().hasHeightForWidth() ) );
    OkButton->setDefault( TRUE );

    toBrowserFilterUILayout->addWidget( OkButton, 4, 1 );

    Cancel = new QPushButton( this, "Cancel" );
    Cancel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, Cancel->sizePolicy().hasHeightForWidth() ) );

    toBrowserFilterUILayout->addWidget( Cancel, 4, 2 );

    Buttons = new QButtonGroup( this, "Buttons" );
    Buttons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)4, 0, 0, Buttons->sizePolicy().hasHeightForWidth() ) );
    Buttons->setColumnLayout(0, Qt::Vertical );
    Buttons->layout()->setSpacing( 6 );
    Buttons->layout()->setMargin( 11 );
    ButtonsLayout = new QGridLayout( Buttons->layout() );
    ButtonsLayout->setAlignment( Qt::AlignTop );

    String = new QLineEdit( Buttons, "String" );
    String->setEnabled( FALSE );

    ButtonsLayout->addMultiCellWidget( String, 1, 1, 0, 5 );

    None = new QRadioButton( Buttons, "None" );
    None->setChecked( TRUE );
    Buttons->insert( None, 0 );

    ButtonsLayout->addWidget( None, 0, 0 );

    StartWith = new QRadioButton( Buttons, "StartWith" );
    Buttons->insert( StartWith, 1 );

    ButtonsLayout->addWidget( StartWith, 0, 1 );

    EndWith = new QRadioButton( Buttons, "EndWith" );
    Buttons->insert( EndWith, 2 );

    ButtonsLayout->addWidget( EndWith, 0, 2 );

    Contains = new QRadioButton( Buttons, "Contains" );
    Buttons->insert( Contains, 3 );

    ButtonsLayout->addWidget( Contains, 0, 3 );

    RegExp = new QRadioButton( Buttons, "RegExp" );
    Buttons->insert( RegExp, 5 );

    ButtonsLayout->addWidget( RegExp, 0, 5 );

    CommaSeparate = new QRadioButton( Buttons, "CommaSeparate" );
    Buttons->insert( CommaSeparate, 4 );

    ButtonsLayout->addWidget( CommaSeparate, 0, 4 );

    toBrowserFilterUILayout->addMultiCellWidget( Buttons, 1, 1, 0, 2 );
    Spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    toBrowserFilterUILayout->addItem( Spacer2, 3, 0 );

    TablespaceType = new QButtonGroup( this, "TablespaceType" );
    TablespaceType->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, TablespaceType->sizePolicy().hasHeightForWidth() ) );
    TablespaceType->setColumnLayout(0, Qt::Vertical );
    TablespaceType->layout()->setSpacing( 6 );
    TablespaceType->layout()->setMargin( 11 );
    TablespaceTypeLayout = new QGridLayout( TablespaceType->layout() );
    TablespaceTypeLayout->setAlignment( Qt::AlignTop );

    IncludeAll = new QRadioButton( TablespaceType, "IncludeAll" );
    IncludeAll->setChecked( TRUE );

    TablespaceTypeLayout->addWidget( IncludeAll, 0, 0 );

    Include = new QRadioButton( TablespaceType, "Include" );

    TablespaceTypeLayout->addWidget( Include, 0, 1 );

    Exclude = new QRadioButton( TablespaceType, "Exclude" );

    TablespaceTypeLayout->addWidget( Exclude, 0, 2 );

    Tablespaces = new toResultView( TablespaceType, "Tablespaces" );
    Tablespaces->setEnabled( FALSE );
    Tablespaces->setFocusPolicy( toResultView::StrongFocus );

    TablespaceTypeLayout->addMultiCellWidget( Tablespaces, 1, 1, 0, 2 );

    toBrowserFilterUILayout->addMultiCellWidget( TablespaceType, 2, 2, 0, 2 );

    Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); 

     QCheckBox( this, "OnlyOwnSchema" );
    Layout1->addWidget( OnlyOwnSchema );

    IgnoreCase = new QCheckBox( this, "IgnoreCase" );
    IgnoreCase->setEnabled( FALSE );
    IgnoreCase->setChecked( TRUE );
    Layout1->addWidget( IgnoreCase );

    Invert = new QCheckBox( this, "Invert" );
    Invert->setEnabled( FALSE );
    Layout1->addWidget( Invert );

    toBrowserFilterUILayout->addMultiCellLayout( Layout1, 0, 0, 0, 2 );
    languageChange();
    resize( QSize(464, 378).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( None, SIGNAL( toggled(bool) ), String, SLOT( setDisabled(bool) ) );
    connect( None, SIGNAL( toggled(bool) ), IgnoreCase, SLOT( setDisabled(bool) ) );
    connect( None, SIGNAL( toggled(bool) ), Invert, SLOT( setDisabled(bool) ) );
    connect( Cancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( OkButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( IncludeAll, SIGNAL( toggled(bool) ), Tablespaces, SLOT( setDisabled(bool) ) );

    // tab order
    setTabOrder( OnlyOwnSchema, IgnoreCase );
    setTabOrder( IgnoreCase, Invert );
    setTabOrder( Invert, None );
    setTabOrder( None, String );
    setTabOrder( String, IncludeAll );
    setTabOrder( IncludeAll, Include );
    setTabOrder( Include, Exclude );
    setTabOrder( Exclude, Tablespaces );
    setTabOrder( Tablespaces, OkButton );
    setTabOrder( OkButton, Cancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void toBrowserFilterUI::languageChange()
{
    setCaption( tr( "Filter setting" ) );
    OkButton->setText( tr( "&Ok" ) );
    Cancel->setText( tr( "Cancel" ) );
    Buttons->setTitle( tr( "Filter on name" ) );
    None->setText( tr( "&No filter" ) );
    StartWith->setText( tr( "&Start with" ) );
    QToolTip::add( StartWith, tr( "Object name start with" ) );
    EndWith->setText( tr( "&End with" ) );
    QToolTip::add( EndWith, tr( "Object name ends in" ) );
    Contains->setText( tr( "&Contains" ) );
    QToolTip::add( Contains, tr( "Object name contains" ) );
    RegExp->setText( tr( "&RegExp" ) );
    QToolTip::add( RegExp, tr( "Object name matches RegExp" ) );
    CommaSeparate->setText( tr( "&Comma list" ) );
    QToolTip::add( CommaSeparate, tr( "Comma separated list of object names" ) );
    TablespaceType->setTitle( tr( "Filter on tablespace" ) );
    IncludeAll->setText( tr( "Include &All" ) );
    Include->setText( tr( "&Include" ) );
    Exclude->setText( tr( "&Exclude" ) );
    OnlyOwnSchema->setText( tr( "Only display own schema" ) );
    IgnoreCase->setText( tr( "Ignore &Case" ) );
    Invert->setText( tr( "&Invert selection" ) );
}

void toBrowserFilterUI::displayHelp()
{
    qWarning( "toBrowserFilterUI::displayHelp(): Not implemented yet" );
}