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.cpp43
1 files changed, 35 insertions, 8 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 57be247..6f3f255 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -61,22 +61,22 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
61 this, SLOT(slotDisplay(const QString&))); 61 this, SLOT(slotDisplay(const QString&)));
62 connect(m_view, SIGNAL(sig_showInfo(const QString&)), 62 connect(m_view, SIGNAL(sig_showInfo(const QString&)),
63 this, SLOT(slotShowInfo(const QString&)) ); 63 this, SLOT(slotShowInfo(const QString&)) );
64 64
65 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); 65 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce);
66 66
67 QToolButton *btn = new QToolButton( bar ); 67 upButton = new QToolButton( bar );
68 btn->setIconSet( Resource::loadIconSet( "up" ) ); 68 upButton->setIconSet( Resource::loadIconSet( "up" ) );
69 connect( btn, SIGNAL(clicked()), 69 connect( upButton, SIGNAL(clicked()),
70 m_view, SLOT(slotDirUp()) ); 70 m_view, SLOT(slotDirUp()) );
71 71
72 btn = new PFileSystem( bar ); 72 fsButton = new PFileSystem( bar );
73 connect( btn, SIGNAL( changeDir( const QString& ) ), 73 connect( fsButton, SIGNAL( changeDir( const QString& ) ),
74 m_view, SLOT(slotChangeDir( const QString& ) ) ); 74 m_view, SLOT(slotChangeDir( const QString& ) ) );
75 75
76 btn = new QToolButton( bar ); 76 QToolButton*btn = new QToolButton( bar );
77 btn->setIconSet( Resource::loadIconSet( "edit" ) ); 77 btn->setIconSet( Resource::loadIconSet( "edit" ) );
78 connect( btn, SIGNAL(clicked()), 78 connect( btn, SIGNAL(clicked()),
79 m_view, SLOT(slotRename()) ); 79 m_view, SLOT(slotRename()) );
80 80
81 if ( Ir::supported() ) { 81 if ( Ir::supported() ) {
82 btn = new QToolButton( bar ); 82 btn = new QToolButton( bar );
@@ -88,21 +88,33 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
88 btn = new QToolButton( bar ); 88 btn = new QToolButton( bar );
89 btn->setIconSet( Resource::loadIconSet( "trash" ) ); 89 btn->setIconSet( Resource::loadIconSet( "trash" ) );
90 connect( btn, SIGNAL(clicked() ), 90 connect( btn, SIGNAL(clicked() ),
91 m_view, SLOT(slotTrash() ) ); 91 m_view, SLOT(slotTrash() ) );
92 92
93 93
94 btn = new ViewModeButton( bar ); 94 viewModeButton = new ViewModeButton( bar );
95 connect( btn, SIGNAL(changeMode(int)), 95 connect( viewModeButton, SIGNAL(changeMode(int)),
96 m_view, SLOT(slotChangeMode(int))); 96 m_view, SLOT(slotChangeMode(int)));
97 97
98 btn = new QToolButton( bar ); 98 btn = new QToolButton( bar );
99 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); 99 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) );
100 connect( btn, SIGNAL(clicked() ), 100 connect( btn, SIGNAL(clicked() ),
101 this, SLOT(slotConfig() ) ); 101 this, SLOT(slotConfig() ) );
102 102
103
104
105 prevButton = new QToolButton(bar);
106 prevButton->setIconSet( Resource::loadIconSet( "back" ) );
107 connect(prevButton,SIGNAL(clicked()),m_view,SLOT(slotShowPrev()));
108 prevButton->hide();
109
110 nextButton = new QToolButton(bar);
111 nextButton->setIconSet( Resource::loadIconSet( "forward" ) );
112 connect(nextButton,SIGNAL(clicked()),m_view,SLOT(slotShowNext()));
113 nextButton->hide();
114
103 rotateButton = new QToolButton(bar); 115 rotateButton = new QToolButton(bar);
104 rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); 116 rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) );
105 rotateButton->setToggleButton(true); 117 rotateButton->setToggleButton(true);
106 118
107 odebug << "Mode = " << m_stack->mode() << oendl; 119 odebug << "Mode = " << m_stack->mode() << oendl;
108 if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { 120 if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) {
@@ -281,20 +293,30 @@ void PMainWindow::initDisp() {
281 */ 293 */
282void PMainWindow::slotShowInfo( const QString& inf ) { 294void PMainWindow::slotShowInfo( const QString& inf ) {
283 if ( !m_info ) { 295 if ( !m_info ) {
284 initInfo(); 296 initInfo();
285 } 297 }
286 m_info->setPath( inf ); 298 m_info->setPath( inf );
299 prevButton->hide();
300 nextButton->hide();
301 upButton->hide();
302 fsButton->hide();
303 viewModeButton->hide();
287 m_stack->raiseWidget( ImageInfo ); 304 m_stack->raiseWidget( ImageInfo );
288} 305}
289 306
290void PMainWindow::slotDisplay( const QString& inf ) { 307void PMainWindow::slotDisplay( const QString& inf ) {
291 if ( !m_disp ) { 308 if ( !m_disp ) {
292 initDisp(); 309 initDisp();
293 } 310 }
294 m_disp->setImage( inf ); 311 m_disp->setImage( inf );
312 prevButton->show();
313 nextButton->show();
314 upButton->hide();
315 fsButton->hide();
316 viewModeButton->hide();
295 m_stack->raiseWidget( ImageDisplay ); 317 m_stack->raiseWidget( ImageDisplay );
296} 318}
297 319
298void PMainWindow::slotReturn() { 320void PMainWindow::slotReturn() {
299 raiseIconView(); 321 raiseIconView();
300} 322}
@@ -313,12 +335,17 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) {
313 } 335 }
314 ev->accept(); 336 ev->accept();
315 QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); 337 QTimer::singleShot(0, qApp, SLOT(closeAllWindows()));
316} 338}
317 339
318void PMainWindow::raiseIconView() { 340void PMainWindow::raiseIconView() {
341 prevButton->hide();
342 nextButton->hide();
343 upButton->show();
344 fsButton->show();
345 viewModeButton->show();
319 m_stack->raiseWidget( IconView ); 346 m_stack->raiseWidget( IconView );
320} 347}
321 348
322void PMainWindow::setDocument( const QString& showImg ) { 349void PMainWindow::setDocument( const QString& showImg ) {
323 QString file = showImg; 350 QString file = showImg;
324 DocLnk lnk(showImg); 351 DocLnk lnk(showImg);