Diffstat (limited to 'core/apps/textedit/fileSaver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index b813ed3..9e9e863 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp | |||
@@ -1,82 +1,86 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** copyright 2001 ljp ljp@llornkcor.com | 2 | ** copyright 2001 ljp ljp@llornkcor.com |
3 | ** Created: Fri Dec 14 08:16:46 2001 fileSaver.cpp | 3 | ** Created: Fri Dec 14 08:16:46 2001 fileSaver.cpp |
4 | ** | 4 | ** |
5 | ** This file may be distributed and/or modified under the terms of the | 5 | ** This file may be distributed and/or modified under the terms of the |
6 | ** GNU General Public License version 2 as published by the Free Software | 6 | ** GNU General Public License version 2 as published by the Free Software |
7 | ** Foundation and appearing in the file LICENSE.GPL included in the | 7 | ** Foundation and appearing in the file LICENSE.GPL included in the |
8 | ** packaging of this file. | 8 | ** packaging of this file. |
9 | ** | 9 | ** |
10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
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/qpeapplication.h> | 16 | #include <qpe/qpeapplication.h> |
17 | |||
18 | #include <qlistview.h> | 17 | #include <qlistview.h> |
19 | #include <qpushbutton.h> | 18 | #include <qpushbutton.h> |
20 | #include <qfile.h> | 19 | #include <qfile.h> |
21 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
22 | #include <unistd.h> | ||
23 | #include <qlineedit.h> | 21 | #include <qlineedit.h> |
22 | #include <qcheckbox.h> | ||
23 | |||
24 | #include <unistd.h> | ||
24 | 25 | ||
25 | fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl , const QString currentFileName ) | 26 | fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl , const QString currentFileName ) |
26 | : QDialog( parent, name, modal, fl ) | 27 | : QDialog( parent, name, modal, fl ) |
27 | { | 28 | { |
28 | if ( !name ) | 29 | if ( !name ) |
29 | setName( "fileSaver" ); | 30 | setName( "fileSaver" ); |
30 | resize( 236, 280 ); | 31 | resize( 236, 280 ); |
31 | setCaption(tr( "Save file" ) ); | 32 | setCaption(tr( "Save file" ) ); |
32 | QFileInfo fi(currentFileName); | 33 | QFileInfo fi(currentFileName); |
33 | QString tmpFileName=fi.fileName(); | 34 | QString tmpFileName=fi.fileName(); |
34 | // qDebug( tmpFileName); | 35 | // qDebug( tmpFileName); |
35 | 36 | ||
36 | dirLabel = new QLabel(this, "DirLabel"); | 37 | dirLabel = new QLabel(this, "DirLabel"); |
37 | dirLabel->setText(currentDir.canonicalPath()); | 38 | dirLabel->setText(currentDir.canonicalPath()); |
38 | dirLabel->setGeometry(10,4,230,30); | 39 | dirLabel->setGeometry(10,4,230,30); |
39 | 40 | ||
40 | ListView = new QListView( this, "ListView" ); | 41 | ListView = new QListView( this, "ListView" ); |
41 | ListView->addColumn( tr( "Name" ) ); | 42 | ListView->addColumn( tr( "Name" ) ); |
42 | ListView->setColumnWidth(0,140); | 43 | ListView->setColumnWidth(0,140); |
43 | ListView->setSorting( 2, FALSE); | 44 | ListView->setSorting( 2, FALSE); |
44 | ListView->addColumn( tr( "Size" ) ); | 45 | ListView->addColumn( tr( "Size" ) ); |
45 | ListView->setColumnWidth(1,59); | 46 | ListView->setColumnWidth(1,59); |
46 | ListView->setColumnWidthMode(0,QListView::Manual); | 47 | ListView->setColumnWidthMode(0,QListView::Manual); |
47 | ListView->setColumnAlignment(1,QListView::AlignRight); | 48 | ListView->setColumnAlignment(1,QListView::AlignRight); |
48 | // ListView->setMultiSelection(true); | 49 | // ListView->setMultiSelection(true); |
49 | // ListView->setSelectionMode(QListView::Extended); | 50 | // ListView->setSelectionMode(QListView::Extended); |
50 | 51 | ||
51 | ListView->setAllColumnsShowFocus( TRUE ); | 52 | ListView->setAllColumnsShowFocus( TRUE ); |
52 | ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); | 53 | ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); |
53 | 54 | ||
54 | fileEdit= new QLineEdit(this); | 55 | fileEdit= new QLineEdit(this); |
55 | fileEdit->setGeometry( QRect( 10, 200, 200, 22)); | 56 | fileEdit->setGeometry( QRect( 10, 200, 200, 22)); |
56 | 57 | ||
57 | fileEdit->setText( tmpFileName); | 58 | fileEdit->setText( tmpFileName); |
58 | 59 | ||
60 | filePermCheck = new QCheckBox( this, "SetFilePerms" ); | ||
61 | filePermCheck->setText("set file permissions"); | ||
62 | filePermCheck->setGeometry(10, 220, 150,22); | ||
59 | // signals and slots connections | 63 | // signals and slots connections |
60 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); | 64 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); |
61 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 65 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
62 | 66 | ||
63 | // tmpFileName=fi.FilePath(); | 67 | // tmpFileName=fi.FilePath(); |
64 | // qDebug( tmpFileName); | 68 | // qDebug( tmpFileName); |
65 | currentDir.setPath( QDir::currentDirPath() ); | 69 | currentDir.setPath( QDir::currentDirPath() ); |
66 | populateList(); | 70 | populateList(); |
67 | } | 71 | } |
68 | 72 | ||
69 | fileSaver::~fileSaver() | 73 | fileSaver::~fileSaver() |
70 | { | 74 | { |
71 | } | 75 | } |
72 | 76 | ||
73 | 77 | ||
74 | void fileSaver::populateList() | 78 | void fileSaver::populateList() |
75 | { | 79 | { |
76 | ListView->clear(); | 80 | ListView->clear(); |
77 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); | 81 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); |
78 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 82 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
79 | currentDir.setMatchAllDirs(TRUE); | 83 | currentDir.setMatchAllDirs(TRUE); |
80 | 84 | ||
81 | currentDir.setNameFilter("*"); | 85 | currentDir.setNameFilter("*"); |
82 | QString fileL, fileS; | 86 | QString fileL, fileS; |