author | llornkcor <llornkcor> | 2002-03-24 20:47:43 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-24 20:47:43 (UTC) |
commit | e37311c84c3f14f947a4e28df809898d23cb2495 (patch) (unidiff) | |
tree | 284882e817c649619df942df7c6291c98c0daadb | |
parent | c9df42aefa24b90ddf89117cf25f6d6fcef2f1dd (diff) | |
download | opie-e37311c84c3f14f947a4e28df809898d23cb2495.zip opie-e37311c84c3f14f947a4e28df809898d23cb2495.tar.gz opie-e37311c84c3f14f947a4e28df809898d23cb2495.tar.bz2 |
blah
-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 3 | ||||
-rw-r--r-- | core/apps/textedit/fileBrowser.h | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index 7eac5d2..eea7144 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp | |||
@@ -69,65 +69,65 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags | |||
69 | 69 | ||
70 | dirPathStringList << "/"; | 70 | dirPathStringList << "/"; |
71 | // we can get the storage here | 71 | // we can get the storage here |
72 | 72 | ||
73 | layout->addMultiCellWidget( dirPathCombo, 0, 0, 0, 4 ); | 73 | layout->addMultiCellWidget( dirPathCombo, 0, 0, 0, 4 ); |
74 | 74 | ||
75 | cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); | 75 | cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); |
76 | cdUpButton ->setMinimumSize( QSize( 20, 20 ) ); | 76 | cdUpButton ->setMinimumSize( QSize( 20, 20 ) ); |
77 | cdUpButton ->setMaximumSize( QSize( 20, 20 ) ); | 77 | cdUpButton ->setMaximumSize( QSize( 20, 20 ) ); |
78 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | 78 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); |
79 | cdUpButton ->setFlat(TRUE); | 79 | cdUpButton ->setFlat(TRUE); |
80 | layout->addMultiCellWidget( cdUpButton, 0, 0, 5, 5 ); | 80 | layout->addMultiCellWidget( cdUpButton, 0, 0, 5, 5 ); |
81 | 81 | ||
82 | 82 | ||
83 | docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); | 83 | docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); |
84 | docButton->setMinimumSize( QSize( 20, 20 ) ); | 84 | docButton->setMinimumSize( QSize( 20, 20 ) ); |
85 | docButton->setMaximumSize( QSize( 20, 20 ) ); | 85 | docButton->setMaximumSize( QSize( 20, 20 ) ); |
86 | connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); | 86 | connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); |
87 | docButton->setFlat(TRUE); | 87 | docButton->setFlat(TRUE); |
88 | layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); | 88 | layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); |
89 | 89 | ||
90 | homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); | 90 | homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); |
91 | homeButton->setMinimumSize( QSize( 20, 20 ) ); | 91 | homeButton->setMinimumSize( QSize( 20, 20 ) ); |
92 | homeButton->setMaximumSize( QSize( 20, 20 ) ); | 92 | homeButton->setMaximumSize( QSize( 20, 20 ) ); |
93 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | 93 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); |
94 | homeButton->setFlat(TRUE); | 94 | homeButton->setFlat(TRUE); |
95 | layout->addMultiCellWidget( homeButton, 0, 0, 7, 7 ); | 95 | layout->addMultiCellWidget( homeButton, 0, 0, 7, 7 ); |
96 | 96 | ||
97 | FileStack = new QWidgetStack( this ); | 97 | FileStack = new QWidgetStack( this ); |
98 | 98 | ||
99 | 99 | ||
100 | ListView = new QListView( this, "ListView" ); | 100 | ListView = new QListView( this, "ListView" ); |
101 | ListView->setMinimumSize( QSize( 100, 25 ) ); | 101 | // ListView->setMinimumSize( QSize( 100, 25 ) ); |
102 | ListView->addColumn( tr( "Name" ) ); | 102 | ListView->addColumn( tr( "Name" ) ); |
103 | ListView->setColumnWidth(0,120); | 103 | ListView->setColumnWidth(0,120); |
104 | ListView->setSorting( 2, FALSE); | 104 | ListView->setSorting( 2, FALSE); |
105 | ListView->addColumn( tr( "Size" ) ); | 105 | ListView->addColumn( tr( "Size" ) ); |
106 | ListView->setColumnWidth(1,-1); | 106 | ListView->setColumnWidth(1,-1); |
107 | ListView->addColumn( "Date",-1); | 107 | ListView->addColumn( "Date",-1); |
108 | 108 | ||
109 | ListView->setColumnWidthMode(0,QListView::Manual); | 109 | ListView->setColumnWidthMode(0,QListView::Manual); |
110 | ListView->setColumnAlignment(1,QListView::AlignRight); | 110 | ListView->setColumnAlignment(1,QListView::AlignRight); |
111 | ListView->setColumnAlignment(2,QListView::AlignRight); | 111 | ListView->setColumnAlignment(2,QListView::AlignRight); |
112 | ListView->setAllColumnsShowFocus( TRUE ); | 112 | ListView->setAllColumnsShowFocus( TRUE ); |
113 | 113 | ||
114 | QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold); | 114 | QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold); |
115 | connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 115 | connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
116 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); | 116 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); |
117 | 117 | ||
118 | connect( ListView, SIGNAL( clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 118 | connect( ListView, SIGNAL( clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
119 | 119 | ||
120 | FileStack->addWidget( ListView, get_unique_id() ); | 120 | FileStack->addWidget( ListView, get_unique_id() ); |
121 | mimeType="text/*"; | 121 | mimeType="text/*"; |
122 | fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy | 122 | fileSelector = new FileSelector( mimeType, FileStack, "fileselector" , FALSE, FALSE); //buggy |
123 | // connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) ); | 123 | // connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( showEditTools() ) ); |
124 | // connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); | 124 | // connect( fileSelector, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); |
125 | connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) ); | 125 | connect( fileSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( docOpen( const DocLnk & ) ) ); |
126 | layout->addMultiCellWidget( FileStack, 1, 1, 0, 7 ); | 126 | layout->addMultiCellWidget( FileStack, 1, 1, 0, 7 ); |
127 | 127 | ||
128 | SelectionCombo = new QComboBox( FALSE, this, "SelectionCombo" ); | 128 | SelectionCombo = new QComboBox( FALSE, this, "SelectionCombo" ); |
129 | SelectionCombo->insertItem( tr( "Documents" ) ); | 129 | SelectionCombo->insertItem( tr( "Documents" ) ); |
130 | SelectionCombo->insertItem( tr( "All files" ) ); | 130 | SelectionCombo->insertItem( tr( "All files" ) ); |
131 | SelectionCombo->insertItem( tr( "Hidden files" ) ); | 131 | SelectionCombo->insertItem( tr( "Hidden files" ) ); |
132 | // SelectionCombo->setMaximumWidth(120); | 132 | // SelectionCombo->setMaximumWidth(120); |
133 | layout->addMultiCellWidget( SelectionCombo, 2, 2, 0, 3 ); | 133 | layout->addMultiCellWidget( SelectionCombo, 2, 2, 0, 3 ); |
@@ -498,34 +498,33 @@ void fileBrowser::receive( const QCString &msg, const QByteArray &data ) { | |||
498 | // { | 498 | // { |
499 | // int k; | 499 | // int k; |
500 | // QString c, m; | 500 | // QString c, m; |
501 | // stream >> k; | 501 | // stream >> k; |
502 | // stream >> c; | 502 | // stream >> c; |
503 | // stream >> m; | 503 | // stream >> m; |
504 | } | 504 | } |
505 | 505 | ||
506 | void fileBrowser::dirPathComboActivated( const QString & current) { | 506 | void fileBrowser::dirPathComboActivated( const QString & current) { |
507 | chdir( current.latin1() ); | 507 | chdir( current.latin1() ); |
508 | currentDir.cd( current, TRUE); | 508 | currentDir.cd( current, TRUE); |
509 | populateList(); | 509 | populateList(); |
510 | update(); | 510 | update(); |
511 | } | 511 | } |
512 | 512 | ||
513 | void fileBrowser::dirPathEditPressed() { | 513 | void fileBrowser::dirPathEditPressed() { |
514 | QString current = dirPathCombo->lineEdit()->text(); | 514 | QString current = dirPathCombo->lineEdit()->text(); |
515 | chdir( current.latin1() ); | 515 | chdir( current.latin1() ); |
516 | currentDir.cd( current, TRUE); | 516 | currentDir.cd( current, TRUE); |
517 | populateList(); | 517 | populateList(); |
518 | update(); | 518 | update(); |
519 | } | 519 | } |
520 | 520 | ||
521 | void fileBrowser::fillCombo(const QString ¤tPath) { | 521 | void fileBrowser::fillCombo(const QString ¤tPath) { |
522 | 522 | ||
523 | dirPathCombo->lineEdit()->setText(currentPath); | 523 | dirPathCombo->lineEdit()->setText(currentPath); |
524 | 524 | ||
525 | if( dirPathStringList.grep(currentPath,TRUE).isEmpty() ) { | 525 | if( dirPathStringList.grep(currentPath,TRUE).isEmpty() ) { |
526 | dirPathCombo->clear(); | 526 | dirPathCombo->clear(); |
527 | dirPathStringList.prepend(currentPath ); | 527 | dirPathStringList.prepend(currentPath ); |
528 | dirPathCombo->insertStringList( dirPathStringList,-1); | 528 | dirPathCombo->insertStringList( dirPathStringList,-1); |
529 | } | 529 | } |
530 | |||
531 | } | 530 | } |
diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h index 42bbc10..bac3d2e 100644 --- a/core/apps/textedit/fileBrowser.h +++ b/core/apps/textedit/fileBrowser.h | |||
@@ -34,68 +34,68 @@ class QListViewItem; | |||
34 | class QPushButton; | 34 | class QPushButton; |
35 | class QComboBox; | 35 | class QComboBox; |
36 | class QWidgetStack; | 36 | class QWidgetStack; |
37 | class FileSelector; | 37 | class FileSelector; |
38 | class QPoint; | 38 | class QPoint; |
39 | class MenuButton; | 39 | class MenuButton; |
40 | class QRegExp; | 40 | class QRegExp; |
41 | 41 | ||
42 | 42 | ||
43 | class fileBrowser : public QDialog | 43 | class fileBrowser : public QDialog |
44 | { | 44 | { |
45 | Q_OBJECT | 45 | Q_OBJECT |
46 | 46 | ||
47 | public: | 47 | public: |
48 | fileBrowser( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ,const QString filter=0); | 48 | fileBrowser( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ,const QString filter=0); |
49 | ~fileBrowser(); | 49 | ~fileBrowser(); |
50 | 50 | ||
51 | QPushButton *buttonOk, *buttonCancel, *homeButton, *docButton, *hideButton, *cdUpButton; | 51 | QPushButton *buttonOk, *buttonCancel, *homeButton, *docButton, *hideButton, *cdUpButton; |
52 | QListView* ListView; | 52 | QListView* ListView; |
53 | 53 | ||
54 | QLabel *dirLabel; | 54 | QLabel *dirLabel; |
55 | QString selectedFileName, filterStr; | 55 | QString selectedFileName, filterStr; |
56 | QDir currentDir; | 56 | QDir currentDir; |
57 | QFile file; | 57 | QFile file; |
58 | QStringList fileList, dirPathStringList; | 58 | QStringList fileList, dirPathStringList; |
59 | QListViewItem * item; | 59 | QListViewItem * item; |
60 | QComboBox *SelectionCombo, *dirPathCombo; | 60 | QComboBox *SelectionCombo, *dirPathCombo; |
61 | MenuButton *typemb; | 61 | MenuButton *typemb; |
62 | QWidgetStack *FileStack; | 62 | QWidgetStack *FileStack; |
63 | FileSelector *fileSelector; | 63 | FileSelector *fileSelector; |
64 | QString mimeType; | 64 | QString mimeType; |
65 | public slots: | 65 | public slots: |
66 | 66 | void setFileView( int ); | |
67 | |||
67 | private: | 68 | private: |
68 | // QDict<void> mimes; | 69 | // QDict<void> mimes; |
69 | QRegExp tf; | 70 | QRegExp tf; |
70 | QStringList getMimeTypes(); | 71 | QStringList getMimeTypes(); |
71 | void fillCombo( const QString&); | 72 | void fillCombo( const QString&); |
72 | void setFileView( int ); | ||
73 | 73 | ||
74 | private slots: | 74 | private slots: |
75 | void populateList(); | 75 | void populateList(); |
76 | void homeButtonPushed(); | 76 | void homeButtonPushed(); |
77 | void docButtonPushed(); | 77 | void docButtonPushed(); |
78 | void ListPressed( int, QListViewItem *, const QPoint&, int); | 78 | void ListPressed( int, QListViewItem *, const QPoint&, int); |
79 | void showListMenu(QListViewItem*); | 79 | void showListMenu(QListViewItem*); |
80 | void doCd(); | 80 | void doCd(); |
81 | void makDir(); | 81 | void makDir(); |
82 | void localRename(); | 82 | void localRename(); |
83 | void localDelete(); | 83 | void localDelete(); |
84 | void receive( const QCString &msg, const QByteArray &data ); | 84 | void receive( const QCString &msg, const QByteArray &data ); |
85 | void dirPathComboActivated( const QString & ); | 85 | void dirPathComboActivated( const QString & ); |
86 | void upDir(); | 86 | void upDir(); |
87 | void listClicked( QListViewItem * ); | 87 | void listClicked( QListViewItem * ); |
88 | void selectionChanged( const QString & ); | 88 | void selectionChanged( const QString & ); |
89 | void OnOK(); | 89 | void OnOK(); |
90 | void docOpen( const DocLnk & ); | 90 | void docOpen( const DocLnk & ); |
91 | void updateMimeTypeMenu(); | 91 | void updateMimeTypeMenu(); |
92 | void showType(const QString &); | 92 | void showType(const QString &); |
93 | void dirPathEditPressed(); | 93 | void dirPathEditPressed(); |
94 | 94 | ||
95 | protected slots: | 95 | protected slots: |
96 | 96 | ||
97 | protected: | 97 | protected: |
98 | 98 | ||
99 | }; | 99 | }; |
100 | 100 | ||
101 | #endif // FILEBROWSER_H | 101 | #endif // FILEBROWSER_H |