-rw-r--r-- | core/launcher/mediummountgui.cpp | 24 | ||||
-rw-r--r-- | core/launcher/mediummountgui.h | 10 |
2 files changed, 10 insertions, 24 deletions
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp index 6d60ce4..b0a1b10 100644 --- a/core/launcher/mediummountgui.cpp +++ b/core/launcher/mediummountgui.cpp @@ -143,9 +143,9 @@ void MediumMountGui::startGui() { connect( CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers() ) ); QVBox* dirBox = new QVBox( this ); - dirBox->setMargin( 4 ); + dirBox->setMargin( 5 ); // select dirs DirSelectText = new QLabel( dirBox, "DirSelectText" ); DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) ); @@ -153,8 +153,9 @@ void MediumMountGui::startGui() { QHBox* dirLineBox = new QHBox( dirBox ); LineEdit1 = new QLineEdit( dirLineBox ); PushButton3 = new QPushButton( dirLineBox ); PushButton3->setText( tr( "Add" ) ); + PushButton3->setFocus(); // decision DirSelectText_2 = new QLabel( dirBox ); DirSelectText_2->setText( tr( "Your decision will be stored on the medium." ) ); @@ -170,22 +171,11 @@ void MediumMountGui::startGui() { CheckBoxVideo->setChecked( checkmimevideo ); CheckBoxAll->setChecked( checkmimeall ); deactivateOthers(); - QHBox* buttonBox = new QHBox( this ); - // buttons - quit = new QPushButton( buttonBox ); - quit->setFocus(); - quit->setText( tr( "Yes" ) ); - quit_2 = new QPushButton( buttonBox ); - quit_2->setText( tr( "No" ) ); - mainLayout->addWidget( GroupBox1 ); mainLayout->addWidget( dirBox ); - mainLayout->addWidget( buttonBox ); - - connect( quit, SIGNAL( clicked() ), this, SLOT( yesPressed() ) ); - connect( quit_2, SIGNAL( clicked() ), this, SLOT( noPressed() ) ); + mainLayout->addStretch( 0 ); } void MediumMountGui::deactivateOthers() { @@ -195,22 +185,22 @@ void MediumMountGui::deactivateOthers() { CheckBoxText->setEnabled( mod ); CheckBoxImage->setEnabled( mod ); } -void MediumMountGui::yesPressed() { +void MediumMountGui::accept() { writeConfig( true ); // and do something - accept(); + QDialog::accept(); } QStringList MediumMountGui::mimeTypes() { return mimeTypeList; } -void MediumMountGui::noPressed() { +void MediumMountGui::reject() { writeConfig( false ); - reject(); + QDialog::reject(); } MediumMountGui::~MediumMountGui() { } diff --git a/core/launcher/mediummountgui.h b/core/launcher/mediummountgui.h index 39f9a52..d5c0fe7 100644 --- a/core/launcher/mediummountgui.h +++ b/core/launcher/mediummountgui.h @@ -17,14 +17,12 @@ class Config; class MediumMountGui : public QDialog { Q_OBJECT public: - MediumMountGui( Config *cfg, const QString &path = "tmp/", QWidget* parent = 0, const char* name = 0, bool modal = FALSE ,WFlags fl = 0 ); + MediumMountGui( Config *cfg, const QString &path = "tmp/", QWidget* parent = 0, const char* name = 0, bool modal = FALSE ,WFlags fl = 0 ); ~MediumMountGui(); protected: - QPushButton* quit; - QPushButton* quit_2; QLabel* DirSelectText_2; QLineEdit* LineEdit1; QPushButton* PushButton3; QLabel* DirSelectText; @@ -38,9 +36,8 @@ protected: QCheckBox* CheckBoxAll; QCheckBox* CheckBoxLink; QCheckBox* AskBox; - public: bool check(); QStringList mimeTypes(); QStringList dirs(); @@ -49,14 +46,13 @@ private: void readConfig(); void writeConfig( bool checkagain ); private slots: - void yesPressed(); - void noPressed(); + void accept(); + void reject(); void deactivateOthers(); private: QString mediumPath; - bool checkagain:1; bool checkmimeaudio:1; bool checkmimeimage:1; bool checkmimetext:1; |