Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 173 |
1 files changed, 138 insertions, 35 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 3c946b6..a1349a8 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -13,142 +13,202 @@ | |||
13 | #include <iface/ifaceinfo.h> | 13 | #include <iface/ifaceinfo.h> |
14 | #include <iface/dirview.h> | 14 | #include <iface/dirview.h> |
15 | 15 | ||
16 | #include <opie2/odebug.h> | 16 | #include <opie2/odebug.h> |
17 | #include <opie2/owidgetstack.h> | 17 | #include <opie2/owidgetstack.h> |
18 | #include <opie2/oapplicationfactory.h> | 18 | #include <opie2/oapplicationfactory.h> |
19 | #include <opie2/otabwidget.h> | 19 | #include <opie2/otabwidget.h> |
20 | #include <opie2/okeyconfigwidget.h> | 20 | #include <opie2/okeyconfigwidget.h> |
21 | 21 | ||
22 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/ir.h> | 24 | #include <qpe/ir.h> |
25 | #include <qpe/storage.h> | ||
25 | #include <qpe/applnk.h> | 26 | #include <qpe/applnk.h> |
26 | 27 | ||
27 | #include <qtoolbar.h> | 28 | #include <qtoolbar.h> |
28 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
29 | #include <qlayout.h> | 30 | #include <qlayout.h> |
30 | #include <qdialog.h> | 31 | #include <qdialog.h> |
31 | #include <qmap.h> | 32 | #include <qmap.h> |
32 | #include <qtimer.h> | 33 | #include <qtimer.h> |
33 | #include <qframe.h> | 34 | #include <qframe.h> |
34 | 35 | #include <qmenubar.h> | |
36 | #include <qaction.h> | ||
35 | 37 | ||
36 | //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) | 38 | //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) |
37 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) | 39 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) |
38 | 40 | ||
39 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 41 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
40 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) | 42 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) |
41 | { | 43 | { |
42 | setCaption( QObject::tr("Opie Eye Caramba" ) ); | 44 | setCaption( QObject::tr("Opie Eye Caramba" ) ); |
43 | m_cfg = new Opie::Core::OConfig("phunkview"); | 45 | m_cfg = new Opie::Core::OConfig("phunkview"); |
44 | m_cfg->setGroup("Zecke_view" ); | 46 | m_cfg->setGroup("Zecke_view" ); |
47 | |||
48 | m_storage = new StorageInfo(); | ||
49 | connect(m_storage, SIGNAL(disksChanged() ), | ||
50 | this, SLOT( dirChanged() ) ); | ||
51 | |||
45 | /* | 52 | /* |
46 | * Initialize ToolBar and IconView | 53 | * Initialize ToolBar and IconView |
47 | * And Connect Them | 54 | * And Connect Them |
48 | */ | 55 | */ |
49 | QToolBar *bar = new QToolBar( this ); | 56 | toolBar = new QToolBar( this ); |
50 | bar->setHorizontalStretchable( true ); | 57 | menuBar = new QMenuBar( this ); |
58 | fileMenu = new QPopupMenu( menuBar ); | ||
59 | menuBar->insertItem( tr( "File" ), fileMenu ); | ||
60 | dispMenu = new QPopupMenu( menuBar ); | ||
61 | menuBar->insertItem( tr( "Show" ), dispMenu ); | ||
62 | |||
63 | addToolBar(toolBar); | ||
64 | toolBar->setHorizontalStretchable( true ); | ||
51 | setToolBarsMovable( false ); | 65 | setToolBarsMovable( false ); |
52 | 66 | ||
53 | m_stack = new Opie::Ui::OWidgetStack( this ); | 67 | m_stack = new Opie::Ui::OWidgetStack( this ); |
54 | setCentralWidget( m_stack ); | 68 | setCentralWidget( m_stack ); |
55 | 69 | ||
56 | m_view = new PIconView( m_stack, m_cfg ); | 70 | m_view = new PIconView( m_stack, m_cfg ); |
57 | m_stack->addWidget( m_view, IconView ); | 71 | m_stack->addWidget( m_view, IconView ); |
58 | m_stack->raiseWidget( IconView ); | 72 | m_stack->raiseWidget( IconView ); |
73 | |||
59 | connect(m_view, SIGNAL(sig_display(const QString&)), | 74 | connect(m_view, SIGNAL(sig_display(const QString&)), |
60 | this, SLOT(slotDisplay(const QString&))); | 75 | this, SLOT(slotDisplay(const QString&))); |
61 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), | 76 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), |
62 | this, SLOT(slotShowInfo(const QString&)) ); | 77 | this, SLOT(slotShowInfo(const QString&)) ); |
63 | 78 | ||
64 | m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); | 79 | m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); |
65 | 80 | ||
66 | upButton = new QToolButton( bar ); | 81 | m_aDirUp = new QAction( tr( "Go dir up" ), Resource::loadIconSet( "up" ), |
67 | upButton->setIconSet( Resource::loadIconSet( "up" ) ); | 82 | 0, 0, this, 0, true ); |
68 | connect( upButton, SIGNAL(clicked()), | 83 | m_aDirUp->setToggleAction(false); |
69 | m_view, SLOT(slotDirUp()) ); | 84 | connect(m_aDirUp,SIGNAL(activated()),m_view,SLOT(slotDirUp())); |
85 | m_aDirUp->addTo( toolBar ); | ||
86 | |||
87 | QToolButton*btn; | ||
70 | 88 | ||
71 | fsButton = new PFileSystem( bar ); | 89 | fsButton = new PFileSystem( toolBar ); |
72 | connect( fsButton, SIGNAL( changeDir( const QString& ) ), | 90 | connect( fsButton, SIGNAL( changeDir( const QString& ) ), |
73 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | 91 | m_view, SLOT(slotChangeDir( const QString& ) ) ); |
92 | connect( this, SIGNAL( changeDir( const QString& ) ), | ||
93 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | ||
74 | 94 | ||
75 | QToolButton*btn = new QToolButton( bar ); | 95 | m_aShowInfo = new QAction( tr( "Show imageinfo" ), Resource::loadIconSet( "edit" ), |
76 | btn->setIconSet( Resource::loadIconSet( "edit" ) ); | 96 | 0, 0, this, 0, true ); |
77 | connect( btn, SIGNAL(clicked()), | 97 | m_aShowInfo->setToggleAction(false); |
78 | m_view, SLOT(slotImageInfo()) ); | 98 | connect(m_aShowInfo,SIGNAL(activated()),m_view,SLOT(slotImageInfo())); |
99 | m_aShowInfo->addTo( toolBar ); | ||
79 | 100 | ||
80 | if ( Ir::supported() ) { | 101 | if ( Ir::supported() ) { |
81 | btn = new QToolButton( bar ); | 102 | m_aBeam = new QAction( tr( "Beam file" ), Resource::loadIconSet( "beam" ), |
82 | btn->setIconSet( Resource::loadIconSet( "beam" ) ); | 103 | 0, 0, this, 0, true ); |
83 | connect( btn, SIGNAL(clicked()), | 104 | m_aBeam->setToggleAction(false); |
84 | m_view, SLOT(slotBeam()) ); | 105 | connect(m_aBeam,SIGNAL(activated()),m_view,SLOT(slotBeam())); |
106 | m_aBeam->addTo( toolBar ); | ||
85 | } | 107 | } |
108 | m_aTrash = new QAction( tr( "Delete file" ), Resource::loadIconSet( "trash" ), | ||
109 | 0, 0, this, 0, true ); | ||
110 | m_aTrash->setToggleAction(false); | ||
111 | connect(m_aTrash,SIGNAL(activated()),m_view,SLOT(slotTrash())); | ||
112 | m_aTrash->addTo( toolBar ); | ||
86 | 113 | ||
87 | btn = new QToolButton( bar ); | 114 | m_aViewfile = new QAction( tr( "Display image" ), Resource::loadIconSet( "mag" ), |
88 | btn->setIconSet( Resource::loadIconSet( "trash" ) ); | 115 | 0, 0, this, 0, true ); |
89 | connect( btn, SIGNAL(clicked() ), | 116 | m_aViewfile->setToggleAction(false); |
90 | m_view, SLOT(slotTrash() ) ); | 117 | connect(m_aViewfile,SIGNAL(activated()),m_view,SLOT(slotShowImage())); |
118 | |||
119 | m_aStartSlide = new QAction( tr( "Start slideshow" ), Resource::loadIconSet( "play" ), | ||
120 | 0, 0, this, 0, true ); | ||
121 | m_aStartSlide->setToggleAction(false); | ||
122 | |||
123 | connect(m_aStartSlide,SIGNAL(activated()),m_view,SLOT(slotStartSlide())); | ||
91 | 124 | ||
92 | 125 | ||
93 | int mode = m_cfg->readNumEntry("ListViewMode", 1); | 126 | int mode = m_cfg->readNumEntry("ListViewMode", 1); |
94 | if (mode < 1 || mode>3) mode = 1; | 127 | if (mode < 1 || mode>3) mode = 1; |
95 | viewModeButton = new ViewModeButton( bar,mode ); | 128 | viewModeButton = new ViewModeButton( toolBar,mode ); |
96 | connect( viewModeButton, SIGNAL(changeMode(int)), | 129 | connect( viewModeButton, SIGNAL(changeMode(int)), |
97 | m_view, SLOT(slotChangeMode(int))); | 130 | m_view, SLOT(slotChangeMode(int))); |
98 | 131 | ||
99 | btn = new QToolButton( bar ); | 132 | btn = new QToolButton( toolBar ); |
100 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); | 133 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); |
101 | connect( btn, SIGNAL(clicked() ), | 134 | connect( btn, SIGNAL(clicked() ), |
102 | this, SLOT(slotConfig() ) ); | 135 | this, SLOT(slotConfig() ) ); |
103 | 136 | ||
104 | 137 | prevButton = new QToolButton(toolBar); | |
105 | |||
106 | prevButton = new QToolButton(bar); | ||
107 | prevButton->setIconSet( Resource::loadIconSet( "back" ) ); | 138 | prevButton->setIconSet( Resource::loadIconSet( "back" ) ); |
108 | connect(prevButton,SIGNAL(clicked()),m_view,SLOT(slotShowPrev())); | 139 | connect(prevButton,SIGNAL(clicked()),m_view,SLOT(slotShowPrev())); |
109 | 140 | ||
110 | nextButton = new QToolButton(bar); | 141 | nextButton = new QToolButton(toolBar); |
111 | nextButton->setIconSet( Resource::loadIconSet( "forward" ) ); | 142 | nextButton->setIconSet( Resource::loadIconSet( "forward" ) ); |
112 | connect(nextButton,SIGNAL(clicked()),m_view,SLOT(slotShowNext())); | 143 | connect(nextButton,SIGNAL(clicked()),m_view,SLOT(slotShowNext())); |
113 | 144 | ||
114 | rotateButton = new QToolButton(bar); | 145 | /* filemenu start */ |
146 | m_aViewfile->addTo(fileMenu); | ||
147 | m_aShowInfo->addTo(fileMenu); | ||
148 | m_aStartSlide->addTo(fileMenu); | ||
149 | |||
150 | fileMenu->insertSeparator(); | ||
151 | m_aDirUp->addTo( fileMenu ); | ||
152 | |||
153 | fsMenu = new QPopupMenu(fileMenu); | ||
154 | fileMenu->insertItem(Resource::loadIconSet( "cardmon/pcmcia" ),tr("Select filesystem"),fsMenu); | ||
155 | connect( fsMenu, SIGNAL( activated( int ) ), | ||
156 | this, SLOT(slotSelectDir( int ) ) ); | ||
157 | dirChanged(); | ||
158 | |||
159 | fileMenu->insertSeparator(); | ||
160 | if ( Ir::supported() ) { | ||
161 | m_aBeam->addTo( fileMenu ); | ||
162 | } | ||
163 | fileMenu->insertSeparator(); | ||
164 | m_aTrash->addTo( fileMenu ); | ||
165 | /* filemenu end */ | ||
166 | |||
167 | rotateButton = new QToolButton(toolBar); | ||
115 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); | 168 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); |
116 | rotateButton->setToggleButton(true); | 169 | rotateButton->setToggleButton(true); |
117 | |||
118 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 170 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { |
119 | rotateButton->setOn(true); | 171 | rotateButton->setOn(true); |
120 | autoRotate = true; | 172 | autoRotate = true; |
121 | prevButton->hide(); | 173 | prevButton->hide(); |
122 | nextButton->hide(); | 174 | nextButton->hide(); |
123 | } else { | 175 | } else { |
124 | rotateButton->setOn(false); | 176 | rotateButton->setOn(false); |
125 | autoRotate = false; | 177 | autoRotate = false; |
126 | } | 178 | } |
127 | |||
128 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); | 179 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); |
129 | 180 | ||
130 | scaleButton = new QToolButton(bar); | 181 | scaleButton = new QToolButton(toolBar); |
131 | scaleButton->setIconSet( Resource::loadIconSet( "1to1" ) ); | 182 | scaleButton->setIconSet( Resource::loadIconSet( "1to1" ) ); |
132 | scaleButton->setToggleButton(true); | 183 | scaleButton->setToggleButton(true); |
133 | scaleButton->setOn(false); | 184 | scaleButton->setOn(false); |
134 | connect(scaleButton,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); | 185 | connect(scaleButton,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); |
135 | autoScale = true; | 186 | autoScale = true; |
136 | 187 | ||
137 | zoomButton = new QToolButton(bar); | 188 | zoomButton = new QToolButton(toolBar); |
138 | zoomButton->setIconSet( Resource::loadIconSet( "mag" ) ); | 189 | zoomButton->setIconSet( Resource::loadIconSet( "mag" ) ); |
139 | zoomButton->setToggleButton(true); | 190 | zoomButton->setToggleButton(true); |
140 | zoomButton->setOn(true); | 191 | zoomButton->setOn(true); |
141 | connect(zoomButton,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool))); | 192 | connect(zoomButton,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool))); |
142 | zoomerOn = true; | 193 | zoomerOn = true; |
194 | |||
195 | /* showmenu */ | ||
196 | m_aHideToolbar = new QAction( tr( "Show toolbar" ), Resource::loadIconSet( "UtilsIcon" ), | ||
197 | 0, 0, this, 0, true ); | ||
198 | m_aHideToolbar->setOn (true); | ||
199 | m_aHideToolbar->addTo(dispMenu); | ||
200 | connect(m_aHideToolbar,SIGNAL(toggled(bool)),this,SLOT(showToolbar(bool))); | ||
201 | /* showmenu end*/ | ||
202 | |||
143 | } | 203 | } |
144 | 204 | ||
145 | PMainWindow::~PMainWindow() { | 205 | PMainWindow::~PMainWindow() { |
146 | } | 206 | } |
147 | 207 | ||
148 | void PMainWindow::slotToggleZoomer() | 208 | void PMainWindow::slotToggleZoomer() |
149 | { | 209 | { |
150 | if (!m_disp) return; | 210 | if (!m_disp) return; |
151 | bool cur = zoomButton->isOn(); | 211 | bool cur = zoomButton->isOn(); |
152 | zoomButton->setOn(!cur); | 212 | zoomButton->setOn(!cur); |
153 | } | 213 | } |
154 | 214 | ||
@@ -168,27 +228,28 @@ void PMainWindow::slotToggleAutorotate() | |||
168 | rotateButton->setOn(!cur); | 228 | rotateButton->setOn(!cur); |
169 | } | 229 | } |
170 | 230 | ||
171 | void PMainWindow::slotToggleAutoscale() | 231 | void PMainWindow::slotToggleAutoscale() |
172 | { | 232 | { |
173 | if (!m_disp) return; | 233 | if (!m_disp) return; |
174 | bool cur = scaleButton->isOn(); | 234 | bool cur = scaleButton->isOn(); |
175 | scaleButton->setOn(!cur); | 235 | scaleButton->setOn(!cur); |
176 | } | 236 | } |
177 | 237 | ||
178 | void PMainWindow::slotRotateToggled(bool how) | 238 | void PMainWindow::slotRotateToggled(bool how) |
179 | { | 239 | { |
240 | odebug << "Autorotate: " << how << oendl; | ||
180 | autoRotate = how; | 241 | autoRotate = how; |
181 | if (m_disp) { | 242 | if (m_disp) { |
182 | m_disp->setAutoRotate(how); | 243 | m_disp->setAutoScaleRotate(autoScale,autoRotate); |
183 | } | 244 | } |
184 | } | 245 | } |
185 | 246 | ||
186 | void PMainWindow::slotScaleToggled(bool how) | 247 | void PMainWindow::slotScaleToggled(bool how) |
187 | { | 248 | { |
188 | autoScale = !how; | 249 | autoScale = !how; |
189 | if (!how) { | 250 | if (!how) { |
190 | autoRotate = how; | 251 | autoRotate = how; |
191 | } | 252 | } |
192 | if (m_disp) { | 253 | if (m_disp) { |
193 | m_disp->setAutoScaleRotate(autoScale,autoRotate); | 254 | m_disp->setAutoScaleRotate(autoScale,autoRotate); |
194 | } | 255 | } |
@@ -358,40 +419,47 @@ void PMainWindow::slotToggleFullScreen() | |||
358 | */ | 419 | */ |
359 | void PMainWindow::slotShowInfo( const QString& inf ) { | 420 | void PMainWindow::slotShowInfo( const QString& inf ) { |
360 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 421 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
361 | return; | 422 | return; |
362 | } | 423 | } |
363 | if ( !m_info ) { | 424 | if ( !m_info ) { |
364 | initInfo(); | 425 | initInfo(); |
365 | } | 426 | } |
366 | m_info->setPath( inf ); | 427 | m_info->setPath( inf ); |
367 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 428 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { |
368 | prevButton->hide(); | 429 | prevButton->hide(); |
369 | nextButton->hide(); | 430 | nextButton->hide(); |
370 | upButton->hide(); | 431 | m_aDirUp->setEnabled(false); |
432 | m_aShowInfo->setEnabled(false); | ||
433 | m_aViewfile->setEnabled(true); | ||
434 | m_aStartSlide->setEnabled(false); | ||
371 | fsButton->hide(); | 435 | fsButton->hide(); |
372 | viewModeButton->hide(); | 436 | viewModeButton->hide(); |
373 | } | 437 | } |
374 | m_stack->raiseWidget( ImageInfo ); | 438 | m_stack->raiseWidget( ImageInfo ); |
375 | } | 439 | } |
376 | 440 | ||
377 | void PMainWindow::slotDisplay( const QString& inf ) { | 441 | void PMainWindow::slotDisplay( const QString& inf ) { |
442 | odebug << "slotDisplay: " << inf << oendl; | ||
378 | if ( !m_disp ) { | 443 | if ( !m_disp ) { |
379 | initDisp(); | 444 | initDisp(); |
380 | } | 445 | } |
381 | m_disp->setImage( inf ); | 446 | m_disp->setImage( inf ); |
382 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 447 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { |
383 | prevButton->show(); | 448 | prevButton->show(); |
384 | nextButton->show(); | 449 | nextButton->show(); |
385 | upButton->hide(); | 450 | m_aDirUp->setEnabled(false); |
451 | m_aShowInfo->setEnabled(true); | ||
452 | m_aViewfile->setEnabled(false); | ||
453 | m_aStartSlide->setEnabled(false); | ||
386 | fsButton->hide(); | 454 | fsButton->hide(); |
387 | viewModeButton->hide(); | 455 | viewModeButton->hide(); |
388 | } | 456 | } |
389 | if (m_disp->fullScreen()) { | 457 | if (m_disp->fullScreen()) { |
390 | //m_disp->showFullScreen(); | 458 | //m_disp->showFullScreen(); |
391 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | 459 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); |
392 | } else { | 460 | } else { |
393 | m_stack->raiseWidget( ImageDisplay ); | 461 | m_stack->raiseWidget( ImageDisplay ); |
394 | } | 462 | } |
395 | } | 463 | } |
396 | 464 | ||
397 | void PMainWindow::slotReturn() { | 465 | void PMainWindow::slotReturn() { |
@@ -415,32 +483,67 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) { | |||
415 | m_disp->reparent(0,QPoint(0,0)); | 483 | m_disp->reparent(0,QPoint(0,0)); |
416 | m_stack->addWidget(m_disp,ImageDisplay); | 484 | m_stack->addWidget(m_disp,ImageDisplay); |
417 | } | 485 | } |
418 | ev->accept(); | 486 | ev->accept(); |
419 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); | 487 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); |
420 | } | 488 | } |
421 | 489 | ||
422 | void PMainWindow::raiseIconView() { | 490 | void PMainWindow::raiseIconView() { |
423 | setUpdatesEnabled(false); | 491 | setUpdatesEnabled(false); |
424 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 492 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { |
425 | prevButton->hide(); | 493 | prevButton->hide(); |
426 | nextButton->hide(); | 494 | nextButton->hide(); |
427 | upButton->show(); | 495 | m_aDirUp->setEnabled(true); |
496 | m_aShowInfo->setEnabled(true); | ||
497 | m_aViewfile->setEnabled(true); | ||
498 | m_aStartSlide->setEnabled(true); | ||
428 | fsButton->show(); | 499 | fsButton->show(); |
429 | viewModeButton->show(); | 500 | viewModeButton->show(); |
430 | } | 501 | } |
431 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 502 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
432 | m_disp->hide(); | 503 | m_disp->hide(); |
433 | } | 504 | } |
434 | m_stack->raiseWidget( IconView ); | 505 | m_stack->raiseWidget( IconView ); |
435 | setUpdatesEnabled(true); | 506 | setUpdatesEnabled(true); |
436 | repaint(); | 507 | repaint(); |
437 | } | 508 | } |
438 | 509 | ||
439 | void PMainWindow::setDocument( const QString& showImg ) { | 510 | void PMainWindow::setDocument( const QString& showImg ) { |
440 | QString file = showImg; | 511 | QString file = showImg; |
441 | DocLnk lnk(showImg); | 512 | DocLnk lnk(showImg); |
442 | if (lnk.isValid() ) | 513 | if (lnk.isValid() ) |
443 | file = lnk.file(); | 514 | file = lnk.file(); |
444 | 515 | ||
445 | slotDisplay( file ); | 516 | slotDisplay( file ); |
446 | } | 517 | } |
518 | |||
519 | void PMainWindow::slotSelectDir(int id) | ||
520 | { | ||
521 | emit changeDir( m_dev[fsMenu->text(id )] ); | ||
522 | } | ||
523 | |||
524 | void PMainWindow::dirChanged() | ||
525 | { | ||
526 | fsMenu->clear(); | ||
527 | m_dev.clear(); | ||
528 | |||
529 | /* home dir, too */ | ||
530 | QString f = getenv( "HOME" ); | ||
531 | if (!f.isEmpty()) { | ||
532 | m_dev.insert("Home directory",f); | ||
533 | fsMenu->insertItem("Home directory"); | ||
534 | } | ||
535 | const QList<FileSystem> &fs = m_storage->fileSystems(); | ||
536 | QListIterator<FileSystem> it(fs ); | ||
537 | for ( ; it.current(); ++it ) { | ||
538 | const QString disk = (*it)->name(); | ||
539 | const QString path = (*it)->path(); | ||
540 | m_dev.insert( disk, path ); | ||
541 | fsMenu->insertItem( disk ); | ||
542 | } | ||
543 | } | ||
544 | |||
545 | void PMainWindow::showToolbar(bool how) | ||
546 | { | ||
547 | if (!how) toolBar->hide(); | ||
548 | else toolBar->show(); | ||
549 | } \ No newline at end of file | ||