-rw-r--r-- | libopie/ofileselector.cc | 123 | ||||
-rw-r--r-- | libopie/ofileselector.h | 15 |
2 files changed, 111 insertions, 27 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index cb18039..d1f1e1f 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc | |||
@@ -1,743 +1,771 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 3 | .=l. Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <qnamespace.h> | 29 | #include <qnamespace.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | #include <qcombobox.h> | 31 | #include <qcombobox.h> |
32 | #include <qhbox.h> | 32 | #include <qhbox.h> |
33 | #include <qvbox.h> | 33 | #include <qvbox.h> |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qwidgetstack.h> | 35 | #include <qwidgetstack.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qcheckbox.h> | 37 | #include <qcheckbox.h> |
38 | #include <qlabel.h> | 38 | #include <qlabel.h> |
39 | #include <qheader.h> | 39 | #include <qheader.h> |
40 | #include <qdir.h> | 40 | #include <qdir.h> |
41 | #include <qpainter.h> | 41 | #include <qpainter.h> |
42 | #include <qaction.h> | 42 | #include <qaction.h> |
43 | #include <qpopupmenu.h> | 43 | #include <qpopupmenu.h> |
44 | #include <qcursor.h> | 44 | #include <qcursor.h> |
45 | #include <qstringlist.h> | ||
46 | #include <qmessagebox.h> | ||
45 | 47 | ||
46 | #include <qpe/qpeapplication.h> | 48 | #include <qpe/qpeapplication.h> |
47 | #include <qpe/fileselector.h> | 49 | #include <qpe/fileselector.h> |
48 | #include <qpe/applnk.h> | 50 | #include <qpe/applnk.h> |
49 | #include <qpe/global.h> | 51 | #include <qpe/global.h> |
50 | #include <qpe/mimetype.h> | 52 | #include <qpe/mimetype.h> |
51 | #include <qpe/resource.h> | 53 | #include <qpe/resource.h> |
52 | #include <qpe/storage.h> | 54 | #include <qpe/storage.h> |
53 | 55 | ||
54 | #include <unistd.h> | 56 | #include <unistd.h> |
55 | #include <stdlib.h> | 57 | #include <stdlib.h> |
56 | #include <sys/stat.h> | 58 | #include <sys/stat.h> |
57 | 59 | ||
58 | #include "ofileselector.h" | 60 | #include "ofileselector.h" |
59 | 61 | ||
60 | QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0; | 62 | QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0; |
61 | 63 | ||
62 | namespace { | 64 | namespace { |
63 | 65 | ||
64 | int indexByString( const QComboBox *box, const QString &str ){ | 66 | int indexByString( const QComboBox *box, const QString &str ){ |
65 | int index= -1; | 67 | int index= -1; |
66 | for(int i= 0; i < box->count(); i++ ){ | 68 | for(int i= 0; i < box->count(); i++ ){ |
67 | qWarning("str T%sT boxT%sT", str.latin1(), box->text(i).latin1() ); | 69 | qWarning("str T%sT boxT%sT", str.latin1(), box->text(i).latin1() ); |
68 | if( str == box->text(i ) ){ | 70 | if( str == box->text(i ) ){ |
69 | index= i; | 71 | index= i; |
70 | break; | 72 | break; |
71 | } | 73 | } |
72 | } | 74 | } |
73 | return index; | 75 | return index; |
74 | } | 76 | } |
75 | 77 | ||
76 | }; | 78 | }; |
77 | 79 | ||
78 | 80 | ||
79 | OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, | 81 | OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, |
80 | const QString &fileName, const QStringList &mimetypes ) : QWidget( wid ) | 82 | const QString &fileName, const QStringList &mimetypes ) : QWidget( wid ) |
81 | { | 83 | { |
82 | if(wid!=0) | 84 | if(wid!=0) |
83 | resize(wid->width(),wid->height()); | 85 | resize(wid->width(),wid->height()); |
84 | m_selector = selector; | 86 | m_selector = selector; |
85 | m_currentDir = dirName; | 87 | m_currentDir = dirName; |
86 | m_name = fileName; | 88 | m_name = fileName; |
87 | m_mimetypes = mimetypes; | 89 | m_mimetypes = mimetypes; |
88 | // if( mimetypes.isEmpty() ) | 90 | // if( mimetypes.isEmpty() ) |
89 | // m_autoMime = true; | 91 | // m_autoMime = true; |
90 | 92 | ||
91 | m_mode = mode; | 93 | m_mode = mode; |
92 | m_shTool = true; | 94 | m_shTool = true; |
93 | m_shPerm = true; | 95 | m_shPerm = true; |
94 | m_shLne = true; | 96 | m_shLne = true; |
95 | m_shChooser = true; | 97 | m_shChooser = true; |
96 | m_shYesNo = true; | 98 | m_shYesNo = true; |
97 | // for FILESELECTOR only view is interesting | 99 | // for FILESELECTOR only view is interesting |
98 | m_location = 0; | 100 | m_location = 0; |
99 | m_homeButton = 0; | 101 | m_homeButton = 0; |
100 | m_docButton = 0; | 102 | m_docButton = 0; |
101 | m_hideButton = 0; | 103 | m_hideButton = 0; |
102 | m_ok = 0; | 104 | m_ok = 0; |
103 | m_cancel = 0; | 105 | m_cancel = 0; |
104 | m_reread = 0; | 106 | m_reread = 0; |
105 | m_up = 0; | 107 | m_up = 0; |
106 | m_View = 0; | 108 | m_View = 0; |
107 | m_select = 0; | 109 | m_select = 0; |
108 | m_stack = 0; | 110 | m_stack = 0; |
109 | 111 | ||
110 | m_select = 0; | 112 | m_select = 0; |
111 | m_stack = 0; | 113 | m_stack = 0; |
112 | m_lay = 0; | 114 | m_lay = 0; |
113 | m_boxToolbar = 0; | 115 | m_boxToolbar = 0; |
114 | m_boxOk = 0; | 116 | m_boxOk = 0; |
115 | m_edit = 0; | 117 | m_edit = 0; |
116 | 118 | ||
117 | m_fnLabel = 0; | 119 | m_fnLabel = 0; |
118 | m_checkPerm = 0; | 120 | m_checkPerm = 0; |
119 | m_mimeCheck = 0; | 121 | m_mimeCheck = 0; |
120 | m_viewCheck = 0; | 122 | m_viewCheck = 0; |
121 | 123 | ||
122 | m_pseudo = 0; | 124 | m_pseudo = 0; |
123 | m_pseudoLayout = 0; | 125 | m_pseudoLayout = 0; |
124 | 126 | ||
125 | m_dir = true; | 127 | m_dir = true; |
126 | m_files = true; | 128 | m_files = true; |
127 | m_custom = 0; | 129 | m_custom = 0; |
128 | m_showPopup = true; | 130 | m_showPopup = true; |
129 | 131 | ||
130 | if(m_pixmaps == 0 ) // init the pixmaps | 132 | if(m_pixmaps == 0 ) // init the pixmaps |
131 | initPics(); | 133 | initPics(); |
132 | 134 | ||
133 | m_lay = new QVBoxLayout(this); | 135 | m_lay = new QVBoxLayout(this); |
134 | init(); | 136 | init(); |
135 | m_edit->setText( fileName ); | 137 | m_edit->setText( fileName ); |
136 | } | 138 | } |
139 | |||
137 | void OFileSelector::initPics() | 140 | void OFileSelector::initPics() |
138 | { | 141 | { |
139 | qWarning("init pics" ); | 142 | qWarning("init pics" ); |
140 | m_pixmaps = new QMap<QString,QPixmap>; | 143 | m_pixmaps = new QMap<QString,QPixmap>; |
141 | QPixmap pm = Resource::loadPixmap( "folder" ); | 144 | QPixmap pm = Resource::loadPixmap( "folder" ); |
142 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 145 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
143 | QPainter painter( &pm ); | 146 | QPainter painter( &pm ); |
144 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 147 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
145 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | 148 | pm.setMask( pm.createHeuristicMask( FALSE ) ); |
146 | m_pixmaps->insert("dirsymlink", pm ); | 149 | m_pixmaps->insert("dirsymlink", pm ); |
147 | 150 | ||
148 | QPixmap pm2 = Resource::loadPixmap( "lockedfolder" ); | 151 | QPixmap pm2 = Resource::loadPixmap( "lockedfolder" ); |
149 | QPainter pen(&pm2 ); | 152 | QPainter pen(&pm2 ); |
150 | pen.drawPixmap(pm2.width()-lnk.width(), pm2.height()-lnk.height(), lnk ); | 153 | pen.drawPixmap(pm2.width()-lnk.width(), pm2.height()-lnk.height(), lnk ); |
151 | pm2.setMask( pm2.createHeuristicMask( FALSE ) ); | 154 | pm2.setMask( pm2.createHeuristicMask( FALSE ) ); |
152 | m_pixmaps->insert("symlinkedlocked", pm2 ); | 155 | m_pixmaps->insert("symlinkedlocked", pm2 ); |
153 | 156 | ||
154 | }; | 157 | } |
158 | |||
155 | // let's initialize the gui | 159 | // let's initialize the gui |
156 | /** | 160 | /** |
157 | -------------------- | 161 | -------------------- |
158 | | cmbBox Button | | 162 | | cmbBox Button | |
159 | -------------------- | 163 | -------------------- |
160 | | FileSlector | | 164 | | FileSlector | |
161 | | or | | 165 | | or | |
162 | | OSelector | | 166 | | OSelector | |
163 | | | | 167 | | | |
164 | | | | 168 | | | |
165 | ____________________ | 169 | ____________________ |
166 | | LineEdit | | 170 | | LineEdit | |
167 | ____________________ | 171 | ____________________ |
168 | | Permission Bar | | 172 | | Permission Bar | |
169 | ____________________ | 173 | ____________________ |
170 | | ViewChoose | | 174 | | ViewChoose | |
171 | ____________________ | 175 | ____________________ |
172 | | Save Cancel| | 176 | | Save Cancel| |
173 | ____________________ | 177 | ____________________ |
174 | */ | 178 | */ |
175 | void OFileSelector::delItems() | 179 | void OFileSelector::delItems() |
176 | { | 180 | { |
177 | QLayoutIterator it = m_lay->iterator(); | 181 | QLayoutIterator it = m_lay->iterator(); |
178 | while ( it.current() != 0 ){ | 182 | while ( it.current() != 0 ){ |
179 | it.deleteCurrent(); | 183 | it.deleteCurrent(); |
180 | } | 184 | } |
181 | } | 185 | } |
186 | |||
182 | void OFileSelector::init() | 187 | void OFileSelector::init() |
183 | { | 188 | { |
184 | 189 | ||
185 | m_stack = new QWidgetStack(this, "wstack" ); | 190 | m_stack = new QWidgetStack(this, "wstack" ); |
186 | if( m_selector == NORMAL ){ | 191 | if( m_selector == NORMAL ){ |
187 | QString currMime; | 192 | QString currMime; |
188 | if( m_mimeCheck != 0 ) | 193 | if( m_mimeCheck != 0 ) |
189 | currMime = m_mimeCheck->currentText(); | 194 | currMime = m_mimeCheck->currentText(); |
190 | 195 | ||
191 | updateMimes(); | 196 | updateMimes(); |
192 | m_select = new FileSelector( currMime == "All" ? QString::null : currMime , m_stack, "fileselector", FALSE, FALSE ); | 197 | m_select = new FileSelector( currMime == "All" ? QString::null : currMime , m_stack, "fileselector", FALSE, FALSE ); |
193 | m_stack->addWidget(m_select, NORMAL ); | 198 | m_stack->addWidget(m_select, NORMAL ); |
194 | m_lay->addWidget(m_stack ); | 199 | m_lay->addWidget(m_stack ); |
195 | m_stack->raiseWidget(NORMAL ); | 200 | m_stack->raiseWidget(NORMAL ); |
196 | connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); | 201 | connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); |
197 | m_pseudoLayout = 0l; | 202 | m_pseudoLayout = 0l; |
198 | }else { | 203 | }else { |
199 | initializeListView(); | 204 | initializeListView(); |
200 | } | 205 | } |
201 | 206 | ||
202 | if(m_shLne ){ | 207 | if(m_shLne ){ |
203 | initializeName(); | 208 | initializeName(); |
204 | } | 209 | } |
205 | 210 | ||
206 | if(m_shPerm ){ | 211 | if(m_shPerm ){ |
207 | m_checkPerm = new QCheckBox(tr("Set Permission"), this, "Permission" ); | 212 | m_checkPerm = new QCheckBox(tr("Set Permission"), this, "Permission" ); |
208 | m_checkPerm->setChecked( false ); | 213 | m_checkPerm->setChecked( false ); |
209 | m_lay->addWidget(m_checkPerm ); | 214 | m_lay->addWidget(m_checkPerm ); |
210 | } | 215 | } |
211 | 216 | ||
212 | if( m_shChooser ) | 217 | if( m_shChooser ) |
213 | initializeChooser(); | 218 | initializeChooser(); |
214 | 219 | ||
215 | if(m_shYesNo ) | 220 | if(m_shYesNo ) |
216 | initializeYes(); | 221 | initializeYes(); |
217 | 222 | ||
218 | 223 | ||
219 | }; | 224 | } |
220 | 225 | ||
221 | void OFileSelector::setYesCancelVisible( bool show ) | 226 | void OFileSelector::setYesCancelVisible( bool show ) |
222 | { | 227 | { |
223 | if ( show == m_shYesNo ) | 228 | if ( show == m_shYesNo ) |
224 | return; | 229 | return; |
225 | m_shYesNo = show; | 230 | m_shYesNo = show; |
226 | if( !show ){ | 231 | if( !show ){ |
227 | delete m_ok; | 232 | delete m_ok; |
228 | delete m_cancel; | 233 | delete m_cancel; |
229 | m_ok = 0; | 234 | m_ok = 0; |
230 | m_cancel = 0; | 235 | m_cancel = 0; |
231 | // delete m_boxOk; all ready deleted in delItems | 236 | // delete m_boxOk; all ready deleted in delItems |
232 | } | 237 | } |
233 | updateLay(); // recreate it and save the other states | 238 | updateLay(); // recreate it and save the other states |
234 | } | 239 | } |
235 | 240 | ||
236 | void OFileSelector::setToolbarVisible( bool show ) | 241 | void OFileSelector::setToolbarVisible( bool show ) |
237 | { | 242 | { |
238 | if ( m_shTool == show ) | 243 | if ( m_shTool == show ) |
239 | return; | 244 | return; |
240 | if(!m_shTool ){ | 245 | if(!m_shTool ){ |
241 | delete m_boxToolbar; | 246 | delete m_boxToolbar; |
242 | delete m_homeButton; | 247 | delete m_homeButton; |
243 | delete m_docButton; | 248 | delete m_docButton; |
244 | delete m_location; | 249 | delete m_location; |
245 | delete m_up; | 250 | delete m_up; |
246 | m_boxToolbar = 0; | 251 | m_boxToolbar = 0; |
247 | m_homeButton = 0; | 252 | m_homeButton = 0; |
248 | m_docButton = 0; | 253 | m_docButton = 0; |
249 | m_location = 0; | 254 | m_location = 0; |
250 | m_up = 0; | 255 | m_up = 0; |
251 | }; | 256 | }; |
252 | updateLay();// overkill fix it | 257 | updateLay();// overkill fix it |
253 | } | 258 | } |
254 | 259 | ||
255 | void OFileSelector::setPermissionBarVisible( bool show ) | 260 | void OFileSelector::setPermissionBarVisible( bool show ) |
256 | { | 261 | { |
257 | if( show == m_shPerm ) | 262 | if( show == m_shPerm ) |
258 | return; | 263 | return; |
259 | 264 | ||
260 | m_shPerm = show; | 265 | m_shPerm = show; |
261 | 266 | ||
262 | updateLay(); | 267 | updateLay(); |
263 | } | 268 | } |
269 | |||
264 | void OFileSelector::setLineEditVisible( bool show ) | 270 | void OFileSelector::setLineEditVisible( bool show ) |
265 | { | 271 | { |
266 | if( show == m_shLne ) | 272 | if( show == m_shLne ) |
267 | return; | 273 | return; |
268 | 274 | ||
269 | m_shLne = show; | 275 | m_shLne = show; |
270 | if( !show ){ | 276 | if( !show ){ |
271 | delete m_edit; | 277 | delete m_edit; |
272 | delete m_fnLabel; | 278 | delete m_fnLabel; |
273 | m_edit = 0; | 279 | m_edit = 0; |
274 | m_fnLabel = 0; | 280 | m_fnLabel = 0; |
275 | //delete m_boxName; will be deleted | 281 | //delete m_boxName; will be deleted |
276 | } | 282 | } |
277 | updateLay(); | 283 | updateLay(); |
278 | } | 284 | } |
285 | |||
279 | void OFileSelector::setChooserVisible( bool show ) | 286 | void OFileSelector::setChooserVisible( bool show ) |
280 | { | 287 | { |
281 | if( show = m_shChooser ) | 288 | if( show = m_shChooser ) |
282 | return; | 289 | return; |
283 | m_shChooser = show; | 290 | m_shChooser = show; |
284 | if( !show ){ | 291 | if( !show ){ |
285 | delete m_mimeCheck; | 292 | delete m_mimeCheck; |
286 | delete m_viewCheck; | 293 | delete m_viewCheck; |
287 | m_mimeCheck = 0; | 294 | m_mimeCheck = 0; |
288 | m_viewCheck = 0; | 295 | m_viewCheck = 0; |
289 | } | 296 | } |
290 | updateLay(); | 297 | updateLay(); |
291 | } | 298 | } |
299 | |||
292 | QCheckBox* OFileSelector::permissionCheckbox( ) | 300 | QCheckBox* OFileSelector::permissionCheckbox( ) |
293 | { | 301 | { |
294 | return m_checkPerm; | 302 | return m_checkPerm; |
295 | } | 303 | } |
304 | |||
296 | void OFileSelector::setCaseSensetive( bool caSe ) | 305 | void OFileSelector::setCaseSensetive( bool caSe ) |
297 | { | 306 | { |
298 | m_case = caSe; | 307 | m_case = caSe; |
299 | reparse(); | 308 | reparse(); |
300 | } | 309 | } |
310 | |||
301 | void OFileSelector::setShowFiles(bool files ){ | 311 | void OFileSelector::setShowFiles(bool files ){ |
302 | m_files = files; | 312 | m_files = files; |
303 | reparse(); | 313 | reparse(); |
304 | } | 314 | } |
315 | |||
305 | void OFileSelector::setPopupMenu(QPopupMenu *pop ) | 316 | void OFileSelector::setPopupMenu(QPopupMenu *pop ) |
306 | { | 317 | { |
307 | //delete oldpopup; | 318 | //delete oldpopup; |
308 | m_custom = pop; | 319 | m_custom = pop; |
309 | } | 320 | } |
321 | |||
310 | bool OFileSelector::setPermission( ) const | 322 | bool OFileSelector::setPermission( ) const |
311 | { | 323 | { |
312 | if( m_checkPerm == 0 ) | 324 | if( m_checkPerm == 0 ) |
313 | return false; | 325 | return false; |
314 | else | 326 | else |
315 | return m_checkPerm->isChecked(); | 327 | return m_checkPerm->isChecked(); |
316 | } | 328 | } |
329 | |||
317 | void OFileSelector::setPermissionChecked( bool check ) | 330 | void OFileSelector::setPermissionChecked( bool check ) |
318 | { | 331 | { |
319 | if( m_checkPerm == 0 ) | 332 | if( m_checkPerm == 0 ) |
320 | return; | 333 | return; |
321 | m_checkPerm->setChecked( check ); | 334 | m_checkPerm->setChecked( check ); |
322 | } | 335 | } |
336 | |||
323 | QString OFileSelector::selectedName( )const | 337 | QString OFileSelector::selectedName( )const |
324 | { | 338 | { |
325 | QString string; | 339 | QString string; |
326 | if( m_selector == NORMAL ){ | 340 | if( m_selector == NORMAL ){ |
327 | const DocLnk *lnk = m_select->selected(); | 341 | const DocLnk *lnk = m_select->selected(); |
328 | string = lnk->file(); | 342 | string = lnk->file(); |
329 | }else if(m_selector == EXTENDED || m_selector == EXTENDED_ALL ) { | 343 | }else if(m_selector == EXTENDED || m_selector == EXTENDED_ALL ) { |
330 | QListViewItem *item = m_View->currentItem(); | 344 | QListViewItem *item = m_View->currentItem(); |
331 | if(item != 0 ){ | 345 | if(item != 0 ){ |
332 | string = m_currentDir + "/" + item->text( 1 ); | 346 | string = m_currentDir + "/" + item->text( 1 ); |
333 | } | 347 | } |
334 | } | 348 | } |
335 | return string; | 349 | return string; |
336 | } | 350 | } |
351 | |||
337 | QStringList OFileSelector::selectedNames()const | 352 | QStringList OFileSelector::selectedNames()const |
338 | { | 353 | { |
339 | QStringList list; | 354 | QStringList list; |
340 | return list; | 355 | return list; |
341 | } | 356 | } |
357 | |||
342 | DocLnk OFileSelector::selectedDocument( )const | 358 | DocLnk OFileSelector::selectedDocument( )const |
343 | { | 359 | { |
344 | DocLnk lnk; | 360 | DocLnk lnk; |
345 | return lnk; | 361 | return lnk; |
346 | } | 362 | } |
347 | void OFileSelector::updateLay() | 363 | void OFileSelector::updateLay() |
348 | { | 364 | { |
349 | /* if( m_shTool ) | 365 | /* if( m_shTool ) |
350 | // | 366 | // |
351 | else | 367 | else |
352 | // hide | 368 | // hide |
353 | */ | 369 | */ |
354 | // save the state | 370 | // save the state |
355 | bool check = false; | 371 | bool check = false; |
356 | if( m_checkPerm != 0 ) | 372 | if( m_checkPerm != 0 ) |
357 | check = m_checkPerm->isChecked(); | 373 | check = m_checkPerm->isChecked(); |
358 | QString text; | 374 | QString text; |
359 | 375 | ||
360 | if( m_edit != 0 ) | 376 | if( m_edit != 0 ) |
361 | text = m_edit->text(); | 377 | text = m_edit->text(); |
362 | // save current mimetype | 378 | // save current mimetype |
363 | 379 | ||
364 | delItems(); | 380 | delItems(); |
365 | delete m_checkPerm; | 381 | delete m_checkPerm; |
366 | m_checkPerm = 0; | 382 | m_checkPerm = 0; |
367 | delete m_edit; | 383 | delete m_edit; |
368 | m_edit = 0; | 384 | m_edit = 0; |
369 | delete m_fnLabel; | 385 | delete m_fnLabel; |
370 | m_fnLabel = 0; | 386 | m_fnLabel = 0; |
371 | delete m_ok; | 387 | delete m_ok; |
372 | m_ok = 0; | 388 | m_ok = 0; |
373 | delete m_cancel; | 389 | delete m_cancel; |
374 | m_cancel = 0; | 390 | m_cancel = 0; |
375 | delete m_mimeCheck; | 391 | delete m_mimeCheck; |
376 | m_mimeCheck = 0; | 392 | m_mimeCheck = 0; |
377 | delete m_viewCheck; | 393 | delete m_viewCheck; |
378 | m_viewCheck = 0; | 394 | m_viewCheck = 0; |
379 | delete m_select; // test | 395 | delete m_select; // test |
380 | delete m_stack; | 396 | delete m_stack; |
381 | //delete m_list; | 397 | //delete m_list; |
382 | init(); | 398 | init(); |
383 | if( m_shLne ) | 399 | if( m_shLne ) |
384 | m_edit->setText(text ); | 400 | m_edit->setText(text ); |
385 | if( m_shPerm ) | 401 | if( m_shPerm ) |
386 | m_checkPerm->setChecked(check ); | 402 | m_checkPerm->setChecked(check ); |
387 | } | 403 | } |
404 | |||
388 | // let's update the mimetypes. Use the current mimefilter for the 2nd QDir retrieve | 405 | // let's update the mimetypes. Use the current mimefilter for the 2nd QDir retrieve |
389 | // insert QListViewItems with the right options | 406 | // insert QListViewItems with the right options |
390 | bool OFileSelector::compliesMime(const QString &path, const QString &mime ) | 407 | bool OFileSelector::compliesMime(const QString &path, const QString &mime ) |
391 | { | 408 | { |
392 | if( mime == "All" ) | 409 | if( mime == "All" ) |
393 | return true; | 410 | return true; |
394 | MimeType type( path ); | 411 | MimeType type( path ); |
395 | if( type.id() == mime ) | 412 | if( type.id() == mime ) |
396 | return true; | 413 | return true; |
397 | return false; | 414 | return false; |
398 | } | 415 | } |
399 | 416 | ||
400 | void OFileSelector::reparse() | 417 | void OFileSelector::reparse() |
401 | { | 418 | { |
402 | if(m_View== 0 || m_selector == NORMAL) | 419 | if(m_View== 0 || m_selector == NORMAL) |
403 | return; | 420 | return; |
404 | 421 | ||
405 | m_View->clear(); | 422 | m_View->clear(); |
406 | 423 | ||
407 | 424 | ||
408 | QString currMime =m_mimeCheck->currentText(); | 425 | QString currMime =m_mimeCheck->currentText(); |
409 | // update the mimetype now | 426 | // update the mimetype now |
410 | if( m_autoMime ) { | 427 | if( m_autoMime ) { |
411 | QDir dir( m_currentDir ); | 428 | QDir dir( m_currentDir ); |
412 | m_mimetypes.clear(); | 429 | m_mimetypes.clear(); |
413 | m_mimeCheck->clear(); | 430 | m_mimeCheck->clear(); |
414 | dir.setFilter( QDir::Files | QDir::Readable ); | 431 | dir.setFilter( QDir::Files | QDir::Readable ); |
415 | dir.setSorting(QDir::Size ); | 432 | dir.setSorting(QDir::Size ); |
416 | const QFileInfoList *list = dir.entryInfoList(); | 433 | const QFileInfoList *list = dir.entryInfoList(); |
417 | QFileInfoListIterator it( *list ); | 434 | QFileInfoListIterator it( *list ); |
418 | QFileInfo *fi; | 435 | QFileInfo *fi; |
419 | while( (fi=it.current()) ){ | 436 | while( (fi=it.current()) ){ |
420 | if(fi->extension() == QString::fromLatin1("desktop") ){ | 437 | if(fi->extension() == QString::fromLatin1("desktop") ){ |
421 | ++it; | 438 | ++it; |
422 | continue; | 439 | continue; |
423 | } | 440 | } |
424 | MimeType type(fi->filePath() ); | 441 | MimeType type(fi->filePath() ); |
425 | if( !m_mimetypes.contains( type.id() ) ) | 442 | if( !m_mimetypes.contains( type.id() ) ) |
426 | m_mimetypes.append( type.id() ); | 443 | m_mimetypes.append( type.id() ); |
427 | 444 | ||
428 | ++it; | 445 | ++it; |
429 | } | 446 | } |
430 | m_mimetypes.prepend("All" ); | 447 | m_mimetypes.prepend("All" ); |
431 | m_mimeCheck->insertStringList(m_mimetypes ); | 448 | m_mimeCheck->insertStringList(m_mimetypes ); |
432 | // set it to the current mimetype | 449 | // set it to the current mimetype |
433 | m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currMime ) ); | 450 | m_mimeCheck->setCurrentItem( indexByString( m_mimeCheck, currMime ) ); |
434 | }; | 451 | }; |
452 | |||
435 | QDir dir( m_currentDir ); | 453 | QDir dir( m_currentDir ); |
436 | //dir.setFilter(-1 ); | 454 | //dir.setFilter(-1 ); |
437 | int sort = QDir::Name | QDir::DirsFirst | QDir::Reversed; | 455 | int sort = QDir::Name | QDir::DirsFirst | QDir::Reversed; |
438 | if( m_case ) | 456 | if( m_case ) |
439 | sort = QDir::IgnoreCase; | 457 | sort = QDir::IgnoreCase; |
440 | dir.setSorting( sort ); | 458 | dir.setSorting( sort ); |
441 | 459 | ||
442 | int filter; | 460 | int filter; |
443 | /* if( m_dir && !m_files) | 461 | /* if( m_dir && !m_files) |
444 | filter |= QDir::Dirs; | 462 | filter |= QDir::Dirs; |
445 | else if( !m_dir && m_files ) | 463 | else if( !m_dir && m_files ) |
446 | filter |= QDir::Files; | 464 | filter |= QDir::Files; |
447 | else | 465 | else |
448 | filter |= QDir::All; | 466 | filter |= QDir::All; |
449 | */ | 467 | */ |
450 | if( m_selector == EXTENDED_ALL ) | 468 | if( m_selector == EXTENDED_ALL ) |
451 | filter = QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All; | 469 | filter = QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All; |
452 | else | 470 | else |
453 | filter = QDir::Files | QDir::Dirs | QDir::All; | 471 | filter = QDir::Files | QDir::Dirs | QDir::All; |
454 | dir.setFilter( filter ); | 472 | dir.setFilter( filter ); |
455 | 473 | ||
456 | const QFileInfoList *list = dir.entryInfoList(); | 474 | const QFileInfoList *list = dir.entryInfoList(); |
457 | QFileInfoListIterator it( *list ); | 475 | QFileInfoListIterator it( *list ); |
458 | QFileInfo *fi; | 476 | QFileInfo *fi; |
459 | while( (fi=it.current()) ){ | 477 | while( (fi=it.current()) ){ |
460 | if(fi->fileName() == ".." || fi->fileName() == "." ){ | 478 | if(fi->fileName() == ".." || fi->fileName() == "." ){ |
461 | ++it; | 479 | ++it; |
462 | continue; | 480 | continue; |
463 | } | 481 | } |
464 | qWarning("Test: %s", fi->fileName().latin1() ); | 482 | qWarning("Test: %s", fi->fileName().latin1() ); |
465 | if(fi->isSymLink() ){ | 483 | if(fi->isSymLink() ){ |
466 | qWarning("Symlink %s", fi->fileName().latin1() ); | 484 | qWarning("Symlink %s", fi->fileName().latin1() ); |
467 | QString file = fi->dirPath(true)+"/"+ fi->readLink(); | 485 | QString file = fi->dirPath(true)+"/"+ fi->readLink(); |
468 | qWarning("File ->%s", file.latin1() ); | 486 | qWarning("File ->%s", file.latin1() ); |
469 | for(int i=0; i<=4; i++ ){ // prepend from dos | 487 | for(int i=0; i<=4; i++ ){ // prepend from dos |
470 | QFileInfo info( file ); | 488 | QFileInfo info( file ); |
471 | if( !info.exists() ){ | 489 | if( !info.exists() ){ |
472 | qWarning("does not exist" ); | 490 | qWarning("does not exist" ); |
473 | addSymlink(currMime, fi, TRUE ); | 491 | addSymlink(currMime, fi, TRUE ); |
474 | break; | 492 | break; |
475 | }else if( info.isDir() ){ | 493 | }else if( info.isDir() ){ |
476 | qWarning("isDir" ); | 494 | qWarning("isDir" ); |
477 | addDir(currMime, fi, TRUE ); | 495 | addDir(currMime, fi, TRUE ); |
478 | break; | 496 | break; |
479 | }else if( info.isFile() ){ | 497 | }else if( info.isFile() ){ |
480 | qWarning("isFile" ); | 498 | qWarning("isFile" ); |
481 | addFile(currMime, fi, TRUE ); | 499 | addFile(currMime, fi, TRUE ); |
482 | break; | 500 | break; |
483 | }else if( info.isSymLink() ){ | 501 | }else if( info.isSymLink() ){ |
484 | file = info.dirPath(true)+ "/"+ info.readLink(); | 502 | file = info.dirPath(true)+ "/"+ info.readLink(); |
485 | qWarning("isSymlink again %s", file.latin1() ); | 503 | qWarning("isSymlink again %s", file.latin1() ); |
486 | }else if( i == 4 ){ // just insert it and have the symlink symbol | 504 | }else if( i == 4 ){ // just insert it and have the symlink symbol |
487 | addSymlink(currMime, fi ); | 505 | addSymlink(currMime, fi ); |
488 | qWarning("level too deep" ); | 506 | qWarning("level too deep" ); |
489 | } | 507 | } |
490 | } | 508 | } |
491 | }else if( fi->isDir() ){ | 509 | }else if( fi->isDir() ){ |
492 | addDir(currMime, fi ); | 510 | addDir(currMime, fi ); |
493 | }else if( fi->isFile() ) { // file ? | 511 | }else if( fi->isFile() ) { // file ? |
494 | addFile(currMime, fi ); | 512 | addFile(currMime, fi ); |
495 | } | 513 | } |
496 | ++it; | 514 | ++it; |
497 | } | 515 | } |
498 | m_View->sort(); | 516 | m_View->sort(); |
499 | } | 517 | } |
518 | |||
500 | QString OFileSelector::directory()const | 519 | QString OFileSelector::directory()const |
501 | { | 520 | { |
502 | return m_currentDir; | 521 | QDir d( m_currentDir); |
522 | return d.absPath(); | ||
503 | } | 523 | } |
524 | |||
504 | int OFileSelector::fileCount() | 525 | int OFileSelector::fileCount() |
505 | { | 526 | { |
506 | return 0; | 527 | return 0; |
507 | } | 528 | } |
529 | |||
508 | void OFileSelector::slotOk( ) | 530 | void OFileSelector::slotOk( ) |
509 | { | 531 | { |
510 | emit ok(); | 532 | emit ok(); |
511 | } | 533 | } |
534 | |||
512 | void OFileSelector::slotCancel( ) | 535 | void OFileSelector::slotCancel( ) |
513 | { | 536 | { |
514 | emit cancel(); | 537 | emit cancel(); |
515 | } | 538 | } |
516 | 539 | ||
517 | void OFileSelector::initializeName() | 540 | void OFileSelector::initializeName() |
518 | { | 541 | { |
519 | m_boxName = new QHBoxLayout(this ); | 542 | m_boxName = new QHBoxLayout(this ); |
520 | m_edit = new QLineEdit(this ); | 543 | m_edit = new QLineEdit(this ); |
521 | m_fnLabel = new QLabel(this ); | 544 | m_fnLabel = new QLabel(this ); |
522 | m_fnLabel->setText(tr("Name:") ); | 545 | m_fnLabel->setText(tr("Name:") ); |
523 | m_boxName->addWidget(m_fnLabel ); | 546 | m_boxName->addWidget(m_fnLabel ); |
524 | m_boxName->insertSpacing(1, 8 ); | 547 | m_boxName->insertSpacing(1, 8 ); |
525 | m_boxName->addWidget(m_edit, 100 ); | 548 | m_boxName->addWidget(m_edit, 100 ); |
526 | 549 | ||
527 | m_lay->addLayout(m_boxName); | 550 | m_lay->addLayout(m_boxName); |
528 | } | 551 | } |
552 | |||
529 | void OFileSelector::initializeYes() | 553 | void OFileSelector::initializeYes() |
530 | { | 554 | { |
531 | m_ok = new QPushButton("&Save", this, "save" ); | 555 | m_ok = new QPushButton("&Save", this, "save" ); |
532 | m_cancel = new QPushButton("C&ancel", this, "cancel" ); | 556 | m_cancel = new QPushButton("C&ancel", this, "cancel" ); |
533 | m_boxOk = new QHBoxLayout(this ); | 557 | m_boxOk = new QHBoxLayout(this ); |
534 | m_boxOk->addWidget( m_ok, Qt::AlignHCenter ); | 558 | m_boxOk->addWidget( m_ok, Qt::AlignHCenter ); |
535 | m_boxOk->insertSpacing(1, 8 ); | 559 | m_boxOk->insertSpacing(1, 8 ); |
536 | m_boxOk->addWidget( m_cancel, Qt::AlignHCenter); | 560 | m_boxOk->addWidget( m_cancel, Qt::AlignHCenter); |
537 | m_lay->addLayout(m_boxOk ); | 561 | m_lay->addLayout(m_boxOk ); |
538 | connect(m_ok, SIGNAL(clicked() ), | 562 | connect(m_ok, SIGNAL(clicked() ), |
539 | this, SLOT(slotOk() ) ); | 563 | this, SLOT(slotOk() ) ); |
540 | connect(m_cancel, SIGNAL(clicked() ), | 564 | connect(m_cancel, SIGNAL(clicked() ), |
541 | this, SLOT(slotCancel() ) ); | 565 | this, SLOT(slotCancel() ) ); |
542 | 566 | ||
543 | } | 567 | } |
568 | |||
544 | void OFileSelector::initializeChooser() | 569 | void OFileSelector::initializeChooser() |
545 | { | 570 | { |
546 | m_boxView = new QHBoxLayout(this ); | 571 | m_boxView = new QHBoxLayout(this ); |
547 | 572 | ||
548 | m_mimeCheck = new QComboBox(this, "mime check"); | 573 | m_mimeCheck = new QComboBox(this, "mime check"); |
549 | m_viewCheck = new QComboBox(this, "view check"); | 574 | m_viewCheck = new QComboBox(this, "view check"); |
550 | m_boxView->addWidget(m_viewCheck, 0 ); | 575 | m_boxView->addWidget(m_viewCheck, 0 ); |
551 | m_boxView->insertSpacing(2, 8 ); | 576 | m_boxView->insertSpacing(2, 8 ); |
552 | m_boxView->addWidget(m_mimeCheck, 0 ); | 577 | m_boxView->addWidget(m_mimeCheck, 0 ); |
553 | m_lay->addLayout(m_boxView ); | 578 | m_lay->addLayout(m_boxView ); |
554 | m_lay->insertSpacing( 4, 8); | 579 | m_lay->insertSpacing( 4, 8); |
555 | 580 | ||
556 | m_viewCheck->insertItem(tr("Documents") ); | 581 | m_viewCheck->insertItem(tr("Documents") ); |
557 | m_viewCheck->insertItem(tr("Files") ); | 582 | m_viewCheck->insertItem(tr("Files") ); |
558 | m_viewCheck->insertItem(tr("All Files") ); | 583 | m_viewCheck->insertItem(tr("All Files") ); |
559 | 584 | ||
560 | // if(!m_autoMime ) | 585 | // if(!m_autoMime ) |
561 | // m_mimeCheck->insertItem(m_mimetypes.join("," ) ); | 586 | // m_mimeCheck->insertItem(m_mimetypes.join("," ) ); |
562 | // else{ // check | 587 | // else{ // check |
563 | updateMimes(); | 588 | updateMimes(); |
564 | m_mimeCheck->insertStringList( m_mimetypes ); | 589 | m_mimeCheck->insertStringList( m_mimetypes ); |
565 | // } | 590 | // } |
566 | 591 | ||
567 | connect( m_viewCheck, SIGNAL(activated(const QString &) ), | 592 | connect( m_viewCheck, SIGNAL(activated(const QString &) ), |
568 | this, SLOT(slotViewCheck(const QString & ) ) ); | 593 | this, SLOT(slotViewCheck(const QString & ) ) ); |
569 | 594 | ||
570 | connect( m_mimeCheck, SIGNAL(activated(const QString &) ), | 595 | connect( m_mimeCheck, SIGNAL(activated(const QString &) ), |
571 | this, SLOT(slotMimeCheck(const QString & ) ) ); | 596 | this, SLOT(slotMimeCheck(const QString & ) ) ); |
572 | } | 597 | } |
598 | |||
573 | void OFileSelector::slotMimeCheck(const QString &view ){ | 599 | void OFileSelector::slotMimeCheck(const QString &view ){ |
574 | if(m_selector == NORMAL ){ | 600 | if(m_selector == NORMAL ){ |
575 | delete m_select; | 601 | delete m_select; |
576 | m_select = new FileSelector(view == "All" ? QString::null : view | 602 | m_select = new FileSelector(view == "All" ? QString::null : view |
577 | , m_stack, "fileselector", FALSE, FALSE ); | 603 | , m_stack, "fileselector", FALSE, FALSE ); |
578 | m_stack->addWidget( m_select, NORMAL ); | 604 | m_stack->addWidget( m_select, NORMAL ); |
579 | m_stack->raiseWidget( NORMAL ); | 605 | m_stack->raiseWidget( NORMAL ); |
580 | }else{ | 606 | }else{ |
581 | reparse(); | 607 | reparse(); |
582 | } | 608 | } |
583 | } | 609 | } |
584 | 610 | ||
585 | void OFileSelector::slotViewCheck(const QString &view ){ | 611 | void OFileSelector::slotViewCheck(const QString &view ){ |
586 | qWarning("changed: show %s", view.latin1() ); | 612 | qWarning("changed: show %s", view.latin1() ); |
587 | // if the current view is the one | 613 | // if the current view is the one |
588 | QString currMime = m_mimeCheck->currentText(); | 614 | QString currMime = m_mimeCheck->currentText(); |
589 | if( view == QString::fromLatin1("Documents") ){ | 615 | if( view == QString::fromLatin1("Documents") ){ |
590 | // get the mimetype now | 616 | // get the mimetype now |
591 | // check if we're the current widget and return | 617 | // check if we're the current widget and return |
592 | if( m_View != 0) { // delete 0 shouldn't crash but it did :( | 618 | if( m_View != 0) { // delete 0 shouldn't crash but it did :( |
593 | delete m_View; | 619 | delete m_View; |
594 | delete m_boxToolbar; | 620 | delete m_boxToolbar; |
595 | delete m_homeButton; | 621 | delete m_homeButton; |
596 | delete m_docButton; | 622 | delete m_docButton; |
597 | delete m_location; | 623 | delete m_location; |
598 | delete m_up; | 624 | delete m_up; |
599 | delete m_pseudo; | 625 | delete m_pseudo; |
600 | //if(m_pseudoLayout!=0 ) | 626 | //if(m_pseudoLayout!=0 ) |
601 | // delete m_pseudoLayout; | 627 | // delete m_pseudoLayout; |
602 | } | 628 | } |
603 | m_View = 0; | 629 | m_View = 0; |
604 | m_boxToolbar = 0; | 630 | m_boxToolbar = 0; |
605 | m_homeButton = 0; | 631 | m_homeButton = 0; |
606 | m_docButton = 0; | 632 | m_docButton = 0; |
607 | m_location = 0; | 633 | m_location = 0; |
608 | m_up = 0; | 634 | m_up = 0; |
609 | m_pseudo = 0; | 635 | m_pseudo = 0; |
610 | m_pseudoLayout = 0; | 636 | m_pseudoLayout = 0; |
611 | 637 | ||
612 | delete m_select; | 638 | delete m_select; |
613 | m_select = new FileSelector( currMime == "All" ? QString::null : currMime, | 639 | m_select = new FileSelector( currMime == "All" ? QString::null : currMime, |
614 | m_stack,"fileselector", FALSE, FALSE ); | 640 | m_stack,"fileselector", FALSE, FALSE ); |
615 | m_stack->addWidget( m_select, NORMAL ); | 641 | m_stack->addWidget( m_select, NORMAL ); |
616 | m_mimeCheck->clear(); | 642 | m_mimeCheck->clear(); |
617 | m_selector = NORMAL; | 643 | m_selector = NORMAL; |
618 | updateMimes(); | 644 | updateMimes(); |
619 | m_mimeCheck->insertStringList( m_mimetypes ); | 645 | m_mimeCheck->insertStringList( m_mimetypes ); |
620 | m_stack->raiseWidget( NORMAL ); | 646 | m_stack->raiseWidget( NORMAL ); |
621 | connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); | 647 | connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); |
622 | 648 | ||
623 | }else if(view == QString::fromLatin1("Files") ){ | 649 | }else if(view == QString::fromLatin1("Files") ){ |
624 | // remove from the stack | 650 | // remove from the stack |
625 | delete m_select; | 651 | delete m_select; |
626 | m_select = 0; | 652 | m_select = 0; |
627 | delete m_View; | 653 | delete m_View; |
628 | m_View = 0; | 654 | m_View = 0; |
629 | 655 | ||
630 | 656 | ||
631 | 657 | ||
632 | m_selector = EXTENDED; | 658 | m_selector = EXTENDED; |
633 | // create the ListView or IconView | 659 | // create the ListView or IconView |
634 | initializeListView(); | 660 | initializeListView(); |
635 | 661 | ||
636 | reparse(); | 662 | reparse(); |
637 | }else if(view == QString::fromLatin1("All Files") ) { | 663 | }else if(view == QString::fromLatin1("All Files") ) { |
638 | // remove from the stack | 664 | // remove from the stack |
639 | delete m_select; | 665 | delete m_select; |
640 | m_select = 0; | 666 | m_select = 0; |
641 | delete m_View; | 667 | delete m_View; |
642 | m_View = 0; | 668 | m_View = 0; |
643 | 669 | ||
644 | m_selector = EXTENDED_ALL; | 670 | m_selector = EXTENDED_ALL; |
645 | initializeListView(); | 671 | initializeListView(); |
646 | reparse(); | 672 | reparse(); |
647 | }; | 673 | }; |
648 | }; | 674 | } |
649 | 675 | ||
650 | 676 | ||
651 | void OFileSelector::updateMimes() // lets check which mode is active | 677 | void OFileSelector::updateMimes() // lets check which mode is active |
652 | // check the current dir for items then | 678 | // check the current dir for items then |
653 | { | 679 | { |
654 | m_mimetypes.clear(); | 680 | m_mimetypes.clear(); |
655 | m_mimetypes.append("All" ); | 681 | m_mimetypes.append("All" ); |
656 | if( m_selector == NORMAL ){ | 682 | if( m_selector == NORMAL ){ |
657 | DocLnkSet set; | 683 | DocLnkSet set; |
658 | Global::findDocuments(&set, QString::null ); | 684 | Global::findDocuments(&set, QString::null ); |
659 | QListIterator<DocLnk> dit( set.children() ); | 685 | QListIterator<DocLnk> dit( set.children() ); |
660 | for ( ; dit.current(); ++dit ) { | 686 | for ( ; dit.current(); ++dit ) { |
661 | if( !m_mimetypes.contains((*dit)->type() ) ) | 687 | if( !m_mimetypes.contains((*dit)->type() ) ) |
662 | m_mimetypes.append( (*dit)->type() ); | 688 | m_mimetypes.append( (*dit)->type() ); |
663 | } | 689 | } |
664 | }else{ | 690 | }else{ |
665 | // should be allreday updatet | 691 | // should be allreday updatet |
666 | ; | 692 | ; |
667 | } | 693 | } |
668 | }; | 694 | } |
695 | |||
669 | void OFileSelector::initializeListView() | 696 | void OFileSelector::initializeListView() |
670 | { | 697 | { |
671 | // just to make sure but clean it up better FIXME | 698 | // just to make sure but clean it up better FIXME |
672 | delete m_View; | 699 | delete m_View; |
673 | m_View = 0; | 700 | m_View = 0; |
674 | delete m_boxToolbar; | 701 | delete m_boxToolbar; |
675 | delete m_homeButton; | 702 | delete m_homeButton; |
676 | delete m_docButton; | 703 | delete m_docButton; |
677 | delete m_location; | 704 | delete m_location; |
678 | delete m_up; | 705 | delete m_up; |
679 | //delete m_pseudo; | 706 | //delete m_pseudo; |
680 | //if(m_pseudoLayout!=0 ) // why did you overload malloc | 707 | //if(m_pseudoLayout!=0 ) // why did you overload malloc |
681 | //delete m_pseudoLayout; | 708 | //delete m_pseudoLayout; |
682 | m_boxToolbar = 0; | 709 | m_boxToolbar = 0; |
683 | m_homeButton = 0; | 710 | m_homeButton = 0; |
684 | m_docButton = 0; | 711 | m_docButton = 0; |
685 | m_location = 0; | 712 | m_location = 0; |
686 | m_up = 0; | 713 | m_up = 0; |
687 | m_pseudo = 0; | 714 | m_pseudo = 0; |
688 | m_pseudoLayout = 0; | 715 | m_pseudoLayout = 0; |
689 | // time for the toolbar | 716 | // time for the toolbar |
690 | m_pseudo = new QWidget(m_stack, "Pseudo Widget"); | 717 | m_pseudo = new QWidget(m_stack, "Pseudo Widget"); |
691 | m_pseudoLayout = new QVBoxLayout(m_pseudo ); | 718 | m_pseudoLayout = new QVBoxLayout(m_pseudo ); |
692 | if(m_shTool ){ | 719 | if(m_shTool ){ |
693 | m_boxToolbar = new QHBoxLayout( ); | 720 | m_boxToolbar = new QHBoxLayout( ); |
694 | m_boxToolbar->setAutoAdd( true ); | 721 | m_boxToolbar->setAutoAdd( true ); |
695 | m_location = new QComboBox(m_pseudo ); | 722 | m_location = new QComboBox(m_pseudo ); |
723 | connect( m_location, SIGNAL(activated(const QString &) ), this, SLOT( locationComboActivated(const QString & ) ) ); | ||
696 | 724 | ||
697 | m_up = new QPushButton(Resource::loadIconSet("up"),"", m_pseudo,"cdUpButton"); | 725 | m_up = new QPushButton(Resource::loadIconSet("up"),"", m_pseudo,"cdUpButton"); |
698 | m_up->setFixedSize( QSize( 20, 20 ) ); | 726 | m_up->setFixedSize( QSize( 20, 20 ) ); |
699 | connect(m_up ,SIGNAL(clicked()),this,SLOT(cdUP() ) ); | 727 | connect(m_up ,SIGNAL(clicked()),this,SLOT(cdUP() ) ); |
700 | m_up->setFlat(TRUE); | 728 | m_up->setFlat(TRUE); |
701 | 729 | ||
702 | m_homeButton = new QPushButton(Resource::loadIconSet("home") , "", m_pseudo); | 730 | m_homeButton = new QPushButton(Resource::loadIconSet("home") , "", m_pseudo); |
703 | m_homeButton->setFixedSize( QSize( 20, 20 ) ); | 731 | m_homeButton->setFixedSize( QSize( 20, 20 ) ); |
704 | connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotHome() ) ); | 732 | connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotHome() ) ); |
705 | m_homeButton->setFlat(TRUE); | 733 | m_homeButton->setFlat(TRUE); |
706 | 734 | ||
707 | m_docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"", m_pseudo,"docsButton"); | 735 | m_docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"", m_pseudo,"docsButton"); |
708 | m_docButton->setFixedSize( QSize( 20, 20 ) ); | 736 | m_docButton->setFixedSize( QSize( 20, 20 ) ); |
709 | connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotDoc() ) ); | 737 | connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotDoc() ) ); |
710 | m_docButton->setFlat(TRUE); | 738 | m_docButton->setFlat(TRUE); |
711 | 739 | ||
712 | m_boxToolbar->addWidget(m_location ); | 740 | m_boxToolbar->addWidget(m_location ); |
713 | m_boxToolbar->addWidget(m_up ); | 741 | m_boxToolbar->addWidget(m_up ); |
714 | m_boxToolbar->addWidget(m_homeButton ); | 742 | m_boxToolbar->addWidget(m_homeButton ); |
715 | m_boxToolbar->addWidget(m_docButton ); | 743 | m_boxToolbar->addWidget(m_docButton ); |
716 | m_pseudoLayout->addLayout(m_boxToolbar ); | 744 | m_pseudoLayout->addLayout(m_boxToolbar ); |
717 | // lets fill the combobox | 745 | // lets fill the combobox |
718 | StorageInfo storage; | 746 | StorageInfo storage; |
719 | const QList<FileSystem> &fs = storage.fileSystems(); | 747 | const QList<FileSystem> &fs = storage.fileSystems(); |
720 | QListIterator<FileSystem> it ( fs ); | 748 | QListIterator<FileSystem> it ( fs ); |
721 | for( ; it.current(); ++it ){ | 749 | for( ; it.current(); ++it ){ |
722 | const QString disk = (*it)->name(); | 750 | const QString disk = (*it)->name(); |
723 | const QString path = (*it)->path(); | 751 | const QString path = (*it)->path(); |
724 | m_location->insertItem(path+ "<-"+disk ); | 752 | m_location->insertItem(path+ "<-"+disk ); |
725 | } | 753 | } |
726 | int count = m_location->count(); | 754 | int count = m_location->count(); |
727 | m_location->insertItem(m_currentDir ); | 755 | m_location->insertItem(m_currentDir ); |
728 | m_location->setCurrentItem( count ); | 756 | m_location->setCurrentItem( count ); |
729 | }; | 757 | }; |
730 | m_View = new QListView(m_pseudo, "Extended view" ); | 758 | m_View = new QListView(m_pseudo, "Extended view" ); |
731 | m_stack->addWidget( m_pseudo, EXTENDED ); | 759 | m_stack->addWidget( m_pseudo, EXTENDED ); |
732 | m_stack->raiseWidget( EXTENDED ); | 760 | m_stack->raiseWidget( EXTENDED ); |
733 | m_pseudoLayout->addWidget(m_View ); | 761 | m_pseudoLayout->addWidget(m_View ); |
734 | QPEApplication::setStylusOperation( m_View->viewport(),QPEApplication::RightOnHold); | 762 | QPEApplication::setStylusOperation( m_View->viewport(),QPEApplication::RightOnHold); |
735 | // set up the stuff | 763 | // set up the stuff |
736 | // Pixmap Name Date Size mime | 764 | // Pixmap Name Date Size mime |
737 | //(m_View->header() )->hide(); | 765 | //(m_View->header() )->hide(); |
738 | //m_View->setRootIsDecorated(false); | 766 | //m_View->setRootIsDecorated(false); |
739 | m_View->addColumn(" "); | 767 | m_View->addColumn(" "); |
740 | m_View->addColumn(tr("Name"),135 ); | 768 | m_View->addColumn(tr("Name"),135 ); |
741 | m_View->addColumn(tr("Size"),-1 ); | 769 | m_View->addColumn(tr("Size"),-1 ); |
742 | m_View->addColumn(tr("Date"), 60 ); | 770 | m_View->addColumn(tr("Date"), 60 ); |
743 | m_View->addColumn(tr("Mime Type"),-1 ); | 771 | m_View->addColumn(tr("Mime Type"),-1 ); |
@@ -760,298 +788,351 @@ void OFileSelector::initializeListView() | |||
760 | if we're in SAVE !isWriteable is locked | 788 | if we're in SAVE !isWriteable is locked |
761 | 789 | ||
762 | 790 | ||
763 | */ | 791 | */ |
764 | 792 | ||
765 | 793 | ||
766 | void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink ){ | 794 | void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink ){ |
767 | qWarning("Add Files" ); | 795 | qWarning("Add Files" ); |
768 | if( !m_files ){ | 796 | if( !m_files ){ |
769 | qWarning("not mfiles" ); | 797 | qWarning("not mfiles" ); |
770 | return; | 798 | return; |
771 | } | 799 | } |
772 | 800 | ||
773 | MimeType type( info->filePath() ); | 801 | MimeType type( info->filePath() ); |
774 | QString name; | 802 | QString name; |
775 | QString dir; | 803 | QString dir; |
776 | bool locked= false; | 804 | bool locked= false; |
777 | if(mime == "All" ){ | 805 | if(mime == "All" ){ |
778 | ; | 806 | ; |
779 | }else if( type.id() != mime ) { | 807 | }else if( type.id() != mime ) { |
780 | return; | 808 | return; |
781 | } | 809 | } |
782 | QPixmap pix = type.pixmap(); | 810 | QPixmap pix = type.pixmap(); |
783 | if(pix.isNull() ) | 811 | if(pix.isNull() ) |
784 | pix = Resource::loadPixmap( "UnknownDocument-14" ); | 812 | pix = Resource::loadPixmap( "UnknownDocument-14" ); |
785 | dir = info->dirPath( true ); | 813 | dir = info->dirPath( true ); |
786 | if( symlink ) { // check if the readLink is readable | 814 | if( symlink ) { // check if the readLink is readable |
787 | // do it right later | 815 | // do it right later |
788 | name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); | 816 | name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); |
789 | }else{ // keep track of the icons | 817 | }else{ // keep track of the icons |
790 | name = info->fileName(); | 818 | name = info->fileName(); |
791 | if( m_mode == OPEN ){ | 819 | if( m_mode == OPEN ){ |
792 | if( !info->isReadable() ){ | 820 | if( !info->isReadable() ){ |
793 | locked = true; | 821 | locked = true; |
794 | pix = Resource::loadPixmap("locked" ); | 822 | pix = Resource::loadPixmap("locked" ); |
795 | } | 823 | } |
796 | }else if( m_mode == SAVE ){ | 824 | }else if( m_mode == SAVE ){ |
797 | if( !info->isWritable() ){ | 825 | if( !info->isWritable() ){ |
798 | locked = true; | 826 | locked = true; |
799 | pix = Resource::loadPixmap("locked" ); | 827 | pix = Resource::loadPixmap("locked" ); |
800 | } | 828 | } |
801 | } | 829 | } |
802 | } | 830 | } |
803 | new OFileSelectorItem( m_View, pix, name, | 831 | new OFileSelectorItem( m_View, pix, name, |
804 | info->lastModified().toString(), | 832 | info->lastModified().toString(), |
805 | QString::number( info->size() ), | 833 | QString::number( info->size() ), |
806 | dir, locked ); | 834 | dir, locked ); |
807 | } | 835 | } |
836 | |||
808 | void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) | 837 | void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) |
809 | { | 838 | { |
810 | if(!m_dir ) | 839 | if(!m_dir ) |
811 | return; | 840 | return; |
812 | //if( showDirs ) | 841 | //if( showDirs ) |
813 | { | 842 | { |
814 | bool locked=false; | 843 | bool locked=false; |
815 | QString name; | 844 | QString name; |
816 | QPixmap pix; | 845 | QPixmap pix; |
817 | if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){ | 846 | if( ( m_mode == OPEN && !info->isReadable() ) || ( m_mode == SAVE && !info->isWritable() ) ){ |
818 | locked = true; | 847 | locked = true; |
819 | if( symlink ){ | 848 | if( symlink ){ |
820 | pix = (*m_pixmaps)["symlinkedlocked"]; | 849 | pix = (*m_pixmaps)["symlinkedlocked"]; |
821 | }else{ | 850 | }else{ |
822 | pix = Resource::loadPixmap("lockedfolder" ); | 851 | pix = Resource::loadPixmap("lockedfolder" ); |
823 | } | 852 | } |
824 | }else{ | 853 | }else{ |
825 | if( symlink ){ | 854 | if( symlink ){ |
826 | pix = (*m_pixmaps)["dirsymlink" ]; | 855 | pix = (*m_pixmaps)["dirsymlink" ]; |
827 | }else{ | 856 | }else{ |
828 | pix = Resource::loadPixmap("folder" ); | 857 | pix = Resource::loadPixmap("folder" ); |
829 | } | 858 | } |
830 | } | 859 | } |
831 | if( symlink){ | 860 | if( symlink){ |
832 | name = info->fileName()+ "->"+ info->dirPath(true) +"/" +info->readLink(); | 861 | name = info->fileName()+ "->"+ info->dirPath(true) +"/" +info->readLink(); |
833 | 862 | ||
834 | }else{ | 863 | }else{ |
835 | //if(info->isReadable() ) | 864 | //if(info->isReadable() ) |
836 | name = info->fileName(); | 865 | name = info->fileName(); |
837 | } | 866 | } |
838 | 867 | ||
839 | new OFileSelectorItem(m_View, pix, | 868 | new OFileSelectorItem(m_View, pix, |
840 | name, info->lastModified().toString(), | 869 | name, info->lastModified().toString(), |
841 | QString::number(info->size() ),info->dirPath(true), locked, true ); | 870 | QString::number(info->size() ),info->dirPath(true), locked, true ); |
842 | 871 | ||
843 | } | 872 | } |
844 | } | 873 | } |
874 | |||
845 | void OFileSelector::setShowDirs(bool dir ) | 875 | void OFileSelector::setShowDirs(bool dir ) |
846 | { | 876 | { |
847 | m_dir = dir; | 877 | m_dir = dir; |
848 | reparse(); | 878 | reparse(); |
849 | } | 879 | } |
850 | 880 | ||
851 | void OFileSelector::slotFileSelected(const QString &string ) | 881 | void OFileSelector::slotFileSelected(const QString &string ) |
852 | { | 882 | { |
853 | if(m_shLne ) | 883 | if(m_shLne ) |
854 | m_edit->setText( string ); | 884 | m_edit->setText( string ); |
855 | 885 | ||
856 | emit fileSelected( string ); | 886 | emit fileSelected( string ); |
857 | // do AppLnk stuff | 887 | // do AppLnk stuff |
858 | } | 888 | } |
889 | |||
859 | void OFileSelector::slotFileBridgeSelected( const DocLnk &lnk ) | 890 | void OFileSelector::slotFileBridgeSelected( const DocLnk &lnk ) |
860 | { | 891 | { |
861 | slotFileSelected(lnk.name() ); | 892 | slotFileSelected(lnk.name() ); |
862 | emit fileSelected( lnk ); | 893 | emit fileSelected( lnk ); |
863 | } | 894 | } |
895 | |||
864 | void OFileSelector::slotSelectionChanged() // get the current items | 896 | void OFileSelector::slotSelectionChanged() // get the current items |
865 | // fixme | 897 | // fixme |
866 | { | 898 | { |
867 | qWarning("selection changed" ); | 899 | qWarning("selection changed" ); |
868 | } | 900 | } |
901 | |||
869 | void OFileSelector::slotCurrentChanged(QListViewItem *item ) | 902 | void OFileSelector::slotCurrentChanged(QListViewItem *item ) |
870 | { | 903 | { |
871 | qWarning("current changed" ); | 904 | qWarning("current changed" ); |
872 | if( item == 0 ) | 905 | if( item == 0 ) |
873 | return; | 906 | return; |
874 | 907 | ||
875 | if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ | 908 | if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ |
876 | OFileSelectorItem *sel = (OFileSelectorItem*)item; | 909 | OFileSelectorItem *sel = (OFileSelectorItem*)item; |
877 | if(!sel->isDir() ){ | 910 | if(!sel->isDir() ){ |
878 | qWarning("is not dir" ); | 911 | qWarning("is not dir" ); |
879 | if(m_shLne ){ | 912 | if(m_shLne ){ |
880 | m_edit->setText(sel->text(1) ); | 913 | m_edit->setText(sel->text(1) ); |
881 | qWarning("setTexy" ); | 914 | qWarning("setTexy" ); |
882 | } | 915 | } |
883 | } | 916 | } |
884 | }else { | 917 | }else { |
885 | qWarning("mode not extended" ); | 918 | qWarning("mode not extended" ); |
886 | } | 919 | } |
887 | } | 920 | } |
921 | |||
888 | // either select or change dir | 922 | // either select or change dir |
889 | void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &point, int ) | 923 | void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &point, int ) |
890 | { | 924 | { |
891 | if( item == 0 ) | 925 | if( item == 0 ) |
892 | return; | 926 | return; |
893 | 927 | ||
894 | if( button != Qt::LeftButton ) | 928 | if( button != Qt::LeftButton ) |
895 | return; | 929 | return; |
896 | 930 | ||
897 | qWarning("clicked" ); | 931 | qWarning("clicked" ); |
898 | if(m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ | 932 | if(m_selector == EXTENDED || m_selector == EXTENDED_ALL ){ |
899 | qWarning("inside" ); | 933 | qWarning("inside" ); |
900 | OFileSelectorItem *sel = (OFileSelectorItem*)item; | 934 | OFileSelectorItem *sel = (OFileSelectorItem*)item; |
901 | if(!sel->isLocked() ){ // not locked either changedir or open | 935 | if(!sel->isLocked() ){ // not locked either changedir or open |
902 | QStringList str = QStringList::split("->", sel->text(1) ); | 936 | QStringList str = QStringList::split("->", sel->text(1) ); |
903 | if(sel->isDir() ){ | 937 | if(sel->isDir() ){ |
904 | cd( sel->directory() + "/" + str[0] ); | 938 | cd( sel->directory() + "/" + str[0] ); |
905 | }else{ | 939 | } else { |
906 | qWarning("file" ); | 940 | qWarning("file" ); |
907 | if(m_shLne ) | 941 | if(m_shLne ) |
908 | m_edit->setText(str[0] ); | 942 | m_edit->setText(str[0] ); |
909 | emit fileSelected(str[0] ); | 943 | emit fileSelected(str[0] ); |
910 | // emit DocLnk need to do it | 944 | // emit DocLnk need to do it |
911 | } | 945 | } |
912 | }else{ | 946 | } else { |
913 | qWarning( "locked" ); | 947 | qWarning( "locked" ); |
914 | } | 948 | } |
915 | }; | 949 | }; |
916 | } | 950 | } |
951 | |||
917 | void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) | 952 | void OFileSelector::slotRightButton(int button, QListViewItem *item, const QPoint &, int ) |
918 | { | 953 | { |
919 | if (item == 0 ) | 954 | if (item == 0 ) |
920 | return; | 955 | return; |
921 | 956 | ||
922 | if( button != Qt::RightButton ) | 957 | if( button != Qt::RightButton ) |
923 | return; | 958 | return; |
924 | qWarning("right button" ); | 959 | qWarning("right button" ); |
925 | slotContextMenu(item); | 960 | slotContextMenu(item); |
926 | } | 961 | } |
962 | |||
927 | void OFileSelector::slotContextMenu(QListViewItem *item) | 963 | void OFileSelector::slotContextMenu(QListViewItem *item) |
928 | { | 964 | { |
929 | qWarning("context menu" ); | 965 | qWarning("context menu" ); |
930 | if( item ==0 || !m_showPopup ) | 966 | if( item ==0 || !m_showPopup ) |
931 | return; | 967 | return; |
932 | 968 | ||
933 | if( m_custom !=0){ | 969 | if( m_custom !=0){ |
934 | m_custom->exec(); | 970 | m_custom->exec(); |
935 | }else{ | 971 | }else{ |
936 | QPopupMenu menu; | 972 | QPopupMenu menu; |
937 | QAction up; | 973 | QAction up; |
938 | up.setText("cd up"); | 974 | up.setText("cd up"); |
939 | up.addTo( &menu ); | 975 | up.addTo( &menu ); |
940 | connect(&up, SIGNAL(activated() ), | 976 | connect(&up, SIGNAL(activated() ), |
941 | this, SLOT(cdUP() ) ); | 977 | this, SLOT(cdUP() ) ); |
942 | 978 | ||
943 | QAction act; | 979 | QAction act; |
944 | OFileSelectorItem *sel = (OFileSelectorItem*)item; | 980 | OFileSelectorItem *sel = (OFileSelectorItem*)item; |
945 | if(sel->isDir() ){ | 981 | if(sel->isDir() ){ |
946 | act.setText( tr("Change Directory") ); | 982 | act.setText( tr("Change Directory") ); |
947 | act.addTo(&menu ); | 983 | act.addTo(&menu ); |
948 | connect(&act, SIGNAL(activated() ), | 984 | connect(&act, SIGNAL(activated() ), |
949 | this, SLOT(slotChangedDir() ) ); | 985 | this, SLOT(slotChangedDir() ) ); |
950 | }else{ | 986 | }else{ |
951 | act.setText( tr("Open file" ) ); | 987 | act.setText( tr("Open file" ) ); |
952 | act.addTo( &menu ); | 988 | act.addTo( &menu ); |
953 | connect(&act, SIGNAL(activated() ), | 989 | connect(&act, SIGNAL(activated() ), |
954 | this, SLOT(slotOpen() ) ); | 990 | this, SLOT(slotOpen() ) ); |
955 | } | 991 | } |
956 | QAction rescan; | 992 | QAction rescan; |
957 | rescan.setText( tr("Rescan") ); | 993 | rescan.setText( tr("Rescan") ); |
958 | rescan.addTo( &menu ); | 994 | rescan.addTo( &menu ); |
959 | connect(&rescan, SIGNAL(activated() ), | 995 | connect(&rescan, SIGNAL(activated() ), |
960 | this, SLOT(slotRescan() ) ); | 996 | this, SLOT(slotRescan() ) ); |
961 | 997 | ||
962 | QAction rename; | 998 | QAction rename; |
963 | rename.setText( tr("Rename") ); | 999 | rename.setText( tr("Rename") ); |
964 | rename.addTo( &menu ); | 1000 | rename.addTo( &menu ); |
965 | connect(&rename, SIGNAL(activated() ), | 1001 | connect(&rename, SIGNAL(activated() ), |
966 | this, SLOT(slotRename() ) ); | 1002 | this, SLOT(slotRename() ) ); |
967 | 1003 | ||
968 | menu.insertSeparator(); | 1004 | menu.insertSeparator(); |
969 | QAction delItem; | 1005 | QAction delItem; |
970 | delItem.setText( tr("Delete") ); | 1006 | delItem.setText( tr("Delete") ); |
971 | delItem.addTo(&menu ); | 1007 | delItem.addTo(&menu ); |
972 | connect(&delItem, SIGNAL(activated() ), | 1008 | connect(&delItem, SIGNAL(activated() ), |
973 | this, SLOT(slotDelete() ) ); | 1009 | this, SLOT(slotDelete() ) ); |
974 | 1010 | ||
975 | menu.exec(QCursor::pos() ); | 1011 | menu.exec(QCursor::pos() ); |
976 | } | 1012 | } |
977 | } | 1013 | } |
1014 | |||
978 | bool OFileSelector::cd(const QString &str ) | 1015 | bool OFileSelector::cd(const QString &str ) |
979 | { | 1016 | { |
980 | qWarning(" dir %s", str.latin1() ); | 1017 | qWarning(" dir %s", str.latin1() ); |
981 | QDir dir( str); | 1018 | QDir dir( str); |
982 | if(dir.exists() ){ | 1019 | if(dir.exists() ){ |
983 | m_currentDir = str; | 1020 | m_currentDir = dir.absPath(); |
984 | reparse(); | 1021 | reparse(); |
985 | if(m_shTool ){ | 1022 | if(m_shTool ){ |
986 | int count = m_location->count(); | 1023 | int count = m_location->count(); |
987 | m_location->insertItem(str ); | 1024 | insertLocationPath( str ,count ); |
988 | m_location->setCurrentItem( count ); | 1025 | m_location->setCurrentItem( count ); |
989 | } | 1026 | } |
990 | return true; | 1027 | return true; |
991 | } | 1028 | } |
992 | return false; | 1029 | return false; |
993 | } | 1030 | } |
994 | 1031 | ||
1032 | void OFileSelector::insertLocationPath(const QString ¤tPath, int count) { | ||
1033 | QStringList pathList; | ||
1034 | for(int i=0;i<count;i++) { | ||
1035 | pathList << m_location->text(i); | ||
1036 | } | ||
1037 | if( pathList.grep( currentPath,TRUE).isEmpty() ) { | ||
1038 | m_location->clear(); | ||
1039 | if( currentPath.left(2)=="//") | ||
1040 | pathList.append( currentPath.right(currentPath.length()-1) ); | ||
1041 | else | ||
1042 | pathList.append( currentPath ); | ||
1043 | m_location->insertStringList( pathList,-1); | ||
1044 | } | ||
1045 | } | ||
1046 | |||
995 | void OFileSelector::slotChangedDir() | 1047 | void OFileSelector::slotChangedDir() |
996 | { | 1048 | { |
997 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); | 1049 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); |
998 | if(sel->isDir() ){ | 1050 | if(sel->isDir() ){ |
999 | QStringList str = QStringList::split("->", sel->text(1) ); | 1051 | QStringList str = QStringList::split("->", sel->text(1) ); |
1000 | cd( sel->directory() + "/" + str[0] ); | 1052 | cd( sel->directory() + "/" + str[0] ); |
1053 | |||
1001 | } | 1054 | } |
1002 | } | 1055 | } |
1056 | |||
1003 | void OFileSelector::slotOpen() | 1057 | void OFileSelector::slotOpen() |
1004 | { | 1058 | { |
1005 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); | 1059 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); |
1006 | if(!sel->isDir() ){ | 1060 | if(!sel->isDir() ){ |
1007 | QStringList str = QStringList::split("->", sel->text(1) ); | 1061 | QStringList str = QStringList::split("->", sel->text(1) ); |
1008 | slotFileSelected( str[0] ); | 1062 | slotFileSelected( str[0] ); |
1009 | } | 1063 | } |
1010 | } | 1064 | } |
1065 | |||
1011 | void OFileSelector::slotRescan() | 1066 | void OFileSelector::slotRescan() |
1012 | { | 1067 | { |
1013 | reparse(); | 1068 | reparse(); |
1014 | } | 1069 | } |
1070 | |||
1015 | void OFileSelector::slotRename() | 1071 | void OFileSelector::slotRename() |
1016 | { | 1072 | { |
1017 | // rename inline | 1073 | // rename inline |
1018 | } | 1074 | } |
1075 | |||
1019 | void OFileSelector::slotDelete() | 1076 | void OFileSelector::slotDelete() |
1020 | { | 1077 | { |
1021 | qWarning("delete slot" ); | 1078 | qWarning("delete slot" ); |
1022 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); | 1079 | OFileSelectorItem *sel = (OFileSelectorItem*)m_View->currentItem(); |
1023 | QStringList list = QStringList::split("->", sel->text(1) ); | 1080 | QStringList list = QStringList::split("->", sel->text(1) ); |
1024 | if( sel->isDir() ){ | 1081 | if( sel->isDir() ){ |
1025 | QString str = QString::fromLatin1("rm -rf ") + list[0]; | 1082 | QString str = QString::fromLatin1("rm -rf ") + list[0]; //better safe than sorry |
1026 | ::system(str.utf8().data() ); | 1083 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+list[0], |
1027 | }else{ | 1084 | tr("Yes"),tr("No"),0,1,1) ) { |
1085 | case 0: | ||
1086 | ::system(str.utf8().data() ); | ||
1087 | break; | ||
1088 | } | ||
1089 | } else { | ||
1028 | QFile::remove( list[0] ); | 1090 | QFile::remove( list[0] ); |
1029 | } | 1091 | } |
1030 | m_View->takeItem( sel ); | 1092 | m_View->takeItem( sel ); |
1031 | delete sel; | 1093 | delete sel; |
1032 | } | 1094 | } |
1033 | 1095 | ||
1034 | void OFileSelector::cdUP() | 1096 | void OFileSelector::cdUP() |
1035 | { | 1097 | { |
1036 | QDir dir( m_currentDir ); | 1098 | QDir dir( m_currentDir ); |
1037 | dir.cdUp(); | 1099 | dir.cdUp(); |
1038 | if(dir.exists() ){ | 1100 | if(dir.exists() ){ |
1039 | m_currentDir = dir.absPath(); | 1101 | m_currentDir = dir.absPath(); |
1040 | reparse(); | 1102 | reparse(); |
1041 | int count = m_location->count(); | 1103 | int count = m_location->count(); |
1042 | m_location->insertItem(m_currentDir ); | 1104 | insertLocationPath( m_currentDir,count ); |
1043 | m_location->setCurrentItem( count ); | 1105 | m_location->setCurrentItem( indexFromString(m_currentDir )); |
1106 | //this wont work in all instances | ||
1107 | // FIXME | ||
1044 | } | 1108 | } |
1045 | } | 1109 | } |
1110 | |||
1111 | int OFileSelector::indexFromString(const QString &str) { | ||
1112 | |||
1113 | for(int i=0;i< m_location->count();i++) { | ||
1114 | if(str == m_location->text(i)) | ||
1115 | return i; | ||
1116 | } | ||
1117 | return 0; | ||
1118 | } | ||
1119 | |||
1046 | void OFileSelector::slotHome() | 1120 | void OFileSelector::slotHome() |
1047 | { | 1121 | { |
1048 | cd(QDir::homeDirPath() ); | 1122 | cd(QDir::homeDirPath() ); |
1049 | } | 1123 | } |
1124 | |||
1050 | void OFileSelector::slotDoc() | 1125 | void OFileSelector::slotDoc() |
1051 | { | 1126 | { |
1052 | cd(QDir::homeDirPath() + "/Documents" ); | 1127 | cd(QDir::homeDirPath() + "/Documents" ); |
1053 | } | 1128 | } |
1129 | |||
1054 | void OFileSelector::slotNavigate() | 1130 | void OFileSelector::slotNavigate() |
1055 | { | 1131 | { |
1056 | 1132 | ||
1057 | } | 1133 | } |
1134 | |||
1135 | void OFileSelector::locationComboActivated(const QString & file ) { | ||
1136 | cd(file.left(file.find("<-",0,TRUE))); | ||
1137 | reparse(); | ||
1138 | } | ||
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h index 5e98a1e..81a9e63 100644 --- a/libopie/ofileselector.h +++ b/libopie/ofileselector.h | |||
@@ -22,219 +22,222 @@ | |||
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef opiefileselector_h | 34 | #ifndef opiefileselector_h |
35 | #define opiefileselector_h | 35 | #define opiefileselector_h |
36 | 36 | ||
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include <qstring.h> | 38 | #include <qstring.h> |
39 | #include <qpixmap.h> | 39 | #include <qpixmap.h> |
40 | #include <qstringlist.h> | 40 | #include <qstringlist.h> |
41 | #include <qmap.h> | 41 | #include <qmap.h> |
42 | #include <qvaluelist.h> | 42 | #include <qvaluelist.h> |
43 | 43 | ||
44 | #include <qpe/applnk.h> | 44 | #include <qpe/applnk.h> |
45 | #include <qlistview.h> | 45 | #include <qlistview.h> |
46 | /** This is OPIEs FileDialog Widget. You can use it | 46 | /** This is OPIEs FileDialog Widget. You can use it |
47 | * as a dropin replacement of the fileselector and | 47 | * as a dropin replacement of the fileselector and |
48 | * or use any of the new features. | 48 | * or use any of the new features. |
49 | * This is also a complete FileSave and FileLoad widget | 49 | * This is also a complete FileSave and FileLoad widget |
50 | * If you look for a Dialog check OFileDialog | 50 | * If you look for a Dialog check OFileDialog |
51 | * | 51 | * |
52 | */ | 52 | */ |
53 | class DocLnk; | 53 | class DocLnk; |
54 | class QCheckBox; | 54 | class QCheckBox; |
55 | class QComboBox; | 55 | class QComboBox; |
56 | class QPushButton; | 56 | class QPushButton; |
57 | class FileSelector; | 57 | class FileSelector; |
58 | class QGridLayout; | 58 | class QGridLayout; |
59 | class QLineEdit; | 59 | class QLineEdit; |
60 | class QLabel; | 60 | class QLabel; |
61 | class QWidgetStack; | 61 | class QWidgetStack; |
62 | class QHBoxLayout; | 62 | class QHBoxLayout; |
63 | class QVBoxLayout; | 63 | class QVBoxLayout; |
64 | class QPopupMenu; | 64 | class QPopupMenu; |
65 | class QFileInfo; | 65 | class QFileInfo; |
66 | // | 66 | // |
67 | class OFileSelectorItem : public QListViewItem { | 67 | class OFileSelectorItem : public QListViewItem { |
68 | public: | 68 | public: |
69 | OFileSelectorItem(QListView *view, const QPixmap &pixmap, const QString &path, | 69 | OFileSelectorItem(QListView *view, const QPixmap &pixmap, const QString &path, |
70 | const QString &date, const QString &size, const QString &mDir, | 70 | const QString &date, const QString &size, const QString &mDir, |
71 | bool isLocked=false, bool isDir=false ): QListViewItem(view) { | 71 | bool isLocked=false, bool isDir=false ): QListViewItem(view) { |
72 | setPixmap(0, pixmap ); | 72 | setPixmap(0, pixmap ); |
73 | setText(1, path ); | 73 | setText(1, path ); |
74 | setText(2, size ); | 74 | setText(2, size ); |
75 | setText(3, date ); | 75 | setText(3, date ); |
76 | //setText(4, mDir ); | 76 | //setText(4, mDir ); |
77 | m_dir = mDir; | 77 | m_dir = mDir; |
78 | dir = isDir; | 78 | dir = isDir; |
79 | mLocked = isLocked; | 79 | mLocked = isLocked; |
80 | } | 80 | } |
81 | bool isLocked() const{ | 81 | bool isLocked() const{ |
82 | return mLocked; | 82 | return mLocked; |
83 | } | 83 | } |
84 | QString directory()const{ | 84 | QString directory()const{ |
85 | return m_dir; | 85 | return m_dir; |
86 | } | 86 | } |
87 | bool isDir()const{ | 87 | bool isDir()const{ |
88 | return dir; | 88 | return dir; |
89 | } | 89 | } |
90 | QString path()const{ | 90 | QString path()const{ |
91 | return text(1 ); | 91 | return text(1 ); |
92 | } | 92 | } |
93 | QString key(int id, bool )const { | 93 | QString key(int id, bool )const { |
94 | QString ke; | 94 | QString ke; |
95 | if( id == 0 || id == 1 ){ // name | 95 | if( id == 0 || id == 1 ){ // name |
96 | if( dir ){ | 96 | if( dir ){ |
97 | ke.append("0" ); | 97 | ke.append("0" ); |
98 | ke.append( text(1) ); | 98 | ke.append( text(1) ); |
99 | }else{ | 99 | }else{ |
100 | ke.append("1" ); | 100 | ke.append("1" ); |
101 | ke.append( text(1) ); | 101 | ke.append( text(1) ); |
102 | } | 102 | } |
103 | }else if( id == 2 ){ // size | 103 | }else if( id == 2 ){ // size |
104 | return text(2); | 104 | return text(2); |
105 | }else if( id == 3 ){ // date | 105 | }else if( id == 3 ){ // date |
106 | return text(3); | 106 | return text(3); |
107 | } | 107 | } |
108 | return ke; | 108 | return ke; |
109 | }; | 109 | }; |
110 | private: | 110 | private: |
111 | bool mLocked:1; | 111 | bool mLocked:1; |
112 | bool dir:1; | 112 | bool dir:1; |
113 | QString m_dir; | 113 | QString m_dir; |
114 | }; | 114 | }; |
115 | 115 | ||
116 | class OFileSelector : public QWidget { | 116 | class OFileSelector : public QWidget { |
117 | Q_OBJECT | 117 | Q_OBJECT |
118 | public: | 118 | public: |
119 | enum Mode {OPEN=1, SAVE=2, FILESELECTOR=4, DIR=8 }; | 119 | enum Mode {OPEN=1, SAVE=2, FILESELECTOR=4, DIR=8 }; |
120 | enum Selector{NORMAL=1, EXTENDED = 2, EXTENDED_ALL =4 }; | 120 | enum Selector{NORMAL=1, EXTENDED = 2, EXTENDED_ALL =4 }; |
121 | enum View { DIRS = 1, FILES = 2, TREE = 4, ICON = 8 }; | 121 | enum View { DIRS = 1, FILES = 2, TREE = 4, ICON = 8 }; |
122 | OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, const QString &fileName = QString::null, const QStringList &mimetypes = QStringList() ); | 122 | OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, const QString &fileName = QString::null, const QStringList &mimetypes = QStringList() ); |
123 | ~OFileSelector() {}; | 123 | ~OFileSelector() {}; |
124 | bool isToolbarVisible() const { return m_shTool; }; | 124 | bool isToolbarVisible() const { return m_shTool; }; |
125 | bool isPermissionBarVisible() const { return m_shPerm; }; | 125 | bool isPermissionBarVisible() const { return m_shPerm; }; |
126 | bool isLineEditVisible()const { return m_shLne; }; | 126 | bool isLineEditVisible()const { return m_shLne; }; |
127 | bool isChooserVisible( )const { return m_shChooser; }; | 127 | bool isChooserVisible( )const { return m_shChooser; }; |
128 | bool isYesCancelVisible()const { return m_shYesNo; }; | 128 | bool isYesCancelVisible()const { return m_shYesNo; }; |
129 | void setYesCancelVisible( bool show ); | 129 | void setYesCancelVisible( bool show ); |
130 | void setToolbarVisible( bool show ); | 130 | void setToolbarVisible( bool show ); |
131 | void setPermissionBarVisible( bool show ); | 131 | void setPermissionBarVisible( bool show ); |
132 | void setLineEditVisible(bool show) ; | 132 | void setLineEditVisible(bool show) ; |
133 | void setChooserVisible( bool chooser ); | 133 | void setChooserVisible( bool chooser ); |
134 | 134 | ||
135 | QCheckBox* permissionCheckbox(); | 135 | QCheckBox* permissionCheckbox(); |
136 | bool setPermission() const; | 136 | bool setPermission() const; |
137 | void setPermissionChecked( bool check ); | 137 | void setPermissionChecked( bool check ); |
138 | 138 | ||
139 | void setMode( int ); | 139 | void setMode( int ); |
140 | 140 | ||
141 | bool showDirs()const { return m_dir; } | 141 | bool showDirs()const { return m_dir; } |
142 | void setShowDirs(bool ); | 142 | void setShowDirs(bool ); |
143 | 143 | ||
144 | const QListView* listView() { return m_View; }; | 144 | const QListView* listView() { return m_View; }; |
145 | 145 | ||
146 | bool isCaseSensetive()const { return m_case; } | 146 | bool isCaseSensetive()const { return m_case; } |
147 | void setCaseSensetive(bool caSe ); | 147 | void setCaseSensetive(bool caSe ); |
148 | 148 | ||
149 | bool showFiles()const { return m_files; }; | 149 | bool showFiles()const { return m_files; }; |
150 | void setShowFiles(bool ); | 150 | void setShowFiles(bool ); |
151 | bool cd(const QString &path ); | 151 | bool cd(const QString &path ); |
152 | 152 | ||
153 | 153 | ||
154 | int mode()const { return m_mode; }; | 154 | int mode()const { return m_mode; }; |
155 | int selector()const { return m_selector; }; | 155 | int selector()const { return m_selector; }; |
156 | void setSelector( int ); | 156 | void setSelector( int ); |
157 | 157 | ||
158 | bool showPopup()const { return m_showPopup; }; | 158 | bool showPopup()const { return m_showPopup; }; |
159 | void setShowPopup( bool pop ) { m_showPopup = pop; }; | 159 | void setShowPopup( bool pop ) { m_showPopup = pop; }; |
160 | void setPopupMenu( QPopupMenu * ); | 160 | void setPopupMenu( QPopupMenu * ); |
161 | 161 | ||
162 | void updateLay(); | 162 | void updateLay(); |
163 | 163 | ||
164 | void reparse(); // re reads the dir | 164 | void reparse(); // re reads the dir |
165 | 165 | ||
166 | QString selectedName( )const; | 166 | QString selectedName( )const; |
167 | QStringList selectedNames()const; | 167 | QStringList selectedNames()const; |
168 | 168 | ||
169 | QString selectedPath() const; | 169 | QString selectedPath() const; |
170 | QStringList selectedPaths() const; | 170 | QStringList selectedPaths() const; |
171 | 171 | ||
172 | QString directory()const; | 172 | QString directory()const; |
173 | int fileCount(); | 173 | int fileCount(); |
174 | 174 | ||
175 | /* the user needs to delete it */ | 175 | /* the user needs to delete it */ |
176 | DocLnk selectedDocument()const; | 176 | DocLnk selectedDocument()const; |
177 | /* the user needs to delete it */ | 177 | /* the user needs to delete it */ |
178 | QValueList<DocLnk> selectedDocuments()const; | 178 | QValueList<DocLnk> selectedDocuments()const; |
179 | 179 | ||
180 | signals: | 180 | signals: |
181 | void fileSelected( const DocLnk & ); | 181 | void fileSelected( const DocLnk & ); |
182 | void fileSelected( const QString & ); | 182 | void fileSelected( const QString & ); |
183 | void dirSelected(const QString &dir ); | 183 | void dirSelected(const QString &dir ); |
184 | void closeMe(); | 184 | void closeMe(); |
185 | void ok(); | 185 | void ok(); |
186 | void cancel(); | 186 | void cancel(); |
187 | 187 | ||
188 | protected slots: | 188 | protected slots: |
189 | void slotOk(); | 189 | void slotOk(); |
190 | void slotCancel(); | 190 | void slotCancel(); |
191 | void slotViewCheck(const QString & ); | 191 | void slotViewCheck(const QString & ); |
192 | void slotMimeCheck(const QString & ); | 192 | void slotMimeCheck(const QString & ); |
193 | void locationComboActivated(const QString & ); | ||
194 | void insertLocationPath(const QString &, int); | ||
195 | int indexFromString(const QString &); | ||
193 | protected: | 196 | protected: |
194 | void init(); | 197 | void init(); |
195 | void updateMimes(); | 198 | void updateMimes(); |
196 | 199 | ||
197 | protected: | 200 | protected: |
198 | 201 | ||
199 | private: | 202 | private: |
200 | int m_mode, m_selector; | 203 | int m_mode, m_selector; |
201 | QComboBox *m_location, *m_mimeCheck, *m_viewCheck; | 204 | QComboBox *m_location, *m_mimeCheck, *m_viewCheck; |
202 | QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel; | 205 | QPushButton *m_homeButton, *m_docButton, *m_hideButton, *m_ok, *m_cancel; |
203 | QPushButton *m_reread, *m_up; | 206 | QPushButton *m_reread, *m_up; |
204 | QListView *m_View; | 207 | QListView *m_View; |
205 | QCheckBox *m_checkPerm; | 208 | QCheckBox *m_checkPerm; |
206 | QWidget *m_pseudo; | 209 | QWidget *m_pseudo; |
207 | QVBoxLayout *m_pseudoLayout; | 210 | QVBoxLayout *m_pseudoLayout; |
208 | 211 | ||
209 | QString m_currentDir; | 212 | QString m_currentDir; |
210 | QString m_name; | 213 | QString m_name; |
211 | QStringList m_mimetypes; | 214 | QStringList m_mimetypes; |
212 | 215 | ||
213 | FileSelector *m_select; | 216 | FileSelector *m_select; |
214 | QWidgetStack *m_stack; | 217 | QWidgetStack *m_stack; |
215 | QVBoxLayout *m_lay; | 218 | QVBoxLayout *m_lay; |
216 | QGridLayout *m_Oselector; | 219 | QGridLayout *m_Oselector; |
217 | 220 | ||
218 | QHBoxLayout *m_boxToolbar; | 221 | QHBoxLayout *m_boxToolbar; |
219 | QHBoxLayout *m_boxOk; | 222 | QHBoxLayout *m_boxOk; |
220 | QHBoxLayout *m_boxName; | 223 | QHBoxLayout *m_boxName; |
221 | QHBoxLayout *m_boxView; | 224 | QHBoxLayout *m_boxView; |
222 | 225 | ||
223 | QPopupMenu *m_custom; | 226 | QPopupMenu *m_custom; |
224 | 227 | ||
225 | QLineEdit *m_edit; | 228 | QLineEdit *m_edit; |
226 | QLabel *m_fnLabel; | 229 | QLabel *m_fnLabel; |
227 | bool m_shTool:1; | 230 | bool m_shTool:1; |
228 | bool m_shPerm:1; | 231 | bool m_shPerm:1; |
229 | bool m_shLne:1; | 232 | bool m_shLne:1; |
230 | bool m_shChooser:1; | 233 | bool m_shChooser:1; |
231 | bool m_shYesNo:1; | 234 | bool m_shYesNo:1; |
232 | bool m_boCheckPerm:1; | 235 | bool m_boCheckPerm:1; |
233 | bool m_autoMime:1; | 236 | bool m_autoMime:1; |
234 | bool m_case:1; | 237 | bool m_case:1; |
235 | bool m_dir:1; | 238 | bool m_dir:1; |
236 | bool m_files:1; | 239 | bool m_files:1; |
237 | bool m_showPopup:1; | 240 | bool m_showPopup:1; |
238 | 241 | ||
239 | // implementation todo | 242 | // implementation todo |
240 | virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE ); | 243 | virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE ); |