| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2009 by The qGo Project * |
| 3 | * * |
| 4 | * This file is part of qGo. * |
| 5 | * * |
| 6 | * qGo is free software: you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
| 9 | * (at your option) any later version. * |
| 10 | * * |
| 11 | * This program is distributed in the hope that it will be useful, * |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 | * GNU General Public License for more details. * |
| 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/> * |
| 18 | * or write to the Free Software Foundation, Inc., * |
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | |
| 23 | #include <QtWidgets> |
| 24 | #include "login.h"cxx . . $ `<file>/src/network/login.h`/ |
| 25 | #include "host.h"cxx . . $ `<file>/src/host.h`/ |
| 26 | #include "network/igsconnection.h"cxx . . $ `<file>/src/network/igsconnection.h`/ |
| 27 | #include "network/wing.h"cxx . . $ `<file>/src/network/wing.h`/ |
| 28 | #include "network/lgs.h"cxx . . $ `<file>/src/network/lgs.h`/ |
| 29 | #include "network/cyberoroconnection.h"cxx . . $ `<file>/src/network/cyberoroconnection.h`/ |
| 30 | #include "network/tygemconnection.h"cxx . . $ `<file>/src/network/tygemconnection.h`/ |
| 31 | #include "network/eweiqiconnection.h"cxx . . $ `<file>/src/network/eweiqiconnection.h`/ |
| 32 | #include "network/tomconnection.h"cxx . . $ `<file>/src/network/tomconnection.h`/ |
| 33 | #include "connectionwidget.h"cxx . . $ `<file>/src/connectionwidget.h`/ |
| 34 | |
| 35 | const char * connectionTypeStringcxx . . $ connectionTypeString.[] = {"IGS", "WING", "LGS", "CyberORO", "Tygem", "eWeiQi", "Tom", |
| 36 | "Default", "None", "Unknown", |
| 37 | "NNGS", "CTN", "CWS",}; |
| 38 | |
| 39 | enum CredentialTableColumncxx . . $ CredentialTableColumn# { CRED_PROTOCOLcxx . . $ CRED_PROTOCOL., CRED_HOSTNAMEcxx . . $ CRED_HOSTNAME., CRED_PORTcxx . . $ CRED_PORT., CRED_USERNAMEcxx . . $ CRED_USERNAME., CRED_PASSWORDcxx . . $ CRED_PASSWORD., CRED_NUMITEMScxx . . $ CRED_NUMITEMS. }; |
| 40 | |
| 41 | CredentialTableModelcxx . . $ CredentialTableModel#::CredentialTableModelcxx . . $ CredentialTableModel#CredentialTableModel(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent) |
| 42 | : QAbstractTableModelcxx . . $ QAbstractTableModel#(parent) |
| 43 | { |
| 44 | editablecxx . . $ CredentialTableModel#editable. = true; |
| 45 | loadCredentialscxx . . $ CredentialTableModel#loadCredentials(49f6e7a06ebc5aa8).(); |
| 46 | } |
| 47 | |
| 48 | CredentialTableModelcxx . . $ CredentialTableModel#::~cxx . . $ CredentialTableModel#`~CredentialTableModel`(ced63f7c635d850d).CredentialTableModelcxx . . $ CredentialTableModel#() {} |
| 49 | |
| 50 | int CredentialTableModelcxx . . $ CredentialTableModel#::rowCountcxx . . $ CredentialTableModel#rowCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &) const |
| 51 | { |
| 52 | return credentialscxx . . $ CredentialTableModel#credentials..sizecxx . . $ QList#size(ea6fe5115c70a13f).(); |
| 53 | } |
| 54 | |
| 55 | int CredentialTableModelcxx . . $ CredentialTableModel#::columnCountcxx . . $ CredentialTableModel#columnCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &) const |
| 56 | { |
| 57 | return CRED_NUMITEMScxx . . $ CRED_NUMITEMS.; |
| 58 | } |
| 59 | |
| 60 | QModelIndexcxx . . $ QModelIndex# CredentialTableModelcxx . . $ CredentialTableModel#::indexcxx . . $ CredentialTableModel#index(37dbccf64c4e392). ( int row, int column, const QModelIndexcxx . . $ QModelIndex# &) const |
| 61 | { |
| 62 | return createIndexcxx . . $ QAbstractItemModel#createIndex(ec74543ca13990c5).(row,column); |
| 63 | } |
| 64 | |
| 65 | QVariantcxx . . $ QVariant# CredentialTableModelcxx . . $ CredentialTableModel#::datacxx . . $ CredentialTableModel#data(69b5b18a001c0029).(const QModelIndexcxx . . $ QModelIndex# &index, int role) const |
| 66 | { |
| 67 | if(!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) |
| 68 | return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 69 | if ((role != Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) && (role != Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.)) |
| 70 | return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 71 | switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) |
| 72 | { |
| 73 | case CRED_PROTOCOLcxx . . $ CRED_PROTOCOL.: |
| 74 | if (role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) |
| 75 | return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).(connectionTypeStringcxx . . $ connectionTypeString.[int(credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()].typecxx . . $ ConnectionCredentials#type.)]); |
| 76 | else |
| 77 | return QVariantcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).(int(credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()].typecxx . . $ ConnectionCredentials#type.)); |
| 78 | case CRED_HOSTNAMEcxx . . $ CRED_HOSTNAME.: |
| 79 | return credentialscxx . . $ QVariant#QVariant(3520e46b33348bf6).[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()].hostNamecxx . . $ ConnectionCredentials#hostName.; |
| 80 | case CRED_PORTcxx . . $ CRED_PORT.: |
| 81 | return QVariantcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).(credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()].portcxx . . $ ConnectionCredentials#port.); |
| 82 | case CRED_USERNAMEcxx . . $ CRED_USERNAME.: |
| 83 | return credentialscxx . . $ QVariant#QVariant(3520e46b33348bf6).[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()].userNamecxx . . $ ConnectionCredentials#userName.; |
| 84 | case CRED_PASSWORDcxx . . $ CRED_PASSWORD.: |
| 85 | if ((role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) && ( ! credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()].passwordcxx . . $ ConnectionCredentials#password..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() )) |
| 86 | return QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).::fromUtf8cxx . . $ QString#fromUtf8(5ac70cc0fa2a874e).( "\u2022\u2022\u2022\u2022\u2022" ); |
| 87 | else |
| 88 | return credentialscxx . . $ QVariant#QVariant(3520e46b33348bf6).[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()].passwordcxx . . $ ConnectionCredentials#password.; |
| 89 | default: |
| 90 | return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | QVariantcxx . . $ QVariant# CredentialTableModelcxx . . $ CredentialTableModel#::headerDatacxx . . $ CredentialTableModel#headerData(b8cfec0985494997).(int section, Qtcxx . . $ Qt/::Orientationcxx . . $ Qt/Orientation# orientation, int role) const |
| 95 | { |
| 96 | if(orientation == Qtcxx . . $ Qt/::Horizontalcxx . . $ Qt/Horizontal. && role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) |
| 97 | switch(section) |
| 98 | { |
| 99 | case CRED_PROTOCOLcxx . . $ CRED_PROTOCOL.: |
| 100 | return QVariantcxx . . $ QVariant#QVariant(85c52e162fed56f9).("Protocol"); |
| 101 | case CRED_HOSTNAMEcxx . . $ CRED_HOSTNAME.: |
| 102 | return QVariantcxx . . $ QVariant#QVariant(85c52e162fed56f9).("Hostname"); |
| 103 | case CRED_PORTcxx . . $ CRED_PORT.: |
| 104 | return QVariantcxx . . $ QVariant#QVariant(85c52e162fed56f9).("Port"); |
| 105 | case CRED_USERNAMEcxx . . $ CRED_USERNAME.: |
| 106 | return QVariantcxx . . $ QVariant#QVariant(85c52e162fed56f9).("Username"); |
| 107 | case CRED_PASSWORDcxx . . $ CRED_PASSWORD.: |
| 108 | return QVariantcxx . . $ QVariant#QVariant(85c52e162fed56f9).("Password"); |
| 109 | } |
| 110 | return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 111 | } |
| 112 | |
| 113 | Qtcxx . . $ Qt/::ItemFlagscxx . . $ Qt/ItemFlags# CredentialTableModelcxx . . $ CredentialTableModel#::flagscxx . . $ CredentialTableModel#flags(36b38c1b3d3f7b45).(const QModelIndexcxx . . $ QModelIndex# &) const |
| 114 | { |
| 115 | if (editablecxx . . $ CredentialTableModel#editable.) |
| 116 | return Qtcxx . . $ Qt/::ItemIsEnabledcxx . . $ Qt/ItemIsEnabled. |cxx . . $ Qt/`operator|`(bcda3d535fff4cd0). Qtcxx . . $ Qt/::ItemIsEditablecxx . . $ Qt/ItemIsEditable.; |
| 117 | else |
| 118 | return Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::ItemIsEnabledcxx . . $ Qt/ItemIsEnabled.; |
| 119 | } |
| 120 | |
| 121 | bool CredentialTableModelcxx . . $ CredentialTableModel#::setDatacxx . . $ CredentialTableModel#setData(6d1d8401440d0a2c).(const QModelIndexcxx . . $ QModelIndex# & index, const QVariantcxx . . $ QVariant# & value, int role) |
| 122 | { |
| 123 | int row = index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).(); |
| 124 | int column = index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).(); |
| 125 | if ((row < 0) || (row >= credentialscxx . . $ CredentialTableModel#credentials..sizecxx . . $ QList#size(ea6fe5115c70a13f).()) || (role != Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.)) |
| 126 | return false; |
| 127 | |
| 128 | bool ok; |
| 129 | int val; |
| 130 | switch (column) |
| 131 | { |
| 132 | case CRED_PROTOCOLcxx . . $ CRED_PROTOCOL.: |
| 133 | val = value.toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(& ok); |
| 134 | if ((!ok) || (val<0) || (val >= int(TypeDEFAULTcxx . . $ TypeDEFAULT.))) |
| 135 | return false; |
| 136 | credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).row].typecxx . . $ ConnectionCredentials#type. = ConnectionTypecxx . . $ ConnectionType#(val); |
| 137 | break; |
| 138 | case CRED_HOSTNAMEcxx . . $ CRED_HOSTNAME.: |
| 139 | credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).row].hostNamecxx . . $ ConnectionCredentials#hostName. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 140 | break; |
| 141 | case CRED_PORTcxx . . $ CRED_PORT.: |
| 142 | val = value.toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(& ok); |
| 143 | if ((!ok) || (val<0) || (val > 0xFFFF)) |
| 144 | return false; |
| 145 | credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).row].portcxx . . $ ConnectionCredentials#port. = (qint16cxx . . $ qint16#)val; |
| 146 | break; |
| 147 | case CRED_USERNAMEcxx . . $ CRED_USERNAME.: |
| 148 | credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).row].userNamecxx . . $ ConnectionCredentials#userName. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 149 | break; |
| 150 | case CRED_PASSWORDcxx . . $ CRED_PASSWORD.: |
| 151 | credentialscxx . . $ CredentialTableModel#credentials.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).row].passwordcxx . . $ ConnectionCredentials#password. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 152 | break; |
| 153 | default: |
| 154 | return false; |
| 155 | } |
| 156 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! dataChangedcxx . . $ QAbstractItemModel#dataChanged(ae8a85c811f0c28a).(index,index); |
| 157 | return true; |
| 158 | } |
| 159 | |
| 160 | bool CredentialTableModelcxx . . $ CredentialTableModel#::removeRowscxx . . $ CredentialTableModel#removeRows(c4e00837c4ba3150).(int row, int count, const QModelIndexcxx . . $ QModelIndex# &) |
| 161 | { |
| 162 | beginRemoveRowscxx . . $ QAbstractItemModel#beginRemoveRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(),row,row+count-1); |
| 163 | for(;count>0;count--) |
| 164 | credentialscxx . . $ CredentialTableModel#credentials..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(row); |
| 165 | endRemoveRowscxx . . $ QAbstractItemModel#endRemoveRows(49f6e7a06ebc5aa8).(); |
| 166 | return true; |
| 167 | } |
| 168 | |
| 169 | |
| 170 | void CredentialTableModelcxx . . $ CredentialTableModel#::addCredentialcxx . . $ CredentialTableModel#addCredential(231cf4fc7da7cd6f).(ConnectionCredentialscxx . . $ ConnectionCredentials# cred) |
| 171 | { |
| 172 | int row = credentialscxx . . $ CredentialTableModel#credentials..sizecxx . . $ QList#size(ea6fe5115c70a13f).(); |
| 173 | beginInsertRowscxx . . $ QAbstractItemModel#beginInsertRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(),row,row); |
| 174 | credentialscxx . . $ CredentialTableModel#credentials..appendcxx . . $ QList#append(77d9f17553126ecb).(cred); |
| 175 | endInsertRowscxx . . $ QAbstractItemModel#endInsertRows(49f6e7a06ebc5aa8).(); |
| 176 | } |
| 177 | |
| 178 | void CredentialTableModelcxx . . $ CredentialTableModel#::loadCredentialscxx . . $ CredentialTableModel#loadCredentials(49f6e7a06ebc5aa8).(void) |
| 179 | { |
| 180 | QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).; |
| 181 | int size = settings.beginReadArraycxx . . $ QSettings#beginReadArray(645d6210e0be3a78).("CREDENTIALS"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 182 | for (int i = 0; i < size; ++i) |
| 183 | { |
| 184 | settings.setArrayIndexcxx . . $ QSettings#setArrayIndex(d4f767463ce0a6b3).(i); |
| 185 | int j = 0; |
| 186 | for (;j < int(TypeDEFAULTcxx . . $ TypeDEFAULT.); j++) |
| 187 | { |
| 188 | if (settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("type"cxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). QStringcxx . . $ QString#QString(85c52e162fed56f9).(connectionTypeStringcxx . . $ connectionTypeString.[j])) |
| 189 | break; |
| 190 | } |
| 191 | if (j == int(TypeDEFAULTcxx . . $ TypeDEFAULT.)) |
| 192 | break; |
| 193 | // We should probably do some sanity checks here |
| 194 | // although this is all user-changeable in the GUI, so bad values should be handled gracefully |
| 195 | credentialscxx . . $ CredentialTableModel#credentials..appendcxx . . $ QList#append(77d9f17553126ecb).(ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).((ConnectionTypecxx . . $ ConnectionType#)(j), |
| 196 | settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("host"cxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(), |
| 197 | (qint16cxx . . $ qint16#)(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("port"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()), |
| 198 | settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("user"cxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(), |
| 199 | settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("password"cxx . . $ QString#QString(85c52e162fed56f9).).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).())); |
| 200 | } |
| 201 | settings.endArraycxx . . $ QSettings#endArray(49f6e7a06ebc5aa8).(); |
| 202 | } |
| 203 | |
| 204 | void CredentialTableModelcxx . . $ CredentialTableModel#::saveCredentialscxx . . $ CredentialTableModel#saveCredentials(49f6e7a06ebc5aa8).(void) |
| 205 | { |
| 206 | QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).; |
| 207 | settings.beginWriteArraycxx . . $ QSettings#beginWriteArray(29ed8fcd127906b1).("CREDENTIALS"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 208 | for (int i = 0; i < credentialscxx . . $ CredentialTableModel#credentials..sizecxx . . $ QList#size(ea6fe5115c70a13f).(); ++i) |
| 209 | { |
| 210 | settings.setArrayIndexcxx . . $ QSettings#setArrayIndex(d4f767463ce0a6b3).(i); |
| 211 | settings.setValuecxx . . $ QSettings#setValue(1c60a90c724e6bfb).("type"cxx . . $ QString#QString(85c52e162fed56f9)., connectionTypeStringcxx . . $ QVariant#QVariant(85c52e162fed56f9).[credentialscxx . . $ CredentialTableModel#credentials..atcxx . . $ QList#at(e2681f9bb6b2f357).(i).typecxx . . $ ConnectionCredentials#type.]); |
| 212 | settings.setValuecxx . . $ QSettings#setValue(1c60a90c724e6bfb).("host"cxx . . $ QString#QString(85c52e162fed56f9)., credentialscxx . . $ QVariant#QVariant(3520e46b33348bf6)..atcxx . . $ QList#at(e2681f9bb6b2f357).(i).hostNamecxx . . $ ConnectionCredentials#hostName.); |
| 213 | settings.setValuecxx . . $ QSettings#setValue(1c60a90c724e6bfb).("port"cxx . . $ QString#QString(85c52e162fed56f9)., credentialscxx . . $ QVariant#QVariant(d4f767463ce0a6b3)..atcxx . . $ QList#at(e2681f9bb6b2f357).(i).portcxx . . $ ConnectionCredentials#port.); |
| 214 | settings.setValuecxx . . $ QSettings#setValue(1c60a90c724e6bfb).("user"cxx . . $ QString#QString(85c52e162fed56f9)., credentialscxx . . $ QVariant#QVariant(3520e46b33348bf6)..atcxx . . $ QList#at(e2681f9bb6b2f357).(i).userNamecxx . . $ ConnectionCredentials#userName.); |
| 215 | settings.setValuecxx . . $ QSettings#setValue(1c60a90c724e6bfb).("password"cxx . . $ QString#QString(85c52e162fed56f9)., credentialscxx . . $ QVariant#QVariant(3520e46b33348bf6)..atcxx . . $ QList#at(e2681f9bb6b2f357).(i).passwordcxx . . $ ConnectionCredentials#password.); |
| 216 | } |
| 217 | settings.endArraycxx . . $ QSettings#endArray(49f6e7a06ebc5aa8).(); |
| 218 | |
| 219 | } |
| 220 | |
| 221 | ComboBoxDelegatecxx . . $ ComboBoxDelegate#::ComboBoxDelegatecxx . . $ ComboBoxDelegate#ComboBoxDelegate(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent) |
| 222 | : QStyledItemDelegatecxx . . $ QStyledItemDelegate#(parent) |
| 223 | { |
| 224 | } |
| 225 | |
| 226 | QWidgetcxx . . $ QWidget# *ComboBoxDelegatecxx . . $ ComboBoxDelegate#::createEditorcxx . . $ ComboBoxDelegate#createEditor(f2c7e294f1841167).(QWidgetcxx . . $ QWidget# *parent, |
| 227 | const QStyleOptionViewItemcxx . . $ QStyleOptionViewItem# &/* option */, |
| 228 | const QModelIndexcxx . . $ QModelIndex# &/* index */) const |
| 229 | { |
| 230 | QComboBoxcxx . . $ QComboBox# *editor = new QComboBoxcxx . . $ QComboBox#(parent); |
| 231 | for (int i=0; i <= (int)TypeDEFAULTcxx . . $ TypeDEFAULT.; i++) |
| 232 | editor->addItemcxx . . $ QComboBox#addItem(1c60a90c724e6bfb).(connectionTypeStringcxx . . $ QString#QString(85c52e162fed56f9).[i]); |
| 233 | return editor; |
| 234 | } |
| 235 | |
| 236 | void ComboBoxDelegatecxx . . $ ComboBoxDelegate#::setEditorDatacxx . . $ ComboBoxDelegate#setEditorData(bb3f73f852642966).(QWidgetcxx . . $ QWidget# *editor, |
| 237 | const QModelIndexcxx . . $ QModelIndex# &index) const |
| 238 | { |
| 239 | int value = index.modelcxx . . $ QModelIndex#model(9e8e94cc3b959740).()->datacxx . . $ QAbstractItemModel#data(69b5b18a001c0029).(index, Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 240 | |
| 241 | QComboBoxcxx . . $ QComboBox# *comboBox = static_cast<QComboBoxcxx . . $ QComboBox#*>(editor); |
| 242 | comboBox->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(value); |
| 243 | } |
| 244 | |
| 245 | void ComboBoxDelegatecxx . . $ ComboBoxDelegate#::setModelDatacxx . . $ ComboBoxDelegate#setModelData(3e66fac4f8e72d1b).(QWidgetcxx . . $ QWidget# *editor, QAbstractItemModelcxx . . $ QAbstractItemModel# *model, |
| 246 | const QModelIndexcxx . . $ QModelIndex# &index) const |
| 247 | { |
| 248 | QComboBoxcxx . . $ QComboBox# *comboBox = static_cast<QComboBoxcxx . . $ QComboBox#*>(editor); |
| 249 | |
| 250 | model->setDatacxx . . $ QAbstractItemModel#setData(6d1d8401440d0a2c).(index, comboBoxcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).(), Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.); |
| 251 | } |
| 252 | |
| 253 | void ComboBoxDelegatecxx . . $ ComboBoxDelegate#::updateEditorGeometrycxx . . $ ComboBoxDelegate#updateEditorGeometry(8e076d6424181c8e).(QWidgetcxx . . $ QWidget# *editor, |
| 254 | const QStyleOptionViewItemcxx . . $ QStyleOptionViewItem# &option, const QModelIndexcxx . . $ QModelIndex# &/* index */) const |
| 255 | { |
| 256 | editor->setGeometrycxx . . $ QWidget#setGeometry(22ba0428947158b).(option.rectcxx . . $ QStyleOption#rect.); |
| 257 | } |
| 258 | |
| 259 | LoginDialogcxx . . $ LoginDialog#::LoginDialogcxx . . $ LoginDialog#LoginDialog(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent) |
| 260 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent) |
| 261 | { |
| 262 | uicxx . . $ LoginDialog#ui..setupUicxx . . $ Ui_LoginDialog#setupUi(d194de0c0f68c28b).(this); |
| 263 | newCredMenucxx . . $ LoginDialog#newCredMenu. = new QMenucxx . . $ QMenu#QMenu(90d5708627041e22).("New credentials..."cxx . . $ QString#QString(85c52e162fed56f9).,this); |
| 264 | newCredMenucxx . . $ LoginDialog#newCredMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).((QActioncxx . . $ QAction#*)(new NewCredentialsActioncxx . . $ NewCredentialsAction#(QStringcxx . . $ QString#QString(85c52e162fed56f9).("IGS"),ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).(TypeIGScxx . . $ TypeIGS.,"igs.joyjoy.net"cxx . . $ QString#QString(85c52e162fed56f9)., 7777,""cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).),(QObjectcxx . . $ QObject#*)this))); |
| 265 | newCredMenucxx . . $ LoginDialog#newCredMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).((QActioncxx . . $ QAction#*)(new NewCredentialsActioncxx . . $ NewCredentialsAction#(QStringcxx . . $ QString#QString(85c52e162fed56f9).("WING"),ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).(TypeWINGcxx . . $ TypeWING.,"wing.gr.jp"cxx . . $ QString#QString(85c52e162fed56f9)., 1515,""cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).),(QObjectcxx . . $ QObject#*)this))); |
| 266 | newCredMenucxx . . $ LoginDialog#newCredMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).((QActioncxx . . $ QAction#*)(new NewCredentialsActioncxx . . $ NewCredentialsAction#(QStringcxx . . $ QString#QString(85c52e162fed56f9).("LGS"),ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).(TypeLGScxx . . $ TypeLGS.,"lgs.taiwango.net"cxx . . $ QString#QString(85c52e162fed56f9)., 9696,""cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).),(QObjectcxx . . $ QObject#*)this))); |
| 267 | newCredMenucxx . . $ LoginDialog#newCredMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).((QActioncxx . . $ QAction#*)(new NewCredentialsActioncxx . . $ NewCredentialsAction#(QStringcxx . . $ QString#QString(85c52e162fed56f9).("CyberORO"),ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).(TypeOROcxx . . $ TypeORO.,"211.38.95.221"cxx . . $ QString#QString(85c52e162fed56f9)., 7447,""cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).),(QObjectcxx . . $ QObject#*)this))); |
| 268 | newCredMenucxx . . $ LoginDialog#newCredMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).((QActioncxx . . $ QAction#*)(new NewCredentialsActioncxx . . $ NewCredentialsAction#(QStringcxx . . $ QString#QString(85c52e162fed56f9).("Tygem"),ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).(TypeTYGEMcxx . . $ TypeTYGEM.,"121.189.9.52"cxx . . $ QString#QString(85c52e162fed56f9)., 80,""cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).),(QObjectcxx . . $ QObject#*)this))); |
| 269 | newCredMenucxx . . $ LoginDialog#newCredMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).((QActioncxx . . $ QAction#*)(new NewCredentialsActioncxx . . $ NewCredentialsAction#(QStringcxx . . $ QString#QString(85c52e162fed56f9).("eWeiQi"),ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).(TypeEWEIQIcxx . . $ TypeEWEIQI.,"121.189.9.52"cxx . . $ QString#QString(85c52e162fed56f9)., 80,""cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).),(QObjectcxx . . $ QObject#*)this))); |
| 270 | newCredMenucxx . . $ LoginDialog#newCredMenu.->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).((QActioncxx . . $ QAction#*)(new NewCredentialsActioncxx . . $ NewCredentialsAction#(QStringcxx . . $ QString#QString(85c52e162fed56f9).("Tom"),ConnectionCredentialscxx . . $ ConnectionCredentials#ConnectionCredentials(6b53b78f53fed4f4).(TypeTOMcxx . . $ TypeTOM.,"61.135.158.147"cxx . . $ QString#QString(85c52e162fed56f9)., 80,""cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QString#QString(85c52e162fed56f9).),(QObjectcxx . . $ QObject#*)this))); |
| 271 | credModelcxx . . $ LoginDialog#credModel. = new CredentialTableModelcxx . . $ CredentialTableModel#(this); |
| 272 | slot_toggleEditablecxx . . $ LoginDialog#slot_toggleEditable(49f6e7a06ebc5aa8).(); // Sets "editable" to false |
| 273 | uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->setModelcxx . . $ QTableView#setModel(c6e1f1e42522b780).((QAbstractTableModelcxx . . $ QAbstractTableModel#*)credModelcxx . . $ LoginDialog#credModel.); |
| 274 | uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->setSelectionModecxx . . $ QAbstractItemView#setSelectionMode(92c48cbe05de0e90).(QAbstractItemViewcxx . . $ QAbstractItemView#::SingleSelectioncxx . . $ QAbstractItemView#SingleSelection.); |
| 275 | uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->setSelectionBehaviorcxx . . $ QAbstractItemView#setSelectionBehavior(3a606fd1f72e340).(QAbstractItemViewcxx . . $ QAbstractItemView#::SelectRowscxx . . $ QAbstractItemView#SelectRows.); |
| 276 | uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->setItemDelegateForColumncxx . . $ QAbstractItemView#setItemDelegateForColumn(21e833539585089).(0,new ComboBoxDelegatecxx . . $ ComboBoxDelegate#(this)); |
| 277 | uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868).(CRED_PROTOCOLcxx . . $ CRED_PROTOCOL.,80); |
| 278 | uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868).(CRED_PORTcxx . . $ CRED_PORT.,50); |
| 279 | connectcxx . . $ QObject#connect(835f87066c895669).(uicxx . . $ LoginDialog#ui..editButtoncxx . . $ Ui_LoginDialog#editButton., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., this, &LoginDialogcxx . . $ LoginDialog#::slot_toggleEditablecxx . . $ LoginDialog#slot_toggleEditable(49f6e7a06ebc5aa8).); |
| 280 | connectcxx . . $ QObject#connect(835f87066c895669).(uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView., &QTableViewcxx . . $ QTableView#::activatedcxx . . $ QAbstractItemView#activated(87a6de385263c395)., this, &LoginDialogcxx . . $ LoginDialog#::slot_connectcxx . . $ LoginDialog#slot_connect(58b98458fece0954).); |
| 281 | connectcxx . . $ QObject#connect(835f87066c895669).(newCredMenucxx . . $ LoginDialog#newCredMenu., &QMenucxx . . $ QMenu#::triggeredcxx . . $ QMenu#triggered(92b1e80c0a7f1406)., this, &LoginDialogcxx . . $ LoginDialog#::slot_newCredentialcxx . . $ LoginDialog#slot_newCredential(92b1e80c0a7f1406).); |
| 282 | uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->setContextMenuPolicycxx . . $ QWidget#setContextMenuPolicy(de0fa9f0eb4c7210).(Qtcxx . . $ Qt/::CustomContextMenucxx . . $ Qt/CustomContextMenu.); |
| 283 | connectcxx . . $ QObject#connect(835f87066c895669).(uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView., &QTableViewcxx . . $ QTableView#::customContextMenuRequestedcxx . . $ QWidget#customContextMenuRequested(4f9e9534be445c03)., this, &LoginDialogcxx . . $ LoginDialog#::slot_showPopupcxx . . $ LoginDialog#slot_showPopup(4f9e9534be445c03).); |
| 284 | } |
| 285 | |
| 286 | LoginDialogcxx . . $ LoginDialog#::~cxx . . $ LoginDialog#`~LoginDialog`(ced63f7c635d850d).LoginDialogcxx . . $ LoginDialog#() |
| 287 | { |
| 288 | delete newCredMenucxx . . $ LoginDialog#newCredMenu.; |
| 289 | delete credModelcxx . . $ LoginDialog#credModel.; |
| 290 | } |
| 291 | |
| 292 | void LoginDialogcxx . . $ LoginDialog#::slot_connectcxx . . $ LoginDialog#slot_connect(58b98458fece0954).(QModelIndexcxx . . $ QModelIndex# index) |
| 293 | { |
| 294 | if(credModelcxx . . $ LoginDialog#credModel.->editablecxx . . $ CredentialTableModel#editable.) |
| 295 | return; |
| 296 | |
| 297 | int row = index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).(); |
| 298 | if ( credModelcxx . . $ LoginDialog#credModel.->credentialscxx . . $ CredentialTableModel#credentials..atcxx . . $ QList#at(e2681f9bb6b2f357).(row).userNamecxx . . $ ConnectionCredentials#userName..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() ) |
| 299 | { |
| 300 | QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(this, trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Empty Login"), trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("You must enter a username")); |
| 301 | return; |
| 302 | } |
| 303 | |
| 304 | this->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 305 | /* Here a possibility to cancel the connection |
| 306 | * while it is being created could be provided using |
| 307 | * void NetworkConnection::slot_cancelConnecting(void) */ |
| 308 | |
| 309 | //if(ui.connectPB->isDown()) //wth? unreliable? |
| 310 | |
| 311 | connectioncxx . . $ LoginDialog#connection. = newConnectioncxx . . $ LoginDialog#newConnection(e6435401577aa8ae).(credModelcxx . . $ LoginDialog#credModel.->credentialscxx . . $ CredentialTableModel#credentials..atcxx . . $ QList#at(e2681f9bb6b2f357).(row)); |
| 312 | connectcxx . . $ QObject#connect(835f87066c895669).(connectioncxx . . $ LoginDialog#connection., &NetworkConnectioncxx . . $ NetworkConnection#::stateChangedcxx . . $ NetworkConnection#stateChanged(41e728cff2b23034)., this, &LoginDialogcxx . . $ LoginDialog#::slot_receiveConnectionStatecxx . . $ LoginDialog#slot_receiveConnectionState(41e728cff2b23034).); |
| 313 | connectionWidgetcxx . . $ connectionWidget.->setNetworkConnectioncxx . . $ ConnectionWidget#setNetworkConnection(bdf7e61fb2b15626).(connectioncxx . . $ LoginDialog#connection.); |
| 314 | } |
| 315 | |
| 316 | void LoginDialogcxx . . $ LoginDialog#::slot_cancelcxx . . $ LoginDialog#slot_cancel(49f6e7a06ebc5aa8).(void) |
| 317 | { |
| 318 | if(connectioncxx . . $ LoginDialog#connection.) |
| 319 | connectioncxx . . $ LoginDialog#connection.->userCanceledcxx . . $ NetworkConnection#userCanceled(49f6e7a06ebc5aa8).(); |
| 320 | this->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 321 | rejectcxx . . $ QDialog#reject(49f6e7a06ebc5aa8).(); |
| 322 | } |
| 323 | |
| 324 | void LoginDialogcxx . . $ LoginDialog#::slot_toggleEditablecxx . . $ LoginDialog#slot_toggleEditable(49f6e7a06ebc5aa8).(void) |
| 325 | { |
| 326 | credModelcxx . . $ LoginDialog#credModel.->editablecxx . . $ CredentialTableModel#editable. = !(credModelcxx . . $ LoginDialog#credModel.->editablecxx . . $ CredentialTableModel#editable.); |
| 327 | if (credModelcxx . . $ LoginDialog#credModel.->editablecxx . . $ CredentialTableModel#editable.) |
| 328 | { |
| 329 | uicxx . . $ LoginDialog#ui..editButtoncxx . . $ Ui_LoginDialog#editButton.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("&Save"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 330 | uicxx . . $ LoginDialog#ui..editLabelcxx . . $ Ui_LoginDialog#editLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).("Right click to edit"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 331 | } else { |
| 332 | uicxx . . $ LoginDialog#ui..editButtoncxx . . $ Ui_LoginDialog#editButton.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("&Edit"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 333 | uicxx . . $ LoginDialog#ui..editLabelcxx . . $ Ui_LoginDialog#editLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).); |
| 334 | uicxx . . $ LoginDialog#ui..editLabelcxx . . $ Ui_LoginDialog#editLabel.->repaintcxx . . $ QWidget#repaint(49f6e7a06ebc5aa8).(); |
| 335 | credModelcxx . . $ LoginDialog#credModel.->saveCredentialscxx . . $ CredentialTableModel#saveCredentials(49f6e7a06ebc5aa8).(); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | void LoginDialogcxx . . $ LoginDialog#::slot_newCredentialcxx . . $ LoginDialog#slot_newCredential(92b1e80c0a7f1406).(QActioncxx . . $ QAction# *action) |
| 340 | { |
| 341 | credModelcxx . . $ LoginDialog#credModel.->addCredentialcxx . . $ CredentialTableModel#addCredential(231cf4fc7da7cd6f).(((NewCredentialsActioncxx . . $ NewCredentialsAction#*)action)->credcxx . . $ NewCredentialsAction#cred.); |
| 342 | } |
| 343 | |
| 344 | void LoginDialogcxx . . $ LoginDialog#::slot_showPopupcxx . . $ LoginDialog#slot_showPopup(4f9e9534be445c03).(const QPointcxx . . $ QPoint# & iPoint) |
| 345 | { |
| 346 | if (!credModelcxx . . $ LoginDialog#credModel.->editablecxx . . $ CredentialTableModel#editable.) |
| 347 | return; |
| 348 | popup_itemcxx . . $ LoginDialog#popup_item. =cxx . . $ QModelIndex#`operator=`(4665afb3441ab1ca). uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->indexAtcxx . . $ QTableView#indexAt(90c2c28d33eadf46).(iPoint); |
| 349 | QMenucxx . . $ QMenu# menucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.); |
| 350 | QActioncxx . . $ QAction# * deleteAction = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Delete"), 0); |
| 351 | menu.addMenucxx . . $ QMenu#addMenu(e6260eb8882b953).(newCredMenucxx . . $ LoginDialog#newCredMenu.); |
| 352 | if (popup_itemcxx . . $ LoginDialog#popup_item. !=cxx . . $ QModelIndex#`operator!=`(c401e435e302c57b). QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).()) |
| 353 | { |
| 354 | connectcxx . . $ QObject#connect(835f87066c895669).(deleteAction, &QActioncxx . . $ QAction#::triggeredcxx . . $ QAction#triggered(b45ddcbc8423892c)., this, &LoginDialogcxx . . $ LoginDialog#::slot_deleteCredentialcxx . . $ LoginDialog#slot_deleteCredential(49f6e7a06ebc5aa8).); |
| 355 | menu.addSeparatorcxx . . $ QMenu#addSeparator(a590eff9f1ec9a95).(); |
| 356 | menu.addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(deleteAction); |
| 357 | } |
| 358 | |
| 359 | menu.execcxx . . $ QMenu#exec(2535b15b88c544d4).(uicxx . . $ LoginDialog#ui..credentialViewcxx . . $ Ui_LoginDialog#credentialView.->mapToGlobalcxx . . $ QWidget#mapToGlobal(1aa4d425351b0c99).(iPoint)); |
| 360 | delete deleteAction; |
| 361 | } |
| 362 | |
| 363 | void LoginDialogcxx . . $ LoginDialog#::slot_deleteCredentialcxx . . $ LoginDialog#slot_deleteCredential(49f6e7a06ebc5aa8).(void) |
| 364 | { |
| 365 | credModelcxx . . $ LoginDialog#credModel.->removeRowcxx . . $ QAbstractItemModel#removeRow(eb30e146838e644d).(popup_itemcxx . . $ LoginDialog#popup_item..rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()); |
| 366 | } |
| 367 | |
| 368 | void LoginDialogcxx . . $ LoginDialog#::slot_receiveConnectionStatecxx . . $ LoginDialog#slot_receiveConnectionState(41e728cff2b23034).(ConnectionStatecxx . . $ ConnectionState# newState) |
| 369 | { |
| 370 | switch(newState) |
| 371 | { |
| 372 | case Connectedcxx . . $ Connected.: |
| 373 | connectionWidgetcxx . . $ connectionWidget.->setupButtonscxx . . $ ConnectionWidget#setupButtons(49f6e7a06ebc5aa8).(); |
| 374 | connectionWidgetcxx . . $ connectionWidget.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 375 | this->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 376 | this->acceptcxx . . $ QDialog#accept(49f6e7a06ebc5aa8).(); |
| 377 | return; |
| 378 | case AuthFailedcxx . . $ AuthFailed.: |
| 379 | QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(this, trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Bad Login"), trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Invalid Login")); |
| 380 | break; |
| 381 | case PassFailedcxx . . $ PassFailed.: |
| 382 | QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(this, trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Bad Password"), trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Invalid Password")); |
| 383 | break; |
| 384 | case ProtocolErrorcxx . . $ ProtocolError.: |
| 385 | QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(this, trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Protocol Error"), trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("This may also result from wrong username or password")); |
| 386 | break; |
| 387 | case Canceledcxx . . $ Canceled.: |
| 388 | break; |
| 389 | case AlreadyLoggedIncxx . . $ AlreadyLoggedIn.: |
| 390 | QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(this, trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Already Logged In"), trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Are you logged in somewhere else?")); |
| 391 | break; |
| 392 | case ConnectionRefusedcxx . . $ ConnectionRefused.: |
| 393 | QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(this, trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Connection Refused"), trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Server may be down")); |
| 394 | break; |
| 395 | case HostNotFoundcxx . . $ HostNotFound.: |
| 396 | case SockTimeoutcxx . . $ SockTimeout.: |
| 397 | case UnknownErrorcxx . . $ UnknownError.: |
| 398 | QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(this, trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Can't connect"), trcxx . . $ LoginDialog#tr(75d9f1c324b4579d).("Can't connect to host!")); |
| 399 | break; |
| 400 | default: |
| 401 | return; // waiting |
| 402 | } |
| 403 | // Arrive here only in case of connection error |
| 404 | disconnectcxx . . $ QObject#disconnect(bacd0f9184cd8ee1).(connectioncxx . . $ LoginDialog#connection., &NetworkConnectioncxx . . $ NetworkConnection#::stateChangedcxx . . $ NetworkConnection#stateChanged(41e728cff2b23034)., this, &LoginDialogcxx . . $ LoginDialog#::slot_receiveConnectionStatecxx . . $ LoginDialog#slot_receiveConnectionState(41e728cff2b23034).); |
| 405 | connectionWidgetcxx . . $ connectionWidget.->setNetworkConnectioncxx . . $ ConnectionWidget#setNetworkConnection(bdf7e61fb2b15626).(0); |
| 406 | connectioncxx . . $ LoginDialog#connection.->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 407 | connectioncxx . . $ LoginDialog#connection. = 0; |
| 408 | this->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true); |
| 409 | } |
| 410 | |
| 411 | NetworkConnectioncxx . . $ NetworkConnection# * LoginDialogcxx . . $ LoginDialog#::newConnectioncxx . . $ LoginDialog#newConnection(e6435401577aa8ae).(ConnectionCredentialscxx . . $ ConnectionCredentials# cred) |
| 412 | { |
| 413 | switch(cred.typecxx . . $ ConnectionCredentials#type.) |
| 414 | { |
| 415 | case TypeIGScxx . . $ TypeIGS.: |
| 416 | return new IGSConnectioncxx . . $ IGSConnection#(cred); |
| 417 | case TypeOROcxx . . $ TypeORO.: |
| 418 | return new CyberOroConnectioncxx . . $ CyberOroConnection#(cred); |
| 419 | case TypeWINGcxx . . $ TypeWING.: |
| 420 | return new WingConnectioncxx . . $ WingConnection#(cred); |
| 421 | case TypeLGScxx . . $ TypeLGS.: |
| 422 | return new LGSConnectioncxx . . $ LGSConnection#(cred); |
| 423 | case TypeTYGEMcxx . . $ TypeTYGEM.: |
| 424 | return new TygemConnectioncxx . . $ TygemConnection#(cred); |
| 425 | case TypeEWEIQIcxx . . $ TypeEWEIQI.: |
| 426 | return new EWeiQiConnectioncxx . . $ EWeiQiConnection#(cred); |
| 427 | case TypeTOMcxx . . $ TypeTOM.: |
| 428 | return new TomConnectioncxx . . $ TomConnection#(cred); |
| 429 | default: |
| 430 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("LoginDialog::newConnection : Bad connection Type"); |
| 431 | // ERROR handling??? |
| 432 | return 0; |
| 433 | } |
| 434 | } |