Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index feda198..95e619b 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -1,135 +1,140 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | advancedfmData.cpp | 2 | advancedfmData.cpp |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Mon 09-23-2002 13:24:11 | 4 | ** Created: Mon 09-23-2002 13:24:11 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | 13 | ||
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/oresource.h> | 16 | #include <opie2/oresource.h> |
17 | #include <qpe/applnk.h> | 17 | #include <qpe/applnk.h> |
18 | #include <qpe/storage.h> | 18 | #include <qpe/storage.h> |
19 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
20 | #include <qpe/menubutton.h> | 20 | #include <qpe/menubutton.h> |
21 | using namespace Opie::Core; | 21 | using namespace Opie::Core; |
22 | using namespace Opie::Ui; | 22 | using namespace Opie::Ui; |
23 | 23 | ||
24 | /* QT */ | 24 | /* QT */ |
25 | #include <qframe.h> | ||
25 | #include <qlayout.h> | 26 | #include <qlayout.h> |
26 | #include <qhbox.h> | 27 | #include <qhbox.h> |
27 | #include <qmenubar.h> | 28 | #include <qmenubar.h> |
28 | #include <qcombobox.h> | 29 | #include <qcombobox.h> |
29 | #include <qtoolbutton.h> | 30 | #include <qtoolbutton.h> |
30 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
31 | #include <qlistview.h> | 32 | #include <qlistview.h> |
32 | 33 | ||
33 | /* STD */ | 34 | /* STD */ |
34 | #include <sys/utsname.h> | 35 | #include <sys/utsname.h> |
35 | 36 | ||
36 | void AdvancedFm::init() { | 37 | void AdvancedFm::init() { |
37 | b = false; | 38 | b = false; |
38 | setCaption( tr( "AdvancedFm" ) ); | 39 | setCaption( tr( "AdvancedFm" ) ); |
39 | 40 | ||
41 | // QFrame* frame = new QFrame(this); | ||
42 | // setCentralWidget(frame); | ||
43 | // QVBoxLayout *layout = new QVBoxLayout( frame ); | ||
44 | |||
40 | QVBoxLayout *layout = new QVBoxLayout( this ); | 45 | QVBoxLayout *layout = new QVBoxLayout( this ); |
41 | layout->setSpacing( 2); | 46 | layout->setSpacing( 2); |
42 | layout->setMargin( 0); // squeeze | 47 | layout->setMargin( 0); // squeeze |
43 | 48 | ||
44 | QMenuBar *menuBar = new QMenuBar(this); | 49 | QMenuBar *menuBar = new QMenuBar(this); |
45 | menuBar->setMargin( 0 ); // squeeze | 50 | menuBar->setMargin( 0 ); // squeeze |
46 | fileMenu = new QPopupMenu( this ); | 51 | fileMenu = new QPopupMenu( this ); |
47 | viewMenu = new QPopupMenu( this ); | 52 | viewMenu = new QPopupMenu( this ); |
48 | // customDirMenu = new QPopupMenu( this ); | 53 | // customDirMenu = new QPopupMenu( this ); |
49 | 54 | ||
50 | layout->addWidget( menuBar ); | 55 | layout->addWidget( menuBar ); |
51 | 56 | ||
52 | menuBar->insertItem( tr( "File" ), fileMenu); | 57 | menuBar->insertItem( tr( "File" ), fileMenu); |
53 | menuBar->insertItem( tr( "View" ), viewMenu); | 58 | menuBar->insertItem( tr( "View" ), viewMenu); |
54 | 59 | ||
55 | bool useBigIcon = qApp->desktop()->size().width() > 330; | 60 | bool useBigIcon = qApp->desktop()->size().width() > 330; |
56 | 61 | ||
57 | cdUpButton = new QToolButton( 0,"cdUpButton"); | 62 | cdUpButton = new QToolButton( 0,"cdUpButton"); |
58 | cdUpButton->setUsesBigPixmap( useBigIcon ); | 63 | cdUpButton->setUsesBigPixmap( useBigIcon ); |
59 | cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); | 64 | cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); |
60 | cdUpButton->setAutoRaise( true ); | 65 | cdUpButton->setAutoRaise( true ); |
61 | menuBar->insertItem( cdUpButton ); | 66 | menuBar->insertItem( cdUpButton ); |
62 | 67 | ||
63 | qpeDirButton= new QToolButton( 0,"QPEButton"); | 68 | qpeDirButton= new QToolButton( 0,"QPEButton"); |
64 | qpeDirButton->setUsesBigPixmap( useBigIcon ); | 69 | qpeDirButton->setUsesBigPixmap( useBigIcon ); |
65 | qpeDirButton->setPixmap( Opie::Core::OResource::loadPixmap( "logo/opielogo", Opie::Core::OResource::SmallIcon ) ); | 70 | qpeDirButton->setPixmap( Opie::Core::OResource::loadPixmap( "logo/opielogo", Opie::Core::OResource::SmallIcon ) ); |
66 | qpeDirButton->setAutoRaise( true ); | 71 | qpeDirButton->setAutoRaise( true ); |
67 | menuBar->insertItem( qpeDirButton ); | 72 | menuBar->insertItem( qpeDirButton ); |
68 | 73 | ||
69 | cfButton = new QToolButton( 0, "CFButton"); | 74 | cfButton = new QToolButton( 0, "CFButton"); |
70 | cfButton->setUsesBigPixmap( useBigIcon ); | 75 | cfButton->setUsesBigPixmap( useBigIcon ); |
71 | cfButton->setPixmap( Opie::Core::OResource::loadPixmap( "pcmcia", Opie::Core::OResource::SmallIcon ) ); | 76 | cfButton->setPixmap( Opie::Core::OResource::loadPixmap( "pcmcia", Opie::Core::OResource::SmallIcon ) ); |
72 | cfButton->setAutoRaise( true ); | 77 | cfButton->setAutoRaise( true ); |
73 | menuBar->insertItem( cfButton ); | 78 | menuBar->insertItem( cfButton ); |
74 | 79 | ||
75 | sdButton = new QToolButton( 0, "SDButton"); | 80 | sdButton = new QToolButton( 0, "SDButton"); |
76 | sdButton->setUsesBigPixmap( useBigIcon ); | 81 | sdButton->setUsesBigPixmap( useBigIcon ); |
77 | sdButton->setPixmap( Opie::Core::OResource::loadPixmap( "advancedfm/sdcard", Opie::Core::OResource::SmallIcon ) ); | 82 | sdButton->setPixmap( Opie::Core::OResource::loadPixmap( "advancedfm/sdcard", Opie::Core::OResource::SmallIcon ) ); |
78 | sdButton->setAutoRaise( true ); | 83 | sdButton->setAutoRaise( true ); |
79 | menuBar->insertItem( sdButton ); | 84 | menuBar->insertItem( sdButton ); |
80 | 85 | ||
81 | docButton = new QToolButton( 0,"docsButton"); | 86 | docButton = new QToolButton( 0,"docsButton"); |
82 | docButton->setUsesBigPixmap( useBigIcon ); | 87 | docButton->setUsesBigPixmap( useBigIcon ); |
83 | docButton->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) ); | 88 | docButton->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) ); |
84 | docButton->setAutoRaise( true ); | 89 | docButton->setAutoRaise( true ); |
85 | menuBar->insertItem( docButton ); | 90 | menuBar->insertItem( docButton ); |
86 | 91 | ||
87 | homeButton = new QToolButton( 0, "homeButton"); | 92 | homeButton = new QToolButton( 0, "homeButton"); |
88 | homeButton->setUsesBigPixmap( useBigIcon ); | 93 | homeButton->setUsesBigPixmap( useBigIcon ); |
89 | homeButton->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) ); | 94 | homeButton->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) ); |
90 | homeButton->setAutoRaise( true ); | 95 | homeButton->setAutoRaise( true ); |
91 | menuBar->insertItem( homeButton ); | 96 | menuBar->insertItem( homeButton ); |
92 | 97 | ||
93 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 98 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
94 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 99 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
95 | fileMenu->insertSeparator(); | 100 | fileMenu->insertSeparator(); |
96 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | 101 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); |
97 | fileMenu->insertSeparator(); | 102 | fileMenu->insertSeparator(); |
98 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 103 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
99 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 104 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
100 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 105 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
101 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 106 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
102 | fileMenu->insertSeparator(); | 107 | fileMenu->insertSeparator(); |
103 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 108 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
104 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); | 109 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); |
105 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 110 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |
106 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 111 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
107 | fileMenu->setCheckable(TRUE); | 112 | fileMenu->setCheckable(TRUE); |
108 | 113 | ||
109 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); | 114 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); |
110 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); | 115 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); |
111 | viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); | 116 | viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); |
112 | // viewMenu->insertSeparator(); | 117 | // viewMenu->insertSeparator(); |
113 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 118 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
114 | viewMenu->setCheckable(true); | 119 | viewMenu->setCheckable(true); |
115 | viewMenu->setItemChecked( viewMenu->idAt(0), true); | 120 | viewMenu->setItemChecked( viewMenu->idAt(0), true); |
116 | viewMenu->setItemChecked( viewMenu->idAt(1), false); | 121 | viewMenu->setItemChecked( viewMenu->idAt(1), false); |
117 | 122 | ||
118 | s_addBookmark = tr("Bookmark Directory"); | 123 | s_addBookmark = tr("Bookmark Directory"); |
119 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); | 124 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); |
120 | 125 | ||
121 | // menuButton->insertItem(""); | 126 | // menuButton->insertItem(""); |
122 | 127 | ||
123 | // customDirMenu->insertItem(tr("Add This Directory")); | 128 | // customDirMenu->insertItem(tr("Add This Directory")); |
124 | // customDirMenu->insertItem(tr("Remove This Directory")); | 129 | // customDirMenu->insertItem(tr("Remove This Directory")); |
125 | // customDirMenu->insertSeparator(); | 130 | // customDirMenu->insertSeparator(); |
126 | 131 | ||
127 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later | 132 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later |
128 | CBHB->setMargin( 0 ); | 133 | CBHB->setMargin( 0 ); |
129 | CBHB->setSpacing( 1 ); | 134 | CBHB->setSpacing( 1 ); |
130 | 135 | ||
131 | menuButton = new MenuButton( this ); | 136 | menuButton = new MenuButton( this ); |
132 | 137 | ||
133 | menuButton->setUseLabel(false); | 138 | menuButton->setUseLabel(false); |
134 | menuButton->setMaximumWidth( 20 ); | 139 | menuButton->setMaximumWidth( 20 ); |
135 | menuButton->insertItem( s_addBookmark); | 140 | menuButton->insertItem( s_addBookmark); |