From 5894104e6d914bbfd44b1ff6945ad50e76cd4c28 Mon Sep 17 00:00:00 2001 From: TrianguloY Date: Sat, 16 Mar 2019 23:16:52 +0100 Subject: [PATCH] Show toast when disabling scripts. (note: I don't fully understand the string naming convention, probably needs a different name) --- .../activities/MultiPurposeTransparentActivity.java | 6 +++++- .../pierrox/lightning_launcher/script/ScriptExecutor.java | 2 ++ app/llx/core/src/main/res/values/strings.xml | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/llx/core/src/main/java/net/pierrox/lightning_launcher/activities/MultiPurposeTransparentActivity.java b/app/llx/core/src/main/java/net/pierrox/lightning_launcher/activities/MultiPurposeTransparentActivity.java index 89d41ea..92db15d 100644 --- a/app/llx/core/src/main/java/net/pierrox/lightning_launcher/activities/MultiPurposeTransparentActivity.java +++ b/app/llx/core/src/main/java/net/pierrox/lightning_launcher/activities/MultiPurposeTransparentActivity.java @@ -6,6 +6,8 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; +import android.widget.Toast; + import net.pierrox.lightning_launcher.LLApp; import net.pierrox.lightning_launcher.R; import net.pierrox.lightning_launcher.api.ScreenIdentity; @@ -68,7 +70,9 @@ public class MultiPurposeTransparentActivity extends ResourceWrapperActivity { @Override public void onClick(DialogInterface dialogInterface, int i) { // should pass the base dir of the engine in the intent and use it instead of the default engine - LLApp.get().getAppEngine().getScriptManager().getOrLoadScript(script_id).setFlag(Script.FLAG_DISABLED, true); + LLApp llApp = LLApp.get(); + llApp.getAppEngine().getScriptManager().getOrLoadScript(script_id).setFlag(Script.FLAG_DISABLED, true); + Toast.makeText(llApp, R.string.sc_disable_toast, Toast.LENGTH_LONG).show(); finish(); } }); diff --git a/app/llx/core/src/main/java/net/pierrox/lightning_launcher/script/ScriptExecutor.java b/app/llx/core/src/main/java/net/pierrox/lightning_launcher/script/ScriptExecutor.java index d1d8ece..03f084b 100644 --- a/app/llx/core/src/main/java/net/pierrox/lightning_launcher/script/ScriptExecutor.java +++ b/app/llx/core/src/main/java/net/pierrox/lightning_launcher/script/ScriptExecutor.java @@ -344,6 +344,7 @@ public class ScriptExecutor { public void onClick(DialogInterface dialogInterface, int i) { mCurrentScriptDialog = false; mCurrentScript.setFlag(Script.FLAG_DISABLED, true); + Toast.makeText(context, R.string.sc_disable_toast, Toast.LENGTH_LONG).show(); } }); builder.setCancelable(false); @@ -406,6 +407,7 @@ public class ScriptExecutor { public void onClick(DialogInterface dialogInterface, int i) { mCurrentScriptDialog = false; script.setFlag(Script.FLAG_DISABLED, true); + Toast.makeText(context, R.string.sc_disable_toast, Toast.LENGTH_LONG).show(); continuePendingContinuation(pending, input == null ? false : null); } }); diff --git a/app/llx/core/src/main/res/values/strings.xml b/app/llx/core/src/main/res/values/strings.xml index 558694d..dbf668d 100644 --- a/app/llx/core/src/main/res/values/strings.xml +++ b/app/llx/core/src/main/res/values/strings.xml @@ -1309,7 +1309,9 @@ Use Script Service - Allows to view, create, editm delete and run scripts in Lightning Launcher. + Allows to view, create, edit, delete and run scripts in Lightning Launcher. + + Script disabled. Open it in the editor to enable again