Commit 0782ea68 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Add button to open web manager in browser

parent 35e6bf57
......@@ -8,6 +8,7 @@
*/
#include <QDialogButtonBox>
#include <QDesktopServices>
#include <KMessageBox>
......@@ -48,6 +49,14 @@ ProfileEditor::ProfileEditor(QWidget *w) : QDialog(w)
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(saveProfile()));
connect(ui->openWebManagerB, &QPushButton::clicked, this, [this]()
{
QUrl url(QString("http://" + ui->remoteHost->text() + ":8624"));
QDesktopServices::openUrl(url);
});
connect(ui->INDIWebManagerCheck, SIGNAL(toggled(bool)), ui->openWebManagerB, SLOT(setEnabled(bool)));
#ifdef Q_OS_WIN
ui->remoteMode->setChecked(true);
ui->localMode->setEnabled(false);
......@@ -221,6 +230,8 @@ void ProfileEditor::setRemoteMode(bool enable)
ui->loadSiteCheck->setEnabled(enable);
ui->INDIWebManagerCheck->setEnabled(enable);
if (enable == false)
ui->INDIWebManagerCheck->setChecked(false);
ui->INDIWebManagerPort->setEnabled(enable);
}
......
......@@ -6,11 +6,26 @@
<rect>
<x>0</x>
<y>0</y>
<width>387</width>
<height>275</height>
<width>379</width>
<height>266</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QGroupBox" name="profileGroup">
<property name="title">
......@@ -72,6 +87,19 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="INDIWebManagerCheck">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Store profile on remote INDI Web Manager. Use INDI Web Manager on the remote device to start/stop INDI server.</string>
</property>
<property name="text">
<string>INDI Web Manager</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="modeLabel">
<property name="text">
......@@ -139,19 +167,6 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="INDIWebManagerCheck">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Store profile on remote INDI Web Manager. Use INDI Web Manager on the remote device to start/stop INDI server.</string>
</property>
<property name="text">
<string>INDI Web Manager</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QLabel" name="INDIWebManagerPortLabel">
<property name="enabled">
......@@ -175,6 +190,29 @@
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="openWebManagerB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Open Web Manager in browser</string>
</property>
<property name="text">
<string>Web Manager</string>
</property>
<property name="icon">
<iconset resource="../data/kstars.qrc">
<normaloff>:/icons/breeze/default/kstars_xplanet.svg</normaloff>:/icons/breeze/default/kstars_xplanet.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
......@@ -487,6 +525,8 @@
<tabstop>aux4Combo</tabstop>
<tabstop>loadSiteCheck</tabstop>
</tabstops>
<resources/>
<resources>
<include location="../data/kstars.qrc"/>
</resources>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment