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.cpp | 30 |
1 files changed, 27 insertions, 3 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 | |||
@@ -16,6 +16,7 @@ | |||
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 { |
@@ -23,14 +24,34 @@ namespace { | |||
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 | ||
@@ -46,8 +67,9 @@ QString DirInterfaceInfo::name()const { | |||
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 | ||
@@ -55,4 +77,6 @@ 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 | } |