mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Improved status message filtering
* avoid re-init of widget if already initialized * allow icons instead of text for severity radio buttons * changing severity filter directly triggers new filtering * use icon for new button * init this->showFilterBar() as default (otherwise not functional) * widths for filter bar buttons
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3575eed37b
commit
6825524025
@@ -128,7 +128,7 @@ void CSwiftLauncher::ps_displayLatestNews(QNetworkReply *reply)
|
||||
{
|
||||
const QString html = nwReply->readAll().trimmed();
|
||||
if (html.isEmpty()) { return; }
|
||||
ui->tbr_LatestNews->setHtml(html);
|
||||
ui->tbr_LatestNews->setHtml(html); // causes QFSFileEngine::open: No file name specified
|
||||
constexpr qint64 newNews = 72 * 3600 * 1000;
|
||||
const qint64 deltaT = CNetworkUtils::lastModifiedSinceNow(nwReply.data());
|
||||
if (deltaT > 0 && deltaT < newNews)
|
||||
@@ -149,7 +149,7 @@ void CSwiftLauncher::init()
|
||||
|
||||
m_mwaOverlayFrame = ui->fr_SwiftLauncherMain;
|
||||
m_mwaStatusBar = nullptr;
|
||||
m_mwaLogComponent = ui->fr_SwiftLauncherLog;
|
||||
m_mwaLogComponent = ui->comp_SwiftLauncherLog;
|
||||
|
||||
ui->lbl_NewVersionUrl->setTextFormat(Qt::RichText);
|
||||
ui->lbl_NewVersionUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
@@ -231,6 +231,9 @@ void CSwiftLauncher::initLogDisplay()
|
||||
CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo)
|
||||
);
|
||||
logHandler->subscribe(this, &CSwiftLauncher::ps_appendLogMessage);
|
||||
|
||||
ui->comp_SwiftLauncherLog->showFilterBar();
|
||||
ui->comp_SwiftLauncherLog->filterUseRadioButtonDescriptiveIcons(false);
|
||||
}
|
||||
|
||||
void CSwiftLauncher::startSwiftCore()
|
||||
@@ -495,7 +498,7 @@ void CSwiftLauncher::ps_showStatusMessage(const CStatusMessage &msg)
|
||||
|
||||
void CSwiftLauncher::ps_appendLogMessage(const CStatusMessage &message)
|
||||
{
|
||||
ui->fr_SwiftLauncherLog->appendStatusMessageToList(message);
|
||||
ui->comp_SwiftLauncherLog->appendStatusMessageToList(message);
|
||||
if (message.getSeverity() == CStatusMessage::SeverityError)
|
||||
{
|
||||
this->ps_showStatusMessage(message);
|
||||
@@ -504,7 +507,7 @@ void CSwiftLauncher::ps_appendLogMessage(const CStatusMessage &message)
|
||||
|
||||
void CSwiftLauncher::ps_appendLogMessages(const CStatusMessageList &messages)
|
||||
{
|
||||
ui->fr_SwiftLauncherLog->appendStatusMessagesToList(messages);
|
||||
ui->comp_SwiftLauncherLog->appendStatusMessagesToList(messages);
|
||||
if (messages.hasErrorMessages())
|
||||
{
|
||||
this->ps_showStatusMessage(messages.getErrorMessages().toSingleMessage());
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pg_SwiftLauncherMain">
|
||||
<layout class="QVBoxLayout" name="wl_SwiftLauncherMainPage">
|
||||
@@ -879,7 +879,7 @@ p, li { white-space: pre-wrap; }
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CLogComponent" name="fr_SwiftLauncherLog">
|
||||
<widget class="BlackGui::Components::CLogComponent" name="comp_SwiftLauncherLog">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
@@ -935,8 +935,8 @@ p, li { white-space: pre-wrap; }
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="swiftlauncher.qrc"/>
|
||||
<include location="../blackmisc/blackmisc.qrc"/>
|
||||
<include location="swiftlauncher.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
|
||||
Reference in New Issue
Block a user