author | alwin <alwin> | 2004-11-02 17:52:41 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-02 17:52:41 (UTC) |
commit | ebdc2d346272bae27c867b855207993985df4450 (patch) (unidiff) | |
tree | 37b4710141434e33df3873c16937a6ad6a015eb4 /noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp | |
parent | e246d0590286f6b9b0d5d40f1a17caa78c015b21 (diff) | |
download | opie-ebdc2d346272bae27c867b855207993985df4450.zip opie-ebdc2d346272bae27c867b855207993985df4450.tar.gz opie-ebdc2d346272bae27c867b855207993985df4450.tar.bz2 |
if wanted the user may search directories recursiv
Diffstat (limited to 'noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp index 9c69ce5..1e4ec40 100644 --- a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp +++ b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp | |||
@@ -3,56 +3,80 @@ | |||
3 | * zecke@handhelds.org | 3 | * zecke@handhelds.org |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include "dir_ifaceinfo.h" | 6 | #include "dir_ifaceinfo.h" |
7 | 7 | ||
8 | /* OPIE */ | 8 | /* OPIE */ |
9 | #include <opie2/odebug.h> | 9 | #include <opie2/odebug.h> |
10 | #include <qpe/config.h> | 10 | #include <qpe/config.h> |
11 | 11 | ||
12 | /* QT */ | 12 | /* QT */ |
13 | #include <qwidget.h> | 13 | #include <qwidget.h> |
14 | #include <qcheckbox.h> | 14 | #include <qcheckbox.h> |
15 | #include <qframe.h> | 15 | #include <qframe.h> |
16 | #include <qhbox.h> | 16 | #include <qhbox.h> |
17 | #include <qlabel.h> | 17 | #include <qlabel.h> |
18 | #include <qlayout.h> | 18 | #include <qlayout.h> |
19 | #include <qspinbox.h> | ||
19 | 20 | ||
20 | namespace { | 21 | namespace { |
21 | class DirImageWidget : public QFrame { | 22 | class DirImageWidget : public QFrame { |
22 | public: | 23 | public: |
23 | DirImageWidget(): QFrame() { | 24 | DirImageWidget(): QFrame() { |
24 | setFrameStyle(Box|Raised); | 25 | setFrameStyle(Box|Raised); |
25 | QVBoxLayout *m_MainLayout = new QVBoxLayout( this, 6, 2, "m_MainLayout"); | 26 | QVBoxLayout *m_MainLayout = new QVBoxLayout( this, 6, 2, "m_MainLayout"); |
27 | QGridLayout*RecDepthLayout = new QGridLayout( 0, 1, 1, 0, 6, "RecDepthLayout"); | ||
28 | |||
26 | chkbox = new QCheckBox( QObject::tr("Show all files"), this ); | 29 | chkbox = new QCheckBox( QObject::tr("Show all files"), this ); |
27 | m_MainLayout->addWidget(chkbox); | 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); | ||
28 | QSpacerItem *spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); | 46 | QSpacerItem *spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
29 | m_MainLayout->addItem( spacer1 ); | 47 | m_MainLayout->addItem( spacer1 ); |
30 | 48 | ||
31 | } | 49 | } |
32 | ~DirImageWidget() {} | 50 | ~DirImageWidget() {} |
33 | QCheckBox* chkbox; | 51 | QCheckBox* chkbox,*recBox; |
52 | QSpinBox * recDepth; | ||
53 | QLabel* recDepthLabel,*recWarningLabel; | ||
54 | |||
34 | }; | 55 | }; |
35 | } | 56 | } |
36 | 57 | ||
37 | 58 | ||
38 | DirInterfaceInfo::DirInterfaceInfo() { | 59 | DirInterfaceInfo::DirInterfaceInfo() { |
39 | } | 60 | } |
40 | DirInterfaceInfo::~DirInterfaceInfo() { | 61 | DirInterfaceInfo::~DirInterfaceInfo() { |
41 | } | 62 | } |
42 | 63 | ||
43 | QString DirInterfaceInfo::name()const { | 64 | QString DirInterfaceInfo::name()const { |
44 | return QObject::tr("Directory View" ); | 65 | return QObject::tr("Directory View" ); |
45 | } | 66 | } |
46 | 67 | ||
47 | QWidget* DirInterfaceInfo::configWidget(const Config& cfg) { | 68 | QWidget* DirInterfaceInfo::configWidget(const Config& cfg) { |
48 | DirImageWidget* wid = new DirImageWidget(); | 69 | DirImageWidget* wid = new DirImageWidget(); |
49 | wid->chkbox->setChecked( cfg.readBoolEntry("Dir_Check_All_Files", true) ); | 70 | wid->chkbox->setChecked(cfg.readBoolEntry("Dir_Check_All_Files",false)); |
50 | 71 | wid->recBox->setChecked(cfg.readBoolEntry("Dir_Check_Recursive_Files",false)); | |
72 | wid->recDepth->setValue(cfg.readNumEntry("Dir_Recursive_Files_Depth",10)); | ||
51 | return wid; | 73 | return wid; |
52 | } | 74 | } |
53 | 75 | ||
54 | void DirInterfaceInfo::writeConfig( QWidget* _wid, Config& cfg) { | 76 | void DirInterfaceInfo::writeConfig( QWidget* _wid, Config& cfg) { |
55 | owarn << "Write Config" << oendl; | 77 | owarn << "Write Config" << oendl; |
56 | DirImageWidget* wid = static_cast<DirImageWidget*>(_wid); | 78 | DirImageWidget* wid = static_cast<DirImageWidget*>(_wid); |
57 | cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked() ); | 79 | cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked()); |
80 | cfg.writeEntry("Dir_Check_Recursive_Files", wid->recBox->isChecked()); | ||
81 | cfg.writeEntry("Dir_Recursive_Files_Depth",wid->recDepth->value()); | ||
58 | } | 82 | } |