Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 30 |
1 files changed, 16 insertions, 14 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 | |||
@@ -95,17 +95,19 @@ void AdvancedFm::init() { | |||
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 | ||
@@ -117,19 +119,20 @@ void AdvancedFm::init() { | |||
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 ); |
@@ -145,12 +148,14 @@ void AdvancedFm::init() { | |||
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); |
154 | Local_View->setFocusPolicy(StrongFocus); | ||
155 | Local_View->installEventFilter( this ); | ||
151 | 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")); |
@@ -167,13 +172,14 @@ void AdvancedFm::init() { | |||
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); | |
179 | Remote_View->installEventFilter( this ); | ||
174 | 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")); |
@@ -200,22 +206,17 @@ void AdvancedFm::init() { | |||
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() ) { |
@@ -277,10 +278,11 @@ void AdvancedFm::initConnections() | |||
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 | |||