diff options
| author | Max Christian Pohle | 2015-11-21 14:35:42 +0100 | 
|---|---|---|
| committer | Max Christian Pohle | 2015-11-21 14:35:42 +0100 | 
| commit | ce38d5155853e9c091b4104c17e3b674a58cc0d7 (patch) | |
| tree | d5c074c53aba6fd74759c8ec67cc4bc4a123e3be /mainwindow.cpp | |
| parent | bca14f8fdb25a5e230e083896f969aa431cf43f5 (diff) | |
| download | qspacestatus-ce38d5155853e9c091b4104c17e3b674a58cc0d7.tar.bz2 qspacestatus-ce38d5155853e9c091b4104c17e3b674a58cc0d7.zip | |
improved gui
made items resizable and added a refresh button for the list of
hackerspaces
Diffstat (limited to 'mainwindow.cpp')
| -rw-r--r-- | mainwindow.cpp | 10 | 
1 files changed, 7 insertions, 3 deletions
| 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) : | |||
| 8 | { | 8 | { | 
| 9 | ui->setupUi(this); | 9 | ui->setupUi(this); | 
| 10 | ui->menuBar->setVisible(false); | 10 | ui->menuBar->setVisible(false); | 
| 11 | |||
| 12 | qDebug() << "Using: " << this->qsettings.fileName(); | 11 | qDebug() << "Using: " << this->qsettings.fileName(); | 
| 13 | 12 | ||
| 14 | this->qsystemtrayicon = new QSystemTrayIcon(this->windowIcon(), 0); | 13 | this->qsystemtrayicon = new QSystemTrayIcon(this->windowIcon(), 0); | 
| @@ -17,7 +16,7 @@ MainWindow::MainWindow(QWidget *parent) : | |||
| 17 | this->qsystemtrayicon->setToolTip(this->windowTitle()); | 16 | this->qsystemtrayicon->setToolTip(this->windowTitle()); | 
| 18 | this->connect(this->qsystemtrayicon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(slotActivated(QSystemTrayIcon::ActivationReason))); | 17 | this->connect(this->qsystemtrayicon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(slotActivated(QSystemTrayIcon::ActivationReason))); | 
| 19 | this->updateStatus(); | 18 | this->updateStatus(); | 
| 20 | this->updateSpaceList(this->qsettings.value("hackerspace").toString()); | 19 | this->updateSpaceList(); | 
| 21 | 20 | ||
| 22 | 21 | ||
| 23 | 22 | ||
| @@ -33,8 +32,11 @@ MainWindow::~MainWindow() | |||
| 33 | delete ui; | 32 | delete ui; | 
| 34 | } | 33 | } | 
| 35 | 34 | ||
| 36 | void MainWindow::updateSpaceList(QString defaultSpace) | 35 | void MainWindow::updateSpaceList() | 
| 37 | { | 36 | { | 
| 37 | qDebug() << "updateSpaceList()"; | ||
| 38 | QString defaultSpace = this->qsettings.value("hackerspace").toString(); | ||
| 39 | |||
| 38 | QUrl url("http://spaceapi.net/directory.json"); | 40 | QUrl url("http://spaceapi.net/directory.json"); | 
| 39 | QJsonObject json = QJsonDocument::fromJson(this->download(url)).object(); | 41 | QJsonObject json = QJsonDocument::fromJson(this->download(url)).object(); | 
| 40 | 42 | ||
| @@ -171,3 +173,5 @@ void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1) | |||
| 171 | this->updateStatus(); | 173 | this->updateStatus(); | 
| 172 | this->saveSettings(); | 174 | this->saveSettings(); | 
| 173 | } | 175 | } | 
| 176 | |||
| 177 | |||
