Diffstat (limited to 'noncore/settings/mediummount') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/mediummount/mainwindow.cc | 1 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumglobal.cc | 2 | ||||
-rw-r--r-- | noncore/settings/mediummount/mediumwidget.cc | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/noncore/settings/mediummount/mainwindow.cc b/noncore/settings/mediummount/mainwindow.cc index 6b37cff..eec786c 100644 --- a/noncore/settings/mediummount/mainwindow.cc +++ b/noncore/settings/mediummount/mainwindow.cc | |||
@@ -1,64 +1,65 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #include <qtabwidget.h> | 3 | #include <qtabwidget.h> |
4 | #include <qlayout.h> | 4 | #include <qlayout.h> |
5 | #include <qtooltip.h> | 5 | #include <qtooltip.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | 7 | ||
8 | #include <qpe/storage.h> | 8 | #include <qpe/storage.h> |
9 | 9 | ||
10 | #include "mediumwidget.h" | 10 | #include "mediumwidget.h" |
11 | #include "mediumglobal.h" | 11 | #include "mediumglobal.h" |
12 | 12 | ||
13 | #include "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | 14 | ||
15 | using namespace MediumMountSetting; | 15 | using namespace MediumMountSetting; |
16 | 16 | ||
17 | /* TRANSLATOR MediumMountSetting::MainWindow */ | ||
17 | 18 | ||
18 | MainWindow::MainWindow( QWidget *parent, const char *name, bool modal, WFlags ) | 19 | MainWindow::MainWindow( QWidget *parent, const char *name, bool modal, WFlags ) |
19 | : QDialog( parent, name, modal, WStyle_ContextHelp ) | 20 | : QDialog( parent, name, modal, WStyle_ContextHelp ) |
20 | 21 | ||
21 | { | 22 | { |
22 | setCaption ( tr( "Medium Mount Settings" )); | 23 | setCaption ( tr( "Medium Mount Settings" )); |
23 | 24 | ||
24 | m_lay = new QVBoxLayout( this ); | 25 | m_lay = new QVBoxLayout( this ); |
25 | 26 | ||
26 | m_tab = new QTabWidget( this ); | 27 | m_tab = new QTabWidget( this ); |
27 | 28 | ||
28 | m_lay->addWidget( m_tab ); | 29 | m_lay->addWidget( m_tab ); |
29 | 30 | ||
30 | init(); | 31 | init(); |
31 | } | 32 | } |
32 | 33 | ||
33 | MainWindow::~MainWindow() | 34 | MainWindow::~MainWindow() |
34 | { | 35 | { |
35 | } | 36 | } |
36 | 37 | ||
37 | void MainWindow::init() | 38 | void MainWindow::init() |
38 | { | 39 | { |
39 | m_global = new MediumGlobalWidget( m_tab, "test drive" ); | 40 | m_global = new MediumGlobalWidget( m_tab, "test drive" ); |
40 | m_tab->addTab( m_global, tr("Global") ); | 41 | m_tab->addTab( m_global, tr("Global") ); |
41 | 42 | ||
42 | StorageInfo storage; | 43 | StorageInfo storage; |
43 | const QList<FileSystem> &fs = storage.fileSystems(); | 44 | const QList<FileSystem> &fs = storage.fileSystems(); |
44 | QListIterator<FileSystem> it( fs ); | 45 | QListIterator<FileSystem> it( fs ); |
45 | MediumMountWidget *wid; | 46 | MediumMountWidget *wid; |
46 | for( ; it.current(); ++it ){ | 47 | for( ; it.current(); ++it ){ |
47 | if( (*it)->isRemovable() ){ | 48 | if( (*it)->isRemovable() ){ |
48 | wid = new MediumMountWidget((*it)->path(), QPixmap(), m_tab ); | 49 | wid = new MediumMountWidget((*it)->path(), QPixmap(), m_tab ); |
49 | m_mediums.append( wid ); | 50 | m_mediums.append( wid ); |
50 | m_tab->addTab( wid, (*it)->name() ); | 51 | m_tab->addTab( wid, (*it)->name() ); |
51 | } | 52 | } |
52 | } | 53 | } |
53 | } | 54 | } |
54 | 55 | ||
55 | void MainWindow::accept() | 56 | void MainWindow::accept() |
56 | { | 57 | { |
57 | m_global->writeConfig(); | 58 | m_global->writeConfig(); |
58 | 59 | ||
59 | MediumMountWidget *confWidget; | 60 | MediumMountWidget *confWidget; |
60 | for ( confWidget = m_mediums.first(); confWidget != 0; | 61 | for ( confWidget = m_mediums.first(); confWidget != 0; |
61 | confWidget = m_mediums.next() ) { | 62 | confWidget = m_mediums.next() ) { |
62 | confWidget->writeConfig(); | 63 | confWidget->writeConfig(); |
63 | } | 64 | } |
64 | 65 | ||
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,65 +1,67 @@ | |||
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 | ||
16 | using namespace MediumMountSetting; | 16 | using namespace MediumMountSetting; |
17 | 17 | ||
18 | /* TRANSLATOR MediumMountSetting::MediumGlobalWidget */ | ||
19 | |||
18 | MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) | 20 | MediumGlobalWidget::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 | } |
26 | void MediumGlobalWidget::initGUI() | 28 | void 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 | ||
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,72 +1,74 @@ | |||
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 | ||