Diffstat (limited to 'noncore/settings/networksettings/ppp/modemcmds.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/modemcmds.cpp | 129 |
1 files changed, 72 insertions, 57 deletions
diff --git a/noncore/settings/networksettings/ppp/modemcmds.cpp b/noncore/settings/networksettings/ppp/modemcmds.cpp index 1d9db6e..e797795 100644 --- a/noncore/settings/networksettings/ppp/modemcmds.cpp +++ b/noncore/settings/networksettings/ppp/modemcmds.cpp @@ -29,9 +29,7 @@ #include <qbuttongroup.h> +#include <qscrollview.h> +#include <qapplication.h> #include <stdlib.h> -//#include <kapplication.h> // for getMiniIcon() -//#include <klocale.h> -#define i18n QObject::tr #include "modemcmds.h" #include "pppdata.h" -//#include <kwin.h> @@ -42,6 +40,6 @@ -ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - : QDialog(parent, name, true ), _pppdata(pd) +ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name , bool modal, WFlags f) + : QDialog( parent, name, modal, f ), _pppdata(pd) { - setCaption(i18n("Edit Modem Commands")); + setCaption(QObject::tr("Edit Modem Commands")); @@ -50,4 +48,15 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) + QVBoxLayout *main = new QVBoxLayout( this ); + QScrollView *sv = new QScrollView( this ); + QWidget *mainW = new QWidget( sv->viewport() ); + sv->setResizePolicy( QScrollView::AutoOneFit ); + sv->setHScrollBarMode( QScrollView::AlwaysOff ); + sv->setFrameShape( QFrame::NoFrame ); + sv->addChild( mainW ); + main->addWidget( sv ); + // evil hack + mainW->setMaximumWidth( QApplication::desktop()->width() - 10 ); + // toplevel layout - QVBoxLayout *tl = new QVBoxLayout(this, 10, 4); + QVBoxLayout *tl = new QVBoxLayout( mainW, 10, 4); @@ -56,3 +65,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) tl->addLayout(l1); - box = new QGroupBox(this, "box"); + box = new QGroupBox(mainW, "box"); + box->setMargin( 0 ); l1->addMultiCellWidget(box, row++, GRIDROWS, 0, 3); @@ -62,3 +72,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) l1->addLayout(l2, row, 2); - lpreinitslider = new QLabel("MMMM", this); + lpreinitslider = new QLabel("MMMM", mainW); FORMATSLIDERLABEL(lpreinitslider); @@ -66,3 +76,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) QSlider *preinitslider = new QSlider(0, 300, 1, 0, - QSlider::Horizontal, this); + QSlider::Horizontal, mainW); // preinitslider->setFixedHeight(preinitslider->sizeHint().height()); @@ -73,3 +83,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - lpreinit = new QLabel(i18n("Pre-init delay (sec/100):"), this); + lpreinit = new QLabel(QObject::tr("Pre-init delay (sec/100):"), mainW); l1->addWidget(lpreinit, row++, 1); @@ -77,5 +87,5 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) for(int i = 0; i < PPPData::NumInitStrings; i++) { - initstr[i] = new QLineEdit(this); - QLabel *initLabel = new QLabel(i18n("Initialization string %1:").arg(i + 1), - this); + initstr[i] = new QLineEdit(mainW); + QLabel *initLabel = new QLabel(QObject::tr("Initialization string %1:").arg(i + 1), + mainW); ADJUSTEDIT(initstr[i]); @@ -87,6 +97,6 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) l1->addLayout(l3, row, 2); - linitslider = new QLabel("MMMM", this); + linitslider = new QLabel("MMMM", mainW); FORMATSLIDERLABEL(linitslider); QSlider *initslider = new QSlider(1, 300, 1, 0, - QSlider::Horizontal, this); + QSlider::Horizontal, mainW); // initslider->setFixedHeight(initslider->sizeHint().height()); @@ -97,3 +107,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - label3 = new QLabel(i18n("Post-init delay (sec/100):"), this); + label3 = new QLabel(QObject::tr("Post-init delay (sec/100):"), mainW); l1->addWidget(label3, row++, 1); @@ -103,6 +113,6 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) l1->addLayout(l4, row, 2); - ldurationslider = new QLabel("MMMM", this); + ldurationslider = new QLabel("MMMM", mainW); FORMATSLIDERLABEL(ldurationslider); QSlider *durationslider = new QSlider(1, 255, 1, 0, - QSlider::Horizontal, this); + QSlider::Horizontal, mainW); // durationslider->setFixedHeight(durationslider->sizeHint().height()); @@ -113,3 +123,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - lduration = new QLabel(i18n("Dialing speed (sec/100):"), this); + lduration = new QLabel(QObject::tr("Dialing speed (sec/100):"), mainW); l1->addWidget(lduration, row++, 1); @@ -117,4 +127,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - initresp = new QLineEdit(this); - label2 = new QLabel(i18n("Init response:"), this); + initresp = new QLineEdit(mainW); + label2 = new QLabel(QObject::tr("Init response:"), mainW); ADJUSTEDIT(initresp); @@ -123,4 +133,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - nodetectdialtone = new QLineEdit(this); - lnodetectdialtone = new QLabel(i18n("No dial tone detection:"), this); + nodetectdialtone = new QLineEdit(mainW); + lnodetectdialtone = new QLabel(QObject::tr("No dial tone detection:"), mainW); ADJUSTEDIT(nodetectdialtone); @@ -129,4 +139,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - dialstr = new QLineEdit(this); - label4 = new QLabel(i18n("Dial string:"),this); + dialstr = new QLineEdit(mainW); + label4 = new QLabel(QObject::tr("Dial string:"),mainW); ADJUSTEDIT(dialstr); @@ -135,4 +145,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - connectresp = new QLineEdit(this); - label5 = new QLabel(i18n("Connect response:"), this); + connectresp = new QLineEdit(mainW); + label5 = new QLabel(QObject::tr("Connect response:"), mainW); ADJUSTEDIT(connectresp); @@ -141,4 +151,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - busyresp = new QLineEdit(this); - label6 = new QLabel(i18n("Busy response:"), this); + busyresp = new QLineEdit(mainW); + label6 = new QLabel(QObject::tr("Busy response:"), mainW); ADJUSTEDIT(busyresp); @@ -147,4 +157,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - nocarrierresp = new QLineEdit(this); - label7 = new QLabel(i18n("No carrier response:"), this); + nocarrierresp = new QLineEdit(mainW); + label7 = new QLabel(QObject::tr("No carrier response:"), mainW); ADJUSTEDIT(nocarrierresp); @@ -153,4 +163,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - nodialtoneresp = new QLineEdit(this); - label8 = new QLabel(i18n("No dial tone response:"), this); + nodialtoneresp = new QLineEdit(mainW); + label8 = new QLabel(QObject::tr("No dial tone response:"), mainW); ADJUSTEDIT(nodialtoneresp); @@ -159,4 +169,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - hangupstr = new QLineEdit(this); - label9 = new QLabel(i18n("Hangup string:"), this); + hangupstr = new QLineEdit(mainW); + label9 = new QLabel(QObject::tr("Hangup string:"), mainW); ADJUSTEDIT(hangupstr); @@ -165,4 +175,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - hangupresp = new QLineEdit(this); - label10 = new QLabel(i18n("Hangup response:"), this); + hangupresp = new QLineEdit(mainW); + label10 = new QLabel(QObject::tr("Hangup response:"), mainW); ADJUSTEDIT(hangupresp); @@ -171,4 +181,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - answerstr = new QLineEdit(this); - label11 = new QLabel(i18n("Answer string:"), this); + answerstr = new QLineEdit(mainW); + label11 = new QLabel(QObject::tr("Answer string:"), mainW); ADJUSTEDIT(answerstr); @@ -177,4 +187,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - ringresp = new QLineEdit(this); - label12 = new QLabel(i18n("Ring response:"), this); + ringresp = new QLineEdit(mainW); + label12 = new QLabel(QObject::tr("Ring response:"), mainW); ADJUSTEDIT(ringresp); @@ -183,4 +193,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - answerresp = new QLineEdit(this); - label13 = new QLabel(i18n("Answer response:"), this); + answerresp = new QLineEdit(mainW); + label13 = new QLabel(QObject::tr("Answer response:"), mainW); ADJUSTEDIT(answerresp); @@ -189,4 +199,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - escapestr = new QLineEdit(this); - label14 = new QLabel(i18n("Escape string:"), this); + escapestr = new QLineEdit(mainW); + label14 = new QLabel(QObject::tr("Escape string:"), mainW); ADJUSTEDIT(escapestr); @@ -195,4 +205,4 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - escaperesp = new QLineEdit(this); - label15 = new QLabel(i18n("Escape response:"), this); + escaperesp = new QLineEdit(mainW); + label15 = new QLabel(QObject::tr("Escape response:"), mainW); ADJUSTEDIT(escaperesp); @@ -203,3 +213,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) l1->addLayout(l5, row, 2); - lslider = new QLabel("MMMM", this); + lslider = new QLabel("MMMM", mainW); FORMATSLIDERLABEL(lslider); @@ -207,3 +217,3 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) QSlider *slider = new QSlider(0, 255, 1, 0, - QSlider::Horizontal, this); + QSlider::Horizontal, mainW); // slider->setFixedHeight(slider->sizeHint().height()); @@ -214,6 +224,6 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) - label16 = new QLabel(i18n("Guard time (sec/50):"), this); + label16 = new QLabel(QObject::tr("Guard time (sec/50):"), mainW); l1->addWidget(label16, row++, 1); - QLabel *l = new QLabel(i18n("Volume off/low/high:"), this); + QLabel *l = new QLabel(QObject::tr("Volume off/low/high:"), mainW); l1->addWidget(l, row, 1); @@ -221,9 +231,9 @@ ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name) l1->addLayout(l6, row++, 2); - volume_off = new QLineEdit(this); + volume_off = new QLineEdit(mainW); // volume_off->setFixedHeight(volume_off->sizeHint().height()); // volume_off->setMinimumWidth((int)(volume_off->sizeHint().width() / 2)); - volume_medium = new QLineEdit(this); + volume_medium = new QLineEdit(mainW); // volume_medium->setFixedHeight(volume_medium->sizeHint().height()); // volume_medium->setMinimumWidth((int)(volume_medium->sizeHint().width() / 2)); - volume_high = new QLineEdit(this); + volume_high = new QLineEdit(mainW); // volume_high->setFixedHeight(volume_high->sizeHint().height()); @@ -309,3 +319,8 @@ void ModemCommands::slotOk() { _pppdata->save(); - accept(); + QDialog::accept(); +} + +void ModemCommands::accept() +{ + slotOk(); } |