Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index dd9cced..f63b5a1 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -1,24 +1,25 @@ | |||
1 | /* | 1 | /* |
2 | * GPLv2 zecke@handhelds.org | 2 | * GPLv2 zecke@handhelds.org |
3 | * No WArranty... | 3 | * No WArranty... |
4 | */ | 4 | */ |
5 | #include "mainwindow.h" | 5 | #include "mainwindow.h" |
6 | 6 | ||
7 | #include "iconview.h" | 7 | #include "iconview.h" |
8 | #include "filesystem.h" | 8 | #include "filesystem.h" |
9 | #include "imageinfoui.h" | 9 | #include "imageinfoui.h" |
10 | #include "imageview.h" | 10 | #include "imageview.h" |
11 | #if 0 | ||
11 | #include "viewmodebutton.h" | 12 | #include "viewmodebutton.h" |
12 | 13 | #endif | |
13 | #include <iface/ifaceinfo.h> | 14 | #include <iface/ifaceinfo.h> |
14 | #include <iface/dirview.h> | 15 | #include <iface/dirview.h> |
15 | 16 | ||
16 | #include <opie2/odebug.h> | 17 | #include <opie2/odebug.h> |
17 | #include <opie2/owidgetstack.h> | 18 | #include <opie2/owidgetstack.h> |
18 | #include <opie2/oapplicationfactory.h> | 19 | #include <opie2/oapplicationfactory.h> |
19 | #include <opie2/otabwidget.h> | 20 | #include <opie2/otabwidget.h> |
20 | #include <opie2/okeyconfigwidget.h> | 21 | #include <opie2/okeyconfigwidget.h> |
21 | 22 | ||
22 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
23 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
24 | #include <qpe/ir.h> | 25 | #include <qpe/ir.h> |
@@ -53,24 +54,26 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
53 | 54 | ||
54 | m_stack = new Opie::Ui::OWidgetStack( this ); | 55 | m_stack = new Opie::Ui::OWidgetStack( this ); |
55 | setCentralWidget( m_stack ); | 56 | setCentralWidget( m_stack ); |
56 | 57 | ||
57 | m_view = new PIconView( m_stack, m_cfg ); | 58 | m_view = new PIconView( m_stack, m_cfg ); |
58 | m_stack->addWidget( m_view, IconView ); | 59 | m_stack->addWidget( m_view, IconView ); |
59 | m_stack->raiseWidget( IconView ); | 60 | m_stack->raiseWidget( IconView ); |
60 | connect(m_view, SIGNAL(sig_display(const QString&)), | 61 | connect(m_view, SIGNAL(sig_display(const QString&)), |
61 | this, SLOT(slotDisplay(const QString&))); | 62 | this, SLOT(slotDisplay(const QString&))); |
62 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), | 63 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), |
63 | this, SLOT(slotShowInfo(const QString&)) ); | 64 | this, SLOT(slotShowInfo(const QString&)) ); |
64 | 65 | ||
66 | m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); | ||
67 | |||
65 | QToolButton *btn = new QToolButton( bar ); | 68 | QToolButton *btn = new QToolButton( bar ); |
66 | btn->setIconSet( Resource::loadIconSet( "up" ) ); | 69 | btn->setIconSet( Resource::loadIconSet( "up" ) ); |
67 | connect( btn, SIGNAL(clicked()), | 70 | connect( btn, SIGNAL(clicked()), |
68 | m_view, SLOT(slotDirUp()) ); | 71 | m_view, SLOT(slotDirUp()) ); |
69 | 72 | ||
70 | btn = new PFileSystem( bar ); | 73 | btn = new PFileSystem( bar ); |
71 | connect( btn, SIGNAL( changeDir( const QString& ) ), | 74 | connect( btn, SIGNAL( changeDir( const QString& ) ), |
72 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | 75 | m_view, SLOT(slotChangeDir( const QString& ) ) ); |
73 | 76 | ||
74 | btn = new QToolButton( bar ); | 77 | btn = new QToolButton( bar ); |
75 | btn->setIconSet( Resource::loadIconSet( "edit" ) ); | 78 | btn->setIconSet( Resource::loadIconSet( "edit" ) ); |
76 | connect( btn, SIGNAL(clicked()), | 79 | connect( btn, SIGNAL(clicked()), |
@@ -79,39 +82,48 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
79 | if ( Ir::supported() ) { | 82 | if ( Ir::supported() ) { |
80 | btn = new QToolButton( bar ); | 83 | btn = new QToolButton( bar ); |
81 | btn->setIconSet( Resource::loadIconSet( "beam" ) ); | 84 | btn->setIconSet( Resource::loadIconSet( "beam" ) ); |
82 | connect( btn, SIGNAL(clicked()), | 85 | connect( btn, SIGNAL(clicked()), |
83 | m_view, SLOT(slotBeam()) ); | 86 | m_view, SLOT(slotBeam()) ); |
84 | } | 87 | } |
85 | 88 | ||
86 | btn = new QToolButton( bar ); | 89 | btn = new QToolButton( bar ); |
87 | btn->setIconSet( Resource::loadIconSet( "trash" ) ); | 90 | btn->setIconSet( Resource::loadIconSet( "trash" ) ); |
88 | connect( btn, SIGNAL(clicked() ), | 91 | connect( btn, SIGNAL(clicked() ), |
89 | m_view, SLOT(slotTrash() ) ); | 92 | m_view, SLOT(slotTrash() ) ); |
90 | 93 | ||
94 | #if 0 | ||
91 | btn = new ViewModeButton( bar ); | 95 | btn = new ViewModeButton( bar ); |
92 | connect( btn, SIGNAL(changeMode(int)), | 96 | connect( btn, SIGNAL(changeMode(int)), |
93 | m_view, SLOT(slotChangeMode(int))); | 97 | m_view, SLOT(slotChangeMode(int))); |
94 | 98 | #endif | |
95 | btn = new QToolButton( bar ); | 99 | btn = new QToolButton( bar ); |
96 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); | 100 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); |
97 | connect( btn, SIGNAL(clicked() ), | 101 | connect( btn, SIGNAL(clicked() ), |
98 | this, SLOT(slotConfig() ) ); | 102 | this, SLOT(slotConfig() ) ); |
99 | 103 | ||
100 | rotateButton = new QToolButton(bar); | 104 | rotateButton = new QToolButton(bar); |
101 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); | 105 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); |
102 | rotateButton->setToggleButton(true); | 106 | rotateButton->setToggleButton(true); |
103 | rotateButton->setOn(true); | 107 | |
108 | odebug << "Mode = " << m_stack->mode() << oendl; | ||
109 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | ||
110 | rotateButton->setOn(true); | ||
111 | autoRotate = true; | ||
112 | } else { | ||
113 | rotateButton->setOn(false); | ||
114 | autoRotate = false; | ||
115 | } | ||
116 | |||
104 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); | 117 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); |
105 | autoRotate = true; | ||
106 | 118 | ||
107 | btn = new QToolButton(bar); | 119 | btn = new QToolButton(bar); |
108 | btn->setIconSet( Resource::loadIconSet( "1to1" ) ); | 120 | btn->setIconSet( Resource::loadIconSet( "1to1" ) ); |
109 | btn->setToggleButton(true); | 121 | btn->setToggleButton(true); |
110 | btn->setOn(false); | 122 | btn->setOn(false); |
111 | connect(btn,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); | 123 | connect(btn,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); |
112 | autoScale = true; | 124 | autoScale = true; |
113 | 125 | ||
114 | btn = new QToolButton(bar); | 126 | btn = new QToolButton(bar); |
115 | btn->setIconSet( Resource::loadIconSet( "mag" ) ); | 127 | btn->setIconSet( Resource::loadIconSet( "mag" ) ); |
116 | btn->setToggleButton(true); | 128 | btn->setToggleButton(true); |
117 | btn->setOn(true); | 129 | btn->setOn(true); |
@@ -239,24 +251,27 @@ void PMainWindow::initT( const char* name, T** ptr, int id) { | |||
239 | 251 | ||
240 | connect(*ptr, SIGNAL(sig_return()), | 252 | connect(*ptr, SIGNAL(sig_return()), |
241 | this,SLOT(slotReturn())); | 253 | this,SLOT(slotReturn())); |
242 | 254 | ||
243 | } | 255 | } |
244 | void PMainWindow::initInfo() { | 256 | void PMainWindow::initInfo() { |
245 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); | 257 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); |
246 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); | 258 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); |
247 | } | 259 | } |
248 | void PMainWindow::initDisp() { | 260 | void PMainWindow::initDisp() { |
249 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); | 261 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); |
250 | if (m_disp) { | 262 | if (m_disp) { |
263 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | ||
264 | m_disp->setMinimumSize(QApplication::desktop()->size()/2); | ||
265 | } | ||
251 | m_disp->setAutoScale(autoScale); | 266 | m_disp->setAutoScale(autoScale); |
252 | m_disp->setAutoRotate(autoRotate); | 267 | m_disp->setAutoRotate(autoRotate); |
253 | m_disp->setShowZoomer(zoomerOn); | 268 | m_disp->setShowZoomer(zoomerOn); |
254 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); | 269 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); |
255 | } | 270 | } |
256 | } | 271 | } |
257 | 272 | ||
258 | /** | 273 | /** |
259 | * With big Screen the plan could be to 'detach' the image | 274 | * With big Screen the plan could be to 'detach' the image |
260 | * window if visible and to create a ne wone | 275 | * window if visible and to create a ne wone |
261 | * init* already supports it but I make no use of it for | 276 | * init* already supports it but I make no use of it for |
262 | * now. We set filename and raise | 277 | * now. We set filename and raise |