summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp3
-rw-r--r--core/apps/textedit/fileSaver.cpp2
2 files changed, 4 insertions, 1 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
@@ -17,49 +17,50 @@
#include <qlistview.h>
#include <qpushbutton.h>
#include <qfile.h>
#include <qmessagebox.h>
#include <unistd.h>
fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "fileBrowser" );
resize( 236, 280 );
setCaption(tr( "Browse for file" ) );
filterStr=filter;
dirLabel = new QLabel(this, "DirLabel");
dirLabel->setText(currentDir.canonicalPath());
dirLabel->setGeometry(10,4,230,30);
ListView = new QListView( this, "ListView" );
ListView->addColumn( tr( "Name" ) );
ListView->setColumnWidth(0,140);
ListView->setSorting( 2, FALSE);
ListView->addColumn( tr( "Size" ) );
ListView->setColumnWidth(1,59);
// ListView->addColumn( tr( "" ) );
-// ListView->setColumnWidth(1,59);
+ ListView->setColumnWidthMode(0,QListView::Manual);
+ ListView->setColumnAlignment(1,QListView::AlignRight);
// ListView->setMultiSelection(true);
// ListView->setSelectionMode(QListView::Extended);
ListView->setAllColumnsShowFocus( TRUE );
ListView->setGeometry( QRect( 10, 35, 220, 240 ) );
// signals and slots connections
connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) );
connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
currentDir.setPath(QDir::currentDirPath());
populateList();
}
fileBrowser::~fileBrowser()
{
}
void fileBrowser::populateList()
{
ListView->clear();
//qDebug(currentDir.canonicalPath());
currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden );
currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
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
@@ -22,48 +22,50 @@
#include <unistd.h>
#include <qlineedit.h>
fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl , const QString currentFileName )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "fileSaver" );
resize( 236, 280 );
setCaption(tr( "Save file" ) );
QFileInfo fi(currentFileName);
QString tmpFileName=fi.fileName();
// qDebug( tmpFileName);
dirLabel = new QLabel(this, "DirLabel");
dirLabel->setText(currentDir.canonicalPath());
dirLabel->setGeometry(10,4,230,30);
ListView = new QListView( this, "ListView" );
ListView->addColumn( tr( "Name" ) );
ListView->setColumnWidth(0,140);
ListView->setSorting( 2, FALSE);
ListView->addColumn( tr( "Size" ) );
ListView->setColumnWidth(1,59);
+ ListView->setColumnWidthMode(0,QListView::Manual);
+ ListView->setColumnAlignment(1,QListView::AlignRight);
// ListView->setMultiSelection(true);
// ListView->setSelectionMode(QListView::Extended);
ListView->setAllColumnsShowFocus( TRUE );
ListView->setGeometry( QRect( 10, 35, 220, 160 ) );
fileEdit= new QLineEdit(this);
fileEdit->setGeometry( QRect( 10, 200, 200, 22));
fileEdit->setText( tmpFileName);
// signals and slots connections
connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) );
connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
// tmpFileName=fi.FilePath();
// qDebug( tmpFileName);
currentDir.setPath( QDir::currentDirPath() );
populateList();
}
fileSaver::~fileSaver()
{
}