summaryrefslogtreecommitdiff
path: root/noncore/graphics
Unidiff
Diffstat (limited to 'noncore/graphics') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/gui.pro6
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp3
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp19
3 files changed, 23 insertions, 5 deletions
diff --git a/noncore/graphics/opie-eye/gui/gui.pro b/noncore/graphics/opie-eye/gui/gui.pro
index b9f0bf8..2759dd5 100644
--- a/noncore/graphics/opie-eye/gui/gui.pro
+++ b/noncore/graphics/opie-eye/gui/gui.pro
@@ -1,15 +1,17 @@
1HEADERS += gui/filesystem.h \ 1HEADERS += gui/filesystem.h \
2 gui/iconview.h \ 2 gui/iconview.h \
3 gui/imageinfoui.h \ 3 gui/imageinfoui.h \
4 gui/imageview.h \ 4 gui/imageview.h \
5 gui/mainwindow.h \ 5 gui/mainwindow.h \
6 gui/viewmodebutton.h 6 gui/viewmodebutton.h \
7 gui/basesetup.h
7 8
8SOURCES += gui/filesystem.cpp \ 9SOURCES += gui/filesystem.cpp \
9 gui/iconview.cpp \ 10 gui/iconview.cpp \
10 gui/imageinfoui.cpp \ 11 gui/imageinfoui.cpp \
11 gui/imageview.cpp \ 12 gui/imageview.cpp \
12 gui/mainwindow.cpp \ 13 gui/mainwindow.cpp \
13 gui/viewmodebutton.cpp 14 gui/viewmodebutton.cpp \
15 gui/basesetup.cpp
14 16
15 17
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index a41ce9f..7c8c88d 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -664,49 +664,50 @@ void PIconView::slotShowPrev()
664} 664}
665 665
666void PIconView::slotShowImage() 666void PIconView::slotShowImage()
667{ 667{
668 bool isDir = false; 668 bool isDir = false;
669 QString name = currentFileName(isDir); 669 QString name = currentFileName(isDir);
670 if (isDir) return; 670 if (isDir) return;
671 slotShowImage( name ); 671 slotShowImage( name );
672} 672}
673void PIconView::slotShowImage( const QString& name) { 673void PIconView::slotShowImage( const QString& name) {
674 PDirLister *lister = currentView()->dirLister(); 674 PDirLister *lister = currentView()->dirLister();
675 QString r_name = lister->nameToFname(name); 675 QString r_name = lister->nameToFname(name);
676 emit sig_display(r_name); 676 emit sig_display(r_name);
677} 677}
678 678
679void PIconView::slotStartSlide() { 679void PIconView::slotStartSlide() {
680 bool isDir = false; 680 bool isDir = false;
681 QString name = currentFileName(isDir); 681 QString name = currentFileName(isDir);
682 if (isDir) { 682 if (isDir) {
683 if (!slotShowFirst()) 683 if (!slotShowFirst())
684 return; 684 return;
685 } else { 685 } else {
686 slotShowImage( name ); 686 slotShowImage( name );
687 } 687 }
688 emit sig_startslide(2); 688 int t = m_cfg->readNumEntry("base_slideshowtimeout", 2);
689 emit sig_startslide(t);
689} 690}
690 691
691void PIconView::slotImageInfo() { 692void PIconView::slotImageInfo() {
692 bool isDir = false; 693 bool isDir = false;
693 QString name = currentFileName(isDir); 694 QString name = currentFileName(isDir);
694 if (isDir) return; 695 if (isDir) return;
695 slotImageInfo( name ); 696 slotImageInfo( name );
696} 697}
697 698
698void PIconView::slotImageInfo( const QString& name) { 699void PIconView::slotImageInfo( const QString& name) {
699 PDirLister *lister = currentView()->dirLister(); 700 PDirLister *lister = currentView()->dirLister();
700 QString r_name = lister->nameToFname(name); 701 QString r_name = lister->nameToFname(name);
701 emit sig_showInfo(r_name ); 702 emit sig_showInfo(r_name );
702} 703}
703 704
704 705
705void PIconView::slotChangeMode( int mode ) { 706void PIconView::slotChangeMode( int mode ) {
706 if ( mode >= 1 && mode <= 3 ) 707 if ( mode >= 1 && mode <= 3 )
707 m_mode = mode; 708 m_mode = mode;
708 709
709 m_cfg->writeEntry("ListViewMode", m_mode); 710 m_cfg->writeEntry("ListViewMode", m_mode);
710 /* performance! */ 711 /* performance! */
711 m_view->clear(); 712 m_view->clear();
712 calculateGrid(); 713 calculateGrid();
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index e714e84..570ee45 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -1,35 +1,36 @@
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 13
13#include <iface/ifaceinfo.h> 14#include <iface/ifaceinfo.h>
14#include <iface/dirview.h> 15#include <iface/dirview.h>
15 16
16#include <opie2/odebug.h> 17#include <opie2/odebug.h>
17#include <opie2/owidgetstack.h> 18#include <opie2/owidgetstack.h>
18#include <opie2/oapplicationfactory.h> 19#include <opie2/oapplicationfactory.h>
19#include <opie2/otabwidget.h> 20#include <opie2/otabwidget.h>
20#include <opie2/okeyconfigwidget.h> 21#include <opie2/okeyconfigwidget.h>
21 22
22#include <qpe/resource.h> 23#include <qpe/resource.h>
23#include <qpe/config.h> 24#include <qpe/config.h>
24#include <qpe/ir.h> 25#include <qpe/ir.h>
25#include <qpe/storage.h> 26#include <qpe/storage.h>
26#include <qpe/applnk.h> 27#include <qpe/applnk.h>
27 28
28#include <qtoolbar.h> 29#include <qtoolbar.h>
29#include <qtoolbutton.h> 30#include <qtoolbutton.h>
30#include <qlayout.h> 31#include <qlayout.h>
31#include <qdialog.h> 32#include <qdialog.h>
32#include <qmap.h> 33#include <qmap.h>
33#include <qtimer.h> 34#include <qtimer.h>
34#include <qframe.h> 35#include <qframe.h>
35#include <qmenubar.h> 36#include <qmenubar.h>
@@ -48,48 +49,49 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
48 m_storage = new StorageInfo(); 49 m_storage = new StorageInfo();
49 connect(m_storage, SIGNAL(disksChanged() ), 50 connect(m_storage, SIGNAL(disksChanged() ),
50 this, SLOT( dirChanged() ) ); 51 this, SLOT( dirChanged() ) );
51 52
52 m_stack = new Opie::Ui::OWidgetStack( this ); 53 m_stack = new Opie::Ui::OWidgetStack( this );
53 setCentralWidget( m_stack ); 54 setCentralWidget( m_stack );
54 55
55 m_view = new PIconView( m_stack, m_cfg ); 56 m_view = new PIconView( m_stack, m_cfg );
56 m_stack->addWidget( m_view, IconView ); 57 m_stack->addWidget( m_view, IconView );
57 m_stack->raiseWidget( IconView ); 58 m_stack->raiseWidget( IconView );
58 59
59 connect(m_view, SIGNAL(sig_display(const QString&)), 60 connect(m_view, SIGNAL(sig_display(const QString&)),
60 this, SLOT(slotDisplay(const QString&))); 61 this, SLOT(slotDisplay(const QString&)));
61 connect(m_view, SIGNAL(sig_showInfo(const QString&)), 62 connect(m_view, SIGNAL(sig_showInfo(const QString&)),
62 this, SLOT(slotShowInfo(const QString&)) ); 63 this, SLOT(slotShowInfo(const QString&)) );
63 connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int))); 64 connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int)));
64 65
65 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); 66 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce);
66 67
67 listviewMenu = 0; 68 listviewMenu = 0;
68 /* setup menu and toolbar */ 69 /* setup menu and toolbar */
69 setupActions(); 70 setupActions();
70 setupToolbar(); 71 setupToolbar();
71 setupMenu(); 72 setupMenu();
73 m_aHideToolbar->setOn(m_cfg->readBoolEntry("base_showtoolbar",true));
72} 74}
73 75
74PMainWindow::~PMainWindow() { 76PMainWindow::~PMainWindow() {
75} 77}
76 78
77void PMainWindow::slotToggleZoomer() 79void PMainWindow::slotToggleZoomer()
78{ 80{
79 if (!m_disp) return; 81 if (!m_disp) return;
80 bool cur = m_aZoomer->isOn(); 82 bool cur = m_aZoomer->isOn();
81 m_aZoomer->setOn(!cur); 83 m_aZoomer->setOn(!cur);
82} 84}
83 85
84void PMainWindow::slotZoomerToggled(bool how) 86void PMainWindow::slotZoomerToggled(bool how)
85{ 87{
86 zoomerOn = how; 88 zoomerOn = how;
87 if (m_disp) { 89 if (m_disp) {
88 m_disp->setShowZoomer(zoomerOn); 90 m_disp->setShowZoomer(zoomerOn);
89 } 91 }
90} 92}
91 93
92void PMainWindow::slotToggleAutorotate() 94void PMainWindow::slotToggleAutorotate()
93{ 95{
94 if (!m_disp) return; 96 if (!m_disp) return;
95 if (!m_aAutoRotate->isEnabled()) return; 97 if (!m_aAutoRotate->isEnabled()) return;
@@ -119,48 +121,52 @@ void PMainWindow::slotScaleToggled(bool how)
119 if (!how) { 121 if (!how) {
120 autoRotate = how; 122 autoRotate = how;
121 } 123 }
122 if (!autoScale) { 124 if (!autoScale) {
123 m_aAutoRotate->setOn(false); 125 m_aAutoRotate->setOn(false);
124 } 126 }
125 if (m_disp) { 127 if (m_disp) {
126 m_disp->setAutoScaleRotate(!m_aAutoScale->isOn(),m_aAutoRotate->isOn()); 128 m_disp->setAutoScaleRotate(!m_aAutoScale->isOn(),m_aAutoRotate->isOn());
127 } 129 }
128 m_aAutoRotate->setEnabled(!how); 130 m_aAutoRotate->setEnabled(!how);
129} 131}
130 132
131void PMainWindow::slotConfig() { 133void PMainWindow::slotConfig() {
132 /* 134 /*
133 * have a tab with the possible views 135 * have a tab with the possible views
134 * a tab for globals image cache size.. scaled loading 136 * a tab for globals image cache size.. scaled loading
135 * and one tab for the KeyConfigs 137 * and one tab for the KeyConfigs
136 */ 138 */
137 QDialog dlg(this, 0, true); 139 QDialog dlg(this, 0, true);
138 dlg.setCaption( tr("Phunk View - Config" ) ); 140 dlg.setCaption( tr("Phunk View - Config" ) );
139 141
140 QHBoxLayout *lay = new QHBoxLayout(&dlg); 142 QHBoxLayout *lay = new QHBoxLayout(&dlg);
141 Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); 143 Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg );
142 lay->addWidget( wid ); 144 lay->addWidget( wid );
145
146 BaseSetup*bSetup = new BaseSetup(m_cfg,wid);
147 wid->addTab(bSetup,"SettingsIcon","Basics setup");
148
143 ViewMap *vM = viewMap(); 149 ViewMap *vM = viewMap();
144 ViewMap::Iterator _it = vM->begin(); 150 ViewMap::Iterator _it = vM->begin();
145 QMap<PDirView*, QWidget*> lst; 151 QMap<PDirView*, QWidget*> lst;
146 152
147 for( ; _it != vM->end(); ++_it ) { 153 for( ; _it != vM->end(); ++_it ) {
148 PDirView *view = (_it.data())(*m_cfg); 154 PDirView *view = (_it.data())(*m_cfg);
149 PInterfaceInfo *inf = view->interfaceInfo(); 155 PInterfaceInfo *inf = view->interfaceInfo();
150 QWidget *_wid = inf->configWidget( *m_cfg ); 156 QWidget *_wid = inf->configWidget( *m_cfg );
151 if (!_wid) continue; 157 if (!_wid) continue;
152 _wid->reparent(wid, QPoint() ); 158 _wid->reparent(wid, QPoint() );
153 lst.insert( view, _wid ); 159 lst.insert( view, _wid );
154 wid->addTab( _wid, "fileopen", inf->name() ); 160 wid->addTab( _wid, "fileopen", inf->name() );
155 } 161 }
156 162
157/* 163/*
158 * Add the KeyConfigWidget 164 * Add the KeyConfigWidget
159 */ 165 */
160 Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); 166 Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" );
161 keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); 167 keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue );
162 keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); 168 keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() );
163 169
164 if ( !m_info ) { 170 if ( !m_info ) {
165 initInfo(); 171 initInfo();
166 } 172 }
@@ -175,48 +181,49 @@ void PMainWindow::slotConfig() {
175 wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); 181 wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") );
176 182
177 183
178 bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); 184 bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
179 185
180/* 186/*
181 * clean up 187 * clean up
182 *apply changes 188 *apply changes
183 */ 189 */
184 190
185 QMap<PDirView*, QWidget*>::Iterator it; 191 QMap<PDirView*, QWidget*>::Iterator it;
186 for ( it = lst.begin(); it != lst.end(); ++it ) { 192 for ( it = lst.begin(); it != lst.end(); ++it ) {
187 if ( act ) 193 if ( act )
188 it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); 194 it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg);
189 delete it.key(); 195 delete it.key();
190 } 196 }
191 197
192 198
193 if ( act ) { 199 if ( act ) {
194 m_view->resetView(); 200 m_view->resetView();
195 keyWid->save(); 201 keyWid->save();
196 m_disp->manager()->save(); 202 m_disp->manager()->save();
197 m_info->manager()->save(); 203 m_info->manager()->save();
198 m_view->manager()->save(); 204 m_view->manager()->save();
205 bSetup->save_values();
199 } 206 }
200 delete keyWid; 207 delete keyWid;
201} 208}
202 209
203/* 210/*
204 * create a new image info component 211 * create a new image info component
205 * and detach the current one 212 * and detach the current one
206 * we will make the other delete on exit 213 * we will make the other delete on exit
207 */ 214 */
208template<class T> 215template<class T>
209void PMainWindow::initT( const char* name, T** ptr, int id) { 216void PMainWindow::initT( const char* name, T** ptr, int id) {
210 if ( *ptr ) { 217 if ( *ptr ) {
211 (*ptr)->disconnect(this, SLOT(slotReturn())); 218 (*ptr)->disconnect(this, SLOT(slotReturn()));
212 (*ptr)->setDestructiveClose(); 219 (*ptr)->setDestructiveClose();
213 m_stack->removeWidget( *ptr ); 220 m_stack->removeWidget( *ptr );
214 } 221 }
215 *ptr = new T(m_cfg, m_stack, name ); 222 *ptr = new T(m_cfg, m_stack, name );
216 m_stack->addWidget( *ptr, id ); 223 m_stack->addWidget( *ptr, id );
217 224
218 connect(*ptr, SIGNAL(sig_return()), 225 connect(*ptr, SIGNAL(sig_return()),
219 this,SLOT(slotReturn())); 226 this,SLOT(slotReturn()));
220 227
221} 228}
222void PMainWindow::initInfo() { 229void PMainWindow::initInfo() {
@@ -247,50 +254,58 @@ void PMainWindow::initDisp() {
247 } 254 }
248} 255}
249 256
250void PMainWindow::slotToggleFullScreen() 257void PMainWindow::slotToggleFullScreen()
251{ 258{
252 odebug << "Toggle full " << oendl; 259 odebug << "Toggle full " << oendl;
253 bool current = !m_aFullScreen->isOn(); 260 bool current = !m_aFullScreen->isOn();
254 m_aFullScreen->setOn(current); 261 m_aFullScreen->setOn(current);
255} 262}
256 263
257void PMainWindow::slotFullScreenToggled(bool current) 264void PMainWindow::slotFullScreenToggled(bool current)
258{ 265{
259 odebug << "slotFullScreenToggled " << current << oendl; 266 odebug << "slotFullScreenToggled " << current << oendl;
260 if (!m_disp) return; 267 if (!m_disp) return;
261 if (current) { 268 if (current) {
262 odebug << "full" << oendl; 269 odebug << "full" << oendl;
263 m_disp->setBackgroundColor(black); 270 m_disp->setBackgroundColor(black);
264 m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); 271 m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0));
265 m_disp->setVScrollBarMode(QScrollView::AlwaysOff); 272 m_disp->setVScrollBarMode(QScrollView::AlwaysOff);
266 m_disp->setHScrollBarMode(QScrollView::AlwaysOff); 273 m_disp->setHScrollBarMode(QScrollView::AlwaysOff);
267 m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); 274 m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height());
268 } else { 275 } else {
269 setUpdatesEnabled(false); 276 setUpdatesEnabled(false);
270 odebug << "window" << oendl; 277 odebug << "window" << oendl;
271 m_disp->setMinimumSize(10,10); 278 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
272 m_disp->reparent(0,QPoint(0,0)); 279 m_disp->setMinimumSize(QApplication::desktop()->size()/2);
280 } else {
281 m_disp->setMinimumSize(10,10);
282 }
283 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
284 m_disp->reparent(0,QPoint(50,50));
285 } else {
286 m_disp->reparent(0,QPoint(0,0));
287 }
273 m_disp->setBackgroundColor(white); 288 m_disp->setBackgroundColor(white);
274 m_stack->addWidget(m_disp,ImageDisplay); 289 m_stack->addWidget(m_disp,ImageDisplay);
275 m_disp->setVScrollBarMode(QScrollView::Auto); 290 m_disp->setVScrollBarMode(QScrollView::Auto);
276 m_disp->setHScrollBarMode(QScrollView::Auto); 291 m_disp->setHScrollBarMode(QScrollView::Auto);
277 m_stack->raiseWidget(m_disp); 292 m_stack->raiseWidget(m_disp);
278 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { 293 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
279 m_disp->resize(m_disp->minimumSize()); 294 m_disp->resize(m_disp->minimumSize());
280 } 295 }
281 setUpdatesEnabled(true); 296 setUpdatesEnabled(true);
282 } 297 }
283 m_disp->setFullScreen(current); 298 m_disp->setFullScreen(current);
284} 299}
285 300
286/** 301/**
287 * With big Screen the plan could be to 'detach' the image 302 * With big Screen the plan could be to 'detach' the image
288 * window if visible and to create a ne wone 303 * window if visible and to create a ne wone
289 * init* already supports it but I make no use of it for 304 * init* already supports it but I make no use of it for
290 * now. We set filename and raise 305 * now. We set filename and raise
291 * 306 *
292 * ### FIXME and talk to alwin 307 * ### FIXME and talk to alwin
293 */ 308 */
294void PMainWindow::slotShowInfo( const QString& inf ) { 309void PMainWindow::slotShowInfo( const QString& inf ) {
295 if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { 310 if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) {
296 return; 311 return;