-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index a96bfbd..e532867 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -1,583 +1,581 @@ | |||
1 | /* | 1 | /* |
2 | * GPLv2 zecke@handhelds.org | 2 | * GPLv2 zecke@handhelds.org |
3 | * No WArranty... | 3 | * No WArranty... |
4 | */ | 4 | */ |
5 | #include "mainwindow.h" | 5 | #include "mainwindow.h" |
6 | #include "imageview.h" | 6 | #include "imageview.h" |
7 | 7 | ||
8 | #include "iconview.h" | 8 | #include "iconview.h" |
9 | #include "filesystem.h" | 9 | #include "filesystem.h" |
10 | #include "imageinfoui.h" | 10 | #include "imageinfoui.h" |
11 | #include "viewmodebutton.h" | 11 | #include "viewmodebutton.h" |
12 | #include "basesetup.h" | 12 | #include "basesetup.h" |
13 | 13 | ||
14 | #include <iface/ifaceinfo.h> | 14 | #include <iface/ifaceinfo.h> |
15 | #include <iface/dirview.h> | 15 | #include <iface/dirview.h> |
16 | 16 | ||
17 | #include <opie2/odebug.h> | 17 | #include <opie2/odebug.h> |
18 | #include <opie2/owidgetstack.h> | 18 | #include <opie2/owidgetstack.h> |
19 | #include <opie2/oapplicationfactory.h> | 19 | #include <opie2/oapplicationfactory.h> |
20 | #include <opie2/otabwidget.h> | 20 | #include <opie2/otabwidget.h> |
21 | #include <opie2/okeyconfigwidget.h> | 21 | #include <opie2/okeyconfigwidget.h> |
22 | 22 | ||
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | #include <qpe/ir.h> | 25 | #include <qpe/ir.h> |
26 | #include <qpe/storage.h> | 26 | #include <qpe/storage.h> |
27 | #include <qpe/applnk.h> | 27 | #include <qpe/applnk.h> |
28 | 28 | ||
29 | #include <qtoolbar.h> | 29 | #include <qtoolbar.h> |
30 | #include <qtoolbutton.h> | 30 | #include <qtoolbutton.h> |
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qmap.h> | 33 | #include <qmap.h> |
34 | #include <qtimer.h> | 34 | #include <qtimer.h> |
35 | #include <qframe.h> | 35 | #include <qframe.h> |
36 | #include <qmenubar.h> | 36 | #include <qmenubar.h> |
37 | #include <qaction.h> | 37 | #include <qaction.h> |
38 | 38 | ||
39 | //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) | 39 | //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) |
40 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) | 40 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) |
41 | 41 | ||
42 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 42 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
43 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) | 43 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) |
44 | { | 44 | { |
45 | setCaption( QObject::tr("Opie Eye" ) ); | 45 | setCaption( QObject::tr("Opie Eye" ) ); |
46 | m_cfg = new Opie::Core::OConfig("opie-eye"); | 46 | m_cfg = new Opie::Core::OConfig("opie-eye"); |
47 | m_cfg->setGroup("main" ); | 47 | m_cfg->setGroup("main" ); |
48 | readConfig(); | 48 | readConfig(); |
49 | m_setDocCalled = false; | 49 | m_setDocCalled = false; |
50 | m_polishDone = false; | 50 | m_polishDone = false; |
51 | m_SmallWindow = QApplication::desktop()->size().width()<330; | 51 | m_SmallWindow = QApplication::desktop()->size().width()<330; |
52 | 52 | ||
53 | m_storage = new StorageInfo(); | 53 | m_storage = new StorageInfo(); |
54 | connect(m_storage, SIGNAL(disksChanged() ), | 54 | connect(m_storage, SIGNAL(disksChanged() ), |
55 | this, SLOT( dirChanged() ) ); | 55 | this, SLOT( dirChanged() ) ); |
56 | 56 | ||
57 | m_stack = new Opie::Ui::OWidgetStack( this ); | 57 | m_stack = new Opie::Ui::OWidgetStack( this ); |
58 | setCentralWidget( m_stack ); | 58 | setCentralWidget( m_stack ); |
59 | 59 | ||
60 | m_view = new PIconView( m_stack, m_cfg ); | 60 | m_view = new PIconView( m_stack, m_cfg ); |
61 | m_stack->addWidget( m_view, IconView ); | 61 | m_stack->addWidget( m_view, IconView ); |
62 | m_stack->raiseWidget( IconView ); | 62 | m_stack->raiseWidget( IconView ); |
63 | 63 | ||
64 | connect(m_view, SIGNAL(sig_display(const QString&)), | 64 | connect(m_view, SIGNAL(sig_display(const QString&)), |
65 | this, SLOT(slotDisplay(const QString&))); | 65 | this, SLOT(slotDisplay(const QString&))); |
66 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), | 66 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), |
67 | this, SLOT(slotShowInfo(const QString&)) ); | 67 | this, SLOT(slotShowInfo(const QString&)) ); |
68 | connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int))); | 68 | connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int))); |
69 | 69 | ||
70 | m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); | ||
71 | |||
72 | listviewMenu = 0; | 70 | listviewMenu = 0; |
73 | /* setup menu and toolbar */ | 71 | /* setup menu and toolbar */ |
74 | setupActions(); | 72 | setupActions(); |
75 | setupToolbar(); | 73 | setupToolbar(); |
76 | setupMenu(); | 74 | setupMenu(); |
77 | m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true)); | 75 | m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true)); |
78 | m_aAutoRotate->setEnabled(!m_aUnscaled->isOn()); | 76 | m_aAutoRotate->setEnabled(!m_aUnscaled->isOn()); |
79 | if (m_aForceSmall) { | 77 | if (m_aForceSmall) { |
80 | m_aForceSmall->setOn(m_cfg->readBoolEntry("dontshowseperate",true)); | 78 | m_aForceSmall->setOn(m_cfg->readBoolEntry("dontshowseperate",true)); |
81 | } | 79 | } |
82 | odebug << "mainwindow constructor done" << oendl; | 80 | odebug << "mainwindow constructor done" << oendl; |
83 | } | 81 | } |
84 | 82 | ||
85 | PMainWindow::~PMainWindow() { | 83 | PMainWindow::~PMainWindow() { |
86 | } | 84 | } |
87 | 85 | ||
88 | void PMainWindow::slotToggleZoomer() | 86 | void PMainWindow::slotToggleZoomer() |
89 | { | 87 | { |
90 | m_aZoomer->setOn(!m_aZoomer->isOn()); | 88 | m_aZoomer->setOn(!m_aZoomer->isOn()); |
91 | } | 89 | } |
92 | 90 | ||
93 | void PMainWindow::slotZoomerToggled(bool how) | 91 | void PMainWindow::slotZoomerToggled(bool how) |
94 | { | 92 | { |
95 | if (m_disp) { | 93 | if (m_disp) { |
96 | m_disp->setShowZoomer(how); | 94 | m_disp->setShowZoomer(how); |
97 | } | 95 | } |
98 | if (autoSave) { | 96 | if (autoSave) { |
99 | m_cfg->writeEntry("zoomeron",how); | 97 | m_cfg->writeEntry("zoomeron",how); |
100 | } | 98 | } |
101 | } | 99 | } |
102 | 100 | ||
103 | void PMainWindow::slotToggleAutorotate() | 101 | void PMainWindow::slotToggleAutorotate() |
104 | { | 102 | { |
105 | if (!m_aAutoRotate->isEnabled()) return; | 103 | if (!m_aAutoRotate->isEnabled()) return; |
106 | m_aAutoRotate->setOn(!m_aAutoRotate->isOn()); | 104 | m_aAutoRotate->setOn(!m_aAutoRotate->isOn()); |
107 | } | 105 | } |
108 | 106 | ||
109 | void PMainWindow::slotToggleAutoscale() | 107 | void PMainWindow::slotToggleAutoscale() |
110 | { | 108 | { |
111 | m_aUnscaled->setOn(!m_aUnscaled->isOn()); | 109 | m_aUnscaled->setOn(!m_aUnscaled->isOn()); |
112 | } | 110 | } |
113 | 111 | ||
114 | void PMainWindow::slotRotateToggled(bool how) | 112 | void PMainWindow::slotRotateToggled(bool how) |
115 | { | 113 | { |
116 | if (autoSave) { | 114 | if (autoSave) { |
117 | m_cfg->writeEntry("autorotate",how); | 115 | m_cfg->writeEntry("autorotate",how); |
118 | } | 116 | } |
119 | if (m_disp) { | 117 | if (m_disp) { |
120 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),how); | 118 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),how); |
121 | } | 119 | } |
122 | } | 120 | } |
123 | 121 | ||
124 | void PMainWindow::slotScaleToggled(bool how) | 122 | void PMainWindow::slotScaleToggled(bool how) |
125 | { | 123 | { |
126 | if (autoSave) { | 124 | if (autoSave) { |
127 | m_cfg->writeEntry("unscaled",how); | 125 | m_cfg->writeEntry("unscaled",how); |
128 | } | 126 | } |
129 | odebug << "Unscaled: " << m_aUnscaled->isOn() << oendl; | 127 | odebug << "Unscaled: " << m_aUnscaled->isOn() << oendl; |
130 | odebug << "How: " << how << oendl; | 128 | odebug << "How: " << how << oendl; |
131 | if (how) { | 129 | if (how) { |
132 | m_aAutoRotate->setOn(false); | 130 | m_aAutoRotate->setOn(false); |
133 | } | 131 | } |
134 | if (m_disp) { | 132 | if (m_disp) { |
135 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn()); | 133 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn()); |
136 | } | 134 | } |
137 | m_aAutoRotate->setEnabled(!how); | 135 | m_aAutoRotate->setEnabled(!how); |
138 | odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl; | 136 | odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl; |
139 | } | 137 | } |
140 | 138 | ||
141 | void PMainWindow::slotConfig() { | 139 | void PMainWindow::slotConfig() { |
142 | /* | 140 | /* |
143 | * have a tab with the possible views | 141 | * have a tab with the possible views |
144 | * a tab for globals image cache size.. scaled loading | 142 | * a tab for globals image cache size.. scaled loading |
145 | * and one tab for the KeyConfigs | 143 | * and one tab for the KeyConfigs |
146 | */ | 144 | */ |
147 | QDialog dlg(this, 0, true); | 145 | QDialog dlg(this, 0, true); |
148 | dlg.setCaption( tr("Opie Eye - Config" ) ); | 146 | dlg.setCaption( tr("Opie Eye - Config" ) ); |
149 | 147 | ||
150 | QHBoxLayout *lay = new QHBoxLayout(&dlg); | 148 | QHBoxLayout *lay = new QHBoxLayout(&dlg); |
151 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); | 149 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); |
152 | lay->addWidget( wid ); | 150 | lay->addWidget( wid ); |
153 | 151 | ||
154 | BaseSetup*bSetup = new BaseSetup(m_cfg,wid); | 152 | BaseSetup*bSetup = new BaseSetup(m_cfg,wid); |
155 | wid->addTab(bSetup,"SettingsIcon","Basics setup"); | 153 | wid->addTab(bSetup,"SettingsIcon","Basics setup"); |
156 | 154 | ||
157 | ViewMap *vM = viewMap(); | 155 | ViewMap *vM = viewMap(); |
158 | ViewMap::Iterator _it = vM->begin(); | 156 | ViewMap::Iterator _it = vM->begin(); |
159 | QMap<PDirView*, QWidget*> lst; | 157 | QMap<PDirView*, QWidget*> lst; |
160 | 158 | ||
161 | for( ; _it != vM->end(); ++_it ) { | 159 | for( ; _it != vM->end(); ++_it ) { |
162 | PDirView *view = (_it.data())(*m_cfg); | 160 | PDirView *view = (_it.data())(*m_cfg); |
163 | PInterfaceInfo *inf = view->interfaceInfo(); | 161 | PInterfaceInfo *inf = view->interfaceInfo(); |
164 | QWidget *_wid = inf->configWidget( *m_cfg ); | 162 | QWidget *_wid = inf->configWidget( *m_cfg ); |
165 | if (!_wid) continue; | 163 | if (!_wid) continue; |
166 | _wid->reparent(wid, QPoint() ); | 164 | _wid->reparent(wid, QPoint() ); |
167 | lst.insert( view, _wid ); | 165 | lst.insert( view, _wid ); |
168 | wid->addTab( _wid, "fileopen", inf->name() ); | 166 | wid->addTab( _wid, "fileopen", inf->name() ); |
169 | } | 167 | } |
170 | 168 | ||
171 | /* | 169 | /* |
172 | * Add the KeyConfigWidget | 170 | * Add the KeyConfigWidget |
173 | */ | 171 | */ |
174 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 172 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
175 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 173 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
176 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 174 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
177 | QWidget*w = m_stack->visibleWidget(); | 175 | QWidget*w = m_stack->visibleWidget(); |
178 | 176 | ||
179 | bool reminfo = false; | 177 | bool reminfo = false; |
180 | if ( !m_info ) { | 178 | if ( !m_info ) { |
181 | reminfo = true; | 179 | reminfo = true; |
182 | initInfo(); | 180 | initInfo(); |
183 | m_info->hide(); | 181 | m_info->hide(); |
184 | } | 182 | } |
185 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); | 183 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); |
186 | 184 | ||
187 | bool remdisp = false; | 185 | bool remdisp = false; |
188 | if ( !m_disp ) { | 186 | if ( !m_disp ) { |
189 | remdisp = true; | 187 | remdisp = true; |
190 | initDisp(); | 188 | initDisp(); |
191 | m_disp->hide(); | 189 | m_disp->hide(); |
192 | } | 190 | } |
193 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); | 191 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); |
194 | 192 | ||
195 | keyWid->load(); | 193 | keyWid->load(); |
196 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 194 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
197 | wid->setCurrentTab(0); | 195 | wid->setCurrentTab(0); |
198 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 196 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
199 | 197 | ||
200 | /* | 198 | /* |
201 | * clean up | 199 | * clean up |
202 | *apply changes | 200 | *apply changes |
203 | */ | 201 | */ |
204 | 202 | ||
205 | QMap<PDirView*, QWidget*>::Iterator it; | 203 | QMap<PDirView*, QWidget*>::Iterator it; |
206 | for ( it = lst.begin(); it != lst.end(); ++it ) { | 204 | for ( it = lst.begin(); it != lst.end(); ++it ) { |
207 | if ( act ) | 205 | if ( act ) |
208 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); | 206 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); |
209 | delete it.key(); | 207 | delete it.key(); |
210 | } | 208 | } |
211 | 209 | ||
212 | 210 | ||
213 | if ( act ) { | 211 | if ( act ) { |
214 | keyWid->save(); | 212 | keyWid->save(); |
215 | m_disp->manager()->save(); | 213 | m_disp->manager()->save(); |
216 | m_info->manager()->save(); | 214 | m_info->manager()->save(); |
217 | m_view->manager()->save(); | 215 | m_view->manager()->save(); |
218 | bSetup->save_values(); | 216 | bSetup->save_values(); |
219 | m_view->resetView(); | 217 | m_view->resetView(); |
220 | readConfig(); | 218 | readConfig(); |
221 | } | 219 | } |
222 | delete keyWid; | 220 | delete keyWid; |
223 | 221 | ||
224 | m_stack->raiseWidget(w); | 222 | m_stack->raiseWidget(w); |
225 | if (remdisp) { | 223 | if (remdisp) { |
226 | m_disp->hide(); | 224 | m_disp->hide(); |
227 | } | 225 | } |
228 | if (reminfo) { | 226 | if (reminfo) { |
229 | m_info->hide(); | 227 | m_info->hide(); |
230 | } | 228 | } |
231 | } | 229 | } |
232 | 230 | ||
233 | /* | 231 | /* |
234 | * create a new image info component | 232 | * create a new image info component |
235 | * and detach the current one | 233 | * and detach the current one |
236 | * we will make the other delete on exit | 234 | * we will make the other delete on exit |
237 | */ | 235 | */ |
238 | template<class T> | 236 | template<class T> |
239 | void PMainWindow::initT( const char* name, T** ptr, int id) { | 237 | void PMainWindow::initT( const char* name, T** ptr, int id) { |
240 | if ( *ptr ) { | 238 | if ( *ptr ) { |
241 | (*ptr)->disconnect(this, SLOT(slotReturn())); | 239 | (*ptr)->disconnect(this, SLOT(slotReturn())); |
242 | (*ptr)->setDestructiveClose(); | 240 | (*ptr)->setDestructiveClose(); |
243 | m_stack->removeWidget( *ptr ); | 241 | m_stack->removeWidget( *ptr ); |
244 | } | 242 | } |
245 | *ptr = new T(m_cfg, m_stack, name ); | 243 | *ptr = new T(m_cfg, m_stack, name ); |
246 | m_stack->addWidget( *ptr, id ); | 244 | m_stack->addWidget( *ptr, id ); |
247 | 245 | ||
248 | connect(*ptr, SIGNAL(sig_return()), | 246 | connect(*ptr, SIGNAL(sig_return()), |
249 | this,SLOT(slotReturn())); | 247 | this,SLOT(slotReturn())); |
250 | 248 | ||
251 | } | 249 | } |
252 | 250 | ||
253 | void PMainWindow::initInfo() { | 251 | void PMainWindow::initInfo() { |
254 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); | 252 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); |
255 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); | 253 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); |
256 | } | 254 | } |
257 | 255 | ||
258 | void PMainWindow::initDisp() { | 256 | void PMainWindow::initDisp() { |
259 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); | 257 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); |
260 | if (m_disp) { | 258 | if (m_disp) { |
261 | // if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 259 | // if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
262 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); | 260 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); |
263 | // } | 261 | // } |
264 | m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); | 262 | m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); |
265 | m_disp->setAutoScale(!m_aUnscaled->isOn()); | 263 | m_disp->setAutoScale(!m_aUnscaled->isOn()); |
266 | m_disp->setAutoRotate(m_aAutoRotate->isOn()); | 264 | m_disp->setAutoRotate(m_aAutoRotate->isOn()); |
267 | m_disp->setShowZoomer(m_aZoomer->isOn()); | 265 | m_disp->setShowZoomer(m_aZoomer->isOn()); |
268 | m_disp->setBackgroundColor(white); | 266 | m_disp->setBackgroundColor(white); |
269 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); | 267 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); |
270 | connect(m_disp,SIGNAL(dispNext()),m_view,SLOT(slotShowNext())); | 268 | connect(m_disp,SIGNAL(dispNext()),m_view,SLOT(slotShowNext())); |
271 | connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev())); | 269 | connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev())); |
272 | connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen())); | 270 | connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen())); |
273 | connect(m_disp,SIGNAL(hideMe()),this,SLOT(raiseIconView())); | 271 | connect(m_disp,SIGNAL(hideMe()),this,SLOT(raiseIconView())); |
274 | connect(m_disp,SIGNAL(toggleZoomer()),this,SLOT(slotToggleZoomer())); | 272 | connect(m_disp,SIGNAL(toggleZoomer()),this,SLOT(slotToggleZoomer())); |
275 | connect(m_disp,SIGNAL(toggleAutoscale()),this,SLOT(slotToggleAutoscale())); | 273 | connect(m_disp,SIGNAL(toggleAutoscale()),this,SLOT(slotToggleAutoscale())); |
276 | connect(m_disp,SIGNAL(toggleAutorotate()),this,SLOT(slotToggleAutorotate())); | 274 | connect(m_disp,SIGNAL(toggleAutorotate()),this,SLOT(slotToggleAutorotate())); |
277 | connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int))); | 275 | connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int))); |
278 | slotFullScreenToggled(m_aFullScreen->isOn()); | 276 | slotFullScreenToggled(m_aFullScreen->isOn()); |
279 | } | 277 | } |
280 | } | 278 | } |
281 | 279 | ||
282 | void PMainWindow::slotToggleFullScreen() | 280 | void PMainWindow::slotToggleFullScreen() |
283 | { | 281 | { |
284 | bool current = !m_aFullScreen->isOn(); | 282 | bool current = !m_aFullScreen->isOn(); |
285 | m_aFullScreen->setOn(current); | 283 | m_aFullScreen->setOn(current); |
286 | } | 284 | } |
287 | 285 | ||
288 | void PMainWindow::slotFullScreenButton(bool current) | 286 | void PMainWindow::slotFullScreenButton(bool current) |
289 | { | 287 | { |
290 | if (autoSave) { | 288 | if (autoSave) { |
291 | m_cfg->writeEntry("fullscreen",current); | 289 | m_cfg->writeEntry("fullscreen",current); |
292 | } | 290 | } |
293 | if (!m_disp) return; | 291 | if (!m_disp) return; |
294 | if (m_disp->isVisible()) { | 292 | if (m_disp->isVisible()) { |
295 | setupViewWindow(current, true); | 293 | setupViewWindow(current, true); |
296 | } | 294 | } |
297 | } | 295 | } |
298 | 296 | ||
299 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) | 297 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) |
300 | { | 298 | { |
301 | if (!m_disp) { | 299 | if (!m_disp) { |
302 | return; | 300 | return; |
303 | } | 301 | } |
304 | if (current) { | 302 | if (current) { |
305 | m_disp->setBackgroundColor(black); | 303 | m_disp->setBackgroundColor(black); |
306 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); | 304 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); |
307 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); | 305 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); |
308 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); | 306 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); |
309 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 307 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); |
310 | m_disp->setFullScreen(current,forceDisplay); | 308 | m_disp->setFullScreen(current,forceDisplay); |
311 | } else { | 309 | } else { |
312 | setUpdatesEnabled(false); | 310 | setUpdatesEnabled(false); |
313 | #if 0 | 311 | #if 0 |
314 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 312 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
315 | 313 | ||
316 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); | 314 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); |
317 | } else { | 315 | } else { |
318 | //m_disp->setMinimumSize(10,10); | 316 | //m_disp->setMinimumSize(10,10); |
319 | } | 317 | } |
320 | #endif | 318 | #endif |
321 | m_disp->setBackgroundColor(white); | 319 | m_disp->setBackgroundColor(white); |
322 | m_stack->addWidget(m_disp,ImageDisplay); | 320 | m_stack->addWidget(m_disp,ImageDisplay); |
323 | m_disp->setVScrollBarMode(QScrollView::Auto); | 321 | m_disp->setVScrollBarMode(QScrollView::Auto); |
324 | m_disp->setHScrollBarMode(QScrollView::Auto); | 322 | m_disp->setHScrollBarMode(QScrollView::Auto); |
325 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 323 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
326 | m_disp->setGeometry(30,30,QApplication::desktop()->width()-60,QApplication::desktop()->height()-60); | 324 | m_disp->setGeometry(30,30,QApplication::desktop()->width()-60,QApplication::desktop()->height()-60); |
327 | } | 325 | } |
328 | if (forceDisplay || m_disp->isVisible()) { | 326 | if (forceDisplay || m_disp->isVisible()) { |
329 | m_stack->raiseWidget(m_disp); | 327 | m_stack->raiseWidget(m_disp); |
330 | m_disp->setFocus(); | 328 | m_disp->setFocus(); |
331 | } | 329 | } |
332 | setUpdatesEnabled(true); | 330 | setUpdatesEnabled(true); |
333 | } | 331 | } |
334 | m_disp->setFullScreen(current,forceDisplay); | 332 | m_disp->setFullScreen(current,forceDisplay); |
335 | } | 333 | } |
336 | 334 | ||
337 | void PMainWindow::slotFullScreenToggled(bool current) | 335 | void PMainWindow::slotFullScreenToggled(bool current) |
338 | { | 336 | { |
339 | setupViewWindow(current,true); | 337 | setupViewWindow(current,true); |
340 | } | 338 | } |
341 | 339 | ||
342 | /** | 340 | /** |
343 | * With big Screen the plan could be to 'detach' the image | 341 | * With big Screen the plan could be to 'detach' the image |
344 | * window if visible and to create a ne wone | 342 | * window if visible and to create a ne wone |
345 | * init* already supports it but I make no use of it for | 343 | * init* already supports it but I make no use of it for |
346 | * now. We set filename and raise | 344 | * now. We set filename and raise |
347 | * | 345 | * |
348 | * ### FIXME and talk to alwin | 346 | * ### FIXME and talk to alwin |
349 | */ | 347 | */ |
350 | void PMainWindow::slotShowInfo( const QString& inf ) { | 348 | void PMainWindow::slotShowInfo( const QString& inf ) { |
351 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 349 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
352 | return; | 350 | return; |
353 | } | 351 | } |
354 | if ( !m_info ) { | 352 | if ( !m_info ) { |
355 | initInfo(); | 353 | initInfo(); |
356 | } | 354 | } |
357 | m_info->setPath( inf ); | 355 | m_info->setPath( inf ); |
358 | if (m_SmallWindow) { | 356 | if (m_SmallWindow) { |
359 | m_aNext->removeFrom(toolBar); | 357 | m_aNext->removeFrom(toolBar); |
360 | m_aPrevious->removeFrom(toolBar); | 358 | m_aPrevious->removeFrom(toolBar); |
361 | fsButton->hide(); | 359 | fsButton->hide(); |
362 | } | 360 | } |
363 | m_aNext->setEnabled(false); | 361 | m_aNext->setEnabled(false); |
364 | m_aPrevious->setEnabled(false); | 362 | m_aPrevious->setEnabled(false); |
365 | m_aDirUp->setEnabled(false); | 363 | m_aDirUp->setEnabled(false); |
366 | m_aShowInfo->setEnabled(false); | 364 | m_aShowInfo->setEnabled(false); |
367 | m_aViewfile->setEnabled(true); | 365 | m_aViewfile->setEnabled(true); |
368 | m_aStartSlide->setEnabled(false); | 366 | m_aStartSlide->setEnabled(false); |
369 | m_stack->raiseWidget( ImageInfo ); | 367 | m_stack->raiseWidget( ImageInfo ); |
370 | } | 368 | } |
371 | 369 | ||
372 | void PMainWindow::slotDisplay( const QString& inf ) { | 370 | void PMainWindow::slotDisplay( const QString& inf ) { |
373 | bool nwindow = false; | 371 | bool nwindow = false; |
374 | if ( !m_disp ) { | 372 | if ( !m_disp ) { |
375 | nwindow = true; | 373 | nwindow = true; |
376 | initDisp(); | 374 | initDisp(); |
377 | } | 375 | } |
378 | m_disp->setImage( inf ); | 376 | m_disp->setImage( inf ); |
379 | if (m_SmallWindow) { | 377 | if (m_SmallWindow) { |
380 | if (m_gPrevNext->isEnabled()==false) { | 378 | if (m_gPrevNext->isEnabled()==false) { |
381 | m_gPrevNext->addTo(toolBar); | 379 | m_gPrevNext->addTo(toolBar); |
382 | fsButton->hide(); | 380 | fsButton->hide(); |
383 | } | 381 | } |
384 | } | 382 | } |
385 | m_gPrevNext->setEnabled(true); | 383 | m_gPrevNext->setEnabled(true); |
386 | m_aDirUp->setEnabled(false); | 384 | m_aDirUp->setEnabled(false); |
387 | m_aShowInfo->setEnabled(true); | 385 | m_aShowInfo->setEnabled(true); |
388 | m_aViewfile->setEnabled(false); | 386 | m_aViewfile->setEnabled(false); |
389 | m_aStartSlide->setEnabled(false); | 387 | m_aStartSlide->setEnabled(false); |
390 | 388 | ||
391 | if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { | 389 | if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { |
392 | slotFullScreenToggled(m_aFullScreen->isOn()); | 390 | slotFullScreenToggled(m_aFullScreen->isOn()); |
393 | } | 391 | } |
394 | if (m_disp->fullScreen()) { | 392 | if (m_disp->fullScreen()) { |
395 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | 393 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); |
396 | } else { | 394 | } else { |
397 | m_stack->raiseWidget( ImageDisplay ); | 395 | m_stack->raiseWidget( ImageDisplay ); |
398 | } | 396 | } |
399 | } | 397 | } |
400 | 398 | ||
401 | void PMainWindow::raiseIconView() { | 399 | void PMainWindow::raiseIconView() { |
402 | setUpdatesEnabled(false); | 400 | setUpdatesEnabled(false); |
403 | if (m_SmallWindow) { | 401 | if (m_SmallWindow) { |
404 | m_gPrevNext->removeFrom(toolBar); | 402 | m_gPrevNext->removeFrom(toolBar); |
405 | fsButton->show(); | 403 | fsButton->show(); |
406 | } | 404 | } |
407 | m_gPrevNext->setEnabled(false); | 405 | m_gPrevNext->setEnabled(false); |
408 | m_aDirUp->setEnabled(true); | 406 | m_aDirUp->setEnabled(true); |
409 | m_aShowInfo->setEnabled(true); | 407 | m_aShowInfo->setEnabled(true); |
410 | m_aViewfile->setEnabled(true); | 408 | m_aViewfile->setEnabled(true); |
411 | m_aStartSlide->setEnabled(true); | 409 | m_aStartSlide->setEnabled(true); |
412 | 410 | ||
413 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 411 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
414 | m_disp->stopSlide(); | 412 | m_disp->stopSlide(); |
415 | m_disp->hide(); | 413 | m_disp->hide(); |
416 | } | 414 | } |
417 | m_stack->raiseWidget( IconView ); | 415 | m_stack->raiseWidget( IconView ); |
418 | setUpdatesEnabled(true); | 416 | setUpdatesEnabled(true); |
419 | repaint(); | 417 | repaint(); |
420 | } | 418 | } |
421 | 419 | ||
422 | void PMainWindow::slotReturn() { | 420 | void PMainWindow::slotReturn() { |
423 | raiseIconView(); | 421 | raiseIconView(); |
424 | } | 422 | } |
425 | 423 | ||
426 | 424 | ||
427 | void PMainWindow::closeEvent( QCloseEvent* ev ) { | 425 | void PMainWindow::closeEvent( QCloseEvent* ev ) { |
428 | /* | 426 | /* |
429 | * return from view | 427 | * return from view |
430 | * or properly quit | 428 | * or properly quit |
431 | */ | 429 | */ |
432 | if (!m_setDocCalled) { | 430 | if (!m_setDocCalled) { |
433 | if ( m_stack->visibleWidget() == m_info || | 431 | if ( m_stack->visibleWidget() == m_info || |
434 | m_stack->visibleWidget() == m_disp ) { | 432 | m_stack->visibleWidget() == m_disp ) { |
435 | ev->ignore(); | 433 | ev->ignore(); |
436 | raiseIconView(); | 434 | raiseIconView(); |
437 | return; | 435 | return; |
438 | } | 436 | } |
439 | } | 437 | } |
440 | if (m_disp && m_disp->fullScreen()) { | 438 | if (m_disp && m_disp->fullScreen()) { |
441 | /* otherwise opie-eye crashes in bigscreen mode! */ | 439 | /* otherwise opie-eye crashes in bigscreen mode! */ |
442 | m_disp->reparent(0,QPoint(0,0)); | 440 | m_disp->reparent(0,QPoint(0,0)); |
443 | m_stack->addWidget(m_disp,ImageDisplay); | 441 | m_stack->addWidget(m_disp,ImageDisplay); |
444 | } | 442 | } |
445 | ev->accept(); | 443 | ev->accept(); |
446 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); | 444 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); |
447 | } | 445 | } |
448 | 446 | ||
449 | void PMainWindow::setDocument( const QString& showImg ) | 447 | void PMainWindow::setDocument( const QString& showImg ) |
450 | { | 448 | { |
451 | QString file = showImg; | 449 | QString file = showImg; |
452 | DocLnk lnk(showImg); | 450 | DocLnk lnk(showImg); |
453 | if (lnk.isValid() ) | 451 | if (lnk.isValid() ) |
454 | file = lnk.file(); | 452 | file = lnk.file(); |
455 | slotDisplay( file ); | 453 | slotDisplay( file ); |
456 | #if 0 | 454 | #if 0 |
457 | if (!m_polishDone) { | 455 | if (!m_polishDone) { |
458 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); | 456 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); |
459 | } | 457 | } |
460 | #endif | 458 | #endif |
461 | } | 459 | } |
462 | 460 | ||
463 | void PMainWindow::check_view_fullscreen() | 461 | void PMainWindow::check_view_fullscreen() |
464 | { | 462 | { |
465 | if (!m_view) return; | 463 | if (!m_view) return; |
466 | if (!m_view->hasFocus()&&m_aFullScreen->isOn()) { | 464 | if (!m_view->hasFocus()&&m_aFullScreen->isOn()) { |
467 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | 465 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); |
468 | } | 466 | } |
469 | } | 467 | } |
470 | 468 | ||
471 | void PMainWindow::slotSelectDir(int id) | 469 | void PMainWindow::slotSelectDir(int id) |
472 | { | 470 | { |
473 | emit changeDir( m_dev[fsMenu->text(id )] ); | 471 | emit changeDir( m_dev[fsMenu->text(id )] ); |
474 | } | 472 | } |
475 | 473 | ||
476 | void PMainWindow::dirChanged() | 474 | void PMainWindow::dirChanged() |
477 | { | 475 | { |
478 | fsMenu->clear(); | 476 | fsMenu->clear(); |
479 | m_dev.clear(); | 477 | m_dev.clear(); |
480 | 478 | ||
481 | /* home dir, too */ | 479 | /* home dir, too */ |
482 | QString f = getenv( "HOME" ); | 480 | QString f = getenv( "HOME" ); |
483 | if (!f.isEmpty()) { | 481 | if (!f.isEmpty()) { |
484 | m_dev.insert("Home directory",f); | 482 | m_dev.insert("Home directory",f); |
485 | fsMenu->insertItem("Home directory"); | 483 | fsMenu->insertItem("Home directory"); |
486 | } | 484 | } |
487 | const QList<FileSystem> &fs = m_storage->fileSystems(); | 485 | const QList<FileSystem> &fs = m_storage->fileSystems(); |
488 | QListIterator<FileSystem> it(fs ); | 486 | QListIterator<FileSystem> it(fs ); |
489 | for ( ; it.current(); ++it ) { | 487 | for ( ; it.current(); ++it ) { |
490 | const QString disk = (*it)->name(); | 488 | const QString disk = (*it)->name(); |
491 | const QString path = (*it)->path(); | 489 | const QString path = (*it)->path(); |
492 | m_dev.insert( disk, path ); | 490 | m_dev.insert( disk, path ); |
493 | fsMenu->insertItem( disk ); | 491 | fsMenu->insertItem( disk ); |
494 | } | 492 | } |
495 | } | 493 | } |
496 | 494 | ||
497 | void PMainWindow::showToolbar(bool how) | 495 | void PMainWindow::showToolbar(bool how) |
498 | { | 496 | { |
499 | if (!how) toolBar->hide(); | 497 | if (!how) toolBar->hide(); |
500 | else toolBar->show(); | 498 | else toolBar->show(); |
501 | if (autoSave) { | 499 | if (autoSave) { |
502 | m_cfg->writeEntry("showtoolbar",how); | 500 | m_cfg->writeEntry("showtoolbar",how); |
503 | } | 501 | } |
504 | } | 502 | } |
505 | 503 | ||
506 | void PMainWindow::setupActions() | 504 | void PMainWindow::setupActions() |
507 | { | 505 | { |
508 | m_aDirUp = new QAction( tr( "Go dir up" ), Resource::loadIconSet( "up" ), 0, 0, this, 0, true ); | 506 | m_aDirUp = new QAction( tr( "Go dir up" ), Resource::loadIconSet( "up" ), 0, 0, this, 0, true ); |
509 | m_aDirUp->setToggleAction(false); | 507 | m_aDirUp->setToggleAction(false); |
510 | connect(m_aDirUp,SIGNAL(activated()),m_view,SLOT(slotDirUp())); | 508 | connect(m_aDirUp,SIGNAL(activated()),m_view,SLOT(slotDirUp())); |
511 | 509 | ||
512 | if ( Ir::supported() ) { | 510 | if ( Ir::supported() ) { |
513 | m_aBeam = new QAction( tr( "Beam file" ), Resource::loadIconSet( "beam" ),0, 0, this, 0, true ); | 511 | m_aBeam = new QAction( tr( "Beam file" ), Resource::loadIconSet( "beam" ),0, 0, this, 0, true ); |
514 | m_aBeam->setToggleAction(false); | 512 | m_aBeam->setToggleAction(false); |
515 | connect(m_aBeam,SIGNAL(activated()),m_view,SLOT(slotBeam())); | 513 | connect(m_aBeam,SIGNAL(activated()),m_view,SLOT(slotBeam())); |
516 | } else { | 514 | } else { |
517 | m_aBeam = 0; | 515 | m_aBeam = 0; |
518 | } | 516 | } |
519 | 517 | ||
520 | m_aShowInfo = new QAction( tr( "Show imageinfo" ), Resource::loadIconSet( "edit" ), 0, 0, this, 0, true ); | 518 | m_aShowInfo = new QAction( tr( "Show imageinfo" ), Resource::loadIconSet( "edit" ), 0, 0, this, 0, true ); |
521 | m_aShowInfo->setToggleAction(false); | 519 | m_aShowInfo->setToggleAction(false); |
522 | connect(m_aShowInfo,SIGNAL(activated()),m_view,SLOT(slotImageInfo())); | 520 | connect(m_aShowInfo,SIGNAL(activated()),m_view,SLOT(slotImageInfo())); |
523 | 521 | ||
524 | m_aTrash = new QAction( tr( "Delete file" ), Resource::loadIconSet("trash"), 0, 0, this, 0, true ); | 522 | m_aTrash = new QAction( tr( "Delete file" ), Resource::loadIconSet("trash"), 0, 0, this, 0, true ); |
525 | m_aTrash->setToggleAction(false); | 523 | m_aTrash->setToggleAction(false); |
526 | connect(m_aTrash,SIGNAL(activated()),m_view,SLOT(slotTrash())); | 524 | connect(m_aTrash,SIGNAL(activated()),m_view,SLOT(slotTrash())); |
527 | 525 | ||
528 | m_aViewfile = new QAction( tr( "Display image" ), Resource::loadIconSet("mag"), 0, 0, this, 0, true ); | 526 | m_aViewfile = new QAction( tr( "Display image" ), Resource::loadIconSet("mag"), 0, 0, this, 0, true ); |
529 | m_aViewfile->setToggleAction(false); | 527 | m_aViewfile->setToggleAction(false); |
530 | connect(m_aViewfile,SIGNAL(activated()),m_view,SLOT(slotShowImage())); | 528 | connect(m_aViewfile,SIGNAL(activated()),m_view,SLOT(slotShowImage())); |
531 | 529 | ||
532 | m_aStartSlide = new QAction( tr( "Start slideshow" ), Resource::loadIconSet("play"),0, 0, this, 0, true ); | 530 | m_aStartSlide = new QAction( tr( "Start slideshow" ), Resource::loadIconSet("play"),0, 0, this, 0, true ); |
533 | m_aStartSlide->setToggleAction(false); | 531 | m_aStartSlide->setToggleAction(false); |
534 | connect(m_aStartSlide,SIGNAL(activated()),m_view,SLOT(slotStartSlide())); | 532 | connect(m_aStartSlide,SIGNAL(activated()),m_view,SLOT(slotStartSlide())); |
535 | 533 | ||
536 | m_aHideToolbar = new QAction( tr( "Show toolbar" ), Resource::loadIconSet( "UtilsIcon" ), 0, 0, this, 0, true ); | 534 | m_aHideToolbar = new QAction( tr( "Show toolbar" ), Resource::loadIconSet( "UtilsIcon" ), 0, 0, this, 0, true ); |
537 | m_aHideToolbar->setOn (true); | 535 | m_aHideToolbar->setOn (true); |
538 | connect(m_aHideToolbar,SIGNAL(toggled(bool)),this,SLOT(showToolbar(bool))); | 536 | connect(m_aHideToolbar,SIGNAL(toggled(bool)),this,SLOT(showToolbar(bool))); |
539 | 537 | ||
540 | m_aSetup = new QAction( tr( "Settings" ), Resource::loadIconSet("SettingsIcon"), 0, 0, this, 0, true ); | 538 | m_aSetup = new QAction( tr( "Settings" ), Resource::loadIconSet("SettingsIcon"), 0, 0, this, 0, true ); |
541 | m_aSetup->setToggleAction(false); | 539 | m_aSetup->setToggleAction(false); |
542 | connect(m_aSetup,SIGNAL(activated()),this,SLOT(slotConfig())); | 540 | connect(m_aSetup,SIGNAL(activated()),this,SLOT(slotConfig())); |
543 | 541 | ||
544 | m_gListViewMode = new QActionGroup(this,"Select listmode",true); | 542 | m_gListViewMode = new QActionGroup(this,"Select listmode",true); |
545 | connect(m_gListViewMode,SIGNAL(selected(QAction*)),this,SLOT(listviewselected(QAction*))); | 543 | connect(m_gListViewMode,SIGNAL(selected(QAction*)),this,SLOT(listviewselected(QAction*))); |
546 | 544 | ||
547 | m_aDirLong = new QAction( tr( "Thumbnail and Imageinfo" ),Resource::loadIconSet("opie-eye/opie-eye-thumb"), 0, 0, this, 0, true ); | 545 | m_aDirLong = new QAction( tr( "Thumbnail and Imageinfo" ),Resource::loadIconSet("opie-eye/opie-eye-thumb"), 0, 0, this, 0, true ); |
548 | m_aDirLong->setToggleAction(true); | 546 | m_aDirLong->setToggleAction(true); |
549 | m_aDirShort = new QAction( tr( "Thumbnail and name" ),Resource::loadIconSet("opie-eye/opie-eye-thumbonly"), 0, 0, this, 0, true ); | 547 | m_aDirShort = new QAction( tr( "Thumbnail and name" ),Resource::loadIconSet("opie-eye/opie-eye-thumbonly"), 0, 0, this, 0, true ); |
550 | m_aDirShort->setToggleAction(true); | 548 | m_aDirShort->setToggleAction(true); |
551 | m_aDirName = new QAction( tr( "Name only" ), Resource::loadIconSet("opie-eye/opie-eye-textview"),0, 0, this, 0, true ); | 549 | m_aDirName = new QAction( tr( "Name only" ), Resource::loadIconSet("opie-eye/opie-eye-textview"),0, 0, this, 0, true ); |
552 | m_aDirName->setToggleAction(true); | 550 | m_aDirName->setToggleAction(true); |
553 | int mode = m_cfg->readNumEntry("ListViewMode", 1); | 551 | int mode = m_cfg->readNumEntry("ListViewMode", 1); |
554 | if (mode < 1 || mode>3) mode = 1; | 552 | if (mode < 1 || mode>3) mode = 1; |
555 | switch (mode) { | 553 | switch (mode) { |
556 | case 3: | 554 | case 3: |
557 | m_aDirName->setOn(true); | 555 | m_aDirName->setOn(true); |
558 | break; | 556 | break; |
559 | case 2: | 557 | case 2: |
560 | m_aDirShort->setOn(true); | 558 | m_aDirShort->setOn(true); |
561 | break; | 559 | break; |
562 | case 1: | 560 | case 1: |
563 | default: | 561 | default: |
564 | m_aDirLong->setOn(true); | 562 | m_aDirLong->setOn(true); |
565 | } | 563 | } |
566 | m_gListViewMode->insert(m_aDirLong); | 564 | m_gListViewMode->insert(m_aDirLong); |
567 | m_gListViewMode->insert(m_aDirShort); | 565 | m_gListViewMode->insert(m_aDirShort); |
568 | m_gListViewMode->insert(m_aDirName); | 566 | m_gListViewMode->insert(m_aDirName); |
569 | 567 | ||
570 | m_gPrevNext = new QActionGroup(this,"imageprevnext",false); | 568 | m_gPrevNext = new QActionGroup(this,"imageprevnext",false); |
571 | m_aNext = new QAction( tr( "Next image" ), Resource::loadIconSet("forward"), 0, 0, this, 0, true ); | 569 | m_aNext = new QAction( tr( "Next image" ), Resource::loadIconSet("forward"), 0, 0, this, 0, true ); |
572 | m_aNext->setToggleAction(false); | 570 | m_aNext->setToggleAction(false); |
573 | connect(m_aNext,SIGNAL(activated()),m_view,SLOT(slotShowNext())); | 571 | connect(m_aNext,SIGNAL(activated()),m_view,SLOT(slotShowNext())); |
574 | m_aPrevious = new QAction( tr( "Previous image" ), Resource::loadIconSet("back"), 0, 0, this, 0, true ); | 572 | m_aPrevious = new QAction( tr( "Previous image" ), Resource::loadIconSet("back"), 0, 0, this, 0, true ); |
575 | m_aPrevious->setToggleAction(false); | 573 | m_aPrevious->setToggleAction(false); |
576 | connect(m_aPrevious,SIGNAL(activated()),m_view,SLOT(slotShowPrev())); | 574 | connect(m_aPrevious,SIGNAL(activated()),m_view,SLOT(slotShowPrev())); |
577 | m_gPrevNext->insert(m_aPrevious); | 575 | m_gPrevNext->insert(m_aPrevious); |
578 | m_gPrevNext->insert(m_aNext); | 576 | m_gPrevNext->insert(m_aNext); |
579 | 577 | ||
580 | m_aFullScreen = new QAction( tr( "Show images fullscreen" ), | 578 | m_aFullScreen = new QAction( tr( "Show images fullscreen" ), |
581 | Resource::loadIconSet("fullscreen"), 0, 0, this, 0, true ); | 579 | Resource::loadIconSet("fullscreen"), 0, 0, this, 0, true ); |
582 | m_aFullScreen->setToggleAction(true); | 580 | m_aFullScreen->setToggleAction(true); |
583 | if (autoSave) { | 581 | if (autoSave) { |