[Xfce4-commits] [xfce/xfce4-session] 03/08: Add a label for the currently active session

noreply at xfce.org noreply at xfce.org
Mon May 13 22:10:42 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-session.

commit 57ba99fa006219505549e05baa9e5392cc9eff9e
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sat May 11 23:30:47 2019 +0200

    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(-)

diff --git a/settings/main.c b/settings/main.c
index 720cec1..61879f5 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 <b>%s</b>";
+    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 d77e34a..9d24da1 100644
--- a/settings/xfce4-session-settings.ui
+++ b/settings/xfce4-session-settings.ui
@@ -222,18 +222,17 @@
                 <property name="border_width">12</property>
                 <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkBox" id="hbox10">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="valign">start</property>
                     <property name="margin_bottom">6</property>
-                    <property name="spacing">12</property>
+                    <property name="spacing">6</property>
                     <child>
-                      <object class="GtkImage" id="image10">
+                      <object class="GtkLabel" id="label_active_session">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="stock">gtk-dialog-info</property>
-                        <property name="icon_size">6</property>
+                        <property name="label" translatable="yes">Currently active session: <b>Default</b></property>
+                        <property name="use_markup">True</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -242,17 +241,19 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel" id="label21">
+                      <object class="GtkButton" id="btn_save_session">
+                        <property name="label" translatable="yes">Save Sess_ion</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">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.</property>
-                        <property name="justify">fill</property>
-                        <property name="wrap">True</property>
-                        <property name="xalign">0</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="valign">center</property>
+                        <property name="image">image2</property>
+                        <property name="use_underline">True</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
+                        <property name="pack_type">end</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
@@ -264,6 +265,75 @@
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkInfoBar">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child internal-child="action_area">
+                      <object class="GtkButtonBox">
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <property name="layout_style">end</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child internal-child="content_area">
+                      <object class="GtkBox">
+                        <property name="can_focus">False</property>
+                        <property name="spacing">16</property>
+                        <child>
+                          <object class="GtkImage" id="image10">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="icon_name">dialog-information-symbolic</property>
+                            <property name="icon_size">3</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label21">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="label" translatable="yes">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.</property>
+                            <property name="justify">fill</property>
+                            <property name="wrap">True</property>
+                            <property name="xalign">0</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
                   <object class="GtkScrolledWindow" id="scrolledwindow4">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -281,7 +351,7 @@
                   <packing>
                     <property name="expand">True</property>
                     <property name="fill">True</property>
-                    <property name="position">1</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
                 <child>
@@ -290,38 +360,10 @@
                     <property name="can_focus">False</property>
                     <property name="spacing">6</property>
                     <child>
-                      <object class="GtkButton" id="btn_save_session">
-                        <property name="label" translatable="yes">Save Sess_ion</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="valign">center</property>
-                        <property name="image">image2</property>
-                        <property name="use_underline">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
+                      <placeholder/>
                     </child>
                     <child>
-                      <object class="GtkButton" id="btn_clear_sessions">
-                        <property name="label" translatable="yes">Clear Save_d Sessions</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="halign">end</property>
-                        <property name="valign">center</property>
-                        <property name="image">image1</property>
-                        <property name="use_underline">True</property>
-                        <property name="always_show_image">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
+                      <placeholder/>
                     </child>
                     <child>
                       <placeholder/>
@@ -360,7 +402,7 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">2</property>
+                    <property name="position">3</property>
                   </packing>
                 </child>
               </object>
@@ -387,18 +429,75 @@
                 <property name="border_width">12</property>
                 <property name="orientation">vertical</property>
                 <child>
-                  <object class="GtkScrolledWindow" id="saved-sessions">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="shadow_type">in</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
                     <child>
-                      <object class="GtkTreeView" id="saved-sessions-list">
+                      <object class="GtkScrolledWindow" id="saved-sessions">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <child internal-child="selection">
-                          <object class="GtkTreeSelection"/>
+                        <property name="shadow_type">in</property>
+                        <child>
+                          <object class="GtkTreeView" id="saved-sessions-list">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <child internal-child="selection">
+                              <object class="GtkTreeSelection"/>
+                            </child>
+                          </object>
                         </child>
                       </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkButton" id="btn_delete_session">
+                            <property name="label" translatable="yes">Delete</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButton" id="btn_clear_sessions">
+                            <property name="label" translatable="yes">Clear Save_d Sessions</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="halign">end</property>
+                            <property name="valign">center</property>
+                            <property name="image">image1</property>
+                            <property name="use_underline">True</property>
+                            <property name="always_show_image">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <style>
+                          <class name="inline-toolbar"/>
+                        </style>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
                     </child>
                   </object>
                   <packing>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list