This commit is contained in:
hm
2021-05-13 09:17:59 +08:00
parent 35098e2a5c
commit b38e0abc8b
12 changed files with 166 additions and 289 deletions
+26 -1
View File
@@ -17,6 +17,9 @@ GlobalSetting::GlobalSetting(QWidget *parent) :
ui->comboBox_Beep->addItem(tr(""),true);
ui->comboBox_Beep->addItem(tr(""),false);
ui->comboBox_TTS->addItem(tr(""),true);
ui->comboBox_TTS->addItem(tr(""),false);
Config *cfg = new Config();
@@ -29,6 +32,9 @@ GlobalSetting::GlobalSetting(QWidget *parent) :
ui->comboBox_Beep->setCurrentIndex(ui->comboBox_Beep->findData(beep.toBool()));
QVariant tts;
cfg->getTTS(&tts);
ui->comboBox_TTS->setCurrentIndex(ui->comboBox_TTS->findData(beep.toBool()));
emit setGCSID(id.toInt());//设置全局ID
@@ -222,5 +228,24 @@ void GlobalSetting::on_pushButton_Beep_clicked()
delete cfg;
emit showMessage((state.toBool())?(tr("声音开启")):(tr("声音关闭")));
emit showMessage((state.toBool())?(tr("心跳声音开启")):(tr("心跳声音关闭")));
}
void GlobalSetting::on_pushButton_TTS_clicked()
{
QVariant state;
state = ui->comboBox_TTS->currentData();
emit setTTS(state.toBool());
Config *cfg = new Config();
cfg->setTTS(state);
cfg->deleteLater();
delete cfg;
emit showMessage((state.toBool())?(tr("语音提示开启")):(tr("语音提示关闭")));
}
@@ -36,6 +36,8 @@ private slots:
void on_pushButton_Beep_clicked();
void on_pushButton_TTS_clicked();
signals:
void showMessage(const QString &message,int TimeOut = 0);
@@ -50,6 +52,8 @@ signals:
void setBeep(QVariant beep);
void setTTS(QVariant flag);
private:
Ui::GlobalSetting *ui;
};
+47 -11
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>533</width>
<height>454</height>
<width>738</width>
<height>472</height>
</rect>
</property>
<property name="windowTitle">
@@ -139,10 +139,10 @@
<string>ID设置</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>设置地面站ID号</string>
<string>心跳声</string>
</property>
</widget>
</item>
@@ -156,6 +156,16 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_Beep"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>地面站ID号</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_Beep">
<property name="text">
@@ -163,13 +173,20 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_Beep"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<item row="2" column="2">
<widget class="QPushButton" name="pushButton_TTS">
<property name="text">
<string>心跳声开关</string>
<string>Set</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_TTS"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>提示声</string>
</property>
</widget>
</item>
@@ -219,8 +236,27 @@
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QQuickWidget" name="quickWidget">
<property name="resizeMode">
<enum>QQuickWidget::SizeRootObjectToView</enum>
</property>
<property name="source">
<url>
<string>qrc:/App/qml/base.qml</string>
</url>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QQuickWidget</class>
<extends>QWidget</extends>
<header location="global">QtQuickWidgets/QQuickWidget</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>