summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp44
-rw-r--r--core/apps/textedit/fileBrowser.h11
-rw-r--r--core/apps/textedit/fileSaver.cpp35
-rw-r--r--core/apps/textedit/fileSaver.h7
-rw-r--r--core/apps/textedit/textedit.cpp4
5 files changed, 85 insertions, 16 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 @@
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/qpeapplication.h>
17 18
@@ -23,2 +24,4 @@
23 24
25
26
24fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter ) 27fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter )
@@ -36,7 +39,18 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
36 39
37 QPushButton *homeButton; 40 homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton");
38 homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton");
39 homeButton->setGeometry(200,4,25,25); 41 homeButton->setGeometry(200,4,25,25);
40 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 42 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
41 43 homeButton->setFlat(TRUE);
44
45 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
46 docButton->setGeometry(170,4,25,25);
47 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
48 docButton->setFlat(TRUE);
49
50 hideButton = new QPushButton( Resource::loadIconSet("s_hidden"),"",this,"hideButton");
51 hideButton->setGeometry(140,4,25,25);
52 connect( hideButton,SIGNAL(toggled(bool)),this,SLOT( hideButtonPushed(bool)) );
53 hideButton->setToggleButton(TRUE);
54 hideButton->setFlat(TRUE);
55
42 ListView = new QListView( this, "ListView" ); 56 ListView = new QListView( this, "ListView" );
@@ -60,2 +74,4 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags
60 currentDir.setPath(QDir::currentDirPath()); 74 currentDir.setPath(QDir::currentDirPath());
75 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All);
76
61 populateList(); 77 populateList();
@@ -73,3 +89,2 @@ void fileBrowser::populateList()
73//qDebug(currentDir.canonicalPath()); 89//qDebug(currentDir.canonicalPath());
74 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
75 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 90 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
@@ -180 +195,22 @@ void fileBrowser::homeButtonPushed() {
180} 195}
196
197void fileBrowser::docButtonPushed() {
198 chdir( QString(QPEApplication::documentDir()+"/text").latin1() );
199 currentDir.cd( QPEApplication::documentDir()+"/text", TRUE);
200 populateList();
201 update();
202
203}
204
205void fileBrowser::hideButtonPushed(bool b) {
206 if (b)
207 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
208 else
209 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
210
211// chdir( QString(QPEApplication::documentDir()+"/text").latin1() );
212// currentDir.cd( QPEApplication::documentDir()+"/text", TRUE);
213 populateList();
214 update();
215
216}
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:
41 41
42 QPushButton* buttonOk; 42 QPushButton *buttonOk, *buttonCancel, *homeButton, *docButton, *hideButton;
43 QListView* ListView; 43 QListView* ListView;
44 QPushButton* buttonCancel; 44
45 QLabel *dirLabel; 45 QLabel *dirLabel;
@@ -49,6 +49,7 @@ public:
49 QStringList fileList; 49 QStringList fileList;
50 50 QListViewItem * item;
51QListViewItem * item;
52public slots: 51public slots:
53void homeButtonPushed(); 52 void homeButtonPushed();
53 void docButtonPushed();
54 void hideButtonPushed(bool);
54private: 55private:
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
41 41
42 QPushButton *homeButton;
43 homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton"); 42 homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton");
@@ -45,3 +44,15 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
45 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 44 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
45 homeButton->setFlat(TRUE);
46 46
47 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
48 docButton->setGeometry(170,4,25,25);
49 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
50 docButton->setFlat(TRUE);
51
52 hideButton = new QPushButton( Resource::loadIconSet("s_hidden"),"",this,"hideButton");
53 hideButton->setGeometry(140,4,25,25);
54 connect( hideButton,SIGNAL(toggled(bool)),this,SLOT( hideButtonPushed(bool)) );
55 hideButton->setToggleButton(TRUE);
56 hideButton->setFlat(TRUE);
57
47 ListView = new QListView( this, "ListView" ); 58 ListView = new QListView( this, "ListView" );
@@ -75,2 +86,3 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl
75 currentDir.setPath( QDir::currentDirPath() ); 86 currentDir.setPath( QDir::currentDirPath() );
87 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden */| QDir::All);
76 populateList(); 88 populateList();
@@ -87,3 +99,2 @@ void fileSaver::populateList()
87 ListView->clear(); 99 ListView->clear();
88 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden );
89 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 100 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
@@ -202 +213,21 @@ void fileSaver::homeButtonPushed() {
202} 213}
214void fileSaver::docButtonPushed() {
215 chdir( QString(QPEApplication::documentDir()+"/text").latin1() );
216 currentDir.cd( QPEApplication::documentDir()+"/text", TRUE);
217 populateList();
218 update();
219
220}
221
222void fileSaver::hideButtonPushed(bool b) {
223 if (b)
224 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
225 else
226 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
227
228// chdir( QString(QPEApplication::documentDir()+"/text").latin1() );
229// currentDir.cd( QPEApplication::documentDir()+"/text", TRUE);
230 populateList();
231 update();
232
233}
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:
45 45
46 QPushButton* buttonOk; 46 QPushButton *buttonOk, *buttonCancel, *homeButton, *docButton, *hideButton;
47 QListView* ListView; 47 QListView* ListView;
48 QPushButton* buttonCancel;
49 QLabel *dirLabel; 48 QLabel *dirLabel;
@@ -57,3 +56,5 @@ QListViewItem * item;
57public slots: 56public slots:
58void homeButtonPushed(); 57 void homeButtonPushed();
58 void docButtonPushed();
59 void hideButtonPushed(bool);
59private: 60private:
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,3 +563,4 @@ void TextEdit::newFileOpen()
563 edited=FALSE; 563 edited=FALSE;
564 setCaption(caption().right(caption().length()-1)); 564 if(caption().left(1)=="*")
565 setCaption(caption().right(caption().length()-1));
565} 566}
@@ -694,3 +695,2 @@ void TextEdit::openFile( const DocLnk &f )
694 edited=FALSE; 695 edited=FALSE;
695 setCaption(caption().right(caption().length()-1));
696 696