summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-01 16:41:11 (UTC)
committer alwin <alwin>2004-11-01 16:41:11 (UTC)
commit5a41dcd5901badbd2e258b0a916fb012b6351eeb (patch) (side-by-side diff)
treebf1821746491c996f20d9ecbf3952a94e96e422f
parente28f024b5d0d70dd22d7beacfd693b75e2fcf39e (diff)
downloadopie-5a41dcd5901badbd2e258b0a916fb012b6351eeb.zip
opie-5a41dcd5901badbd2e258b0a916fb012b6351eeb.tar.gz
opie-5a41dcd5901badbd2e258b0a916fb012b6351eeb.tar.bz2
some layout work
work on saving default values some fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/basesetup.cpp18
-rw-r--r--noncore/graphics/opie-eye/gui/basesetup.h6
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp6
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp124
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h7
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp12
6 files changed, 113 insertions, 60 deletions
diff --git a/noncore/graphics/opie-eye/gui/basesetup.cpp b/noncore/graphics/opie-eye/gui/basesetup.cpp
index 1a354a5..20dda5a 100644
--- a/noncore/graphics/opie-eye/gui/basesetup.cpp
+++ b/noncore/graphics/opie-eye/gui/basesetup.cpp
@@ -8,4 +8,5 @@
BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * name, WFlags f)
- :QWidget(parent,name,f)
+ :QFrame(parent,name,f)
{
+ setFrameStyle(Box|Raised);
m_cfg = a_cfg;
@@ -19,3 +20,3 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
m_SlideShowTime->setMaxValue( 60 );
- m_SlideShowTime->setMinValue(1);
+ m_SlideShowTime->setMinValue(0);
m_SlideShowTime->setValue( 2 );
@@ -30,2 +31,3 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
+#if 0
m_ShowToolBar = new QCheckBox( this, "m_ShowToolBar" );
@@ -33,2 +35,6 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
m_MainLayout->addWidget( m_ShowToolBar );
+#endif
+ m_SaveStateAuto = new QCheckBox( this, "m_SaveStateAuto" );
+ m_SaveStateAuto->setText(tr("Save status of fullscreen/autorotate"));
+ m_MainLayout->addWidget( m_SaveStateAuto );
@@ -38,8 +44,6 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
int stime = m_cfg->readNumEntry("base_slideshowtimeout",2);
- if (stime<1) stime=2;
+ if (stime<0) stime=2;
if (stime>60) stime=60;
m_SlideShowTime->setValue(stime);
-
- bool stoolbar = m_cfg->readBoolEntry("base_showtoolbar",true);
- m_ShowToolBar->setChecked(stoolbar);
+ m_SaveStateAuto->setChecked(m_cfg->readBoolEntry("base_savestatus",false));
}
@@ -54,3 +58,3 @@ void BaseSetup::save_values()
m_cfg->writeEntry("base_slideshowtimeout",m_SlideShowTime->value());
- m_cfg->writeEntry("base_showtoolbar",m_ShowToolBar->isChecked());
+ m_cfg->writeEntry("base_savestatus",m_SaveStateAuto->isChecked());
}
diff --git a/noncore/graphics/opie-eye/gui/basesetup.h b/noncore/graphics/opie-eye/gui/basesetup.h
index c13e2af..c343f88 100644
--- a/noncore/graphics/opie-eye/gui/basesetup.h
+++ b/noncore/graphics/opie-eye/gui/basesetup.h
@@ -5,3 +5,3 @@
-#include <qwidget.h>
+#include <qframe.h>
@@ -14,3 +14,3 @@ class QSpacerItem;
-class BaseSetup:public QWidget
+class BaseSetup:public QFrame
{
@@ -30,3 +30,3 @@ protected:
QLabel * m_SlidetimeLabel;
- QCheckBox *m_ShowToolBar;
+ QCheckBox *m_SaveStateAuto;
QSpacerItem *spacer1;
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index 86db732..be58c72 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -40,3 +40,2 @@ ImageView::~ImageView()
{
- odebug << "Delete Imageview" << oendl;
delete m_viewManager;
@@ -59,3 +58,6 @@ void ImageView::startSlide(int value)
connect(m_slideTimer,SIGNAL(timeout()),SLOT(nextSlide()));
- m_slideTimer->start(m_slideValue*1000,true);
+ /* this "+1" is one millisecond. with that we can setup a slideshowvalue
+ of 0. eg "as fast as possible".
+ */
+ m_slideTimer->start(m_slideValue*1000+1,true);
}
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index ece51a1..5eb065f 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -47,2 +47,3 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
m_cfg->setGroup("main" );
+ readConfig();
@@ -72,3 +73,4 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
setupMenu();
- m_aHideToolbar->setOn(m_cfg->readBoolEntry("base_showtoolbar",true));
+ m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true));
+ m_aAutoRotate->setEnabled(!m_aUnscaled->isOn());
}
@@ -80,5 +82,3 @@ void PMainWindow::slotToggleZoomer()
{
- if (!m_disp) return;
- bool cur = m_aZoomer->isOn();
- m_aZoomer->setOn(!cur);
+ m_aZoomer->setOn(!m_aZoomer->isOn());
}
@@ -87,5 +87,7 @@ void PMainWindow::slotZoomerToggled(bool how)
{
- zoomerOn = how;
if (m_disp) {
- m_disp->setShowZoomer(zoomerOn);
+ m_disp->setShowZoomer(how);
+ }
+ if (autoSave) {
+ m_cfg->writeEntry("zoomeron",how);
}
@@ -95,6 +97,4 @@ void PMainWindow::slotToggleAutorotate()
{
- if (!m_disp) return;
if (!m_aAutoRotate->isEnabled()) return;
- bool cur = m_aAutoRotate->isOn();
- m_aAutoRotate->setOn(!cur);
+ m_aAutoRotate->setOn(!m_aAutoRotate->isOn());
}
@@ -103,5 +103,3 @@ void PMainWindow::slotToggleAutoscale()
{
- if (!m_disp) return;
- bool cur = m_aAutoScale->isOn();
- m_aAutoScale->setOn(!cur);
+ m_aUnscaled->setOn(!m_aUnscaled->isOn());
}
@@ -110,5 +108,7 @@ void PMainWindow::slotRotateToggled(bool how)
{
- autoRotate = how;
+ if (autoSave) {
+ m_cfg->writeEntry("autorotate",how);
+ }
if (m_disp) {
- m_disp->setAutoScaleRotate(!m_aAutoScale->isOn(),m_aAutoRotate->isOn());
+ m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),how);
}
@@ -118,7 +118,8 @@ void PMainWindow::slotScaleToggled(bool how)
{
- autoScale = !how;
- if (!how) {
- autoRotate = how;
+ if (autoSave) {
+ m_cfg->writeEntry("unscaled",how);
}
- if (!autoScale) {
+ odebug << "Unscaled: " << m_aUnscaled->isOn() << oendl;
+ odebug << "How: " << how << oendl;
+ if (how) {
m_aAutoRotate->setOn(false);
@@ -126,5 +127,6 @@ void PMainWindow::slotScaleToggled(bool how)
if (m_disp) {
- m_disp->setAutoScaleRotate(!m_aAutoScale->isOn(),m_aAutoRotate->isOn());
+ m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn());
}
m_aAutoRotate->setEnabled(!how);
+ odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl;
}
@@ -138,3 +140,3 @@ void PMainWindow::slotConfig() {
QDialog dlg(this, 0, true);
- dlg.setCaption( tr("Phunk View - Config" ) );
+ dlg.setCaption( tr("Opie Eye - Config" ) );
@@ -167,4 +169,7 @@ void PMainWindow::slotConfig() {
keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() );
+ QWidget*w = m_stack->visibleWidget();
+ bool reminfo = false;
if ( !m_info ) {
+ reminfo = true;
initInfo();
@@ -173,3 +178,5 @@ void PMainWindow::slotConfig() {
+ bool remdisp = false;
if ( !m_disp ) {
+ remdisp = true;
initDisp();
@@ -180,4 +187,3 @@ void PMainWindow::slotConfig() {
wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") );
-
-
+ wid->setCurrentTab(0);
bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
@@ -204,4 +210,19 @@ void PMainWindow::slotConfig() {
bSetup->save_values();
+ readConfig();
}
delete keyWid;
+
+ m_stack->raiseWidget(w);
+ if (remdisp) {
+ m_disp->disconnect(this, SLOT(slotReturn()));
+ m_disp->setDestructiveClose();
+ m_stack->removeWidget(m_disp);
+ m_disp = 0;
+ }
+ if (reminfo) {
+ m_info->disconnect(this, SLOT(slotReturn()));
+ m_info->setDestructiveClose();
+ m_stack->removeWidget(m_info);
+ m_info = 0;
+ }
}
@@ -240,3 +261,3 @@ void PMainWindow::initDisp() {
m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType);
- m_disp->setAutoScale(!m_aAutoScale->isOn());
+ m_disp->setAutoScale(!m_aUnscaled->isOn());
m_disp->setAutoRotate(m_aAutoRotate->isOn());
@@ -265,15 +286,13 @@ void PMainWindow::slotFullScreenButton(bool current)
{
- if (m_disp) odebug << "Disp fenster ist hidden: "<<m_disp->isHidden()<<oendl;
+ if (autoSave) {
+ m_cfg->writeEntry("fullscreen",current);
+ }
if (!m_disp) return;
- /* I can not solve this effects here - it seems that we require some
- status variable, too. so we will live with some interesting effects
- meanwhile */
-#if 0
- bool th = m_disp->isHidden();
- setupViewWindow(current, false);
- /* realy - after setting up the fullscreenmode while the window is hidden
- it is unvisibile not hidden!!!!! Hell. */
- if (th) m_disp->hide();
-#endif
+ if (m_disp->isHidden()) {
+ /* it must get some setups for switch we can just do if the window is visible.
+ so we must delete the imageview window and re-create it when displaying new
+ image */
+ return;
+ }
setupViewWindow(current, true);
@@ -459,2 +478,5 @@ void PMainWindow::showToolbar(bool how)
else toolBar->show();
+ if (autoSave) {
+ m_cfg->writeEntry("showtoolbar",how);
+ }
}
@@ -538,3 +560,7 @@ void PMainWindow::setupActions()
m_aFullScreen->setToggleAction(true);
+ if (autoSave) {
+ m_aFullScreen->setOn(m_cfg->readBoolEntry("fullscreen",false));
+ } else {
m_aFullScreen->setOn(false);
+ }
connect(m_aFullScreen,SIGNAL(toggled(bool)),this,SLOT(slotFullScreenButton(bool)));
@@ -544,8 +570,10 @@ void PMainWindow::setupActions()
m_aAutoRotate->setToggleAction(true);
+
if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) {
m_aAutoRotate->setOn(true);
- autoRotate = true;
} else {
m_aAutoRotate->setOn(false);
- autoRotate = false;
+ }
+ if (autoSave) {
+ m_aAutoRotate->setOn(m_cfg->readBoolEntry("autorotate",m_aAutoRotate->isOn()));
}
@@ -553,6 +581,10 @@ void PMainWindow::setupActions()
- m_aAutoScale = new QAction( tr( "Show images unscaled" ), Resource::loadIconSet( "1to1" ), 0, 0, this, 0, true );
- m_aAutoScale->setToggleAction(true);
- m_aAutoScale->setOn (false);
- connect(m_aAutoScale,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool)));
+ m_aUnscaled = new QAction( tr( "Show images unscaled" ), Resource::loadIconSet( "1to1" ), 0, 0, this, 0, true );
+ m_aUnscaled->setToggleAction(true);
+ connect(m_aUnscaled,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool)));
+ if (autoSave) {
+ m_aUnscaled->setOn(m_cfg->readBoolEntry("unscaled",false));
+ } else {
+ m_aUnscaled->setOn(false);
+ }
@@ -560,7 +592,10 @@ void PMainWindow::setupActions()
m_aZoomer->setToggleAction(true);
+ if (autoSave) {
+ m_aZoomer->setOn(m_cfg->readBoolEntry("zoomeron",true));
+ } else {
m_aZoomer->setOn (true);
- zoomerOn = true;
+ }
connect(m_aZoomer,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool)));
m_gDisplayType->insert(m_aAutoRotate);
- m_gDisplayType->insert(m_aAutoScale);
+ m_gDisplayType->insert(m_aUnscaled);
m_gDisplayType->insert(m_aZoomer);
@@ -660 +695,6 @@ void PMainWindow::listviewselected(QAction*which)
}
+
+void PMainWindow::readConfig()
+{
+ autoSave =m_cfg->readBoolEntry("base_savestatus",true);
+}
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 703965b..5707568 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -80,5 +80,3 @@ private:
ImageView *m_disp;
- bool autoRotate;
- bool autoScale;
- bool zoomerOn;
+ bool autoSave;
QToolButton*fsButton;
@@ -90,5 +88,6 @@ private:
QAction *m_aNext,*m_aPrevious,*m_aFullScreen;
- QAction *m_aAutoRotate,*m_aAutoScale,*m_aZoomer;
+ QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer;
/* init funs */
+ void readConfig();
void setupActions();
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
index f4a6a87..9c69ce5 100644
--- a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
+++ b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
@@ -14,10 +14,18 @@
#include <qcheckbox.h>
+#include <qframe.h>
#include <qhbox.h>
#include <qlabel.h>
+#include <qlayout.h>
namespace {
- class DirImageWidget : public QHBox {
+ class DirImageWidget : public QFrame {
public:
- DirImageWidget() {
+ DirImageWidget(): QFrame() {
+ setFrameStyle(Box|Raised);
+ QVBoxLayout *m_MainLayout = new QVBoxLayout( this, 6, 2, "m_MainLayout");
chkbox = new QCheckBox( QObject::tr("Show all files"), this );
+ m_MainLayout->addWidget(chkbox);
+ QSpacerItem *spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ m_MainLayout->addItem( spacer1 );
+
}