summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-28 07:42:56 (UTC)
committer harlekin <harlekin>2003-03-28 07:42:56 (UTC)
commit827e06044df4df235912156c730baa3c87717526 (patch) (unidiff)
treeb4cc79ed55e987d1fc6a6c30140950ef4e4ec4f1
parent39a71f2dfcb0116554d2806735adb394847a2027 (diff)
downloadopie-827e06044df4df235912156c730baa3c87717526.zip
opie-827e06044df4df235912156c730baa3c87717526.tar.gz
opie-827e06044df4df235912156c730baa3c87717526.tar.bz2
close mediummount on exit .-)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/mediummount/mainwindow.cc7
-rw-r--r--noncore/settings/mediummount/mainwindow.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/noncore/settings/mediummount/mainwindow.cc b/noncore/settings/mediummount/mainwindow.cc
index bfd1e21..6b37cff 100644
--- a/noncore/settings/mediummount/mainwindow.cc
+++ b/noncore/settings/mediummount/mainwindow.cc
@@ -1,75 +1,82 @@
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
15using namespace MediumMountSetting; 15using namespace MediumMountSetting;
16 16
17 17
18MainWindow::MainWindow( QWidget *parent, const char *name, bool modal, WFlags ) 18MainWindow::MainWindow( QWidget *parent, const char *name, bool modal, WFlags )
19 : QDialog( parent, name, modal, WStyle_ContextHelp ) 19 : QDialog( parent, name, modal, WStyle_ContextHelp )
20 20
21{ 21{
22 setCaption ( tr( "Medium Mount Settings" )); 22 setCaption ( tr( "Medium Mount Settings" ));
23 23
24 m_lay = new QVBoxLayout( this ); 24 m_lay = new QVBoxLayout( this );
25 25
26 m_tab = new QTabWidget( this ); 26 m_tab = new QTabWidget( this );
27 27
28 m_lay->addWidget( m_tab ); 28 m_lay->addWidget( m_tab );
29 29
30 init(); 30 init();
31} 31}
32 32
33MainWindow::~MainWindow() 33MainWindow::~MainWindow()
34{ 34{
35} 35}
36 36
37void MainWindow::init() 37void MainWindow::init()
38{ 38{
39 m_global = new MediumGlobalWidget( m_tab, "test drive" ); 39 m_global = new MediumGlobalWidget( m_tab, "test drive" );
40 m_tab->addTab( m_global, tr("Global") ); 40 m_tab->addTab( m_global, tr("Global") );
41 41
42 StorageInfo storage; 42 StorageInfo storage;
43 const QList<FileSystem> &fs = storage.fileSystems(); 43 const QList<FileSystem> &fs = storage.fileSystems();
44 QListIterator<FileSystem> it( fs ); 44 QListIterator<FileSystem> it( fs );
45 MediumMountWidget *wid; 45 MediumMountWidget *wid;
46 for( ; it.current(); ++it ){ 46 for( ; it.current(); ++it ){
47 if( (*it)->isRemovable() ){ 47 if( (*it)->isRemovable() ){
48 wid = new MediumMountWidget((*it)->path(), QPixmap(), m_tab ); 48 wid = new MediumMountWidget((*it)->path(), QPixmap(), m_tab );
49 m_mediums.append( wid ); 49 m_mediums.append( wid );
50 m_tab->addTab( wid, (*it)->name() ); 50 m_tab->addTab( wid, (*it)->name() );
51 } 51 }
52 } 52 }
53} 53}
54 54
55void MainWindow::accept() 55void MainWindow::accept()
56{ 56{
57 m_global->writeConfig(); 57 m_global->writeConfig();
58 58
59 MediumMountWidget *confWidget; 59 MediumMountWidget *confWidget;
60 for ( confWidget = m_mediums.first(); confWidget != 0; 60 for ( confWidget = m_mediums.first(); confWidget != 0;
61 confWidget = m_mediums.next() ) { 61 confWidget = m_mediums.next() ) {
62 confWidget->writeConfig(); 62 confWidget->writeConfig();
63 } 63 }
64 64
65 QDialog::accept(); 65 QDialog::accept();
66} 66}
67 67
68void MainWindow::done ( int r )
69{
70 QDialog::done( r );
71 close ();
72}
73
74
68void MainWindow::slotGlobalChanged(int ) 75void MainWindow::slotGlobalChanged(int )
69{ 76{
70 77
71} 78}
72void MainWindow::slotCheckingChanged(int ) 79void MainWindow::slotCheckingChanged(int )
73{ 80{
74 81
75} 82}
diff --git a/noncore/settings/mediummount/mainwindow.h b/noncore/settings/mediummount/mainwindow.h
index 9c648ef..71dac79 100644
--- a/noncore/settings/mediummount/mainwindow.h
+++ b/noncore/settings/mediummount/mainwindow.h
@@ -1,34 +1,35 @@
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 <qdialog.h> 7#include <qdialog.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 QDialog { 15 class MainWindow : public QDialog {
16 Q_OBJECT 16 Q_OBJECT
17 public: 17 public:
18 MainWindow(QWidget *parent = 0, const char *name = 0 , bool modal = FALSE, WFlags = 0); 18 MainWindow(QWidget *parent = 0, const char *name = 0 , bool modal = FALSE, 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 void accept(); 24 void accept();
25 void done( int );
25 private: 26 private:
26 void init(); 27 void init();
27 QTabWidget *m_tab; 28 QTabWidget *m_tab;
28 QVBoxLayout *m_lay; 29 QVBoxLayout *m_lay;
29 MediumGlobalWidget *m_global; 30 MediumGlobalWidget *m_global;
30 QList<MediumMountWidget> m_mediums; 31 QList<MediumMountWidget> m_mediums;
31 }; 32 };
32}; 33};
33 34
34#endif 35#endif