⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 settingssub.cxx

📁 使用VOIP技术.能够无连接接通远程用户
💻 CXX
📖 第 1 页 / 共 2 页
字号:
    }    thisCodec = thisCodec->nextSibling();  }  return NULL;}  void Settings::SearchForAGatekeeper_slot(){  if (!controlsSet)    return;  connectOpts.searchForGatekeeper = CheckBoxSearchForAGatekeeper->isChecked();  LineEditGatekeeper->setEnabled(!connectOpts.searchForGatekeeper);  if (!CPhone::GetUi().InitialiseGatekeeper()) {    PString res = CPhone::GetUi().GetGatekeeperRegistrationMessage();    DisplayMessage("Gatekeeper Failed : " + res);  }  UpdateCurrentGatekeeperText();  return;}void Settings::UpdateCurrentGatekeeperText(){  TextLabelMicroTelcoStatus->setText((const char *)CPhone::GetUi().GetGatekeeperName());  if  (TextLabelMicroTelcoStatus->text().isEmpty())    DisplayMessage("No gatekeeper defined or found");  else        DisplayMessage(QString("Gatekeeper set to ") + TextLabelMicroTelcoStatus->text());}void Settings::GatekeeperName_slot(){  /* the name the user types in is changing  as the user types */  if (!controlsSet)    return;    connectOpts.gatekeeperName = (const char *) LineEditGatekeeper->text();  if (connectOpts.searchForGatekeeper)     return;  CPhone::GetUi().InitialiseGatekeeper();  UpdateCurrentGatekeeperText();  return;}void Settings::AutoAnswer_slot(){  if (!controlsSet)    return;    connectOpts.autoAnswer = CheckBoxAutoAnswer->isChecked();   return;}void Settings::DisableFastStart_slot(){  if (!controlsSet)    return;  connectOpts.noFastStart = CheckBoxDisableFastStart->isChecked();    return;}void Settings::DisableH245Tunneling_slot(){  if (!controlsSet)    return;    connectOpts.noH245Tunnelling = CheckBoxDisableH245Tunnel->isChecked();   return;}void Settings::PacketUtilization_slot(){ if (!controlsSet)    return;  connectOpts.packetUtilization = SpinBoxFramesEthernetPacket->value();  return;}void Settings::BandwidthAudio_slot(){   if (!controlsSet)    return;   long i = SpinBoxBandwidthAudio->value();   connectOpts.audioBandwidth = i;   return;}void Settings::BandwidthVideo_slot(){  if (!controlsSet)    return;    long i = SpinBoxBandwidthVideo->value();  connectOpts.videoBandwidth = i;    return;}void Settings::UserName_slot(){  if (!controlsSet)    return;  QString s = LineEditUserName->text();  if (s.isEmpty()) {    DisplayMessage("Empty user name is ignored.  Using \"" + 		   QString((const char *)connectOpts.userName) + "\"");    return;  }  DisplayMessage("");  connectOpts.userName = (const char *)s;  CPhone::GetUi().UpdateUserName(); return;}void Settings::CheckBoxDefaultAudioBandwidth_slot(){  if (!controlsSet)    return;  bool b = CheckBoxDefaultAudio->isChecked();  connectOpts.useDefaultAudioBandwidth = b;  if(b)    SpinBoxBandwidthAudio->show();  else    SpinBoxBandwidthAudio->hide(); return;}void Settings::CheckBoxDefaultVideoBandwidth_slot(){  if (!controlsSet)    return;  bool b = CheckBoxDefaultVideo->isChecked();  connectOpts.useDefaultVideoBandwidth = b;  if (b)    SpinBoxBandwidthVideo->show();  else    SpinBoxBandwidthVideo->hide(); return;}void Settings::DisplayMessage(const char * message){  DisplayMessage(QString(message));}void Settings::DisplayMessage(PString message){  DisplayMessage(QString((const char *)message));}void Settings::DisplayMessage(QString message){  LabelDisplaySettingsEnabled->prepareDisplayText(message);  QCustomEvent *ce = new QCustomEvent(QEvent::User);  QApplication::postEvent(LabelDisplaySettingsEnabled, ce);  killTimers();  startTimer(20 * 1000); //display text for 20 seconds.}void Settings::timerEvent(QTimerEvent *){  LabelDisplaySettingsEnabled->clear(); //setText("");}void Settings::OnConnectionEstablished(bool isEstablished){  //isEstablished is true means this call is being created.  //isEstablished is false means this call is terminated.  DisplayMessage(isEstablished ? QString("Controls disabled during call") : QString("Controls now active"));  char * patterns[] = {"LineEditGatekeeper" , "LineEditUserName" , "SpinBox.*" , "PushButton.*", 		       "CheckBox.*", "LineEditNatTraversal", "PushButtonEnableMicroTelco",		       "LineEditMicroTelcoAccount,", "LineEditMicroTelcoPassword", 		       "SpinBoxLowUdp", "SpinBoxHighUdp", 0 };  int index = 0;  while (patterns[index] != NULL) {    QObjectList * l = topLevelWidget()->queryList("QObject", patterns[index]);    QObjectListIt it( *l );             // iterate over the QObjects matching patterns[index]    QObject * obj;    while ((obj = it.current()) != 0) { // for each found QObject      ++it;      ((QWidget *)obj)->setEnabled(!isEstablished);    }  delete l;                           // delete the list, not the objects  index ++;  }}void Settings::PushButtonNatTraversal_Slot(){  if (!controlsSet)    return;  bool b = PushButtonNatTraversal->state();  connectOpts.doNatTraversal = b;  PushButtonNatTraversal->setText((b ? QString("Enable traversal") : QString("No traversal")));}void Settings::LineEditNatTraversalChanged_Slot(){  if (!controlsSet)    return;  QString s = LineEditNatTraversal->text();  connectOpts.externalNatAddress = (const char *)s;  CPhone::GetUi().UpdateNatTraversalAddress();}void Settings::UpdateMicroTelcoText(){  PushButtonEnableMicroTelco->setText((connectOpts.doMicroTelco ? 				       QString("Micro Telco Services Active") : QString("No Micro Telco")));  TextLabelMicroTelcoStatus->setText((connectOpts.doMicroTelco ? 				      QString("Using gk.microtelco.com as MicroTelco enabled") : 				      CPhone::GetUi().GetGatekeeperName()));}void Settings::PushButtonMicroTelcoSlot(){  if (!controlsSet)    return;  bool b = PushButtonEnableMicroTelco->state();  connectOpts.doMicroTelco = b;  UpdateMicroTelcoText();  PString res;  if (b) {    TextLabel2_2->hide();    CheckBoxSearchForAGatekeeper->hide();    LineEditGatekeeper->hide();    BOOL success = CPhone::GetUi().MicroTelcoActivate(b);    if (success)       DisplayMessage("Micro Telco Activated");    else      QApplication::postEvent(this, new QCustomEvent(CUSTOM_EVENT_FAIL_MT));   } else {    TextLabel2_2->show();    CheckBoxSearchForAGatekeeper->show();    LineEditGatekeeper->show();    SearchForAGatekeeper_slot(); }}void Settings::MicroTelcoAccountChanged_Slot(){    if (!controlsSet)    return;        QString s = LineEditMicroTelcoAccount->text();    connectOpts.microTelcoAccount = (const char *)s;}void Settings::MicroTelcoPasswordChanged_Slot(){  if (!controlsSet)    return;    QString s = LineEditMicroTelcoPassword->text();  connectOpts.microTelcoPassword = (const char *)s;}void Settings::SpinBoxLowUdp_Slot(){  if (!controlsSet)    return;    int a,b;  a = SpinBoxLowUdp->value();  b = SpinBoxHighUdp->value();  if (a > b)     SpinBoxHighUdp->setValue(a);    connectOpts.lowUdpPort = a;  CPhone::GetUi().UpdateUdpPorts();}void Settings::SpinBoxHighUdp_Slot(){  if (!controlsSet)    return;    int a,b;  a = SpinBoxLowUdp->value();  b = SpinBoxHighUdp->value();  if (b < a)     SpinBoxLowUdp->setValue(b);    connectOpts.highUdpPort = b;  CPhone::GetUi().UpdateUdpPorts();}void Settings::customEvent(QCustomEvent *e){  if (e->type() == CUSTOM_EVENT_FAIL_MT) {    PushButtonEnableMicroTelco->setOn(FALSE);     PString res = CPhone::GetUi().GetGatekeeperRegistrationMessage();    DisplayMessage("MicroTelco Failed : " + res);  }  if (e->type()  == CUSTOM_EVENT_DIE)     close(TRUE);  if (e->type()  == CUSTOM_EVENT_SETUP)     Setup();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -