mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Formatting this->ui to ui
This commit is contained in:
committed by
Roland Winklmeier
parent
7330ccba1b
commit
aafff6cd82
@@ -53,7 +53,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) :
|
||||
connect(sGui, &CApplication::updateInfoAvailable, this, &CSwiftLauncher::ps_loadedUpdateInfo);
|
||||
|
||||
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this, SLOT(ps_showLogPage()));
|
||||
this->ui->le_DBusServerPort->setValidator(new QIntValidator(0, 65535, this));
|
||||
ui->le_DBusServerPort->setValidator(new QIntValidator(0, 65535, this));
|
||||
|
||||
// default from settings
|
||||
const QString dbus(this->m_dbusServerAddress.getThreadLocal());
|
||||
@@ -86,11 +86,11 @@ CoreModes::CoreMode CSwiftLauncher::getCoreMode() const
|
||||
|
||||
QString CSwiftLauncher::getDBusAddress() const
|
||||
{
|
||||
if (this->ui->rb_DBusSession->isChecked()) { return CDBusServer::sessionBusAddress(); }
|
||||
if (this->ui->rb_DBusSystem->isChecked()) { return CDBusServer::systemBusAddress(); }
|
||||
if (ui->rb_DBusSession->isChecked()) { return CDBusServer::sessionBusAddress(); }
|
||||
if (ui->rb_DBusSystem->isChecked()) { return CDBusServer::systemBusAddress(); }
|
||||
return CDBusServer::p2pAddress(
|
||||
this->ui->cb_DBusServerAddress->currentText() + ":" +
|
||||
this->ui->le_DBusServerPort->text()
|
||||
ui->cb_DBusServerAddress->currentText() + ":" +
|
||||
ui->le_DBusServerPort->text()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void CSwiftLauncher::ps_displayLatestNews(QNetworkReply *reply)
|
||||
if (nwReply->error() == QNetworkReply::NoError)
|
||||
{
|
||||
const QString html = nwReply->readAll().trimmed();
|
||||
this->ui->te_LatestNews->setHtml(html);
|
||||
ui->te_LatestNews->setHtml(html);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,16 +118,16 @@ void CSwiftLauncher::init()
|
||||
{
|
||||
sGui->initMainApplicationWindow(this);
|
||||
|
||||
this->m_mwaOverlayFrame = this->ui->fr_SwiftLauncherMain;
|
||||
this->m_mwaOverlayFrame = ui->fr_SwiftLauncherMain;
|
||||
this->m_mwaStatusBar = nullptr;
|
||||
this->m_mwaLogComponent = this->ui->fr_SwiftLauncherLog;
|
||||
this->m_mwaLogComponent = ui->fr_SwiftLauncherLog;
|
||||
|
||||
this->ui->lbl_NewVersionUrl->setTextFormat(Qt::RichText);
|
||||
this->ui->lbl_NewVersionUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
this->ui->lbl_NewVersionUrl->setOpenExternalLinks(true);
|
||||
ui->lbl_NewVersionUrl->setTextFormat(Qt::RichText);
|
||||
ui->lbl_NewVersionUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
ui->lbl_NewVersionUrl->setOpenExternalLinks(true);
|
||||
|
||||
this->ui->wi_NewVersionAvailable->setVisible(false);
|
||||
this->ui->wi_NoNewVersion->setVisible(true);
|
||||
ui->wi_NewVersionAvailable->setVisible(false);
|
||||
ui->wi_NoNewVersion->setVisible(true);
|
||||
|
||||
this->initStyleSheet();
|
||||
this->initLogDisplay();
|
||||
@@ -157,9 +157,9 @@ void CSwiftLauncher::loadLatestNews()
|
||||
|
||||
void CSwiftLauncher::initDBusGui()
|
||||
{
|
||||
this->ui->cb_DBusServerAddress->addItem("127.0.0.1");
|
||||
this->ui->cb_DBusServerAddress->addItems(CNetworkUtils::getKnownIpAddresses());
|
||||
this->ui->cb_DBusServerAddress->setCurrentIndex(0);
|
||||
ui->cb_DBusServerAddress->addItem("127.0.0.1");
|
||||
ui->cb_DBusServerAddress->addItems(CNetworkUtils::getKnownIpAddresses());
|
||||
ui->cb_DBusServerAddress->setCurrentIndex(0);
|
||||
|
||||
connect(ui->cb_DBusServerAddress, &QComboBox::currentTextChanged, this, &CSwiftLauncher::ps_dbusServerAddressSelectionChanged);
|
||||
connect(ui->rb_DBusP2P, &QRadioButton::clicked, this, &CSwiftLauncher::ps_dbusServerModeSelected);
|
||||
@@ -169,7 +169,7 @@ void CSwiftLauncher::initDBusGui()
|
||||
|
||||
void CSwiftLauncher::initVersion()
|
||||
{
|
||||
this->ui->le_CurrentVersion->setText(sGui->versionStringDevBetaInfo());
|
||||
ui->le_CurrentVersion->setText(sGui->versionStringDevBetaInfo());
|
||||
}
|
||||
|
||||
void CSwiftLauncher::initLogDisplay()
|
||||
@@ -192,7 +192,7 @@ void CSwiftLauncher::startSwiftCore()
|
||||
"--dbus", dBus
|
||||
});
|
||||
|
||||
if (this->ui->rb_SwiftCoreAudio->isChecked())
|
||||
if (ui->rb_SwiftCoreAudio->isChecked())
|
||||
{
|
||||
args.append("--coreaudio");
|
||||
}
|
||||
@@ -260,7 +260,7 @@ bool CSwiftLauncher::canConnectDBusServer(QString &msg) const
|
||||
|
||||
bool CSwiftLauncher::isStandaloneGuiSelected() const
|
||||
{
|
||||
return this->ui->rb_SwiftStandalone->isChecked();
|
||||
return ui->rb_SwiftStandalone->isChecked();
|
||||
}
|
||||
|
||||
void CSwiftLauncher::setDefault(const QString &value)
|
||||
@@ -268,15 +268,15 @@ void CSwiftLauncher::setDefault(const QString &value)
|
||||
QString v(value.toLower().trimmed());
|
||||
if (v.isEmpty() || v.startsWith("session"))
|
||||
{
|
||||
this->ui->rb_DBusSession->setChecked(true);
|
||||
ui->rb_DBusSession->setChecked(true);
|
||||
}
|
||||
else if (v.startsWith("sys"))
|
||||
{
|
||||
this->ui->rb_DBusSystem->setChecked(true);
|
||||
ui->rb_DBusSystem->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui->rb_DBusP2P->setChecked(true);
|
||||
ui->rb_DBusP2P->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,9 +293,9 @@ QString CSwiftLauncher::toCmdLine(const QString &exe, const QStringList &exeArgs
|
||||
|
||||
void CSwiftLauncher::ps_loadSetup()
|
||||
{
|
||||
if (!this->ui->le_LatestVersion->text().isEmpty())
|
||||
if (!ui->le_LatestVersion->text().isEmpty())
|
||||
{
|
||||
this->ui->le_LatestVersion->setText("");
|
||||
ui->le_LatestVersion->setText("");
|
||||
const CStatusMessageList msgs(sApp->requestReloadOfSetupAndVersion());
|
||||
this->ps_appendLogMessages(msgs);
|
||||
}
|
||||
@@ -313,17 +313,17 @@ void CSwiftLauncher::ps_loadedUpdateInfo(bool success)
|
||||
const QString latestVersion(updateInfo.getLatestVersion()) ; // need to get this from somewhere
|
||||
CFailoverUrlList downloadUrls(updateInfo.getDownloadUrls());
|
||||
bool newVersionAvailable = CVersion::isNewerVersion(latestVersion) && !downloadUrls.isEmpty();
|
||||
this->ui->wi_NewVersionAvailable->setVisible(newVersionAvailable);
|
||||
this->ui->wi_NoNewVersion->setVisible(!newVersionAvailable);
|
||||
this->ui->le_LatestVersion->setText(latestVersion);
|
||||
this->ui->le_Channel->setText(updateInfo.getChannel());
|
||||
ui->wi_NewVersionAvailable->setVisible(newVersionAvailable);
|
||||
ui->wi_NoNewVersion->setVisible(!newVersionAvailable);
|
||||
ui->le_LatestVersion->setText(latestVersion);
|
||||
ui->le_Channel->setText(updateInfo.getChannel());
|
||||
|
||||
if (!downloadUrls.isEmpty())
|
||||
{
|
||||
const CUrl downloadUrl(downloadUrls.obtainNextUrl());
|
||||
const QString urlStr(downloadUrl.toQString());
|
||||
QString hl("<a href=\"%1\">%2 %3</a>");
|
||||
this->ui->lbl_NewVersionUrl->setText(hl.arg(urlStr).arg(urlStr).arg(latestVersion));
|
||||
ui->lbl_NewVersionUrl->setText(hl.arg(urlStr).arg(urlStr).arg(latestVersion));
|
||||
}
|
||||
|
||||
this->loadLatestNews();
|
||||
@@ -337,24 +337,24 @@ void CSwiftLauncher::ps_changedUpdateInfoCache()
|
||||
void CSwiftLauncher::ps_startButtonPressed()
|
||||
{
|
||||
QObject *sender = QObject::sender();
|
||||
if (sender == this->ui->tb_SwiftGui)
|
||||
if (sender == ui->tb_SwiftGui)
|
||||
{
|
||||
if (this->setSwiftGuiExecutable())
|
||||
{
|
||||
this->accept();
|
||||
}
|
||||
}
|
||||
else if (sender == this->ui->tb_SwiftData)
|
||||
else if (sender == ui->tb_SwiftData)
|
||||
{
|
||||
this->setSwiftDataExecutable();
|
||||
this->accept();
|
||||
}
|
||||
else if (sender == this->ui->tb_SwiftCore)
|
||||
else if (sender == ui->tb_SwiftCore)
|
||||
{
|
||||
if (this->isStandaloneGuiSelected()) { this->ui->rb_SwiftCoreGuiAudio->setChecked(true); }
|
||||
if (this->isStandaloneGuiSelected()) { ui->rb_SwiftCoreGuiAudio->setChecked(true); }
|
||||
this->startSwiftCore();
|
||||
}
|
||||
else if (sender == this->ui->tb_Database)
|
||||
else if (sender == ui->tb_Database)
|
||||
{
|
||||
const CUrl homePage(sApp->getGlobalSetup().getDbHomePageUrl());
|
||||
QDesktopServices::openUrl(homePage);
|
||||
@@ -366,21 +366,21 @@ void CSwiftLauncher::ps_dbusServerAddressSelectionChanged(const QString ¤t
|
||||
Q_UNUSED(currentText);
|
||||
if (this->isStandaloneGuiSelected())
|
||||
{
|
||||
this->ui->rb_SwiftCoreGuiAudio->setChecked(true);
|
||||
ui->rb_SwiftCoreGuiAudio->setChecked(true);
|
||||
}
|
||||
this->ui->rb_DBusP2P->setChecked(true);
|
||||
ui->rb_DBusP2P->setChecked(true);
|
||||
}
|
||||
|
||||
void CSwiftLauncher::ps_dbusServerModeSelected(bool selected)
|
||||
{
|
||||
if (!selected) { return; }
|
||||
if (!this->isStandaloneGuiSelected()) { return; }
|
||||
this->ui->rb_SwiftCoreGuiAudio->setChecked(true);
|
||||
ui->rb_SwiftCoreGuiAudio->setChecked(true);
|
||||
}
|
||||
|
||||
void CSwiftLauncher::ps_showStatusMessage(const CStatusMessage &msg)
|
||||
{
|
||||
this->ui->fr_SwiftLauncherMain->showOverlayMessage(msg, 5000);
|
||||
ui->fr_SwiftLauncherMain->showOverlayMessage(msg, 5000);
|
||||
}
|
||||
|
||||
void CSwiftLauncher::ps_appendLogMessage(const CStatusMessage &message)
|
||||
@@ -403,7 +403,7 @@ void CSwiftLauncher::ps_appendLogMessages(const CStatusMessageList &messages)
|
||||
|
||||
void CSwiftLauncher::ps_showMainPage()
|
||||
{
|
||||
this->ui->sw_SwiftLauncher->setCurrentWidget(this->ui->pg_SwiftLauncherMain);
|
||||
ui->sw_SwiftLauncher->setCurrentWidget(ui->pg_SwiftLauncherMain);
|
||||
}
|
||||
|
||||
void CSwiftLauncher::ps_tabChanged(int current)
|
||||
@@ -416,5 +416,5 @@ void CSwiftLauncher::ps_tabChanged(int current)
|
||||
|
||||
void CSwiftLauncher::ps_showLogPage()
|
||||
{
|
||||
this->ui->sw_SwiftLauncher->setCurrentWidget(this->ui->pg_SwiftLauncherLog);
|
||||
ui->sw_SwiftLauncher->setCurrentWidget(ui->pg_SwiftLauncherLog);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user