Changeset 752 in ntrip for trunk/BNS


Ignore:
Timestamp:
Mar 30, 2008, 3:39:17 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnsmain.cpp

    r749 r752  
    1717#include <unistd.h>
    1818#include <signal.h>
    19 #include <QApplication>
    2019#include <iostream>
    2120
     
    5049  QSettings settings;
    5150  if (settings.allKeys().size() == 0) {
    52     settings.setValue("casterHost", "www.euref-ip.net");
    53     settings.setValue("casterPort", 2101);
    5451  }
    5552
     
    5956  // ---------------------------------------
    6057  if (GUIenabled) {
    61 
    62     QString fontString = settings.value("font").toString();
    63     if ( !fontString.isEmpty() ) {
    64       QFont newFont;
    65       if (newFont.fromString(fontString)) {
    66         QApplication::setFont(newFont);
    67       }
    68     }
    69    
    70     app.setWindowIcon(QPixmap(":ntrip-logo.png"));
    71 
    7258    bnsWindow* bnsWin = new bnsWindow();
    7359    bnsWin->show();
  • trunk/BNS/bnswindow.cpp

    r750 r752  
    2727bnsWindow::bnsWindow() {
    2828
     29  QSettings settings;
     30
     31  QString fontString = settings.value("font").toString();
     32  if ( !fontString.isEmpty() ) {
     33    QFont newFont;
     34    if (newFont.fromString(fontString)) {
     35      this->setFont(newFont);
     36    }
     37  }
     38 
    2939  int ww = QFontMetrics(this->font()).width('w');
    30  
    3140  setMinimumSize(77*ww, 65*ww);
    32 
    3341  setWindowTitle(tr("BKG Ntrip Server (BNS) Version 1.0"));
     42  setWindowIcon(QPixmap(":ntrip-logo.png"));
    3443
    3544  // Create Actions
     
    6170  setCentralWidget(_canvas);
    6271
    63   QSettings settings;
     72  _ephHostLineEdit  = new QLineEdit(settings.value("ephHost").toString());
     73  _ephHostLineEdit->setWhatsThis(tr("Host for broadcast ephemeris (from BNC)"));
     74  _ephPortLineEdit  = new QLineEdit(settings.value("ephPort").toString());
     75  _ephPortLineEdit->setWhatsThis(tr("Port for broadcast ephemeris (from BNC)"));
     76  _ephPortLineEdit->setMaximumWidth(9*ww);
     77
    6478  _proxyHostLineEdit  = new QLineEdit(settings.value("proxyHost").toString());
    6579  _proxyHostLineEdit->setWhatsThis(tr("<p>If you are running BNS within a protected Local Area Network (LAN), you might need to use a proxy server to access the Internet. Enter your proxy server IP and port number in case one is operated in front of BNC. If you do not know the IP and port of your proxy server, check the proxy server settings in your Internet browser or ask your network administrator.</p><p>Note that IP streaming is sometimes not allowed in a LAN. In this case you need to ask your network administrator for an appropriate modification of the local security policy or for the installation of a TCP relay to the NTRIP broadcasters. If these are not possible, you might need to run BNC outside your LAN on a network that has unobstructed connection to the Internet.</p>"));
     
    7185  // ---------
    7286  QTabWidget* tabs = new QTabWidget();
     87  QWidget* tab_inp   = new QWidget();
     88  QWidget* tab_out   = new QWidget();
    7389  QWidget* tab_proxy = new QWidget();
    74   QWidget* tab_opt   = new QWidget();
    75   QWidget* tab_res   = new QWidget();
     90  tabs->addTab(tab_inp,  tr("Input"));
     91  tabs->addTab(tab_out,  tr("Output"));
    7692  tabs->addTab(tab_proxy,tr("Proxy"));
    77   tabs->addTab(tab_opt,  tr("Options"));
    78   tabs->addTab(tab_res,  tr("Results"));
     93
     94  // Input-Tab
     95  // ---------
     96  QGridLayout* iLayout = new QGridLayout;
     97  ///  iLayout->setColumnMinimumWidth(0,12*ww);
     98  iLayout->addWidget(new QLabel("Input Options"),0, 0, 1, 2, Qt::AlignLeft);
     99  iLayout->addWidget(new QLabel("Host (Ephemeris)"),1,0, Qt::AlignLeft);
     100  iLayout->addWidget(_ephHostLineEdit,1, 1);
     101  iLayout->addWidget(new QLabel("Port (Ephemeris)"),2,0, Qt::AlignLeft);
     102  iLayout->addWidget(_ephPortLineEdit,2, 1);
     103  tab_inp->setLayout(iLayout);
    79104
    80105  // Proxy-Tab
     
    82107  QGridLayout* pLayout = new QGridLayout;
    83108  pLayout->setColumnMinimumWidth(0,12*ww);
    84   pLayout->addWidget(new QLabel("Proxy host"),0,0, Qt::AlignLeft);
    85   pLayout->addWidget(_proxyHostLineEdit,0, 1);
    86   pLayout->addWidget(new QLabel("Proxy port"),1,0, Qt::AlignLeft);
    87   pLayout->addWidget(_proxyPortLineEdit,1,1);
    88   pLayout->addWidget(new QLabel("Settings for the proxy in protected networks, leave the boxes blank if none."),2, 0, 1, 2, Qt::AlignLeft);
    89   pLayout->addWidget(new QLabel("    "),3,0);
    90   pLayout->addWidget(new QLabel("    "),4,0);
    91   pLayout->addWidget(new QLabel("    "),5,0);
     109  pLayout->addWidget(new QLabel("Settings for the proxy in protected networks, leave the boxes blank if none."),0, 0, 1, 2, Qt::AlignLeft);
     110  pLayout->addWidget(new QLabel("Proxy host"),1,0, Qt::AlignLeft);
     111  pLayout->addWidget(_proxyHostLineEdit,1, 1);
     112  pLayout->addWidget(new QLabel("Proxy port"),2,0, Qt::AlignLeft);
     113  pLayout->addWidget(_proxyPortLineEdit,2,1);
    92114  tab_proxy->setLayout(pLayout);
    93115
     
    157179    QApplication::setFont(newFont);
    158180    int ww = QFontMetrics(newFont).width('w');
    159     setMinimumSize(60*ww, 80*ww);
    160     resize(60*ww, 80*ww);
     181    setMinimumSize(77*ww, 65*ww);
    161182  }
    162183}
     
    197218void bnsWindow::slotSaveOptions() {
    198219  QSettings settings;
     220  settings.setValue("ephHost",     _ephHostLineEdit->text());
     221  settings.setValue("ephPort",     _ephPortLineEdit->text());
    199222  settings.setValue("proxyHost",   _proxyHostLineEdit->text());
    200223  settings.setValue("proxyPort",   _proxyPortLineEdit->text());
  • trunk/BNS/bnswindow.h

    r750 r752  
    4848  QWidget*   _canvas;
    4949
     50  QLineEdit* _ephHostLineEdit;
     51  QLineEdit* _ephPortLineEdit;
    5052  QLineEdit* _proxyHostLineEdit;
    5153  QLineEdit* _proxyPortLineEdit;
Note: See TracChangeset for help on using the changeset viewer.