author | alwin <alwin> | 2005-03-05 16:28:16 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-05 16:28:16 (UTC) |
commit | c017febf6f4092bb968d12df5a30a0af30066048 (patch) (unidiff) | |
tree | cfeefc7fc3c2ee8a4485219e5dea502783f3db36 | |
parent | 206e91c510caba81f41704f11b097307d8daa6cb (diff) | |
download | opie-c017febf6f4092bb968d12df5a30a0af30066048.zip opie-c017febf6f4092bb968d12df5a30a0af30066048.tar.gz opie-c017febf6f4092bb968d12df5a30a0af30066048.tar.bz2 |
prepare for toggle of display mode of the different views
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 85 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 6 |
2 files changed, 61 insertions, 30 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 90e2e99..a96bfbd 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -1,739 +1,768 @@ | |||
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 | 52 | ||
52 | m_storage = new StorageInfo(); | 53 | m_storage = new StorageInfo(); |
53 | connect(m_storage, SIGNAL(disksChanged() ), | 54 | connect(m_storage, SIGNAL(disksChanged() ), |
54 | this, SLOT( dirChanged() ) ); | 55 | this, SLOT( dirChanged() ) ); |
55 | 56 | ||
56 | m_stack = new Opie::Ui::OWidgetStack( this ); | 57 | m_stack = new Opie::Ui::OWidgetStack( this ); |
57 | setCentralWidget( m_stack ); | 58 | setCentralWidget( m_stack ); |
58 | 59 | ||
59 | m_view = new PIconView( m_stack, m_cfg ); | 60 | m_view = new PIconView( m_stack, m_cfg ); |
60 | m_stack->addWidget( m_view, IconView ); | 61 | m_stack->addWidget( m_view, IconView ); |
61 | m_stack->raiseWidget( IconView ); | 62 | m_stack->raiseWidget( IconView ); |
62 | 63 | ||
63 | connect(m_view, SIGNAL(sig_display(const QString&)), | 64 | connect(m_view, SIGNAL(sig_display(const QString&)), |
64 | this, SLOT(slotDisplay(const QString&))); | 65 | this, SLOT(slotDisplay(const QString&))); |
65 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), | 66 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), |
66 | this, SLOT(slotShowInfo(const QString&)) ); | 67 | this, SLOT(slotShowInfo(const QString&)) ); |
67 | connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int))); | 68 | connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int))); |
68 | 69 | ||
69 | m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); | 70 | m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); |
70 | 71 | ||
71 | listviewMenu = 0; | 72 | listviewMenu = 0; |
72 | /* setup menu and toolbar */ | 73 | /* setup menu and toolbar */ |
73 | setupActions(); | 74 | setupActions(); |
74 | setupToolbar(); | 75 | setupToolbar(); |
75 | setupMenu(); | 76 | setupMenu(); |
76 | m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true)); | 77 | m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true)); |
77 | m_aAutoRotate->setEnabled(!m_aUnscaled->isOn()); | 78 | m_aAutoRotate->setEnabled(!m_aUnscaled->isOn()); |
79 | if (m_aForceSmall) { | ||
80 | m_aForceSmall->setOn(m_cfg->readBoolEntry("dontshowseperate",true)); | ||
81 | } | ||
78 | odebug << "mainwindow constructor done" << oendl; | 82 | odebug << "mainwindow constructor done" << oendl; |
79 | } | 83 | } |
80 | 84 | ||
81 | PMainWindow::~PMainWindow() { | 85 | PMainWindow::~PMainWindow() { |
82 | } | 86 | } |
83 | 87 | ||
84 | void PMainWindow::slotToggleZoomer() | 88 | void PMainWindow::slotToggleZoomer() |
85 | { | 89 | { |
86 | m_aZoomer->setOn(!m_aZoomer->isOn()); | 90 | m_aZoomer->setOn(!m_aZoomer->isOn()); |
87 | } | 91 | } |
88 | 92 | ||
89 | void PMainWindow::slotZoomerToggled(bool how) | 93 | void PMainWindow::slotZoomerToggled(bool how) |
90 | { | 94 | { |
91 | if (m_disp) { | 95 | if (m_disp) { |
92 | m_disp->setShowZoomer(how); | 96 | m_disp->setShowZoomer(how); |
93 | } | 97 | } |
94 | if (autoSave) { | 98 | if (autoSave) { |
95 | m_cfg->writeEntry("zoomeron",how); | 99 | m_cfg->writeEntry("zoomeron",how); |
96 | } | 100 | } |
97 | } | 101 | } |
98 | 102 | ||
99 | void PMainWindow::slotToggleAutorotate() | 103 | void PMainWindow::slotToggleAutorotate() |
100 | { | 104 | { |
101 | if (!m_aAutoRotate->isEnabled()) return; | 105 | if (!m_aAutoRotate->isEnabled()) return; |
102 | m_aAutoRotate->setOn(!m_aAutoRotate->isOn()); | 106 | m_aAutoRotate->setOn(!m_aAutoRotate->isOn()); |
103 | } | 107 | } |
104 | 108 | ||
105 | void PMainWindow::slotToggleAutoscale() | 109 | void PMainWindow::slotToggleAutoscale() |
106 | { | 110 | { |
107 | m_aUnscaled->setOn(!m_aUnscaled->isOn()); | 111 | m_aUnscaled->setOn(!m_aUnscaled->isOn()); |
108 | } | 112 | } |
109 | 113 | ||
110 | void PMainWindow::slotRotateToggled(bool how) | 114 | void PMainWindow::slotRotateToggled(bool how) |
111 | { | 115 | { |
112 | if (autoSave) { | 116 | if (autoSave) { |
113 | m_cfg->writeEntry("autorotate",how); | 117 | m_cfg->writeEntry("autorotate",how); |
114 | } | 118 | } |
115 | if (m_disp) { | 119 | if (m_disp) { |
116 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),how); | 120 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),how); |
117 | } | 121 | } |
118 | } | 122 | } |
119 | 123 | ||
120 | void PMainWindow::slotScaleToggled(bool how) | 124 | void PMainWindow::slotScaleToggled(bool how) |
121 | { | 125 | { |
122 | if (autoSave) { | 126 | if (autoSave) { |
123 | m_cfg->writeEntry("unscaled",how); | 127 | m_cfg->writeEntry("unscaled",how); |
124 | } | 128 | } |
125 | odebug << "Unscaled: " << m_aUnscaled->isOn() << oendl; | 129 | odebug << "Unscaled: " << m_aUnscaled->isOn() << oendl; |
126 | odebug << "How: " << how << oendl; | 130 | odebug << "How: " << how << oendl; |
127 | if (how) { | 131 | if (how) { |
128 | m_aAutoRotate->setOn(false); | 132 | m_aAutoRotate->setOn(false); |
129 | } | 133 | } |
130 | if (m_disp) { | 134 | if (m_disp) { |
131 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn()); | 135 | m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn()); |
132 | } | 136 | } |
133 | m_aAutoRotate->setEnabled(!how); | 137 | m_aAutoRotate->setEnabled(!how); |
134 | odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl; | 138 | odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl; |
135 | } | 139 | } |
136 | 140 | ||
137 | void PMainWindow::slotConfig() { | 141 | void PMainWindow::slotConfig() { |
138 | /* | 142 | /* |
139 | * have a tab with the possible views | 143 | * have a tab with the possible views |
140 | * a tab for globals image cache size.. scaled loading | 144 | * a tab for globals image cache size.. scaled loading |
141 | * and one tab for the KeyConfigs | 145 | * and one tab for the KeyConfigs |
142 | */ | 146 | */ |
143 | QDialog dlg(this, 0, true); | 147 | QDialog dlg(this, 0, true); |
144 | dlg.setCaption( tr("Opie Eye - Config" ) ); | 148 | dlg.setCaption( tr("Opie Eye - Config" ) ); |
145 | 149 | ||
146 | QHBoxLayout *lay = new QHBoxLayout(&dlg); | 150 | QHBoxLayout *lay = new QHBoxLayout(&dlg); |
147 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); | 151 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); |
148 | lay->addWidget( wid ); | 152 | lay->addWidget( wid ); |
149 | 153 | ||
150 | BaseSetup*bSetup = new BaseSetup(m_cfg,wid); | 154 | BaseSetup*bSetup = new BaseSetup(m_cfg,wid); |
151 | wid->addTab(bSetup,"SettingsIcon","Basics setup"); | 155 | wid->addTab(bSetup,"SettingsIcon","Basics setup"); |
152 | 156 | ||
153 | ViewMap *vM = viewMap(); | 157 | ViewMap *vM = viewMap(); |
154 | ViewMap::Iterator _it = vM->begin(); | 158 | ViewMap::Iterator _it = vM->begin(); |
155 | QMap<PDirView*, QWidget*> lst; | 159 | QMap<PDirView*, QWidget*> lst; |
156 | 160 | ||
157 | for( ; _it != vM->end(); ++_it ) { | 161 | for( ; _it != vM->end(); ++_it ) { |
158 | PDirView *view = (_it.data())(*m_cfg); | 162 | PDirView *view = (_it.data())(*m_cfg); |
159 | PInterfaceInfo *inf = view->interfaceInfo(); | 163 | PInterfaceInfo *inf = view->interfaceInfo(); |
160 | QWidget *_wid = inf->configWidget( *m_cfg ); | 164 | QWidget *_wid = inf->configWidget( *m_cfg ); |
161 | if (!_wid) continue; | 165 | if (!_wid) continue; |
162 | _wid->reparent(wid, QPoint() ); | 166 | _wid->reparent(wid, QPoint() ); |
163 | lst.insert( view, _wid ); | 167 | lst.insert( view, _wid ); |
164 | wid->addTab( _wid, "fileopen", inf->name() ); | 168 | wid->addTab( _wid, "fileopen", inf->name() ); |
165 | } | 169 | } |
166 | 170 | ||
167 | /* | 171 | /* |
168 | * Add the KeyConfigWidget | 172 | * Add the KeyConfigWidget |
169 | */ | 173 | */ |
170 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 174 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
171 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 175 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
172 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 176 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
173 | QWidget*w = m_stack->visibleWidget(); | 177 | QWidget*w = m_stack->visibleWidget(); |
174 | 178 | ||
175 | bool reminfo = false; | 179 | bool reminfo = false; |
176 | if ( !m_info ) { | 180 | if ( !m_info ) { |
177 | reminfo = true; | 181 | reminfo = true; |
178 | initInfo(); | 182 | initInfo(); |
179 | m_info->hide(); | 183 | m_info->hide(); |
180 | } | 184 | } |
181 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); | 185 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); |
182 | 186 | ||
183 | bool remdisp = false; | 187 | bool remdisp = false; |
184 | if ( !m_disp ) { | 188 | if ( !m_disp ) { |
185 | remdisp = true; | 189 | remdisp = true; |
186 | initDisp(); | 190 | initDisp(); |
187 | m_disp->hide(); | 191 | m_disp->hide(); |
188 | } | 192 | } |
189 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); | 193 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); |
190 | 194 | ||
191 | keyWid->load(); | 195 | keyWid->load(); |
192 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 196 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
193 | wid->setCurrentTab(0); | 197 | wid->setCurrentTab(0); |
194 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 198 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
195 | 199 | ||
196 | /* | 200 | /* |
197 | * clean up | 201 | * clean up |
198 | *apply changes | 202 | *apply changes |
199 | */ | 203 | */ |
200 | 204 | ||
201 | QMap<PDirView*, QWidget*>::Iterator it; | 205 | QMap<PDirView*, QWidget*>::Iterator it; |
202 | for ( it = lst.begin(); it != lst.end(); ++it ) { | 206 | for ( it = lst.begin(); it != lst.end(); ++it ) { |
203 | if ( act ) | 207 | if ( act ) |
204 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); | 208 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); |
205 | delete it.key(); | 209 | delete it.key(); |
206 | } | 210 | } |
207 | 211 | ||
208 | 212 | ||
209 | if ( act ) { | 213 | if ( act ) { |
210 | keyWid->save(); | 214 | keyWid->save(); |
211 | m_disp->manager()->save(); | 215 | m_disp->manager()->save(); |
212 | m_info->manager()->save(); | 216 | m_info->manager()->save(); |
213 | m_view->manager()->save(); | 217 | m_view->manager()->save(); |
214 | bSetup->save_values(); | 218 | bSetup->save_values(); |
215 | m_view->resetView(); | 219 | m_view->resetView(); |
216 | readConfig(); | 220 | readConfig(); |
217 | } | 221 | } |
218 | delete keyWid; | 222 | delete keyWid; |
219 | 223 | ||
220 | m_stack->raiseWidget(w); | 224 | m_stack->raiseWidget(w); |
221 | if (remdisp) { | 225 | if (remdisp) { |
222 | m_disp->hide(); | 226 | m_disp->hide(); |
223 | } | 227 | } |
224 | if (reminfo) { | 228 | if (reminfo) { |
225 | m_info->hide(); | 229 | m_info->hide(); |
226 | } | 230 | } |
227 | } | 231 | } |
228 | 232 | ||
229 | /* | 233 | /* |
230 | * create a new image info component | 234 | * create a new image info component |
231 | * and detach the current one | 235 | * and detach the current one |
232 | * we will make the other delete on exit | 236 | * we will make the other delete on exit |
233 | */ | 237 | */ |
234 | template<class T> | 238 | template<class T> |
235 | void PMainWindow::initT( const char* name, T** ptr, int id) { | 239 | void PMainWindow::initT( const char* name, T** ptr, int id) { |
236 | if ( *ptr ) { | 240 | if ( *ptr ) { |
237 | (*ptr)->disconnect(this, SLOT(slotReturn())); | 241 | (*ptr)->disconnect(this, SLOT(slotReturn())); |
238 | (*ptr)->setDestructiveClose(); | 242 | (*ptr)->setDestructiveClose(); |
239 | m_stack->removeWidget( *ptr ); | 243 | m_stack->removeWidget( *ptr ); |
240 | } | 244 | } |
241 | *ptr = new T(m_cfg, m_stack, name ); | 245 | *ptr = new T(m_cfg, m_stack, name ); |
242 | m_stack->addWidget( *ptr, id ); | 246 | m_stack->addWidget( *ptr, id ); |
243 | 247 | ||
244 | connect(*ptr, SIGNAL(sig_return()), | 248 | connect(*ptr, SIGNAL(sig_return()), |
245 | this,SLOT(slotReturn())); | 249 | this,SLOT(slotReturn())); |
246 | 250 | ||
247 | } | 251 | } |
248 | 252 | ||
249 | void PMainWindow::initInfo() { | 253 | void PMainWindow::initInfo() { |
250 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); | 254 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); |
251 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); | 255 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); |
252 | } | 256 | } |
253 | 257 | ||
254 | void PMainWindow::initDisp() { | 258 | void PMainWindow::initDisp() { |
255 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); | 259 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); |
256 | if (m_disp) { | 260 | if (m_disp) { |
257 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 261 | // if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
258 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); | 262 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); |
259 | } | 263 | // } |
260 | m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); | 264 | m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); |
261 | m_disp->setAutoScale(!m_aUnscaled->isOn()); | 265 | m_disp->setAutoScale(!m_aUnscaled->isOn()); |
262 | m_disp->setAutoRotate(m_aAutoRotate->isOn()); | 266 | m_disp->setAutoRotate(m_aAutoRotate->isOn()); |
263 | m_disp->setShowZoomer(m_aZoomer->isOn()); | 267 | m_disp->setShowZoomer(m_aZoomer->isOn()); |
264 | m_disp->setBackgroundColor(white); | 268 | m_disp->setBackgroundColor(white); |
265 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); | 269 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); |
266 | connect(m_disp,SIGNAL(dispNext()),m_view,SLOT(slotShowNext())); | 270 | connect(m_disp,SIGNAL(dispNext()),m_view,SLOT(slotShowNext())); |
267 | connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev())); | 271 | connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev())); |
268 | connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen())); | 272 | connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen())); |
269 | connect(m_disp,SIGNAL(hideMe()),this,SLOT(raiseIconView())); | 273 | connect(m_disp,SIGNAL(hideMe()),this,SLOT(raiseIconView())); |
270 | connect(m_disp,SIGNAL(toggleZoomer()),this,SLOT(slotToggleZoomer())); | 274 | connect(m_disp,SIGNAL(toggleZoomer()),this,SLOT(slotToggleZoomer())); |
271 | connect(m_disp,SIGNAL(toggleAutoscale()),this,SLOT(slotToggleAutoscale())); | 275 | connect(m_disp,SIGNAL(toggleAutoscale()),this,SLOT(slotToggleAutoscale())); |
272 | connect(m_disp,SIGNAL(toggleAutorotate()),this,SLOT(slotToggleAutorotate())); | 276 | connect(m_disp,SIGNAL(toggleAutorotate()),this,SLOT(slotToggleAutorotate())); |
273 | connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int))); | 277 | connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int))); |
274 | slotFullScreenToggled(m_aFullScreen->isOn()); | 278 | slotFullScreenToggled(m_aFullScreen->isOn()); |
275 | } | 279 | } |
276 | } | 280 | } |
277 | 281 | ||
278 | void PMainWindow::slotToggleFullScreen() | 282 | void PMainWindow::slotToggleFullScreen() |
279 | { | 283 | { |
280 | bool current = !m_aFullScreen->isOn(); | 284 | bool current = !m_aFullScreen->isOn(); |
281 | m_aFullScreen->setOn(current); | 285 | m_aFullScreen->setOn(current); |
282 | } | 286 | } |
283 | 287 | ||
284 | void PMainWindow::slotFullScreenButton(bool current) | 288 | void PMainWindow::slotFullScreenButton(bool current) |
285 | { | 289 | { |
286 | if (autoSave) { | 290 | if (autoSave) { |
287 | m_cfg->writeEntry("fullscreen",current); | 291 | m_cfg->writeEntry("fullscreen",current); |
288 | } | 292 | } |
289 | if (!m_disp) return; | 293 | if (!m_disp) return; |
290 | if (m_disp->isVisible()) { | 294 | if (m_disp->isVisible()) { |
291 | setupViewWindow(current, true); | 295 | setupViewWindow(current, true); |
292 | } | 296 | } |
293 | } | 297 | } |
294 | 298 | ||
295 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) | 299 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) |
296 | { | 300 | { |
297 | if (!m_disp) { | 301 | if (!m_disp) { |
298 | return; | 302 | return; |
299 | } | 303 | } |
300 | if (current) { | 304 | if (current) { |
301 | m_disp->setBackgroundColor(black); | 305 | m_disp->setBackgroundColor(black); |
302 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); | 306 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); |
303 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); | 307 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); |
304 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); | 308 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); |
305 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 309 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); |
306 | m_disp->setFullScreen(current,forceDisplay); | 310 | m_disp->setFullScreen(current,forceDisplay); |
307 | } else { | 311 | } else { |
308 | setUpdatesEnabled(false); | 312 | setUpdatesEnabled(false); |
313 | #if 0 | ||
309 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 314 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
310 | 315 | ||
311 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); | 316 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); |
312 | } else { | 317 | } else { |
313 | //m_disp->setMinimumSize(10,10); | 318 | //m_disp->setMinimumSize(10,10); |
314 | } | 319 | } |
315 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 320 | #endif |
316 | m_disp->reparent(0,QPoint(10,10)); | ||
317 | } else { | ||
318 | m_disp->reparent(0,QPoint(0,0)); | ||
319 | } | ||
320 | m_disp->setBackgroundColor(white); | 321 | m_disp->setBackgroundColor(white); |
321 | m_stack->addWidget(m_disp,ImageDisplay); | 322 | m_stack->addWidget(m_disp,ImageDisplay); |
322 | m_disp->setVScrollBarMode(QScrollView::Auto); | 323 | m_disp->setVScrollBarMode(QScrollView::Auto); |
323 | m_disp->setHScrollBarMode(QScrollView::Auto); | 324 | m_disp->setHScrollBarMode(QScrollView::Auto); |
324 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 325 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
325 | m_disp->setGeometry(30,30,QApplication::desktop()->width()-60,QApplication::desktop()->height()-60); | 326 | m_disp->setGeometry(30,30,QApplication::desktop()->width()-60,QApplication::desktop()->height()-60); |
326 | } | 327 | } |
327 | if (forceDisplay || m_disp->isVisible()) { | 328 | if (forceDisplay || m_disp->isVisible()) { |
328 | m_stack->raiseWidget(m_disp); | 329 | m_stack->raiseWidget(m_disp); |
329 | m_disp->setFocus(); | 330 | m_disp->setFocus(); |
330 | } | 331 | } |
331 | setUpdatesEnabled(true); | 332 | setUpdatesEnabled(true); |
332 | } | 333 | } |
333 | m_disp->setFullScreen(current,forceDisplay); | 334 | m_disp->setFullScreen(current,forceDisplay); |
334 | } | 335 | } |
335 | 336 | ||
336 | void PMainWindow::slotFullScreenToggled(bool current) | 337 | void PMainWindow::slotFullScreenToggled(bool current) |
337 | { | 338 | { |
338 | setupViewWindow(current,true); | 339 | setupViewWindow(current,true); |
339 | } | 340 | } |
340 | 341 | ||
341 | /** | 342 | /** |
342 | * With big Screen the plan could be to 'detach' the image | 343 | * With big Screen the plan could be to 'detach' the image |
343 | * window if visible and to create a ne wone | 344 | * window if visible and to create a ne wone |
344 | * init* already supports it but I make no use of it for | 345 | * init* already supports it but I make no use of it for |
345 | * now. We set filename and raise | 346 | * now. We set filename and raise |
346 | * | 347 | * |
347 | * ### FIXME and talk to alwin | 348 | * ### FIXME and talk to alwin |
348 | */ | 349 | */ |
349 | void PMainWindow::slotShowInfo( const QString& inf ) { | 350 | void PMainWindow::slotShowInfo( const QString& inf ) { |
350 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 351 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
351 | return; | 352 | return; |
352 | } | 353 | } |
353 | if ( !m_info ) { | 354 | if ( !m_info ) { |
354 | initInfo(); | 355 | initInfo(); |
355 | } | 356 | } |
356 | m_info->setPath( inf ); | 357 | m_info->setPath( inf ); |
357 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 358 | if (m_SmallWindow) { |
358 | m_aNext->removeFrom(toolBar); | 359 | m_aNext->removeFrom(toolBar); |
359 | m_aPrevious->removeFrom(toolBar); | 360 | m_aPrevious->removeFrom(toolBar); |
360 | m_aNext->setEnabled(false); | ||
361 | m_aPrevious->setEnabled(false); | ||
362 | m_aDirUp->setEnabled(false); | ||
363 | m_aShowInfo->setEnabled(false); | ||
364 | m_aViewfile->setEnabled(true); | ||
365 | m_aStartSlide->setEnabled(false); | ||
366 | fsButton->hide(); | 361 | fsButton->hide(); |
367 | } | 362 | } |
363 | m_aNext->setEnabled(false); | ||
364 | m_aPrevious->setEnabled(false); | ||
365 | m_aDirUp->setEnabled(false); | ||
366 | m_aShowInfo->setEnabled(false); | ||
367 | m_aViewfile->setEnabled(true); | ||
368 | m_aStartSlide->setEnabled(false); | ||
368 | m_stack->raiseWidget( ImageInfo ); | 369 | m_stack->raiseWidget( ImageInfo ); |
369 | } | 370 | } |
370 | 371 | ||
371 | void PMainWindow::slotDisplay( const QString& inf ) { | 372 | void PMainWindow::slotDisplay( const QString& inf ) { |
372 | bool nwindow = false; | 373 | bool nwindow = false; |
373 | if ( !m_disp ) { | 374 | if ( !m_disp ) { |
374 | nwindow = true; | 375 | nwindow = true; |
375 | initDisp(); | 376 | initDisp(); |
376 | } | 377 | } |
377 | m_disp->setImage( inf ); | 378 | m_disp->setImage( inf ); |
378 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 379 | if (m_SmallWindow) { |
379 | if (m_gPrevNext->isEnabled()==false) { | 380 | if (m_gPrevNext->isEnabled()==false) { |
380 | m_gPrevNext->addTo(toolBar); | 381 | m_gPrevNext->addTo(toolBar); |
381 | m_gPrevNext->setEnabled(true); | ||
382 | |||
383 | m_aDirUp->setEnabled(false); | ||
384 | m_aShowInfo->setEnabled(true); | ||
385 | m_aViewfile->setEnabled(false); | ||
386 | m_aStartSlide->setEnabled(false); | ||
387 | fsButton->hide(); | 382 | fsButton->hide(); |
388 | } | 383 | } |
389 | } | 384 | } |
385 | m_gPrevNext->setEnabled(true); | ||
386 | m_aDirUp->setEnabled(false); | ||
387 | m_aShowInfo->setEnabled(true); | ||
388 | m_aViewfile->setEnabled(false); | ||
389 | m_aStartSlide->setEnabled(false); | ||
390 | |||
390 | if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { | 391 | if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { |
391 | slotFullScreenToggled(m_aFullScreen->isOn()); | 392 | slotFullScreenToggled(m_aFullScreen->isOn()); |
392 | } | 393 | } |
393 | if (m_disp->fullScreen()) { | 394 | if (m_disp->fullScreen()) { |
394 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | 395 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); |
395 | } else { | 396 | } else { |
396 | m_stack->raiseWidget( ImageDisplay ); | 397 | m_stack->raiseWidget( ImageDisplay ); |
397 | } | 398 | } |
398 | } | 399 | } |
399 | 400 | ||
400 | void PMainWindow::raiseIconView() { | 401 | void PMainWindow::raiseIconView() { |
401 | setUpdatesEnabled(false); | 402 | setUpdatesEnabled(false); |
402 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 403 | if (m_SmallWindow) { |
403 | m_gPrevNext->removeFrom(toolBar); | 404 | m_gPrevNext->removeFrom(toolBar); |
404 | m_gPrevNext->setEnabled(false); | ||
405 | m_aDirUp->setEnabled(true); | ||
406 | m_aShowInfo->setEnabled(true); | ||
407 | m_aViewfile->setEnabled(true); | ||
408 | m_aStartSlide->setEnabled(true); | ||
409 | fsButton->show(); | 405 | fsButton->show(); |
410 | } | 406 | } |
407 | m_gPrevNext->setEnabled(false); | ||
408 | m_aDirUp->setEnabled(true); | ||
409 | m_aShowInfo->setEnabled(true); | ||
410 | m_aViewfile->setEnabled(true); | ||
411 | m_aStartSlide->setEnabled(true); | ||
412 | |||
411 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 413 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
412 | m_disp->stopSlide(); | 414 | m_disp->stopSlide(); |
413 | m_disp->hide(); | 415 | m_disp->hide(); |
414 | } | 416 | } |
415 | m_stack->raiseWidget( IconView ); | 417 | m_stack->raiseWidget( IconView ); |
416 | setUpdatesEnabled(true); | 418 | setUpdatesEnabled(true); |
417 | repaint(); | 419 | repaint(); |
418 | } | 420 | } |
419 | 421 | ||
420 | void PMainWindow::slotReturn() { | 422 | void PMainWindow::slotReturn() { |
421 | raiseIconView(); | 423 | raiseIconView(); |
422 | } | 424 | } |
423 | 425 | ||
424 | 426 | ||
425 | void PMainWindow::closeEvent( QCloseEvent* ev ) { | 427 | void PMainWindow::closeEvent( QCloseEvent* ev ) { |
426 | /* | 428 | /* |
427 | * return from view | 429 | * return from view |
428 | * or properly quit | 430 | * or properly quit |
429 | */ | 431 | */ |
430 | if (!m_setDocCalled) { | 432 | if (!m_setDocCalled) { |
431 | if ( m_stack->visibleWidget() == m_info || | 433 | if ( m_stack->visibleWidget() == m_info || |
432 | m_stack->visibleWidget() == m_disp ) { | 434 | m_stack->visibleWidget() == m_disp ) { |
433 | ev->ignore(); | 435 | ev->ignore(); |
434 | raiseIconView(); | 436 | raiseIconView(); |
435 | return; | 437 | return; |
436 | } | 438 | } |
437 | } | 439 | } |
438 | if (m_disp && m_disp->fullScreen()) { | 440 | if (m_disp && m_disp->fullScreen()) { |
439 | /* otherwise opie-eye crashes in bigscreen mode! */ | 441 | /* otherwise opie-eye crashes in bigscreen mode! */ |
440 | m_disp->reparent(0,QPoint(0,0)); | 442 | m_disp->reparent(0,QPoint(0,0)); |
441 | m_stack->addWidget(m_disp,ImageDisplay); | 443 | m_stack->addWidget(m_disp,ImageDisplay); |
442 | } | 444 | } |
443 | ev->accept(); | 445 | ev->accept(); |
444 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); | 446 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); |
445 | } | 447 | } |
446 | 448 | ||
447 | void PMainWindow::setDocument( const QString& showImg ) | 449 | void PMainWindow::setDocument( const QString& showImg ) |
448 | { | 450 | { |
449 | QString file = showImg; | 451 | QString file = showImg; |
450 | DocLnk lnk(showImg); | 452 | DocLnk lnk(showImg); |
451 | if (lnk.isValid() ) | 453 | if (lnk.isValid() ) |
452 | file = lnk.file(); | 454 | file = lnk.file(); |
453 | slotDisplay( file ); | 455 | slotDisplay( file ); |
454 | #if 0 | 456 | #if 0 |
455 | if (!m_polishDone) { | 457 | if (!m_polishDone) { |
456 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); | 458 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); |
457 | } | 459 | } |
458 | #endif | 460 | #endif |
459 | } | 461 | } |
460 | 462 | ||
461 | void PMainWindow::check_view_fullscreen() | 463 | void PMainWindow::check_view_fullscreen() |
462 | { | 464 | { |
463 | if (!m_view) return; | 465 | if (!m_view) return; |
464 | if (!m_view->hasFocus()&&m_aFullScreen->isOn()) { | 466 | if (!m_view->hasFocus()&&m_aFullScreen->isOn()) { |
465 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | 467 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); |
466 | } | 468 | } |
467 | } | 469 | } |
468 | 470 | ||
469 | void PMainWindow::slotSelectDir(int id) | 471 | void PMainWindow::slotSelectDir(int id) |
470 | { | 472 | { |
471 | emit changeDir( m_dev[fsMenu->text(id )] ); | 473 | emit changeDir( m_dev[fsMenu->text(id )] ); |
472 | } | 474 | } |
473 | 475 | ||
474 | void PMainWindow::dirChanged() | 476 | void PMainWindow::dirChanged() |
475 | { | 477 | { |
476 | fsMenu->clear(); | 478 | fsMenu->clear(); |
477 | m_dev.clear(); | 479 | m_dev.clear(); |
478 | 480 | ||
479 | /* home dir, too */ | 481 | /* home dir, too */ |
480 | QString f = getenv( "HOME" ); | 482 | QString f = getenv( "HOME" ); |
481 | if (!f.isEmpty()) { | 483 | if (!f.isEmpty()) { |
482 | m_dev.insert("Home directory",f); | 484 | m_dev.insert("Home directory",f); |
483 | fsMenu->insertItem("Home directory"); | 485 | fsMenu->insertItem("Home directory"); |
484 | } | 486 | } |
485 | const QList<FileSystem> &fs = m_storage->fileSystems(); | 487 | const QList<FileSystem> &fs = m_storage->fileSystems(); |
486 | QListIterator<FileSystem> it(fs ); | 488 | QListIterator<FileSystem> it(fs ); |
487 | for ( ; it.current(); ++it ) { | 489 | for ( ; it.current(); ++it ) { |
488 | const QString disk = (*it)->name(); | 490 | const QString disk = (*it)->name(); |
489 | const QString path = (*it)->path(); | 491 | const QString path = (*it)->path(); |
490 | m_dev.insert( disk, path ); | 492 | m_dev.insert( disk, path ); |
491 | fsMenu->insertItem( disk ); | 493 | fsMenu->insertItem( disk ); |
492 | } | 494 | } |
493 | } | 495 | } |
494 | 496 | ||
495 | void PMainWindow::showToolbar(bool how) | 497 | void PMainWindow::showToolbar(bool how) |
496 | { | 498 | { |
497 | if (!how) toolBar->hide(); | 499 | if (!how) toolBar->hide(); |
498 | else toolBar->show(); | 500 | else toolBar->show(); |
499 | if (autoSave) { | 501 | if (autoSave) { |
500 | m_cfg->writeEntry("showtoolbar",how); | 502 | m_cfg->writeEntry("showtoolbar",how); |
501 | } | 503 | } |
502 | } | 504 | } |
503 | 505 | ||
504 | void PMainWindow::setupActions() | 506 | void PMainWindow::setupActions() |
505 | { | 507 | { |
506 | m_aDirUp = new QAction( tr( "Go dir up" ), Resource::loadIconSet( "up" ), 0, 0, this, 0, true ); | 508 | m_aDirUp = new QAction( tr( "Go dir up" ), Resource::loadIconSet( "up" ), 0, 0, this, 0, true ); |
507 | m_aDirUp->setToggleAction(false); | 509 | m_aDirUp->setToggleAction(false); |
508 | connect(m_aDirUp,SIGNAL(activated()),m_view,SLOT(slotDirUp())); | 510 | connect(m_aDirUp,SIGNAL(activated()),m_view,SLOT(slotDirUp())); |
509 | 511 | ||
510 | if ( Ir::supported() ) { | 512 | if ( Ir::supported() ) { |
511 | m_aBeam = new QAction( tr( "Beam file" ), Resource::loadIconSet( "beam" ),0, 0, this, 0, true ); | 513 | m_aBeam = new QAction( tr( "Beam file" ), Resource::loadIconSet( "beam" ),0, 0, this, 0, true ); |
512 | m_aBeam->setToggleAction(false); | 514 | m_aBeam->setToggleAction(false); |
513 | connect(m_aBeam,SIGNAL(activated()),m_view,SLOT(slotBeam())); | 515 | connect(m_aBeam,SIGNAL(activated()),m_view,SLOT(slotBeam())); |
514 | } else { | 516 | } else { |
515 | m_aBeam = 0; | 517 | m_aBeam = 0; |
516 | } | 518 | } |
517 | 519 | ||
518 | m_aShowInfo = new QAction( tr( "Show imageinfo" ), Resource::loadIconSet( "edit" ), 0, 0, this, 0, true ); | 520 | m_aShowInfo = new QAction( tr( "Show imageinfo" ), Resource::loadIconSet( "edit" ), 0, 0, this, 0, true ); |
519 | m_aShowInfo->setToggleAction(false); | 521 | m_aShowInfo->setToggleAction(false); |
520 | connect(m_aShowInfo,SIGNAL(activated()),m_view,SLOT(slotImageInfo())); | 522 | connect(m_aShowInfo,SIGNAL(activated()),m_view,SLOT(slotImageInfo())); |
521 | 523 | ||
522 | m_aTrash = new QAction( tr( "Delete file" ), Resource::loadIconSet("trash"), 0, 0, this, 0, true ); | 524 | m_aTrash = new QAction( tr( "Delete file" ), Resource::loadIconSet("trash"), 0, 0, this, 0, true ); |
523 | m_aTrash->setToggleAction(false); | 525 | m_aTrash->setToggleAction(false); |
524 | connect(m_aTrash,SIGNAL(activated()),m_view,SLOT(slotTrash())); | 526 | connect(m_aTrash,SIGNAL(activated()),m_view,SLOT(slotTrash())); |
525 | 527 | ||
526 | m_aViewfile = new QAction( tr( "Display image" ), Resource::loadIconSet("mag"), 0, 0, this, 0, true ); | 528 | m_aViewfile = new QAction( tr( "Display image" ), Resource::loadIconSet("mag"), 0, 0, this, 0, true ); |
527 | m_aViewfile->setToggleAction(false); | 529 | m_aViewfile->setToggleAction(false); |
528 | connect(m_aViewfile,SIGNAL(activated()),m_view,SLOT(slotShowImage())); | 530 | connect(m_aViewfile,SIGNAL(activated()),m_view,SLOT(slotShowImage())); |
529 | 531 | ||
530 | m_aStartSlide = new QAction( tr( "Start slideshow" ), Resource::loadIconSet("play"),0, 0, this, 0, true ); | 532 | m_aStartSlide = new QAction( tr( "Start slideshow" ), Resource::loadIconSet("play"),0, 0, this, 0, true ); |
531 | m_aStartSlide->setToggleAction(false); | 533 | m_aStartSlide->setToggleAction(false); |
532 | connect(m_aStartSlide,SIGNAL(activated()),m_view,SLOT(slotStartSlide())); | 534 | connect(m_aStartSlide,SIGNAL(activated()),m_view,SLOT(slotStartSlide())); |
533 | 535 | ||
534 | m_aHideToolbar = new QAction( tr( "Show toolbar" ), Resource::loadIconSet( "UtilsIcon" ), 0, 0, this, 0, true ); | 536 | m_aHideToolbar = new QAction( tr( "Show toolbar" ), Resource::loadIconSet( "UtilsIcon" ), 0, 0, this, 0, true ); |
535 | m_aHideToolbar->setOn (true); | 537 | m_aHideToolbar->setOn (true); |
536 | connect(m_aHideToolbar,SIGNAL(toggled(bool)),this,SLOT(showToolbar(bool))); | 538 | connect(m_aHideToolbar,SIGNAL(toggled(bool)),this,SLOT(showToolbar(bool))); |
537 | 539 | ||
538 | m_aSetup = new QAction( tr( "Settings" ), Resource::loadIconSet("SettingsIcon"), 0, 0, this, 0, true ); | 540 | m_aSetup = new QAction( tr( "Settings" ), Resource::loadIconSet("SettingsIcon"), 0, 0, this, 0, true ); |
539 | m_aSetup->setToggleAction(false); | 541 | m_aSetup->setToggleAction(false); |
540 | connect(m_aSetup,SIGNAL(activated()),this,SLOT(slotConfig())); | 542 | connect(m_aSetup,SIGNAL(activated()),this,SLOT(slotConfig())); |
541 | 543 | ||
542 | m_gListViewMode = new QActionGroup(this,"Select listmode",true); | 544 | m_gListViewMode = new QActionGroup(this,"Select listmode",true); |
543 | connect(m_gListViewMode,SIGNAL(selected(QAction*)),this,SLOT(listviewselected(QAction*))); | 545 | connect(m_gListViewMode,SIGNAL(selected(QAction*)),this,SLOT(listviewselected(QAction*))); |
544 | 546 | ||
545 | m_aDirLong = new QAction( tr( "Thumbnail and Imageinfo" ),Resource::loadIconSet("opie-eye/opie-eye-thumb"), 0, 0, this, 0, true ); | 547 | m_aDirLong = new QAction( tr( "Thumbnail and Imageinfo" ),Resource::loadIconSet("opie-eye/opie-eye-thumb"), 0, 0, this, 0, true ); |
546 | m_aDirLong->setToggleAction(true); | 548 | m_aDirLong->setToggleAction(true); |
547 | m_aDirShort = new QAction( tr( "Thumbnail and name" ),Resource::loadIconSet("opie-eye/opie-eye-thumbonly"), 0, 0, this, 0, true ); | 549 | m_aDirShort = new QAction( tr( "Thumbnail and name" ),Resource::loadIconSet("opie-eye/opie-eye-thumbonly"), 0, 0, this, 0, true ); |
548 | m_aDirShort->setToggleAction(true); | 550 | m_aDirShort->setToggleAction(true); |
549 | m_aDirName = new QAction( tr( "Name only" ), Resource::loadIconSet("opie-eye/opie-eye-textview"),0, 0, this, 0, true ); | 551 | m_aDirName = new QAction( tr( "Name only" ), Resource::loadIconSet("opie-eye/opie-eye-textview"),0, 0, this, 0, true ); |
550 | m_aDirName->setToggleAction(true); | 552 | m_aDirName->setToggleAction(true); |
551 | int mode = m_cfg->readNumEntry("ListViewMode", 1); | 553 | int mode = m_cfg->readNumEntry("ListViewMode", 1); |
552 | if (mode < 1 || mode>3) mode = 1; | 554 | if (mode < 1 || mode>3) mode = 1; |
553 | switch (mode) { | 555 | switch (mode) { |
554 | case 3: | 556 | case 3: |
555 | m_aDirName->setOn(true); | 557 | m_aDirName->setOn(true); |
556 | break; | 558 | break; |
557 | case 2: | 559 | case 2: |
558 | m_aDirShort->setOn(true); | 560 | m_aDirShort->setOn(true); |
559 | break; | 561 | break; |
560 | case 1: | 562 | case 1: |
561 | default: | 563 | default: |
562 | m_aDirLong->setOn(true); | 564 | m_aDirLong->setOn(true); |
563 | } | 565 | } |
564 | m_gListViewMode->insert(m_aDirLong); | 566 | m_gListViewMode->insert(m_aDirLong); |
565 | m_gListViewMode->insert(m_aDirShort); | 567 | m_gListViewMode->insert(m_aDirShort); |
566 | m_gListViewMode->insert(m_aDirName); | 568 | m_gListViewMode->insert(m_aDirName); |
567 | 569 | ||
568 | m_gPrevNext = new QActionGroup(this,"imageprevnext",false); | 570 | m_gPrevNext = new QActionGroup(this,"imageprevnext",false); |
569 | m_aNext = new QAction( tr( "Next image" ), Resource::loadIconSet("forward"), 0, 0, this, 0, true ); | 571 | m_aNext = new QAction( tr( "Next image" ), Resource::loadIconSet("forward"), 0, 0, this, 0, true ); |
570 | m_aNext->setToggleAction(false); | 572 | m_aNext->setToggleAction(false); |
571 | connect(m_aNext,SIGNAL(activated()),m_view,SLOT(slotShowNext())); | 573 | connect(m_aNext,SIGNAL(activated()),m_view,SLOT(slotShowNext())); |
572 | m_aPrevious = new QAction( tr( "Previous image" ), Resource::loadIconSet("back"), 0, 0, this, 0, true ); | 574 | m_aPrevious = new QAction( tr( "Previous image" ), Resource::loadIconSet("back"), 0, 0, this, 0, true ); |
573 | m_aPrevious->setToggleAction(false); | 575 | m_aPrevious->setToggleAction(false); |
574 | connect(m_aPrevious,SIGNAL(activated()),m_view,SLOT(slotShowPrev())); | 576 | connect(m_aPrevious,SIGNAL(activated()),m_view,SLOT(slotShowPrev())); |
575 | m_gPrevNext->insert(m_aPrevious); | 577 | m_gPrevNext->insert(m_aPrevious); |
576 | m_gPrevNext->insert(m_aNext); | 578 | m_gPrevNext->insert(m_aNext); |
577 | 579 | ||
578 | m_aFullScreen = new QAction( tr( "Show images fullscreen" ), | 580 | m_aFullScreen = new QAction( tr( "Show images fullscreen" ), |
579 | Resource::loadIconSet("fullscreen"), 0, 0, this, 0, true ); | 581 | Resource::loadIconSet("fullscreen"), 0, 0, this, 0, true ); |
580 | m_aFullScreen->setToggleAction(true); | 582 | m_aFullScreen->setToggleAction(true); |
581 | if (autoSave) { | 583 | if (autoSave) { |
582 | m_aFullScreen->setOn(m_cfg->readBoolEntry("fullscreen",false)); | 584 | m_aFullScreen->setOn(m_cfg->readBoolEntry("fullscreen",false)); |
583 | } else { | 585 | } else { |
584 | m_aFullScreen->setOn(false); | 586 | m_aFullScreen->setOn(false); |
585 | } | 587 | } |
586 | connect(m_aFullScreen,SIGNAL(toggled(bool)),this,SLOT(slotFullScreenButton(bool))); | 588 | connect(m_aFullScreen,SIGNAL(toggled(bool)),this,SLOT(slotFullScreenButton(bool))); |
587 | 589 | ||
588 | m_gDisplayType = new QActionGroup(this,"imagedisplaytype",false); | 590 | m_gDisplayType = new QActionGroup(this,"imagedisplaytype",false); |
589 | m_aAutoRotate = new QAction( tr( "Auto rotate images" ), Resource::loadIconSet( "rotate" ), 0, 0, this, 0, true ); | 591 | m_aAutoRotate = new QAction( tr( "Auto rotate images" ), Resource::loadIconSet( "rotate" ), 0, 0, this, 0, true ); |
590 | m_aAutoRotate->setToggleAction(true); | 592 | m_aAutoRotate->setToggleAction(true); |
591 | 593 | ||
592 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 594 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { |
593 | m_aAutoRotate->setOn(true); | 595 | m_aAutoRotate->setOn(true); |
594 | } else { | 596 | } else { |
595 | m_aAutoRotate->setOn(false); | 597 | m_aAutoRotate->setOn(false); |
596 | } | 598 | } |
597 | if (autoSave) { | 599 | if (autoSave) { |
598 | m_aAutoRotate->setOn(m_cfg->readBoolEntry("autorotate",m_aAutoRotate->isOn())); | 600 | m_aAutoRotate->setOn(m_cfg->readBoolEntry("autorotate",m_aAutoRotate->isOn())); |
599 | } | 601 | } |
600 | connect(m_aAutoRotate,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); | 602 | connect(m_aAutoRotate,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); |
601 | 603 | ||
602 | m_aUnscaled = new QAction( tr( "Show images unscaled" ), Resource::loadIconSet( "1to1" ), 0, 0, this, 0, true ); | 604 | m_aUnscaled = new QAction( tr( "Show images unscaled" ), Resource::loadIconSet( "1to1" ), 0, 0, this, 0, true ); |
603 | m_aUnscaled->setToggleAction(true); | 605 | m_aUnscaled->setToggleAction(true); |
604 | connect(m_aUnscaled,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); | 606 | connect(m_aUnscaled,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); |
605 | if (autoSave) { | 607 | if (autoSave) { |
606 | m_aUnscaled->setOn(m_cfg->readBoolEntry("unscaled",false)); | 608 | m_aUnscaled->setOn(m_cfg->readBoolEntry("unscaled",false)); |
607 | } else { | 609 | } else { |
608 | m_aUnscaled->setOn(false); | 610 | m_aUnscaled->setOn(false); |
609 | } | 611 | } |
610 | 612 | ||
611 | m_aZoomer = new QAction( tr( "Show zoomer window when unscaled" ), Resource::loadIconSet( "mag" ), 0, 0, this, 0, true ); | 613 | m_aZoomer = new QAction( tr( "Show zoomer window when unscaled" ), Resource::loadIconSet( "mag" ), 0, 0, this, 0, true ); |
612 | m_aZoomer->setToggleAction(true); | 614 | m_aZoomer->setToggleAction(true); |
613 | if (autoSave) { | 615 | if (autoSave) { |
614 | m_aZoomer->setOn(m_cfg->readBoolEntry("zoomeron",true)); | 616 | m_aZoomer->setOn(m_cfg->readBoolEntry("zoomeron",true)); |
615 | } else { | 617 | } else { |
616 | m_aZoomer->setOn (true); | 618 | m_aZoomer->setOn (true); |
617 | } | 619 | } |
618 | connect(m_aZoomer,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool))); | 620 | connect(m_aZoomer,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool))); |
619 | m_gDisplayType->insert(m_aAutoRotate); | 621 | m_gDisplayType->insert(m_aAutoRotate); |
620 | m_gDisplayType->insert(m_aUnscaled); | 622 | m_gDisplayType->insert(m_aUnscaled); |
621 | m_gDisplayType->insert(m_aZoomer); | 623 | m_gDisplayType->insert(m_aZoomer); |
622 | 624 | ||
623 | m_hGroup = new QActionGroup(this,"actioncollection",false); | 625 | m_hGroup = new QActionGroup(this,"actioncollection",false); |
624 | m_hGroup->insert(m_aFullScreen); | 626 | m_hGroup->insert(m_aFullScreen); |
627 | |||
628 | if (!m_SmallWindow) { | ||
629 | m_aForceSmall = new QAction(tr("Dont show seperate windows"),Resource::loadIconSet( "AppsIcon" ), 0, 0, this, 0, true); | ||
630 | m_aForceSmall->setToggleAction(true); | ||
631 | connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool))); | ||
632 | } else { | ||
633 | m_aForceSmall = 0; | ||
634 | } | ||
625 | } | 635 | } |
626 | 636 | ||
627 | void PMainWindow::setupToolbar() | 637 | void PMainWindow::setupToolbar() |
628 | { | 638 | { |
629 | toolBar = new QToolBar( this ); | 639 | toolBar = new QToolBar( this ); |
630 | addToolBar(toolBar); | 640 | addToolBar(toolBar); |
631 | toolBar->setHorizontalStretchable( true ); | 641 | toolBar->setHorizontalStretchable( true ); |
632 | setToolBarsMovable( false ); | 642 | setToolBarsMovable( false ); |
633 | m_aDirUp->addTo( toolBar ); | 643 | m_aDirUp->addTo( toolBar ); |
634 | 644 | ||
635 | fsButton = new PFileSystem( toolBar ); | 645 | fsButton = new PFileSystem( toolBar ); |
636 | connect( fsButton, SIGNAL( changeDir( const QString& ) ), | 646 | connect( fsButton, SIGNAL( changeDir( const QString& ) ), |
637 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | 647 | m_view, SLOT(slotChangeDir( const QString& ) ) ); |
638 | connect( this, SIGNAL( changeDir( const QString& ) ), | 648 | connect( this, SIGNAL( changeDir( const QString& ) ), |
639 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | 649 | m_view, SLOT(slotChangeDir( const QString& ) ) ); |
640 | 650 | ||
641 | if (m_aBeam) { | 651 | if (m_aBeam) { |
642 | m_aBeam->addTo( toolBar ); | 652 | m_aBeam->addTo( toolBar ); |
643 | } | 653 | } |
644 | m_aShowInfo->addTo(toolBar); | 654 | m_aShowInfo->addTo(toolBar); |
645 | m_aTrash->addTo(toolBar); | 655 | m_aTrash->addTo(toolBar); |
646 | // m_aSetup->addTo(toolBar); | 656 | // m_aSetup->addTo(toolBar); |
647 | 657 | ||
648 | m_gDisplayType->addTo(toolBar); | 658 | m_gDisplayType->addTo(toolBar); |
649 | 659 | ||
650 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 660 | if (!m_SmallWindow) { |
651 | m_gPrevNext->addTo(toolBar); | 661 | m_gPrevNext->addTo(toolBar); |
652 | } else { | 662 | } else { |
653 | m_gPrevNext->setEnabled(false); | 663 | m_gPrevNext->setEnabled(false); |
654 | } | 664 | } |
655 | } | 665 | } |
656 | 666 | ||
657 | void PMainWindow::setupMenu() | 667 | void PMainWindow::setupMenu() |
658 | { | 668 | { |
659 | fileMenu = new QPopupMenu( menuBar() ); | 669 | fileMenu = new QPopupMenu( menuBar() ); |
660 | menuBar()->insertItem( tr( "File" ), fileMenu ); | 670 | menuBar()->insertItem( tr( "File" ), fileMenu ); |
661 | dispMenu = new QPopupMenu( menuBar() ); | 671 | dispMenu = new QPopupMenu( menuBar() ); |
662 | menuBar()->insertItem( tr( "Show" ), dispMenu ); | 672 | menuBar()->insertItem( tr( "Show" ), dispMenu ); |
663 | settingsMenu = new QPopupMenu( menuBar() ); | 673 | settingsMenu = new QPopupMenu( menuBar() ); |
664 | menuBar()->insertItem( tr( "Settings" ), settingsMenu ); | 674 | menuBar()->insertItem( tr( "Settings" ), settingsMenu ); |
665 | 675 | ||
666 | m_aViewfile->addTo(fileMenu); | 676 | m_aViewfile->addTo(fileMenu); |
667 | m_aShowInfo->addTo(fileMenu); | 677 | m_aShowInfo->addTo(fileMenu); |
668 | m_aStartSlide->addTo(fileMenu); | 678 | m_aStartSlide->addTo(fileMenu); |
669 | 679 | ||
670 | fileMenu->insertSeparator(); | 680 | fileMenu->insertSeparator(); |
671 | m_aDirUp->addTo( fileMenu ); | 681 | m_aDirUp->addTo( fileMenu ); |
672 | 682 | ||
673 | fsMenu = new QPopupMenu(fileMenu); | 683 | fsMenu = new QPopupMenu(fileMenu); |
674 | fileMenu->insertItem(Resource::loadIconSet( "cardmon/pcmcia" ),tr("Select filesystem"),fsMenu); | 684 | fileMenu->insertItem(Resource::loadIconSet( "cardmon/pcmcia" ),tr("Select filesystem"),fsMenu); |
675 | connect( fsMenu, SIGNAL( activated( int ) ), this, SLOT(slotSelectDir( int ) ) ); | 685 | connect( fsMenu, SIGNAL( activated( int ) ), this, SLOT(slotSelectDir( int ) ) ); |
676 | dirChanged(); | 686 | dirChanged(); |
677 | 687 | ||
678 | if ( m_aBeam ) { | 688 | if ( m_aBeam ) { |
679 | fileMenu->insertSeparator(); | 689 | fileMenu->insertSeparator(); |
680 | m_aBeam->addTo( fileMenu ); | 690 | m_aBeam->addTo( fileMenu ); |
681 | } | 691 | } |
682 | fileMenu->insertSeparator(); | 692 | fileMenu->insertSeparator(); |
683 | m_aTrash->addTo(fileMenu); | 693 | m_aTrash->addTo(fileMenu); |
684 | 694 | ||
685 | listviewMenu = new QPopupMenu(dispMenu); | 695 | listviewMenu = new QPopupMenu(dispMenu); |
686 | dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); | 696 | dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); |
687 | m_gListViewMode->addTo(listviewMenu); | 697 | m_gListViewMode->addTo(listviewMenu); |
688 | dispMenu->insertSeparator(); | 698 | dispMenu->insertSeparator(); |
689 | m_aFullScreen->addTo(dispMenu); | 699 | m_aFullScreen->addTo(dispMenu); |
690 | m_gDisplayType->addTo(dispMenu); | 700 | m_gDisplayType->addTo(dispMenu); |
691 | dispMenu->insertSeparator(); | 701 | dispMenu->insertSeparator(); |
692 | m_gPrevNext->addTo(dispMenu); | 702 | m_gPrevNext->addTo(dispMenu); |
703 | if (m_aForceSmall) { | ||
704 | dispMenu->insertSeparator(); | ||
705 | m_aForceSmall->addTo(dispMenu); | ||
706 | } | ||
693 | 707 | ||
694 | m_aSetup->addTo(settingsMenu); | 708 | m_aSetup->addTo(settingsMenu); |
695 | m_aHideToolbar->addTo(settingsMenu); | 709 | m_aHideToolbar->addTo(settingsMenu); |
696 | } | 710 | } |
697 | 711 | ||
698 | void PMainWindow::listviewselected(QAction*which) | 712 | void PMainWindow::listviewselected(QAction*which) |
699 | { | 713 | { |
700 | if (!which || which->isOn()==false) return; | 714 | if (!which || which->isOn()==false) return; |
701 | int val = 1; | 715 | int val = 1; |
702 | 716 | ||
703 | if (which==m_aDirName) { | 717 | if (which==m_aDirName) { |
704 | val = 3; | 718 | val = 3; |
705 | } else if (which==m_aDirShort) { | 719 | } else if (which==m_aDirShort) { |
706 | val = 2; | 720 | val = 2; |
707 | } else if (which==m_aDirLong) { | 721 | } else if (which==m_aDirLong) { |
708 | val = 1; | 722 | val = 1; |
709 | } | 723 | } |
710 | emit changeListMode(val); | 724 | emit changeListMode(val); |
711 | } | 725 | } |
712 | 726 | ||
713 | void PMainWindow::readConfig() | 727 | void PMainWindow::readConfig() |
714 | { | 728 | { |
715 | autoSave =m_cfg->readBoolEntry("savestatus",true); | 729 | autoSave =m_cfg->readBoolEntry("savestatus",true); |
716 | } | 730 | } |
717 | 731 | ||
718 | void PMainWindow::polish() | 732 | void PMainWindow::polish() |
719 | { | 733 | { |
720 | if (m_disp) { | 734 | if (m_disp) { |
721 | odebug << "======================\n" | 735 | odebug << "======================\n" |
722 | << "Called via setdocument\n" | 736 | << "Called via setdocument\n" |
723 | << "======================" << oendl; | 737 | << "======================" << oendl; |
724 | m_setDocCalled = true; | 738 | m_setDocCalled = true; |
725 | m_view->setDoccalled(true); | 739 | m_view->setDoccalled(true); |
726 | m_disp->setCloseIfHide(true); | 740 | m_disp->setCloseIfHide(true); |
727 | } else { | 741 | } else { |
728 | m_setDocCalled = false; | 742 | m_setDocCalled = false; |
729 | m_view->setDoccalled(false); | 743 | m_view->setDoccalled(false); |
730 | } | 744 | } |
731 | m_polishDone = true; | 745 | m_polishDone = true; |
732 | QMainWindow::polish(); | 746 | QMainWindow::polish(); |
733 | if (m_setDocCalled) { | 747 | if (m_setDocCalled) { |
734 | if (m_aFullScreen->isOn()) { | 748 | if (m_aFullScreen->isOn()) { |
735 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); | 749 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); |
736 | } else if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 750 | } else if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
737 | } | 751 | } |
738 | } | 752 | } |
739 | } | 753 | } |
754 | |||
755 | void PMainWindow::slotForceSmall(bool how) | ||
756 | { | ||
757 | odebug << "Disable separate windows: " << how << oendl; | ||
758 | if (m_stack) { | ||
759 | if (how) { | ||
760 | m_stack->forceMode(Opie::Ui::OWidgetStack::SmallScreen); | ||
761 | } else { | ||
762 | m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); | ||
763 | } | ||
764 | } | ||
765 | if (autoSave) { | ||
766 | m_cfg->writeEntry("dontshowseperate",how); | ||
767 | } | ||
768 | } | ||
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index 2f54090..a49a9d3 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h | |||
@@ -1,110 +1,112 @@ | |||
1 | /* | 1 | /* |
2 | * GPLv2 zecke@handhelds.org | 2 | * GPLv2 zecke@handhelds.org |
3 | * No WArranty... | 3 | * No WArranty... |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef PHUNK_MAIN_WINDOW_H | 6 | #ifndef PHUNK_MAIN_WINDOW_H |
7 | #define PHUNK_MAIN_WINDOW_H | 7 | #define PHUNK_MAIN_WINDOW_H |
8 | 8 | ||
9 | #include <opie2/oconfig.h> | 9 | #include <opie2/oconfig.h> |
10 | 10 | ||
11 | #include <qmainwindow.h> | 11 | #include <qmainwindow.h> |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | namespace Opie { | 15 | namespace Opie { |
16 | namespace Ui{ | 16 | namespace Ui{ |
17 | class OWidgetStack; | 17 | class OWidgetStack; |
18 | } | 18 | } |
19 | namespace Core{ | 19 | namespace Core{ |
20 | class OKeyConfigManager; | 20 | class OKeyConfigManager; |
21 | } | 21 | } |
22 | } | 22 | } |
23 | 23 | ||
24 | class ImageView; | 24 | class ImageView; |
25 | class ImageWidget; | 25 | class ImageWidget; |
26 | class PIconView; | 26 | class PIconView; |
27 | class imageinfo; | 27 | class imageinfo; |
28 | class QMenuBar; | 28 | class QMenuBar; |
29 | class QToolBar; | 29 | class QToolBar; |
30 | class QPopupMenu; | 30 | class QPopupMenu; |
31 | class QAction; | 31 | class QAction; |
32 | class QActionGroup; | 32 | class QActionGroup; |
33 | class StorageInfo; | 33 | class StorageInfo; |
34 | 34 | ||
35 | class PMainWindow : public QMainWindow { | 35 | class PMainWindow : public QMainWindow { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | enum Views { IconView, ImageInfo, ImageDisplay }; | 37 | enum Views { IconView, ImageInfo, ImageDisplay }; |
38 | public: | 38 | public: |
39 | static QString appName() { return QString::fromLatin1("opie-eye" ); } | 39 | static QString appName() { return QString::fromLatin1("opie-eye" ); } |
40 | PMainWindow(QWidget*, const char*, WFlags ); | 40 | PMainWindow(QWidget*, const char*, WFlags ); |
41 | ~PMainWindow(); | 41 | ~PMainWindow(); |
42 | 42 | ||
43 | signals: | 43 | signals: |
44 | void configChanged(); | 44 | void configChanged(); |
45 | void changeDir( const QString& ); | 45 | void changeDir( const QString& ); |
46 | void changeListMode(int); | 46 | void changeListMode(int); |
47 | 47 | ||
48 | public slots: | 48 | public slots: |
49 | void slotShowInfo( const QString& inf ); | 49 | void slotShowInfo( const QString& inf ); |
50 | void slotDisplay( const QString& inf ); | 50 | void slotDisplay( const QString& inf ); |
51 | void slotReturn(); | 51 | void slotReturn(); |
52 | void slotRotateToggled(bool); | 52 | void slotRotateToggled(bool); |
53 | void slotScaleToggled(bool); | 53 | void slotScaleToggled(bool); |
54 | void slotZoomerToggled(bool); | 54 | void slotZoomerToggled(bool); |
55 | void slotToggleZoomer(); | 55 | void slotToggleZoomer(); |
56 | void slotToggleAutorotate(); | 56 | void slotToggleAutorotate(); |
57 | void slotToggleAutoscale(); | 57 | void slotToggleAutoscale(); |
58 | void setDocument( const QString& ); | 58 | void setDocument( const QString& ); |
59 | virtual void slotToggleFullScreen(); | 59 | virtual void slotToggleFullScreen(); |
60 | virtual void slotFullScreenToggled(bool); | 60 | virtual void slotFullScreenToggled(bool); |
61 | virtual void polish(); | 61 | virtual void polish(); |
62 | 62 | ||
63 | protected slots: | 63 | protected slots: |
64 | void raiseIconView(); | 64 | void raiseIconView(); |
65 | void closeEvent( QCloseEvent* ); | 65 | void closeEvent( QCloseEvent* ); |
66 | void showToolbar(bool); | 66 | void showToolbar(bool); |
67 | void listviewselected(QAction*); | 67 | void listviewselected(QAction*); |
68 | void slotFullScreenButton(bool); | 68 | void slotFullScreenButton(bool); |
69 | void check_view_fullscreen(); | 69 | void check_view_fullscreen(); |
70 | 70 | ||
71 | private: | 71 | private: |
72 | template<class T> void initT( const char* name, T**, int ); | 72 | template<class T> void initT( const char* name, T**, int ); |
73 | void initInfo(); | 73 | void initInfo(); |
74 | void initDisp(); | 74 | void initDisp(); |
75 | void setupViewWindow(bool full, bool forceDisplay); | 75 | void setupViewWindow(bool full, bool forceDisplay); |
76 | 76 | ||
77 | private: | 77 | private: |
78 | Opie::Core::OConfig *m_cfg; | 78 | Opie::Core::OConfig *m_cfg; |
79 | Opie::Ui::OWidgetStack *m_stack; | 79 | Opie::Ui::OWidgetStack *m_stack; |
80 | PIconView* m_view; | 80 | PIconView* m_view; |
81 | imageinfo *m_info; | 81 | imageinfo *m_info; |
82 | ImageView *m_disp; | 82 | ImageView *m_disp; |
83 | bool autoSave; | 83 | bool autoSave:1; |
84 | bool m_setDocCalled:1; | 84 | bool m_setDocCalled:1; |
85 | bool m_polishDone:1; | 85 | bool m_polishDone:1; |
86 | bool m_SmallWindow:1; | ||
86 | QToolButton*fsButton; | 87 | QToolButton*fsButton; |
87 | QToolBar *toolBar; | 88 | QToolBar *toolBar; |
88 | QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu; | 89 | QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu; |
89 | QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide; | 90 | QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide; |
90 | QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; | 91 | QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; |
91 | QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; | 92 | QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; |
92 | QAction *m_aNext,*m_aPrevious,*m_aFullScreen; | 93 | QAction *m_aNext,*m_aPrevious,*m_aFullScreen; |
93 | QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer; | 94 | QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall; |
94 | 95 | ||
95 | /* init funs */ | 96 | /* init funs */ |
96 | void readConfig(); | 97 | void readConfig(); |
97 | void setupActions(); | 98 | void setupActions(); |
98 | void setupToolbar(); | 99 | void setupToolbar(); |
99 | void setupMenu(); | 100 | void setupMenu(); |
100 | /* for the device submenu - ToDo: Merge with the special button */ | 101 | /* for the device submenu - ToDo: Merge with the special button */ |
101 | StorageInfo *m_storage; | 102 | StorageInfo *m_storage; |
102 | QMap<QString, QString> m_dev; | 103 | QMap<QString, QString> m_dev; |
103 | 104 | ||
104 | private slots: | 105 | private slots: |
105 | void slotConfig(); | 106 | void slotConfig(); |
106 | void slotSelectDir(int); | 107 | void slotSelectDir(int); |
107 | void dirChanged(); | 108 | void dirChanged(); |
109 | void slotForceSmall(bool); | ||
108 | }; | 110 | }; |
109 | 111 | ||
110 | #endif | 112 | #endif |