summaryrefslogtreecommitdiff
path: root/noncore/settings/mediummount/mediumglobal.cc
Unidiff
Diffstat (limited to 'noncore/settings/mediummount/mediumglobal.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/mediummount/mediumglobal.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/mediummount/mediumglobal.cc b/noncore/settings/mediummount/mediumglobal.cc
index 75e3839..ab0b3af 100644
--- a/noncore/settings/mediummount/mediumglobal.cc
+++ b/noncore/settings/mediummount/mediumglobal.cc
@@ -1,113 +1,115 @@
1 1
2 2
3#include <qlineedit.h> 3#include <qlineedit.h>
4#include <qcheckbox.h> 4#include <qcheckbox.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qabstractlayout.h> // spacer item 6#include <qabstractlayout.h> // spacer item
7#include <qlayout.h> 7#include <qlayout.h>
8#include <qframe.h> 8#include <qframe.h>
9#include <qgroupbox.h> 9#include <qgroupbox.h>
10#include <qwhatsthis.h> 10#include <qwhatsthis.h>
11 11
12#include <qpe/config.h> 12#include <qpe/config.h>
13 13
14#include "mediumglobal.h" 14#include "mediumglobal.h"
15 15
16using namespace MediumMountSetting; 16using namespace MediumMountSetting;
17 17
18/* TRANSLATOR MediumMountSetting::MediumGlobalWidget */
19
18MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) 20MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name )
19 : QWidget( wid, name, WStyle_ContextHelp ) 21 : QWidget( wid, name, WStyle_ContextHelp )
20{ 22{
21 m_config = 0; 23 m_config = 0;
22 initGUI(); 24 initGUI();
23 readConfig(); 25 readConfig();
24 26
25} 27}
26void MediumGlobalWidget::initGUI() 28void MediumGlobalWidget::initGUI()
27{ 29{
28 m_layout = new QVBoxLayout(this ); 30 m_layout = new QVBoxLayout(this );
29 m_layout->setMargin( 4 ); 31 m_layout->setMargin( 4 );
30 // m_layout->setSpacing( 10 ); 32 // m_layout->setSpacing( 10 );
31 33
32 34
33 m_label = new QLabel( this ); 35 m_label = new QLabel( this );
34 m_label->setTextFormat( Qt::RichText ); 36 m_label->setTextFormat( Qt::RichText );
35 m_label->setText( tr("") ); 37 m_label->setText( tr("") );
36 QWhatsThis::add( this, tr("If a medium gets inserted into this device Opie " 38 QWhatsThis::add( this, tr("If a medium gets inserted into this device Opie "
37 "tries to search the medium for Documents. On " 39 "tries to search the medium for Documents. On "
38 "large mediums this can take some time. You can choose " 40 "large mediums this can take some time. You can choose "
39 "if Opie should scan for Documents globally or on a " 41 "if Opie should scan for Documents globally or on a "
40 "per medium level. You're also able to reconfigure " 42 "per medium level. You're also able to reconfigure "
41 "each medium.") ); 43 "each medium.") );
42 44
43 m_layout->addWidget( m_label ); 45 m_layout->addWidget( m_label );
44 46
45 m_check = new QCheckBox( tr("Enable medium checking" ), this ); 47 m_check = new QCheckBox( tr("Enable medium checking" ), this );
46 connect( m_check, SIGNAL(stateChanged(int) ), 48 connect( m_check, SIGNAL(stateChanged(int) ),
47 this, SLOT(slotEnableChecking() ) ); 49 this, SLOT(slotEnableChecking() ) );
48 m_layout->addWidget(m_check ); 50 m_layout->addWidget(m_check );
49 51
50 m_frame = new QFrame(this, "Frame" ); 52 m_frame = new QFrame(this, "Frame" );
51 m_frame->setFrameShape( QFrame::Box ); 53 m_frame->setFrameShape( QFrame::Box );
52 m_frame->setFrameShadow( QFrame::Sunken ); 54 m_frame->setFrameShadow( QFrame::Sunken );
53 55
54 m_box = new QVBoxLayout( m_frame ); 56 m_box = new QVBoxLayout( m_frame );
55 m_box->setMargin( 5 ); 57 m_box->setMargin( 5 );
56 m_useglobal = new QCheckBox( tr("Use global settings"), m_frame ); 58 m_useglobal = new QCheckBox( tr("Use global settings"), m_frame );
57 connect( m_useglobal, SIGNAL( stateChanged(int) ), 59 connect( m_useglobal, SIGNAL( stateChanged(int) ),
58 this, SLOT( slotGlobalChanged() ) ); 60 this, SLOT( slotGlobalChanged() ) );
59 61
60 m_box->addWidget( m_useglobal ); 62 m_box->addWidget( m_useglobal );
61 63
62 m_global = new QGroupBox( tr("Which media files"), m_frame ); 64 m_global = new QGroupBox( tr("Which media files"), m_frame );
63 m_frameLay = new QGridLayout(m_global, 4, 3 ); 65 m_frameLay = new QGridLayout(m_global, 4, 3 );
64 m_frameLay->setMargin( 10 ); 66 m_frameLay->setMargin( 10 );
65 67
66 QSpacerItem *item2 = new QSpacerItem( 5, 8, 68 QSpacerItem *item2 = new QSpacerItem( 5, 8,
67 QSizePolicy::Fixed, 69 QSizePolicy::Fixed,
68 QSizePolicy::Fixed ); 70 QSizePolicy::Fixed );
69 m_audio = new QCheckBox( tr("Audio"), m_global ); 71 m_audio = new QCheckBox( tr("Audio"), m_global );
70 m_all = new QCheckBox( tr("All") , m_global ); 72 m_all = new QCheckBox( tr("All") , m_global );
71 m_image = new QCheckBox( tr("Image"), m_global ); 73 m_image = new QCheckBox( tr("Image"), m_global );
72 m_text = new QCheckBox( tr("Text") , m_global ); 74 m_text = new QCheckBox( tr("Text") , m_global );
73 m_video = new QCheckBox( tr("Video"), m_global ); 75 m_video = new QCheckBox( tr("Video"), m_global );
74 76
75 connect(m_all, SIGNAL(stateChanged(int) ), 77 connect(m_all, SIGNAL(stateChanged(int) ),
76 this, SLOT(slotAllChanged() ) ); 78 this, SLOT(slotAllChanged() ) );
77 79
78 m_frameLay->addItem( item2, 0, 0 ); 80 m_frameLay->addItem( item2, 0, 0 );
79 81
80 m_frameLay->addWidget( m_audio, 1, 0 ); 82 m_frameLay->addWidget( m_audio, 1, 0 );
81 m_frameLay->addWidget( m_image, 2, 0 ); 83 m_frameLay->addWidget( m_image, 2, 0 );
82 m_frameLay->addWidget( m_all, 3, 0 ); 84 m_frameLay->addWidget( m_all, 3, 0 );
83 85
84 m_frameLay->addWidget( m_text, 1, 2 ); 86 m_frameLay->addWidget( m_text, 1, 2 );
85 m_frameLay->addWidget( m_video, 2, 2 ); 87 m_frameLay->addWidget( m_video, 2, 2 );
86 88
87 m_frameLay->addRowSpacing( 0, 8 ); 89 m_frameLay->addRowSpacing( 0, 8 );
88 m_frameLay->addColSpacing( 1, 2 ); 90 m_frameLay->addColSpacing( 1, 2 );
89 91
90 m_box->addWidget( m_global ); 92 m_box->addWidget( m_global );
91 93
92 94
93 m_layout->addWidget( m_frame ); 95 m_layout->addWidget( m_frame );
94 96
95 QSpacerItem *item1 = new QSpacerItem( 1, 24, 97 QSpacerItem *item1 = new QSpacerItem( 1, 24,
96 QSizePolicy::Fixed, 98 QSizePolicy::Fixed,
97 QSizePolicy::Expanding ); 99 QSizePolicy::Expanding );
98 m_layout->addItem( item1 ); 100 m_layout->addItem( item1 );
99} 101}
100void MediumGlobalWidget::readConfig() 102void MediumGlobalWidget::readConfig()
101{ 103{
102 if( m_config == 0 ) 104 if( m_config == 0 )
103 m_config = new Config("medium" ); 105 m_config = new Config("medium" );
104 106
105 m_config->setGroup("main"); 107 m_config->setGroup("main");
106 m_useglobal->setChecked( m_config->readBoolEntry("global", false ) ); 108 m_useglobal->setChecked( m_config->readBoolEntry("global", false ) );
107 m_check->setChecked( m_config->readBoolEntry("use", true ) ); 109 m_check->setChecked( m_config->readBoolEntry("use", true ) );
108 110
109 m_config->setGroup("mimetypes" ); 111 m_config->setGroup("mimetypes" );
110 m_all->setChecked ( m_config->readBoolEntry("all", false ) ); 112 m_all->setChecked ( m_config->readBoolEntry("all", false ) );
111 m_audio->setChecked( m_config->readBoolEntry("audio", true ) ); 113 m_audio->setChecked( m_config->readBoolEntry("audio", true ) );
112 m_video->setChecked( m_config->readBoolEntry("video", true ) ); 114 m_video->setChecked( m_config->readBoolEntry("video", true ) );
113 m_text->setChecked ( m_config->readBoolEntry("text", true ) ); 115 m_text->setChecked ( m_config->readBoolEntry("text", true ) );