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
@@ -94,2 +94,16 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
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
@@ -101,2 +115,21 @@ PMainWindow::~PMainWindow() {
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
@@ -182,2 +215,7 @@ 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}
@@ -200,4 +238,5 @@ void PMainWindow::slotShowInfo( const QString& inf ) {
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 );