|
|
|
#include "homepagedlg.h"
|
|
|
|
#include "ui_homepagedlg.h"
|
|
|
|
#include <QDir>
|
|
|
|
#include <qsettings.h>
|
|
|
|
|
|
|
|
HomePageDlg::HomePageDlg(QWidget *parent)
|
|
|
|
: QWidget(parent)
|
|
|
|
, ui(new Ui::HomePageDlg)
|
|
|
|
, _lLinkIp("")
|
|
|
|
, _adHocNetwork("")
|
|
|
|
, _satelliteComm("")
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
QPalette palette;
|
|
|
|
//设置主窗口背景颜色
|
|
|
|
palette.setColor(QPalette::Window,QColor(50, 50, 50));
|
|
|
|
this->setPalette(palette);
|
|
|
|
//嵌入到主窗口
|
|
|
|
setWindowFlags(Qt::CustomizeWindowHint|Qt::FramelessWindowHint);
|
|
|
|
hide();
|
|
|
|
initSettingUrl();
|
|
|
|
}
|
|
|
|
|
|
|
|
HomePageDlg::~HomePageDlg()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************
|
|
|
|
* @func getUrl
|
|
|
|
* @brief 获取设备url
|
|
|
|
* @param
|
|
|
|
**************************************************/
|
|
|
|
void HomePageDlg::getUrl(std::unordered_map<QString, QString>& urlMap)
|
|
|
|
{
|
|
|
|
urlMap = _urlMap;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************
|
|
|
|
* @func
|
|
|
|
* @brief 初始化配置文件
|
|
|
|
* @param
|
|
|
|
* @return
|
|
|
|
**************************************************/
|
|
|
|
void HomePageDlg::initSettingUrl()
|
|
|
|
{
|
|
|
|
QString urlFile = QCoreApplication::applicationDirPath()+"/config.ini";
|
|
|
|
std::unique_ptr<QSettings> configIni = std::make_unique<QSettings>(urlFile,QSettings::IniFormat);
|
|
|
|
|
|
|
|
_lLinkIp = configIni->value("L链/IP").toString();
|
|
|
|
_adHocNetwork = configIni->value("宽带自组网/IP").toString();
|
|
|
|
_satelliteComm = configIni->value("机载卫通/IP").toString();
|
|
|
|
|
|
|
|
_urlMap.insert({"L链",_lLinkIp});
|
|
|
|
_urlMap.insert({"宽带自组网",_adHocNetwork});
|
|
|
|
_urlMap.insert({"机载卫通",_satelliteComm});
|
|
|
|
}
|
|
|
|
|
|
|
|
void HomePageDlg::on_pushButton_clicked()
|
|
|
|
{
|
|
|
|
emit sendUrl(_urlMap);
|
|
|
|
}
|
|
|
|
|