From 2dfc5c76379baf8ae8ad6aed5f6c44d59d79087b Mon Sep 17 00:00:00 2001 From: bipolar Date: Fri, 01 Mar 2002 14:49:41 +0000 Subject: ljp (llornkcor) commited this. Fixes fileSaveas and filedialog positioning when input method is opened. Added home buttons on each. --- (limited to 'core/apps/textedit/fileBrowser.cpp') 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 @@ -13,6 +13,7 @@ ****************************************************************************/ #include "fileBrowser.h" #include +#include #include #include @@ -25,12 +26,19 @@ 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" ) ); ListView->setColumnWidth(0,140); @@ -51,6 +59,7 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); currentDir.setPath(QDir::currentDirPath()); populateList(); + move(0,15); } fileBrowser::~fileBrowser() @@ -94,7 +103,7 @@ void fileBrowser::populateList() ++it; } ListView->setSorting( 2, FALSE); - dirLabel->setText("Current Directory:\n"+currentDir.canonicalPath()); + dirLabel->setText(currentDir.canonicalPath()); } void fileBrowser::upDir() @@ -162,3 +171,10 @@ void fileBrowser::OnOK() } accept(); } + +void fileBrowser::homeButtonPushed() { + chdir( QDir::homeDirPath().latin1() ); + currentDir.cd( QDir::homeDirPath(), TRUE); + populateList(); + update(); +} -- cgit v0.9.0.2