author | bipolar <bipolar> | 2002-03-01 14:49:41 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-01 14:49:41 (UTC) |
commit | 2dfc5c76379baf8ae8ad6aed5f6c44d59d79087b (patch) (unidiff) | |
tree | d4b0572e3204ab4b7bdacde937bca46392182f75 /core/apps/textedit/fileSaver.cpp | |
parent | 38e7dc570dfbcea350795d9cf8f66b643ad159a8 (diff) | |
download | opie-2dfc5c76379baf8ae8ad6aed5f6c44d59d79087b.zip opie-2dfc5c76379baf8ae8ad6aed5f6c44d59d79087b.tar.gz opie-2dfc5c76379baf8ae8ad6aed5f6c44d59d79087b.tar.bz2 |
ljp (llornkcor) commited this. Fixes fileSaveas and filedialog positioning
when input method is opened. Added home buttons on each.
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 | |||
@@ -12,8 +12,10 @@ | |||
12 | ** | 12 | ** |
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> |
19 | #include <qfile.h> | 21 | #include <qfile.h> |
@@ -27,18 +29,22 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
27 | : QDialog( parent, name, modal, fl ) | 29 | : QDialog( parent, name, modal, 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); |
44 | ListView->setSorting( 2, FALSE); | 50 | ListView->setSorting( 2, FALSE); |
@@ -49,26 +55,28 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
49 | // ListView->setMultiSelection(true); | 55 | // ListView->setMultiSelection(true); |
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 *)) ); |
66 | 72 | ||
67 | // tmpFileName=fi.FilePath(); | 73 | // tmpFileName=fi.FilePath(); |
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() |
74 | { | 82 | { |
@@ -108,9 +116,9 @@ void fileSaver::populateList() | |||
108 | item= new QListViewItem( ListView,fileL,fileS ); | 116 | item= new QListViewItem( ListView,fileL,fileS ); |
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 | } |
116 | 124 | ||
@@ -185,4 +193,11 @@ void fileSaver::accept() { | |||
185 | } | 193 | } |
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 | } | ||