mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
Minor tweaks, formatting
This commit is contained in:
@@ -162,9 +162,9 @@ namespace BlackConfig
|
|||||||
return QDateTime::currentDateTime() > getEol();
|
return QDateTime::currentDateTime() > getEol();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString boolToYesNo(bool v)
|
const QString boolToYesNo(bool v)
|
||||||
{
|
{
|
||||||
return v ? "yes" : "no";
|
return v ? QStringLiteral("yes") : QStringLiteral("no");
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &CBuildConfig::compiledWithInfo(bool shortVersion)
|
const QString &CBuildConfig::compiledWithInfo(bool shortVersion)
|
||||||
@@ -210,7 +210,7 @@ namespace BlackConfig
|
|||||||
const QString &CBuildConfig::buildDateAndTime()
|
const QString &CBuildConfig::buildDateAndTime()
|
||||||
{
|
{
|
||||||
// http://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros
|
// http://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros
|
||||||
static const QString buildDateAndTime(__DATE__ " " __TIME__);
|
static const QString buildDateAndTime = QString(__DATE__ " " __TIME__).simplified();
|
||||||
return buildDateAndTime;
|
return buildDateAndTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ namespace BlackGui
|
|||||||
CStyleSheetUtility::fileNameStandardWidget()
|
CStyleSheetUtility::fileNameStandardWidget()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
setStyleSheet(s);
|
this->setStyleSheet(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
CActionHotkey CHotkeyDialog::getActionHotkey(const CActionHotkey &initial, const CIdentifierList &identifiers, QWidget *parent)
|
CActionHotkey CHotkeyDialog::getActionHotkey(const CActionHotkey &initial, const CIdentifierList &identifiers, QWidget *parent)
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CLogComponent</class>
|
<class>CLogComponent</class>
|
||||||
<widget class="QFrame" name="CLogComponent">
|
<widget class="QFrame" name="CLogComponent">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>264</width>
|
||||||
|
<height>335</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Log component</string>
|
<string>Log component</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -60,6 +68,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Views::CStatusMessageView" name="tvp_StatusMessages">
|
<widget class="BlackGui::Views::CStatusMessageView" name="tvp_StatusMessages">
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string>Status message log view</string>
|
||||||
|
</property>
|
||||||
<property name="verticalScrollBarPolicy">
|
<property name="verticalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ namespace BlackGui
|
|||||||
CFilterDialog::CFilterDialog(QWidget *parent) : QDialog(parent, Qt::Tool)
|
CFilterDialog::CFilterDialog(QWidget *parent) : QDialog(parent, Qt::Tool)
|
||||||
{
|
{
|
||||||
this->setWindowTitle("Filter dialog");
|
this->setWindowTitle("Filter dialog");
|
||||||
this->ps_onStyleSheetChanged();
|
this->onStyleSheetChanged();
|
||||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CFilterDialog::ps_onStyleSheetChanged);
|
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CFilterDialog::onStyleSheetChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
CFilterDialog::~CFilterDialog()
|
CFilterDialog::~CFilterDialog()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void CFilterDialog::ps_onStyleSheetChanged()
|
void CFilterDialog::onStyleSheetChanged()
|
||||||
{
|
{
|
||||||
const QString qss = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameFilterDialog());
|
const QString qss = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameFilterDialog());
|
||||||
this->setStyleSheet(qss);
|
this->setStyleSheet(qss);
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ namespace BlackGui
|
|||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CFilterDialog();
|
virtual ~CFilterDialog();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
//! Stylesheet changed
|
//! Stylesheet changed
|
||||||
void ps_onStyleSheetChanged();
|
void onStyleSheetChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ namespace BlackGui
|
|||||||
CStyleSheetUtility::CStyleSheetUtility(BlackMisc::Restricted<CGuiApplication>, QObject *parent) : QObject(parent)
|
CStyleSheetUtility::CStyleSheetUtility(BlackMisc::Restricted<CGuiApplication>, QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
this->read();
|
this->read();
|
||||||
connect(&this->m_fileWatcher, &QFileSystemWatcher::directoryChanged, this, &CStyleSheetUtility::qssDirectoryChanged);
|
connect(&m_fileWatcher, &QFileSystemWatcher::directoryChanged, this, &CStyleSheetUtility::qssDirectoryChanged);
|
||||||
connect(&this->m_fileWatcher, &QFileSystemWatcher::fileChanged, this, &CStyleSheetUtility::qssDirectoryChanged);
|
connect(&m_fileWatcher, &QFileSystemWatcher::fileChanged, this, &CStyleSheetUtility::qssDirectoryChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &CStyleSheetUtility::fontStyleAsString(const QFont &font)
|
const QString &CStyleSheetUtility::fontStyleAsString(const QFont &font)
|
||||||
@@ -137,8 +137,8 @@ namespace BlackGui
|
|||||||
if (!directory.exists()) { return false; }
|
if (!directory.exists()) { return false; }
|
||||||
|
|
||||||
// qss/css files
|
// qss/css files
|
||||||
const bool needsWatcher = this->m_fileWatcher.files().isEmpty();
|
const bool needsWatcher = m_fileWatcher.files().isEmpty();
|
||||||
if (needsWatcher) { this->m_fileWatcher.addPath(CDirectoryUtils::stylesheetsDirectory()); } // directory to deleted file watching
|
if (needsWatcher) { m_fileWatcher.addPath(CDirectoryUtils::stylesheetsDirectory()); } // directory to deleted file watching
|
||||||
directory.setNameFilters({"*.qss", "*.css"});
|
directory.setNameFilters({"*.qss", "*.css"});
|
||||||
directory.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
directory.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ namespace BlackGui
|
|||||||
QFile file(absolutePath);
|
QFile file(absolutePath);
|
||||||
if (file.open(QFile::QIODevice::ReadOnly | QIODevice::Text))
|
if (file.open(QFile::QIODevice::ReadOnly | QIODevice::Text))
|
||||||
{
|
{
|
||||||
if (needsWatcher) { this->m_fileWatcher.addPath(absolutePath); }
|
if (needsWatcher) { m_fileWatcher.addPath(absolutePath); }
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
const QString c = in.readAll();
|
const QString c = in.readAll();
|
||||||
const QString f = fileInfo.fileName().toLower();
|
const QString f = fileInfo.fileName().toLower();
|
||||||
@@ -162,9 +162,9 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore redundant re-reads
|
// ignore redundant re-reads
|
||||||
if (newStyleSheets != this->m_styleSheets)
|
if (newStyleSheets != m_styleSheets)
|
||||||
{
|
{
|
||||||
this->m_styleSheets = newStyleSheets;
|
m_styleSheets = newStyleSheets;
|
||||||
emit this->styleSheetsChanged();
|
emit this->styleSheetsChanged();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -173,7 +173,7 @@ namespace BlackGui
|
|||||||
QString CStyleSheetUtility::style(const QString &fileName) const
|
QString CStyleSheetUtility::style(const QString &fileName) const
|
||||||
{
|
{
|
||||||
if (!this->containsStyle(fileName)) { return QString(); }
|
if (!this->containsStyle(fileName)) { return QString(); }
|
||||||
return this->m_styleSheets[fileName.toLower()].trimmed();
|
return m_styleSheets[fileName.toLower()].trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CStyleSheetUtility::styles(const QStringList &fileNames) const
|
QString CStyleSheetUtility::styles(const QStringList &fileNames) const
|
||||||
@@ -193,12 +193,12 @@ namespace BlackGui
|
|||||||
if (fontAdded) { continue; }
|
if (fontAdded) { continue; }
|
||||||
fontAdded = true;
|
fontAdded = true;
|
||||||
s = hasModifiedFont ?
|
s = hasModifiedFont ?
|
||||||
this->m_styleSheets[fileNameFontsModified().toLower()] :
|
m_styleSheets[fileNameFontsModified().toLower()] :
|
||||||
this->m_styleSheets[fileNameFonts()];
|
m_styleSheets[fileNameFonts()];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s = this->m_styleSheets[key];
|
s = m_styleSheets[key];
|
||||||
}
|
}
|
||||||
if (s.isEmpty()) continue;
|
if (s.isEmpty()) continue;
|
||||||
if (!style.isEmpty()) style.append("\n\n");
|
if (!style.isEmpty()) style.append("\n\n");
|
||||||
@@ -211,7 +211,7 @@ namespace BlackGui
|
|||||||
bool CStyleSheetUtility::containsStyle(const QString &fileName) const
|
bool CStyleSheetUtility::containsStyle(const QString &fileName) const
|
||||||
{
|
{
|
||||||
if (fileName.isEmpty()) return false;
|
if (fileName.isEmpty()) return false;
|
||||||
return this->m_styleSheets.contains(fileName.toLower().trimmed());
|
return m_styleSheets.contains(fileName.toLower().trimmed());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CStyleSheetUtility::updateFont(const QFont &font)
|
bool CStyleSheetUtility::updateFont(const QFont &font)
|
||||||
|
|||||||
Reference in New Issue
Block a user