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