00001 #include "dir_setup.h"
00002
00003
00004 #include <qwidget.h>
00005 #include <qcheckbox.h>
00006 #include <qframe.h>
00007 #include <qhbox.h>
00008 #include <qlabel.h>
00009 #include <qlayout.h>
00010 #include <qspinbox.h>
00011
00012 DirImageWidget::DirImageWidget()
00013 : QFrame()
00014 {
00015 setFrameStyle(Box|Raised);
00016 QVBoxLayout *m_MainLayout = new QVBoxLayout( this, 6, 2, "m_MainLayout");
00017 QGridLayout*RecDepthLayout = new QGridLayout( 0, 1, 1, 0, 6, "RecDepthLayout");
00018
00019 chkbox = new QCheckBox( QObject::tr("Show all files"), this );
00020 m_MainLayout->addWidget(chkbox);
00021 recWarningLabel = new QLabel(this);
00022 recWarningLabel->setText(QObject::tr("<center><b>Be carefull with the following options!</b></center>"));
00023 m_MainLayout->addWidget(recWarningLabel);
00024 recBox = new QCheckBox( QObject::tr("Show files recursive"),this);
00025 m_MainLayout->addWidget(recBox);
00026 recDepthLabel = new QLabel(this);
00027 recDepthLabel->setText(QObject::tr("Recursion depth:"));
00028 RecDepthLayout->addWidget(recDepthLabel,0,0);
00029 recDepth = new QSpinBox(this);
00030 recDepth->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed));
00031 recDepth->setMaxValue(10);
00032 recDepth->setMinValue(1);
00033 recDepth->setSuffix(QObject::tr(" directories"));
00034 RecDepthLayout->addWidget(recDepth,0,1);
00035 m_MainLayout->addLayout(RecDepthLayout);
00036 QSpacerItem *spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
00037 m_MainLayout->addItem( spacer1 );
00038 connect(recBox,SIGNAL(toggled(bool)),this,SLOT(recBoxToggled(bool)));
00039 }
00040
00041 DirImageWidget::~DirImageWidget()
00042 {
00043 }
00044
00045 void DirImageWidget::recBoxToggled(bool how)
00046 {
00047 recDepth->setEnabled(how);
00048 }