Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 0966f02..bb80dc6 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -13,12 +13,14 @@ | |||
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> | 16 | #include <qpe/qpemenubar.h> |
17 | #include <qpe/qpetoolbar.h> | 17 | #include <qpe/qpetoolbar.h> |
18 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
19 | #include <qpe/menubutton.h> | ||
20 | #include <qpe/config.h> | ||
19 | 21 | ||
20 | #include <qlayout.h> | 22 | #include <qlayout.h> |
21 | #include <qpixmap.h> | 23 | #include <qpixmap.h> |
22 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
23 | #include <qpopupmenu.h> | 25 | #include <qpopupmenu.h> |
24 | #include <qtabwidget.h> | 26 | #include <qtabwidget.h> |
@@ -40,47 +42,54 @@ void AdvancedFm::init() { | |||
40 | layout->setMargin( 2); | 42 | layout->setMargin( 2); |
41 | 43 | ||
42 | 44 | ||
43 | QPEMenuBar *menuBar = new QPEMenuBar(this); | 45 | QPEMenuBar *menuBar = new QPEMenuBar(this); |
44 | fileMenu = new QPopupMenu( this ); | 46 | fileMenu = new QPopupMenu( this ); |
45 | viewMenu = new QPopupMenu( this ); | 47 | viewMenu = new QPopupMenu( this ); |
48 | // customDirMenu = new QPopupMenu( this ); | ||
46 | 49 | ||
47 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); | 50 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); |
48 | 51 | ||
49 | menuBar->insertItem( tr( "File" ), fileMenu); | 52 | menuBar->insertItem( tr( "File" ), fileMenu); |
50 | menuBar->insertItem( tr( "View" ), viewMenu); | 53 | menuBar->insertItem( tr( "View" ), viewMenu); |
54 | // menuBar->insertItem( tr( "^" ), customDirMenu); | ||
55 | |||
56 | cdUpButton = new QToolButton( this,"cdUpButton"); | ||
57 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | ||
58 | cdUpButton->setFixedSize( QSize( 20, 20 ) ); | ||
59 | layout->addMultiCellWidget( cdUpButton , 0, 0, 2, 2); | ||
60 | |||
61 | menuButton = new MenuButton(this); | ||
62 | menuButton->setFixedSize( QSize( 20, 20 ) ); | ||
63 | layout->addMultiCellWidget( menuButton , 0, 0, 3, 3); | ||
51 | 64 | ||
52 | qpeDirButton= new QToolButton(this,"QPEButton"); | 65 | qpeDirButton= new QToolButton(this,"QPEButton"); |
53 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | 66 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); |
54 | qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); | 67 | qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); |
55 | layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); | 68 | layout->addMultiCellWidget( qpeDirButton , 0, 0, 4, 4); |
56 | 69 | ||
57 | cfButton = new QToolButton( this,"CFButton"); | 70 | cfButton = new QToolButton( this,"CFButton"); |
58 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); | 71 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); |
59 | cfButton ->setFixedSize( QSize( 20, 20 ) ); | 72 | cfButton ->setFixedSize( QSize( 20, 20 ) ); |
60 | layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); | 73 | layout->addMultiCellWidget( cfButton , 0, 0, 5, 5); |
61 | 74 | ||
62 | sdButton = new QToolButton( this,"SDButton"); | 75 | sdButton = new QToolButton( this,"SDButton"); |
63 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); | 76 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); |
64 | sdButton->setFixedSize( QSize( 20, 20 ) ); | 77 | sdButton->setFixedSize( QSize( 20, 20 ) ); |
65 | layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); | 78 | layout->addMultiCellWidget( sdButton , 0, 0, 6, 6); |
66 | 79 | ||
67 | cdUpButton = new QToolButton( this,"cdUpButton"); | ||
68 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | ||
69 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | ||
70 | layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); | ||
71 | 80 | ||
72 | docButton = new QToolButton( this,"docsButton"); | 81 | docButton = new QToolButton( this,"docsButton"); |
73 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | 82 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); |
74 | docButton->setFixedSize( QSize( 20, 20 ) ); | 83 | docButton->setFixedSize( QSize( 20, 20 ) ); |
75 | layout->addMultiCellWidget( docButton, 0, 0, 6, 6); | 84 | layout->addMultiCellWidget( docButton, 0, 0, 7, 7); |
76 | 85 | ||
77 | homeButton = new QToolButton( this,"homeButton"); | 86 | homeButton = new QToolButton( this,"homeButton"); |
78 | homeButton->setPixmap(Resource::loadPixmap("home")); | 87 | homeButton->setPixmap(Resource::loadPixmap("home")); |
79 | homeButton->setFixedSize( QSize( 20, 20 ) ); | 88 | homeButton->setFixedSize( QSize( 20, 20 ) ); |
80 | layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); | 89 | layout->addMultiCellWidget( homeButton, 0, 0, 8, 8); |
81 | 90 | ||
82 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 91 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
83 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 92 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
84 | fileMenu->insertSeparator(); | 93 | fileMenu->insertSeparator(); |
85 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 94 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
86 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 95 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
@@ -96,26 +105,40 @@ void AdvancedFm::init() { | |||
96 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 105 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); |
97 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 106 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); |
98 | viewMenu->insertSeparator(); | 107 | viewMenu->insertSeparator(); |
99 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 108 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
100 | viewMenu->setCheckable(TRUE); | 109 | viewMenu->setCheckable(TRUE); |
101 | 110 | ||
111 | s_addBookmark = tr("Bookmark Directory"); | ||
112 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); | ||
113 | |||
114 | menuButton->setUseLabel(false); | ||
115 | menuButton->insertItem( s_addBookmark); | ||
116 | menuButton->insertItem( s_removeBookmark); | ||
117 | menuButton->insertSeparator(); | ||
118 | // menuButton->insertItem(""); | ||
119 | |||
120 | // customDirMenu->insertItem(tr("Add This Directory")); | ||
121 | // customDirMenu->insertItem(tr("Remove This Directory")); | ||
122 | // customDirMenu->insertSeparator(); | ||
123 | |||
124 | customDirsToMenu(); | ||
102 | 125 | ||
103 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 126 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); |
104 | currentPathCombo->setEditable(TRUE); | 127 | currentPathCombo->setEditable(TRUE); |
105 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); | 128 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 8); |
106 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 129 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
107 | 130 | ||
108 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 131 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
109 | 132 | ||
110 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); | 133 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 8); |
111 | 134 | ||
112 | 135 | ||
113 | TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); | 136 | TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); |
114 | // TabWidget = new QTabWidget( this, "TabWidget" ); | 137 | // TabWidget = new QTabWidget( this, "TabWidget" ); |
115 | layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); | 138 | layout->addMultiCellWidget( TabWidget, 2, 2, 0, 8); |
116 | 139 | ||
117 | tab = new QWidget( TabWidget, "tab" ); | 140 | tab = new QWidget( TabWidget, "tab" ); |
118 | tabLayout = new QGridLayout( tab ); | 141 | tabLayout = new QGridLayout( tab ); |
119 | tabLayout->setSpacing( 2); | 142 | tabLayout->setSpacing( 2); |
120 | tabLayout->setMargin( 2); | 143 | tabLayout->setMargin( 2); |
121 | 144 | ||
@@ -235,7 +258,12 @@ void AdvancedFm::initConnections() { | |||
235 | 258 | ||
236 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), | 259 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), |
237 | this,SLOT(tabChanged(QWidget*))); | 260 | this,SLOT(tabChanged(QWidget*))); |
238 | 261 | ||
239 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); | 262 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); |
240 | 263 | ||
264 | connect( menuButton, SIGNAL( selected(const QString &)), SLOT(gotoCustomDir(const QString&))); | ||
265 | // connect( menuButton, SIGNAL( selected( int)), SLOT( dirMenuSelected(int))); | ||
266 | |||
267 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | ||
268 | |||
241 | } | 269 | } |