Changeset 88 in ntrip for trunk/BNC/bnctabledlg.cpp
- Timestamp:
- Aug 31, 2006, 7:20:36 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnctabledlg.cpp
r83 r88 31 31 QVBoxLayout* mainLayout = new QVBoxLayout(this); 32 32 33 _casterHostLabel = new QLabel(tr("caster host")); 34 _casterPortLabel = new QLabel(tr("caster port")); 33 _casterHostLabel = new QLabel(tr("caster host")); 34 _casterPortLabel = new QLabel(tr("caster port")); 35 _casterUserLabel = new QLabel(tr("user")); 36 _casterPasswordLabel = new QLabel(tr("password")); 35 37 QSettings settings; 36 _casterHostLineEdit = new QLineEdit(settings.value("casterHost").toString()); 37 _casterPortLineEdit = new QLineEdit(settings.value("casterPort").toString()); 38 39 QHBoxLayout* editLayout = new QHBoxLayout; 40 editLayout->addWidget(_casterHostLabel); 41 editLayout->addWidget(_casterHostLineEdit); 42 editLayout->addWidget(_casterPortLabel); 43 editLayout->addWidget(_casterPortLineEdit); 38 _casterHostLineEdit = new QLineEdit(settings.value("casterHost").toString()); 39 int ww = QFontMetrics(_casterHostLineEdit->font()).width('w'); 40 _casterHostLineEdit->setMaximumWidth(18*ww); 41 _casterPortLineEdit = new QLineEdit(settings.value("casterPort").toString()); 42 _casterPortLineEdit->setMaximumWidth(9*ww); 43 _casterUserLineEdit = new QLineEdit(settings.value("casterUser").toString()); 44 _casterUserLineEdit->setMaximumWidth(9*ww); 45 _casterPasswordLineEdit = new QLineEdit(settings.value("casterPassword").toString()); 46 _casterPasswordLineEdit->setMaximumWidth(9*ww); 47 _casterPasswordLineEdit->setEchoMode(QLineEdit::Password); 48 49 QGridLayout* editLayout = new QGridLayout; 50 editLayout->addWidget(_casterHostLabel, 0, 0); 51 editLayout->addWidget(_casterHostLineEdit, 0, 1); 52 editLayout->addWidget(_casterPortLabel, 0, 2); 53 editLayout->addWidget(_casterPortLineEdit, 0, 3); 54 editLayout->addWidget(_casterUserLabel, 1, 0); 55 editLayout->addWidget(_casterUserLineEdit, 1, 1); 56 editLayout->addWidget(_casterPasswordLabel, 1, 2); 57 editLayout->addWidget(_casterPasswordLineEdit, 1, 3); 58 44 59 mainLayout->addLayout(editLayout); 45 60 … … 81 96 void bncTableDlg::slotGetTable() { 82 97 83 QString host = _casterHostLineEdit->text(); 84 int port = _casterPortLineEdit->text().toInt(); 85 QByteArray mountPoint = "/"; 86 QByteArray user; 87 QByteArray password; 98 QUrl url; 99 url.setHost(_casterHostLineEdit->text()); 100 url.setPort(_casterPortLineEdit->text().toInt()); 88 101 89 102 // Send the Request 90 103 // ---------------- 91 104 QString msg; 92 QTcpSocket* socket = bncGetThread::request(host, port, _proxyHost, 93 _proxyPort, mountPoint, 94 user, password, msg); 105 QTcpSocket* socket = bncGetThread::request(url, msg); 106 95 107 if (!socket) { 96 108 QMessageBox::warning(0, "BNC", msg); … … 163 175 settings.setValue("casterHost", _casterHostLineEdit->text()); 164 176 settings.setValue("casterPort", _casterPortLineEdit->text()); 177 settings.setValue("casterUser", _casterUserLineEdit->text()); 178 settings.setValue("casterPassword", _casterPasswordLineEdit->text()); 165 179 166 180 QStringList* mountPoints = new QStringList; … … 173 187 if (_table->isItemSelected(item)) { 174 188 QUrl url; 189 url.setUserName(_casterUserLineEdit->text()); 190 url.setPassword(_casterPasswordLineEdit->text()); 175 191 url.setHost(_casterHostLineEdit->text()); 176 192 url.setPort(_casterPortLineEdit->text().toInt());
Note:
See TracChangeset
for help on using the changeset viewer.