mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 07:15:34 +08:00
Ref T78, setting and dialog "do not show again"
Applies to automatic update info check
This commit is contained in:
@@ -26,8 +26,10 @@ namespace BlackGui
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->bb_DownloadInstallDialog->button(QDialogButtonBox::Ok)->setText(" Download and install ");
|
||||
ui->cb_DontShowAgain->setChecked(!m_setting.get());
|
||||
this->selectionChanged();
|
||||
connect(ui->comp_DistributionInfo, &CDistributionInfoComponent::selectionChanged, this, &CDownloadAndInstallDialog::selectionChanged);
|
||||
connect(ui->cb_DontShowAgain, &QCheckBox::toggled, this, &CDownloadAndInstallDialog::onDontShowAgain);
|
||||
}
|
||||
|
||||
CDownloadAndInstallDialog::~CDownloadAndInstallDialog()
|
||||
@@ -53,6 +55,11 @@ namespace BlackGui
|
||||
return QDialog::Rejected;
|
||||
}
|
||||
|
||||
void CDownloadAndInstallDialog::onDontShowAgain(bool dontShowAgain)
|
||||
{
|
||||
m_setting.setAndSave(!dontShowAgain);
|
||||
}
|
||||
|
||||
void CDownloadAndInstallDialog::selectionChanged()
|
||||
{
|
||||
const bool nv = ui->comp_DistributionInfo->isNewVersionAvailable();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_DOWNLOADANDINSTALLDIALOG_H
|
||||
#define BLACKGUI_COMPONENTS_DOWNLOADANDINSTALLDIALOG_H
|
||||
|
||||
#include "blackgui/settings/updatenotification.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include <QDialog>
|
||||
|
||||
@@ -42,6 +43,10 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDownloadAndInstallDialog> ui;
|
||||
BlackMisc::CSetting<BlackGui::Settings::TUpdateNotificationSettings> m_setting { this }; //!< show again?
|
||||
|
||||
//! Toggled checkbox
|
||||
void onDontShowAgain(bool dontShowAgain);
|
||||
|
||||
//! Selection in distribution component changed
|
||||
void selectionChanged();
|
||||
|
||||
@@ -7,37 +7,77 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>125</height>
|
||||
<height>150</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>130</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Update checker</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_DownloadAndInstall">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CDistributionInfoComponent" name="comp_DistributionInfo">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>75</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="bb_DownloadInstallDialog">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="wi_Bottom" native="true">
|
||||
<layout class="QHBoxLayout" name="hl_Bottom">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_DontShowAgain">
|
||||
<property name="text">
|
||||
<string>Don't show again</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="bb_DownloadInstallDialog">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user