refactor: AddResults => enum class ScreenAddResults
This commit is contained in:
@ -1037,7 +1037,7 @@ void MainWindow::autoAddScreen(const QString &name)
|
||||
if (name.isEmpty())
|
||||
return;
|
||||
|
||||
if (m_serverConfig.autoAddScreen(name) == AutoAddScreenManualClient) {
|
||||
if (m_serverConfig.autoAddScreen(name) == ScreenAddResults::AutoAddScreenManualClient) {
|
||||
showConfigureServer(
|
||||
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;
|
||||
}
|
||||
|
||||
int ServerConfig::autoAddScreen(const QString name)
|
||||
ScreenAddResults ServerConfig::autoAddScreen(const QString name)
|
||||
{
|
||||
using enum AddAction;
|
||||
using enum ScreenAddResults;
|
||||
|
||||
int serverIndex = -1;
|
||||
int targetIndex = -1;
|
||||
|
||||
@ -37,6 +37,14 @@ const auto kDefaultProtocol = ServerProtocol::kBarrier;
|
||||
|
||||
} // namespace deskflow::gui
|
||||
|
||||
enum class ScreenAddResults
|
||||
{
|
||||
AutoAddScreenOk,
|
||||
AutoAddScreenManualServer,
|
||||
AutoAddScreenManualClient,
|
||||
AutoAddScreenIgnore
|
||||
};
|
||||
|
||||
class ServerConfig : public ScreenConfig, public deskflow::gui::IServerConfig
|
||||
{
|
||||
using ServerProtocol = deskflow::gui::ServerProtocol;
|
||||
@ -148,7 +156,7 @@ public:
|
||||
//
|
||||
void commit();
|
||||
int numScreens() const;
|
||||
int autoAddScreen(const QString name);
|
||||
ScreenAddResults autoAddScreen(const QString name);
|
||||
const QString getServerName() const;
|
||||
void updateServerName();
|
||||
const QString configFile() const;
|
||||
@ -275,11 +283,3 @@ private:
|
||||
};
|
||||
|
||||
QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config);
|
||||
|
||||
enum AddResults
|
||||
{
|
||||
AutoAddScreenOk,
|
||||
AutoAddScreenManualServer,
|
||||
AutoAddScreenManualClient,
|
||||
AutoAddScreenIgnore
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user