Diffstat (limited to 'noncore/graphics/opie-eye/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 10 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.h | 1 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 7c8c88d..eafff1d 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -144,24 +144,25 @@ namespace { | |||
144 | /* | 144 | /* |
145 | * Set up the GUI.. initialize the slave set up gui | 145 | * Set up the GUI.. initialize the slave set up gui |
146 | * and also load a dir | 146 | * and also load a dir |
147 | */ | 147 | */ |
148 | PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | 148 | PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) |
149 | : QVBox( wid ), m_cfg( cfg ), m_updatet( false ) | 149 | : QVBox( wid ), m_cfg( cfg ), m_updatet( false ) |
150 | { | 150 | { |
151 | { | 151 | { |
152 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); | 152 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); |
153 | } | 153 | } |
154 | m_path = QDir::homeDirPath(); | 154 | m_path = QDir::homeDirPath(); |
155 | m_mode = 0; | 155 | m_mode = 0; |
156 | m_internalReset = false; | ||
156 | 157 | ||
157 | QHBox *hbox = new QHBox( this ); | 158 | QHBox *hbox = new QHBox( this ); |
158 | QLabel* lbl = new QLabel( hbox ); | 159 | QLabel* lbl = new QLabel( hbox ); |
159 | lbl->setText( tr("View as" ) ); | 160 | lbl->setText( tr("View as" ) ); |
160 | 161 | ||
161 | m_views = new QComboBox( hbox, "View As" ); | 162 | m_views = new QComboBox( hbox, "View As" ); |
162 | 163 | ||
163 | m_view= new QIconView( this ); | 164 | m_view= new QIconView( this ); |
164 | connect(m_view, SIGNAL(clicked(QIconViewItem*) ), | 165 | connect(m_view, SIGNAL(clicked(QIconViewItem*) ), |
165 | this, SLOT(slotClicked(QIconViewItem*)) ); | 166 | this, SLOT(slotClicked(QIconViewItem*)) ); |
166 | connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), | 167 | connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), |
167 | this, SLOT(slotClicked(QIconViewItem*)) ); | 168 | this, SLOT(slotClicked(QIconViewItem*)) ); |
@@ -354,25 +355,27 @@ void PIconView::slotTrash() { | |||
354 | 355 | ||
355 | /* | 356 | /* |
356 | * see what views are available | 357 | * see what views are available |
357 | */ | 358 | */ |
358 | void PIconView::loadViews() { | 359 | void PIconView::loadViews() { |
359 | ViewMap::Iterator it; | 360 | ViewMap::Iterator it; |
360 | ViewMap* map = viewMap(); | 361 | ViewMap* map = viewMap(); |
361 | for ( it = map->begin(); it != map->end(); ++it ) | 362 | for ( it = map->begin(); it != map->end(); ++it ) |
362 | m_views->insertItem( it.key() ); | 363 | m_views->insertItem( it.key() ); |
363 | } | 364 | } |
364 | 365 | ||
365 | void PIconView::resetView() { | 366 | void PIconView::resetView() { |
367 | m_internalReset = true; | ||
366 | slotViewChanged(m_views->currentItem()); | 368 | slotViewChanged(m_views->currentItem()); |
369 | m_internalReset = false; | ||
367 | } | 370 | } |
368 | 371 | ||
369 | /* | 372 | /* |
370 | *swicth view reloadDir and connect signals | 373 | *swicth view reloadDir and connect signals |
371 | */ | 374 | */ |
372 | void PIconView::slotViewChanged( int i) { | 375 | void PIconView::slotViewChanged( int i) { |
373 | if (!m_views->count() ) { | 376 | if (!m_views->count() ) { |
374 | setCurrentView( 0l); | 377 | setCurrentView( 0l); |
375 | return; | 378 | return; |
376 | } | 379 | } |
377 | 380 | ||
378 | PDirView* cur = currentView(); | 381 | PDirView* cur = currentView(); |
@@ -398,26 +401,29 @@ void PIconView::slotViewChanged( int i) { | |||
398 | /* connect to the signals of the lister */ | 401 | /* connect to the signals of the lister */ |
399 | PDirLister* lis = cur->dirLister(); | 402 | PDirLister* lis = cur->dirLister(); |
400 | connect(lis, SIGNAL(sig_thumbInfo(const QString&, const QString& )), | 403 | connect(lis, SIGNAL(sig_thumbInfo(const QString&, const QString& )), |
401 | this, SLOT( slotThumbInfo(const QString&, const QString&))); | 404 | this, SLOT( slotThumbInfo(const QString&, const QString&))); |
402 | connect(lis, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)), | 405 | connect(lis, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)), |
403 | this, SLOT(slotThumbNail(const QString&, const QPixmap&))); | 406 | this, SLOT(slotThumbNail(const QString&, const QPixmap&))); |
404 | connect(lis, SIGNAL(sig_start()), | 407 | connect(lis, SIGNAL(sig_start()), |
405 | this, SLOT(slotStart())); | 408 | this, SLOT(slotStart())); |
406 | connect(lis, SIGNAL(sig_end()) , | 409 | connect(lis, SIGNAL(sig_end()) , |
407 | this, SLOT(slotEnd()) ); | 410 | this, SLOT(slotEnd()) ); |
408 | 411 | ||
409 | 412 | ||
410 | /* reload now with default Path*/ | 413 | /* reload now with default Path |
411 | m_path = lis->defaultPath(); | 414 | * but only if it isn't a reset like from setupdlg |
415 | */ | ||
416 | if (!m_internalReset) | ||
417 | m_path = lis->defaultPath(); | ||
412 | QTimer::singleShot( 0, this, SLOT(slotReloadDir())); | 418 | QTimer::singleShot( 0, this, SLOT(slotReloadDir())); |
413 | } | 419 | } |
414 | 420 | ||
415 | 421 | ||
416 | void PIconView::slotReloadDir() { | 422 | void PIconView::slotReloadDir() { |
417 | slotChangeDir( m_path ); | 423 | slotChangeDir( m_path ); |
418 | } | 424 | } |
419 | 425 | ||
420 | 426 | ||
421 | /* | 427 | /* |
422 | * add files and folders | 428 | * add files and folders |
423 | */ | 429 | */ |
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h index dff55ed..bea35c2 100644 --- a/noncore/graphics/opie-eye/gui/iconview.h +++ b/noncore/graphics/opie-eye/gui/iconview.h | |||
@@ -86,15 +86,16 @@ private slots: | |||
86 | void slotThumbInfo(const QString&, const QString&); | 86 | void slotThumbInfo(const QString&, const QString&); |
87 | void slotThumbNail(const QString&, const QPixmap&); | 87 | void slotThumbNail(const QString&, const QPixmap&); |
88 | 88 | ||
89 | void slotChangeMode( int ); | 89 | void slotChangeMode( int ); |
90 | private: | 90 | private: |
91 | Opie::Core::OKeyConfigManager *m_viewManager; | 91 | Opie::Core::OKeyConfigManager *m_viewManager; |
92 | Opie::Core::OConfig *m_cfg; | 92 | Opie::Core::OConfig *m_cfg; |
93 | QComboBox* m_views; | 93 | QComboBox* m_views; |
94 | QIconView* m_view; | 94 | QIconView* m_view; |
95 | QString m_path; | 95 | QString m_path; |
96 | bool m_updatet : 1; | 96 | bool m_updatet : 1; |
97 | int m_mode; | 97 | int m_mode; |
98 | bool m_internalReset:1; | ||
98 | }; | 99 | }; |
99 | 100 | ||
100 | #endif | 101 | #endif |
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 6660eb2..30c9bf1 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -164,31 +164,33 @@ void PMainWindow::slotConfig() { | |||
164 | /* | 164 | /* |
165 | * Add the KeyConfigWidget | 165 | * Add the KeyConfigWidget |
166 | */ | 166 | */ |
167 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 167 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
168 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 168 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
169 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 169 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
170 | QWidget*w = m_stack->visibleWidget(); | 170 | QWidget*w = m_stack->visibleWidget(); |
171 | 171 | ||
172 | bool reminfo = false; | 172 | bool reminfo = false; |
173 | if ( !m_info ) { | 173 | if ( !m_info ) { |
174 | reminfo = true; | 174 | reminfo = true; |
175 | initInfo(); | 175 | initInfo(); |
176 | m_info->hide(); | ||
176 | } | 177 | } |
177 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); | 178 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); |
178 | 179 | ||
179 | bool remdisp = false; | 180 | bool remdisp = false; |
180 | if ( !m_disp ) { | 181 | if ( !m_disp ) { |
181 | remdisp = true; | 182 | remdisp = true; |
182 | initDisp(); | 183 | initDisp(); |
184 | m_disp->hide(); | ||
183 | } | 185 | } |
184 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); | 186 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); |
185 | 187 | ||
186 | keyWid->load(); | 188 | keyWid->load(); |
187 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 189 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
188 | wid->setCurrentTab(0); | 190 | wid->setCurrentTab(0); |
189 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 191 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
190 | 192 | ||
191 | /* | 193 | /* |
192 | * clean up | 194 | * clean up |
193 | *apply changes | 195 | *apply changes |
194 | */ | 196 | */ |