mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-09 20:14:04 +08:00
Added plugin_error_notifications_enabled preference
This will allow user to control whether flashes and notifications for plugin errors are enabled or not. The `TermuxPreferenceConstants` classes has been updated to `v0.4.0`. Check its Changelog sections for info on changes.
This commit is contained in:
@@ -108,6 +108,9 @@ class DebuggingPreferencesDataStore extends PreferenceDataStore {
|
||||
case "terminal_view_key_logging_enabled":
|
||||
mPreferences.setTerminalViewKeyLoggingEnabled(value);
|
||||
break;
|
||||
case "plugin_error_notifications_enabled":
|
||||
mPreferences.setPluginErrorNotificationsEnabled(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -118,6 +121,8 @@ class DebuggingPreferencesDataStore extends PreferenceDataStore {
|
||||
switch (key) {
|
||||
case "terminal_view_key_logging_enabled":
|
||||
return mPreferences.getTerminalViewKeyLoggingEnabled();
|
||||
case "plugin_error_notifications_enabled":
|
||||
return mPreferences.getPluginErrorNotificationsEnabled();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@@ -130,4 +130,14 @@ public class TermuxAppSharedPreferences {
|
||||
SharedPreferenceUtils.setBoolean(mSharedPreferences, TERMUX_APP.KEY_TERMINAL_VIEW_KEY_LOGGING_ENABLED, value, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean getPluginErrorNotificationsEnabled() {
|
||||
return SharedPreferenceUtils.getBoolean(mSharedPreferences, TERMUX_APP.KEY_PLUGIN_ERROR_NOTIFICATIONS_ENABLED, TERMUX_APP.DEFAULT_VALUE_PLUGIN_ERROR_NOTIFICATIONS_ENABLED);
|
||||
}
|
||||
|
||||
public void setPluginErrorNotificationsEnabled(boolean value) {
|
||||
SharedPreferenceUtils.setBoolean(mSharedPreferences, TERMUX_APP.KEY_PLUGIN_ERROR_NOTIFICATIONS_ENABLED, value, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.termux.app.settings.preferences;
|
||||
|
||||
/*
|
||||
* Version: v0.3.0
|
||||
* Version: v0.4.0
|
||||
*
|
||||
* Changelog
|
||||
*
|
||||
@@ -16,7 +16,12 @@ package com.termux.app.settings.preferences;
|
||||
* Termux app and its plugins. This will allow {@link com.termux.app.TermuxSettings} to
|
||||
* manage preferences of plugins as well if they don't have launcher activity themselves
|
||||
* and also allow plugin apps to make changes to preferences from background.
|
||||
* - Added `KEY_LOG_LEVEL` to `TERMUX_TASKER_APP` scope.
|
||||
* - Added following to `TERMUX_TASKER_APP`:
|
||||
* `KEY_LOG_LEVEL`.
|
||||
*
|
||||
* - 0.4.0 (2021-03-13)
|
||||
* - Added following to `TERMUX_APP`:
|
||||
* `KEY_PLUGIN_ERROR_NOTIFICATIONS_ENABLED` and `DEFAULT_VALUE_PLUGIN_ERROR_NOTIFICATIONS_ENABLED`.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -71,6 +76,12 @@ public final class TermuxPreferenceConstants {
|
||||
public static final String KEY_TERMINAL_VIEW_KEY_LOGGING_ENABLED = "terminal_view_key_logging_enabled";
|
||||
public static final boolean DEFAULT_VALUE_TERMINAL_VIEW_KEY_LOGGING_ENABLED = false;
|
||||
|
||||
/**
|
||||
* Defines the key for whether flashes and notifications for plugin errors are enabled or not
|
||||
*/
|
||||
public static final String KEY_PLUGIN_ERROR_NOTIFICATIONS_ENABLED = "plugin_error_notifications_enabled";
|
||||
public static final boolean DEFAULT_VALUE_PLUGIN_ERROR_NOTIFICATIONS_ENABLED = true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user