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 | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 88acd59..5e94f93 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -15,13 +15,12 @@ | |||
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/owidgetstack.h> | 16 | #include <opie2/owidgetstack.h> |
17 | #include <opie2/oapplicationfactory.h> | 17 | #include <opie2/oapplicationfactory.h> |
18 | #include <opie2/otabwidget.h> | 18 | #include <opie2/otabwidget.h> |
19 | #include <opie2/okeyconfigwidget.h> | 19 | #include <opie2/okeyconfigwidget.h> |
20 | 20 | ||
21 | |||
22 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
23 | #include <qpe/config.h> | 22 | #include <qpe/config.h> |
24 | #include <qpe/ir.h> | 23 | #include <qpe/ir.h> |
25 | 24 | ||
26 | #include <qtoolbar.h> | 25 | #include <qtoolbar.h> |
27 | #include <qtoolbutton.h> | 26 | #include <qtoolbutton.h> |
@@ -30,22 +29,21 @@ | |||
30 | #include <qmap.h> | 29 | #include <qmap.h> |
31 | #include <qtimer.h> | 30 | #include <qtimer.h> |
32 | 31 | ||
33 | 32 | ||
34 | 33 | ||
35 | 34 | ||
36 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow> ) | 35 | OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) |
37 | 36 | ||
38 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 37 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
39 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) | 38 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) |
40 | { | 39 | { |
41 | setCaption( QObject::tr("Opie Eye Caramba" ) ); | 40 | setCaption( QObject::tr("Opie Eye Caramba" ) ); |
42 | m_cfg = new Opie::Core::OConfig("phunkview"); | 41 | m_cfg = new Opie::Core::OConfig("phunkview"); |
43 | m_cfg->setGroup("Zecke_view" ); | 42 | m_cfg->setGroup("Zecke_view" ); |
44 | 43 | // qDebug( "Process-wide OApplication object @ %0x", oApp ); | |
45 | |||
46 | /* | 44 | /* |
47 | * Initialize ToolBar and IconView | 45 | * Initialize ToolBar and IconView |
48 | * And Connect Them | 46 | * And Connect Them |
49 | */ | 47 | */ |
50 | QToolBar *bar = new QToolBar( this ); | 48 | QToolBar *bar = new QToolBar( this ); |
51 | bar->setHorizontalStretchable( true ); | 49 | bar->setHorizontalStretchable( true ); |
@@ -89,13 +87,13 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
89 | m_view, SLOT(slotTrash() ) ); | 87 | m_view, SLOT(slotTrash() ) ); |
90 | 88 | ||
91 | btn = new QToolButton( bar ); | 89 | btn = new QToolButton( bar ); |
92 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); | 90 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); |
93 | connect( btn, SIGNAL(clicked() ), | 91 | connect( btn, SIGNAL(clicked() ), |
94 | this, SLOT(slotConfig() ) ); | 92 | this, SLOT(slotConfig() ) ); |
95 | 93 | ||
96 | rotateButton = new QToolButton(bar); | 94 | rotateButton = new QToolButton(bar); |
97 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); | 95 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); |
98 | rotateButton->setToggleButton(true); | 96 | rotateButton->setToggleButton(true); |
99 | rotateButton->setOn(true); | 97 | rotateButton->setOn(true); |
100 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); | 98 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); |
101 | autoRotate = true; | 99 | autoRotate = true; |
@@ -161,12 +159,16 @@ void PMainWindow::slotConfig() { | |||
161 | /* | 159 | /* |
162 | * Add the KeyConfigWidget | 160 | * Add the KeyConfigWidget |
163 | */ | 161 | */ |
164 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 162 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
165 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 163 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
166 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 164 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
165 | if ( !m_info ) { | ||
166 | initInfo(); | ||
167 | } | ||
168 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); | ||
167 | keyWid->load(); | 169 | keyWid->load(); |
168 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 170 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
169 | 171 | ||
170 | 172 | ||
171 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 173 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
172 | 174 | ||
@@ -207,12 +209,13 @@ void PMainWindow::initT( const char* name, T** ptr, int id) { | |||
207 | connect(*ptr, SIGNAL(sig_return()), | 209 | connect(*ptr, SIGNAL(sig_return()), |
208 | this,SLOT(slotReturn())); | 210 | this,SLOT(slotReturn())); |
209 | 211 | ||
210 | } | 212 | } |
211 | void PMainWindow::initInfo() { | 213 | void PMainWindow::initInfo() { |
212 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); | 214 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); |
215 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); | ||
213 | } | 216 | } |
214 | void PMainWindow::initDisp() { | 217 | void PMainWindow::initDisp() { |
215 | initT<ImageScrollView>( "Image ScrollView", &m_disp, ImageDisplay ); | 218 | initT<ImageScrollView>( "Image ScrollView", &m_disp, ImageDisplay ); |
216 | if (m_disp) { | 219 | if (m_disp) { |
217 | m_disp->setAutoScale(autoScale); | 220 | m_disp->setAutoScale(autoScale); |
218 | m_disp->setAutoRotate(autoRotate); | 221 | m_disp->setAutoRotate(autoRotate); |
@@ -226,14 +229,15 @@ void PMainWindow::initDisp() { | |||
226 | * init* already supports it but I make no use of it for | 229 | * init* already supports it but I make no use of it for |
227 | * now. We set filename and raise | 230 | * now. We set filename and raise |
228 | * | 231 | * |
229 | * ### FIXME and talk to alwin | 232 | * ### FIXME and talk to alwin |
230 | */ | 233 | */ |
231 | void PMainWindow::slotShowInfo( const QString& inf ) { | 234 | void PMainWindow::slotShowInfo( const QString& inf ) { |
232 | if ( !m_info ) | 235 | if ( !m_info ) { |
233 | initInfo(); | 236 | initInfo(); |
237 | } | ||
234 | m_info->setPath( inf ); | 238 | m_info->setPath( inf ); |
235 | m_stack->raiseWidget( ImageInfo ); | 239 | m_stack->raiseWidget( ImageInfo ); |
236 | } | 240 | } |
237 | 241 | ||
238 | void PMainWindow::slotDisplay( const QString& inf ) { | 242 | void PMainWindow::slotDisplay( const QString& inf ) { |
239 | if ( !m_disp ) { | 243 | if ( !m_disp ) { |