debian/patches: Add 0001_hide_NoDisplay_apps.patch. Hide NoDisplay Apps in Startup Applications.
This commit is contained in:
200
debian/patches/0001_hide_NoDisplay_apps.patch
vendored
Normal file
200
debian/patches/0001_hide_NoDisplay_apps.patch
vendored
Normal file
@ -0,0 +1,200 @@
|
||||
Author: Wu Xiaotian <yetist@gmail.com>
|
||||
Description: Hide NoDisplay Apps in Startup Applications
|
||||
|
||||
diff --git a/capplet/gsm-properties-dialog.c b/capplet/gsm-properties-dialog.c
|
||||
index 20ceac8..bde8999 100644
|
||||
--- a/capplet/gsm-properties-dialog.c
|
||||
+++ b/capplet/gsm-properties-dialog.c
|
||||
@@ -43,11 +43,13 @@
|
||||
#define CAPPLET_EDIT_WIDGET_NAME "session_properties_edit_button"
|
||||
#define CAPPLET_SAVE_WIDGET_NAME "session_properties_save_button"
|
||||
#define CAPPLET_REMEMBER_WIDGET_NAME "session_properties_remember_toggle"
|
||||
+#define CAPPLET_SHOW_HIDDEN_WIDGET_NAME "session_properties_show_hidden_toggle"
|
||||
|
||||
#define STARTUP_APP_ICON "system-run"
|
||||
|
||||
#define SPC_CONFIG_SCHEMA "org.mate.session"
|
||||
#define SPC_AUTOSAVE_KEY "auto-save-session"
|
||||
+#define SPC_SHOW_HIDDEN_KEY "show-hidden-apps"
|
||||
|
||||
struct _GsmPropertiesDialog
|
||||
{
|
||||
@@ -179,6 +181,10 @@ append_app (GsmPropertiesDialog *dialog,
|
||||
GspApp *app)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
+ if (find_by_app (GTK_TREE_MODEL (dialog->list_store),
|
||||
+ &iter, app)) {
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
gtk_list_store_append (dialog->list_store, &iter);
|
||||
_fill_iter_from_app (dialog->list_store, &iter, app);
|
||||
@@ -457,6 +463,37 @@ on_row_activated (GtkTreeView *tree_view,
|
||||
on_edit_app_clicked (NULL, dialog);
|
||||
}
|
||||
|
||||
+static void
|
||||
+update_tree_view (GsmPropertiesDialog *dialog)
|
||||
+{
|
||||
+ GSList *apps;
|
||||
+ GSList *l;
|
||||
+ gboolean show_hidden;
|
||||
+ GspApp *app;
|
||||
+
|
||||
+ show_hidden = g_settings_get_boolean (dialog->settings, SPC_SHOW_HIDDEN_KEY);
|
||||
+
|
||||
+ apps = gsp_app_manager_get_apps (dialog->manager);
|
||||
+ for (l = apps; l != NULL; l = l->next) {
|
||||
+ app = GSP_APP (l->data);
|
||||
+ if (gsp_app_get_nodisplay(app)) {
|
||||
+ if (show_hidden) {
|
||||
+ _app_added (dialog, app, dialog->manager);
|
||||
+ }else{
|
||||
+ _app_removed (dialog, app, dialog->manager);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ g_slist_free (apps);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+on_show_hidden_clicked (GtkWidget *widget,
|
||||
+ GsmPropertiesDialog *dialog)
|
||||
+{
|
||||
+ update_tree_view (dialog);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
on_save_session_clicked (GtkWidget *widget,
|
||||
GsmPropertiesDialog *dialog)
|
||||
@@ -633,6 +670,17 @@ setup_dialog (GsmPropertiesDialog *dialog)
|
||||
g_settings_bind (dialog->settings, SPC_AUTOSAVE_KEY,
|
||||
button, "active", G_SETTINGS_BIND_DEFAULT);
|
||||
|
||||
+ button = GTK_WIDGET (gtk_builder_get_object (dialog->xml,
|
||||
+ CAPPLET_SHOW_HIDDEN_WIDGET_NAME));
|
||||
+
|
||||
+ g_settings_bind (dialog->settings, SPC_SHOW_HIDDEN_KEY,
|
||||
+ button, "active", G_SETTINGS_BIND_DEFAULT);
|
||||
+
|
||||
+ g_signal_connect (button,
|
||||
+ "clicked",
|
||||
+ G_CALLBACK (on_show_hidden_clicked),
|
||||
+ dialog);
|
||||
+
|
||||
button = GTK_WIDGET (gtk_builder_get_object (dialog->xml,
|
||||
CAPPLET_SAVE_WIDGET_NAME));
|
||||
g_signal_connect (button,
|
||||
@@ -648,6 +696,7 @@ setup_dialog (GsmPropertiesDialog *dialog)
|
||||
G_CALLBACK (_app_removed), dialog);
|
||||
|
||||
populate_model (dialog);
|
||||
+ update_tree_view (dialog);
|
||||
}
|
||||
|
||||
static GObject *
|
||||
diff --git a/capplet/gsp-app.c b/capplet/gsp-app.c
|
||||
index 1e970e6..169701f 100644
|
||||
--- a/capplet/gsp-app.c
|
||||
+++ b/capplet/gsp-app.c
|
||||
@@ -54,6 +54,7 @@ typedef struct {
|
||||
char *path;
|
||||
|
||||
gboolean hidden;
|
||||
+ gboolean nodisplay;
|
||||
gboolean enabled;
|
||||
|
||||
char *name;
|
||||
@@ -621,6 +622,18 @@ gsp_app_set_enabled (GspApp *app,
|
||||
_gsp_app_emit_changed (app);
|
||||
}
|
||||
|
||||
+gboolean
|
||||
+gsp_app_get_nodisplay (GspApp *app)
|
||||
+{
|
||||
+ GspAppPrivate *priv;
|
||||
+
|
||||
+ g_return_val_if_fail (GSP_IS_APP (app), FALSE);
|
||||
+
|
||||
+ priv = gsp_app_get_instance_private (app);
|
||||
+
|
||||
+ return priv->nodisplay;
|
||||
+}
|
||||
+
|
||||
const char *
|
||||
gsp_app_get_name (GspApp *app)
|
||||
{
|
||||
@@ -953,7 +966,9 @@ gsp_app_new (const char *path,
|
||||
priv->enabled = gsp_key_file_get_boolean (keyfile,
|
||||
GSP_KEY_FILE_DESKTOP_KEY_AUTOSTART_ENABLED,
|
||||
TRUE);
|
||||
-
|
||||
+ priv->nodisplay = gsp_key_file_get_boolean (keyfile,
|
||||
+ G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY,
|
||||
+ FALSE);
|
||||
priv->name = gsp_key_file_get_locale_string (keyfile,
|
||||
G_KEY_FILE_DESKTOP_KEY_NAME);
|
||||
priv->exec = gsp_key_file_get_string (keyfile,
|
||||
@@ -1100,6 +1115,7 @@ gsp_app_create (const char *name,
|
||||
|
||||
priv->hidden = FALSE;
|
||||
priv->enabled = TRUE;
|
||||
+ priv->nodisplay = FALSE;
|
||||
|
||||
if (!gsm_util_text_is_blank (name)) {
|
||||
priv->name = g_strdup (name);
|
||||
diff --git a/capplet/gsp-app.h b/capplet/gsp-app.h
|
||||
index e4ee457..6b0d640 100644
|
||||
--- a/capplet/gsp-app.h
|
||||
+++ b/capplet/gsp-app.h
|
||||
@@ -64,6 +64,7 @@ gboolean gsp_app_get_hidden (GspApp *app);
|
||||
gboolean gsp_app_get_enabled (GspApp *app);
|
||||
void gsp_app_set_enabled (GspApp *app,
|
||||
gboolean enabled);
|
||||
+gboolean gsp_app_get_nodisplay (GspApp *app);
|
||||
|
||||
const char *gsp_app_get_name (GspApp *app);
|
||||
const char *gsp_app_get_exec (GspApp *app);
|
||||
diff --git a/data/org.mate.session.gschema.xml.in b/data/org.mate.session.gschema.xml.in
|
||||
index b7f8f2d..f151dbb 100644
|
||||
--- a/data/org.mate.session.gschema.xml.in
|
||||
+++ b/data/org.mate.session.gschema.xml.in
|
||||
@@ -10,6 +10,11 @@
|
||||
<summary>Save sessions</summary>
|
||||
<description>If enabled, mate-session will save the session automatically.</description>
|
||||
</key>
|
||||
+ <key name="show-hidden-apps" type="b">
|
||||
+ <default>false</default>
|
||||
+ <summary>Show hidden autostart applications</summary>
|
||||
+ <description>If enabled, mate-session-properties will show hidden autostart applications.</description>
|
||||
+ </key>
|
||||
<key name="logout-prompt" type="b">
|
||||
<default>true</default>
|
||||
<summary>Logout prompt</summary>
|
||||
diff --git a/data/session-properties.ui b/data/session-properties.ui
|
||||
index fef715c..b162a15 100644
|
||||
--- a/data/session-properties.ui
|
||||
+++ b/data/session-properties.ui
|
||||
@@ -141,6 +141,21 @@
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
+ <child>
|
||||
+ <object class="GtkCheckButton" id="session_properties_show_hidden_toggle">
|
||||
+ <property name="label" translatable="yes">_Show hidden</property>
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="can_focus">True</property>
|
||||
+ <property name="receives_default">False</property>
|
||||
+ <property name="use_underline">True</property>
|
||||
+ <property name="draw_indicator">True</property>
|
||||
+ </object>
|
||||
+ <packing>
|
||||
+ <property name="expand">False</property>
|
||||
+ <property name="fill">True</property>
|
||||
+ <property name="position">2</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
1
debian/patches/series
vendored
1
debian/patches/series
vendored
@ -1 +1,2 @@
|
||||
0001_hide_NoDisplay_apps.patch
|
||||
0005_lock-session-before-user-switch.patch
|
||||
|
Reference in New Issue
Block a user