Monitor::Monitor(QSettings *settings, MainWindow *settings_window, TrayIcon *trayIcon, QObject *parent) : QObject(parent) { this->settings = settings; this->trayIcon = trayIcon; this->settings_window = settings_window; connect(this->trayIcon, SIGNAL(manualUpdateTriggered()), this, SLOT(manualUpdate())); connect(this->settings_window, SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(updateTimeout())); if (settings->value("auto_update/enabled", true).toBool()) { timer->start(settings->value("auto_update/interval", 60).toInt() * 60000); } }
MapOverlay::MapOverlay(MapWidget *mapWidget) { qDebug() << __FUNCTION__; // create a buttonmanager and fill with buttons m_mapButtonManager = new MapButtonManager(mapWidget); MapButton *zoom_in = m_mapButtonManager->create("zoom_in", 1, 1); QObject::connect(zoom_in, SIGNAL(clicked()), mapWidget, SLOT(zoomIn())); MapButton *gps = m_mapButtonManager->create("gps", 1, 2, MapButton::Disabled); QObject::connect(gps, SIGNAL(clicked()), mapWidget, SLOT(gpsFollow())); MapButton *zoom_out = m_mapButtonManager->create("zoom_out", 1, 3); QObject::connect(zoom_out, SIGNAL(clicked()), mapWidget, SLOT(zoomOut())); MapButton *update = m_mapButtonManager->create("update", -1, 1, MapButton::Hidden); QObject::connect(update, SIGNAL(clicked()), mapWidget, SLOT(manualUpdate())); MapButton *fullscreen = m_mapButtonManager->create("fs", -1, -1); QObject::connect(fullscreen, SIGNAL(clicked()), mapWidget, SLOT(toggleFullscreen())); };