summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/fileBrowser.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/fileBrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/fileBrowser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/fileBrowser.cpp b/noncore/apps/opie-reader/fileBrowser.cpp
index b21d59d..21c970b 100644
--- a/noncore/apps/opie-reader/fileBrowser.cpp
+++ b/noncore/apps/opie-reader/fileBrowser.cpp
@@ -18,56 +18,59 @@ Extensive modification by Tim Wentford to allow it to work in rotated mode
18 18
19fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter, const QString iPath ) 19fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags fl , const QString filter, const QString iPath )
20 : QDialog( parent, name, modal, fl ), filterspec(QDir::All) 20 : QDialog( parent, name, modal, fl ), filterspec(QDir::All)
21{ 21{
22// showMaximized(); 22// showMaximized();
23 if ( !name ) 23 if ( !name )
24 setName( "fileBrowser" ); 24 setName( "fileBrowser" );
25 if (parent != NULL) resize( parent->width(), parent->height() ); 25 if (parent != NULL) resize( parent->width(), parent->height() );
26 setCaption(tr( "Browse for file" ) ); 26 setCaption(tr( "Browse for file" ) );
27 filterStr=filter; 27 filterStr=filter;
28 28
29 buttonOk = new QPushButton( this, "buttonOk" ); 29 buttonOk = new QPushButton( this, "buttonOk" );
30 buttonOk->setFixedSize( 25, 25 ); 30 buttonOk->setFixedSize( 25, 25 );
31 buttonOk->setAutoDefault( false ); 31 buttonOk->setAutoDefault( false );
32 buttonOk->setText( tr( "/" ) ); 32 buttonOk->setText( tr( "/" ) );
33 33
34 buttonShowHidden = new QPushButton( this, "buttonShowHidden" ); 34 buttonShowHidden = new QPushButton( this, "buttonShowHidden" );
35// buttonShowHidden->setFixedSize( 50, 25 ); 35// buttonShowHidden->setFixedSize( 50, 25 );
36 buttonShowHidden->setText( tr( "Hidden" ) ); 36 buttonShowHidden->setText( tr( "Hidden" ) );
37 buttonShowHidden->setAutoDefault( false ); 37 buttonShowHidden->setAutoDefault( false );
38 buttonShowHidden->setToggleButton( true ); 38 buttonShowHidden->setToggleButton( true );
39 buttonShowHidden->setOn( false ); 39 buttonShowHidden->setOn( false );
40 40
41 dirLabel = new QLabel(this, "DirLabel"); 41 dirLabel = new QLabel(this, "DirLabel");
42 dirLabel->setAlignment(AlignLeft | AlignVCenter | ExpandTabs | WordBreak);
42 dirLabel->setText(currentDir.canonicalPath()); 43 dirLabel->setText(currentDir.canonicalPath());
43 44
44 ListView = new QtrListView( this, "ListView" ); 45 ListView = new QtrListView( this, "ListView" );
45 ListView->addColumn( tr( "Name" ) ); 46 ListView->addColumn( tr( "Name" ) );
46 ListView->setSorting( 2, FALSE); 47 ListView->setSorting( 2, FALSE);
47 ListView->addColumn( tr( "Size" ) ); 48 ListView->addColumn( tr( "Size" ) );
48 ListView->setSelectionMode(QListView::Single); 49 ListView->setSelectionMode(QListView::Single);
49 ListView->setAllColumnsShowFocus( TRUE ); 50 ListView->setAllColumnsShowFocus( TRUE );
51 ListView->setColumnWidthMode(0, QListView::Manual);
52 ListView->setColumnWidthMode(1, QListView::Manual);
50 53
51 // signals and slots connections 54 // signals and slots connections
52 connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) ); 55 connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) );
53 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) ); 56 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) );
54 connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); 57 connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) );
55 connect( ListView, SIGNAL(clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); 58 connect( ListView, SIGNAL(clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
56 connect( ListView, SIGNAL(OnOKButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); 59 connect( ListView, SIGNAL(OnOKButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
57 connect( ListView, SIGNAL(OnCentreButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); 60 connect( ListView, SIGNAL(OnCentreButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
58 connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) ); 61 connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) );
59 62
60 QVBoxLayout* grid = new QVBoxLayout(this); 63 QVBoxLayout* grid = new QVBoxLayout(this);
61 QHBoxLayout* hgrid = new QHBoxLayout(grid); 64 QHBoxLayout* hgrid = new QHBoxLayout(grid);
62 hgrid->addWidget(dirLabel,1); 65 hgrid->addWidget(dirLabel,1);
63 hgrid->addWidget(buttonShowHidden); 66 hgrid->addWidget(buttonShowHidden);
64 hgrid->addWidget(buttonOk); 67 hgrid->addWidget(buttonOk);
65 grid->addWidget(ListView,1); 68 grid->addWidget(ListView,1);
66 69
67 if (QFileInfo(iPath).exists()) 70 if (QFileInfo(iPath).exists())
68 { 71 {
69 currentDir.setPath(iPath); 72 currentDir.setPath(iPath);
70 chdir(iPath.latin1()); 73 chdir(iPath.latin1());
71 } 74 }
72 else 75 else
73 { 76 {