[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 01/02: Add help buttons to all dialogs linking to wiki page

noreply at xfce.org noreply at xfce.org
Sun Aug 16 10:05:41 CEST 2015


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

omegaphil pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit 665d77a393d2af002fcd8421a3f9004c32fbe5d6
Author: OmegaPhil <OmegaPhil at startmail.com>
Date:   Sat Aug 15 21:02:55 2015 +0100

    Add help buttons to all dialogs linking to wiki page
---
 src/choose-monitor-window.cpp |   18 +++++++-----------
 src/choose-monitor-window.hpp |    1 -
 src/preferences-window.cpp    |    8 ++++++++
 src/ui.glade                  |   27 +++++++++++++++++++++------
 4 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/src/choose-monitor-window.cpp b/src/choose-monitor-window.cpp
index f6113fb..1a7a222 100644
--- a/src/choose-monitor-window.cpp
+++ b/src/choose-monitor-window.cpp
@@ -23,6 +23,7 @@
 
 #include <sstream>
 
+#include <gtkmm/linkbutton.h>
 #include <gtkmm/messagedialog.h>
 #include <gtkmm/stock.h>  // For creating a button image from stock
 
@@ -194,13 +195,13 @@ ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* panel_applet_local,
     menu->show_all();
   }
 
-  // connect close operations
-  Gtk::Button *help_button;
-  ui->get_widget("help_button", help_button);
+  /* Fix border on help linkbutton - border is specified in the glade config, yet
+   * it is ignored?? */
+  Gtk::LinkButton *link_button;
+  ui->get_widget("help_button", link_button);
+  link_button->set_relief(Gtk::RELIEF_NORMAL);
 
-  help_button->signal_clicked()
-    .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::on_help_button_clicked));
-  
+  // Connect close operations
   window->signal_delete_event()
     .connect(sigc::mem_fun(*this, &ChooseMonitorWindow::on_closed));
 }
@@ -630,11 +631,6 @@ void ChooseMonitorWindow::on_temperature_radiobutton_toggled()
     = temperature_radiobutton->get_active();
 }
 
-void ChooseMonitorWindow::on_help_button_clicked()
-{
-  // FIXME: do something
-}
-
 bool ChooseMonitorWindow::on_closed(GdkEventAny *)
 {
   window->hide();
diff --git a/src/choose-monitor-window.hpp b/src/choose-monitor-window.hpp
index e266fa5..c4109fa 100644
--- a/src/choose-monitor-window.hpp
+++ b/src/choose-monitor-window.hpp
@@ -123,7 +123,6 @@ private:
   void on_temperature_radiobutton_toggled();
   void on_network_interface_name_edited(const Glib::ustring& path,
                                         const Glib::ustring& new_text);
-  void on_help_button_clicked();
   bool on_closed(GdkEventAny *);
 };
 
diff --git a/src/preferences-window.cpp b/src/preferences-window.cpp
index 1975581..5882e32 100644
--- a/src/preferences-window.cpp
+++ b/src/preferences-window.cpp
@@ -26,6 +26,8 @@
 #include <cassert>
 #include <iostream>
 
+#include <gtkmm/linkbutton.h>
+
 #include "preferences-window.hpp"
 #include "choose-monitor-window.hpp"
 #include "gui-helpers.hpp"
@@ -212,6 +214,12 @@ PreferencesWindow::PreferencesWindow(Applet &applet_, monitor_seq monitors)
   ui->get_widget("flame_colorbutton", flame_colorbutton);
   connect_monitor_colorbutton(flame_colorbutton);
 
+  /* Fix border on help linkbutton - border is specified in the glade config, yet
+   * it is ignored?? */
+  Gtk::LinkButton *link_button;
+  ui->get_widget("help_button", link_button);
+  link_button->set_relief(Gtk::RELIEF_NORMAL);
+
   // Fill in values
   viewer_type_listener(applet.get_viewer_type(), true);
   background_color_listener(applet.get_background_color());
diff --git a/src/ui.glade b/src/ui.glade
index 630aba7..b0dfbc0 100644
--- a/src/ui.glade
+++ b/src/ui.glade
@@ -19,15 +19,14 @@
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <widget class="GtkButton" id="help_button">
+              <widget class="GtkLinkButton" id="help_button">
                 <property name="label">gtk-help</property>
-                <property name="response_id">-11</property>
                 <property name="visible">True</property>
-                <property name="sensitive">False</property>
                 <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
+                <property name="receives_default">True</property>
+                <property name="has_tooltip">True</property>
                 <property name="use_stock">True</property>
+                <property name="uri">http://goodies.xfce.org/projects/panel-plugins/xfce4-hardware-monitor-plugin#configuration_of_the_device_you_are_monitoring</property>
               </widget>
               <packing>
                 <property name="expand">False</property>
@@ -2593,6 +2592,22 @@ individual monitor values</property>
             <property name="spacing">12</property>
             <property name="layout_style">end</property>
             <child>
+              <widget class="GtkLinkButton" id="help_button">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="has_tooltip">True</property>
+                <property name="use_stock">True</property>
+                <property name="uri">http://goodies.xfce.org/projects/panel-plugins/xfce4-hardware-monitor-plugin#configuration_of_the_device_you_are_monitoring</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
               <widget class="GtkButton" id="close_button">
                 <property name="label">gtk-close</property>
                 <property name="visible">True</property>
@@ -2604,7 +2619,7 @@ individual monitor values</property>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </widget>

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


More information about the Xfce4-commits mailing list