author | alwin <alwin> | 2004-11-12 15:57:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-12 15:57:59 (UTC) |
commit | e1ed329d0b8be10ac6e019d37b82afcf21990691 (patch) (unidiff) | |
tree | 0c84e2c4fd062487932de9add39a083da194cca0 /noncore/graphics/opie-eye/gui | |
parent | de558d6f0bc31f58ffaa894a0236f0d9cb5d73e0 (diff) | |
download | opie-e1ed329d0b8be10ac6e019d37b82afcf21990691.zip opie-e1ed329d0b8be10ac6e019d37b82afcf21990691.tar.gz opie-e1ed329d0b8be10ac6e019d37b82afcf21990691.tar.bz2 |
- fixed a bug in docview-lister: different files may have same docview
name. So mapping filenames to docname isn't usefull.
- when opie-eye is started from doctab closing the imagewindow
closes the application
- when a doc-link is changed while opie-eye is running it get the
changes, too.
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 | |||
@@ -191,65 +191,52 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
191 | { | 191 | { |
192 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); | 192 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); |
193 | } | 193 | } |
194 | m_path = QDir::homeDirPath(); | 194 | m_path = QDir::homeDirPath(); |
195 | m_mode = 0; | 195 | m_mode = 0; |
196 | m_iconsize = 32; | 196 | m_iconsize = 32; |
197 | m_internalReset = false; | 197 | m_internalReset = false; |
198 | m_customWidget = 0; | 198 | m_customWidget = 0; |
199 | m_setDocCalled = false; | ||
199 | 200 | ||
200 | m_hbox = new QHBox( this ); | 201 | m_hbox = new QHBox( this ); |
201 | QLabel* lbl = new QLabel( m_hbox ); | 202 | QLabel* lbl = new QLabel( m_hbox ); |
202 | lbl->setText( tr("View as" ) ); | 203 | lbl->setText( tr("View as" ) ); |
203 | 204 | ||
204 | m_views = new QComboBox( m_hbox, "View As" ); | 205 | m_views = new QComboBox( m_hbox, "View As" ); |
205 | 206 | ||
206 | m_view= new QIconView( this ); | 207 | m_view= new QIconView( this ); |
207 | connect(m_view, SIGNAL(clicked(QIconViewItem*) ), | 208 | connect(m_view, SIGNAL(clicked(QIconViewItem*) ), |
208 | this, SLOT(slotClicked(QIconViewItem*)) ); | 209 | this, SLOT(slotClicked(QIconViewItem*)) ); |
209 | connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), | 210 | connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), |
210 | this, SLOT(slotClicked(QIconViewItem*)) ); | 211 | this, SLOT(slotClicked(QIconViewItem*)) ); |
211 | 212 | ||
212 | m_view->setArrangement( QIconView::LeftToRight ); | 213 | m_view->setArrangement( QIconView::LeftToRight ); |
213 | 214 | ||
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 ); |
220 | if (m_mode >1) { | 218 | if (m_mode >1) { |
221 | m_view->setResizeMode(QIconView::Adjust); | 219 | m_view->setResizeMode(QIconView::Adjust); |
222 | } else { | 220 | } else { |
223 | m_view->setResizeMode(QIconView::Fixed); | 221 | m_view->setResizeMode(QIconView::Fixed); |
224 | } | 222 | } |
225 | m_iconsize = m_cfg->readNumEntry("iconsize", 32); | 223 | m_iconsize = m_cfg->readNumEntry("iconsize", 32); |
226 | if (m_iconsize<12)m_iconsize = 12; | 224 | if (m_iconsize<12)m_iconsize = 12; |
227 | if (m_iconsize>64)m_iconsize = 64; | 225 | if (m_iconsize>64)m_iconsize = 64; |
228 | 226 | ||
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 | } |
249 | 236 | ||
250 | /* | 237 | /* |
251 | * Unref the slave and save the keyboard manager | 238 | * Unref the slave and save the keyboard manager |
252 | */ | 239 | */ |
253 | PIconView::~PIconView() { | 240 | PIconView::~PIconView() { |
254 | { | 241 | { |
255 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); | 242 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); |
@@ -436,16 +423,40 @@ void PIconView::resetView() { | |||
436 | } | 423 | } |
437 | } else { | 424 | } else { |
438 | m_iconsize = 64; | 425 | m_iconsize = 64; |
439 | } | 426 | } |
440 | slotViewChanged(m_views->currentItem()); | 427 | slotViewChanged(m_views->currentItem()); |
441 | m_internalReset = false; | 428 | m_internalReset = false; |
442 | } | 429 | } |
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 | /* |
445 | *swicth view reloadDir and connect signals | 456 | *swicth view reloadDir and connect signals |
446 | */ | 457 | */ |
447 | void PIconView::slotViewChanged( int i) { | 458 | void PIconView::slotViewChanged( int i) { |
448 | if (!m_views->count() ) { | 459 | if (!m_views->count() ) { |
449 | setCurrentView( 0l); | 460 | setCurrentView( 0l); |
450 | return; | 461 | return; |
451 | } | 462 | } |
@@ -524,25 +535,30 @@ void PIconView::addFolders( const QStringList& lst) { | |||
524 | void PIconView::addFiles( const QStringList& lst) { | 535 | void PIconView::addFiles( const QStringList& lst) { |
525 | QStringList::ConstIterator it; | 536 | QStringList::ConstIterator it; |
526 | IconViewItem * _iv; | 537 | IconViewItem * _iv; |
527 | QPixmap*m_pix = 0; | 538 | QPixmap*m_pix = 0; |
528 | QString pre = ""; | 539 | QString pre = ""; |
529 | if (!m_path.isEmpty()) { | 540 | if (!m_path.isEmpty()) { |
530 | pre = m_path+"/"; | 541 | pre = m_path+"/"; |
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) { |
536 | _iv->setTextOnly(true); | 555 | _iv->setTextOnly(true); |
537 | _iv->setPixmap(QPixmap()); | 556 | _iv->setPixmap(QPixmap()); |
538 | |||
539 | |||
540 | |||
541 | } else { | 557 | } else { |
542 | if (m_pix) _iv->setPixmap(*m_pix); | 558 | if (m_pix) _iv->setPixmap(*m_pix); |
543 | } | 559 | } |
544 | } | 560 | } |
545 | 561 | ||
546 | } | 562 | } |
547 | 563 | ||
548 | /* | 564 | /* |
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 | |||
@@ -30,37 +30,41 @@ class PIconView : public QVBox { | |||
30 | BeamItem, DeleteItem, ViewItem, InfoItem,SlideItem | 30 | BeamItem, DeleteItem, ViewItem, InfoItem,SlideItem |
31 | }; | 31 | }; |
32 | public: | 32 | public: |
33 | PIconView( QWidget* wid, Opie::Core::OConfig *cfg ); | 33 | PIconView( QWidget* wid, Opie::Core::OConfig *cfg ); |
34 | ~PIconView(); | 34 | ~PIconView(); |
35 | void resetView(); | 35 | void resetView(); |
36 | Opie::Core::OKeyConfigManager* manager(); | 36 | Opie::Core::OKeyConfigManager* manager(); |
37 | 37 | ||
38 | void setDoccalled(bool); | ||
39 | |||
38 | signals: | 40 | signals: |
39 | void sig_showInfo( const QString& ); | 41 | void sig_showInfo( const QString& ); |
40 | void sig_display(const QString&); | 42 | void sig_display(const QString&); |
41 | void sig_startslide(int timeout); | 43 | void sig_startslide(int timeout); |
42 | 44 | ||
43 | public slots: | 45 | public slots: |
44 | virtual void slotShowNext(); | 46 | virtual void slotShowNext(); |
45 | virtual void slotShowPrev(); | 47 | virtual void slotShowPrev(); |
46 | virtual void slotShowLast(); | 48 | virtual void slotShowLast(); |
47 | virtual bool slotShowFirst(); | 49 | virtual bool slotShowFirst(); |
50 | virtual void polish(); | ||
48 | 51 | ||
49 | protected: | 52 | protected: |
50 | void resizeEvent( QResizeEvent* ); | 53 | void resizeEvent( QResizeEvent* ); |
51 | 54 | ||
52 | private: | 55 | private: |
53 | void initKeys(); | 56 | void initKeys(); |
54 | QString currentFileName(bool &isDir)const; | 57 | QString currentFileName(bool &isDir)const; |
55 | QString nextFileName(bool &isDir)const; | 58 | QString nextFileName(bool &isDir)const; |
56 | QString prevFileName(bool &isDir)const; | 59 | QString prevFileName(bool &isDir)const; |
57 | void loadViews(); | 60 | void loadViews(); |
58 | void calculateGrid(QResizeEvent*e = 0); | 61 | void calculateGrid(QResizeEvent*e = 0); |
62 | bool m_setDocCalled:1; | ||
59 | 63 | ||
60 | private slots: | 64 | private slots: |
61 | void slotDirUp(); | 65 | void slotDirUp(); |
62 | void slotChangeDir(const QString&); | 66 | void slotChangeDir(const QString&); |
63 | void slotTrash(); | 67 | void slotTrash(); |
64 | void slotViewChanged( int ); | 68 | void slotViewChanged( int ); |
65 | void slotReloadDir(); | 69 | void slotReloadDir(); |
66 | void slotRename(); | 70 | void slotRename(); |
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 | |||
@@ -22,16 +22,17 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
22 | m_ignore_next_in = false; | 22 | m_ignore_next_in = false; |
23 | m_slideTimer = 0; | 23 | m_slideTimer = 0; |
24 | QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); | 24 | QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); |
25 | initKeys(); | 25 | initKeys(); |
26 | m_slideValue = 5; | 26 | m_slideValue = 5; |
27 | m_gDisplayType = 0; | 27 | m_gDisplayType = 0; |
28 | m_gPrevNext = 0; | 28 | m_gPrevNext = 0; |
29 | m_hGroup = 0; | 29 | m_hGroup = 0; |
30 | closeIfHide = false; | ||
30 | } | 31 | } |
31 | 32 | ||
32 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) | 33 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) |
33 | { | 34 | { |
34 | m_gDisplayType = disptypeGroup; | 35 | m_gDisplayType = disptypeGroup; |
35 | m_gPrevNext = nextprevGroup; | 36 | m_gPrevNext = nextprevGroup; |
36 | m_hGroup = hGroup; | 37 | m_hGroup = hGroup; |
37 | } | 38 | } |
@@ -147,17 +148,29 @@ void ImageView::initKeys() | |||
147 | m_viewManager->load(); | 148 | m_viewManager->load(); |
148 | } | 149 | } |
149 | 150 | ||
150 | void ImageView::keyReleaseEvent(QKeyEvent * e) | 151 | void ImageView::keyReleaseEvent(QKeyEvent * e) |
151 | { | 152 | { |
152 | if (!e || e->state()!=0) { | 153 | if (!e || e->state()!=0) { |
153 | return; | 154 | return; |
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 | } |
157 | 170 | ||
158 | void ImageView::slotShowImageInfo() | 171 | void ImageView::slotShowImageInfo() |
159 | { | 172 | { |
160 | emit dispImageInfo(m_lastName); | 173 | emit dispImageInfo(m_lastName); |
161 | } | 174 | } |
162 | 175 | ||
163 | void ImageView::contentsMousePressEvent ( QMouseEvent * e) | 176 | void ImageView::contentsMousePressEvent ( QMouseEvent * e) |
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 | |||
@@ -34,16 +34,17 @@ public: | |||
34 | ImageView(Opie::Core::OConfig *cfg,QWidget* parent,const char* name = 0, WFlags fl = 0 ); | 34 | ImageView(Opie::Core::OConfig *cfg,QWidget* parent,const char* name = 0, WFlags fl = 0 ); |
35 | virtual ~ImageView(); | 35 | virtual ~ImageView(); |
36 | Opie::Core::OKeyConfigManager* manager(); | 36 | Opie::Core::OKeyConfigManager* manager(); |
37 | void setFullScreen(bool how,bool force=true); | 37 | void setFullScreen(bool how,bool force=true); |
38 | bool fullScreen(){return m_isFullScreen;} | 38 | bool fullScreen(){return m_isFullScreen;} |
39 | virtual void enableFullscreen(); | 39 | virtual void enableFullscreen(); |
40 | void stopSlide(); | 40 | void stopSlide(); |
41 | void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup); | 41 | void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup); |
42 | void setCloseIfHide(bool); | ||
42 | 43 | ||
43 | signals: | 44 | signals: |
44 | void dispImageInfo(const QString&); | 45 | void dispImageInfo(const QString&); |
45 | void dispNext(); | 46 | void dispNext(); |
46 | void dispPrev(); | 47 | void dispPrev(); |
47 | void toggleFullScreen(); | 48 | void toggleFullScreen(); |
48 | void hideMe(); | 49 | void hideMe(); |
49 | void toggleZoomer(); | 50 | void toggleZoomer(); |
@@ -56,16 +57,17 @@ protected: | |||
56 | void initKeys(); | 57 | void initKeys(); |
57 | bool m_isFullScreen:1; | 58 | bool m_isFullScreen:1; |
58 | bool m_ignore_next_in:1; | 59 | bool m_ignore_next_in:1; |
59 | int focus_in_count; | 60 | int focus_in_count; |
60 | QTimer*m_slideTimer; | 61 | QTimer*m_slideTimer; |
61 | int m_slideValue; | 62 | int m_slideValue; |
62 | virtual void focusInEvent ( QFocusEvent * ); | 63 | virtual void focusInEvent ( QFocusEvent * ); |
63 | QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup; | 64 | QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup; |
65 | bool closeIfHide:1; | ||
64 | 66 | ||
65 | public slots: | 67 | public slots: |
66 | virtual void hide(); | 68 | virtual void hide(); |
67 | virtual void startSlide(int); | 69 | virtual void startSlide(int); |
68 | virtual void nextSlide(); | 70 | virtual void nextSlide(); |
69 | 71 | ||
70 | protected slots: | 72 | protected slots: |
71 | virtual void slotShowImageInfo(); | 73 | virtual void slotShowImageInfo(); |
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 | |||
@@ -41,16 +41,18 @@ OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) | |||
41 | 41 | ||
42 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 42 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
43 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) | 43 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) |
44 | { | 44 | { |
45 | setCaption( QObject::tr("Opie Eye Caramba" ) ); | 45 | setCaption( QObject::tr("Opie Eye Caramba" ) ); |
46 | m_cfg = new Opie::Core::OConfig("opie-eye"); | 46 | m_cfg = new Opie::Core::OConfig("opie-eye"); |
47 | m_cfg->setGroup("main" ); | 47 | m_cfg->setGroup("main" ); |
48 | readConfig(); | 48 | readConfig(); |
49 | m_setDocCalled = false; | ||
50 | m_polishDone = false; | ||
49 | 51 | ||
50 | m_storage = new StorageInfo(); | 52 | m_storage = new StorageInfo(); |
51 | connect(m_storage, SIGNAL(disksChanged() ), | 53 | connect(m_storage, SIGNAL(disksChanged() ), |
52 | this, SLOT( dirChanged() ) ); | 54 | this, SLOT( dirChanged() ) ); |
53 | 55 | ||
54 | m_stack = new Opie::Ui::OWidgetStack( this ); | 56 | m_stack = new Opie::Ui::OWidgetStack( this ); |
55 | setCentralWidget( m_stack ); | 57 | setCentralWidget( m_stack ); |
56 | 58 | ||
@@ -414,43 +416,45 @@ void PMainWindow::slotReturn() { | |||
414 | } | 416 | } |
415 | 417 | ||
416 | 418 | ||
417 | void PMainWindow::closeEvent( QCloseEvent* ev ) { | 419 | void PMainWindow::closeEvent( QCloseEvent* ev ) { |
418 | /* | 420 | /* |
419 | * return from view | 421 | * return from view |
420 | * or properly quit | 422 | * or properly quit |
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 | } |
428 | if (m_disp && m_disp->fullScreen()) { | 432 | if (m_disp && m_disp->fullScreen()) { |
429 | /* otherwise opie-eye crashes in bigscreen mode! */ | 433 | /* otherwise opie-eye crashes in bigscreen mode! */ |
430 | m_disp->reparent(0,QPoint(0,0)); | 434 | m_disp->reparent(0,QPoint(0,0)); |
431 | m_stack->addWidget(m_disp,ImageDisplay); | 435 | m_stack->addWidget(m_disp,ImageDisplay); |
432 | } | 436 | } |
433 | ev->accept(); | 437 | ev->accept(); |
434 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); | 438 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); |
435 | } | 439 | } |
436 | 440 | ||
437 | void PMainWindow::setDocument( const QString& showImg ) | 441 | void PMainWindow::setDocument( const QString& showImg ) |
438 | { | 442 | { |
439 | bool first_start = m_disp==0; | ||
440 | |||
441 | QString file = showImg; | 443 | QString file = showImg; |
442 | DocLnk lnk(showImg); | 444 | DocLnk lnk(showImg); |
443 | if (lnk.isValid() ) | 445 | if (lnk.isValid() ) |
444 | file = lnk.file(); | 446 | file = lnk.file(); |
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 | } |
450 | 454 | ||
451 | void PMainWindow::check_view_fullscreen() | 455 | void PMainWindow::check_view_fullscreen() |
452 | { | 456 | { |
453 | if (!m_view) return; | 457 | if (!m_view) return; |
454 | if (!m_view->hasFocus()&&m_aFullScreen->isOn()) { | 458 | if (!m_view->hasFocus()&&m_aFullScreen->isOn()) { |
455 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | 459 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); |
456 | } | 460 | } |
@@ -684,27 +688,46 @@ void PMainWindow::setupMenu() | |||
684 | m_aSetup->addTo(settingsMenu); | 688 | m_aSetup->addTo(settingsMenu); |
685 | m_aHideToolbar->addTo(settingsMenu); | 689 | m_aHideToolbar->addTo(settingsMenu); |
686 | } | 690 | } |
687 | 691 | ||
688 | void PMainWindow::listviewselected(QAction*which) | 692 | void PMainWindow::listviewselected(QAction*which) |
689 | { | 693 | { |
690 | if (!which || which->isOn()==false) return; | 694 | if (!which || which->isOn()==false) return; |
691 | int val = 1; | 695 | int val = 1; |
692 | // QString name; | ||
693 | 696 | ||
694 | if (which==m_aDirName) { | 697 | if (which==m_aDirName) { |
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 | } |
704 | emit changeListMode(val); | 704 | emit changeListMode(val); |
705 | } | 705 | } |
706 | 706 | ||
707 | void PMainWindow::readConfig() | 707 | void PMainWindow::readConfig() |
708 | { | 708 | { |
709 | autoSave =m_cfg->readBoolEntry("savestatus",true); | 709 | autoSave =m_cfg->readBoolEntry("savestatus",true); |
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 | |||
@@ -53,16 +53,17 @@ public slots: | |||
53 | void slotScaleToggled(bool); | 53 | void slotScaleToggled(bool); |
54 | void slotZoomerToggled(bool); | 54 | void slotZoomerToggled(bool); |
55 | void slotToggleZoomer(); | 55 | void slotToggleZoomer(); |
56 | void slotToggleAutorotate(); | 56 | void slotToggleAutorotate(); |
57 | void slotToggleAutoscale(); | 57 | void slotToggleAutoscale(); |
58 | void setDocument( const QString& ); | 58 | void setDocument( const QString& ); |
59 | virtual void slotToggleFullScreen(); | 59 | virtual void slotToggleFullScreen(); |
60 | virtual void slotFullScreenToggled(bool); | 60 | virtual void slotFullScreenToggled(bool); |
61 | virtual void polish(); | ||
61 | 62 | ||
62 | protected slots: | 63 | protected slots: |
63 | void raiseIconView(); | 64 | void raiseIconView(); |
64 | void closeEvent( QCloseEvent* ); | 65 | void closeEvent( QCloseEvent* ); |
65 | void showToolbar(bool); | 66 | void showToolbar(bool); |
66 | void listviewselected(QAction*); | 67 | void listviewselected(QAction*); |
67 | void slotFullScreenButton(bool); | 68 | void slotFullScreenButton(bool); |
68 | void check_view_fullscreen(); | 69 | void check_view_fullscreen(); |
@@ -75,16 +76,18 @@ private: | |||
75 | 76 | ||
76 | private: | 77 | private: |
77 | Opie::Core::OConfig *m_cfg; | 78 | Opie::Core::OConfig *m_cfg; |
78 | Opie::Ui::OWidgetStack *m_stack; | 79 | Opie::Ui::OWidgetStack *m_stack; |
79 | PIconView* m_view; | 80 | PIconView* m_view; |
80 | imageinfo *m_info; | 81 | imageinfo *m_info; |
81 | ImageView *m_disp; | 82 | ImageView *m_disp; |
82 | bool autoSave; | 83 | bool autoSave; |
84 | bool m_setDocCalled:1; | ||
85 | bool m_polishDone:1; | ||
83 | QToolButton*fsButton; | 86 | QToolButton*fsButton; |
84 | QToolBar *toolBar; | 87 | QToolBar *toolBar; |
85 | QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu; | 88 | QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu; |
86 | QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide; | 89 | QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide; |
87 | QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; | 90 | QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; |
88 | QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; | 91 | QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; |
89 | QAction *m_aNext,*m_aPrevious,*m_aFullScreen; | 92 | QAction *m_aNext,*m_aPrevious,*m_aFullScreen; |
90 | QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer; | 93 | QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer; |