From ce38d5155853e9c091b4104c17e3b674a58cc0d7 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sat, 21 Nov 2015 14:35:42 +0100 Subject: improved gui made items resizable and added a refresh button for the list of hackerspaces --- mainwindow.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mainwindow.cpp') diff --git a/mainwindow.cpp b/mainwindow.cpp index 2590d4f..55a9769 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -8,7 +8,6 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); ui->menuBar->setVisible(false); - qDebug() << "Using: " << this->qsettings.fileName(); this->qsystemtrayicon = new QSystemTrayIcon(this->windowIcon(), 0); @@ -17,7 +16,7 @@ MainWindow::MainWindow(QWidget *parent) : this->qsystemtrayicon->setToolTip(this->windowTitle()); this->connect(this->qsystemtrayicon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(slotActivated(QSystemTrayIcon::ActivationReason))); this->updateStatus(); - this->updateSpaceList(this->qsettings.value("hackerspace").toString()); + this->updateSpaceList(); @@ -33,8 +32,11 @@ MainWindow::~MainWindow() delete ui; } -void MainWindow::updateSpaceList(QString defaultSpace) +void MainWindow::updateSpaceList() { + qDebug() << "updateSpaceList()"; + QString defaultSpace = this->qsettings.value("hackerspace").toString(); + QUrl url("http://spaceapi.net/directory.json"); QJsonObject json = QJsonDocument::fromJson(this->download(url)).object(); @@ -171,3 +173,5 @@ void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1) this->updateStatus(); this->saveSettings(); } + + -- cgit v1.2.3