Add warning for com-upd. shortcuts, fix disable state for it

pull/35/head
Miepee 4 years ago
parent 583e9557af
commit dd0e691525

@ -584,5 +584,11 @@ namespace AM2RLauncher.Language {
return ResourceManager.GetString("CreateShortcut", resourceCulture);
}
}
public static string ShortcutWarning {
get {
return ResourceManager.GetString("ShortcutWarning", resourceCulture);
}
}
}
}

@ -387,6 +387,10 @@ Bitte äußerste Vorsicht walten lassen.</value>
<value>Der offizielle AM2R Matrix Space</value>
</data>
<data name="CreateShortcut" xml:space="preserve">
<value>DESKTOPVERKNÜPFUNG ERTELLEN</value>
<value>DESKTOPVERKNÜPFUNG ERSTELLEN</value>
</data>
<data name="ShortcutWarning" xml:space="preserve">
<value>Das Starten der Community Updates durch Verknüpfungen umgeht den Launcher und dadurch auch automatische Updates.
Das Updaten von AM2R oder des Launchers kann nur durch das direkte Starten des Launchers passieren!</value>
</data>
</root>

@ -389,4 +389,8 @@ Procede con cautela.</value>
<data name="CreateShortcut" xml:space="preserve">
<value>CREAR ACCESO DIRECTO EN EL ESCRITORIO</value>
</data>
<data name="ShortcutWarning" xml:space="preserve">
<value>¡Ejecutar las Actualizaciones de la Comunidad desde el acceso directo ignorará el Launcher evitando actualizaciones automáticas!
¡AM2R y el Launcher solo pueden actualizarse abriendo el Launcher directamente!</value>
</data>
</root>

@ -389,4 +389,8 @@
<data name="CreateShortcut" xml:space="preserve">
<value>ショートカットをデスクトップに作成</value>
</data>
<data name="ShortcutWarning" xml:space="preserve">
<value>ショートカットからコミュニティアップデートを起動するとランチャーがパスされるため自動更新されません。
AM2Rやランチャーの更新は、ランチャーを直接起動することで実行されます。</value>
</data>
</root>

@ -391,4 +391,8 @@ Proceed with caution.</value>
<data name="CreateShortcut" xml:space="preserve">
<value>CREATE SHORTCUT ON DESKTOP</value>
</data>
<data name="ShortcutWarning" xml:space="preserve">
<value>Launching the Community Updates through the shortcut will bypass the Launcher and thus avoid automatic updates!
Updating AM2R or the Launcher can only be done by opening the Launcher directly!</value>
</data>
</root>

@ -389,4 +389,8 @@
<data name="CreateShortcut" xml:space="preserve">
<value>СОЗДАТЬ ЯРЛЫК НА РАБОЧЕМ СТОЛЕ</value>
</data>
<data name="ShortcutWarning" xml:space="preserve">
<value>Запуск обновлений сообщества через ярлык проигнорирует автоматические обновления лаунчера!
Обновить AM2R и лаунчер можно только открыв лаунчер напрямую!</value>
</data>
</root>

@ -391,4 +391,8 @@
<data name="CreateShortcut" xml:space="preserve">
<value>创建桌面快捷方式</value>
</data>
<data name="ShortcutWarning" xml:space="preserve">
<value>通过快捷方式运行社区更新版本,将会绕过启动器从而避免自动更新!
更新 AM2R 或者启动器只能通过直接打开启动器来完成!</value>
</data>
</root>

@ -773,6 +773,7 @@ public partial class MainForm : Form
log.Info("SettingsProfileDropDown.SelectedIndex has been changed to " + modSettingsProfileDropDown.SelectedIndex + ".");
if (modSettingsProfileDropDown.SelectedIndex <= 0 || modSettingsProfileDropDown.Items.Count == 0)
{
desktopShortcutButton.Enabled = false;
deleteModButton.Enabled = false;
deleteModButton.ToolTip = null;
updateModButton.Enabled = false;
@ -781,6 +782,7 @@ public partial class MainForm : Form
}
else
{
desktopShortcutButton.Enabled = true;
deleteModButton.Enabled = true;
deleteModButton.ToolTip = HelperMethods.GetText(Text.DeleteModButtonToolTip, profileName);
// On non-installable profiles we want to disable updating
@ -804,7 +806,14 @@ public partial class MainForm : Form
ProfileXML profile = profileList[modSettingsProfileDropDown.SelectedIndex];
log.Info($"User wants to create a desktop shortcut for {profile.Name}.");
//TODO: warning if used on community updates
// We want to give a warning to users, so they don't complain with "why didn't I get 2.0???"
if (profile.Name == "Community Updates (Latest)")
{
Application.Instance.Invoke(() =>
{
MessageBox.Show(Text.ShortcutWarning, Text.WarningWindowTitle, MessageBoxType.Warning);
});
}
string desktopFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop, Environment.SpecialFolderOption.Create);
string shortcutFile = "";
@ -832,7 +841,7 @@ public partial class MainForm : Form
// Replace values
desktopEntryText = desktopEntryText.Replace("PROFILENAME", $"{profile.Name}");
desktopEntryText = desktopEntryText.Replace("PROFILEDESCRIPTION", $"{profile.ProfileNotes}");
desktopEntryText = desktopEntryText.Replace("PROFILEDESCRIPTION", $"A shortcut for {profile.Name}.");
desktopEntryText = desktopEntryText.Replace("ICONPATH", $"{Core.PatchDataPath}/data/files_to_copy/icon.png");
string gameName;

@ -197,6 +197,7 @@ public partial class MainForm
// Only enable these, when we're not on the community updates
if (modSettingsProfileDropDown.SelectedIndex > 0)
{
desktopShortcutButton.Enabled = enabled;
updateModButton.Enabled = profileList[modSettingsProfileDropDown.SelectedIndex].Installable;
updateModButton.ToolTip = HelperMethods.GetText(Text.UpdateModButtonToolTip, selectedProfileName);
deleteModButton.Enabled = enabled;

@ -657,6 +657,7 @@ public partial class MainForm : Form
modSettingsProfileDropDown.DataStore = profileDropDown.DataStore; // It's actually more comfortable if it's outside, because of GTK shenanigans
modSettingsProfileDropDown.Bind(m => m.SelectedIndex, profileDropDown, p => p.SelectedIndex);
//TODO: this is copy pasted too often, make custom class for our buttons so we can just call *one* constructor.
desktopShortcutButton = profileButton = new ColorButton
{
Text = Text.CreateShortcut,

Loading…
Cancel
Save