Changeset 88 in ntrip for trunk/BNC/bnctabledlg.cpp


Ignore:
Timestamp:
Aug 31, 2006, 7:20:36 PM (18 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnctabledlg.cpp

    r83 r88  
    3131  QVBoxLayout* mainLayout = new QVBoxLayout(this);
    3232
    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"));
    3537  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
    4459  mainLayout->addLayout(editLayout);
    4560
     
    8196void bncTableDlg::slotGetTable() {
    8297
    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());
    88101
    89102  // Send the Request
    90103  // ----------------
    91104  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
    95107  if (!socket) {
    96108    QMessageBox::warning(0, "BNC", msg);
     
    163175  settings.setValue("casterHost", _casterHostLineEdit->text());
    164176  settings.setValue("casterPort", _casterPortLineEdit->text());
     177  settings.setValue("casterUser", _casterUserLineEdit->text());
     178  settings.setValue("casterPassword", _casterPasswordLineEdit->text());
    165179
    166180  QStringList* mountPoints = new QStringList;
     
    173187      if (_table->isItemSelected(item)) {
    174188        QUrl url;
     189        url.setUserName(_casterUserLineEdit->text());
     190        url.setPassword(_casterPasswordLineEdit->text());
    175191        url.setHost(_casterHostLineEdit->text());
    176192        url.setPort(_casterPortLineEdit->text().toInt());
Note: See TracChangeset for help on using the changeset viewer.