[gparted] modern-gtk2: Use Gtk::Widget::set_tooltip_text() (!17)



commit 430ac9240c64d826dc9725aac7dd4e37bfcd44d1
Author: Luca Bacci <luca bacci982 gmail com>
Date:   Mon Aug 13 16:05:15 2018 +0200

    modern-gtk2: Use Gtk::Widget::set_tooltip_text() (!17)
    
    GParted was using Gtk::Tooltips widgets for tooltips, but they were
    deprecated in gtkmm 2.12 in favour of Gtk::Tooltip widgets.  (Note the
    spelling difference, with and without a trailing 's').
    
    As GParted's tooltips are all text only continue to use the shortcut,
    which is now Gtk::Widget::set_tooltip_text().
    
    References:
    https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Tooltips.html#details
    https://developer.gnome.org/gtkmm/2.24/classGtk_1_1Tooltip.html#details
    https://gitlab.gnome.org/GNOME/gtkmm/blob/2.20.0/NEWS#L740
    
    Closes !17 - Gtk2 modernisation

 include/Dialog_Base_Partition.h |  1 -
 include/Win_GParted.h           |  1 -
 src/Win_GParted.cc              | 16 ++++++++--------
 3 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/include/Dialog_Base_Partition.h b/include/Dialog_Base_Partition.h
index 10a52929..1b810a9e 100644
--- a/include/Dialog_Base_Partition.h
+++ b/include/Dialog_Base_Partition.h
@@ -28,7 +28,6 @@
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/table.h>
 #include <gtkmm/box.h>
-#include <gtkmm/tooltips.h>
 #include <gtkmm/optionmenu.h>
 
 namespace GParted
diff --git a/include/Win_GParted.h b/include/Win_GParted.h
index 59a9ab75..d5a4a146 100644
--- a/include/Win_GParted.h
+++ b/include/Win_GParted.h
@@ -226,7 +226,6 @@ private:
        Gtk::Statusbar statusbar;
        Gtk::Image *image ;
        Gtk::ScrolledWindow *scrollwindow;
-       Gtk::Tooltips tooltips ;
        Gtk::Table *table ;
        Gtk::ProgressBar pulsebar ;
        Gtk::TreeRow treerow;
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index c8dd0912..ddd74049 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -244,12 +244,12 @@ void Win_GParted::init_toolbar()
        toolbutton ->signal_clicked() .connect( sigc::mem_fun( *this, &Win_GParted::activate_new ) );
        toolbar_main .append( *toolbutton );
        TOOLBAR_NEW = index++ ;
-       toolbutton ->set_tooltip(tooltips, _("Create a new partition in the selected unallocated space") );   
          
+       toolbutton->set_tooltip_text(_("Create a new partition in the selected unallocated space"));
        toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::DELETE));
        toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_delete) );
        toolbar_main.append(*toolbutton);
        TOOLBAR_DEL = index++ ;
-       toolbutton ->set_tooltip(tooltips, _("Delete the selected partition") );                
+       toolbutton->set_tooltip_text(_("Delete the selected partition"));
        toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) );
        index++ ;
        
@@ -271,7 +271,7 @@ void Win_GParted::init_toolbar()
        toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_resize) );
        toolbar_main.append(*toolbutton);
        TOOLBAR_RESIZE_MOVE = index++ ;
-       toolbutton ->set_tooltip(tooltips, _("Resize/Move the selected partition") );           
+       toolbutton->set_tooltip_text(_("Resize/Move the selected partition"));
        toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) );
        index++ ;
 
@@ -280,12 +280,12 @@ void Win_GParted::init_toolbar()
        toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_copy) );
        toolbar_main.append(*toolbutton);
        TOOLBAR_COPY = index++ ;
-       toolbutton ->set_tooltip(tooltips, _("Copy the selected partition to the clipboard") );         
+       toolbutton->set_tooltip_text(_("Copy the selected partition to the clipboard"));
        toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::PASTE));
        toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_paste) );
        toolbar_main.append(*toolbutton);
        TOOLBAR_PASTE = index++ ;
-       toolbutton ->set_tooltip(tooltips, _("Paste the partition from the clipboard") );               
+       toolbutton->set_tooltip_text(_("Paste the partition from the clipboard"));
        toolbar_main.append( *(Gtk::manage(new Gtk::SeparatorToolItem)) );
        index++ ;
        
@@ -297,7 +297,7 @@ void Win_GParted::init_toolbar()
                toolbar_main.append(*toolbutton);
                TOOLBAR_UNDO = index++ ;
                toolbutton ->set_sensitive( false );
-               toolbutton ->set_tooltip(tooltips, _("Undo Last Operation") );
+               toolbutton->set_tooltip_text(_("Undo Last Operation"));
        }
        
        toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::APPLY));
@@ -305,8 +305,8 @@ void Win_GParted::init_toolbar()
        toolbar_main.append(*toolbutton);
        TOOLBAR_APPLY = index++ ;
        toolbutton ->set_sensitive( false );
-       toolbutton ->set_tooltip(tooltips, _("Apply All Operations") );         
-       
+       toolbutton->set_tooltip_text(_("Apply All Operations"));
+
        //initialize and pack combo_devices
        liststore_devices = Gtk::ListStore::create( treeview_devices_columns ) ;
        combo_devices .set_model( liststore_devices ) ;


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