| 1 | /* |
| 2 | * File: TerminalProperties.cpp |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: Aug 7, 2009 |
| 6 | * |
| 7 | * Copyright (c) 2009-2013 Jacob Dekel |
| 8 | * $Id$ |
| 9 | * |
| 10 | * This program is free software: you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation, either version 3 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include "TerminalProperties.h"cxx . . $ `<file>/HercConfiguration/TerminalProperties.h`/ |
| 26 | #include "ConfigLine.h"cxx . . $ `<file>/HercConfiguration/ConfigLine.h`/ |
| 27 | |
| 28 | #include <sstream> |
| 29 | |
| 30 | TerminalPropertiescxx . . $ TerminalProperties#::TerminalPropertiescxx . . $ TerminalProperties#TerminalProperties(b7c8c82eacf24532).(ConfigLinecxx . . $ ConfigLine# & line, QWidgetcxx . . $ QWidget# *parent) |
| 31 | : GenericDevicePropertiescxx . . $ GenericDeviceProperties#(line, parent) |
| 32 | { |
| 33 | uicxx . . $ TerminalProperties#ui..setupUicxx . . $ Ui_TerminalPropertiesClass#setupUi(108f35f7aa7f3cf9).(this); |
| 34 | |
| 35 | if (!line.isNewcxx . . $ ConfigLine#isNew(50ce9a9e25b4a850).()) |
| 36 | { |
| 37 | uicxx . . $ TerminalProperties#ui..deviceNumbercxx . . $ Ui_TerminalPropertiesClass#deviceNumber.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(mLinecxx . . $ QString#QString(85c52e162fed56f9)..getTokencxx . . $ ConfigLine#getToken(ffc0d510d034206b).(0).c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).()); |
| 38 | uicxx . . $ TerminalProperties#ui..terminalCombocxx . . $ Ui_TerminalPropertiesClass#terminalCombo.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).( (mLinecxx . . $ GenericDeviceProperties#mLine..getTokencxx . . $ ConfigLine#getToken(ffc0d510d034206b).(1) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "3287") ? 1 : 0); |
| 39 | if (mLinecxx . . $ GenericDeviceProperties#mLine..sizecxx . . $ ConfigLine#size(455f465bc33b4cdf).() > 2) |
| 40 | { |
| 41 | int index = 2; |
| 42 | if (mLinecxx . . $ GenericDeviceProperties#mLine..getTokencxx . . $ ConfigLine#getToken(ffc0d510d034206b).(index).comparecxx . . $ std/__cxx11/basic_string#compare(1fc9373649671084).("SYSGCONS") == 0) |
| 43 | index++; |
| 44 | if (mLinecxx . . $ GenericDeviceProperties#mLine..getTokencxx . . $ ConfigLine#getToken(ffc0d510d034206b).(index)[cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).0] == '*') |
| 45 | index++; |
| 46 | else |
| 47 | uicxx . . $ TerminalProperties#ui..groupNamecxx . . $ Ui_TerminalPropertiesClass#groupName.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(mLinecxx . . $ QString#QString(85c52e162fed56f9)..getTokencxx . . $ ConfigLine#getToken(ffc0d510d034206b).(index++).c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).()); |
| 48 | if (mLinecxx . . $ GenericDeviceProperties#mLine..sizecxx . . $ ConfigLine#size(455f465bc33b4cdf).() >= index) |
| 49 | uicxx . . $ TerminalProperties#ui..IPAddresscxx . . $ Ui_TerminalPropertiesClass#IPAddress.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(mLinecxx . . $ QString#QString(85c52e162fed56f9)..getTokencxx . . $ ConfigLine#getToken(ffc0d510d034206b).(index).c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).()); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ TerminalProperties#ui..OKButtoncxx . . $ Ui_TerminalPropertiesClass#OKButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(ok())); |
| 54 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ TerminalProperties#ui..cancelButtoncxx . . $ Ui_TerminalPropertiesClass#cancelButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(cancel())); |
| 55 | } |
| 56 | |
| 57 | TerminalPropertiescxx . . $ TerminalProperties#::~cxx . . $ TerminalProperties#`~TerminalProperties`(49f6e7a06ebc5aa8).TerminalPropertiescxx . . $ TerminalProperties#() |
| 58 | { |
| 59 | |
| 60 | } |
| 61 | |
| 62 | void TerminalPropertiescxx . . $ TerminalProperties#::okcxx . . $ TerminalProperties#ok(49f6e7a06ebc5aa8).() |
| 63 | { |
| 64 | if (!deviceNumberValidatorcxx . . $ GenericDeviceProperties#deviceNumberValidator(5bc323e34e13a656).(uicxx . . $ TerminalProperties#ui..deviceNumbercxx . . $ Ui_TerminalPropertiesClass#deviceNumber.)) |
| 65 | return; |
| 66 | stdcxx . . $ std/::stringstreamcxx . . $ std/stringstream# newLineBuffcxx . . $ std/__cxx11/basic_stringstream#basic_stringstream(49f6e7a06ebc5aa8).; |
| 67 | stdcxx . . $ std/::stringcxx . . $ std/string# ipcxx . . $ std/__cxx11/basic_string#basic_string(49f6e7a06ebc5aa8).; |
| 68 | if (uicxx . . $ TerminalProperties#ui..IPAddresscxx . . $ Ui_TerminalPropertiesClass#IPAddress.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "...") // no address |
| 69 | ip =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). ""; |
| 70 | else |
| 71 | { |
| 72 | if (!validateIpcxx . . $ IpValidator#validateIp(8c7794b15f0d8b60).(uicxx . . $ TerminalProperties#ui..IPAddresscxx . . $ Ui_TerminalPropertiesClass#IPAddress.,false, false)) |
| 73 | return; |
| 74 | ip =cxx . . $ std/__cxx11/basic_string#`operator=`(706c69e8c742c906). uicxx . . $ TerminalProperties#ui..IPAddresscxx . . $ Ui_TerminalPropertiesClass#IPAddress.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(); |
| 75 | } |
| 76 | |
| 77 | stdcxx . . $ std/::stringcxx . . $ std/string# sysgTextcxx . . $ std/__cxx11/basic_string#basic_string(49f6e7a06ebc5aa8).; |
| 78 | if (isSysgcxx . . $ TerminalProperties#isSysg(c9857a73d68e59ba).()) sysgText =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "SYSGCONS "; |
| 79 | |
| 80 | newLineBuff <<cxx . . $ std/`operator<<`(88df5bef833f7f83). uicxx . . $ TerminalProperties#ui..deviceNumbercxx . . $ Ui_TerminalPropertiesClass#deviceNumber.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).() |
| 81 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). uicxx . . $ TerminalProperties#ui..terminalCombocxx . . $ Ui_TerminalPropertiesClass#terminalCombo.->currentTextcxx . . $ QComboBox#currentText(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).() |
| 82 | <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). sysgText; |
| 83 | if (uicxx . . $ TerminalProperties#ui..groupNamecxx . . $ Ui_TerminalPropertiesClass#groupName.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().lengthcxx . . $ QString#length(455f465bc33b4cdf).() == 0) |
| 84 | { |
| 85 | newLineBuff <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " *"; |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | newLineBuff <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). uicxx . . $ TerminalProperties#ui..groupNamecxx . . $ Ui_TerminalPropertiesClass#groupName.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).(); |
| 90 | } |
| 91 | newLineBuff <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). ip +cxx . . $ std/operator+(40fc1db9226233c6). "\n"; |
| 92 | hOutDebugcxx . . $ `HercStudio/HerculesStudio.h:49:9`!(3,"terminal: new line:" << newLineBuff.str() |
| 93 | << " " << &mLine); |
| 94 | mLinecxx . . $ GenericDeviceProperties#mLine..replaceLinecxx . . $ ConfigLine#replaceLine(9c546c94e5fcce4e).(newLineBuff.strcxx . . $ std/__cxx11/basic_stringstream#str(d33e1a6fd36255f7).()); |
| 95 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! updateLinecxx . . $ TerminalProperties#updateLine(b45ddcbc8423892c).(true); |
| 96 | this->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 97 | } |
| 98 | |
| 99 | bool TerminalPropertiescxx . . $ TerminalProperties#::isSysgcxx . . $ TerminalProperties#isSysg(c9857a73d68e59ba).() |
| 100 | { |
| 101 | return false; |
| 102 | } |
| 103 | |
| 104 | void TerminalPropertiescxx . . $ TerminalProperties#::cancelcxx . . $ TerminalProperties#cancel(49f6e7a06ebc5aa8).() |
| 105 | { |
| 106 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! updateLinecxx . . $ TerminalProperties#updateLine(b45ddcbc8423892c).(false); |
| 107 | this->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 108 | } |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 |