-rw-r--r-- | noncore/settings/mediummount/mainwindow.cc | 7 | ||||
-rw-r--r-- | noncore/settings/mediummount/mainwindow.h | 1 |
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 @@ #include <qtabwidget.h> #include <qlayout.h> #include <qtooltip.h> #include <qwhatsthis.h> #include <qpe/storage.h> #include "mediumwidget.h" #include "mediumglobal.h" #include "mainwindow.h" using namespace MediumMountSetting; MainWindow::MainWindow( QWidget *parent, const char *name, bool modal, WFlags ) : QDialog( parent, name, modal, WStyle_ContextHelp ) { setCaption ( tr( "Medium Mount Settings" )); m_lay = new QVBoxLayout( this ); m_tab = new QTabWidget( this ); m_lay->addWidget( m_tab ); init(); } MainWindow::~MainWindow() { } void MainWindow::init() { m_global = new MediumGlobalWidget( m_tab, "test drive" ); m_tab->addTab( m_global, tr("Global") ); StorageInfo storage; const QList<FileSystem> &fs = storage.fileSystems(); QListIterator<FileSystem> it( fs ); MediumMountWidget *wid; for( ; it.current(); ++it ){ if( (*it)->isRemovable() ){ wid = new MediumMountWidget((*it)->path(), QPixmap(), m_tab ); m_mediums.append( wid ); m_tab->addTab( wid, (*it)->name() ); } } } void MainWindow::accept() { m_global->writeConfig(); MediumMountWidget *confWidget; for ( confWidget = m_mediums.first(); confWidget != 0; confWidget = m_mediums.next() ) { confWidget->writeConfig(); } QDialog::accept(); } +void MainWindow::done ( int r ) +{ + QDialog::done( r ); + close (); +} + + void MainWindow::slotGlobalChanged(int ) { } void MainWindow::slotCheckingChanged(int ) { } 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 @@ #ifndef MediumMountMainwindow_h #define MediumMountMainwindow_h #include <qlist.h> #include <qdialog.h> class QVBoxLayout; class QTabWidget; namespace MediumMountSetting { class MediumMountWidget; class MediumGlobalWidget; class MainWindow : public QDialog { Q_OBJECT public: MainWindow(QWidget *parent = 0, const char *name = 0 , bool modal = FALSE, WFlags = 0); ~MainWindow(); private slots: void slotGlobalChanged(int ); void slotCheckingChanged(int ); void accept(); + void done( int ); private: void init(); QTabWidget *m_tab; QVBoxLayout *m_lay; MediumGlobalWidget *m_global; QList<MediumMountWidget> m_mediums; }; }; #endif |