author | zcarsten <zcarsten> | 2003-07-22 19:23:13 (UTC) |
---|---|---|
committer | zcarsten <zcarsten> | 2003-07-22 19:23:13 (UTC) |
commit | fa3772aa7ddea5725cc7e7db42d017567e4cc14c (patch) (unidiff) | |
tree | 112ec27dd148d0b381ac559fd3e1ee32a89ecd0d /noncore/apps/zsafe/scqtfiledlg.cpp | |
parent | 059af0e82a14a32f068c2ad943dc918afca93587 (diff) | |
download | opie-fa3772aa7ddea5725cc7e7db42d017567e4cc14c.zip opie-fa3772aa7ddea5725cc7e7db42d017567e4cc14c.tar.gz opie-fa3772aa7ddea5725cc7e7db42d017567e4cc14c.tar.bz2 |
Initial revision
Diffstat (limited to 'noncore/apps/zsafe/scqtfiledlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/zsafe/scqtfiledlg.cpp | 261 |
1 files changed, 261 insertions, 0 deletions
diff --git a/noncore/apps/zsafe/scqtfiledlg.cpp b/noncore/apps/zsafe/scqtfiledlg.cpp new file mode 100644 index 0000000..d6cea64 --- a/dev/null +++ b/noncore/apps/zsafe/scqtfiledlg.cpp | |||
@@ -0,0 +1,261 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'scqtfiledlg.ui' | ||
3 | ** | ||
4 | ** Created: Sun Jun 8 15:51:12 2003 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "scqtfiledlg.h" | ||
10 | |||
11 | #include <qcombobox.h> | ||
12 | #include <qheader.h> | ||
13 | #include <qlineedit.h> | ||
14 | #include <qlistview.h> | ||
15 | #include <qpushbutton.h> | ||
16 | #include <qtoolbutton.h> | ||
17 | #include <qlayout.h> | ||
18 | #include <qvariant.h> | ||
19 | #include <qtooltip.h> | ||
20 | #include <qwhatsthis.h> | ||
21 | #include <qimage.h> | ||
22 | #include <qpixmap.h> | ||
23 | |||
24 | static const char* const image0_data[] = { | ||
25 | "24 16 3 1", | ||
26 | ". c None", | ||
27 | "# c #000040", | ||
28 | "a c #808080", | ||
29 | "........................", | ||
30 | "........................", | ||
31 | ".................####...", | ||
32 | ".................####...", | ||
33 | ".......##........#aa#...", | ||
34 | "......###........#aa#...", | ||
35 | ".....####........#aa#...", | ||
36 | "....##############aa#...", | ||
37 | "...###aaaaaaaaaaaaaa#...", | ||
38 | "..####aaaaaaaaaaaaaa#...", | ||
39 | "...###aaaaaaaaaaaaaa#...", | ||
40 | "....#################...", | ||
41 | ".....####...............", | ||
42 | "......###...............", | ||
43 | ".......##...............", | ||
44 | "........................"}; | ||
45 | |||
46 | static const char* const image1_data[] = { | ||
47 | "24 16 4 1", | ||
48 | ". c None", | ||
49 | "a c #008080", | ||
50 | "b c #808080", | ||
51 | "# c #ff0000", | ||
52 | "........................", | ||
53 | "........................", | ||
54 | "...####..........####...", | ||
55 | "...#####........#####...", | ||
56 | "....######.....#####a...", | ||
57 | ".....######...#####ba...", | ||
58 | ".....aa###########bba...", | ||
59 | "....aaaaa#######aabba...", | ||
60 | "...aaabbb######bbbbba...", | ||
61 | "..aaaabb########bbbba...", | ||
62 | "...aaa############bba...", | ||
63 | "....a######aaa#####aa...", | ||
64 | "....######.....######...", | ||
65 | "...#####a........####...", | ||
66 | "...####aa.........###...", | ||
67 | "........................"}; | ||
68 | |||
69 | static const char* const image2_data[] = { | ||
70 | "17 15 4 1", | ||
71 | "# c #000000", | ||
72 | ". c #dcdcdc", | ||
73 | "a c #ffff00", | ||
74 | "b c #ffffff", | ||
75 | ".................", | ||
76 | "............#....", | ||
77 | ".................", | ||
78 | "............#....", | ||
79 | ".........#.....#.", | ||
80 | "....####..#.#.#..", | ||
81 | "...#abab#..#.#...", | ||
82 | "..##########..#.#", | ||
83 | "..#babababab##...", | ||
84 | "..#ababababa#.#..", | ||
85 | "..#babababab#..#.", | ||
86 | "..#ababababa#....", | ||
87 | "..#babababab#....", | ||
88 | "..#ababababa#....", | ||
89 | "..###########...."}; | ||
90 | |||
91 | |||
92 | /* | ||
93 | * Constructs a ScQtFileDlg which is a child of 'parent', with the | ||
94 | * name 'name' and widget flags set to 'f' | ||
95 | * | ||
96 | * The dialog will by default be modeless, unless you set 'modal' to | ||
97 | * TRUE to construct a modal dialog. | ||
98 | */ | ||
99 | ScQtFileDlg::ScQtFileDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) | ||
100 | : QDialog( parent, name, modal, fl ) | ||
101 | { | ||
102 | QPixmap image0( ( const char** ) image0_data ); | ||
103 | QPixmap image1( ( const char** ) image1_data ); | ||
104 | QPixmap image2( ( const char** ) image2_data ); | ||
105 | if ( !name ) | ||
106 | setName( "ScQtFileDlg" ); | ||
107 | resize( 196, 279 ); | ||
108 | if (!name) | ||
109 | setCaption( tr( "FileDlg" ) ); | ||
110 | else | ||
111 | setCaption(name); | ||
112 | ScQtFileDlgLayout = new QVBoxLayout( this ); | ||
113 | ScQtFileDlgLayout->setSpacing( 6 ); | ||
114 | ScQtFileDlgLayout->setMargin( 11 ); | ||
115 | |||
116 | Layout5 = new QVBoxLayout; | ||
117 | Layout5->setSpacing( 6 ); | ||
118 | Layout5->setMargin( 0 ); | ||
119 | |||
120 | Layout4 = new QVBoxLayout; | ||
121 | Layout4->setSpacing( 6 ); | ||
122 | Layout4->setMargin( 0 ); | ||
123 | |||
124 | Layout3 = new QHBoxLayout; | ||
125 | Layout3->setSpacing( 6 ); | ||
126 | Layout3->setMargin( 0 ); | ||
127 | |||
128 | TypeComboBox = new QComboBox( FALSE, this, "TypeComboBox" ); | ||
129 | TypeComboBox->setEditable( TRUE ); | ||
130 | TypeComboBox->setInsertionPolicy( QComboBox::AtBottom ); | ||
131 | TypeComboBox->setAutoCompletion( FALSE ); | ||
132 | TypeComboBox->setDuplicatesEnabled( FALSE ); | ||
133 | QToolTip::add( TypeComboBox, tr( "file type filter" ) ); | ||
134 | QWhatsThis::add( TypeComboBox, tr( "ComboBox FileTypeFilter\n" | ||
135 | "\n" | ||
136 | "edit or select the filter" ) ); | ||
137 | Layout3->addWidget( TypeComboBox ); | ||
138 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
139 | Layout3->addItem( spacer ); | ||
140 | |||
141 | OkButton = new QToolButton( this, "OkButton" ); | ||
142 | OkButton->setText( tr( "" ) ); | ||
143 | OkButton->setPixmap( image0 ); | ||
144 | OkButton->setUsesBigPixmap( FALSE ); | ||
145 | QToolTip::add( OkButton, tr( "confirms the selection and closes the form" ) ); | ||
146 | QWhatsThis::add( OkButton, tr( "OKButton" ) ); | ||
147 | Layout3->addWidget( OkButton ); | ||
148 | |||
149 | CancelButton = new QToolButton( this, "CancelButton" ); | ||
150 | CancelButton->setText( tr( "" ) ); | ||
151 | CancelButton->setPixmap( image1 ); | ||
152 | CancelButton->setUsesBigPixmap( FALSE ); | ||
153 | QToolTip::add( CancelButton, tr( "cancels the selection and closes the form" ) ); | ||
154 | QWhatsThis::add( CancelButton, tr( "CancelButton" ) ); | ||
155 | Layout3->addWidget( CancelButton ); | ||
156 | Layout4->addLayout( Layout3 ); | ||
157 | |||
158 | Layout3_2 = new QHBoxLayout; | ||
159 | Layout3_2->setSpacing( 6 ); | ||
160 | Layout3_2->setMargin( 0 ); | ||
161 | |||
162 | FNameLineEdit = new QLineEdit( this, "FNameLineEdit" ); | ||
163 | QToolTip::add( FNameLineEdit, tr( "shows the selected filename" ) ); | ||
164 | QWhatsThis::add( FNameLineEdit, tr( "Filename LineEdit\n" | ||
165 | "\n" | ||
166 | "shows the selected file\n" | ||
167 | "and allows the direct filename\n" | ||
168 | "edit" ) ); | ||
169 | Layout3_2->addWidget( FNameLineEdit ); | ||
170 | |||
171 | MkDirButton = new QToolButton( this, "MkDirButton" ); | ||
172 | MkDirButton->setText( tr( "" ) ); | ||
173 | MkDirButton->setPixmap( image2 ); | ||
174 | MkDirButton->setUsesBigPixmap( FALSE ); | ||
175 | QToolTip::add( MkDirButton, tr( "confirms the selection and closes the form" ) ); | ||
176 | QWhatsThis::add( MkDirButton, tr( "OKButton" ) ); | ||
177 | Layout3_2->addWidget( MkDirButton ); | ||
178 | Layout4->addLayout( Layout3_2 ); | ||
179 | |||
180 | DirComboBox = new QComboBox( FALSE, this, "DirComboBox" ); | ||
181 | DirComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, DirComboBox->sizePolicy().hasHeightForWidth() ) ); | ||
182 | DirComboBox->setEditable( TRUE ); | ||
183 | DirComboBox->setDuplicatesEnabled( FALSE ); | ||
184 | QWhatsThis::add( DirComboBox, tr( "ComboBox Directory \n" | ||
185 | "edit or select the directories name" ) ); | ||
186 | Layout4->addWidget( DirComboBox ); | ||
187 | Layout5->addLayout( Layout4 ); | ||
188 | |||
189 | ListView = new QListView( this, "ListView" ); | ||
190 | ListView->addColumn( tr( "Name" ) ); | ||
191 | ListView->addColumn( tr( "size" ) ); | ||
192 | ListView->addColumn( tr( "type" ) ); | ||
193 | ListView->setRootIsDecorated( TRUE ); | ||
194 | QToolTip::add( ListView, tr( "directory listview" ) ); | ||
195 | QWhatsThis::add( ListView, tr( "Directory ListView\n" | ||
196 | "\n" | ||
197 | "shows the list of dirs and files" ) ); | ||
198 | Layout5->addWidget( ListView ); | ||
199 | ScQtFileDlgLayout->addLayout( Layout5 ); | ||
200 | |||
201 | // signals and slots connections | ||
202 | connect( OkButton, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); | ||
203 | connect( DirComboBox, SIGNAL( activated(int) ), this, SLOT( slotDirComboBoxChanged( int ) ) ); | ||
204 | connect( TypeComboBox, SIGNAL( activated(int) ), this, SLOT( slotTypeComboBoxChanged( int ) ) ); | ||
205 | connect( CancelButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); | ||
206 | connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem *) ) ); | ||
207 | connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem *) ) ); | ||
208 | connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotDoubleClicked(QListViewItem *) ) ); | ||
209 | connect( FNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotFileTextChanged( const QString & ) ) ); | ||
210 | connect( FNameLineEdit, SIGNAL( returnPressed() ), this, SLOT( slotOK() ) ); | ||
211 | connect( MkDirButton, SIGNAL( clicked() ), this, SLOT( slotMkDir() ) ); | ||
212 | } | ||
213 | |||
214 | /* | ||
215 | * Destroys the object and frees any allocated resources | ||
216 | */ | ||
217 | ScQtFileDlg::~ScQtFileDlg() | ||
218 | { | ||
219 | // no need to delete child widgets, Qt does it all for us | ||
220 | } | ||
221 | |||
222 | void ScQtFileDlg::slotCancel() | ||
223 | { | ||
224 | qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" ); | ||
225 | } | ||
226 | |||
227 | void ScQtFileDlg::slotDirComboBoxChanged( int ) | ||
228 | { | ||
229 | qWarning( "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" ); | ||
230 | } | ||
231 | |||
232 | void ScQtFileDlg::slotDoubleClicked(QListViewItem *) | ||
233 | { | ||
234 | qWarning( "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" ); | ||
235 | } | ||
236 | |||
237 | void ScQtFileDlg::slotFileTextChanged( const QString & ) | ||
238 | { | ||
239 | qWarning( "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" ); | ||
240 | } | ||
241 | |||
242 | void ScQtFileDlg::slotMkDir() | ||
243 | { | ||
244 | qWarning( "ScQtFileDlg::slotMkDir(): Not implemented yet!" ); | ||
245 | } | ||
246 | |||
247 | void ScQtFileDlg::slotOK() | ||
248 | { | ||
249 | qWarning( "ScQtFileDlg::slotOK(): Not implemented yet!" ); | ||
250 | } | ||
251 | |||
252 | void ScQtFileDlg::slotSelectionChanged(QListViewItem *) | ||
253 | { | ||
254 | qWarning( "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" ); | ||
255 | } | ||
256 | |||
257 | void ScQtFileDlg::slotTypeComboBoxChanged( int ) | ||
258 | { | ||
259 | qWarning( "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" ); | ||
260 | } | ||
261 | |||