- Timestamp:
- Dec 30, 2009, 7:28:18 AM (15 years ago)
- Location:
- trunk/BNS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnswindow.cpp
r2102 r2138 90 90 91 91 bnsSettings settings; 92 QPalette palette;93 QColor lightGray(230, 230, 230);94 92 95 93 QString fontString = settings.value("font").toString(); … … 346 344 347 345 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())); 353 347 354 348 // General Tab … … 393 387 394 388 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())); 402 390 403 391 // Clocks & Orbits Tab … … 421 409 422 410 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())); 428 412 429 413 // Broadcast Corrections I Tab … … 459 443 460 444 tab_cas1->setLayout(layout_cas1); 445 461 446 connect(_refSys_1_ComboBox, SIGNAL(currentIndexChanged(const QString &)), 462 447 this, SLOT(customTrafo(const QString))); 448 463 449 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())); 480 451 481 452 // Broadcast Corrections II Tab … … 511 482 512 483 tab_cas2->setLayout(layout_cas2); 484 513 485 connect(_refSys_2_ComboBox, SIGNAL(currentIndexChanged(const QString &)), 514 486 this, SLOT(customTrafo(const QString))); 487 515 488 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())); 532 490 533 491 // Broadcast Corrections III Tab … … 563 521 564 522 tab_cas3->setLayout(layout_cas3); 523 565 524 connect(_refSys_3_ComboBox, SIGNAL(currentIndexChanged(const QString &)), 566 525 this, SLOT(customTrafo(const QString))); 526 567 527 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())); 584 529 585 530 // Broadcast Ephemerides … … 608 553 609 554 tab_casEph->setLayout(layout_casEph); 555 610 556 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())); 622 558 623 559 // RINEX Clocks Tab … … 643 579 644 580 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())); 652 582 653 583 // SP3 Orbits Tab … … 673 603 674 604 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())); 682 606 683 607 tabs->setCurrentIndex(settings.value("startTab").toInt()); … … 743 667 _canvas->setLayout(mainLayout); 744 668 669 // Enable/Disable all Widgets 670 // -------------------------- 671 slotBnsTextChanged(); 672 745 673 // Auto start 746 674 // ---------- … … 1006 934 } 1007 935 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 //////////////////////////////////////////////////////////////////////////// 938 void bnsWindow::slotBnsTextChanged(){ 939 940 QPalette palette_white(QColor(255, 255, 255)); 941 QPalette palette_gray(QColor(230, 230, 230)); 1017 942 1018 943 // Enable/disable Proxy Options 1019 944 // ---------------------------- 1020 if ( tabs->currentIndex() == 0) {1021 if (! isEmpty) {945 if (sender() == 0 || sender() == _proxyHostLineEdit) { 946 if (!_proxyHostLineEdit->text().isEmpty()) { 1022 947 _proxyPortLineEdit->setStyleSheet("background-color: white"); 1023 948 _proxyPortLineEdit->setEnabled(true); 1024 } else { 949 } 950 else { 1025 951 _proxyPortLineEdit->setStyleSheet("background-color: lightGray"); 1026 952 _proxyPortLineEdit->setEnabled(false); … … 1030 956 // Enable/disable RINEX Ephemeris Options 1031 957 // -------------------------------------- 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); 1043 970 } 1044 971 } … … 1046 973 // Enable/disable Clocks & Orbits Options 1047 974 // -------------------------------------- 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); 1055 983 } 1056 984 } … … 1058 986 // Enable/disable Broadcast Corrections I Options 1059 987 // ----------------------------------------------- 1060 if ( tabs->currentIndex() == 4) {1061 if (! isEmpty) {988 if (sender() == 0 || sender() == _outHost_1_LineEdit) { 989 if (!_outHost_1_LineEdit->text().isEmpty()) { 1062 990 _outPort_1_LineEdit->setStyleSheet("background-color: white"); 1063 991 _mountpoint_1_LineEdit->setStyleSheet("background-color: white"); … … 1065 993 _outFile_1_LineEdit->setStyleSheet("background-color: white"); 1066 994 _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); 1069 996 _outPort_1_LineEdit->setEnabled(true); 1070 997 _mountpoint_1_LineEdit->setEnabled(true); … … 1073 1000 _refSys_1_ComboBox->setEnabled(true); 1074 1001 _CoM_1_CheckBox->setEnabled(true); 1075 } else { 1002 } 1003 else { 1076 1004 _outPort_1_LineEdit->setStyleSheet("background-color: lightGray"); 1077 1005 _mountpoint_1_LineEdit->setStyleSheet("background-color: lightGray"); … … 1079 1007 _outFile_1_LineEdit->setStyleSheet("background-color: lightGray"); 1080 1008 _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); 1083 1010 _outPort_1_LineEdit->setEnabled(false); 1084 1011 _mountpoint_1_LineEdit->setEnabled(false); … … 1092 1019 // Enable/disable Broadcast Corrections II Options 1093 1020 // ----------------------------------------------- 1094 if ( tabs->currentIndex() == 5) {1095 if (! isEmpty) {1021 if (sender() == 0 || sender() == _outHost_2_LineEdit) { 1022 if (!_outHost_2_LineEdit->text().isEmpty()) { 1096 1023 _outPort_2_LineEdit->setStyleSheet("background-color: white"); 1097 1024 _mountpoint_2_LineEdit->setStyleSheet("background-color: white"); … … 1099 1026 _outFile_2_LineEdit->setStyleSheet("background-color: white"); 1100 1027 _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); 1103 1029 _outPort_2_LineEdit->setEnabled(true); 1104 1030 _mountpoint_2_LineEdit->setEnabled(true); … … 1107 1033 _refSys_2_ComboBox->setEnabled(true); 1108 1034 _CoM_2_CheckBox->setEnabled(true); 1109 } else { 1035 } 1036 else { 1110 1037 _outPort_2_LineEdit->setStyleSheet("background-color: lightGray"); 1111 1038 _mountpoint_2_LineEdit->setStyleSheet("background-color: lightGray"); … … 1113 1040 _outFile_2_LineEdit->setStyleSheet("background-color: lightGray"); 1114 1041 _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); 1117 1043 _outPort_2_LineEdit->setEnabled(false); 1118 1044 _mountpoint_2_LineEdit->setEnabled(false); … … 1126 1052 // Enable/disable Broadcast Corrections III Options 1127 1053 // ----------------------------------------------- 1128 if ( tabs->currentIndex() == 6) {1129 if (! isEmpty) {1054 if (sender() == 0 || sender() == _outHost_3_LineEdit) { 1055 if (!_outHost_3_LineEdit->text().isEmpty()) { 1130 1056 _outPort_3_LineEdit->setStyleSheet("background-color: white"); 1131 1057 _mountpoint_3_LineEdit->setStyleSheet("background-color: white"); … … 1133 1059 _outFile_3_LineEdit->setStyleSheet("background-color: white"); 1134 1060 _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); 1137 1062 _outPort_3_LineEdit->setEnabled(true); 1138 1063 _mountpoint_3_LineEdit->setEnabled(true); … … 1141 1066 _refSys_3_ComboBox->setEnabled(true); 1142 1067 _CoM_3_CheckBox->setEnabled(true); 1143 } else { 1068 } 1069 else { 1144 1070 _outPort_3_LineEdit->setStyleSheet("background-color: lightGray"); 1145 1071 _mountpoint_3_LineEdit->setStyleSheet("background-color: lightGray"); … … 1147 1073 _outFile_3_LineEdit->setStyleSheet("background-color: lightGray"); 1148 1074 _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); 1151 1076 _outPort_3_LineEdit->setEnabled(false); 1152 1077 _mountpoint_3_LineEdit->setEnabled(false); … … 1160 1085 // Enable/disable Broadcast Ephemerides 1161 1086 // ------------------------------------ 1162 if ( tabs->currentIndex() == 7) {1163 if (! isEmpty) {1087 if (sender() == 0 || sender() == _outHost_Eph_LineEdit) { 1088 if (!_outHost_Eph_LineEdit->text().isEmpty()) { 1164 1089 _outPort_Eph_LineEdit->setStyleSheet("background-color: white"); 1165 1090 _mountpoint_Eph_LineEdit->setStyleSheet("background-color: white"); … … 1170 1095 _password_Eph_LineEdit->setEnabled(true); 1171 1096 _samplEphSpinBox->setEnabled(true); 1172 } else { 1097 } 1098 else { 1173 1099 _outPort_Eph_LineEdit->setStyleSheet("background-color: lightGray"); 1174 1100 _mountpoint_Eph_LineEdit->setStyleSheet("background-color: lightGray"); … … 1184 1110 // Enable/disable RINEX Clocks Options 1185 1111 // ----------------------------------- 1186 if ( tabs->currentIndex() == 8) {1187 if (! isEmpty) {1112 if (sender() == 0 || sender() == _rnxPathLineEdit) { 1113 if (!_rnxPathLineEdit->text().isEmpty()) { 1188 1114 _rnxIntrComboBox->setStyleSheet("background-color: white"); 1189 1115 _rnxSamplSpinBox->setStyleSheet("background-color: white"); 1190 1116 _rnxIntrComboBox->setEnabled(true); 1191 1117 _rnxSamplSpinBox->setEnabled(true); 1192 } else { 1118 } 1119 else { 1193 1120 _rnxIntrComboBox->setStyleSheet("background-color: lightGray"); 1194 1121 _rnxSamplSpinBox->setStyleSheet("background-color: lightGray"); … … 1200 1127 // Enable/disable SP3 Orbits Options 1201 1128 // --------------------------------- 1202 if ( tabs->currentIndex() == 9) {1203 if (! isEmpty) {1129 if (sender() == 0 || sender() == _sp3PathLineEdit) { 1130 if (!_sp3PathLineEdit->text().isEmpty()) { 1204 1131 _sp3IntrComboBox->setStyleSheet("background-color: white"); 1205 1132 _sp3SamplSpinBox->setStyleSheet("background-color: white"); 1206 1133 _sp3IntrComboBox->setEnabled(true); 1207 1134 _sp3SamplSpinBox->setEnabled(true); 1208 } else { 1135 } 1136 else { 1209 1137 _sp3IntrComboBox->setStyleSheet("background-color: lightGray"); 1210 1138 _sp3SamplSpinBox->setStyleSheet("background-color: lightGray"); -
trunk/BNS/bnswindow.h
r2046 r2138 33 33 void slotMessage(const QByteArray msg); 34 34 void slotError(const QByteArray msg); 35 void bnsText(const QString &text);35 void slotBnsTextChanged(); 36 36 void customTrafo(const QString &text); 37 37
Note:
See TracChangeset
for help on using the changeset viewer.