Diffstat (limited to 'noncore/graphics/opie-eye/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 64 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.h | 4 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 15 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.h | 2 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 47 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 3 |
6 files changed, 98 insertions, 37 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 948477c..138e661 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -198,2 +198,3 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
198 | m_customWidget = 0; | 198 | m_customWidget = 0; |
199 | m_setDocCalled = false; | ||
199 | 200 | ||
@@ -214,6 +215,3 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
214 | m_mode = m_cfg->readNumEntry("ListViewMode", 1); | 215 | m_mode = m_cfg->readNumEntry("ListViewMode", 1); |
215 | QString lastView = m_cfg->readEntry("LastView",""); | ||
216 | |||
217 | if (m_mode < 1 || m_mode>3) m_mode = 1; | 216 | if (m_mode < 1 || m_mode>3) m_mode = 1; |
218 | |||
219 | m_view->setItemTextPos( QIconView::Right ); | 217 | m_view->setItemTextPos( QIconView::Right ); |
@@ -229,20 +227,9 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
229 | calculateGrid(); | 227 | calculateGrid(); |
230 | |||
231 | initKeys(); | 228 | initKeys(); |
232 | |||
233 | loadViews(); | 229 | loadViews(); |
234 | int cc=0; | 230 | } |
235 | for (; cc<m_views->count();++cc) { | 231 | |
236 | if (m_views->text(cc)==lastView) { | 232 | void PIconView::setDoccalled(bool how) |
237 | break; | 233 | { |
238 | } | 234 | m_setDocCalled = how; |
239 | } | ||
240 | if (cc<m_views->count()) { | ||
241 | m_views->setCurrentItem(cc); | ||
242 | slotViewChanged(cc); | ||
243 | } else { | ||
244 | slotViewChanged(m_views->currentItem()); | ||
245 | } | ||
246 | connect( m_views, SIGNAL(activated(int)), | ||
247 | this, SLOT(slotViewChanged(int)) ); | ||
248 | } | 235 | } |
@@ -443,2 +430,26 @@ void PIconView::resetView() { | |||
443 | 430 | ||
431 | void PIconView::polish() | ||
432 | { | ||
433 | odebug << "===\n" | ||
434 | << "PIconView::polish()\n" | ||
435 | << "====" << oendl; | ||
436 | QVBox::polish(); | ||
437 | |||
438 | QString lastView = m_cfg->readEntry("LastView",""); | ||
439 | int cc=0; | ||
440 | for (; cc<m_views->count();++cc) { | ||
441 | if (m_views->text(cc)==lastView) { | ||
442 | break; | ||
443 | } | ||
444 | } | ||
445 | if (cc<m_views->count()) { | ||
446 | m_views->setCurrentItem(cc); | ||
447 | slotViewChanged(cc); | ||
448 | } else { | ||
449 | slotViewChanged(m_views->currentItem()); | ||
450 | } | ||
451 | connect( m_views, SIGNAL(activated(int)), | ||
452 | this, SLOT(slotViewChanged(int)) ); | ||
453 | } | ||
454 | |||
444 | /* | 455 | /* |
@@ -531,5 +542,13 @@ void PIconView::addFiles( const QStringList& lst) { | |||
531 | } | 542 | } |
543 | QString s = ""; | ||
544 | int pos; | ||
532 | for (it=lst.begin(); it!= lst.end(); ++it ) { | 545 | for (it=lst.begin(); it!= lst.end(); ++it ) { |
533 | m_pix = PPixmapCache::self()->cachedImage( pre+(*it), m_iconsize, m_iconsize ); | 546 | s = (*it); |
534 | _iv = new IconViewItem( m_view, pre+(*it), (*it),m_iconsize ); | 547 | pos = s.find(char(0)); |
548 | m_pix = PPixmapCache::self()->cachedImage( pre+(*it), m_iconsize, m_iconsize ); | ||
549 | if (pos>-1) { | ||
550 | _iv = new IconViewItem( m_view, s.mid(pos+1), s.left(pos),m_iconsize ); | ||
551 | } else { | ||
552 | _iv = new IconViewItem( m_view, pre+(*it), (*it),m_iconsize ); | ||
553 | } | ||
535 | if (m_mode==3) { | 554 | if (m_mode==3) { |
@@ -537,5 +556,2 @@ void PIconView::addFiles( const QStringList& lst) { | |||
537 | _iv->setPixmap(QPixmap()); | 556 | _iv->setPixmap(QPixmap()); |
538 | |||
539 | |||
540 | |||
541 | } else { | 557 | } else { |
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h index 78dda58..6e08fd8 100644 --- a/noncore/graphics/opie-eye/gui/iconview.h +++ b/noncore/graphics/opie-eye/gui/iconview.h | |||
@@ -37,2 +37,4 @@ public: | |||
37 | 37 | ||
38 | void setDoccalled(bool); | ||
39 | |||
38 | signals: | 40 | signals: |
@@ -47,2 +49,3 @@ public slots: | |||
47 | virtual bool slotShowFirst(); | 49 | virtual bool slotShowFirst(); |
50 | virtual void polish(); | ||
48 | 51 | ||
@@ -58,2 +61,3 @@ private: | |||
58 | void calculateGrid(QResizeEvent*e = 0); | 61 | void calculateGrid(QResizeEvent*e = 0); |
62 | bool m_setDocCalled:1; | ||
59 | 63 | ||
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index ebdfc60..ac6474c 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -29,2 +29,3 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
29 | m_hGroup = 0; | 29 | m_hGroup = 0; |
30 | closeIfHide = false; | ||
30 | } | 31 | } |
@@ -154,3 +155,15 @@ void ImageView::keyReleaseEvent(QKeyEvent * e) | |||
154 | } | 155 | } |
155 | if (e->key()==Qt::Key_Escape && fullScreen()) emit hideMe(); | 156 | if (e->key()==Qt::Key_Escape) { |
157 | if (fullScreen()) { | ||
158 | emit hideMe(); | ||
159 | } | ||
160 | if (closeIfHide) { | ||
161 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); | ||
162 | } | ||
163 | } | ||
164 | } | ||
165 | |||
166 | void ImageView::setCloseIfHide(bool how) | ||
167 | { | ||
168 | closeIfHide = how; | ||
156 | } | 169 | } |
diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h index 2408211..f1067bb 100644 --- a/noncore/graphics/opie-eye/gui/imageview.h +++ b/noncore/graphics/opie-eye/gui/imageview.h | |||
@@ -41,2 +41,3 @@ public: | |||
41 | void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup); | 41 | void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup); |
42 | void setCloseIfHide(bool); | ||
42 | 43 | ||
@@ -63,2 +64,3 @@ protected: | |||
63 | QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup; | 64 | QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup; |
65 | bool closeIfHide:1; | ||
64 | 66 | ||
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index f443ccb..295f93f 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -48,2 +48,4 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
48 | readConfig(); | 48 | readConfig(); |
49 | m_setDocCalled = false; | ||
50 | m_polishDone = false; | ||
49 | 51 | ||
@@ -421,7 +423,9 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) { | |||
421 | */ | 423 | */ |
422 | if ( m_stack->visibleWidget() == m_info || | 424 | if (!m_setDocCalled) { |
423 | m_stack->visibleWidget() == m_disp ) { | 425 | if ( m_stack->visibleWidget() == m_info || |
424 | ev->ignore(); | 426 | m_stack->visibleWidget() == m_disp ) { |
425 | raiseIconView(); | 427 | ev->ignore(); |
426 | return; | 428 | raiseIconView(); |
429 | return; | ||
430 | } | ||
427 | } | 431 | } |
@@ -438,4 +442,2 @@ void PMainWindow::setDocument( const QString& showImg ) | |||
438 | { | 442 | { |
439 | bool first_start = m_disp==0; | ||
440 | |||
441 | QString file = showImg; | 443 | QString file = showImg; |
@@ -445,5 +447,7 @@ void PMainWindow::setDocument( const QString& showImg ) | |||
445 | slotDisplay( file ); | 447 | slotDisplay( file ); |
446 | if (first_start && m_aFullScreen->isOn()) { | 448 | #if 0 |
449 | if (!m_polishDone) { | ||
447 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); | 450 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); |
448 | } | 451 | } |
452 | #endif | ||
449 | } | 453 | } |
@@ -691,3 +695,2 @@ void PMainWindow::listviewselected(QAction*which) | |||
691 | int val = 1; | 695 | int val = 1; |
692 | // QString name; | ||
693 | 696 | ||
@@ -695,9 +698,6 @@ void PMainWindow::listviewselected(QAction*which) | |||
695 | val = 3; | 698 | val = 3; |
696 | // name = "opie-eye/opie-eye-textview"; | ||
697 | } else if (which==m_aDirShort) { | 699 | } else if (which==m_aDirShort) { |
698 | val = 2; | 700 | val = 2; |
699 | // name = "opie-eye/opie-eye-thumbonly"; | ||
700 | } else if (which==m_aDirLong) { | 701 | } else if (which==m_aDirLong) { |
701 | val = 1; | 702 | val = 1; |
702 | // name = "opie-eye/opie-eye-thumb"; | ||
703 | } | 703 | } |
@@ -710 +710,24 @@ void PMainWindow::readConfig() | |||
710 | } | 710 | } |
711 | |||
712 | void PMainWindow::polish() | ||
713 | { | ||
714 | if (m_disp) { | ||
715 | odebug << "======================\n" | ||
716 | << "Called via setdocument\n" | ||
717 | << "======================" << oendl; | ||
718 | m_setDocCalled = true; | ||
719 | m_view->setDoccalled(true); | ||
720 | m_disp->setCloseIfHide(true); | ||
721 | } else { | ||
722 | m_setDocCalled = false; | ||
723 | m_view->setDoccalled(false); | ||
724 | } | ||
725 | m_polishDone = true; | ||
726 | QMainWindow::polish(); | ||
727 | if (m_setDocCalled) { | ||
728 | if (m_aFullScreen->isOn()) { | ||
729 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); | ||
730 | } else if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | ||
731 | } | ||
732 | } | ||
733 | } | ||
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index 465e352..2f54090 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h | |||
@@ -60,2 +60,3 @@ public slots: | |||
60 | virtual void slotFullScreenToggled(bool); | 60 | virtual void slotFullScreenToggled(bool); |
61 | virtual void polish(); | ||
61 | 62 | ||
@@ -82,2 +83,4 @@ private: | |||
82 | bool autoSave; | 83 | bool autoSave; |
84 | bool m_setDocCalled:1; | ||
85 | bool m_polishDone:1; | ||
83 | QToolButton*fsButton; | 86 | QToolButton*fsButton; |