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 | 41 |
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 | |||
@@ -92,6 +92,20 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
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 | ||
@@ -99,6 +113,25 @@ PMainWindow::~PMainWindow() { | |||
99 | odebug << "Shutting down" << oendl; | 113 | odebug << "Shutting down" << oendl; |
100 | } | 114 | } |
101 | 115 | ||
116 | void PMainWindow::slotRotateToggled(bool how) | ||
117 | { | ||
118 | autoRotate = how; | ||
119 | if (m_disp) { | ||
120 | m_disp->setAutoRotate(how); | ||
121 | } | ||
122 | } | ||
123 | |||
124 | void 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 | ||
103 | void PMainWindow::slotConfig() { | 136 | void PMainWindow::slotConfig() { |
104 | /* | 137 | /* |
@@ -180,6 +213,11 @@ void PMainWindow::initInfo() { | |||
180 | } | 213 | } |
181 | void PMainWindow::initDisp() { | 214 | void 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 | /** |
@@ -198,8 +236,9 @@ void PMainWindow::slotShowInfo( const QString& inf ) { | |||
198 | } | 236 | } |
199 | 237 | ||
200 | void PMainWindow::slotDisplay( const QString& inf ) { | 238 | void 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 | } |