Diffstat (limited to 'noncore/settings/networksettings/ppp/kpppwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/kpppwidget.cpp | 89 |
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 | |||
@@ -39,25 +39,14 @@ | |||
39 | #include <qwhatsthis.h> | 39 | #include <qwhatsthis.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | 41 | ||
42 | // #include <kaboutdata.h> | 42 | // #include <kaboutdata.h> |
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> |
60 | #include <errno.h> | 49 | #include <errno.h> |
61 | #include <signal.h> | 50 | #include <signal.h> |
62 | 51 | ||
63 | #include "runtests.h" | 52 | #include "runtests.h" |
@@ -75,13 +64,13 @@ | |||
75 | 64 | ||
76 | #define execute_command system | 65 | #define execute_command system |
77 | 66 | ||
78 | KPPPWidget *p_kppp = 0; | 67 | KPPPWidget *p_kppp = 0; |
79 | 68 | ||
80 | KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *name, bool modal, WFlags fl ) | 69 | KPPPWidget::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; |
84 | p_kppp = this; | 73 | p_kppp = this; |
85 | // before doing anything else, run a few tests | 74 | // before doing anything else, run a few tests |
86 | if (!_pppdata->setModemDevice( i->getInterfaceName() )) | 75 | if (!_pppdata->setModemDevice( i->getInterfaceName() )) |
87 | _pppdata->setModemDevice("/dev/modem"); | 76 | _pppdata->setModemDevice("/dev/modem"); |
@@ -105,53 +94,53 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na | |||
105 | tl->addLayout(l1); | 94 | tl->addLayout(l1); |
106 | l1->addColSpacing(0, 10); | 95 | l1->addColSpacing(0, 10); |
107 | l1->addColSpacing(3, 10); | 96 | l1->addColSpacing(3, 10); |
108 | l1->setColStretch(1, 3); | 97 | l1->setColStretch(1, 3); |
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 | ||
114 | connectto_c = new QComboBox(false, this); | 103 | connectto_c = new QComboBox(false, this); |
115 | label1->setBuddy(connectto_c); | 104 | label1->setBuddy(connectto_c); |
116 | 105 | ||
117 | connect(connectto_c, SIGNAL(activated(int)), | 106 | connect(connectto_c, SIGNAL(activated(int)), |
118 | SLOT(newdefaultaccount(int))); | 107 | SLOT(newdefaultaccount(int))); |
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 | ||
124 | // the entry line for usernames | 113 | // the entry line for usernames |
125 | ID_Edit = new QLineEdit(this); | 114 | ID_Edit = new QLineEdit(this); |
126 | ID_Label->setBuddy(ID_Edit); | 115 | ID_Label->setBuddy(ID_Edit); |
127 | l1->addWidget(ID_Edit, 1, 2); | 116 | l1->addWidget(ID_Edit, 1, 2); |
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" |
133 | "terminal-based or script-based authentication.\n" | 122 | "terminal-based or script-based authentication.\n" |
134 | "\n" | 123 | "\n" |
135 | "<b>Important</b>: case is important here:\n" | 124 | "<b>Important</b>: case is important here:\n" |
136 | "<i>myusername</i> is not the same as <i>MyUserName</i>!"); | 125 | "<i>myusername</i> is not the same as <i>MyUserName</i>!"); |
137 | 126 | ||
138 | QWhatsThis::add(ID_Label,tmp); | 127 | QWhatsThis::add(ID_Label,tmp); |
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 | ||
144 | PW_Edit= new QLineEdit(this); | 133 | PW_Edit= new QLineEdit(this); |
145 | PW_Label->setBuddy(PW_Edit); | 134 | PW_Label->setBuddy(PW_Edit); |
146 | PW_Edit->setEchoMode(QLineEdit::Password); | 135 | PW_Edit->setEchoMode(QLineEdit::Password); |
147 | l1->addWidget(PW_Edit, 2, 2); | 136 | l1->addWidget(PW_Edit, 2, 2); |
148 | connect(PW_Edit, SIGNAL(returnPressed()), | 137 | connect(PW_Edit, SIGNAL(returnPressed()), |
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" |
154 | "terminal-based or script-based authentication.\n" | 143 | "terminal-based or script-based authentication.\n" |
155 | "\n" | 144 | "\n" |
156 | "<b>Important</b>: case is important here:\n" | 145 | "<b>Important</b>: case is important here:\n" |
157 | "<i>mypassword</i> is not the same as <i>MyPassword</i>!"); | 146 | "<i>mypassword</i> is not the same as <i>MyPassword</i>!"); |
@@ -161,20 +150,20 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na | |||
161 | 150 | ||
162 | QHBoxLayout *l3 = new QHBoxLayout; | 151 | QHBoxLayout *l3 = new QHBoxLayout; |
163 | tl->addSpacing(5); | 152 | tl->addSpacing(5); |
164 | tl->addLayout(l3); | 153 | tl->addLayout(l3); |
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))); |
170 | log->setChecked(_pppdata->get_show_log_window()); | 159 | log->setChecked(_pppdata->get_show_log_window()); |
171 | l3->addWidget(log); | 160 | l3->addWidget(log); |
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" |
177 | "in tracking down problems.\n" | 166 | "in tracking down problems.\n" |
178 | "\n" | 167 | "\n" |
179 | "Turn it off if <i>kppp</i> routinely connects without\n" | 168 | "Turn it off if <i>kppp</i> routinely connects without\n" |
180 | "problems")); | 169 | "problems")); |
@@ -183,40 +172,40 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na | |||
183 | // tl->addWidget(fline); | 172 | // tl->addWidget(fline); |
184 | 173 | ||
185 | QHBoxLayout *l2 = new QHBoxLayout(this); | 174 | QHBoxLayout *l2 = new QHBoxLayout(this); |
186 | tl->addLayout(l2); | 175 | tl->addLayout(l2); |
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) |
199 | minw = setup_b->sizeHint().width(); | 188 | minw = setup_b->sizeHint().width(); |
200 | 189 | ||
201 | 190 | ||
202 | 191 | ||
203 | // if(_pppdata->access() != KConfig::ReadWrite) | 192 | // if(_pppdata->access() != KConfig::ReadWrite) |
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(); |
219 | connect(connect_b, SIGNAL(clicked()), SLOT(beginConnect())); | 208 | connect(connect_b, SIGNAL(clicked()), SLOT(beginConnect())); |
220 | if(connect_b->sizeHint().width() > minw) | 209 | if(connect_b->sizeHint().width() > minw) |
221 | minw = connect_b->sizeHint().width(); | 210 | minw = connect_b->sizeHint().width(); |
222 | 211 | ||
@@ -283,13 +272,13 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na | |||
283 | // } | 272 | // } |
284 | 273 | ||
285 | // if(m_bCmdlAccount){ | 274 | // if(m_bCmdlAccount){ |
286 | // bool result = _pppdata->setAccount(m_strCmdlAccount); | 275 | // bool result = _pppdata->setAccount(m_strCmdlAccount); |
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; |
292 | // this->show(); | 281 | // this->show(); |
293 | // } else { | 282 | // } else { |
294 | // beginConnect(); | 283 | // beginConnect(); |
295 | // } | 284 | // } |
@@ -479,27 +468,27 @@ void KPPPWidget::sigPPPDDied() { | |||
479 | con->hide(); | 468 | con->hide(); |
480 | 469 | ||
481 | _pppdata->setpppdRunning(false); | 470 | _pppdata->setpppdRunning(false); |
482 | // // not in a signal handler !!! KNotifyClient::beep(); | 471 | // // not in a signal handler !!! KNotifyClient::beep(); |
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>" |
495 | "http://devel-home.kde.org/~kppp/index.html</a></p>"); | 484 | "http://devel-home.kde.org/~kppp/index.html</a></p>"); |
496 | } | 485 | } |
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 */ |
502 | if (false){ | 491 | if (false){ |
503 | qDebug( "Trying to reconnect... " ); | 492 | qDebug( "Trying to reconnect... " ); |
504 | 493 | ||
505 | if(_pppdata->authMethod() == AUTH_PAP || | 494 | if(_pppdata->authMethod() == AUTH_PAP || |
@@ -524,13 +513,13 @@ void KPPPWidget::sigPPPDDied() { | |||
524 | // void KPPPWidget::sigChld() { | 513 | // void KPPPWidget::sigChld() { |
525 | // qDebug( "sigchld()" ); | 514 | // qDebug( "sigchld()" ); |
526 | // // pid_t id = wait(0L); | 515 | // // pid_t id = wait(0L); |
527 | // // if(id == helperPid && helperPid != -1) { | 516 | // // if(id == helperPid && helperPid != -1) { |
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."); |
533 | // QMessageBox::warning(0L,"error", msg); | 522 | // QMessageBox::warning(0L,"error", msg); |
534 | // //remove_pidfile(); | 523 | // //remove_pidfile(); |
535 | // exit(1); | 524 | // exit(1); |
536 | // // } | 525 | // // } |
@@ -557,22 +546,22 @@ void KPPPWidget::beginConnect() { | |||
557 | _pppdata->setPassword(_pppdata->storedPassword()); | 546 | _pppdata->setPassword(_pppdata->storedPassword()); |
558 | // } | 547 | // } |
559 | 548 | ||
560 | QFileInfo info(pppdPath()); | 549 | QFileInfo info(pppdPath()); |
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.")); |
566 | return; | 555 | return; |
567 | } | 556 | } |
568 | #if 0 | 557 | #if 0 |
569 | if(!info.isExecutable()){ | 558 | if(!info.isExecutable()){ |
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 " |
575 | "pppd is executable.").arg(_pppdata->pppdPath()); | 564 | "pppd is executable.").arg(_pppdata->pppdPath()); |
576 | KMessageBox::error(this, string); | 565 | KMessageBox::error(this, string); |
577 | return; | 566 | return; |
578 | 567 | ||
@@ -580,13 +569,13 @@ void KPPPWidget::beginConnect() { | |||
580 | #endif | 569 | #endif |
581 | 570 | ||
582 | QFileInfo info2(_pppdata->modemDevice()); | 571 | QFileInfo info2(_pppdata->modemDevice()); |
583 | 572 | ||
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 " |
589 | "the modem tab of " | 578 | "the modem tab of " |
590 | "the setup dialog.").arg(_pppdata->modemDevice()); | 579 | "the setup dialog.").arg(_pppdata->modemDevice()); |
591 | QMessageBox::warning(this, "error", string); | 580 | QMessageBox::warning(this, "error", string); |
592 | return; | 581 | return; |
@@ -596,36 +585,36 @@ void KPPPWidget::beginConnect() { | |||
596 | // supplied | 585 | // supplied |
597 | if(_pppdata->authMethod() == AUTH_PAP || | 586 | if(_pppdata->authMethod() == AUTH_PAP || |
598 | _pppdata->authMethod() == AUTH_CHAP || | 587 | _pppdata->authMethod() == AUTH_CHAP || |
599 | _pppdata->authMethod() == AUTH_PAPCHAP ) { | 588 | _pppdata->authMethod() == AUTH_PAPCHAP ) { |
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 { |
605 | if(!Modem::modem->setSecret(_pppdata->authMethod(), | 594 | if(!Modem::modem->setSecret(_pppdata->authMethod(), |
606 | encodeWord(_pppdata->storedUsername()), | 595 | encodeWord(_pppdata->storedUsername()), |
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); |
612 | return; | 601 | return; |
613 | } | 602 | } |
614 | } | 603 | } |
615 | } | 604 | } |
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; |
621 | } | 610 | } |
622 | 611 | ||
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 | ||
628 | // con->show(); | 617 | // con->show(); |
629 | 618 | ||
630 | 619 | ||
631 | emit begin_connect(); | 620 | emit begin_connect(); |
@@ -633,14 +622,14 @@ void KPPPWidget::beginConnect() { | |||
633 | 622 | ||
634 | 623 | ||
635 | void KPPPWidget::disconnect() { | 624 | void KPPPWidget::disconnect() { |
636 | if (!_pppdata->command_before_disconnect().isEmpty()) { | 625 | if (!_pppdata->command_before_disconnect().isEmpty()) { |
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(); |
643 | QApplication::flushX(); | 632 | QApplication::flushX(); |
644 | // pid_t id = | 633 | // pid_t id = |
645 | execute_command(_pppdata->command_before_disconnect()); | 634 | execute_command(_pppdata->command_before_disconnect()); |
646 | // int i, status; | 635 | // int i, status; |
@@ -689,14 +678,14 @@ void KPPPWidget::disconnect() { | |||
689 | // } | 678 | // } |
690 | 679 | ||
691 | 680 | ||
692 | void KPPPWidget::quitbutton() { | 681 | 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(); |
699 | QApplication::flushX(); | 688 | QApplication::flushX(); |
700 | execute_command(_pppdata->command_on_disconnect()); | 689 | execute_command(_pppdata->command_on_disconnect()); |
701 | removedns(); | 690 | removedns(); |
702 | Modem::modem->unlockdevice(); | 691 | Modem::modem->unlockdevice(); |
@@ -733,13 +722,13 @@ void KPPPWidget::quitbutton() { | |||
733 | 722 | ||
734 | // // connect to the accounting object | 723 | // // connect to the accounting object |
735 | // connect(acct, SIGNAL(changed(QString, QString)), | 724 | // connect(acct, SIGNAL(changed(QString, QString)), |
736 | // con_win, SLOT(slotAccounting(QString, QString))); | 725 | // con_win, SLOT(slotAccounting(QString, QString))); |
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 | ||
742 | // // starting the messagebox with a timer will prevent us | 731 | // // starting the messagebox with a timer will prevent us |
743 | // // from blocking the calling function ConnectWidget::timerEvent | 732 | // // from blocking the calling function ConnectWidget::timerEvent |
744 | // ruleset_load_errmsg = s; | 733 | // ruleset_load_errmsg = s; |
745 | // QTimer::singleShot(0, this, SLOT(rulesetLoadError())); | 734 | // QTimer::singleShot(0, this, SLOT(rulesetLoadError())); |
@@ -823,54 +812,54 @@ void KPPPWidget::showNews() { | |||
823 | /* | 812 | /* |
824 | * Introduce the QuickHelp feature to new users of this version | 813 | * Introduce the QuickHelp feature to new users of this version |
825 | */ | 814 | */ |
826 | #define QUICKHELP_HINT "Hint_QuickHelp" | 815 | #define QUICKHELP_HINT "Hint_QuickHelp" |
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); |
832 | QHBoxLayout *l1 = new QHBoxLayout(10); | 821 | QHBoxLayout *l1 = new QHBoxLayout(10); |
833 | QVBoxLayout *l2 = new QVBoxLayout(10); | 822 | QVBoxLayout *l2 = new QVBoxLayout(10); |
834 | tl->addLayout(l1); | 823 | tl->addLayout(l1); |
835 | 824 | ||
836 | QLabel *icon = new QLabel(&dlg); | 825 | QLabel *icon = new QLabel(&dlg); |
837 | icon->setPixmap(BarIcon("exclamation")); | 826 | icon->setPixmap(BarIcon("exclamation")); |
838 | icon->setFixedSize(icon->sizeHint()); | 827 | icon->setFixedSize(icon->sizeHint()); |
839 | l1->addWidget(icon); | 828 | l1->addWidget(icon); |
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" |
845 | "\n" | 834 | "\n" |
846 | "To activate it, simply click on a control like\n" | 835 | "To activate it, simply click on a control like\n" |
847 | "a button or a label with the right mouse button.\n" | 836 | "a button or a label with the right mouse button.\n" |
848 | "If the item supports Quickhelp, a popup menu\n" | 837 | "If the item supports Quickhelp, a popup menu\n" |
849 | "will appear leading to Quickhelp.\n" | 838 | "will appear leading to Quickhelp.\n" |
850 | "\n" | 839 | "\n" |
851 | "To test it, right-click somewhere in this text."), | 840 | "To test it, right-click somewhere in this text."), |
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()), |
862 | &dlg, SLOT(accept())); | 851 | &dlg, SLOT(accept())); |
863 | bbox->addStretch(1); | 852 | bbox->addStretch(1); |
864 | bbox->layout(); | 853 | bbox->layout(); |
865 | 854 | ||
866 | l2->addWidget(l); | 855 | l2->addWidget(l); |
867 | l2->addWidget(cb); | 856 | l2->addWidget(cb); |
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"); |
873 | 862 | ||
874 | QWhatsThis::add(cb,tmp); | 863 | QWhatsThis::add(cb,tmp); |
875 | QWhatsThis::add(l, tmp); | 864 | QWhatsThis::add(l, tmp); |
876 | 865 | ||