Diffstat (limited to 'core/apps/textedit/fileSaver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index 9e9e863..de594aa 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp | |||
@@ -13,6 +13,8 @@ | |||
13 | ****************************************************************************/ | 13 | ****************************************************************************/ |
14 | #include "fileSaver.h" | 14 | #include "fileSaver.h" |
15 | #include <qpe/config.h> | 15 | #include <qpe/config.h> |
16 | #include <qpe/resource.h> | ||
17 | |||
16 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
17 | #include <qlistview.h> | 19 | #include <qlistview.h> |
18 | #include <qpushbutton.h> | 20 | #include <qpushbutton.h> |
@@ -28,16 +30,20 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
28 | { | 30 | { |
29 | if ( !name ) | 31 | if ( !name ) |
30 | setName( "fileSaver" ); | 32 | setName( "fileSaver" ); |
31 | resize( 236, 280 ); | 33 | resize( 240, 280 ); |
32 | setCaption(tr( "Save file" ) ); | 34 | setCaption(tr( "Save file" ) ); |
33 | QFileInfo fi(currentFileName); | 35 | QFileInfo fi(currentFileName); |
34 | QString tmpFileName=fi.fileName(); | 36 | QString tmpFileName=fi.fileName(); |
35 | // qDebug( tmpFileName); | 37 | // qDebug( tmpFileName); |
36 | |||
37 | dirLabel = new QLabel(this, "DirLabel"); | 38 | dirLabel = new QLabel(this, "DirLabel"); |
38 | dirLabel->setText(currentDir.canonicalPath()); | 39 | dirLabel->setText(currentDir.canonicalPath()); |
39 | dirLabel->setGeometry(10,4,230,30); | 40 | dirLabel->setGeometry(10,20,230,15); |
40 | 41 | ||
42 | QPushButton *homeButton; | ||
43 | homeButton = new QPushButton(Resource::loadIconSet("home"),"",this,"homeButton"); | ||
44 | homeButton->setGeometry(200,4,25,25); | ||
45 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | ||
46 | |||
41 | ListView = new QListView( this, "ListView" ); | 47 | ListView = new QListView( this, "ListView" ); |
42 | ListView->addColumn( tr( "Name" ) ); | 48 | ListView->addColumn( tr( "Name" ) ); |
43 | ListView->setColumnWidth(0,140); | 49 | ListView->setColumnWidth(0,140); |
@@ -50,16 +56,16 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
50 | // ListView->setSelectionMode(QListView::Extended); | 56 | // ListView->setSelectionMode(QListView::Extended); |
51 | 57 | ||
52 | ListView->setAllColumnsShowFocus( TRUE ); | 58 | ListView->setAllColumnsShowFocus( TRUE ); |
53 | ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); | 59 | ListView->setGeometry( QRect( 10,35,220,125)); |
54 | 60 | ||
55 | fileEdit= new QLineEdit(this); | 61 | fileEdit= new QLineEdit(this); |
56 | fileEdit->setGeometry( QRect( 10, 200, 200, 22)); | 62 | fileEdit->setGeometry( QRect( 10, 162, 205, 17)); |
57 | 63 | ||
58 | fileEdit->setText( tmpFileName); | 64 | fileEdit->setText( tmpFileName); |
59 | 65 | ||
60 | filePermCheck = new QCheckBox( this, "SetFilePerms" ); | 66 | filePermCheck = new QCheckBox( this, "SetFilePerms" ); |
61 | filePermCheck->setText("set file permissions"); | 67 | filePermCheck->setText("set file permissions"); |
62 | filePermCheck->setGeometry(10, 220, 150,22); | 68 | filePermCheck->setGeometry(10, 178, 150,17); |
63 | // signals and slots connections | 69 | // signals and slots connections |
64 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); | 70 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); |
65 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 71 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
@@ -68,6 +74,8 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
68 | // qDebug( tmpFileName); | 74 | // qDebug( tmpFileName); |
69 | currentDir.setPath( QDir::currentDirPath() ); | 75 | currentDir.setPath( QDir::currentDirPath() ); |
70 | populateList(); | 76 | populateList(); |
77 | move(0,15); | ||
78 | |||
71 | } | 79 | } |
72 | 80 | ||
73 | fileSaver::~fileSaver() | 81 | fileSaver::~fileSaver() |
@@ -109,7 +117,7 @@ void fileSaver::populateList() | |||
109 | ++it; | 117 | ++it; |
110 | } | 118 | } |
111 | ListView->setSorting( 2, FALSE); | 119 | ListView->setSorting( 2, FALSE); |
112 | dirLabel->setText("Current Directory:\n"+currentDir.canonicalPath()); | 120 | dirLabel->setText(currentDir.canonicalPath()); |
113 | 121 | ||
114 | 122 | ||
115 | } | 123 | } |
@@ -186,3 +194,10 @@ void fileSaver::accept() { | |||
186 | qDebug("going to save "+selectedFileName); | 194 | qDebug("going to save "+selectedFileName); |
187 | done(1); | 195 | done(1); |
188 | } | 196 | } |
197 | |||
198 | void fileSaver::homeButtonPushed() { | ||
199 | chdir( QDir::homeDirPath().latin1() ); | ||
200 | currentDir.cd( QDir::homeDirPath(), TRUE); | ||
201 | populateList(); | ||
202 | update(); | ||
203 | } | ||