chore: rm unused ServerConfig::autoAddScreen
This commit is contained in:
parent
a82e9a4a74
commit
3580b4ead9
3 changed files with 0 additions and 69 deletions
|
|
@ -322,70 +322,6 @@ int ServerConfig::numScreens() const
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenAddResults ServerConfig::autoAddScreen(const QString name)
|
|
||||||
{
|
|
||||||
using enum AddAction;
|
|
||||||
using enum ScreenAddResults;
|
|
||||||
|
|
||||||
int serverIndex = -1;
|
|
||||||
int targetIndex = -1;
|
|
||||||
const auto screenName = Settings::value(Settings::Core::ScreenName).toString();
|
|
||||||
if (!findScreenName(screenName, serverIndex) && !fixNoServer(screenName, serverIndex)) {
|
|
||||||
return AutoAddScreenManualServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (findScreenName(name, targetIndex)) {
|
|
||||||
qDebug("ignoring screen already in config: %s", qPrintable(name));
|
|
||||||
return AutoAddScreenIgnore;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto result = static_cast<AddAction>(showAddClientDialog(name));
|
|
||||||
|
|
||||||
if (result == AddClientIgnore) {
|
|
||||||
return AutoAddScreenIgnore;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == AddClientOther) {
|
|
||||||
addToFirstEmptyGrid(name);
|
|
||||||
return AutoAddScreenManualClient;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
int startIndex = serverIndex;
|
|
||||||
int offset = 1;
|
|
||||||
int dirIndex = 0;
|
|
||||||
|
|
||||||
if (result == AddClientLeft) {
|
|
||||||
offset = -1;
|
|
||||||
dirIndex = 1;
|
|
||||||
} else if (result == AddClientUp) {
|
|
||||||
offset = -5;
|
|
||||||
dirIndex = 2;
|
|
||||||
} else if (result == AddClientDown) {
|
|
||||||
offset = 5;
|
|
||||||
dirIndex = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
int idx = adjacentScreenIndex(startIndex, neighbourDirs[dirIndex].x, neighbourDirs[dirIndex].y);
|
|
||||||
while (idx != -1) {
|
|
||||||
if (screens()[idx].isNull()) {
|
|
||||||
m_Screens[idx].setName(name);
|
|
||||||
success = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
startIndex += offset;
|
|
||||||
idx = adjacentScreenIndex(startIndex, neighbourDirs[dirIndex].x, neighbourDirs[dirIndex].y);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!success) {
|
|
||||||
addToFirstEmptyGrid(name);
|
|
||||||
return AutoAddScreenManualClient;
|
|
||||||
}
|
|
||||||
|
|
||||||
return AutoAddScreenOk;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ServerConfig::getServerName() const
|
QString ServerConfig::getServerName() const
|
||||||
{
|
{
|
||||||
return Settings::value(Settings::Core::ScreenName).toString();
|
return Settings::value(Settings::Core::ScreenName).toString();
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,6 @@ public:
|
||||||
//
|
//
|
||||||
void commit();
|
void commit();
|
||||||
int numScreens() const;
|
int numScreens() const;
|
||||||
ScreenAddResults autoAddScreen(const QString name);
|
|
||||||
QString getServerName() const;
|
QString getServerName() const;
|
||||||
void updateServerName();
|
void updateServerName();
|
||||||
QString configFile() const;
|
QString configFile() const;
|
||||||
|
|
|
||||||
|
|
@ -486,10 +486,6 @@ Do you want to connect to the server?
|
||||||
<source>%1 is disconnected</source>
|
<source>%1 is disconnected</source>
|
||||||
<translation type="unfinished">%1 está desconectado</translation>
|
<translation type="unfinished">%1 está desconectado</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Please add the client (%1) to the grid.</source>
|
|
||||||
<translation type="unfinished">Por favor agregue el cliente (%1) a la cuadrícula.</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Invalid Screen Name</source>
|
<source>Invalid Screen Name</source>
|
||||||
<translation type="unfinished">Nombre de pantalla no válido</translation>
|
<translation type="unfinished">Nombre de pantalla no válido</translation>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue