- Timestamp:
- Mar 30, 2008, 3:39:17 PM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bnsmain.cpp
r749 r752 17 17 #include <unistd.h> 18 18 #include <signal.h> 19 #include <QApplication>20 19 #include <iostream> 21 20 … … 50 49 QSettings settings; 51 50 if (settings.allKeys().size() == 0) { 52 settings.setValue("casterHost", "www.euref-ip.net");53 settings.setValue("casterPort", 2101);54 51 } 55 52 … … 59 56 // --------------------------------------- 60 57 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 72 58 bnsWindow* bnsWin = new bnsWindow(); 73 59 bnsWin->show(); -
trunk/BNS/bnswindow.cpp
r750 r752 27 27 bnsWindow::bnsWindow() { 28 28 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 29 39 int ww = QFontMetrics(this->font()).width('w'); 30 31 40 setMinimumSize(77*ww, 65*ww); 32 33 41 setWindowTitle(tr("BKG Ntrip Server (BNS) Version 1.0")); 42 setWindowIcon(QPixmap(":ntrip-logo.png")); 34 43 35 44 // Create Actions … … 61 70 setCentralWidget(_canvas); 62 71 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 64 78 _proxyHostLineEdit = new QLineEdit(settings.value("proxyHost").toString()); 65 79 _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>")); … … 71 85 // --------- 72 86 QTabWidget* tabs = new QTabWidget(); 87 QWidget* tab_inp = new QWidget(); 88 QWidget* tab_out = new QWidget(); 73 89 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")); 76 92 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); 79 104 80 105 // Proxy-Tab … … 82 107 QGridLayout* pLayout = new QGridLayout; 83 108 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); 92 114 tab_proxy->setLayout(pLayout); 93 115 … … 157 179 QApplication::setFont(newFont); 158 180 int ww = QFontMetrics(newFont).width('w'); 159 setMinimumSize(60*ww, 80*ww); 160 resize(60*ww, 80*ww); 181 setMinimumSize(77*ww, 65*ww); 161 182 } 162 183 } … … 197 218 void bnsWindow::slotSaveOptions() { 198 219 QSettings settings; 220 settings.setValue("ephHost", _ephHostLineEdit->text()); 221 settings.setValue("ephPort", _ephPortLineEdit->text()); 199 222 settings.setValue("proxyHost", _proxyHostLineEdit->text()); 200 223 settings.setValue("proxyPort", _proxyPortLineEdit->text()); -
trunk/BNS/bnswindow.h
r750 r752 48 48 QWidget* _canvas; 49 49 50 QLineEdit* _ephHostLineEdit; 51 QLineEdit* _ephPortLineEdit; 50 52 QLineEdit* _proxyHostLineEdit; 51 53 QLineEdit* _proxyPortLineEdit;
Note:
See TracChangeset
for help on using the changeset viewer.