build: remove DESKFLOW_SHOW_DEV_THANKS define

This commit is contained in:
sithlord48
2024-10-31 14:47:40 -04:00
committed by Nick Bolton
parent 25dd0ddfbc
commit 147869e3a5
7 changed files with 2 additions and 75 deletions

View File

@ -16,7 +16,6 @@
macro(configure_definitions)
configure_meta()
configure_ninja()
configure_options()
@ -52,23 +51,6 @@ macro(configure_definitions)
endmacro()
macro(configure_meta)
set(DESKFLOW_SHOW_DEV_THANKS
true
CACHE BOOL "Show developer thanks message")
message(VERBOSE "Show dev thanks: ${DESKFLOW_SHOW_DEV_THANKS}")
if(DESKFLOW_SHOW_DEV_THANKS)
message(VERBOSE "Showing developer thanks message")
add_definitions(-DDESKFLOW_SHOW_DEV_THANKS)
else()
message(VERBOSE "Not showing developer thanks message")
endif()
endmacro()
macro(configure_ninja)
# use response files so that ninja can compile on windows, otherwise you get
# an error when linking qt: "The input line is too long."

View File

@ -776,19 +776,6 @@ void MainWindow::showFirstConnectedMessage()
messages::showFirstConnectedMessage(this, m_AppConfig.closeToTray(), m_AppConfig.enableService(), isServer);
}
void MainWindow::showDevThanksMessage()
{
if (!m_AppConfig.showDevThanks()) {
qDebug("skipping dev thanks message");
return;
}
m_AppConfig.setShowDevThanks(false);
m_ConfigScopes.save();
messages::showDevThanks(this, kAppName);
}
void MainWindow::onCoreProcessSecureSocket(bool enabled)
{
secureSocket(enabled);
@ -897,7 +884,6 @@ void MainWindow::onCoreConnectionStateChanged(CoreConnectionState state)
secureSocket(false);
} else if (isVisible()) {
showFirstConnectedMessage();
showDevThanksMessage();
}
}

View File

@ -194,7 +194,6 @@ private:
void resizeEvent(QResizeEvent *event) override;
void moveEvent(QMoveEvent *event) override;
void showFirstConnectedMessage();
void showDevThanksMessage();
void updateStatus();
void showAndActivate();

View File

@ -83,7 +83,7 @@ const char *const AppConfig::m_SettingsName[] = {
"closeToTray",
"mainWindowSize",
"mainWindowPosition",
"showDevThanks",
"", // 41 = Show dev thanks, obsolete
"showCloseReminder",
"enableUpdateCheck",
};
@ -149,7 +149,6 @@ void AppConfig::recallFromCurrentScope()
m_MainWindowPosition =
getFromCurrentScope<QPoint>(kMainWindowPosition, [](const QVariant &v) { return v.toPoint(); });
m_MainWindowSize = getFromCurrentScope<QSize>(kMainWindowSize, [](const QVariant &v) { return v.toSize(); });
m_ShowDevThanks = getFromCurrentScope(kShowDevThanks, m_ShowDevThanks).toBool();
m_ShowCloseReminder = getFromCurrentScope(kShowCloseReminder, m_ShowCloseReminder).toBool();
m_EnableUpdateCheck = getFromCurrentScope<bool>(kEnableUpdateCheck, [](const QVariant &v) { return v.toBool(); });
}
@ -207,7 +206,6 @@ void AppConfig::commit()
setInCurrentScope(kCloseToTray, m_CloseToTray);
setInCurrentScope(kMainWindowSize, m_MainWindowSize);
setInCurrentScope(kMainWindowPosition, m_MainWindowPosition);
setInCurrentScope(kShowDevThanks, m_ShowDevThanks);
setInCurrentScope(kShowCloseReminder, m_ShowCloseReminder);
setInCurrentScope(kEnableUpdateCheck, m_EnableUpdateCheck);
}
@ -576,11 +574,6 @@ std::optional<QPoint> AppConfig::mainWindowPosition() const
return m_MainWindowPosition;
}
bool AppConfig::showDevThanks() const
{
return m_ShowDevThanks;
}
bool AppConfig::showCloseReminder() const
{
return m_ShowCloseReminder;
@ -754,11 +747,6 @@ void AppConfig::setMainWindowPosition(const QPoint &position)
m_MainWindowPosition = position;
}
void AppConfig::setShowDevThanks(bool value)
{
m_ShowDevThanks = value;
}
void AppConfig::setShowCloseReminder(bool value)
{
m_ShowCloseReminder = value;

View File

@ -39,12 +39,6 @@ const ElevateMode kDefaultElevateMode = ElevateMode::kAutomatic;
const QString kDefaultLogFile = QStringLiteral("%1.log").arg(kAppId);
const int kDefaultTlsKeyLength = 2048;
#ifdef DESKFLOW_SHOW_DEV_THANKS
const bool kDefaultShowDevThanks = true;
#else
const bool kDefaultShowDevThanks = false;
#endif
#if defined(Q_OS_WIN)
const ProcessMode kDefaultProcessMode = ProcessMode::kService;
#else
@ -112,7 +106,7 @@ private:
kCloseToTray = 38,
kMainWindowSize = 39,
kMainWindowPosition = 40,
kShowDevThanks = 41,
// 41 = show dev thanks, obsolete
kShowCloseReminder = 42,
kEnableUpdateCheck = 43,
};
@ -187,7 +181,6 @@ public:
QString lastVersion() const;
std::optional<QSize> mainWindowSize() const;
std::optional<QPoint> mainWindowPosition() const;
bool showDevThanks() const;
bool showCloseReminder() const;
std::optional<bool> enableUpdateCheck() const;
@ -228,7 +221,6 @@ public:
void setLastVersion(const QString &version);
void setMainWindowSize(const QSize &size);
void setMainWindowPosition(const QPoint &position);
void setShowDevThanks(bool show);
void setShowCloseReminder(bool show);
void setEnableUpdateCheck(bool value);
@ -333,7 +325,6 @@ private:
int m_TlsKeyLength = deskflow::gui::kDefaultTlsKeyLength;
std::optional<QSize> m_MainWindowSize;
std::optional<QPoint> m_MainWindowPosition;
bool m_ShowDevThanks = deskflow::gui::kDefaultShowDevThanks;
bool m_LoadFromSystemScope = false;
bool m_ShowCloseReminder = true;
std::optional<bool> m_EnableUpdateCheck;

View File

@ -189,23 +189,6 @@ void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableSer
QMessageBox::information(parent, "Connected", message);
}
void showDevThanks(QWidget *parent, const QString &productName)
{
if (productName.isEmpty()) {
qFatal("product name not set");
}
QMessageBox::information(
parent, "Thank you!",
QString("<p>Thanks for using %1.</p>"
"<p>If you enjoy using this tool, visit our website:</p>"
R"(<p><a href="%2" style="color: %3")>%2</a></p>)"
"<p>Please report bugs and consider contributing code.</p>"
"<p>This message will only appear once.</p>")
.arg(productName, kUrlApp, kColorSecondary)
);
}
void showClientConnectError(QWidget *parent, ClientError error, const QString &address)
{
using enum ClientError;

View File

@ -47,8 +47,6 @@ void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableSer
void showCloseReminder(QWidget *parent);
void showDevThanks(QWidget *parent, const QString &productName);
void showClientConnectError(QWidget *parent, ClientError error, const QString &address);
NewClientPromptResult showNewClientPrompt(QWidget *parent, const QString &clientName);