summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/kpppwidget.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/kpppwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp89
1 files changed, 39 insertions, 50 deletions
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp
index 7b5c74d..e466358 100644
--- a/noncore/settings/networksettings/ppp/kpppwidget.cpp
+++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp
@@ -43,17 +43,6 @@
43// #include <kapplication.h> 43// #include <kapplication.h>
44#include <qbuttongroup.h> 44#include <qbuttongroup.h>
45//#include <kcmdlineargs.h>
46//#include <kconfig.h>
47//#include <kdebug.h>
48#define i18n QObject::tr
49//#include <kiconloader.h> // For BarIcon
50//#include <klocale.h>
51#include <qmessagebox.h> 45#include <qmessagebox.h>
52// #include <kseparator.h>
53// #include <kstandarddirs.h>
54// #include <kwin.h>
55// #include <khelpmenu.h>
56#include <qpushbutton.h> 46#include <qpushbutton.h>
57//#include <kguiitem.h>
58 47
59#include <stdlib.h> 48#include <stdlib.h>
@@ -79,5 +68,5 @@ KPPPWidget *p_kppp = 0;
79 68
80KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl ) 69KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl )
81 : QDialog(parent, name, modal, fl), _pppdata(pd) 70 : QDialog(parent, name, modal, Qt::WStyle_ContextHelp ), _pppdata(pd)
82{ 71{
83// tabWindow = 0; 72// tabWindow = 0;
@@ -109,5 +98,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
109 l1->setColStretch(2, 4); 98 l1->setColStretch(2, 4);
110 99
111 label1 = new QLabel(i18n("C&onnect to: "), this); 100 label1 = new QLabel(QObject::tr("C&onnect to: "), this);
112 l1->addWidget(label1, 0, 1); 101 l1->addWidget(label1, 0, 1);
113 102
@@ -119,5 +108,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
119 l1->addWidget(connectto_c, 0, 2); 108 l1->addWidget(connectto_c, 0, 2);
120 109
121 ID_Label = new QLabel(i18n("&Login ID:"), this); 110 ID_Label = new QLabel(QObject::tr("&Login ID:"), this);
122 l1->addWidget(ID_Label, 1, 1); 111 l1->addWidget(ID_Label, 1, 1);
123 112
@@ -128,5 +117,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
128 connect(ID_Edit, SIGNAL(returnPressed()), 117 connect(ID_Edit, SIGNAL(returnPressed()),
129 this, SLOT(enterPressedInID())); 118 this, SLOT(enterPressedInID()));
130 QString tmp = i18n("<p>Type in the username that you got from your\n" 119 QString tmp = QObject::tr("<p>Type in the username that you got from your\n"
131 "ISP. This is especially important for PAP\n" 120 "ISP. This is especially important for PAP\n"
132 "and CHAP. You may omit this when you use\n" 121 "and CHAP. You may omit this when you use\n"
@@ -139,5 +128,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
139 QWhatsThis::add(ID_Edit,tmp); 128 QWhatsThis::add(ID_Edit,tmp);
140 129
141 PW_Label = new QLabel(i18n("&Password:"), this); 130 PW_Label = new QLabel(QObject::tr("&Password:"), this);
142 l1->addWidget(PW_Label, 2, 1); 131 l1->addWidget(PW_Label, 2, 1);
143 132
@@ -149,5 +138,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
149 this, SLOT(enterPressedInPW())); 138 this, SLOT(enterPressedInPW()));
150 139
151 tmp = i18n("<p>Type in the password that you got from your\n" 140 tmp = QObject::tr("<p>Type in the password that you got from your\n"
152 "ISP. This is especially important for PAP\n" 141 "ISP. This is especially important for PAP\n"
153 "and CHAP. You may omit this when you use\n" 142 "and CHAP. You may omit this when you use\n"
@@ -165,5 +154,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
165 tl->addSpacing(5); 154 tl->addSpacing(5);
166 l3->addSpacing(10); 155 l3->addSpacing(10);
167 log = new QCheckBox(i18n("Show lo&g window"), this); 156 log = new QCheckBox(QObject::tr("Show lo&g window"), this);
168 connect(log, SIGNAL(toggled(bool)), 157 connect(log, SIGNAL(toggled(bool)),
169 this, SLOT(log_window_toggled(bool))); 158 this, SLOT(log_window_toggled(bool)));
@@ -172,5 +161,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
172 161
173 QWhatsThis::add(log, 162 QWhatsThis::add(log,
174 i18n("<p>This controls whether a log window is shown.\n" 163 QObject::tr("<p>This controls whether a log window is shown.\n"
175 "A log window shows the communication between\n" 164 "A log window shows the communication between\n"
176 "<i>kppp</i> and your modem. This will help you\n" 165 "<i>kppp</i> and your modem. This will help you\n"
@@ -187,12 +176,12 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
187 176
188 int minw = 0; 177 int minw = 0;
189 quit_b = new QPushButton(i18n("&Quit"), this); 178 quit_b = new QPushButton(QObject::tr("&Quit"), this);
190 // quit_b-> setGuiItem (KGuiItem(i18n("&Quit"), "exit" ) ); 179 // quit_b-> setGuiItem (KGuiItem(QObject::tr("&Quit"), "exit" ) );
191 connect( quit_b, SIGNAL(clicked()), SLOT(quitbutton())); 180 connect( quit_b, SIGNAL(clicked()), SLOT(quitbutton()));
192 if(quit_b->sizeHint().width() > minw) 181 if(quit_b->sizeHint().width() > minw)
193 minw = quit_b->sizeHint().width(); 182 minw = quit_b->sizeHint().width();
194 183
195 setup_b = new QPushButton(i18n("&Setup..."), this); 184 setup_b = new QPushButton(QObject::tr("&Setup..."), this);
196// setup_b->setGuiItem (KGuiItem(i18n("&Setup...")) ); 185// setup_b->setGuiItem (KGuiItem(QObject::tr("&Setup...")) );
197 connect( setup_b, SIGNAL(clicked()), SLOT(expandbutton())); 186 connect( setup_b, SIGNAL(clicked()), SLOT(expandbutton()));
198 if(setup_b->sizeHint().width() > minw) 187 if(setup_b->sizeHint().width() > minw)
@@ -204,15 +193,15 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
204 // setup_b->setEnabled(false); 193 // setup_b->setEnabled(false);
205 194
206// help_b = new QPushButton(i18n("&Help"), this); 195// help_b = new QPushButton(QObject::tr("&Help"), this);
207// connect( help_b, SIGNAL(clicked()), SLOT(helpbutton())); 196// connect( help_b, SIGNAL(clicked()), SLOT(helpbutton()));
208 197
209// KHelpMenu *helpMenu = new KHelpMenu(this, KGlobal::instance()->aboutData(), true); 198// KHelpMenu *helpMenu = new KHelpMenu(this, KGlobal::instance()->aboutData(), true);
210// help_b->setPopup((QPopupMenu*)helpMenu->menu()); 199// help_b->setPopup((QPopupMenu*)helpMenu->menu());
211// help_b->setGuiItem (KGuiItem(i18n("&Help"), "help" ) ); 200// help_b->setGuiItem (KGuiItem(QObject::tr("&Help"), "help" ) );
212 201
213// if(help_b->sizeHint().width() > minw) 202// if(help_b->sizeHint().width() > minw)
214// minw = help_b->sizeHint().width(); 203// minw = help_b->sizeHint().width();
215 204
216 connect_b = new QPushButton(i18n("&Connect"), this); 205 connect_b = new QPushButton(QObject::tr("&Connect"), this);
217 connect_b->setDefault(true); 206 connect_b->setDefault(true);
218 connect_b->setFocus(); 207 connect_b->setFocus();
@@ -287,5 +276,5 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
287// if (!result){ 276// if (!result){
288// QString string; 277// QString string;
289// string = i18n("No such Account:\n%1").arg(m_strCmdlAccount); 278// string = QObject::tr("No such Account:\n%1").arg(m_strCmdlAccount);
290// KMessageBox::error(this, string); 279// KMessageBox::error(this, string);
291// m_bCmdlAccount = false; 280// m_bCmdlAccount = false;
@@ -483,12 +472,12 @@ void KPPPWidget::sigPPPDDied() {
483 QString msg; 472 QString msg;
484 if (_pppdata->pppdError() == E_IF_TIMEOUT) 473 if (_pppdata->pppdError() == E_IF_TIMEOUT)
485 msg = i18n("Timeout expired while waiting for the PPP interface " 474 msg = QObject::tr("Timeout expired while waiting for the PPP interface "
486 "to come up!"); 475 "to come up!");
487 else { 476 else {
488 msg = i18n("<p>The pppd daemon died unexpectedly!</p>"); 477 msg = QObject::tr("<p>The pppd daemon died unexpectedly!</p>");
489 Modem::modem->pppdExitStatus(); 478 Modem::modem->pppdExitStatus();
490 if (Modem::modem->lastStatus != 99) {// more recent pppds only 479 if (Modem::modem->lastStatus != 99) {// more recent pppds only
491 msg += i18n("<p>Exit status: %1").arg(Modem::modem->lastStatus); 480 msg += QObject::tr("<p>Exit status: %1").arg(Modem::modem->lastStatus);
492 msg += i18n("</p><p>See 'man pppd' for an explanation of the error " 481 msg += QObject::tr("</p><p>See 'man pppd' for an explanation of the error "
493 "codes or take a look at the kppp FAQ on " 482 "codes or take a look at the kppp FAQ on "
494 " <a href=http://devel-home.kde.org/~kppp/index.html>" 483 " <a href=http://devel-home.kde.org/~kppp/index.html>"
@@ -497,5 +486,5 @@ void KPPPWidget::sigPPPDDied() {
497 } 486 }
498 487
499 // if(QMessageBox::warning(0, msg, i18n("Error"), i18n("&OK"), i18n("&Details...")) == QMessageBox::No) 488 // if(QMessageBox::warning(0, msg, QObject::tr("Error"), QObject::tr("&OK"), QObject::tr("&Details...")) == QMessageBox::No)
500 // // PPPL_ShowLog(); 489 // // PPPL_ShowLog();
501// } else { /* reconnect on disconnect */ 490// } else { /* reconnect on disconnect */
@@ -528,5 +517,5 @@ void KPPPWidget::sigPPPDDied() {
528// // kdDebug(5002) << "It was the setuid child that died" << endl; 517// // kdDebug(5002) << "It was the setuid child that died" << endl;
529// // helperPid = -1; 518// // helperPid = -1;
530// QString msg = i18n("kppp's helper process just died.\n" 519// QString msg = QObject::tr("kppp's helper process just died.\n"
531// "Since a further execution would be pointless, " 520// "Since a further execution would be pointless, "
532// "kppp will shut down now."); 521// "kppp will shut down now.");
@@ -561,5 +550,5 @@ void KPPPWidget::beginConnect() {
561 550
562 if(!info.exists()){ 551 if(!info.exists()){
563 QMessageBox::warning(this, "error", i18n("Cannot find the PPP daemon!\n" 552 QMessageBox::warning(this, "error", QObject::tr("Cannot find the PPP daemon!\n"
564 "Make sure that pppd is installed and " 553 "Make sure that pppd is installed and "
565 "that you have entered the correct path.")); 554 "that you have entered the correct path."));
@@ -570,5 +559,5 @@ void KPPPWidget::beginConnect() {
570 559
571 QString string; 560 QString string;
572 string = i18n("kppp cannot execute:\n %1\n" 561 string = QObject::tr("kppp cannot execute:\n %1\n"
573 "Please make sure that you have given kppp " 562 "Please make sure that you have given kppp "
574 "setuid permission and that " 563 "setuid permission and that "
@@ -584,5 +573,5 @@ void KPPPWidget::beginConnect() {
584 if(!info2.exists()){ 573 if(!info2.exists()){
585 QString string; 574 QString string;
586 string = i18n("kppp can not find:\n %1\nPlease make sure you have setup " 575 string = QObject::tr("kppp can not find:\n %1\nPlease make sure you have setup "
587 "your modem device properly " 576 "your modem device properly "
588 "and/or adjust the location of the modem device on " 577 "and/or adjust the location of the modem device on "
@@ -600,5 +589,5 @@ void KPPPWidget::beginConnect() {
600 if(ID_Edit->text().isEmpty()) { 589 if(ID_Edit->text().isEmpty()) {
601 QMessageBox::warning(this,"error", 590 QMessageBox::warning(this,"error",
602 i18n("You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!")); 591 QObject::tr("You have selected the authentication method PAP or CHAP. This requires that you supply a username and a password!"));
603 return; 592 return;
604 } else { 593 } else {
@@ -607,5 +596,5 @@ void KPPPWidget::beginConnect() {
607 encodeWord(_pppdata->password()))) { 596 encodeWord(_pppdata->password()))) {
608 QString s; 597 QString s;
609 s = i18n("Cannot create PAP/CHAP authentication\n" 598 s = QObject::tr("Cannot create PAP/CHAP authentication\n"
610 "file \"%1\"").arg(PAP_AUTH_FILE); 599 "file \"%1\"").arg(PAP_AUTH_FILE);
611 QMessageBox::warning(this, "error", s); 600 QMessageBox::warning(this, "error", s);
@@ -616,5 +605,5 @@ void KPPPWidget::beginConnect() {
616 605
617 if (_pppdata->phonenumber().isEmpty()) { 606 if (_pppdata->phonenumber().isEmpty()) {
618 QString s = i18n("You must specify a telephone number!"); 607 QString s = QObject::tr("You must specify a telephone number!");
619 QMessageBox::warning(this, "error", s); 608 QMessageBox::warning(this, "error", s);
620 return; 609 return;
@@ -623,5 +612,5 @@ void KPPPWidget::beginConnect() {
623 this->hide(); 612 this->hide();
624 613
625 QString tit = i18n("Connecting to: %1").arg(_pppdata->accname()); 614 QString tit = QObject::tr("Connecting to: %1").arg(_pppdata->accname());
626// con->setCaption(tit); 615// con->setCaption(tit);
627 616
@@ -637,6 +626,6 @@ void KPPPWidget::disconnect() {
637 con_win->hide(); 626 con_win->hide();
638 con->show(); 627 con->show();
639 con->setCaption(i18n("Disconnecting...")); 628 con->setCaption(QObject::tr("Disconnecting..."));
640 con->setMsg(i18n("Executing command before disconnection.")); 629 con->setMsg(QObject::tr("Executing command before disconnection."));
641 630
642 qApp->processEvents(); 631 qApp->processEvents();
@@ -693,6 +682,6 @@ void KPPPWidget::quitbutton() {
693 if(_pppdata->pppdRunning()) { 682 if(_pppdata->pppdRunning()) {
694 int ok = QMessageBox::warning(this, 683 int ok = QMessageBox::warning(this,
695 i18n("Exiting kPPP will close your PPP Session."), 684 QObject::tr("Exiting kPPP will close your PPP Session."),
696 i18n("Quit kPPP?")); 685 QObject::tr("Quit kPPP?"));
697 if(ok == QMessageBox::Yes) { 686 if(ok == QMessageBox::Yes) {
698 Modem::modem->killPPPDaemon(); 687 Modem::modem->killPPPDaemon();
@@ -737,5 +726,5 @@ void KPPPWidget::quitbutton() {
737 726
738// // if(!acct->loadRuleSet(_pppdata->accountingFile())) { 727// // if(!acct->loadRuleSet(_pppdata->accountingFile())) {
739// // QString s= i18n("Can not load the accounting " 728// // QString s= QObject::tr("Can not load the accounting "
740 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile()); 729 // // "ruleset \"%1\"!").arg(_pppdata->accountingFile());
741 730
@@ -827,5 +816,5 @@ void KPPPWidget::showNews() {
827 if(_pppdata->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) { 816 if(_pppdata->readNumConfig(GENERAL_GRP, QUICKHELP_HINT, 0) == 0) {
828 QDialog dlg(0, 0, true); 817 QDialog dlg(0, 0, true);
829 dlg.setCaption(i18n("Recent Changes in KPPP")); 818 dlg.setCaption(QObject::tr("Recent Changes in KPPP"));
830 819
831 QVBoxLayout *tl = new QVBoxLayout(&dlg, 10, 10); 820 QVBoxLayout *tl = new QVBoxLayout(&dlg, 10, 10);
@@ -840,5 +829,5 @@ void KPPPWidget::showNews() {
840 l1->addLayout(l2); 829 l1->addLayout(l2);
841 830
842 QLabel *l = new QLabel(i18n("From version 1.4.8 on, kppp has a new feature\n" 831 QLabel *l = new QLabel(QObject::tr("From version 1.4.8 on, kppp has a new feature\n"
843 "called \"Quickhelp\". It's similar to a tooltip,\n" 832 "called \"Quickhelp\". It's similar to a tooltip,\n"
844 "but you can activate it whenever you want.\n" 833 "but you can activate it whenever you want.\n"
@@ -852,10 +841,10 @@ void KPPPWidget::showNews() {
852 &dlg); 841 &dlg);
853 842
854 QCheckBox *cb = new QCheckBox(i18n("Don't show this hint again"), &dlg); 843 QCheckBox *cb = new QCheckBox(QObject::tr("Don't show this hint again"), &dlg);
855 cb->setFixedSize(cb->sizeHint()); 844 cb->setFixedSize(cb->sizeHint());
856 845
857 KButtonBox *bbox = new KButtonBox(&dlg); 846 KButtonBox *bbox = new KButtonBox(&dlg);
858 bbox->addStretch(1); 847 bbox->addStretch(1);
859 QPushButton *ok = bbox->addButton(i18n("OK")); 848 QPushButton *ok = bbox->addButton(QObject::tr("OK"));
860 ok->setDefault(true); 849 ok->setDefault(true);
861 dlg.connect(ok, SIGNAL(clicked()), 850 dlg.connect(ok, SIGNAL(clicked()),
@@ -868,5 +857,5 @@ void KPPPWidget::showNews() {
868 tl->addWidget(bbox); 857 tl->addWidget(bbox);
869 858
870 QString tmp = i18n("This is an example of <b>QuickHelp</b>.\n" 859 QString tmp = QObject::tr("This is an example of <b>QuickHelp</b>.\n"
871 "This window will stay open until you\n" 860 "This window will stay open until you\n"
872 "click a mouse button or a press a key.\n"); 861 "click a mouse button or a press a key.\n");