summaryrefslogtreecommitdiff
path: root/core/apps/textedit/fileSaver.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/textedit/fileSaver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileSaver.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp
index 4e80735..fbf50cf 100644
--- a/core/apps/textedit/fileSaver.cpp
+++ b/core/apps/textedit/fileSaver.cpp
@@ -36,17 +36,28 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
QString tmpFileName=fi.fileName();
// qDebug( tmpFileName);
dirLabel = new QLabel(this, "DirLabel");
dirLabel->setText(currentDir.canonicalPath());
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()) );
+ homeButton->setFlat(TRUE);
+ docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
+ docButton->setGeometry(170,4,25,25);
+ connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
+ docButton->setFlat(TRUE);
+
+ hideButton = new QPushButton( Resource::loadIconSet("s_hidden"),"",this,"hideButton");
+ hideButton->setGeometry(140,4,25,25);
+ connect( hideButton,SIGNAL(toggled(bool)),this,SLOT( hideButtonPushed(bool)) );
+ hideButton->setToggleButton(TRUE);
+ hideButton->setFlat(TRUE);
+
ListView = new QListView( this, "ListView" );
ListView->addColumn( tr( "Name" ) );
ListView->setColumnWidth(0,140);
ListView->setSorting( 2, FALSE);
ListView->addColumn( tr( "Size" ) );
ListView->setColumnWidth(1,59);
@@ -70,25 +81,25 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) );
connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
// tmpFileName=fi.FilePath();
// qDebug( tmpFileName);
currentDir.setPath( QDir::currentDirPath() );
+ currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All);
populateList();
move(0,15);
fileEdit->setFocus();
}
fileSaver::~fileSaver()
{
}
void fileSaver::populateList()
{
ListView->clear();
- currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden );
currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
currentDir.setMatchAllDirs(TRUE);
currentDir.setNameFilter("*");
QString fileL, fileS;
const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
@@ -197,6 +208,26 @@ void fileSaver::accept() {
void fileSaver::homeButtonPushed() {
chdir( QDir::homeDirPath().latin1() );
currentDir.cd( QDir::homeDirPath(), TRUE);
populateList();
update();
}
+void fileSaver::docButtonPushed() {
+ chdir( QString(QPEApplication::documentDir()+"/text").latin1() );
+ currentDir.cd( QPEApplication::documentDir()+"/text", TRUE);
+ populateList();
+ update();
+
+}
+
+void fileSaver::hideButtonPushed(bool b) {
+ if (b)
+ currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
+ else
+ currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
+
+// chdir( QString(QPEApplication::documentDir()+"/text").latin1() );
+// currentDir.cd( QPEApplication::documentDir()+"/text", TRUE);
+ populateList();
+ update();
+
+}