summaryrefslogtreecommitdiff
path: root/capplet/gsm-properties-dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'capplet/gsm-properties-dialog.c')
-rw-r--r--capplet/gsm-properties-dialog.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/capplet/gsm-properties-dialog.c b/capplet/gsm-properties-dialog.c
index a67d81a..d05d564 100644
--- a/capplet/gsm-properties-dialog.c
+++ b/capplet/gsm-properties-dialog.c
@@ -32,6 +32,7 @@
#include "gsm-properties-dialog.h"
#include "gsm-app-dialog.h"
+#include "msm-desktop-app-dialog.h"
#include "gsm-util.h"
#include "gsp-app.h"
#include "gsp-app-manager.h"
@@ -40,6 +41,7 @@
#define CAPPLET_TREEVIEW_WIDGET_NAME "session_properties_treeview"
#define CAPPLET_ADD_WIDGET_NAME "session_properties_add_button"
+#define CAPPLET_DESKTOP_ADD_WIDGET_NAME "session_properties_desktop_add_button"
#define CAPPLET_DELETE_WIDGET_NAME "session_properties_delete_button"
#define CAPPLET_EDIT_WIDGET_NAME "session_properties_edit_button"
#define CAPPLET_SAVE_WIDGET_NAME "session_properties_save_button"
@@ -61,6 +63,7 @@ struct _GsmPropertiesDialog
GtkTreeView *treeview;
GtkWidget *add_button;
+ GtkWidget *desktop_add_button;
GtkWidget *delete_button;
GtkWidget *edit_button;
@@ -388,6 +391,33 @@ on_add_app_clicked (GtkWidget *widget,
}
static void
+on_desktop_add_app_clicked (GtkWidget *widget,
+ GsmPropertiesDialog *dialog)
+{
+ GtkWidget *desktop_add_dialog;
+ gint response;
+ const char *filename;
+
+ desktop_add_dialog = msm_desktop_app_dialog_new (dialog->manager);
+ gtk_window_set_transient_for (GTK_WINDOW (desktop_add_dialog),
+ GTK_WINDOW (dialog));
+
+ gtk_widget_show_all (desktop_add_dialog);
+ response = gtk_dialog_run (GTK_DIALOG (desktop_add_dialog));
+
+ if (response == GTK_RESPONSE_OK)
+ {
+ filename = msm_dektop_app_dialog_get_selected (MSM_DESKTOP_APP_DIALOG (desktop_add_dialog));
+ if (filename != NULL)
+ {
+ gsp_app_copy_desktop_file (g_filename_to_uri (filename, NULL, NULL));
+ }
+ }
+
+ gtk_widget_destroy (desktop_add_dialog);
+}
+
+static void
on_delete_app_clicked (GtkWidget *widget,
GsmPropertiesDialog *dialog)
{
@@ -671,7 +701,6 @@ setup_dialog (GsmPropertiesDialog *dialog)
NULL);
gtk_tree_view_append_column (treeview, column);
-
gtk_tree_view_column_set_sort_column_id (column, STORE_COL_DESCRIPTION);
gtk_tree_view_set_search_column (treeview, STORE_COL_SEARCH);
@@ -716,7 +745,6 @@ setup_dialog (GsmPropertiesDialog *dialog)
STORE_COL_DESCRIPTION,
GTK_SORT_ASCENDING);
-
button = GTK_WIDGET (gtk_builder_get_object (dialog->xml,
CAPPLET_ADD_WIDGET_NAME));
dialog->add_button = button;
@@ -726,6 +754,14 @@ setup_dialog (GsmPropertiesDialog *dialog)
dialog);
button = GTK_WIDGET (gtk_builder_get_object (dialog->xml,
+ CAPPLET_DESKTOP_ADD_WIDGET_NAME));
+ dialog->desktop_add_button = button;
+ g_signal_connect (button,
+ "clicked",
+ G_CALLBACK (on_desktop_add_app_clicked),
+ dialog);
+
+ button = GTK_WIDGET (gtk_builder_get_object (dialog->xml,
CAPPLET_DELETE_WIDGET_NAME));
dialog->delete_button = button;
g_signal_connect (button,
@@ -741,7 +777,6 @@ setup_dialog (GsmPropertiesDialog *dialog)
G_CALLBACK (on_edit_app_clicked),
dialog);
-
button = GTK_WIDGET (gtk_builder_get_object (dialog->xml,
CAPPLET_REMEMBER_WIDGET_NAME));
@@ -859,7 +894,7 @@ gsm_properties_dialog_init (GsmPropertiesDialog *dialog)
gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (content_area), 2);
gtk_window_set_icon_name (GTK_WINDOW (dialog), "mate-session-properties");
gtk_window_set_title (GTK_WINDOW (dialog), _("Startup Applications Preferences"));