summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-10 03:22:06 (UTC)
committer llornkcor <llornkcor>2002-03-10 03:22:06 (UTC)
commit115b05c0aa6e11d8a0265f2e6806bdf9d03a404a (patch) (side-by-side diff)
tree2d1648da4632fa2d248159a26abf2da30dff379e
parent637cea2664defb5414a3897f70b616deba926ffe (diff)
downloadopie-115b05c0aa6e11d8a0265f2e6806bdf9d03a404a.zip
opie-115b05c0aa6e11d8a0265f2e6806bdf9d03a404a.tar.gz
opie-115b05c0aa6e11d8a0265f2e6806bdf9d03a404a.tar.bz2
added a documents and hidden file buttons to fileSaver and fileBrowser
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp40
-rw-r--r--core/apps/textedit/fileBrowser.h7
-rw-r--r--core/apps/textedit/fileSaver.cpp35
-rw-r--r--core/apps/textedit/fileSaver.h5
-rw-r--r--core/apps/textedit/textedit.cpp2
5 files changed, 79 insertions, 10 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp
index 8c1e962..c16bd41 100644
--- a/core/apps/textedit/fileBrowser.cpp
+++ b/core/apps/textedit/fileBrowser.cpp
@@ -16,2 +16,3 @@
#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
@@ -23,2 +24,4 @@
+
+
fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter )
@@ -36,3 +39,2 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
- QPushButton *homeButton;
homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton");
@@ -40,2 +42,14 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
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);
@@ -60,2 +74,4 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
currentDir.setPath(QDir::currentDirPath());
+ currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All);
+
populateList();
@@ -73,3 +89,2 @@ void fileBrowser::populateList()
//qDebug(currentDir.canonicalPath());
- currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
@@ -180 +195,22 @@ void fileBrowser::homeButtonPushed() {
}
+
+void fileBrowser::docButtonPushed() {
+ chdir( QString(QPEApplication::documentDir()+"/text").latin1() );
+ currentDir.cd( QPEApplication::documentDir()+"/text", TRUE);
+ populateList();
+ update();
+
+}
+
+void fileBrowser::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();
+
+}
diff --git a/core/apps/textedit/fileBrowser.h b/core/apps/textedit/fileBrowser.h
index c0e1d4a..50ed485 100644
--- a/core/apps/textedit/fileBrowser.h
+++ b/core/apps/textedit/fileBrowser.h
@@ -41,5 +41,5 @@ public:
- QPushButton* buttonOk;
+ QPushButton *buttonOk, *buttonCancel, *homeButton, *docButton, *hideButton;
QListView* ListView;
- QPushButton* buttonCancel;
+
QLabel *dirLabel;
@@ -49,3 +49,2 @@ public:
QStringList fileList;
-
QListViewItem * item;
@@ -53,2 +52,4 @@ public slots:
void homeButtonPushed();
+ void docButtonPushed();
+ void hideButtonPushed(bool);
private:
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
@@ -41,3 +41,2 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
- QPushButton *homeButton;
homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton");
@@ -45,2 +44,14 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
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);
@@ -75,2 +86,3 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
currentDir.setPath( QDir::currentDirPath() );
+ currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All);
populateList();
@@ -87,3 +99,2 @@ void fileSaver::populateList()
ListView->clear();
- currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden );
currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
@@ -202 +213,21 @@ void fileSaver::homeButtonPushed() {
}
+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();
+
+}
diff --git a/core/apps/textedit/fileSaver.h b/core/apps/textedit/fileSaver.h
index 526085d..195a775 100644
--- a/core/apps/textedit/fileSaver.h
+++ b/core/apps/textedit/fileSaver.h
@@ -45,5 +45,4 @@ public:
- QPushButton* buttonOk;
+ QPushButton *buttonOk, *buttonCancel, *homeButton, *docButton, *hideButton;
QListView* ListView;
- QPushButton* buttonCancel;
QLabel *dirLabel;
@@ -58,2 +57,4 @@ public slots:
void homeButtonPushed();
+ void docButtonPushed();
+ void hideButtonPushed(bool);
private:
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 78c4d8a..dafe1dc 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -563,2 +563,3 @@ void TextEdit::newFileOpen()
edited=FALSE;
+ if(caption().left(1)=="*")
setCaption(caption().right(caption().length()-1));
@@ -694,3 +695,2 @@ void TextEdit::openFile( const DocLnk &f )
edited=FALSE;
- setCaption(caption().right(caption().length()-1));