author | llornkcor <llornkcor> | 2002-02-19 03:19:17 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-19 03:19:17 (UTC) |
commit | 789c9e0069f71afececf81204879462f3117e583 (patch) (unidiff) | |
tree | 696073b7c8689379f914a81099163507546349a1 | |
parent | 994691c1659fdac4980b0319aa8fab1c98ef3c73 (diff) | |
download | opie-789c9e0069f71afececf81204879462f3117e583.zip opie-789c9e0069f71afececf81204879462f3117e583.tar.gz opie-789c9e0069f71afececf81204879462f3117e583.tar.bz2 |
set listviewcolum stuff on dialogs
-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 3 | ||||
-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index bb420e6..2275388 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp | |||
@@ -29,25 +29,26 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags | |||
29 | setCaption(tr( "Browse for file" ) ); | 29 | setCaption(tr( "Browse for file" ) ); |
30 | filterStr=filter; | 30 | filterStr=filter; |
31 | dirLabel = new QLabel(this, "DirLabel"); | 31 | dirLabel = new QLabel(this, "DirLabel"); |
32 | dirLabel->setText(currentDir.canonicalPath()); | 32 | dirLabel->setText(currentDir.canonicalPath()); |
33 | dirLabel->setGeometry(10,4,230,30); | 33 | dirLabel->setGeometry(10,4,230,30); |
34 | ListView = new QListView( this, "ListView" ); | 34 | ListView = new QListView( this, "ListView" ); |
35 | ListView->addColumn( tr( "Name" ) ); | 35 | ListView->addColumn( tr( "Name" ) ); |
36 | ListView->setColumnWidth(0,140); | 36 | ListView->setColumnWidth(0,140); |
37 | ListView->setSorting( 2, FALSE); | 37 | ListView->setSorting( 2, FALSE); |
38 | ListView->addColumn( tr( "Size" ) ); | 38 | ListView->addColumn( tr( "Size" ) ); |
39 | ListView->setColumnWidth(1,59); | 39 | ListView->setColumnWidth(1,59); |
40 | // ListView->addColumn( tr( "" ) ); | 40 | // ListView->addColumn( tr( "" ) ); |
41 | // ListView->setColumnWidth(1,59); | 41 | ListView->setColumnWidthMode(0,QListView::Manual); |
42 | ListView->setColumnAlignment(1,QListView::AlignRight); | ||
42 | // ListView->setMultiSelection(true); | 43 | // ListView->setMultiSelection(true); |
43 | // ListView->setSelectionMode(QListView::Extended); | 44 | // ListView->setSelectionMode(QListView::Extended); |
44 | 45 | ||
45 | ListView->setAllColumnsShowFocus( TRUE ); | 46 | ListView->setAllColumnsShowFocus( TRUE ); |
46 | ListView->setGeometry( QRect( 10, 35, 220, 240 ) ); | 47 | ListView->setGeometry( QRect( 10, 35, 220, 240 ) ); |
47 | 48 | ||
48 | // signals and slots connections | 49 | // signals and slots connections |
49 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); | 50 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); |
50 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 51 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
51 | currentDir.setPath(QDir::currentDirPath()); | 52 | currentDir.setPath(QDir::currentDirPath()); |
52 | populateList(); | 53 | populateList(); |
53 | } | 54 | } |
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index af51fc3..b813ed3 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp | |||
@@ -34,39 +34,41 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
34 | // qDebug( tmpFileName); | 34 | // qDebug( tmpFileName); |
35 | 35 | ||
36 | dirLabel = new QLabel(this, "DirLabel"); | 36 | dirLabel = new QLabel(this, "DirLabel"); |
37 | dirLabel->setText(currentDir.canonicalPath()); | 37 | dirLabel->setText(currentDir.canonicalPath()); |
38 | dirLabel->setGeometry(10,4,230,30); | 38 | dirLabel->setGeometry(10,4,230,30); |
39 | 39 | ||
40 | ListView = new QListView( this, "ListView" ); | 40 | ListView = new QListView( this, "ListView" ); |
41 | ListView->addColumn( tr( "Name" ) ); | 41 | ListView->addColumn( tr( "Name" ) ); |
42 | ListView->setColumnWidth(0,140); | 42 | ListView->setColumnWidth(0,140); |
43 | ListView->setSorting( 2, FALSE); | 43 | ListView->setSorting( 2, FALSE); |
44 | ListView->addColumn( tr( "Size" ) ); | 44 | ListView->addColumn( tr( "Size" ) ); |
45 | ListView->setColumnWidth(1,59); | 45 | ListView->setColumnWidth(1,59); |
46 | ListView->setColumnWidthMode(0,QListView::Manual); | ||
47 | ListView->setColumnAlignment(1,QListView::AlignRight); | ||
46 | // ListView->setMultiSelection(true); | 48 | // ListView->setMultiSelection(true); |
47 | // ListView->setSelectionMode(QListView::Extended); | 49 | // ListView->setSelectionMode(QListView::Extended); |
48 | 50 | ||
49 | ListView->setAllColumnsShowFocus( TRUE ); | 51 | ListView->setAllColumnsShowFocus( TRUE ); |
50 | ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); | 52 | ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); |
51 | 53 | ||
52 | fileEdit= new QLineEdit(this); | 54 | fileEdit= new QLineEdit(this); |
53 | fileEdit->setGeometry( QRect( 10, 200, 200, 22)); | 55 | fileEdit->setGeometry( QRect( 10, 200, 200, 22)); |
54 | 56 | ||
55 | fileEdit->setText( tmpFileName); | 57 | fileEdit->setText( tmpFileName); |
56 | 58 | ||
57 | // signals and slots connections | 59 | // signals and slots connections |
58 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); | 60 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); |
59 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 61 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
60 | 62 | ||
61 | // tmpFileName=fi.FilePath(); | 63 | // tmpFileName=fi.FilePath(); |
62 | // qDebug( tmpFileName); | 64 | // qDebug( tmpFileName); |
63 | currentDir.setPath( QDir::currentDirPath() ); | 65 | currentDir.setPath( QDir::currentDirPath() ); |
64 | populateList(); | 66 | populateList(); |
65 | } | 67 | } |
66 | 68 | ||
67 | fileSaver::~fileSaver() | 69 | fileSaver::~fileSaver() |
68 | { | 70 | { |
69 | } | 71 | } |
70 | 72 | ||
71 | 73 | ||
72 | void fileSaver::populateList() | 74 | void fileSaver::populateList() |
@@ -153,25 +155,25 @@ void fileSaver::listClicked(QListViewItem *selectedItem) | |||
153 | 155 | ||
154 | // OnOK(); | 156 | // OnOK(); |
155 | } //end not symlink | 157 | } //end not symlink |
156 | chdir(strItem.latin1()); | 158 | chdir(strItem.latin1()); |
157 | 159 | ||
158 | 160 | ||
159 | } | 161 | } |
160 | 162 | ||
161 | 163 | ||
162 | void fileSaver::closeEvent( QCloseEvent *e ) | 164 | void fileSaver::closeEvent( QCloseEvent *e ) |
163 | { | 165 | { |
164 | if(e->isAccepted()) { | 166 | if(e->isAccepted()) { |
165 | e->accept(); | 167 | e->accept(); |
166 | } else { | 168 | } else { |
167 | qDebug("not accepted"); | 169 | qDebug("not accepted"); |
168 | done(-1); | 170 | done(-1); |
169 | } | 171 | } |
170 | } | 172 | } |
171 | 173 | ||
172 | void fileSaver::accept() { | 174 | void fileSaver::accept() { |
173 | selectedFileName = fileEdit->text(); | 175 | selectedFileName = fileEdit->text(); |
174 | QString path = currentDir.canonicalPath()+"/" + selectedFileName; | 176 | QString path = currentDir.canonicalPath()+"/" + selectedFileName; |
175 | if( path.find("//",0,TRUE) ==-1 ) { | 177 | if( path.find("//",0,TRUE) ==-1 ) { |
176 | selectedFileName = path; | 178 | selectedFileName = path; |
177 | } else { | 179 | } else { |