From 57ba99fa006219505549e05baa9e5392cc9eff9e Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Sat, 11 May 2019 23:30:47 +0200 Subject: Add a label for the currently active session --- settings/main.c | 13 +++ settings/xfce4-session-settings.ui | 199 +++++++++++++++++++++++++++---------- 2 files changed, 162 insertions(+), 50 deletions(-) (limited to 'settings') diff --git a/settings/main.c b/settings/main.c index 720cec16..61879f54 100644 --- a/settings/main.c +++ b/settings/main.c @@ -79,10 +79,15 @@ main(int argc, GtkWidget *notebook; GtkWidget *xfae_page; GtkWidget *lbl; + GtkWidget *label_active_session; GError *error = NULL; XfconfChannel *channel; XfceRc *rc; gboolean visible; + gchar *active_session; + gchar *active_session_label; + const gchar *format; + gchar *markup; Window opt_socket_id = 0; gboolean opt_version = FALSE; @@ -159,6 +164,14 @@ main(int argc, gtk_widget_show(lbl); gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), xfae_page, lbl, 1); + label_active_session = GTK_WIDGET (gtk_builder_get_object (builder, "label_active_session")); + active_session = xfconf_channel_get_string (channel, "/general/SessionName", "Default"); + active_session_label = _("Currently active session:"); + format = "%s %s"; + markup = g_markup_printf_escaped (format, active_session_label, active_session); + gtk_label_set_markup (GTK_LABEL (label_active_session), markup); + g_free (markup); + /* Check if there are saved sessions and if so, show the "Saved Sessions" tab */ rc = settings_list_sessions_open_rc (); if (rc) diff --git a/settings/xfce4-session-settings.ui b/settings/xfce4-session-settings.ui index d77e34ae..9d24da17 100644 --- a/settings/xfce4-session-settings.ui +++ b/settings/xfce4-session-settings.ui @@ -222,18 +222,17 @@ 12 vertical - + True False - start 6 - 12 + 6 - + True False - gtk-dialog-info - 6 + Currently active session: <b>Default</b> + True False @@ -242,17 +241,19 @@ - + + Save Sess_ion True - False - These applications are a part of the currently-running session, and can be saved when you log out. Changes below will only take effect when the session is saved. - fill - True - 0 + True + True + center + image2 + True False True + end 1 @@ -263,6 +264,75 @@ 0 + + + True + False + + + False + 6 + end + + + + + + False + False + 0 + + + + + False + 16 + + + True + False + dialog-information-symbolic + 3 + + + False + True + 0 + + + + + True + False + True + These applications are a part of the currently-running session, and can be saved when you log out. Changes below will only take effect when the session is saved. + fill + True + 0 + + + True + True + 1 + + + + + False + False + 0 + + + + + + + + False + True + 1 + + True @@ -281,7 +351,7 @@ True True - 1 + 2 @@ -290,38 +360,10 @@ False 6 - - Save Sess_ion - True - True - True - center - image2 - True - - - False - True - 0 - + - - Clear Save_d Sessions - True - True - True - end - center - image1 - True - True - - - False - False - 1 - + @@ -360,7 +402,7 @@ False True - 2 + 3 @@ -387,18 +429,75 @@ 12 vertical - + True - True - in + False + vertical - + True True - - + in + + + True + True + + + + + + True + True + 0 + + + + + True + False + + + Delete + True + True + True + + + False + True + 0 + + + + + Clear Save_d Sessions + True + True + True + end + center + image1 + True + True + + + False + False + 1 + + + + + + False + True + 1 + -- cgit v1.2.1