-rw-r--r-- | libopie/ofileselector.cc | 168 | ||||
-rw-r--r-- | libopie/ofileselector.h | 100 |
2 files changed, 220 insertions, 48 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index b911d37..61ab2c4 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc | |||
@@ -38,15 +38,18 @@ | |||
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 | 42 | ||
42 | #include <qpe/qpeapplication.h> | 43 | #include <qpe/qpeapplication.h> |
43 | #include <qpe/fileselector.h> | 44 | #include <qpe/fileselector.h> |
44 | #include <qpe/applnk.h> | 45 | #include <qpe/applnk.h> |
45 | #include <qpe/global.h> | 46 | #include <qpe/global.h> |
46 | #include <qpe/mimetype.h> | 47 | #include <qpe/mimetype.h> |
48 | #include <qpe/resource.h> | ||
47 | 49 | ||
48 | #include "ofileselector.h" | 50 | #include "ofileselector.h" |
49 | 51 | ||
52 | QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0; | ||
50 | 53 | ||
51 | OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, | 54 | OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, |
52 | const QString &fileName, const QStringList mimetypes ) : QWidget( wid ) | 55 | const QString &fileName, const QStringList mimetypes ) : QWidget( wid ) |
@@ -89,11 +92,27 @@ OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString | |||
89 | m_mimeCheck = 0; | 92 | m_mimeCheck = 0; |
90 | m_viewCheck = 0; | 93 | m_viewCheck = 0; |
91 | 94 | ||
95 | m_dir = true; | ||
96 | m_files = true; | ||
97 | |||
98 | if(m_pixmaps == 0 ) // init the pixmaps | ||
99 | initPics(); | ||
100 | |||
92 | m_lay = new QVBoxLayout(this); | 101 | m_lay = new QVBoxLayout(this); |
93 | init(); | 102 | init(); |
94 | m_edit->setText( fileName ); | 103 | m_edit->setText( fileName ); |
95 | } | 104 | } |
105 | void OFileSelector::initPics() | ||
106 | { | ||
107 | m_pixmaps = new QMap<QString,QPixmap>; | ||
108 | QPixmap pm = Resource::loadPixmap( "folder " ); | ||
109 | QPixmap lnk = Resource::loadPixmap( "symlink" ); | ||
110 | QPainter painter( &pm ); | ||
111 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | ||
112 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | ||
113 | m_pixmaps->insert("dirsymlink", pm ); | ||
96 | 114 | ||
115 | }; | ||
97 | // let's initialize the gui | 116 | // let's initialize the gui |
98 | /** | 117 | /** |
99 | -------------------- | 118 | -------------------- |
@@ -149,7 +168,7 @@ void OFileSelector::init() | |||
149 | 168 | ||
150 | }; | 169 | }; |
151 | 170 | ||
152 | void OFileSelector::setShowYesCancel( bool show ) | 171 | void OFileSelector::setYesCancelVisible( bool show ) |
153 | { | 172 | { |
154 | if ( show == m_shYesNo ) | 173 | if ( show == m_shYesNo ) |
155 | return; | 174 | return; |
@@ -164,7 +183,7 @@ void OFileSelector::setShowYesCancel( bool show ) | |||
164 | updateLay(); // recreate it and save the other states | 183 | updateLay(); // recreate it and save the other states |
165 | } | 184 | } |
166 | 185 | ||
167 | void OFileSelector::setShowToolbar( bool show ) | 186 | void OFileSelector::setToolbarVisible( bool show ) |
168 | { | 187 | { |
169 | if ( m_shTool == show ) | 188 | if ( m_shTool == show ) |
170 | return; | 189 | return; |
@@ -175,7 +194,7 @@ void OFileSelector::setShowToolbar( bool show ) | |||
175 | }*/ | 194 | }*/ |
176 | } | 195 | } |
177 | 196 | ||
178 | void OFileSelector::setShowPermissionBar( bool show ) | 197 | void OFileSelector::setPermissionBarVisible( bool show ) |
179 | { | 198 | { |
180 | if( show == m_shPerm ) | 199 | if( show == m_shPerm ) |
181 | return; | 200 | return; |
@@ -184,7 +203,7 @@ void OFileSelector::setShowPermissionBar( bool show ) | |||
184 | 203 | ||
185 | updateLay(); | 204 | updateLay(); |
186 | } | 205 | } |
187 | void OFileSelector::setShowLineEdit( bool show ) | 206 | void OFileSelector::setLineEditVisible( bool show ) |
188 | { | 207 | { |
189 | if( show == m_shLne ) | 208 | if( show == m_shLne ) |
190 | return; | 209 | return; |
@@ -199,7 +218,7 @@ void OFileSelector::setShowLineEdit( bool show ) | |||
199 | } | 218 | } |
200 | updateLay(); | 219 | updateLay(); |
201 | } | 220 | } |
202 | void OFileSelector::setShowChooser( bool show ) | 221 | void OFileSelector::setChooserVisible( bool show ) |
203 | { | 222 | { |
204 | if( show = m_shChooser ) | 223 | if( show = m_shChooser ) |
205 | return; | 224 | return; |
@@ -216,6 +235,20 @@ QCheckBox* OFileSelector::permissionCheckbox( ) | |||
216 | { | 235 | { |
217 | return m_checkPerm; | 236 | return m_checkPerm; |
218 | } | 237 | } |
238 | void OFileSelector::setCaseSensetive( bool caSe ) | ||
239 | { | ||
240 | m_case = caSe; | ||
241 | reparse(); | ||
242 | } | ||
243 | void OFileSelector::setShowFiles(bool files ){ | ||
244 | m_files = files; | ||
245 | reparse(); | ||
246 | } | ||
247 | void OFileSelector::setPopupMenu(const QPopupMenu * ) | ||
248 | { | ||
249 | //delete oldpopup; | ||
250 | |||
251 | } | ||
219 | bool OFileSelector::setPermission( ) const | 252 | bool OFileSelector::setPermission( ) const |
220 | { | 253 | { |
221 | if( m_checkPerm == 0 ) | 254 | if( m_checkPerm == 0 ) |
@@ -229,14 +262,29 @@ void OFileSelector::setPermissionChecked( bool check ) | |||
229 | return; | 262 | return; |
230 | m_checkPerm->setChecked( check ); | 263 | m_checkPerm->setChecked( check ); |
231 | } | 264 | } |
232 | QString OFileSelector::selectedName( ) | 265 | QString OFileSelector::selectedName( )const |
233 | { | 266 | { |
234 | QString string; | 267 | QString string; |
268 | if( m_selector == NORMAL ){ | ||
269 | const DocLnk *lnk = m_select->selected(); | ||
270 | string = lnk->file(); | ||
271 | }else if(m_selector == EXTENDED || m_selector == EXTENDED_ALL ) { | ||
272 | QListViewItem *item = m_View->currentItem(); | ||
273 | if(item != 0 ){ | ||
274 | string = item->text( 1 ); | ||
275 | } | ||
276 | } | ||
235 | return string; | 277 | return string; |
236 | } | 278 | } |
237 | const DocLnk* OFileSelector::selectedDocument( )const | 279 | QStringList OFileSelector::selectedNames()const |
238 | { | 280 | { |
239 | return 0; | 281 | QStringList list; |
282 | |||
283 | } | ||
284 | DocLnk OFileSelector::selectedDocument( )const | ||
285 | { | ||
286 | DocLnk lnk; | ||
287 | return lnk; | ||
240 | } | 288 | } |
241 | void OFileSelector::updateLay() | 289 | void OFileSelector::updateLay() |
242 | { | 290 | { |
@@ -286,15 +334,16 @@ bool OFileSelector::compliesMime(const QString &path, const QString &mime ) | |||
286 | 334 | ||
287 | void OFileSelector::reparse() | 335 | void OFileSelector::reparse() |
288 | { | 336 | { |
289 | if(m_View== 0) | 337 | if(m_View== 0 || m_selector == NORMAL) |
290 | return; | 338 | return; |
291 | 339 | ||
292 | m_View->clear(); | 340 | m_View->clear(); |
293 | 341 | ||
294 | QDir dir( m_currentDir ); | 342 | |
295 | QString currMime =m_mimeCheck->currentText(); | 343 | QString currMime =m_mimeCheck->currentText(); |
296 | // update the mimetype now | 344 | // update the mimetype now |
297 | if( m_autoMime ) { | 345 | if( m_autoMime ) { |
346 | QDir dir( m_currentDir ); | ||
298 | m_mimetypes.clear(); | 347 | m_mimetypes.clear(); |
299 | m_mimeCheck->clear(); | 348 | m_mimeCheck->clear(); |
300 | dir.setFilter( QDir::Files | QDir::Readable ); | 349 | dir.setFilter( QDir::Files | QDir::Readable ); |
@@ -313,45 +362,60 @@ void OFileSelector::reparse() | |||
313 | 362 | ||
314 | ++it; | 363 | ++it; |
315 | } | 364 | } |
365 | m_mimetypes.prepend("All" ); | ||
316 | m_mimeCheck->insertStringList(m_mimetypes ); | 366 | m_mimeCheck->insertStringList(m_mimetypes ); |
317 | // set it to the current mimetype | 367 | // set it to the current mimetype |
318 | }; | 368 | }; |
319 | dir.setFilter(QDir::All ); | 369 | QDir dir( m_currentDir ); |
320 | dir.setSorting(QDir::Name | QDir::DirsFirst ); | 370 | //dir.setFilter(-1 ); |
371 | dir.setSorting(QDir::Name | QDir::DirsFirst | QDir::Reversed | QDir::IgnoreCase ); | ||
321 | const QFileInfoList *list = dir.entryInfoList(); | 372 | const QFileInfoList *list = dir.entryInfoList(); |
322 | QFileInfoListIterator it( *list ); | 373 | QFileInfoListIterator it( *list ); |
323 | QFileInfo *fi; | 374 | QFileInfo *fi; |
324 | while( (fi=it.current()) ){ | 375 | while( (fi=it.current()) ){ |
376 | if(fi->fileName() == ".." || fi->fileName() == "." ){ | ||
377 | ++it; | ||
378 | continue; | ||
379 | } | ||
380 | qWarning("Test: %s", fi->fileName().latin1() ); | ||
325 | if(fi->isSymLink() ){ | 381 | if(fi->isSymLink() ){ |
382 | qWarning("Symlink %s", fi->fileName().latin1() ); | ||
326 | QString file = fi->readLink(); | 383 | QString file = fi->readLink(); |
384 | qWarning("File ->%s", file.latin1() ); | ||
327 | for(int i=0; i<=4; i++ ){ // prepend from dos | 385 | for(int i=0; i<=4; i++ ){ // prepend from dos |
328 | QFileInfo info( file ); | 386 | QFileInfo info( fi->dirPath()+ "/"+file ); |
329 | if( !info.exists() ){ | 387 | if( !info.exists() ){ |
330 | addSymlink(m_currentDir, info.fileName(), TRUE ); | 388 | qWarning("does not exist" ); |
389 | addSymlink(currMime, fi, TRUE ); | ||
331 | break; | 390 | break; |
332 | }else if( info.isDir() ){ | 391 | }else if( info.isDir() ){ |
333 | //addDir( ); | 392 | qWarning("isDir" ); |
393 | addDir(currMime, fi, TRUE ); | ||
394 | break; | ||
334 | }else if( info.isFile() ){ | 395 | }else if( info.isFile() ){ |
335 | 396 | qWarning("isFile" ); | |
397 | addFile(currMime, fi, TRUE ); | ||
398 | break; | ||
336 | }else if( info.isSymLink() ){ | 399 | }else if( info.isSymLink() ){ |
337 | file = info.readLink(); | 400 | file = info.readLink(); |
401 | qWarning("isSymlink again %s", file.latin1() ); | ||
338 | }else if( i == 4 ){ // just insert it and have the symlink symbol | 402 | }else if( i == 4 ){ // just insert it and have the symlink symbol |
339 | addSymlink(m_currentDir, info.fileName() ); | 403 | addSymlink(currMime, fi ); |
404 | qWarning("level too deep" ); | ||
340 | } | 405 | } |
341 | } | 406 | } |
342 | }else if( fi->isDir() ){ | 407 | }else if( fi->isDir() ){ |
343 | 408 | addDir(currMime, fi ); | |
344 | }else if( fi->isFile() ) { // file ? | 409 | }else if( fi->isFile() ) { // file ? |
345 | 410 | addFile(currMime, fi ); | |
346 | |||
347 | } | 411 | } |
348 | ++it; | 412 | ++it; |
349 | } | 413 | } |
414 | m_View->sort(); | ||
350 | } | 415 | } |
351 | QString OFileSelector::directory() | 416 | QString OFileSelector::directory()const |
352 | { | 417 | { |
353 | QString string; | 418 | return m_currentDir; |
354 | return string; | ||
355 | } | 419 | } |
356 | int OFileSelector::fileCount() | 420 | int OFileSelector::fileCount() |
357 | { | 421 | { |
@@ -448,8 +512,12 @@ void OFileSelector::slotViewCheck(const QString &view ){ | |||
448 | m_select = new FileSelector( currMime == "All" ? QString::null : currMime, | 512 | m_select = new FileSelector( currMime == "All" ? QString::null : currMime, |
449 | m_stack,"fileselector", FALSE, FALSE ); | 513 | m_stack,"fileselector", FALSE, FALSE ); |
450 | m_stack->addWidget( m_select, NORMAL ); | 514 | m_stack->addWidget( m_select, NORMAL ); |
451 | m_stack->raiseWidget( NORMAL ); | 515 | m_mimeCheck->clear(); |
452 | m_selector = NORMAL; | 516 | m_selector = NORMAL; |
517 | updateMimes(); | ||
518 | m_mimeCheck->insertStringList( m_mimetypes ); | ||
519 | m_stack->raiseWidget( NORMAL ); | ||
520 | |||
453 | 521 | ||
454 | }else if(view == QString::fromLatin1("Files") ){ | 522 | }else if(view == QString::fromLatin1("Files") ){ |
455 | // remove from the stack | 523 | // remove from the stack |
@@ -510,12 +578,60 @@ void OFileSelector::initializeListView() | |||
510 | m_View->addColumn(tr("Mime Type") ); | 578 | m_View->addColumn(tr("Mime Type") ); |
511 | QHeader *header = m_View->header(); | 579 | QHeader *header = m_View->header(); |
512 | header->hide(); | 580 | header->hide(); |
581 | m_View->setSorting(1 ); | ||
513 | }; | 582 | }; |
514 | 583 | ||
584 | void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink ){ | ||
585 | qWarning("Add Files" ); | ||
586 | if( !m_files ){ | ||
587 | qWarning("not mfiles" ); | ||
588 | return; | ||
589 | } | ||
515 | 590 | ||
591 | MimeType type( info->filePath() ); | ||
592 | if(mime == "All" ){ | ||
593 | ; | ||
594 | }else if( type.id() != mime ) { | ||
595 | return; | ||
596 | } | ||
597 | QPixmap pix = type.pixmap(); | ||
598 | if(pix.isNull() ) | ||
599 | pix = Resource::loadPixmap( "UnknownDocument-14" ); | ||
600 | if( symlink ) // have a blended pic sometime | ||
601 | new OFileSelectorItem( m_View, pix, info->fileName(), | ||
602 | info->lastModified().toString(), | ||
603 | QString::number(info->size() ), | ||
604 | info->dirPath(true) ); | ||
605 | else | ||
606 | new OFileSelectorItem( m_View, pix, info->fileName(), | ||
607 | info->lastModified().toString(), | ||
608 | QString::number(info->size() ), | ||
609 | info->dirPath(true) ); | ||
610 | } | ||
611 | void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink ) | ||
612 | { | ||
613 | if(!m_dir ) | ||
614 | return; | ||
615 | //if( showDirs ) | ||
616 | { | ||
617 | if( symlink){ | ||
618 | QPixmap map = (*m_pixmaps)["dirsymlink" ]; | ||
619 | qWarning("Symlink" ); | ||
620 | new OFileSelectorItem(m_View, map, | ||
621 | info->fileName(), info->lastModified().toString() , | ||
622 | QString::number(info->size() ),info->dirPath(true), true ); | ||
623 | }else | ||
624 | new OFileSelectorItem(m_View, Resource::loadPixmap("folder" ), | ||
625 | info->fileName(), info->lastModified().toString(), | ||
626 | QString::number(info->size() ),info->dirPath(true), true ); | ||
516 | 627 | ||
517 | 628 | } | |
518 | 629 | } | |
630 | void OFileSelector::setShowDirs(bool dir ) | ||
631 | { | ||
632 | m_dir = dir; | ||
633 | reparse(); | ||
634 | } | ||
519 | 635 | ||
520 | 636 | ||
521 | 637 | ||
diff --git a/libopie/ofileselector.h b/libopie/ofileselector.h index a90219f..73674e2 100644 --- a/libopie/ofileselector.h +++ b/libopie/ofileselector.h | |||
@@ -38,7 +38,10 @@ | |||
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> | ||
42 | #include <qvaluelist.h> | ||
41 | 43 | ||
44 | #include <qpe/applnk.h> | ||
42 | #include <qlistview.h> | 45 | #include <qlistview.h> |
43 | /** This is OPIEs FileDialog Widget. You can use it | 46 | /** This is OPIEs FileDialog Widget. You can use it |
44 | * as a dropin replacement of the fileselector and | 47 | * as a dropin replacement of the fileselector and |
@@ -59,27 +62,50 @@ class QWidgetStack; | |||
59 | class QHBoxLayout; | 62 | class QHBoxLayout; |
60 | class QVBoxLayout; | 63 | class QVBoxLayout; |
61 | class QPopupMenu; | 64 | class QPopupMenu; |
62 | 65 | class QFileInfo; | |
63 | 66 | // | |
64 | class OFileSelectorItem : public QListViewItem { | 67 | class OFileSelectorItem : public QListViewItem { |
65 | public: | 68 | public: |
66 | OFileSelectorItem(QListView *view, const QPixmap &pixmap, const QString &path, | 69 | OFileSelectorItem(QListView *view, const QPixmap &pixmap, const QString &path, |
67 | const QString &date, const QString &size, | 70 | const QString &date, const QString &size, const QString &mDir, |
68 | bool isDir=false ): QListViewItem(view) { | 71 | bool isDir=false ): QListViewItem(view) { |
69 | setPixmap(0, pixmap ); | 72 | setPixmap(0, pixmap ); |
70 | setText(1, path ); | 73 | setText(1, path ); |
71 | setText(2, size ); | 74 | setText(2, size ); |
72 | setText(3, date ); | 75 | setText(3, date ); |
76 | //setText(4, mDir ); | ||
77 | m_dir = mDir; | ||
73 | dir = isDir; | 78 | dir = isDir; |
74 | } | 79 | } |
80 | QString directory()const{ | ||
81 | return m_dir; | ||
82 | } | ||
75 | bool isDir()const{ | 83 | bool isDir()const{ |
76 | return dir; | 84 | return dir; |
77 | } | 85 | } |
78 | QString path()const{ | 86 | QString path()const{ |
79 | return text(1 ); | 87 | return text(1 ); |
80 | } | 88 | } |
89 | QString key(int id, bool )const { | ||
90 | QString ke; | ||
91 | if( id == 0 || id == 1 ){ // name | ||
92 | if( dir ){ | ||
93 | ke.append("0" ); | ||
94 | ke.append( text(1) ); | ||
95 | }else{ | ||
96 | ke.append("1" ); | ||
97 | ke.append( text(1) ); | ||
98 | } | ||
99 | }else if( id == 2 ){ // size | ||
100 | return text(2); | ||
101 | }else if( id == 3 ){ // date | ||
102 | return text(3); | ||
103 | } | ||
104 | return ke; | ||
105 | }; | ||
81 | private: | 106 | private: |
82 | bool dir:1; | 107 | bool dir:1; |
108 | QString m_dir; | ||
83 | }; | 109 | }; |
84 | 110 | ||
85 | class OFileSelector : public QWidget { | 111 | class OFileSelector : public QWidget { |
@@ -90,35 +116,61 @@ class OFileSelector : public QWidget { | |||
90 | enum View { DIRS = 1, FILES = 2, TREE = 4, ICON = 8 }; | 116 | enum View { DIRS = 1, FILES = 2, TREE = 4, ICON = 8 }; |
91 | OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, const QString &fileName = QString::null, const QStringList mimetypes = QStringList() ); | 117 | OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, const QString &fileName = QString::null, const QStringList mimetypes = QStringList() ); |
92 | 118 | ||
93 | bool showToolbar() const { return m_shTool; }; | 119 | bool isToolbarVisible() const { return m_shTool; }; |
94 | bool showPermissionBar() const { return m_shPerm; }; | 120 | bool isPermissionBarVisible() const { return m_shPerm; }; |
95 | bool showLineEdit()const { return m_shLne; }; | 121 | bool isLineEditVisible()const { return m_shLne; }; |
96 | bool showChooser( )const { return m_shChooser; }; | 122 | bool isChooserVisible( )const { return m_shChooser; }; |
97 | bool showYesCancel()const { return m_shYesNo; }; | 123 | bool isYesCancelVisible()const { return m_shYesNo; }; |
98 | void setShowYesCancel( bool show ); | 124 | void setYesCancelVisible( bool show ); |
99 | void setShowToolbar( bool show ); | 125 | void setToolbarVisible( bool show ); |
100 | void setShowPermissionBar( bool show ); | 126 | void setPermissionBarVisible( bool show ); |
101 | void setShowLineEdit(bool show) ; | 127 | void setLineEditVisible(bool show) ; |
102 | void setShowChooser( bool chooser ); | 128 | void setChooserVisible( bool chooser ); |
129 | |||
103 | QCheckBox* permissionCheckbox(); | 130 | QCheckBox* permissionCheckbox(); |
104 | bool setPermission() const; | 131 | bool setPermission() const; |
105 | void setPermissionChecked( bool check ); | 132 | void setPermissionChecked( bool check ); |
133 | |||
106 | void setMode( int ); | 134 | void setMode( int ); |
107 | void setShowDirs(bool dir ) { }; | 135 | |
108 | bool showDirs() {bool turn; return turn; } | 136 | bool showDirs()const { return m_dir; } |
137 | void setShowDirs(bool ); | ||
138 | |||
139 | const QListView* listview() { return m_View; }; | ||
140 | |||
141 | bool isCaseSensetive()const { return m_case; } | ||
142 | void setCaseSensetive(bool caSe ); | ||
143 | |||
144 | bool showFiles()const { return m_files; }; | ||
145 | void setShowFiles(bool ); | ||
146 | |||
147 | |||
148 | |||
109 | int mode()const { return m_mode; }; | 149 | int mode()const { return m_mode; }; |
110 | int selector()const { return m_selector; }; | 150 | int selector()const { return m_selector; }; |
111 | void setSelector( int ); | 151 | void setSelector( int ); |
112 | QString selectedName( ); | 152 | |
153 | |||
113 | void setPopupMenu( const QPopupMenu * ); | 154 | void setPopupMenu( const QPopupMenu * ); |
114 | 155 | ||
115 | const DocLnk* selectedDocument()const; | ||
116 | void updateLay(); | 156 | void updateLay(); |
117 | 157 | ||
118 | void reparse(); // re reads the dir | 158 | void reparse(); // re reads the dir |
119 | QString directory(); | 159 | |
160 | QString selectedName( )const; | ||
161 | QStringList selectedNames()const; | ||
162 | |||
163 | QString selectedPath() const; | ||
164 | QStringList selectedPaths() const; | ||
165 | |||
166 | QString directory()const; | ||
120 | int fileCount(); | 167 | int fileCount(); |
121 | 168 | ||
169 | /* the user needs to delete it */ | ||
170 | DocLnk selectedDocument()const; | ||
171 | /* the user needs to delete it */ | ||
172 | QValueList<DocLnk> selectedDocuments(); | ||
173 | |||
122 | signals: | 174 | signals: |
123 | void fileSelected( const DocLnk & ); | 175 | void fileSelected( const DocLnk & ); |
124 | void fileSelected( const QString & ); | 176 | void fileSelected( const QString & ); |
@@ -164,24 +216,28 @@ class OFileSelector : public QWidget { | |||
164 | bool m_shYesNo:1; | 216 | bool m_shYesNo:1; |
165 | bool m_boCheckPerm:1; | 217 | bool m_boCheckPerm:1; |
166 | bool m_autoMime:1; | 218 | bool m_autoMime:1; |
219 | bool m_case:1; | ||
220 | bool m_dir:1; | ||
221 | bool m_files:1; | ||
167 | 222 | ||
168 | protected: | 223 | protected: |
169 | 224 | ||
170 | private: | 225 | private: |
171 | // implementation todo | 226 | // implementation todo |
172 | virtual void addFile(const QString &path, const QString &name, bool symlink = FALSE ) {}; | 227 | virtual void addFile(const QString &mime, QFileInfo *info, bool symlink = FALSE ); |
173 | virtual void addDir( const QString &path, const QString &dir , bool symlink = FALSE ){}; | 228 | virtual void addDir( const QString &mime, QFileInfo *info , bool symlink = FALSE ); |
174 | virtual void addSymlink(const QString &path, const QString &name, bool broken = FALSE ){}; | 229 | virtual void addSymlink(const QString &mime, QFileInfo *info, bool broken = FALSE ){}; |
175 | void delItems(); | 230 | void delItems(); |
176 | void initializeName(); | 231 | void initializeName(); |
177 | void initializeYes(); | 232 | void initializeYes(); |
178 | void initializeChooser(); | 233 | void initializeChooser(); |
179 | void initializeListView(); | 234 | void initializeListView(); |
235 | void initPics(); | ||
180 | bool compliesMime(const QString &path, const QString &mime); | 236 | bool compliesMime(const QString &path, const QString &mime); |
181 | 237 | ||
182 | class OFileSelectorPrivate; | 238 | class OFileSelectorPrivate; |
183 | OFileSelectorPrivate *d; | 239 | OFileSelectorPrivate *d; |
184 | 240 | static QMap<QString,QPixmap> *m_pixmaps; | |
185 | }; | 241 | }; |
186 | 242 | ||
187 | 243 | ||