summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/mediummount/mainwindow.cc4
-rw-r--r--noncore/settings/mediummount/mainwindow.h2
-rw-r--r--noncore/settings/mediummount/mediumglobal.cc31
3 files changed, 20 insertions, 17 deletions
diff --git a/noncore/settings/mediummount/mainwindow.cc b/noncore/settings/mediummount/mainwindow.cc
index 88f7c61..cf8ad6c 100644
--- a/noncore/settings/mediummount/mainwindow.cc
+++ b/noncore/settings/mediummount/mainwindow.cc
@@ -1,49 +1,49 @@
1 1
2 2
3#include <qtabwidget.h> 3#include <qtabwidget.h>
4#include <qlayout.h> 4#include <qlayout.h>
5 5
6#include <qpe/storage.h> 6#include <qpe/storage.h>
7 7
8#include "mediumwidget.h" 8#include "mediumwidget.h"
9#include "mediumglobal.h" 9#include "mediumglobal.h"
10 10
11#include "mainwindow.h" 11#include "mainwindow.h"
12 12
13using namespace MediumMountSetting; 13using namespace MediumMountSetting;
14 14
15 15
16MainWindow::MainWindow( QWidget *parent, const char *name ) 16MainWindow::MainWindow( QWidget *parent, const char *name, WFlags )
17 : QMainWindow( parent, name ) 17 : QMainWindow( parent, name, WStyle_ContextHelp )
18 18
19{ 19{
20 // m_lay = new QVBoxLayout( this ); 20 // m_lay = new QVBoxLayout( this );
21 m_tab = new QTabWidget( this ); 21 m_tab = new QTabWidget( this );
22 setCentralWidget( m_tab ); 22 setCentralWidget( m_tab );
23 init(); 23 init();
24} 24}
25 25
26MainWindow::~MainWindow() 26MainWindow::~MainWindow()
27{ 27{
28 28
29} 29}
30void MainWindow::init() 30void MainWindow::init()
31{ 31{
32 m_global = new MediumGlobalWidget( m_tab, "test drive" ); 32 m_global = new MediumGlobalWidget( m_tab, "test drive" );
33 m_tab->addTab( m_global, tr("Global") ); 33 m_tab->addTab( m_global, tr("Global") );
34 34
35 StorageInfo storage; 35 StorageInfo storage;
36 const QList<FileSystem> &fs = storage.fileSystems(); 36 const QList<FileSystem> &fs = storage.fileSystems();
37 QListIterator<FileSystem> it( fs ); 37 QListIterator<FileSystem> it( fs );
38 MediumMountWidget *wid; 38 MediumMountWidget *wid;
39 for( ; it.current(); ++it ){ 39 for( ; it.current(); ++it ){
40 if( (*it)->isRemovable() ){ 40 if( (*it)->isRemovable() ){
41 wid = new MediumMountWidget((*it)->path(), QPixmap(), m_tab ); 41 wid = new MediumMountWidget((*it)->path(), QPixmap(), m_tab );
42 m_mediums.append( wid ); 42 m_mediums.append( wid );
43 m_tab->addTab( wid, (*it)->name() ); 43 m_tab->addTab( wid, (*it)->name() );
44 } 44 }
45 } 45 }
46} 46}
47 47
48void MainWindow::slotGlobalChanged(int ) 48void MainWindow::slotGlobalChanged(int )
49{ 49{
diff --git a/noncore/settings/mediummount/mainwindow.h b/noncore/settings/mediummount/mainwindow.h
index 1e60e12..ce54674 100644
--- a/noncore/settings/mediummount/mainwindow.h
+++ b/noncore/settings/mediummount/mainwindow.h
@@ -1,33 +1,33 @@
1 1
2 2
3#ifndef MediumMountMainwindow_h 3#ifndef MediumMountMainwindow_h
4#define MediumMountMainwindow_h 4#define MediumMountMainwindow_h
5 5
6#include <qlist.h> 6#include <qlist.h>
7#include <qmainwindow.h> 7#include <qmainwindow.h>
8 8
9class QVBoxLayout; 9class QVBoxLayout;
10class QTabWidget; 10class QTabWidget;
11 11
12namespace MediumMountSetting { 12namespace MediumMountSetting {
13 class MediumMountWidget; 13 class MediumMountWidget;
14 class MediumGlobalWidget; 14 class MediumGlobalWidget;
15 class MainWindow : public QMainWindow { 15 class MainWindow : public QMainWindow {
16 Q_OBJECT 16 Q_OBJECT
17 public: 17 public:
18 MainWindow(QWidget *parent = 0, const char *name = 0 ); 18 MainWindow(QWidget *parent = 0, const char *name = 0 , WFlags = 0);
19 ~MainWindow(); 19 ~MainWindow();
20 20
21 private slots: 21 private slots:
22 void slotGlobalChanged(int ); 22 void slotGlobalChanged(int );
23 void slotCheckingChanged(int ); 23 void slotCheckingChanged(int );
24 private: 24 private:
25 void init(); 25 void init();
26 QTabWidget *m_tab; 26 QTabWidget *m_tab;
27 QVBoxLayout *m_lay; 27 QVBoxLayout *m_lay;
28 MediumGlobalWidget *m_global; 28 MediumGlobalWidget *m_global;
29 QList<MediumMountWidget> m_mediums; 29 QList<MediumMountWidget> m_mediums;
30 }; 30 };
31}; 31};
32 32
33#endif 33#endif
diff --git a/noncore/settings/mediummount/mediumglobal.cc b/noncore/settings/mediummount/mediumglobal.cc
index 921fcd1..c1ad415 100644
--- a/noncore/settings/mediummount/mediumglobal.cc
+++ b/noncore/settings/mediummount/mediumglobal.cc
@@ -1,127 +1,130 @@
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 11
11#include <qpe/config.h> 12#include <qpe/config.h>
12 13
13#include "mediumglobal.h" 14#include "mediumglobal.h"
14 15
15using namespace MediumMountSetting; 16using namespace MediumMountSetting;
16 17
17MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) 18MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name )
18 : QWidget( wid, name ) 19 : QWidget( wid, name )
19{ 20{
20 m_config = 0; 21 m_config = 0;
21 initGUI(); 22 initGUI();
22 readConfig(); 23 readConfig();
23 24
24} 25}
25void MediumGlobalWidget::initGUI() 26void MediumGlobalWidget::initGUI()
26{ 27{
27 m_layout = new QVBoxLayout(this ); 28 m_layout = new QVBoxLayout(this );
28 m_layout->setMargin( 10 ); 29 m_layout->setMargin( 10 );
29 m_layout->setSpacing( 10 ); 30 m_layout->setSpacing( 10 );
30 31
31 32
32 m_label = new QLabel( this ); 33 m_label = new QLabel( this );
33 m_label->setTextFormat( Qt::RichText ); 34 m_label->setTextFormat( Qt::RichText );
34 m_label->setText( tr("If a medium gets inserted into this device Opie " 35 m_label->setText( tr("") );
35 "tries to search the medium for Dcouments. On " 36 QWhatsThis::add( this, ("If a medium gets inserted into this device Opie "
36 "large mediums this can take some time. You can choose " 37 "tries to search the medium for Dcouments. On "
37 "if Opie should scan for Documents globally or on a " 38 "large mediums this can take some time. You can choose "
38 "per medium level. You're also able to reconfigure " 39 "if Opie should scan for Documents globally or on a "
39 "each medium." 40 "per medium level. You're also able to reconfigure "
40 ) ); 41 "each medium."
42 ) );
43
41 m_layout->addWidget( m_label ); 44 m_layout->addWidget( m_label );
42 45
43 m_check = new QCheckBox( tr("Enable medium checking" ), this ); 46 m_check = new QCheckBox( tr("Enable medium checking" ), this );
44 connect( m_check, SIGNAL(stateChanged(int) ), 47 connect( m_check, SIGNAL(stateChanged(int) ),
45 this, SLOT(slotEnableChecking() ) ); 48 this, SLOT(slotEnableChecking() ) );
46 m_layout->addWidget(m_check ); 49 m_layout->addWidget(m_check );
47 50
48 m_frame = new QFrame(this, "Frame" ); 51 m_frame = new QFrame(this, "Frame" );
49 m_frame->setFrameShape( QFrame::Box ); 52 m_frame->setFrameShape( QFrame::Box );
50 m_frame->setFrameShadow( QFrame::Sunken ); 53 m_frame->setFrameShadow( QFrame::Sunken );
51 54
52 m_box = new QVBoxLayout( m_frame ); 55 m_box = new QVBoxLayout( m_frame );
53 m_box->setMargin( 5 ); 56 m_box->setMargin( 5 );
54 m_useglobal = new QCheckBox( tr("Use global settings"), m_frame ); 57 m_useglobal = new QCheckBox( tr("Use global settings"), m_frame );
55 connect( m_useglobal, SIGNAL( stateChanged(int) ), 58 connect( m_useglobal, SIGNAL( stateChanged(int) ),
56 this, SLOT( slotGlobalChanged() ) ); 59 this, SLOT( slotGlobalChanged() ) );
57 60
58 m_box->addWidget( m_useglobal ); 61 m_box->addWidget( m_useglobal );
59 62
60 m_global = new QGroupBox( tr("Which media files"), m_frame ); 63 m_global = new QGroupBox( tr("Which media files"), m_frame );
61 m_frameLay = new QGridLayout(m_global, 4, 3 ); 64 m_frameLay = new QGridLayout(m_global, 4, 3 );
62 m_frameLay->setMargin( 12 ); 65 m_frameLay->setMargin( 12 );
63 66
64 QSpacerItem *item2 = new QSpacerItem( 5, 8, 67 QSpacerItem *item2 = new QSpacerItem( 5, 8,
65 QSizePolicy::Fixed, 68 QSizePolicy::Fixed,
66 QSizePolicy::Fixed ); 69 QSizePolicy::Fixed );
67 m_audio = new QCheckBox( tr("Audio"), m_global ); 70 m_audio = new QCheckBox( tr("Audio"), m_global );
68 m_all = new QCheckBox( tr("All") , m_global ); 71 m_all = new QCheckBox( tr("All") , m_global );
69 m_image = new QCheckBox( tr("Image"), m_global ); 72 m_image = new QCheckBox( tr("Image"), m_global );
70 m_text = new QCheckBox( tr("Text") , m_global ); 73 m_text = new QCheckBox( tr("Text") , m_global );
71 m_video = new QCheckBox( tr("Video"), m_global ); 74 m_video = new QCheckBox( tr("Video"), m_global );
72 75
73 connect(m_all, SIGNAL(stateChanged(int) ), 76 connect(m_all, SIGNAL(stateChanged(int) ),
74 this, SLOT(slotAllChanged() ) ); 77 this, SLOT(slotAllChanged() ) );
75 78
76 m_frameLay->addItem( item2, 0, 0 ); 79 m_frameLay->addItem( item2, 0, 0 );
77 80
78 m_frameLay->addWidget( m_audio, 1, 0 ); 81 m_frameLay->addWidget( m_audio, 1, 0 );
79 m_frameLay->addWidget( m_image, 2, 0 ); 82 m_frameLay->addWidget( m_image, 2, 0 );
80 m_frameLay->addWidget( m_all, 3, 0 ); 83 m_frameLay->addWidget( m_all, 3, 0 );
81 84
82 m_frameLay->addWidget( m_text, 1, 2 ); 85 m_frameLay->addWidget( m_text, 1, 2 );
83 m_frameLay->addWidget( m_video, 2, 2 ); 86 m_frameLay->addWidget( m_video, 2, 2 );
84 87
85 m_frameLay->addRowSpacing( 0, 8 ); 88 m_frameLay->addRowSpacing( 0, 8 );
86 m_frameLay->addColSpacing( 1, 2 ); 89 m_frameLay->addColSpacing( 1, 2 );
87 90
88 m_box->addWidget( m_global ); 91 m_box->addWidget( m_global );
89 92
90 93
91 m_layout->addWidget( m_frame ); 94 m_layout->addWidget( m_frame );
92 95
93 QSpacerItem *item1 = new QSpacerItem( 1, 24, 96 QSpacerItem *item1 = new QSpacerItem( 1, 24,
94 QSizePolicy::Fixed, 97 QSizePolicy::Fixed,
95 QSizePolicy::Expanding ); 98 QSizePolicy::Expanding );
96 m_layout->addItem( item1 ); 99 m_layout->addItem( item1 );
97} 100}
98void MediumGlobalWidget::readConfig() 101void MediumGlobalWidget::readConfig()
99{ 102{
100 if( m_config == 0 ) 103 if( m_config == 0 )
101 m_config = new Config("medium" ); 104 m_config = new Config("medium" );
102 105
103 m_config->setGroup("main"); 106 m_config->setGroup("main");
104 m_useglobal->setChecked( m_config->readBoolEntry("global", false ) ); 107 m_useglobal->setChecked( m_config->readBoolEntry("global", false ) );
105 m_check->setChecked( m_config->readBoolEntry("use", true ) ); 108 m_check->setChecked( m_config->readBoolEntry("use", true ) );
106 109
107 m_config->setGroup("mimetypes" ); 110 m_config->setGroup("mimetypes" );
108 m_all->setChecked ( m_config->readBoolEntry("all", false ) ); 111 m_all->setChecked ( m_config->readBoolEntry("all", false ) );
109 m_audio->setChecked( m_config->readBoolEntry("audio", true ) ); 112 m_audio->setChecked( m_config->readBoolEntry("audio", true ) );
110 m_video->setChecked( m_config->readBoolEntry("video", true ) ); 113 m_video->setChecked( m_config->readBoolEntry("video", true ) );
111 m_text->setChecked ( m_config->readBoolEntry("text", true ) ); 114 m_text->setChecked ( m_config->readBoolEntry("text", true ) );
112 m_image->setChecked( m_config->readBoolEntry("image", true ) ); 115 m_image->setChecked( m_config->readBoolEntry("image", true ) );
113 116
114 slotAllChanged(); 117 slotAllChanged();
115 slotEnableChecking(); 118 slotEnableChecking();
116 slotGlobalChanged(); 119 slotGlobalChanged();
117 if( m_all->isChecked() ){ 120 if( m_all->isChecked() ){
118 m_video->setEnabled( false ); 121 m_video->setEnabled( false );
119 m_text->setEnabled( false ); 122 m_text->setEnabled( false );
120 m_audio->setEnabled( false ); 123 m_audio->setEnabled( false );
121 m_image->setEnabled( false ); 124 m_image->setEnabled( false );
122 125
123 } 126 }
124} 127}
125void MediumGlobalWidget::writeConfig() 128void MediumGlobalWidget::writeConfig()
126{ 129{
127 m_config->setGroup( "main" ); 130 m_config->setGroup( "main" );