Changeset 2138 in ntrip


Ignore:
Timestamp:
Dec 30, 2009, 7:28:18 AM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnswindow.cpp

    r2102 r2138  
    9090
    9191  bnsSettings settings;
    92   QPalette palette;
    93   QColor lightGray(230, 230, 230);
    9492
    9593  QString fontString = settings.value("font").toString();
     
    346344
    347345  connect(_proxyHostLineEdit, SIGNAL(textChanged(const QString &)),
    348           this, SLOT(bnsText(const QString &)));
    349   if (_proxyHostLineEdit->text().isEmpty()) {
    350     _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
    351     _proxyPortLineEdit->setEnabled(false);
    352   }
     346          this, SLOT(slotBnsTextChanged()));
    353347
    354348  // General Tab
     
    393387
    394388  connect(_ephHostLineEdit, SIGNAL(textChanged(const QString &)),
    395           this, SLOT(bnsText(const QString &)));
    396   if (_ephHostLineEdit->text().isEmpty()) {
    397     _ephPortLineEdit->setStyleSheet("background-color: lightGray");
    398     _ephEchoLineEdit->setStyleSheet("background-color: lightGray");
    399     _ephPortLineEdit->setEnabled(false);
    400     _ephEchoLineEdit->setEnabled(false);
    401   }
     389          this, SLOT(slotBnsTextChanged()));
    402390
    403391  // Clocks & Orbits Tab
     
    421409
    422410  connect(_clkPortLineEdit, SIGNAL(textChanged(const QString &)),
    423           this, SLOT(bnsText(const QString &)));
    424   if (_clkPortLineEdit->text().isEmpty()) {
    425     _inpEchoLineEdit->setStyleSheet("background-color: lightGray");
    426     _inpEchoLineEdit->setEnabled(false);
    427   }
     411          this, SLOT(slotBnsTextChanged()));
    428412
    429413  // Broadcast Corrections I Tab
     
    459443
    460444  tab_cas1->setLayout(layout_cas1);
     445
    461446  connect(_refSys_1_ComboBox, SIGNAL(currentIndexChanged(const QString &)),
    462447          this, SLOT(customTrafo(const QString)));
     448
    463449  connect(_outHost_1_LineEdit, SIGNAL(textChanged(const QString &)),
    464           this, SLOT(bnsText(const QString &)));
    465   if (_outHost_1_LineEdit->text().isEmpty()) {
    466     _outPort_1_LineEdit->setStyleSheet("background-color: lightGray");
    467     _mountpoint_1_LineEdit->setStyleSheet("background-color: lightGray");
    468     _password_1_LineEdit->setStyleSheet("background-color: lightGray");
    469     _outFile_1_LineEdit->setStyleSheet("background-color: lightGray");
    470     _refSys_1_ComboBox->setStyleSheet("background-color: lightGray");
    471     palette.setColor(_CoM_1_CheckBox->backgroundRole(), lightGray);
    472     _CoM_1_CheckBox->setPalette(palette);
    473     _outPort_1_LineEdit->setEnabled(false);
    474     _mountpoint_1_LineEdit->setEnabled(false);
    475     _password_1_LineEdit->setEnabled(false);
    476     _outFile_1_LineEdit->setEnabled(false);
    477     _refSys_1_ComboBox->setEnabled(false);
    478     _CoM_1_CheckBox->setEnabled(false);
    479   }
     450          this, SLOT(slotBnsTextChanged()));
    480451
    481452  // Broadcast Corrections II Tab
     
    511482
    512483  tab_cas2->setLayout(layout_cas2);
     484
    513485  connect(_refSys_2_ComboBox, SIGNAL(currentIndexChanged(const QString &)),
    514486          this, SLOT(customTrafo(const QString)));
     487
    515488  connect(_outHost_2_LineEdit, SIGNAL(textChanged(const QString &)),
    516           this, SLOT(bnsText(const QString &)));
    517   if (_outHost_2_LineEdit->text().isEmpty()) {
    518     _outPort_2_LineEdit->setStyleSheet("background-color: lightGray");
    519     _mountpoint_2_LineEdit->setStyleSheet("background-color: lightGray");
    520     _password_2_LineEdit->setStyleSheet("background-color: lightGray");
    521     _outFile_2_LineEdit->setStyleSheet("background-color: lightGray");
    522     _refSys_2_ComboBox->setStyleSheet("background-color: lightGray");
    523     palette.setColor(_CoM_2_CheckBox->backgroundRole(), lightGray);
    524     _CoM_2_CheckBox->setPalette(palette);
    525     _outPort_2_LineEdit->setEnabled(false);
    526     _mountpoint_2_LineEdit->setEnabled(false);
    527     _password_2_LineEdit->setEnabled(false);
    528     _outFile_2_LineEdit->setEnabled(false);
    529     _refSys_2_ComboBox->setEnabled(false);
    530     _CoM_2_CheckBox->setEnabled(false);
    531   }
     489          this, SLOT(slotBnsTextChanged()));
    532490
    533491  // Broadcast Corrections III Tab
     
    563521
    564522  tab_cas3->setLayout(layout_cas3);
     523
    565524  connect(_refSys_3_ComboBox, SIGNAL(currentIndexChanged(const QString &)),
    566525          this, SLOT(customTrafo(const QString)));
     526
    567527  connect(_outHost_3_LineEdit, SIGNAL(textChanged(const QString &)),
    568           this, SLOT(bnsText(const QString &)));
    569   if (_outHost_3_LineEdit->text().isEmpty()) {
    570     _outPort_3_LineEdit->setStyleSheet("background-color: lightGray");
    571     _mountpoint_3_LineEdit->setStyleSheet("background-color: lightGray");
    572     _password_3_LineEdit->setStyleSheet("background-color: lightGray");
    573     _outFile_3_LineEdit->setStyleSheet("background-color: lightGray");
    574     _refSys_3_ComboBox->setStyleSheet("background-color: lightGray");
    575     palette.setColor(_CoM_3_CheckBox->backgroundRole(), lightGray);
    576     _CoM_3_CheckBox->setPalette(palette);
    577     _outPort_3_LineEdit->setEnabled(false);
    578     _mountpoint_3_LineEdit->setEnabled(false);
    579     _password_3_LineEdit->setEnabled(false);
    580     _outFile_3_LineEdit->setEnabled(false);
    581     _refSys_3_ComboBox->setEnabled(false);
    582     _CoM_3_CheckBox->setEnabled(false);
    583   }
     528          this, SLOT(slotBnsTextChanged()));
    584529
    585530  // Broadcast Ephemerides
     
    608553
    609554  tab_casEph->setLayout(layout_casEph);
     555
    610556  connect(_outHost_Eph_LineEdit, SIGNAL(textChanged(const QString &)),
    611           this, SLOT(bnsText(const QString &)));
    612   if (_outHost_Eph_LineEdit->text().isEmpty()) {
    613     _outPort_Eph_LineEdit->setStyleSheet("background-color: lightGray");
    614     _mountpoint_Eph_LineEdit->setStyleSheet("background-color: lightGray");
    615     _password_Eph_LineEdit->setStyleSheet("background-color: lightGray");
    616     _samplEphSpinBox->setStyleSheet("background-color: lightGray");
    617     _outPort_Eph_LineEdit->setEnabled(false);
    618     _mountpoint_Eph_LineEdit->setEnabled(false);
    619     _password_Eph_LineEdit->setEnabled(false);
    620     _samplEphSpinBox->setEnabled(false);
    621   }
     557          this, SLOT(slotBnsTextChanged()));
    622558
    623559  // RINEX Clocks Tab
     
    643579
    644580  connect(_rnxPathLineEdit, SIGNAL(textChanged(const QString &)),
    645           this, SLOT(bnsText(const QString &)));
    646   if (_rnxPathLineEdit->text().isEmpty()) {
    647     _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
    648     _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
    649     _rnxIntrComboBox->setEnabled(false);
    650     _rnxSamplSpinBox->setEnabled(false);
    651   }
     581          this, SLOT(slotBnsTextChanged()));
    652582
    653583  // SP3 Orbits Tab
     
    673603
    674604  connect(_sp3PathLineEdit, SIGNAL(textChanged(const QString &)),
    675           this, SLOT(bnsText(const QString &)));
    676   if (_sp3PathLineEdit->text().isEmpty()) {
    677     _sp3IntrComboBox->setStyleSheet("background-color: lightGray");
    678     _sp3SamplSpinBox->setStyleSheet("background-color: lightGray");
    679     _sp3IntrComboBox->setEnabled(false);
    680     _sp3SamplSpinBox->setEnabled(false);
    681   }
     605          this, SLOT(slotBnsTextChanged()));
    682606
    683607  tabs->setCurrentIndex(settings.value("startTab").toInt());
     
    743667  _canvas->setLayout(mainLayout);
    744668
     669  // Enable/Disable all Widgets
     670  // --------------------------
     671  slotBnsTextChanged();
     672
    745673  // Auto start
    746674  // ----------
     
    1006934}
    1007935
    1008 //  Bns Text
    1009 ////////////////////////////////////////////////////////////////////////////
    1010 void bnsWindow::bnsText(const QString &text){
    1011 
    1012   bool isEmpty = text.isEmpty();
    1013 
    1014   QPalette palette;
    1015   QColor lightGray(230, 230, 230);
    1016   QColor white(255, 255, 255);
     936// Enable/Disable Widgets according to user input
     937////////////////////////////////////////////////////////////////////////////
     938void bnsWindow::slotBnsTextChanged(){
     939
     940  QPalette palette_white(QColor(255, 255, 255));
     941  QPalette palette_gray(QColor(230, 230, 230));
    1017942
    1018943  // Enable/disable Proxy Options
    1019944  // ----------------------------
    1020   if (tabs->currentIndex() == 0) {
    1021     if (!isEmpty) {
     945  if (sender() == 0 || sender() == _proxyHostLineEdit) {
     946    if (!_proxyHostLineEdit->text().isEmpty()) {
    1022947      _proxyPortLineEdit->setStyleSheet("background-color: white");
    1023948      _proxyPortLineEdit->setEnabled(true);
    1024     } else {
     949    }
     950    else {
    1025951      _proxyPortLineEdit->setStyleSheet("background-color: lightGray");
    1026952      _proxyPortLineEdit->setEnabled(false);
     
    1030956  // Enable/disable RINEX Ephemeris Options
    1031957  // --------------------------------------
    1032   if (tabs->currentIndex() == 2) {
    1033     if (!isEmpty) {
    1034     _ephPortLineEdit->setStyleSheet("background-color: white");
    1035     _ephEchoLineEdit->setStyleSheet("background-color: white");
    1036     _ephPortLineEdit->setEnabled(true);
    1037     _ephEchoLineEdit->setEnabled(true);
    1038     } else {
    1039     _ephPortLineEdit->setStyleSheet("background-color: lightGray");
    1040     _ephEchoLineEdit->setStyleSheet("background-color: lightGray");
    1041     _ephPortLineEdit->setEnabled(false);
    1042     _ephEchoLineEdit->setEnabled(false);
     958  if (sender() == 0 || sender() == _ephHostLineEdit) {
     959    if (!_ephHostLineEdit->text().isEmpty()) {
     960      _ephPortLineEdit->setStyleSheet("background-color: white");
     961      _ephEchoLineEdit->setStyleSheet("background-color: white");
     962      _ephPortLineEdit->setEnabled(true);
     963      _ephEchoLineEdit->setEnabled(true);
     964    }
     965    else {
     966      _ephPortLineEdit->setStyleSheet("background-color: lightGray");
     967      _ephEchoLineEdit->setStyleSheet("background-color: lightGray");
     968      _ephPortLineEdit->setEnabled(false);
     969      _ephEchoLineEdit->setEnabled(false);
    1043970    }
    1044971  }
     
    1046973  // Enable/disable Clocks & Orbits Options
    1047974  // --------------------------------------
    1048   if (tabs->currentIndex() == 3) {
    1049     if (!isEmpty) {
    1050     _inpEchoLineEdit->setStyleSheet("background-color: white");
    1051     _inpEchoLineEdit->setEnabled(true);
    1052     } else {
    1053     _inpEchoLineEdit->setStyleSheet("background-color: lightGray");
    1054     _inpEchoLineEdit->setEnabled(false);
     975  if (sender() == 0 || sender() == _clkPortLineEdit) {
     976    if (!_clkPortLineEdit->text().isEmpty()) {
     977      _inpEchoLineEdit->setStyleSheet("background-color: white");
     978      _inpEchoLineEdit->setEnabled(true);
     979    }
     980    else {
     981      _inpEchoLineEdit->setStyleSheet("background-color: lightGray");
     982      _inpEchoLineEdit->setEnabled(false);
    1055983    }
    1056984  }
     
    1058986  // Enable/disable  Broadcast Corrections I Options
    1059987  // -----------------------------------------------
    1060   if (tabs->currentIndex() == 4) {
    1061     if (!isEmpty) {
     988  if (sender() == 0 || sender() == _outHost_1_LineEdit) {
     989    if (!_outHost_1_LineEdit->text().isEmpty()) {
    1062990      _outPort_1_LineEdit->setStyleSheet("background-color: white");
    1063991      _mountpoint_1_LineEdit->setStyleSheet("background-color: white");
     
    1065993      _outFile_1_LineEdit->setStyleSheet("background-color: white");
    1066994      _refSys_1_ComboBox->setStyleSheet("background-color: white");
    1067       palette.setColor(_CoM_1_CheckBox->backgroundRole(), white);
    1068       _CoM_1_CheckBox->setPalette(palette);
     995      _CoM_1_CheckBox->setPalette(palette_white);
    1069996      _outPort_1_LineEdit->setEnabled(true);
    1070997      _mountpoint_1_LineEdit->setEnabled(true);
     
    10731000      _refSys_1_ComboBox->setEnabled(true);
    10741001      _CoM_1_CheckBox->setEnabled(true);
    1075     } else {
     1002    }
     1003    else {
    10761004      _outPort_1_LineEdit->setStyleSheet("background-color: lightGray");
    10771005      _mountpoint_1_LineEdit->setStyleSheet("background-color: lightGray");
     
    10791007      _outFile_1_LineEdit->setStyleSheet("background-color: lightGray");
    10801008      _refSys_1_ComboBox->setStyleSheet("background-color: lightGray");
    1081       palette.setColor(_CoM_1_CheckBox->backgroundRole(), lightGray);
    1082       _CoM_1_CheckBox->setPalette(palette);
     1009      _CoM_1_CheckBox->setPalette(palette_gray);
    10831010      _outPort_1_LineEdit->setEnabled(false);
    10841011      _mountpoint_1_LineEdit->setEnabled(false);
     
    10921019  // Enable/disable Broadcast Corrections II Options
    10931020  // -----------------------------------------------
    1094   if (tabs->currentIndex() == 5) {
    1095     if (!isEmpty) {
     1021  if (sender() == 0 || sender() == _outHost_2_LineEdit) {
     1022    if (!_outHost_2_LineEdit->text().isEmpty()) {
    10961023      _outPort_2_LineEdit->setStyleSheet("background-color: white");
    10971024      _mountpoint_2_LineEdit->setStyleSheet("background-color: white");
     
    10991026      _outFile_2_LineEdit->setStyleSheet("background-color: white");
    11001027      _refSys_2_ComboBox->setStyleSheet("background-color: white");
    1101       palette.setColor(_CoM_2_CheckBox->backgroundRole(), white);
    1102       _CoM_2_CheckBox->setPalette(palette);
     1028      _CoM_2_CheckBox->setPalette(palette_white);
    11031029      _outPort_2_LineEdit->setEnabled(true);
    11041030      _mountpoint_2_LineEdit->setEnabled(true);
     
    11071033      _refSys_2_ComboBox->setEnabled(true);
    11081034      _CoM_2_CheckBox->setEnabled(true);
    1109     } else {
     1035    }
     1036    else {
    11101037      _outPort_2_LineEdit->setStyleSheet("background-color: lightGray");
    11111038      _mountpoint_2_LineEdit->setStyleSheet("background-color: lightGray");
     
    11131040      _outFile_2_LineEdit->setStyleSheet("background-color: lightGray");
    11141041      _refSys_2_ComboBox->setStyleSheet("background-color: lightGray");
    1115       palette.setColor(_CoM_2_CheckBox->backgroundRole(), lightGray);
    1116       _CoM_2_CheckBox->setPalette(palette);
     1042      _CoM_2_CheckBox->setPalette(palette_gray);
    11171043      _outPort_2_LineEdit->setEnabled(false);
    11181044      _mountpoint_2_LineEdit->setEnabled(false);
     
    11261052  // Enable/disable Broadcast Corrections III Options
    11271053  // -----------------------------------------------
    1128   if (tabs->currentIndex() == 6) {
    1129     if (!isEmpty) {
     1054  if (sender() == 0 || sender() == _outHost_3_LineEdit) {
     1055    if (!_outHost_3_LineEdit->text().isEmpty()) {
    11301056      _outPort_3_LineEdit->setStyleSheet("background-color: white");
    11311057      _mountpoint_3_LineEdit->setStyleSheet("background-color: white");
     
    11331059      _outFile_3_LineEdit->setStyleSheet("background-color: white");
    11341060      _refSys_3_ComboBox->setStyleSheet("background-color: white");
    1135       palette.setColor(_CoM_3_CheckBox->backgroundRole(), white);
    1136       _CoM_3_CheckBox->setPalette(palette);
     1061      _CoM_3_CheckBox->setPalette(palette_white);
    11371062      _outPort_3_LineEdit->setEnabled(true);
    11381063      _mountpoint_3_LineEdit->setEnabled(true);
     
    11411066      _refSys_3_ComboBox->setEnabled(true);
    11421067      _CoM_3_CheckBox->setEnabled(true);
    1143     } else {
     1068    }
     1069    else {
    11441070      _outPort_3_LineEdit->setStyleSheet("background-color: lightGray");
    11451071      _mountpoint_3_LineEdit->setStyleSheet("background-color: lightGray");
     
    11471073      _outFile_3_LineEdit->setStyleSheet("background-color: lightGray");
    11481074      _refSys_3_ComboBox->setStyleSheet("background-color: lightGray");
    1149       palette.setColor(_CoM_3_CheckBox->backgroundRole(), lightGray);
    1150       _CoM_3_CheckBox->setPalette(palette);
     1075      _CoM_3_CheckBox->setPalette(palette_gray);
    11511076      _outPort_3_LineEdit->setEnabled(false);
    11521077      _mountpoint_3_LineEdit->setEnabled(false);
     
    11601085  // Enable/disable Broadcast Ephemerides
    11611086  // ------------------------------------
    1162   if (tabs->currentIndex() == 7) {
    1163     if (!isEmpty) {
     1087  if (sender() == 0 || sender() == _outHost_Eph_LineEdit) {
     1088    if (!_outHost_Eph_LineEdit->text().isEmpty()) {
    11641089      _outPort_Eph_LineEdit->setStyleSheet("background-color: white");
    11651090      _mountpoint_Eph_LineEdit->setStyleSheet("background-color: white");
     
    11701095      _password_Eph_LineEdit->setEnabled(true);
    11711096      _samplEphSpinBox->setEnabled(true);
    1172     } else {
     1097    }
     1098    else {
    11731099      _outPort_Eph_LineEdit->setStyleSheet("background-color: lightGray");
    11741100      _mountpoint_Eph_LineEdit->setStyleSheet("background-color: lightGray");
     
    11841110  // Enable/disable RINEX Clocks Options
    11851111  // -----------------------------------
    1186   if (tabs->currentIndex() == 8) {
    1187     if (!isEmpty) {
     1112  if (sender() == 0 || sender() == _rnxPathLineEdit) {
     1113    if (!_rnxPathLineEdit->text().isEmpty()) {
    11881114      _rnxIntrComboBox->setStyleSheet("background-color: white");
    11891115      _rnxSamplSpinBox->setStyleSheet("background-color: white");
    11901116      _rnxIntrComboBox->setEnabled(true);
    11911117      _rnxSamplSpinBox->setEnabled(true);
    1192     } else {
     1118    }
     1119    else {
    11931120      _rnxIntrComboBox->setStyleSheet("background-color: lightGray");
    11941121      _rnxSamplSpinBox->setStyleSheet("background-color: lightGray");
     
    12001127  // Enable/disable SP3 Orbits Options
    12011128  // ---------------------------------
    1202   if (tabs->currentIndex() == 9) {
    1203     if (!isEmpty) {
     1129  if (sender() == 0 || sender() == _sp3PathLineEdit) {
     1130    if (!_sp3PathLineEdit->text().isEmpty()) {
    12041131      _sp3IntrComboBox->setStyleSheet("background-color: white");
    12051132      _sp3SamplSpinBox->setStyleSheet("background-color: white");
    12061133      _sp3IntrComboBox->setEnabled(true);
    12071134      _sp3SamplSpinBox->setEnabled(true);
    1208     } else {
     1135    }
     1136    else {
    12091137      _sp3IntrComboBox->setStyleSheet("background-color: lightGray");
    12101138      _sp3SamplSpinBox->setStyleSheet("background-color: lightGray");
  • trunk/BNS/bnswindow.h

    r2046 r2138  
    3333  void slotMessage(const QByteArray msg);
    3434  void slotError(const QByteArray msg);
    35   void bnsText(const QString &text);
     35  void slotBnsTextChanged();
    3636  void customTrafo(const QString &text);
    3737
Note: See TracChangeset for help on using the changeset viewer.