Skip to content

Commit 016e307

Browse files
committed
Added possibility of multiple computer names in one action, allowing for one action to be executed on some computers, while not others. Also added computer name "all" to be executed on all computers
1 parent e308d45 commit 016e307

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

AssistantComputerControl/Translations/Danish.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"language": "Danish",
3-
"version": "1.4.0", //the version of the software this translation is made for
3+
"version": "1.4.2", //the version of the software this translation is made for
44
"translation_version": 2,
55

66
//Add your name to the bottom of the contributors list if you have contributed

AssistantComputerControl/Translations/English.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"language": "English",
3-
"version": "1.4.0", //the version of the software this translation is made for
3+
"version": "1.4.2", //the version of the software this translation is made for
44
"translation_version": 2,
55

66
//Add your name to the bottom of the contributors list if you have contributed

AssistantComputerControl/actionChecker.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,26 @@ private static void CheckAction(string theLine, string theFile) {
310310
if (theComputerName == "google" || theComputerName == "alexa") {
311311
MainProgram.DoDebug(" - The targetted 'PC name' is set to 'google' or 'alexa' - this is the old format; these names are reserved and cannot be used as 'Computer name'");
312312
} else {
313+
bool computerNameAccepted = false;
313314
MainProgram.DoDebug(" - Targetted computer is; " + theComputerName);
314-
if (thisComputerName == theComputerName) {
315-
MainProgram.DoDebug(" - This computer is the target!");
315+
316+
if (theComputerName == "all") {
317+
computerNameAccepted = true;
318+
MainProgram.DoDebug(" - Computer name is \"" + theComputerName + "\", meaning it targets all computers");
316319
} else {
317-
//Not this computer!
318-
MainProgram.DoDebug(" - Computer name \"" + theComputerName + "\" does not match \"" + thisComputerName + "\"");
319-
return;
320+
foreach (string computerName in theComputerName.Split(',')) {
321+
if (thisComputerName == computerName) {
322+
MainProgram.DoDebug(" - This computer is the target!");
323+
computerNameAccepted = true;
324+
break;
325+
}
326+
}
327+
328+
if (!computerNameAccepted) {
329+
//Not this computer!
330+
MainProgram.DoDebug(" - Computer name \"" + theComputerName + "\" does not match \"" + thisComputerName + "\" - not executing action");
331+
return;
332+
}
320333
}
321334
}
322335
} else {
0 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)