[Xfce4-commits] <parole:master> Cleanup of plugin manager interface.

Sean Davis noreply at xfce.org
Tue Jul 24 12:52:01 CEST 2012


Updating branch refs/heads/master
         to f405a4e720a72014fe5593032a3dc5f40b421d93 (commit)
       from 1367c515c940970c4ec7744ead8a94bbe5a9ae46 (commit)

commit f405a4e720a72014fe5593032a3dc5f40b421d93
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Tue Jul 24 06:50:10 2012 -0400

    Cleanup of plugin manager interface.

 data/interfaces/plugins.ui   |  152 +++++++++++++++++++++--------------------
 src/parole-plugins-manager.c |   44 +------------
 2 files changed, 80 insertions(+), 116 deletions(-)

diff --git a/data/interfaces/plugins.ui b/data/interfaces/plugins.ui
index c55b7ec..077687d 100644
--- a/data/interfaces/plugins.ui
+++ b/data/interfaces/plugins.ui
@@ -32,10 +32,10 @@
             <child>
               <object class="GtkButton" id="close">
                 <property name="label">gtk-close</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -119,112 +119,120 @@
                 <property name="can_focus">False</property>
                 <property name="spacing">10</property>
                 <child>
-                  <object class="GtkTable" id="table1">
+                  <object class="GtkVBox" id="vbox2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="n_rows">3</property>
-                    <property name="n_columns">2</property>
-                    <property name="column_spacing">4</property>
-                    <property name="row_spacing">10</property>
-                    <child>
-                      <object class="GtkLabel" id="label1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes"><b>Description:</b></property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="x_options"/>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label2">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes"><b>Author:</b></property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options"/>
-                        <property name="y_options"/>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="description">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="use_markup">True</property>
-                        <property name="wrap">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                      </packing>
-                    </child>
+                    <property name="spacing">12</property>
                     <child>
-                      <object class="GtkLabel" id="author">
+                      <object class="GtkFrame" id="frame1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="use_markup">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkLabel" id="description">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="yalign">0</property>
+                                <property name="wrap">True</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes"><b>Description</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
                       </object>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel" id="label4">
+                      <object class="GtkFrame" id="frame2">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes"><b>Site:</b></property>
-                        <property name="use_markup">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkLabel" id="author">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="yalign">0</property>
+                                <property name="wrap">True</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes"><b>Author</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
                       </object>
                       <packing>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options"/>
-                        <property name="y_options"/>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkHBox" id="site-box">
+                      <object class="GtkLinkButton" id="sitebutton">
+                        <property name="label" translatable="yes">Visit Website</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <child>
-                          <placeholder/>
-                        </child>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="relief">none</property>
+                        <property name="uri">http://goodies.xfce.org</property>
                       </object>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
+                    <property name="expand">True</property>
                     <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkHBox" id="hbox6">
+                  <object class="GtkHButtonBox" id="hbuttonbox1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">10</property>
+                    <property name="layout_style">end</property>
                     <child>
                       <object class="GtkButton" id="configure">
                         <property name="label">gtk-properties</property>
-                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="use_stock">True</property>
                         <signal name="clicked" handler="parole_plugins_manager_show_configure" swapped="no"/>
                       </object>
@@ -234,14 +242,10 @@
                         <property name="position">0</property>
                       </packing>
                     </child>
-                    <child>
-                      <placeholder/>
-                    </child>
                   </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>
diff --git a/src/parole-plugins-manager.c b/src/parole-plugins-manager.c
index 27fa2eb..ee4034d 100644
--- a/src/parole-plugins-manager.c
+++ b/src/parole-plugins-manager.c
@@ -283,11 +283,7 @@ void parole_plugins_manager_tree_cursor_changed_cb (GtkTreeView *view,
     ParolePluginInfo *info;
     gboolean configurable = FALSE;
     const gchar *site;
-    
-#if GTK_CHECK_VERSION (2, 18, 0)
-    gchar *site_text;
-#endif
-
+	
     parole_plugins_manager_get_selected_module_data (pref, &module, &info);
     
     if ( G_UNLIKELY (!module || !info))
@@ -297,15 +293,8 @@ void parole_plugins_manager_tree_cursor_changed_cb (GtkTreeView *view,
     
     gtk_label_set_markup (GTK_LABEL (pref->desc), info->desc);
     gtk_label_set_markup (GTK_LABEL (pref->author), info->authors);
-    
-#if GTK_CHECK_VERSION (2, 18, 0)
-    site_text = g_strdup_printf ("<a href=\"%s\">%s</a>", site, _("Visit Website"));
-    gtk_label_set_markup (GTK_LABEL (pref->site), site_text);
-    g_free (site_text);
 
-#else
     gtk_link_button_set_uri (GTK_LINK_BUTTON (pref->site), site);
-#endif
 
     gtk_widget_set_tooltip_text (pref->site, site);
 
@@ -331,24 +320,6 @@ parole_plugins_manager_unload_all (gpointer data, gpointer user_data)
     //g_object_unref (module);
 }
 
-#if !GTK_CHECK_VERSION (2, 18, 0)
-static void
-parole_plugins_manager_open_plugins_website (GtkLinkButton *bt, const gchar *link, gpointer data)
-{
-    gchar *cmd;
-    
-    cmd = g_strdup_printf ("%s %s","xdg-open", link);
-    
-    if ( !g_spawn_command_line_async (cmd, NULL) )
-    {
-        g_free (cmd);
-        cmd = g_strdup_printf ("%s %s","xfbrowser4", link);
-        g_spawn_command_line_async (cmd, NULL);
-    }
-    g_free (cmd);
-}
-#endif
-
 static ParolePluginInfo *
 parole_plugins_manager_get_plugin_info (const gchar *desktop_file)
 {
@@ -432,18 +403,7 @@ parole_plugins_manager_show_plugins_pref (GtkWidget *widget, ParolePluginsManage
     
     pref->desc = GTK_WIDGET (gtk_builder_get_object (builder, "description"));
     pref->author = GTK_WIDGET (gtk_builder_get_object (builder, "author"));
-    site_box = GTK_WIDGET (gtk_builder_get_object (builder, "site-box"));
-    
-#if GTK_CHECK_VERSION (2, 18, 0)
-    pref->site = gtk_label_new (NULL);
-#else
-    pref->site = gtk_link_button_new_with_label (" ", _("Visit Website"));
-    gtk_link_button_set_uri_hook ((GtkLinkButtonUriFunc) parole_plugins_manager_open_plugins_website,
-				  NULL, NULL);
-#endif
-    
-    gtk_box_pack_start (GTK_BOX (site_box), pref->site, FALSE, FALSE, 0);
-    
+    pref->site = GTK_WIDGET (gtk_builder_get_object (builder, "sitebutton"));
     pref->configure = GTK_WIDGET (gtk_builder_get_object (builder, "configure"));
     
     gtk_window_set_transient_for (GTK_WINDOW (pref->window), 


More information about the Xfce4-commits mailing list