Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
openlayerwidget.cpp
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // openlayerwidget.cpp
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 
10 #include <QByteArray>
11 #include <QFile>
12 #include <QStringList>
13 
14 #include <QVBoxLayout>
15 #include <QAction>
16 #include <QActionGroup>
17 #include <QToolButton>
18 #include <QMenu>
19 #include <QLabel>
20 #include <QSplitter>
21 
22 
23 #include <QtWebKit/QWebFrame>
24 #include <QDesktopServices>
25 
26 #include <QDoubleValidator>
27 
28 
29 #include "map/openlayerwidget.h"
30 
31 
32 
34  QWidget(parent)
35 {
36 
37  mainObject = mob;
38 
39  setWindowTitle(tr("FGx OpenLayer Map"));
40  setWindowIcon(QIcon(":/icon/mpmap"));
41 
42  //======================================================
43  //= Main Layout and Splitter
44  QVBoxLayout *mainLayout = new QVBoxLayout(this);
45  mainLayout->setContentsMargins(0,0,0,0);
46  mainLayout->setSpacing(0);
47 
48 
49 
50  toolbarAirports = new QToolBar();
51  mainLayout->addWidget(toolbarAirports);
52 
53 
54  toolbarAirports->addWidget(new QLabel(tr("Lat:")));
55  txtLat = new QLineEdit();
56  QDoubleValidator *validateLat = new QDoubleValidator(this);
57  txtLat->setValidator(validateLat);
58  toolbarAirports->addWidget(txtLat);
59  connect(txtLat, SIGNAL(textEdited(QString)), this, SLOT(on_lat_changed(QString)));
60 
61  toolbarAirports->addWidget(new QLabel(tr("Lon:")));
62  txtLon = new QLineEdit();
63  QDoubleValidator *validateLon = new QDoubleValidator(this);
64  txtLon->setValidator(validateLon);
65  toolbarAirports->addWidget(txtLon);
66  connect(txtLon, SIGNAL(textEdited(QString)), this, SLOT(on_lon_changed(QString)));
67 
68 
69  toolbarAirports->addWidget(new QLabel(tr("Heading:")));
70  spinHeading = new QSpinBox();
71  spinHeading->setRange(0, 359);
72  spinHeading->setSingleStep(1);
73  toolbarAirports->addWidget(spinHeading);
74  connect(spinHeading, SIGNAL(valueChanged(int)), this, SLOT(on_spin(int)));
75 
76 
77  dialHeading = new QDial();
78  dialHeading->setFixedSize(30, 30);
79  dialHeading->setWrapping(true);
80  dialHeading->setRange(0, 359);
81  dialHeading->setPageStep(30);
82  dialHeading->setNotchesVisible(true);
83  toolbarAirports->addWidget(dialHeading);
84  connect(dialHeading, SIGNAL(valueChanged(int)), this, SLOT(on_dial(int)));
85 
86 
87  //=============================================
88  // Cols Selector
89  /*QToolButton *buttShowColumns = new QToolButton(this);
90  buttShowColumns->setText("Show");
91  buttShowColumns->setIcon(QIcon(":/icon/select_cols"));
92  buttShowColumns->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
93  buttShowColumns->setPopupMode(QToolButton::InstantPopup);
94  toolbar->addWidget(buttShowColumns);
95 
96  QMenu *menuCols = new QMenu();
97  buttShowColumns->setMenu(menuCols);
98 
99  //= Cols Widget
100  QWidget *widgetColsSelecta = new QWidget();
101  QVBoxLayout *layCols = new QVBoxLayout();
102  widgetColsSelecta->setLayout(layCols);
103 
104 
105  XGroupVBox *groupBoxRadarCols = new XGroupVBox("Radar Layer- TODO");
106  QButtonGroup *groupRadarCols = new QButtonGroup(this);
107  groupRadarCols->setExclusive(true);
108 
109 
110  QRadioButton *buttShowRadarAll = new QRadioButton();
111  buttShowRadarAll->setText("Icons and Labels");
112  buttShowRadarAll->setChecked(true);
113  groupBoxRadarCols->addWidget(buttShowRadarAll);
114  groupRadarCols->addButton(buttShowRadarAll, 1);
115 
116  QRadioButton *buttShowRadarImg = new QRadioButton();
117  buttShowRadarImg->setText("Icons Only");
118  groupBoxRadarCols->addWidget(buttShowRadarImg);
119  groupRadarCols->addButton(buttShowRadarImg, 2);
120 
121  QRadioButton *buttShowRadarLabels = new QRadioButton();
122  buttShowRadarLabels->setText("Labels Only");
123  groupBoxRadarCols->addWidget(buttShowRadarLabels);
124  groupRadarCols->addButton(buttShowRadarLabels, 3);
125 
126  QWidgetAction *colsWidgetAction = new QWidgetAction(this);
127  colsWidgetAction->setDefaultWidget(groupBoxRadarCols);
128  menuCols->addAction(colsWidgetAction);*/
129 
130  //=============================================
131  // Map Type
132  /*QToolButton *buttMapType = new QToolButton(this);
133  buttMapType->setText("Map Type");
134  buttMapType->setIcon(QIcon(":/icon/map_type"));
135  buttMapType->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
136  buttMapType->setPopupMode(QToolButton::InstantPopup);
137  toolbar->addWidget(buttMapType);
138 
139  QMenu *menuMapType = new QMenu();
140  buttMapType->setMenu(menuMapType);
141 
142  QActionGroup *actionGroup = new QActionGroup(this);
143  actionGroup->setExclusive(true);
144  connect(actionGroup, SIGNAL(triggered(QAction*)), this, SLOT(on_map_type(QAction*)));
145 
146  QAction *actionMapOsm =menuMapType->addAction("Open Street Map");
147  actionMapOsm->setCheckable(true);
148  actionMapOsm->setChecked(true);
149  actionMapOsm->setProperty("map_type", "osm");
150  actionGroup->addAction(actionMapOsm);
151 
152  QAction *actionMapGoogle =menuMapType->addAction("Google Satellite");
153  actionMapGoogle->setCheckable(true);
154  actionMapGoogle->setProperty("map_type", "google_satellite");
155  actionGroup->addAction(actionMapGoogle);
156  actionMapGoogle->setVisible(false);*/
157 
158 
159  //============================================================================
160  // Middle pane with map
161  //============================================================================
162  QHBoxLayout *midLayout = new QHBoxLayout();
163  mainLayout->addLayout(midLayout);
164 
165  //== Zoom Bar
166  QVBoxLayout *layoutZoom = new QVBoxLayout();
167  midLayout->addLayout(layoutZoom, 0);
168 
169  QString zbstyle("font-weight: bold; font-size: 10pt; color: black; padding: 0px; margin: 0px;");
170 
171  QToolButton *buttZoomIn = new QToolButton();
172  buttZoomIn->setText("+");
173  buttZoomIn->setAutoRaise(true);
174  buttZoomIn->setStyleSheet(zbstyle);
175  layoutZoom->addWidget(buttZoomIn, 0);
176  connect(buttZoomIn, SIGNAL(clicked()), this, SLOT(on_zoom_in()));
177 
178  sliderZoom = new QSlider();
179  sliderZoom->setRange(1,16);
180  sliderZoom->setTickPosition(QSlider::TicksLeft);
181  sliderZoom->setTickInterval(1);
182  sliderZoom->setPageStep(1);
183  layoutZoom->addWidget(sliderZoom, 200);
184  connect(sliderZoom, SIGNAL(valueChanged(int)), SLOT(zoom_to(int)));
185 
186  QToolButton *buttZoomOut = new QToolButton();
187  buttZoomOut->setText("-");
188  buttZoomOut->setAutoRaise(true);
189  buttZoomOut->setStyleSheet(zbstyle);
190  layoutZoom->addWidget(buttZoomOut, 0);
191  connect(buttZoomOut, SIGNAL(clicked()), this, SLOT(on_zoom_out()));
192 
193 
194  lblZoom = new QLabel();
195  lblZoom->setFixedWidth(20);
196  lblZoom->setStyleSheet(zbstyle);
197  layoutZoom->addWidget(lblZoom);
198 
199 
200 
201  //=============================================================
202  //== Cache
203  networkDiskCache = new QNetworkDiskCache(this);
204  networkDiskCache->setCacheDirectory(QDesktopServices::storageLocation(QDesktopServices::CacheLocation));
205 
206 
207  //== Browser
208  webView = new QWebView();
209  midLayout->addWidget(webView, 10);
210  webView->page()->networkAccessManager()->setCache(networkDiskCache);
211 
212  webInspector = new QWebInspector();
213  webInspector->hide();
214 
215 
216  connect(webView, SIGNAL(loadStarted()), this, SLOT(start_progress()));
217  connect(webView, SIGNAL(loadProgress(int)), this, SLOT(update_progress(int)));
218  connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(end_progress(bool)));
219 
220 
221  //============================================================
222  //== Status Bar
223  //============================================================
224  statusBar = new QStatusBar(this);
225  mainLayout->addWidget(statusBar);
226  statusBar->showMessage("Idle");
227  statusBar->setSizeGripEnabled(false);
228 
229  //== Progress Bar
230  progressBar = new QProgressBar();
231  progressBar->setVisible(false);
232  statusBar->addPermanentWidget(progressBar);
233 
234 
235 
236  //===================================================
237  //= View Layers
238  buttonGroupViewLayers = new QButtonGroup(this);
239  buttonGroupViewLayers->setExclusive(false);
240  connect(buttonGroupViewLayers, SIGNAL(buttonClicked(QAbstractButton*)),
241  this, SLOT(on_display_layer(QAbstractButton*))
242  );
243  mainObject->settings->beginGroup("map_display_layers");
244 
245 
246  /*chkViewGridLines = new QCheckBox();
247  chkViewGridLines->setText("Grid Lines");
248  chkViewGridLines->setProperty("layer","grid_lines");
249  chkViewGridLines->setChecked(mainObject->settings->value("grid_lines", "0").toBool());
250  statusBar->addPermanentWidget(chkViewGridLines);
251  buttonGroupViewLayers->addButton(chkViewGridLines);*/
252 
253 
254 
255  /*chkViewStands = new QCheckBox();
256  chkViewStands->setText("Stands");
257  chkViewStands->setProperty("layer","stands");
258  statusBar->addPermanentWidget(chkViewStands);
259  chkViewStands->setChecked(mainObject->settings->value("stands", "1").toBool());
260  buttonGroupViewLayers->addButton(chkViewStands);*/
261 
262  /*chkViewRunwayLabels = new QCheckBox();
263  chkViewRunwayLabels->setText("Runway Labels");
264  chkViewRunwayLabels->setProperty("layer","runway_labels");
265  statusBar->addPermanentWidget(chkViewRunwayLabels);
266  chkViewRunwayLabels->setChecked(mainObject->settings->value("runway_labels", "1").toBool());
267  buttonGroupViewLayers->addButton(chkViewRunwayLabels);*/
268 
269  /*chkViewRunwayLines = new QCheckBox();
270  chkViewRunwayLines->setText("Runway Lines");
271  chkViewRunwayLines->setProperty("layer","runway_lines");
272  statusBar->addPermanentWidget(chkViewRunwayLines);
273  chkViewRunwayLines->setChecked(mainObject->settings->value("runway_lines", "1").toBool());
274  buttonGroupViewLayers->addButton(chkViewRunwayLines);*/
275 
276  mainObject->settings->endGroup();
277 
278  buttDebug = new QToolButton();
279  buttDebug->setText("Debug");
280  buttDebug->setVisible(mainObject->debug_mode == true);
281  statusBar->addPermanentWidget(buttDebug);
282  connect(buttDebug, SIGNAL(clicked()), this, SLOT(on_show_debugger()));
283 
284 
285 
286  //============================================================================
287  //== Main Settings connection
288  connect(this, SIGNAL(setx(QString,bool,QString)), mainObject->X, SLOT(set_option(QString,bool,QString)) );
289  connect(this, SIGNAL(setv(QString,QString)), mainObject->X, SLOT(set_value(QString,QString)) );
290  connect(mainObject->X, SIGNAL(upx(QString,bool,QString)), this, SLOT(on_upx(QString,bool,QString)));
291  connect(mainObject, SIGNAL(on_debug_mode(bool)), this, SLOT(on_debug_mode(bool)));
292 }
293 
294 
295 
296 
297 
298 //===========================================================================
299 //== Load Map
300 //===========================================================================
301 void OpenLayerWidget::load_map(QString m_typ)
302 {
303  this->map_type = m_typ;
304 
305  // We open the map.html, read contents and setHtml to webview
306  QFile file(":/openlayers/map.html");
307  if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){
308  qDebug() << "MAP: could not open file" << file.fileName();
309  return;
310  }
311 
312  // read html
313  QByteArray contents = file.readAll();
314 
315  // @TODO: This stuff id dodgy and "qrc:///" caused seg fault - pete
316  webView->setHtml(contents, QUrl("qrc:///openlayers")); // This prefix does not work with src:///openlayers/ .. help.. Geoff.. gral.?
317 
318  //= Add a reference as "Qt" to this Class in Javascript, eg Qt.xxx() in favascript would call this->xxx()
319  webView->page()->mainFrame()->addToJavaScriptWindowObject("Qt", this);
320 
321  //= Enable the web inspector
322  webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, mainObject->debug_mode);
323 
324  webInspector->setPage(webView->page());
325 
326  //= Show Hide widgets
327  bool is_airport = map_type == "airport";
328  //chkViewRunwayLines->setVisible(is_airport);
329  //chkViewRunwayLabels->setVisible(is_airport);
330  //chkViewStands->setVisible(is_airport);
331 
332  toolbarAirports->setVisible(is_airport);
333 
334 }
335 
337 {
338  QString js_mtype = QString("set_map_type('%1');").arg(map_type);
339  execute_js(js_mtype);
340 
341  QList<QAbstractButton *> buttons = buttonGroupViewLayers->buttons();
342  for(int idx = 0; idx < buttons.size(); idx++){
343  QString jstr = QString("display_layer('%1', %2);").arg( buttons.at(idx)->property("layer").toString()
344  ).arg( buttons.at(idx)->isChecked() ? 1 : 0
345  );
346  execute_js(jstr);
347  }
348 
349 }
350 
351 
352 
353 //= Overide the closeEvent
354 void OpenLayerWidget::closeEvent(QCloseEvent *event)
355 {
357  Q_UNUSED(event);
358 }
359 
360 
361 
362 
363 //================================================
364 // Add Runway
365 void OpenLayerWidget::add_runway(QString apt, QString rwy1, QString rwy2, QString lat1, QString lon1, QString lat2, QString lon2)
366 {
367  QString jstr = QString("add_runway('%1', '%2', '%3', %4, %5, %6, %7);").arg(apt).arg(rwy1).arg(rwy2).arg(lat1).arg(lon1).arg(lat2).arg(lon2);
368  execute_js(jstr);
369  //qDebug() << "add_runway jstr: " << jstr;
370 }
371 
372 //================================================
373 // Add Stand
374 void OpenLayerWidget::add_stand(QString apt, QString name, QString lat, QString lon)
375 {
376  QString jstr = QString("add_stand('%1', '%2', %3, %4);").arg(apt).arg(name).arg(lat).arg(lon);
377  execute_js(jstr);
378  //qDebug() << "add_stand jstr: " << jstr;
379 }
380 
381 
382 //================================================
383 // Add Tower
384 void OpenLayerWidget::add_tower(QString name, QString lat, QString lon)
385 {
386  QString jstr = QString("add_tower('%1', %2, %3);").arg(name).arg(lat).arg(lon);
387  execute_js(jstr);
388  //qDebug() << "add_tower " << jstr;
389 }
390 
391 //================================================
392 // Zoom to Airport
394  QString jstr = QString("zoom_to_airport('%1');").arg(apt);
395  execute_js(jstr);
396  qDebug() << "zoom_to_airport jstr: " << jstr;
397 }
398 
399 
400 //================================================
401 // Zoom to point
402 void OpenLayerWidget::zoom_to_latlon(QString lat, QString lon, int zoom)
403 {
404  QString jstr = QString("zoom_to_latlon(%1, %2, %3);").arg(lat).arg(lon).arg(zoom);
405  execute_js(jstr);
406 }
407 
408 //================================================
409 // Zoom to point
411 {
412  QString jstr = QString("zoom_to(%1);").arg(zoom);
413  execute_js(jstr);
414  lblZoom->setText(QString::number(zoom));
415 }
416 
417 //== Zoom in out buttons
419  sliderZoom->setValue(sliderZoom->value() + 1);
420 }
422  sliderZoom->setValue(sliderZoom->value() - 1);
423 }
424 
425 
426 //=================================================
427 // Show Aircraft - This nukes existing and moves - ONLY ONE ALLOWED
428 void OpenLayerWidget::show_aircraft(QString callsign, QString lat, QString lon, QString heading, QString altitude){
429  QString jstr = QString("show_aircraft('%1', %2, %3, %4, %5);").arg(callsign).arg(lat).arg(lon).arg(heading).arg(altitude);
430  execute_js(jstr);
431  //qDebug() << "show_aircraft jstr: " << jstr;
432 }
433 
434 
435 
436 
437 //================================================
438 // display_radar
439 /*void OpenLayerWidget::display_radar_layer( int viz)
440 {
441  QString jstr = QString("display_radar_layer(%1);").arg(viz);
442  execute_js(jstr);
443  //qDebug() << jstr;
444 }*/
445 
446 //=================================================
447 // Show Aircraft Radar - this allows more than one aircraft.
448 void OpenLayerWidget::show_radar(QString callsign, QString lat, QString lon, QString heading, QString altitude, bool is_tower){
449  QString jstr;
450  if(is_tower){
451  add_tower(callsign, lat, lon);
452  }else{
453  jstr = QString("show_radar('%1', %2, %3, %4, %5);").arg(callsign).arg(lat).arg(lon).arg(heading).arg(altitude);
454  }
455  execute_js(jstr);
456  //qDebug() << "show_radar jstr: " << jstr;
457 }
458 
460 {
461  execute_js("clear_radar();");
462 }
463 
464 //=================================================
465 // Focus Aircraft
466 void OpenLayerWidget::focus_aircraft(QString callsign){
467  QString jstr = QString("focus_aircraft('%1');").arg(callsign);
468  execute_js(jstr);
469 }
470 
471 //= TODO later Clear Airport Markers
473 {
474  QString jstr = QString("clear_airport('%1');").arg(apt);
475  execute_js(jstr);
476  qDebug() << "clear prt" << jstr;
477 }
478 
480 {
481  QString jstr = QString("clear_map();");
482  execute_js(jstr);
483  //qDebug() << "clear map" << jstr;
484 }
485 
486 //================================================
487 // Execute Javascript
488 //================================================
489 void OpenLayerWidget::execute_js(QString js_str){
490  if(mainObject->debug_mode){
491  //qDebug() << "> js= " << js_str;
492  }
493  webView->page()->mainFrame()->evaluateJavaScript(js_str);
494 }
495 
496 
497 
498 
499 
500 //===========================================================================
501 // Called from JS
502 //===========================================================================
503 void OpenLayerWidget::map_debug(QVariant mess){
504  //qDebug() << "< " << mess.toString();
505  Q_UNUSED(mess);
506 }
507 
508 
509 //= < JS - map_mouse_move
510 /*void OpenLayerWidget::map_mouse_move(QVariant lat, QVariant lon){
511  lblLat->setText(lat.toString());
512  lblLon->setText(QString::number(lon.toFloat()));
513 }*/
514 
515 //= < JS - map_show_coords()
516 void OpenLayerWidget::map_set_coords(QVariant lat, QVariant lon){
517 
518  qDebug() << "map_set_coords";
519  txtLat->setText(lat.toString());
520  txtLon->setText(lon.toString());
521  emit map_double_clicked(lat.toString(), lon.toString(), spinHeading->text());
522 }
523 
524 //=== On Dial
526 {
527 
528  spinHeading->setValue(val);
529 }
530 
531 //=== On Spin
533 {
534  emit setv("--heading=", QString::number(val));
535 }
536 
537 void OpenLayerWidget::on_upx(QString option, bool enabled, QString value)
538 {
539  Q_UNUSED(option);
540  Q_UNUSED(enabled);
541  Q_UNUSED(value);
542 
543  if(option == "--lat="){
544  txtLat->setText(value);
545 
546  }else if(option == "--lon="){
547  txtLon->setText(value);
548 
549  }else if(option == "--heading="){
550  //spinHeading->setValue(value.toDouble());
551  double d = value.toDouble() * 100;
552  dialHeading->setValue(d / 100);
553 
554  }
555 }
556 
557 
558 //= < JS - map_click() get click to log
559 void OpenLayerWidget::map_click(QVariant lat, QVariant lon){
560  Q_UNUSED(lat);
561  Q_UNUSED(lon);
562  //qDebug() << "map_click()" << lat << lon;
563 }
564 
565 //= < JS - map_right_click()
566 void OpenLayerWidget::map_right_click(QVariant lat, QVariant lon){
567  Q_UNUSED(lat);
568  Q_UNUSED(lon);
569  //qDebug() << "map_right_click()" << lat << lng;
570 }
571 
572 
573 void OpenLayerWidget::map_error(QVariant err){
574  //qDebug("map_error()");
575  Q_UNUSED(err);
576 }
577 
578 void OpenLayerWidget::marker_clicked(QVariant marker, QVariant mId){
579  //qDebug("marker_clicked()");
580  Q_UNUSED(marker);
581  Q_UNUSED(mId);
582 }
583 
584 void OpenLayerWidget::marker_unselected(QVariant curr_idx, QVariant mLocationId){
585  //qDebug("marker_unselected()");
586  Q_UNUSED(curr_idx);
587  Q_UNUSED(mLocationId);
588 }
589 
590 
591 
592 //== < JS - Map zoom changed
594  int z = zoom.toInt();
595  if(z == 0){
596  return; //leave as is
597  }
598  sliderZoom->setValue(z);
599 }
600 
601 /*void OpenLayerWidget::on_map_type(QAction *act)
602  {
603  QString jstr = QString("set_map_type('%1');").arg(act->property("map_type").toString());
604  execute_js(jstr);
605 
606  }*/
607 
608 
609 void OpenLayerWidget::on_display_layer(QAbstractButton *chkBox)
610 {
611  QString jstr = QString("display_layer('%1', %2);").arg( chkBox->property("layer").toString()
612  ).arg( chkBox->isChecked() ? 1 : 0
613  );
614  execute_js(jstr);
615  mainObject->settings->beginGroup("map_display_layers");
616  mainObject->settings->setValue(chkBox->property("layer").toString(), chkBox->isChecked());
617  mainObject->settings->endGroup();
618 }
619 
620 
621 //============================================================================================
622 //== Progress Slots
623 //=============================================================
625  progressBar->setVisible(true);
626 }
627 
629  progressBar->setValue(v);
630 }
632  Q_UNUSED(Ok);
633  progressBar->setVisible(false);
634  statusBar->showMessage( webView->url().toString() );
635 }
636 
637 
639 {
640  webInspector->show();
641  webInspector->setMinimumWidth(500);
642 }
643 
644 
645 void OpenLayerWidget::on_debug_mode(bool debug_mode)
646 {
647  webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, debug_mode);
648  buttDebug->setVisible(debug_mode == true);
649 }
650 
651 
653 {
654  emit setv("--lat=", lat);
655 }
656 
657 
659 {
660  emit setv("--lon=", lon);
661 }
void closeEvent(QCloseEvent *event)
void map_error(QVariant err)
void show_aircraft(QString callsign, QString lat, QString lon, QString heading, QString altitude)
void on_upx(QString option, bool enabled, QString value)
void on_spin(int val)
void add_tower(QString apt, QString lat, QString lon)
void end_progress(bool Ok)
void on_dial(int val)
void map_right_click(QVariant lat, QVariant lon)
QStatusBar * statusBar
void map_debug(QVariant)
void update_progress(int progress)
void zoom_to_latlon(QString lat, QString lon, int zoom)
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:66
OpenLayerWidget(MainObject *mob, QWidget *parent=0)
QWebInspector * webInspector
QSpinBox * spinHeading
void zoom_to(int zoom)
void map_set_coords(QVariant lat, QVariant lon)
void marker_unselected(QVariant curr_idx, QVariant mLocationId)
void map_double_clicked(QString lat, QString lon, QString heading)
QToolBar * toolbarAirports
void focus_aircraft(QString callsign)
void map_click(QVariant lat, QVariant lon)
void saveWindow(QWidget *widget)
Saves a window's size and position.
Definition: xsettings.cpp:90
void show_radar(QString callsign, QString lat, QString lon, QString heading, QString altitude, bool is_tower)
void map_zoom_changed(QVariant zoom)
void on_lon_changed(QString)
void on_lat_changed(QString)
QWebView * webView
bool debug_mode
Definition: mainobject.h:75
void add_runway(QString apt, QString rwy1, QString rwy2, QString lat1, QString lon1, QString lat2, QString lon2)
QNetworkDiskCache * networkDiskCache
void load_map(QString map_type)
void marker_clicked(QVariant marker, QVariant mId)
QLineEdit * txtLat
QButtonGroup * buttonGroupViewLayers
void clear_airport(QString apt)
QLineEdit * txtLon
XSettingsModel * X
Definition: mainobject.h:86
QToolButton * buttDebug
void setv(QString option, QString value)
void on_display_layer(QAbstractButton *)
void execute_js(QString js_string)
MainObject * mainObject
void add_stand(QString apt, QString name, QString lat, QString lon)
QProgressBar * progressBar
void zoom_to_airport(QString apt)
QSlider * sliderZoom
XSettings * settings
Definition: mainobject.h:85
void setx(QString option, bool enabled, QString value)
void on_debug_mode(bool)