[gnome-system-monitor] Move End Process button in the headerbar



commit 087e81e923ae16a72dafecbad3106516494e0e48
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Thu Jul 25 15:38:23 2013 +0200

    Move End Process button in the headerbar
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674405

 data/interface.ui |   32 +++++++++++++++-----------------
 src/interface.cpp |    3 +++
 src/procman-app.h |    1 +
 3 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/data/interface.ui b/data/interface.ui
index 5bbb105..7e6a00d 100644
--- a/data/interface.ui
+++ b/data/interface.ui
@@ -22,6 +22,21 @@
               </object>
             </child>
             <child>
+              <object class="GtkButton" id="end_process_button">
+                <property name="label" translatable="yes">End _Process</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="use_underline">True</property>
+                <property name="action_name">win.send-signal-end</property>
+                <property name="action_target">@i 15</property>
+              </object>
+              <packing>
+                <property name="pack_type">start</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkButton" id="refresh_button">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -136,23 +151,6 @@
                     <property name="position">1</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkButton" id="endprocessbutton">
-                    <property name="label" translatable="yes">End _Process</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="use_underline">True</property>
-                    <property name="action_name">win.send-signal-end</property>
-                    <property name="action_target">@i 15</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
               </object>
               <packing>
                 <property name="name">processes</property>
diff --git a/src/interface.cpp b/src/interface.cpp
index b30e475..c482076 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -483,6 +483,7 @@ update_page_activities (ProcmanApp *app)
     if (strcmp (current_page, "processes") == 0) {
         proctable_thaw (app);
 
+        gtk_widget_show (app->end_process_button);
         gtk_widget_show (app->refresh_button);
         gtk_widget_show (app->view_menu_button);
 
@@ -492,6 +493,7 @@ update_page_activities (ProcmanApp *app)
     } else {
         proctable_freeze (app);
 
+        gtk_widget_hide (app->end_process_button);
         gtk_widget_hide (app->refresh_button);
         gtk_widget_hide (app->view_menu_button);
 
@@ -555,6 +557,7 @@ create_main_window (ProcmanApp *app)
     gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (view_menu_button), view_menu_model);
 
     app->refresh_button = GTK_WIDGET (gtk_builder_get_object (builder, "refresh_button"));
+    app->end_process_button = GTK_WIDGET (gtk_builder_get_object (builder, "end_process_button"));
 
     GActionEntry win_action_entries[] = {
         { "about", on_activate_about, NULL, NULL, NULL },
diff --git a/src/procman-app.h b/src/procman-app.h
index ee48067..8888a82 100644
--- a/src/procman-app.h
+++ b/src/procman-app.h
@@ -171,6 +171,7 @@ public:
     GtkWidget        *stack;
     GtkWidget        *refresh_button;
     GtkWidget        *view_menu_button;
+    GtkWidget        *end_process_button;
     ProcConfig        config;
     LoadGraph        *cpu_graph;
     LoadGraph        *mem_graph;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]