summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-04-22 17:39:18 (UTC)
committer harlekin <harlekin>2003-04-22 17:39:18 (UTC)
commitb22d89883cd92bd9d858caf5ca90b6eef80598d4 (patch) (unidiff)
tree695ff1e42ca09098d8b0cba0b95f0f2f736e0fd2
parentab9387322c5802f75bc9b37b3bb334bd98dd5dd1 (diff)
downloadopie-b22d89883cd92bd9d858caf5ca90b6eef80598d4.zip
opie-b22d89883cd92bd9d858caf5ca90b6eef80598d4.tar.gz
opie-b22d89883cd92bd9d858caf5ca90b6eef80598d4.tar.bz2
- a lot of includes and gui cleanups
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp39
-rw-r--r--noncore/apps/advancedfm/advancedfm.h5
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp82
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp4
4 files changed, 47 insertions, 83 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 41e83c7..66353bb 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -13,15 +13,13 @@
13#include "advancedfm.h" 13#include "advancedfm.h"
14 14
15#include <opie/otabwidget.h> 15
16// #include <opie/ofileselector.h> 16// #include <opie/ofileselector.h>
17// #include <opie/ofiledialog.h> 17// #include <opie/ofiledialog.h>
18 18
19#include <qpe/config.h> 19#include <opie/otabwidget.h>
20
20#include <qpe/filemanager.h> 21#include <qpe/filemanager.h>
21#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
22#include <qpe/qpemenubar.h>
23#include <qpe/qpetoolbar.h>
24#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
25#include <qpe/qcopenvelope_qws.h>
26#include <qpe/config.h> 24#include <qpe/config.h>
27#include <qpe/mimetype.h> 25#include <qpe/mimetype.h>
@@ -31,42 +29,22 @@
31#include <qpe/menubutton.h> 29#include <qpe/menubutton.h>
32 30
33
34#include <qwmatrix.h>
35#include <qregexp.h>
36#include <qtabwidget.h>
37#include <qtextstream.h>
38#include <qpushbutton.h>
39#include <qdatetime.h> 31#include <qdatetime.h>
40#include <qdir.h>
41#include <qfile.h> 32#include <qfile.h>
42#include <qstring.h>
43#include <qcombobox.h> 33#include <qcombobox.h>
44#include <qpopupmenu.h> 34#include <qpopupmenu.h>
45#include <qlistview.h> 35#include <qlistview.h>
46#include <qmainwindow.h>
47#include <qlabel.h> 36#include <qlabel.h>
48#include <qprogressbar.h>
49#include <qspinbox.h>
50#include <qwidget.h> 37#include <qwidget.h>
51#include <qlayout.h> 38#include <qlayout.h>
52#include <qimage.h> 39#include <qimage.h>
53#include <qpixmap.h>
54#include <qmessagebox.h> 40#include <qmessagebox.h>
55#include <qlineedit.h> 41#include <qlineedit.h>
56#include <qregexp.h>
57 42
58#include <unistd.h>
59#include <stdlib.h>
60#include <sys/stat.h> 43#include <sys/stat.h>
61#include <dirent.h>
62#include <stdio.h>
63#include <time.h> 44#include <time.h>
45#include <dirent.h>
64#include <fcntl.h> 46#include <fcntl.h>
65#include <mntent.h>
66#include <string.h>
67#include <errno.h>
68#include <sys/vfs.h> 47#include <sys/vfs.h>
69#include <mntent.h> 48#include <mntent.h>
70#include <sys/utsname.h>
71 49
72AdvancedFm::AdvancedFm( ) 50AdvancedFm::AdvancedFm( )
@@ -75,9 +53,6 @@ AdvancedFm::AdvancedFm( )
75 renameBox = 0; 53 renameBox = 0;
76 54
77 QWMatrix matrix; 55 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
78 QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); 56
79 matrix.scale( .4, .4);
80 unknownXpm = pix.xForm(matrix);
81
82 initConnections(); 57 initConnections();
83 whichTab=1; 58 whichTab=1;
@@ -211,5 +186,5 @@ void AdvancedFm::populateView()
211 } 186 }
212 item->setPixmap( 0,pm); 187 item->setPixmap( 0,pm);
213 188
214 } 189 }
215 isDir=FALSE; 190 isDir=FALSE;
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index c30d8e0..4480051 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -41,6 +41,4 @@ class QSpinBox;
41class QTabWidget; 41class QTabWidget;
42class QWidget; 42class QWidget;
43class QPEToolBar;
44class QPEMenuBar;
45class QPopupMenu; 43class QPopupMenu;
46class QFile; 44class QFile;
@@ -49,5 +47,4 @@ class QLineEdit;
49class MenuButton; 47class MenuButton;
50 48
51//class QPushButton;
52class QToolButton; 49class QToolButton;
53class Ir; 50class Ir;
@@ -55,5 +52,5 @@ class Ir;
55class AdvancedFm : public QMainWindow 52class AdvancedFm : public QMainWindow
56{ 53{
57 Q_OBJECT 54 Q_OBJECT
58public: 55public:
59 AdvancedFm(); 56 AdvancedFm();
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 1a7a6d7..eb2bcd8 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -14,15 +14,11 @@
14#include <opie/otabwidget.h> 14#include <opie/otabwidget.h>
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16#include <qpe/qpemenubar.h>
17#include <qpe/qpetoolbar.h>
18#include <qpe/resource.h> 16#include <qpe/resource.h>
19#include <qpe/menubutton.h> 17#include <qpe/menubutton.h>
20#include <qpe/config.h>
21 18
22#include <qlayout.h> 19#include <qlayout.h>
23#include <qpixmap.h> 20#include <qhbox.h>
21#include <qmenubar.h>
24#include <qcombobox.h> 22#include <qcombobox.h>
25#include <qpopupmenu.h>
26#include <qtabwidget.h>
27#include <qtoolbutton.h> 23#include <qtoolbutton.h>
28#include <qlineedit.h> 24#include <qlineedit.h>
@@ -38,54 +34,51 @@ void AdvancedFm::init() {
38 setCaption( tr( "AdvancedFm" ) ); 34 setCaption( tr( "AdvancedFm" ) );
39 35
40 QGridLayout *layout = new QGridLayout( this ); 36 QVBoxLayout *layout = new QVBoxLayout( this );
41 layout->setSpacing( 2); 37 layout->setSpacing( 2);
42 layout->setMargin( 2); 38 layout->setMargin( 2);
43 39
44 40
45 QPEMenuBar *menuBar = new QPEMenuBar(this); 41 QMenuBar *menuBar = new QMenuBar(this);
46 fileMenu = new QPopupMenu( this ); 42 fileMenu = new QPopupMenu( this );
47 viewMenu = new QPopupMenu( this ); 43 viewMenu = new QPopupMenu( this );
48// customDirMenu = new QPopupMenu( this ); 44// customDirMenu = new QPopupMenu( this );
49 45
50 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); 46 layout->addWidget( menuBar );
51 47
52 menuBar->insertItem( tr( "File" ), fileMenu); 48 menuBar->insertItem( tr( "File" ), fileMenu);
53 menuBar->insertItem( tr( "View" ), viewMenu); 49 menuBar->insertItem( tr( "View" ), viewMenu);
54// menuBar->insertItem( tr( "^" ), customDirMenu);
55 50
56 cdUpButton = new QToolButton( this,"cdUpButton"); 51 cdUpButton = new QToolButton( 0,"cdUpButton");
57 cdUpButton->setPixmap(Resource::loadPixmap("up")); 52 cdUpButton->setPixmap(Resource::loadPixmap("up"));
58 cdUpButton->setFixedSize( QSize( 20, 20 ) ); 53 cdUpButton->setAutoRaise( true );
59 layout->addMultiCellWidget( cdUpButton , 0, 0, 2, 2); 54 menuBar->insertItem( cdUpButton );
60 55
61 menuButton = new MenuButton(this);
62 menuButton->setFixedSize( QSize( 20, 20 ) );
63 layout->addMultiCellWidget( menuButton , 0, 0, 3, 3);
64 56
65 qpeDirButton= new QToolButton(this,"QPEButton"); 57 QHBox *lineBox = new QHBox( this );
58
59 qpeDirButton= new QToolButton( 0,"QPEButton");
66 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); 60 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton");
67 qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); 61 qpeDirButton->setAutoRaise( true );
68 layout->addMultiCellWidget( qpeDirButton , 0, 0, 4, 4); 62 menuBar->insertItem( qpeDirButton );
69 63
70 cfButton = new QToolButton( this,"CFButton"); 64 cfButton = new QToolButton( 0, "CFButton");
71 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); 65 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
72 cfButton ->setFixedSize( QSize( 20, 20 ) ); 66 cfButton->setAutoRaise( true );
73 layout->addMultiCellWidget( cfButton , 0, 0, 5, 5); 67 menuBar->insertItem( cfButton );
74 68
75 sdButton = new QToolButton( this,"SDButton"); 69 sdButton = new QToolButton( 0, "SDButton");
76 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); 70 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard"));
77 sdButton->setFixedSize( QSize( 20, 20 ) ); 71 sdButton->setAutoRaise( true );
78 layout->addMultiCellWidget( sdButton , 0, 0, 6, 6); 72 menuBar->insertItem( sdButton );
79
80 73
81 docButton = new QToolButton( this,"docsButton"); 74 docButton = new QToolButton( 0,"docsButton");
82 docButton->setPixmap(Resource::loadPixmap("DocsIcon")); 75 docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
83 docButton->setFixedSize( QSize( 20, 20 ) ); 76 docButton->setAutoRaise( true );
84 layout->addMultiCellWidget( docButton, 0, 0, 7, 7); 77 menuBar->insertItem( docButton );
85 78
86 homeButton = new QToolButton( this,"homeButton"); 79 homeButton = new QToolButton( 0, "homeButton");
87 homeButton->setPixmap(Resource::loadPixmap("home")); 80 homeButton->setPixmap(Resource::loadPixmap("home"));
88 homeButton->setFixedSize( QSize( 20, 20 ) ); 81 homeButton->setAutoRaise( true );
89 layout->addMultiCellWidget( homeButton, 0, 0, 8, 8); 82 menuBar->insertItem( homeButton );
90 83
91 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); 84 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() ));
@@ -112,8 +105,4 @@ void AdvancedFm::init() {
112 s_removeBookmark = tr("Remove Current Directory from Bookmarks"); 105 s_removeBookmark = tr("Remove Current Directory from Bookmarks");
113 106
114 menuButton->setUseLabel(false);
115 menuButton->insertItem( s_addBookmark);
116 menuButton->insertItem( s_removeBookmark);
117 menuButton->insertSeparator();
118// menuButton->insertItem(""); 107// menuButton->insertItem("");
119 108
@@ -124,17 +113,22 @@ void AdvancedFm::init() {
124 customDirsToMenu(); 113 customDirsToMenu();
125 114
126 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); 115 menuButton = new MenuButton( lineBox );
127 currentPathCombo->setEditable(TRUE);
128 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 8);
129 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
130 116
117 menuButton->setUseLabel(false);
118 menuButton->setMaximumWidth( 20 );
119 menuButton->insertItem( s_addBookmark);
120 menuButton->insertItem( s_removeBookmark);
121 menuButton->insertSeparator();
122
123 currentPathCombo = new QComboBox( FALSE, lineBox, "currentPathCombo" );
124 currentPathCombo->setEditable(TRUE);
131 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 125 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
132 126
133 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 8); 127 layout->addWidget( lineBox );
134 128
135 129
136 TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); 130 TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab);
137// TabWidget = new QTabWidget( this, "TabWidget" ); 131// TabWidget = new QTabWidget( this, "TabWidget" );
138 layout->addMultiCellWidget( TabWidget, 2, 2, 0, 8); 132 layout->addWidget( TabWidget, 4 );
139 133
140 tab = new QWidget( TabWidget, "tab" ); 134 tab = new QWidget( TabWidget, "tab" );
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index eae86a4..575833a 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -19,6 +19,4 @@
19#include <qpe/lnkproperties.h> 19#include <qpe/lnkproperties.h>
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/qpemenubar.h>
22#include <qpe/qpetoolbar.h>
23#include <qpe/resource.h> 21#include <qpe/resource.h>
24#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
@@ -775,5 +773,5 @@ void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int buflen) {
775// lineStr=lineStr.left(lineStr.length()-1); 773// lineStr=lineStr.left(lineStr.length()-1);
776 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); 774 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
777 775
778// OutputEdit->append(lineStr); 776// OutputEdit->append(lineStr);
779// OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 777// OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);