summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
authoralwin <alwin>2004-11-02 22:59:10 (UTC)
committer alwin <alwin>2004-11-02 22:59:10 (UTC)
commit6034297853dc1edd6009cfe7c6786d12cab9367a (patch) (unidiff)
tree557639b47018613a32cd59f33f4b5d2b4fcfaf0c /noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
parentb2cb5b7e90c13c90a6090ab11831f1369675c14b (diff)
downloadopie-6034297853dc1edd6009cfe7c6786d12cab9367a.zip
opie-6034297853dc1edd6009cfe7c6786d12cab9367a.tar.gz
opie-6034297853dc1edd6009cfe7c6786d12cab9367a.tar.bz2
setup dlg into extra files - its a little bit cleaner
Diffstat (limited to 'noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp41
1 files changed, 3 insertions, 38 deletions
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
index 1e4ec40..3132a9e 100644
--- a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
+++ b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
@@ -1,82 +1,47 @@
1/* 1/*
2 * GPLv2 2 * GPLv2
3 * zecke@handhelds.org 3 * zecke@handhelds.org
4 */ 4 */
5 5
6#include "dir_ifaceinfo.h" 6#include "dir_ifaceinfo.h"
7#include "dir_setup.h"
7 8
8/* OPIE */ 9/* OPIE */
9#include <opie2/odebug.h> 10#include <opie2/odebug.h>
10#include <qpe/config.h> 11#include <qpe/config.h>
11 12
12/* QT */ 13/* QT */
13#include <qwidget.h> 14#include <qwidget.h>
14#include <qcheckbox.h> 15#include <qcheckbox.h>
15#include <qframe.h> 16#include <qframe.h>
16#include <qhbox.h> 17#include <qhbox.h>
17#include <qlabel.h> 18#include <qlabel.h>
18#include <qlayout.h> 19#include <qlayout.h>
19#include <qspinbox.h> 20#include <qspinbox.h>
20 21
21namespace {
22 class DirImageWidget : public QFrame {
23 public:
24 DirImageWidget(): QFrame() {
25 setFrameStyle(Box|Raised);
26 QVBoxLayout *m_MainLayout = new QVBoxLayout( this, 6, 2, "m_MainLayout");
27 QGridLayout*RecDepthLayout = new QGridLayout( 0, 1, 1, 0, 6, "RecDepthLayout");
28
29 chkbox = new QCheckBox( QObject::tr("Show all files"), this );
30 m_MainLayout->addWidget(chkbox);
31 recWarningLabel = new QLabel(this);
32 recWarningLabel->setText(QObject::tr("<center><b>Be carefull with the following options!</b></center>"));
33 m_MainLayout->addWidget(recWarningLabel);
34 recBox = new QCheckBox( QObject::tr("Show files recursive"),this);
35 m_MainLayout->addWidget(recBox);
36 recDepthLabel = new QLabel(this);
37 recDepthLabel->setText(QObject::tr("Recursion depth:"));
38 RecDepthLayout->addWidget(recDepthLabel,0,0);
39 recDepth = new QSpinBox(this);
40 recDepth->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed));
41 recDepth->setMaxValue(10);
42 recDepth->setMinValue(1);
43 recDepth->setSuffix(QObject::tr(" directories"));
44 RecDepthLayout->addWidget(recDepth,0,1);
45 m_MainLayout->addLayout(RecDepthLayout);
46 QSpacerItem *spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
47 m_MainLayout->addItem( spacer1 );
48
49 }
50 ~DirImageWidget() {}
51 QCheckBox* chkbox,*recBox;
52 QSpinBox * recDepth;
53 QLabel* recDepthLabel,*recWarningLabel;
54
55 };
56}
57
58
59DirInterfaceInfo::DirInterfaceInfo() { 22DirInterfaceInfo::DirInterfaceInfo() {
60} 23}
24
61DirInterfaceInfo::~DirInterfaceInfo() { 25DirInterfaceInfo::~DirInterfaceInfo() {
62} 26}
63 27
64QString DirInterfaceInfo::name()const { 28QString DirInterfaceInfo::name()const {
65 return QObject::tr("Directory View" ); 29 return QObject::tr("Directory View" );
66} 30}
67 31
68QWidget* DirInterfaceInfo::configWidget(const Config& cfg) { 32QWidget* DirInterfaceInfo::configWidget(const Config& cfg) {
69 DirImageWidget* wid = new DirImageWidget(); 33 DirImageWidget* wid = new DirImageWidget();
70 wid->chkbox->setChecked(cfg.readBoolEntry("Dir_Check_All_Files",false)); 34 wid->chkbox->setChecked(cfg.readBoolEntry("Dir_Check_All_Files",false));
71 wid->recBox->setChecked(cfg.readBoolEntry("Dir_Check_Recursive_Files",false)); 35 wid->recBox->setChecked(cfg.readBoolEntry("Dir_Check_Recursive_Files",false));
72 wid->recDepth->setValue(cfg.readNumEntry("Dir_Recursive_Files_Depth",10)); 36 wid->recDepth->setValue(cfg.readNumEntry("Dir_Recursive_Files_Depth",10));
37 wid->recDepth->setEnabled(wid->recBox->isChecked());
73 return wid; 38 return wid;
74} 39}
75 40
76void DirInterfaceInfo::writeConfig( QWidget* _wid, Config& cfg) { 41void DirInterfaceInfo::writeConfig( QWidget* _wid, Config& cfg) {
77 owarn << "Write Config" << oendl; 42 owarn << "Write Config" << oendl;
78 DirImageWidget* wid = static_cast<DirImageWidget*>(_wid); 43 DirImageWidget* wid = static_cast<DirImageWidget*>(_wid);
79 cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked()); 44 cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked());
80 cfg.writeEntry("Dir_Check_Recursive_Files", wid->recBox->isChecked()); 45 cfg.writeEntry("Dir_Check_Recursive_Files", wid->recBox->isChecked());
81 cfg.writeEntry("Dir_Recursive_Files_Depth",wid->recDepth->value()); 46 cfg.writeEntry("Dir_Recursive_Files_Depth",wid->recDepth->value());
82} 47}