Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 463b202..ddaa39a 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -89,98 +89,104 @@ void AdvancedFm::init() { | |||
89 | fileMenu->insertSeparator(); | 89 | fileMenu->insertSeparator(); |
90 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 90 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
91 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 91 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
92 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 92 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
93 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 93 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
94 | fileMenu->insertSeparator(); | 94 | fileMenu->insertSeparator(); |
95 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 95 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
96 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); | 96 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); |
97 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 97 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |
98 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 98 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
99 | fileMenu->setCheckable(TRUE); | 99 | fileMenu->setCheckable(TRUE); |
100 | 100 | ||
101 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 101 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); |
102 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 102 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); |
103 | // viewMenu->insertSeparator(); | 103 | // viewMenu->insertSeparator(); |
104 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 104 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
105 | viewMenu->setCheckable(TRUE); | 105 | viewMenu->setCheckable(true); |
106 | viewMenu->setItemChecked( viewMenu->idAt(0), true); | ||
107 | viewMenu->setItemChecked( viewMenu->idAt(1), false); | ||
106 | 108 | ||
107 | s_addBookmark = tr("Bookmark Directory"); | 109 | s_addBookmark = tr("Bookmark Directory"); |
108 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); | 110 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); |
109 | 111 | ||
110 | // menuButton->insertItem(""); | 112 | // menuButton->insertItem(""); |
111 | 113 | ||
112 | // customDirMenu->insertItem(tr("Add This Directory")); | 114 | // customDirMenu->insertItem(tr("Add This Directory")); |
113 | // customDirMenu->insertItem(tr("Remove This Directory")); | 115 | // customDirMenu->insertItem(tr("Remove This Directory")); |
114 | // customDirMenu->insertSeparator(); | 116 | // customDirMenu->insertSeparator(); |
115 | 117 | ||
116 | menuButton = new MenuButton( lineBox ); | 118 | menuButton = new MenuButton( lineBox ); |
117 | 119 | ||
118 | menuButton->setUseLabel(false); | 120 | menuButton->setUseLabel(false); |
119 | menuButton->setMaximumWidth( 20 ); | 121 | menuButton->setMaximumWidth( 20 ); |
120 | menuButton->insertItem( s_addBookmark); | 122 | menuButton->insertItem( s_addBookmark); |
121 | menuButton->insertItem( s_removeBookmark); | 123 | menuButton->insertItem( s_removeBookmark); |
122 | menuButton->insertSeparator(); | 124 | menuButton->insertSeparator(); |
125 | menuButton->setFocusPolicy(NoFocus); | ||
123 | 126 | ||
124 | customDirsToMenu(); | 127 | customDirsToMenu(); |
125 | 128 | ||
126 | currentPathCombo = new QComboBox( FALSE, lineBox, "currentPathCombo" ); | 129 | currentPathCombo = new QComboBox( FALSE, lineBox, "currentPathCombo" ); |
127 | currentPathCombo->setEditable(TRUE); | 130 | currentPathCombo->setEditable(TRUE); |
128 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 131 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
129 | 132 | currentPathCombo->setFocusPolicy(NoFocus); | |
130 | layout->addWidget( lineBox ); | 133 | layout->addWidget( lineBox ); |
131 | 134 | ||
132 | 135 | ||
133 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); | 136 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); |
134 | // TabWidget = new QTabWidget( this, "TabWidget" ); | 137 | // TabWidget = new QTabWidget( this, "TabWidget" ); |
135 | layout->addWidget( TabWidget, 4 ); | 138 | layout->addWidget( TabWidget, 4 ); |
136 | 139 | ||
137 | tab = new QWidget( TabWidget, "tab" ); | 140 | tab = new QWidget( TabWidget, "tab" ); |
138 | tabLayout = new QGridLayout( tab ); | 141 | tabLayout = new QGridLayout( tab ); |
139 | tabLayout->setSpacing( 2); | 142 | tabLayout->setSpacing( 2); |
140 | tabLayout->setMargin( 2); | 143 | tabLayout->setMargin( 2); |
141 | 144 | ||
142 | Local_View = new QListView( tab, "Local_View" ); | 145 | Local_View = new QListView( tab, "Local_View" ); |
143 | Local_View->addColumn( tr("File"),130); | 146 | Local_View->addColumn( tr("File"),130); |
144 | Local_View->addColumn( tr("Size"),-1); | 147 | Local_View->addColumn( tr("Size"),-1); |
145 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 148 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
146 | Local_View->addColumn( tr("Date"),-1); | 149 | Local_View->addColumn( tr("Date"),-1); |
147 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 150 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
148 | Local_View->setAllColumnsShowFocus(TRUE); | 151 | Local_View->setAllColumnsShowFocus(TRUE); |
149 | Local_View->setMultiSelection( TRUE ); | 152 | Local_View->setMultiSelection( TRUE ); |
150 | Local_View->setSelectionMode(QListView::Extended); | 153 | Local_View->setSelectionMode(QListView::Extended); |
151 | 154 | Local_View->setFocusPolicy(StrongFocus); | |
155 | Local_View->installEventFilter( this ); | ||
156 | |||
152 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 157 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); |
153 | 158 | ||
154 | tabLayout->addWidget( Local_View, 0, 0 ); | 159 | tabLayout->addWidget( Local_View, 0, 0 ); |
155 | 160 | ||
156 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); | 161 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); |
157 | // TabWidget->insertTab( tab, tr("1")); | 162 | // TabWidget->insertTab( tab, tr("1")); |
158 | 163 | ||
159 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 164 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
160 | tabLayout_2 = new QGridLayout( tab_2 ); | 165 | tabLayout_2 = new QGridLayout( tab_2 ); |
161 | tabLayout_2->setSpacing( 2); | 166 | tabLayout_2->setSpacing( 2); |
162 | tabLayout_2->setMargin( 2); | 167 | tabLayout_2->setMargin( 2); |
163 | 168 | ||
164 | Remote_View = new QListView( tab_2, "Remote_View" ); | 169 | Remote_View = new QListView( tab_2, "Remote_View" ); |
165 | Remote_View->addColumn( tr("File"),130); | 170 | Remote_View->addColumn( tr("File"),130); |
166 | Remote_View->addColumn( tr("Size"),-1); | 171 | Remote_View->addColumn( tr("Size"),-1); |
167 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | 172 | Remote_View->setColumnAlignment(1,QListView::AlignRight); |
168 | Remote_View->addColumn( tr("Date"),-1); | 173 | Remote_View->addColumn( tr("Date"),-1); |
169 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 174 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
170 | Remote_View->setAllColumnsShowFocus(TRUE); | 175 | Remote_View->setAllColumnsShowFocus(TRUE); |
171 | Remote_View->setMultiSelection( TRUE ); | 176 | Remote_View->setMultiSelection( TRUE ); |
172 | Remote_View->setSelectionMode(QListView::Extended); | 177 | Remote_View->setSelectionMode(QListView::Extended); |
173 | 178 | Remote_View->setFocusPolicy(StrongFocus); | |
174 | 179 | Remote_View->installEventFilter( this ); | |
180 | |||
175 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | 181 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); |
176 | 182 | ||
177 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 183 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
178 | 184 | ||
179 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); | 185 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); |
180 | TabWidget->setSizeChange( 370 ); | 186 | TabWidget->setSizeChange( 370 ); |
181 | // TabWidget->insertTab( tab_2, tr( "2")); | 187 | // TabWidget->insertTab( tab_2, tr( "2")); |
182 | 188 | ||
183 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); | 189 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); |
184 | tabLayout_3 = new QGridLayout( tab_3 ); | 190 | tabLayout_3 = new QGridLayout( tab_3 ); |
185 | tabLayout_3->setSpacing( 2); | 191 | tabLayout_3->setSpacing( 2); |
186 | tabLayout_3->setMargin( 2); | 192 | tabLayout_3->setMargin( 2); |
@@ -194,34 +200,29 @@ void AdvancedFm::init() { | |||
194 | 200 | ||
195 | QListView *fileTree; | 201 | QListView *fileTree; |
196 | fileTree = new QListView( tab_3, "tree" ); | 202 | fileTree = new QListView( tab_3, "tree" ); |
197 | 203 | ||
198 | 204 | ||
199 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); | 205 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); |
200 | 206 | ||
201 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); | 207 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); |
202 | */ | 208 | */ |
203 | 209 | ||
204 | /////////////// | 210 | /////////////// |
205 | 211 | ||
206 | 212 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | |
207 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | ||
208 | if (uname(&name) != -1) { | ||
209 | QString release=name.release; | ||
210 | if(release.find("embedix",0,TRUE) !=-1) { | ||
211 | zaurusDevice=TRUE; | 213 | zaurusDevice=TRUE; |
212 | } else { | 214 | else |
213 | zaurusDevice=FALSE; | 215 | zaurusDevice=FALSE; |
214 | } | 216 | |
215 | } | ||
216 | 217 | ||
217 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { | 218 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { |
218 | qDebug("not have sd"); | 219 | qDebug("not have sd"); |
219 | sdButton->hide(); | 220 | sdButton->hide(); |
220 | } | 221 | } |
221 | if( !StorageInfo::hasCf() ) { | 222 | if( !StorageInfo::hasCf() ) { |
222 | qDebug("not have cf"); | 223 | qDebug("not have cf"); |
223 | cfButton->hide(); | 224 | cfButton->hide(); |
224 | } | 225 | } |
225 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 226 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
226 | currentDir.setPath( QDir::currentDirPath()); | 227 | currentDir.setPath( QDir::currentDirPath()); |
227 | 228 | ||
@@ -271,16 +272,17 @@ void AdvancedFm::initConnections() | |||
271 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), | 272 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), |
272 | this,SLOT( ListClicked(QListViewItem *)) ); | 273 | this,SLOT( ListClicked(QListViewItem *)) ); |
273 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 274 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
274 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); | 275 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); |
275 | 276 | ||
276 | connect( TabWidget,SIGNAL(currentChanged(QWidget *)), | 277 | connect( TabWidget,SIGNAL(currentChanged(QWidget *)), |
277 | this,SLOT(tabChanged(QWidget*))); | 278 | this,SLOT(tabChanged(QWidget*))); |
278 | 279 | ||
279 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); | 280 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); |
280 | 281 | ||
281 | connect( menuButton, SIGNAL( selected(const QString &)), SLOT(gotoCustomDir(const QString&))); | 282 | connect( menuButton, SIGNAL( selected(const QString &)), SLOT(gotoCustomDir(const QString&))); |
282 | // connect( menuButton, SIGNAL( selected( int)), SLOT( dirMenuSelected(int))); | 283 | // connect( menuButton, SIGNAL( selected( int)), SLOT( dirMenuSelected(int))); |
283 | 284 | connect( viewMenu, SIGNAL( activated(int )), this, SLOT(slotSwitchMenu(int ))); | |
284 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | 285 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); |
285 | 286 | ||
286 | } | 287 | } |
288 | |||