Diffstat (limited to 'noncore/settings/mediummount/mediumwidget.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/mediummount/mediumwidget.cc b/noncore/settings/mediummount/mediumwidget.cc index eadf502..981e1dd 100644 --- a/noncore/settings/mediummount/mediumwidget.cc +++ b/noncore/settings/mediummount/mediumwidget.cc | |||
@@ -1,120 +1,122 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #include <qcheckbox.h> | 3 | #include <qcheckbox.h> |
4 | #include <qgroupbox.h> | 4 | #include <qgroupbox.h> |
5 | #include <qhbox.h> | 5 | #include <qhbox.h> |
6 | #include <qlabel.h> | 6 | #include <qlabel.h> |
7 | #include <qabstractlayout.h> | 7 | #include <qabstractlayout.h> |
8 | #include <qlayout.h> | 8 | #include <qlayout.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qpixmap.h> | 10 | #include <qpixmap.h> |
11 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
12 | #include <qvbox.h> | 12 | #include <qvbox.h> |
13 | #include <qwhatsthis.h> | 13 | #include <qwhatsthis.h> |
14 | 14 | ||
15 | 15 | ||
16 | #include <qpe/config.h> | 16 | #include <qpe/config.h> |
17 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
18 | 18 | ||
19 | #include "mediumwidget.h" | 19 | #include "mediumwidget.h" |
20 | 20 | ||
21 | 21 | ||
22 | 22 | ||
23 | using namespace MediumMountSetting; | 23 | using namespace MediumMountSetting; |
24 | 24 | ||
25 | /* TRANSLATOR MediumMountSetting::MediumMountWidget */ | ||
26 | |||
25 | MediumMountWidget::MediumMountWidget(const QString &path, | 27 | MediumMountWidget::MediumMountWidget(const QString &path, |
26 | const QPixmap &pix, | 28 | const QPixmap &pix, |
27 | QWidget *parent, | 29 | QWidget *parent, |
28 | const char *name ) | 30 | const char *name ) |
29 | : QWidget( parent, name ) | 31 | : QWidget( parent, name ) |
30 | { | 32 | { |
31 | if(parent == 0){ | 33 | if(parent == 0){ |
32 | resize(QApplication::desktop()->width(), QApplication::desktop()->height() ); | 34 | resize(QApplication::desktop()->width(), QApplication::desktop()->height() ); |
33 | }else{ | 35 | }else{ |
34 | resize(parent->width(), parent->height() ); | 36 | resize(parent->width(), parent->height() ); |
35 | } | 37 | } |
36 | m_path = path; | 38 | m_path = path; |
37 | initGUI(); | 39 | initGUI(); |
38 | m_label->setPixmap(pix ); | 40 | m_label->setPixmap(pix ); |
39 | m_config = 0; | 41 | m_config = 0; |
40 | 42 | ||
41 | readConfig(); | 43 | readConfig(); |
42 | } | 44 | } |
43 | // now we fire up the GUI | 45 | // now we fire up the GUI |
44 | // if I would know what I'm doing ;) | 46 | // if I would know what I'm doing ;) |
45 | void MediumMountWidget::initGUI() | 47 | void MediumMountWidget::initGUI() |
46 | { | 48 | { |
47 | //main layout | 49 | //main layout |
48 | m_box = new QVBoxLayout( this , 5, 5 ); | 50 | m_box = new QVBoxLayout( this , 5, 5 ); |
49 | //m_box->setSpacing( 5 ); | 51 | //m_box->setSpacing( 5 ); |
50 | //m_box->addStretch( -1 ); | 52 | //m_box->addStretch( -1 ); |
51 | 53 | ||
52 | // picture + text | 54 | // picture + text |
53 | m_infoBox = new QHBox(this, "infobox" ); | 55 | m_infoBox = new QHBox(this, "infobox" ); |
54 | //m_infoBox->setSpacing( 4 ); | 56 | //m_infoBox->setSpacing( 4 ); |
55 | m_label = new QLabel(m_infoBox ); | 57 | m_label = new QLabel(m_infoBox ); |
56 | m_desc = new QLabel(m_infoBox ); | 58 | m_desc = new QLabel(m_infoBox ); |
57 | m_desc->setTextFormat( Qt::RichText ); | 59 | m_desc->setTextFormat( Qt::RichText ); |
58 | QWhatsThis::add( this, tr("Configure this medium. The changes will" | 60 | QWhatsThis::add( this, tr("Configure this medium. The changes will" |
59 | " go into effect when the application gets" | 61 | " go into effect when the application gets" |
60 | " closed. To update the Document Tab you need" | 62 | " closed. To update the Document Tab you need" |
61 | " to remove and insert this medium.")); | 63 | " to remove and insert this medium.")); |
62 | m_desc->setText("" ); | 64 | m_desc->setText("" ); |
63 | m_box->addWidget( m_infoBox ); // add the widget to the layout | 65 | m_box->addWidget( m_infoBox ); // add the widget to the layout |
64 | 66 | ||
65 | 67 | ||
66 | // groupbox | 68 | // groupbox |
67 | m_group = new QGroupBox(tr("Which media files"), this, "MediaFiles" ); | 69 | m_group = new QGroupBox(tr("Which media files"), this, "MediaFiles" ); |
68 | m_checks = new QGridLayout( m_group, 4, 3 ); | 70 | m_checks = new QGridLayout( m_group, 4, 3 ); |
69 | //m_checks->setMargin( 12 ); | 71 | //m_checks->setMargin( 12 ); |
70 | 72 | ||
71 | 73 | ||
72 | 74 | ||
73 | QSpacerItem *item2 = new QSpacerItem(5, 8, | 75 | QSpacerItem *item2 = new QSpacerItem(5, 8, |
74 | QSizePolicy::Fixed, | 76 | QSizePolicy::Fixed, |
75 | QSizePolicy::Fixed); | 77 | QSizePolicy::Fixed); |
76 | m_box->addItem( item2 ); | 78 | m_box->addItem( item2 ); |
77 | 79 | ||
78 | m_audio = new QCheckBox( tr("Audio"), m_group ); | 80 | m_audio = new QCheckBox( tr("Audio"), m_group ); |
79 | m_all = new QCheckBox( tr("All") , m_group ); | 81 | m_all = new QCheckBox( tr("All") , m_group ); |
80 | m_image = new QCheckBox( tr("Image"), m_group ); | 82 | m_image = new QCheckBox( tr("Image"), m_group ); |
81 | m_text = new QCheckBox( tr("Text") , m_group ); | 83 | m_text = new QCheckBox( tr("Text") , m_group ); |
82 | m_video = new QCheckBox( tr("Video"), m_group ); | 84 | m_video = new QCheckBox( tr("Video"), m_group ); |
83 | 85 | ||
84 | QSpacerItem *iti1b = new QSpacerItem(2, 10, QSizePolicy::Fixed, | 86 | QSpacerItem *iti1b = new QSpacerItem(2, 10, QSizePolicy::Fixed, |
85 | QSizePolicy::Fixed ); | 87 | QSizePolicy::Fixed ); |
86 | m_checks->addItem( iti1b, 0, 0 ); | 88 | m_checks->addItem( iti1b, 0, 0 ); |
87 | 89 | ||
88 | m_checks->addWidget(m_audio, 1, 0 ); | 90 | m_checks->addWidget(m_audio, 1, 0 ); |
89 | m_checks->addWidget(m_image, 2, 0 ); | 91 | m_checks->addWidget(m_image, 2, 0 ); |
90 | m_checks->addWidget(m_all , 3, 0 ); | 92 | m_checks->addWidget(m_all , 3, 0 ); |
91 | 93 | ||
92 | m_checks->addWidget(m_text, 1, 2 ); | 94 | m_checks->addWidget(m_text, 1, 2 ); |
93 | m_checks->addWidget(m_video, 2, 2 ); | 95 | m_checks->addWidget(m_video, 2, 2 ); |
94 | 96 | ||
95 | m_checks->addRowSpacing(0, 8 ); | 97 | m_checks->addRowSpacing(0, 8 ); |
96 | m_checks->addColSpacing(1, 2 ); | 98 | m_checks->addColSpacing(1, 2 ); |
97 | m_checks->setColStretch(1, -2 ); | 99 | m_checks->setColStretch(1, -2 ); |
98 | 100 | ||
99 | connect(m_all, SIGNAL(stateChanged(int) ), | 101 | connect(m_all, SIGNAL(stateChanged(int) ), |
100 | this, SLOT(slotStateChanged() ) ); | 102 | this, SLOT(slotStateChanged() ) ); |
101 | 103 | ||
102 | m_box->addWidget( m_group ); | 104 | m_box->addWidget( m_group ); |
103 | 105 | ||
104 | // label | 106 | // label |
105 | m_lblPath = new QLabel(tr("Limit search to:"), this ); | 107 | m_lblPath = new QLabel(tr("Limit search to:"), this ); |
106 | m_box->addWidget( m_lblPath ); | 108 | m_box->addWidget( m_lblPath ); |
107 | 109 | ||
108 | // add to | 110 | // add to |
109 | m_hboxAdd = new QHBox( this ); | 111 | m_hboxAdd = new QHBox( this ); |
110 | //m_hboxAdd->setSpacing( 10 ); | 112 | //m_hboxAdd->setSpacing( 10 ); |
111 | m_edit = new QLineEdit(m_hboxAdd ); | 113 | m_edit = new QLineEdit(m_hboxAdd ); |
112 | m_add = new QPushButton(m_hboxAdd ); | 114 | m_add = new QPushButton(m_hboxAdd ); |
113 | m_add->setText( tr("Add") ); | 115 | m_add->setText( tr("Add") ); |
114 | 116 | ||
115 | m_box->addWidget(m_hboxAdd ); | 117 | m_box->addWidget(m_hboxAdd ); |
116 | 118 | ||
117 | m_always = new QCheckBox( tr("Always check this medium"), this ); | 119 | m_always = new QCheckBox( tr("Always check this medium"), this ); |
118 | 120 | ||
119 | m_box->addWidget( m_always ); | 121 | m_box->addWidget( m_always ); |
120 | 122 | ||