Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 78 |
1 files changed, 36 insertions, 42 deletions
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 | |||
@@ -13,17 +13,13 @@ | |||
13 | 13 | ||
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> |
29 | #include <qlistview.h> | 25 | #include <qlistview.h> |
@@ -37,56 +33,53 @@ void AdvancedFm::init() { | |||
37 | #endif | 33 | #endif |
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() )); |
92 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 85 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
@@ -111,10 +104,6 @@ void AdvancedFm::init() { | |||
111 | s_addBookmark = tr("Bookmark Directory"); | 104 | s_addBookmark = tr("Bookmark Directory"); |
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 | ||
120 | // customDirMenu->insertItem(tr("Add This Directory")); | 109 | // customDirMenu->insertItem(tr("Add This Directory")); |
@@ -123,19 +112,24 @@ void AdvancedFm::init() { | |||
123 | 112 | ||
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" ); |
141 | tabLayout = new QGridLayout( tab ); | 135 | tabLayout = new QGridLayout( tab ); |