refactor: AddResults => enum class ScreenAddResults
This commit is contained in:
parent
ffa5b88cdf
commit
7c06ae39ef
3 changed files with 12 additions and 11 deletions
|
|
@ -1037,7 +1037,7 @@ void MainWindow::autoAddScreen(const QString &name)
|
||||||
if (name.isEmpty())
|
if (name.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_serverConfig.autoAddScreen(name) == AutoAddScreenManualClient) {
|
if (m_serverConfig.autoAddScreen(name) == ScreenAddResults::AutoAddScreenManualClient) {
|
||||||
showConfigureServer(
|
showConfigureServer(
|
||||||
tr("Please add the client (%1) to the grid.").arg(Settings::value(Settings::Core::ScreenName).toString())
|
tr("Please add the client (%1) to the grid.").arg(Settings::value(Settings::Core::ScreenName).toString())
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -321,9 +321,10 @@ int ServerConfig::numScreens() const
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ServerConfig::autoAddScreen(const QString name)
|
ScreenAddResults ServerConfig::autoAddScreen(const QString name)
|
||||||
{
|
{
|
||||||
using enum AddAction;
|
using enum AddAction;
|
||||||
|
using enum ScreenAddResults;
|
||||||
|
|
||||||
int serverIndex = -1;
|
int serverIndex = -1;
|
||||||
int targetIndex = -1;
|
int targetIndex = -1;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,14 @@ const auto kDefaultProtocol = ServerProtocol::kBarrier;
|
||||||
|
|
||||||
} // namespace deskflow::gui
|
} // namespace deskflow::gui
|
||||||
|
|
||||||
|
enum class ScreenAddResults
|
||||||
|
{
|
||||||
|
AutoAddScreenOk,
|
||||||
|
AutoAddScreenManualServer,
|
||||||
|
AutoAddScreenManualClient,
|
||||||
|
AutoAddScreenIgnore
|
||||||
|
};
|
||||||
|
|
||||||
class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
|
class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
|
||||||
{
|
{
|
||||||
using ServerProtocol = deskflow::gui::ServerProtocol;
|
using ServerProtocol = deskflow::gui::ServerProtocol;
|
||||||
|
|
@ -148,7 +156,7 @@ public:
|
||||||
//
|
//
|
||||||
void commit();
|
void commit();
|
||||||
int numScreens() const;
|
int numScreens() const;
|
||||||
int autoAddScreen(const QString name);
|
ScreenAddResults autoAddScreen(const QString name);
|
||||||
const QString getServerName() const;
|
const QString getServerName() const;
|
||||||
void updateServerName();
|
void updateServerName();
|
||||||
const QString configFile() const;
|
const QString configFile() const;
|
||||||
|
|
@ -275,11 +283,3 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config);
|
QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config);
|
||||||
|
|
||||||
enum AddResults
|
|
||||||
{
|
|
||||||
AutoAddScreenOk,
|
|
||||||
AutoAddScreenManualServer,
|
|
||||||
AutoAddScreenManualClient,
|
|
||||||
AutoAddScreenIgnore
|
|
||||||
};
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue