Diffstat (limited to 'core/apps/textedit/fileBrowser.cpp') (more/less context) (show 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 @@ #include "fileBrowser.h" #include <qpe/config.h> +#include <qpe/resource.h> #include <qlistview.h> @@ -26,10 +27,17 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags if ( !name ) setName( "fileBrowser" ); - resize( 236, 280 ); + resize( 240, 280 ); setCaption(tr( "Browse for file" ) ); filterStr=filter; + dirLabel = new QLabel(this, "DirLabel"); dirLabel->setText(currentDir.canonicalPath()); - dirLabel->setGeometry(10,4,230,30); + dirLabel->setGeometry(10,20,230,15); + + QPushButton *homeButton; + homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton"); + homeButton->setGeometry(200,4,25,25); + connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); + ListView = new QListView( this, "ListView" ); ListView->addColumn( tr( "Name" ) ); @@ -52,4 +60,5 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags currentDir.setPath(QDir::currentDirPath()); populateList(); + move(0,15); } @@ -95,5 +104,5 @@ void fileBrowser::populateList() } ListView->setSorting( 2, FALSE); - dirLabel->setText("Current Directory:\n"+currentDir.canonicalPath()); + dirLabel->setText(currentDir.canonicalPath()); } @@ -163,2 +172,9 @@ void fileBrowser::OnOK() accept(); } + +void fileBrowser::homeButtonPushed() { + chdir( QDir::homeDirPath().latin1() ); + currentDir.cd( QDir::homeDirPath(), TRUE); + populateList(); + update(); +} |