summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-01 01:58:25 (UTC)
committer alwin <alwin>2004-11-01 01:58:25 (UTC)
commitd69955ef9cddc3acc37b9dc96945cd4bae56eed5 (patch) (unidiff)
tree7982a6da8f8141292eb0a1c09ce384784af2801d
parent01fb5d6957984fe6fe5ed2109a024be7e8159d16 (diff)
downloadopie-d69955ef9cddc3acc37b9dc96945cd4bae56eed5.zip
opie-d69955ef9cddc3acc37b9dc96945cd4bae56eed5.tar.gz
opie-d69955ef9cddc3acc37b9dc96945cd4bae56eed5.tar.bz2
some menu working
some debug messages removed tried to remove some interesting effects when switching view mode
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageinfoui.cpp1
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp7
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h2
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp54
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h4
5 files changed, 45 insertions, 23 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
index e70d6a6..7afb62d 100644
--- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp
+++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
@@ -55,9 +55,8 @@ Opie::Core::OKeyConfigManager* imageinfo::manager()
55} 55}
56 56
57void imageinfo::initKeys() 57void imageinfo::initKeys()
58{ 58{
59 odebug << "init imageinfo keys" << oendl;
60#if 0 59#if 0
61 if (!m_cfg) { 60 if (!m_cfg) {
62 m_cfg = new Opie::Core::OConfig("phunkview"); 61 m_cfg = new Opie::Core::OConfig("phunkview");
63 m_cfg->setGroup("imageinfo_keys" ); 62 m_cfg->setGroup("imageinfo_keys" );
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index c7e48cb..86db732 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -86,9 +86,9 @@ void ImageView::nextSlide()
86void ImageView::initKeys() 86void ImageView::initKeys()
87{ 87{
88 odebug << "init imageview keys" << oendl; 88 odebug << "init imageview keys" << oendl;
89 if (!m_cfg) { 89 if (!m_cfg) {
90 m_cfg = new Opie::Core::OConfig("phunkview"); 90 m_cfg = new Opie::Core::OConfig("opie-eye");
91 m_cfg->setGroup("image_view_keys" ); 91 m_cfg->setGroup("image_view_keys" );
92 } 92 }
93 Opie::Core::OKeyPair::List lst; 93 Opie::Core::OKeyPair::List lst;
94 lst.append( Opie::Core::OKeyPair::upArrowKey() ); 94 lst.append( Opie::Core::OKeyPair::upArrowKey() );
@@ -189,15 +189,15 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
189 } 189 }
190 delete m; 190 delete m;
191} 191}
192 192
193void ImageView::setFullScreen(bool how) 193void ImageView::setFullScreen(bool how,bool force)
194{ 194{
195 m_isFullScreen = how; 195 m_isFullScreen = how;
196 if (how) { 196 if (how) {
197 m_ignore_next_in = true; 197 m_ignore_next_in = true;
198 setFixedSize(qApp->desktop()->size()); 198 setFixedSize(qApp->desktop()->size());
199 showFullScreen(); 199 if (force) showFullScreen();
200 } else { 200 } else {
201 setMinimumSize(10,10); 201 setMinimumSize(10,10);
202 } 202 }
203} 203}
@@ -233,6 +233,5 @@ void ImageView::enableFullscreen()
233 * so we must block it here! */ 233 * so we must block it here! */
234 m_ignore_next_in = true; 234 m_ignore_next_in = true;
235 showFullScreen(); 235 showFullScreen();
236 setUpdatesEnabled(true); 236 setUpdatesEnabled(true);
237
238} 237}
diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h
index 640905a..2408211 100644
--- a/noncore/graphics/opie-eye/gui/imageview.h
+++ b/noncore/graphics/opie-eye/gui/imageview.h
@@ -33,9 +33,9 @@ class ImageView:public Opie::MM::OImageScrollView
33public: 33public:
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); 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);
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 570ee45..ece51a1 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -42,10 +42,10 @@ OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>)
42PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) 42PMainWindow::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("phunkview"); 46 m_cfg = new Opie::Core::OConfig("opie-eye");
47 m_cfg->setGroup("Zecke_view" ); 47 m_cfg->setGroup("main" );
48 48
49 m_storage = new StorageInfo(); 49 m_storage = new StorageInfo();
50 connect(m_storage, SIGNAL(disksChanged() ), 50 connect(m_storage, SIGNAL(disksChanged() ),
51 this, SLOT( dirChanged() ) ); 51 this, SLOT( dirChanged() ) );
@@ -107,9 +107,8 @@ void PMainWindow::slotToggleAutoscale()
107} 107}
108 108
109void PMainWindow::slotRotateToggled(bool how) 109void PMainWindow::slotRotateToggled(bool how)
110{ 110{
111 odebug << "Autorotate: " << how << oendl;
112 autoRotate = how; 111 autoRotate = how;
113 if (m_disp) { 112 if (m_disp) {
114 m_disp->setAutoScaleRotate(!m_aAutoScale->isOn(),m_aAutoRotate->isOn()); 113 m_disp->setAutoScaleRotate(!m_aAutoScale->isOn(),m_aAutoRotate->isOn());
115 } 114 }
@@ -225,12 +224,14 @@ void PMainWindow::initT( const char* name, T** ptr, int id) {
225 connect(*ptr, SIGNAL(sig_return()), 224 connect(*ptr, SIGNAL(sig_return()),
226 this,SLOT(slotReturn())); 225 this,SLOT(slotReturn()));
227 226
228} 227}
228
229void PMainWindow::initInfo() { 229void PMainWindow::initInfo() {
230 initT<imageinfo>( "Image Info", &m_info, ImageInfo ); 230 initT<imageinfo>( "Image Info", &m_info, ImageInfo );
231 connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); 231 connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&)));
232} 232}
233
233void PMainWindow::initDisp() { 234void PMainWindow::initDisp() {
234 initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); 235 initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay );
235 if (m_disp) { 236 if (m_disp) {
236 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 237 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
@@ -255,27 +256,41 @@ void PMainWindow::initDisp() {
255} 256}
256 257
257void PMainWindow::slotToggleFullScreen() 258void PMainWindow::slotToggleFullScreen()
258{ 259{
259 odebug << "Toggle full " << oendl;
260 bool current = !m_aFullScreen->isOn(); 260 bool current = !m_aFullScreen->isOn();
261 m_aFullScreen->setOn(current); 261 m_aFullScreen->setOn(current);
262} 262}
263 263
264void PMainWindow::slotFullScreenToggled(bool current) 264void PMainWindow::slotFullScreenButton(bool current)
265{
266 if (m_disp) odebug << "Disp fenster ist hidden: "<<m_disp->isHidden()<<oendl;
267 if (!m_disp) return;
268
269 /* I can not solve this effects here - it seems that we require some
270 status variable, too. so we will live with some interesting effects
271 meanwhile */
272#if 0
273 bool th = m_disp->isHidden();
274 setupViewWindow(current, false);
275 /* realy - after setting up the fullscreenmode while the window is hidden
276 it is unvisibile not hidden!!!!! Hell. */
277 if (th) m_disp->hide();
278#endif
279 setupViewWindow(current, true);
280}
281
282void PMainWindow::setupViewWindow(bool current, bool forceDisplay)
265{ 283{
266 odebug << "slotFullScreenToggled " << current << oendl;
267 if (!m_disp) return; 284 if (!m_disp) return;
268 if (current) { 285 if (current) {
269 odebug << "full" << oendl;
270 m_disp->setBackgroundColor(black); 286 m_disp->setBackgroundColor(black);
271 m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); 287 m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0));
272 m_disp->setVScrollBarMode(QScrollView::AlwaysOff); 288 m_disp->setVScrollBarMode(QScrollView::AlwaysOff);
273 m_disp->setHScrollBarMode(QScrollView::AlwaysOff); 289 m_disp->setHScrollBarMode(QScrollView::AlwaysOff);
274 m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); 290 m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height());
275 } else { 291 } else {
276 setUpdatesEnabled(false); 292 setUpdatesEnabled(false);
277 odebug << "window" << oendl;
278 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 293 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
279 m_disp->setMinimumSize(QApplication::desktop()->size()/2); 294 m_disp->setMinimumSize(QApplication::desktop()->size()/2);
280 } else { 295 } else {
281 m_disp->setMinimumSize(10,10); 296 m_disp->setMinimumSize(10,10);
@@ -288,15 +303,21 @@ void PMainWindow::slotFullScreenToggled(bool current)
288 m_disp->setBackgroundColor(white); 303 m_disp->setBackgroundColor(white);
289 m_stack->addWidget(m_disp,ImageDisplay); 304 m_stack->addWidget(m_disp,ImageDisplay);
290 m_disp->setVScrollBarMode(QScrollView::Auto); 305 m_disp->setVScrollBarMode(QScrollView::Auto);
291 m_disp->setHScrollBarMode(QScrollView::Auto); 306 m_disp->setHScrollBarMode(QScrollView::Auto);
292 m_stack->raiseWidget(m_disp); 307 if (forceDisplay || m_disp->isVisible())
308 m_stack->raiseWidget(m_disp);
293 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 309 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
294 m_disp->resize(m_disp->minimumSize()); 310 m_disp->resize(m_disp->minimumSize());
295 } 311 }
296 setUpdatesEnabled(true); 312 setUpdatesEnabled(true);
297 } 313 }
298 m_disp->setFullScreen(current); 314 m_disp->setFullScreen(current,forceDisplay);
315}
316
317void PMainWindow::slotFullScreenToggled(bool current)
318{
319 setupViewWindow(current,true);
299} 320}
300 321
301/** 322/**
302 * With big Screen the plan could be to 'detach' the image 323 * With big Screen the plan could be to 'detach' the image
@@ -328,9 +349,8 @@ void PMainWindow::slotShowInfo( const QString& inf ) {
328 m_stack->raiseWidget( ImageInfo ); 349 m_stack->raiseWidget( ImageInfo );
329} 350}
330 351
331void PMainWindow::slotDisplay( const QString& inf ) { 352void PMainWindow::slotDisplay( const QString& inf ) {
332 odebug << "slotDisplay: " << inf << oendl;
333 if ( !m_disp ) { 353 if ( !m_disp ) {
334 initDisp(); 354 initDisp();
335 } 355 }
336 m_disp->setImage( inf ); 356 m_disp->setImage( inf );
@@ -346,9 +366,8 @@ void PMainWindow::slotDisplay( const QString& inf ) {
346 fsButton->hide(); 366 fsButton->hide();
347 } 367 }
348 } 368 }
349 if (m_disp->fullScreen()) { 369 if (m_disp->fullScreen()) {
350 //m_disp->showFullScreen();
351 qwsDisplay()->requestFocus( m_disp->winId(), TRUE); 370 qwsDisplay()->requestFocus( m_disp->winId(), TRUE);
352 } else { 371 } else {
353 m_stack->raiseWidget( ImageDisplay ); 372 m_stack->raiseWidget( ImageDisplay );
354 } 373 }
@@ -517,9 +536,9 @@ void PMainWindow::setupActions()
517 m_aFullScreen = new QAction( tr( "Show images fullscreen" ), 536 m_aFullScreen = new QAction( tr( "Show images fullscreen" ),
518 Resource::loadIconSet("fullscreen"), 0, 0, this, 0, true ); 537 Resource::loadIconSet("fullscreen"), 0, 0, this, 0, true );
519 m_aFullScreen->setToggleAction(true); 538 m_aFullScreen->setToggleAction(true);
520 m_aFullScreen->setOn(false); 539 m_aFullScreen->setOn(false);
521 connect(m_aFullScreen,SIGNAL(toggled(bool)),this,SLOT(slotFullScreenToggled(bool))); 540 connect(m_aFullScreen,SIGNAL(toggled(bool)),this,SLOT(slotFullScreenButton(bool)));
522 541
523 m_gDisplayType = new QActionGroup(this,"imagedisplaytype",false); 542 m_gDisplayType = new QActionGroup(this,"imagedisplaytype",false);
524 m_aAutoRotate = new QAction( tr( "Auto rotate images" ), Resource::loadIconSet( "rotate" ), 0, 0, this, 0, true ); 543 m_aAutoRotate = new QAction( tr( "Auto rotate images" ), Resource::loadIconSet( "rotate" ), 0, 0, this, 0, true );
525 m_aAutoRotate->setToggleAction(true); 544 m_aAutoRotate->setToggleAction(true);
@@ -568,9 +587,9 @@ void PMainWindow::setupToolbar()
568 m_aBeam->addTo( toolBar ); 587 m_aBeam->addTo( toolBar );
569 } 588 }
570 m_aShowInfo->addTo(toolBar); 589 m_aShowInfo->addTo(toolBar);
571 m_aTrash->addTo(toolBar); 590 m_aTrash->addTo(toolBar);
572 m_aSetup->addTo(toolBar); 591// m_aSetup->addTo(toolBar);
573 592
574 m_gDisplayType->addTo(toolBar); 593 m_gDisplayType->addTo(toolBar);
575 594
576 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 595 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
@@ -585,8 +604,10 @@ void PMainWindow::setupMenu()
585 fileMenu = new QPopupMenu( menuBar() ); 604 fileMenu = new QPopupMenu( menuBar() );
586 menuBar()->insertItem( tr( "File" ), fileMenu ); 605 menuBar()->insertItem( tr( "File" ), fileMenu );
587 dispMenu = new QPopupMenu( menuBar() ); 606 dispMenu = new QPopupMenu( menuBar() );
588 menuBar()->insertItem( tr( "Show" ), dispMenu ); 607 menuBar()->insertItem( tr( "Show" ), dispMenu );
608 settingsMenu = new QPopupMenu( menuBar() );
609 menuBar()->insertItem( tr( "Settings" ), settingsMenu );
589 610
590 m_aViewfile->addTo(fileMenu); 611 m_aViewfile->addTo(fileMenu);
591 m_aShowInfo->addTo(fileMenu); 612 m_aShowInfo->addTo(fileMenu);
592 m_aStartSlide->addTo(fileMenu); 613 m_aStartSlide->addTo(fileMenu);
@@ -603,20 +624,21 @@ void PMainWindow::setupMenu()
603 fileMenu->insertSeparator(); 624 fileMenu->insertSeparator();
604 m_aBeam->addTo( fileMenu ); 625 m_aBeam->addTo( fileMenu );
605 } 626 }
606 fileMenu->insertSeparator(); 627 fileMenu->insertSeparator();
607 m_aSetup->addTo(fileMenu);
608 m_aTrash->addTo(fileMenu); 628 m_aTrash->addTo(fileMenu);
609 629
610 m_aHideToolbar->addTo(dispMenu);
611 listviewMenu = new QPopupMenu(dispMenu); 630 listviewMenu = new QPopupMenu(dispMenu);
612 dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); 631 dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu);
613 m_gListViewMode->addTo(listviewMenu); 632 m_gListViewMode->addTo(listviewMenu);
614 dispMenu->insertSeparator(); 633 dispMenu->insertSeparator();
615 m_aFullScreen->addTo(dispMenu); 634 m_aFullScreen->addTo(dispMenu);
616 m_gDisplayType->addTo(dispMenu); 635 m_gDisplayType->addTo(dispMenu);
617 dispMenu->insertSeparator(); 636 dispMenu->insertSeparator();
618 m_gPrevNext->addTo(dispMenu); 637 m_gPrevNext->addTo(dispMenu);
638
639 m_aSetup->addTo(settingsMenu);
640 m_aHideToolbar->addTo(settingsMenu);
619} 641}
620 642
621void PMainWindow::listviewselected(QAction*which) 643void PMainWindow::listviewselected(QAction*which)
622{ 644{
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 65151fc..703965b 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -63,13 +63,15 @@ protected slots:
63 void raiseIconView(); 63 void raiseIconView();
64 void closeEvent( QCloseEvent* ); 64 void closeEvent( QCloseEvent* );
65 void showToolbar(bool); 65 void showToolbar(bool);
66 void listviewselected(QAction*); 66 void listviewselected(QAction*);
67 void slotFullScreenButton(bool);
67 68
68private: 69private:
69 template<class T> void initT( const char* name, T**, int ); 70 template<class T> void initT( const char* name, T**, int );
70 void initInfo(); 71 void initInfo();
71 void initDisp(); 72 void initDisp();
73 void setupViewWindow(bool full, bool forceDisplay);
72 74
73private: 75private:
74 Opie::Core::OConfig *m_cfg; 76 Opie::Core::OConfig *m_cfg;
75 Opie::Ui::OWidgetStack *m_stack; 77 Opie::Ui::OWidgetStack *m_stack;
@@ -80,9 +82,9 @@ private:
80 bool autoScale; 82 bool autoScale;
81 bool zoomerOn; 83 bool zoomerOn;
82 QToolButton*fsButton; 84 QToolButton*fsButton;
83 QToolBar *toolBar; 85 QToolBar *toolBar;
84 QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu; 86 QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu;
85 QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide; 87 QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide;
86 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; 88 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong;
87 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; 89 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup;
88 QAction *m_aNext,*m_aPrevious,*m_aFullScreen; 90 QAction *m_aNext,*m_aPrevious,*m_aFullScreen;