summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/mainwindow.cpp
Unidiff
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.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 7f384bd..88acd59 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -89,19 +89,52 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
89 m_view, SLOT(slotTrash() ) ); 89 m_view, SLOT(slotTrash() ) );
90 90
91 btn = new QToolButton( bar ); 91 btn = new QToolButton( bar );
92 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); 92 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) );
93 connect( btn, SIGNAL(clicked() ), 93 connect( btn, SIGNAL(clicked() ),
94 this, SLOT(slotConfig() ) ); 94 this, SLOT(slotConfig() ) );
95
96 rotateButton = new QToolButton(bar);
97 rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) );
98 rotateButton->setToggleButton(true);
99 rotateButton->setOn(true);
100 connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool)));
101 autoRotate = true;
102
103 btn = new QToolButton(bar);
104 btn->setIconSet( Resource::loadIconSet( "1to1" ) );
105 btn->setToggleButton(true);
106 btn->setOn(false);
107 connect(btn,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool)));
108 autoScale = true;
95 109
96} 110}
97 111
98PMainWindow::~PMainWindow() { 112PMainWindow::~PMainWindow() {
99 odebug << "Shutting down" << oendl; 113 odebug << "Shutting down" << oendl;
100} 114}
101 115
116void PMainWindow::slotRotateToggled(bool how)
117{
118 autoRotate = how;
119 if (m_disp) {
120 m_disp->setAutoRotate(how);
121 }
122}
123
124void PMainWindow::slotScaleToggled(bool how)
125{
126 autoScale = !how;
127 if (m_disp) {
128 m_disp->setAutoScale(autoScale);
129 }
130 if (!autoScale && autoRotate) {
131 rotateButton->setOn(false);
132 }
133 rotateButton->setEnabled(!how);
134}
102 135
103void PMainWindow::slotConfig() { 136void PMainWindow::slotConfig() {
104 /* 137 /*
105 * have a tab with the possible views 138 * have a tab with the possible views
106 * a tab for globals image cache size.. scaled loading 139 * a tab for globals image cache size.. scaled loading
107 * and one tab for the KeyConfigs 140 * and one tab for the KeyConfigs
@@ -177,12 +210,17 @@ void PMainWindow::initT( const char* name, T** ptr, int id) {
177} 210}
178void PMainWindow::initInfo() { 211void PMainWindow::initInfo() {
179 initT<imageinfo>( "Image Info", &m_info, ImageInfo ); 212 initT<imageinfo>( "Image Info", &m_info, ImageInfo );
180} 213}
181void PMainWindow::initDisp() { 214void PMainWindow::initDisp() {
182 initT<ImageScrollView>( "Image ScrollView", &m_disp, ImageDisplay ); 215 initT<ImageScrollView>( "Image ScrollView", &m_disp, ImageDisplay );
216 if (m_disp) {
217 m_disp->setAutoScale(autoScale);
218 m_disp->setAutoRotate(autoRotate);
219 }
220
183} 221}
184 222
185/** 223/**
186 * With big Screen the plan could be to 'detach' the image 224 * With big Screen the plan could be to 'detach' the image
187 * window if visible and to create a ne wone 225 * window if visible and to create a ne wone
188 * init* already supports it but I make no use of it for 226 * init* already supports it but I make no use of it for
@@ -195,14 +233,15 @@ void PMainWindow::slotShowInfo( const QString& inf ) {
195 initInfo(); 233 initInfo();
196 m_info->setPath( inf ); 234 m_info->setPath( inf );
197 m_stack->raiseWidget( ImageInfo ); 235 m_stack->raiseWidget( ImageInfo );
198} 236}
199 237
200void PMainWindow::slotDisplay( const QString& inf ) { 238void PMainWindow::slotDisplay( const QString& inf ) {
201 if ( !m_disp ) 239 if ( !m_disp ) {
202 initDisp(); 240 initDisp();
241 }
203 m_disp->setImage( inf ); 242 m_disp->setImage( inf );
204 m_stack->raiseWidget( ImageDisplay ); 243 m_stack->raiseWidget( ImageDisplay );
205} 244}
206 245
207void PMainWindow::slotReturn() { 246void PMainWindow::slotReturn() {
208 raiseIconView(); 247 raiseIconView();