Diffstat (limited to 'core/apps/textedit/fileBrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index 2275388..3e3cc3a 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp | |||
@@ -14,4 +14,5 @@ | |||
14 | #include "fileBrowser.h" | 14 | #include "fileBrowser.h" |
15 | #include <qpe/config.h> | 15 | #include <qpe/config.h> |
16 | #include <qpe/resource.h> | ||
16 | 17 | ||
17 | #include <qlistview.h> | 18 | #include <qlistview.h> |
@@ -26,10 +27,17 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags | |||
26 | if ( !name ) | 27 | if ( !name ) |
27 | setName( "fileBrowser" ); | 28 | setName( "fileBrowser" ); |
28 | resize( 236, 280 ); | 29 | resize( 240, 280 ); |
29 | setCaption(tr( "Browse for file" ) ); | 30 | setCaption(tr( "Browse for file" ) ); |
30 | filterStr=filter; | 31 | filterStr=filter; |
32 | |||
31 | dirLabel = new QLabel(this, "DirLabel"); | 33 | dirLabel = new QLabel(this, "DirLabel"); |
32 | dirLabel->setText(currentDir.canonicalPath()); | 34 | dirLabel->setText(currentDir.canonicalPath()); |
33 | dirLabel->setGeometry(10,4,230,30); | 35 | dirLabel->setGeometry(10,20,230,15); |
36 | |||
37 | QPushButton *homeButton; | ||
38 | homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton"); | ||
39 | homeButton->setGeometry(200,4,25,25); | ||
40 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | ||
41 | |||
34 | ListView = new QListView( this, "ListView" ); | 42 | ListView = new QListView( this, "ListView" ); |
35 | ListView->addColumn( tr( "Name" ) ); | 43 | ListView->addColumn( tr( "Name" ) ); |
@@ -52,4 +60,5 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags | |||
52 | currentDir.setPath(QDir::currentDirPath()); | 60 | currentDir.setPath(QDir::currentDirPath()); |
53 | populateList(); | 61 | populateList(); |
62 | move(0,15); | ||
54 | } | 63 | } |
55 | 64 | ||
@@ -95,5 +104,5 @@ void fileBrowser::populateList() | |||
95 | } | 104 | } |
96 | ListView->setSorting( 2, FALSE); | 105 | ListView->setSorting( 2, FALSE); |
97 | dirLabel->setText("Current Directory:\n"+currentDir.canonicalPath()); | 106 | dirLabel->setText(currentDir.canonicalPath()); |
98 | } | 107 | } |
99 | 108 | ||
@@ -163,2 +172,9 @@ void fileBrowser::OnOK() | |||
163 | accept(); | 172 | accept(); |
164 | } | 173 | } |
174 | |||
175 | void fileBrowser::homeButtonPushed() { | ||
176 | chdir( QDir::homeDirPath().latin1() ); | ||
177 | currentDir.cd( QDir::homeDirPath(), TRUE); | ||
178 | populateList(); | ||
179 | update(); | ||
180 | } | ||