gparted r971 - in trunk: . src
- From: gedakc svn gnome org
- To: svn-commits-list gnome org
- Subject: gparted r971 - in trunk: . src
- Date: Wed, 19 Nov 2008 20:17:32 +0000 (UTC)
Author: gedakc
Date: Wed Nov 19 20:17:32 2008
New Revision: 971
URL: http://svn.gnome.org/viewvc/gparted?rev=971&view=rev
Log:
Added language length conditional Undo display.
If translated language is relatively long, then split the "Resize/Move" toolbar button text into two lines, and do not display the "Undo" button.
Modified:
trunk/ChangeLog
trunk/src/Win_GParted.cc
Modified: trunk/src/Win_GParted.cc
==============================================================================
--- trunk/src/Win_GParted.cc (original)
+++ trunk/src/Win_GParted.cc Wed Nov 19 20:17:32 2008
@@ -223,7 +223,16 @@
//RESIZE/MOVE
image = manage( new Gtk::Image( Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON ) );
- toolbutton = Gtk::manage(new Gtk::ToolButton( *image, _("Resize/Move") ));
+ Glib::ustring str_temp = _("Resize/Move") ;
+ //Condition string split and Undo button.
+ // for longer translated string, split string in two and skip the Undo button to permit full toolbar to display
+ // FIXME: Is there a better way to do this, perhaps without the conditional? At the moment this seems to be the best compromise.
+ bool display_undo = true ;
+ if( str_temp .length() > 14 ) {
+ str_temp .replace( str_temp .find( "/" ), 1, "\n/" ) ;
+ display_undo = false ;
+ }
+ toolbutton = Gtk::manage(new Gtk::ToolButton( *image, str_temp ));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_resize) );
toolbar_main.append(*toolbutton);
TOOLBAR_RESIZE_MOVE = index++ ;
@@ -246,12 +255,15 @@
index++ ;
//UNDO and APPLY
- toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::UNDO));
- toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_undo) );
- toolbar_main.append(*toolbutton);
- TOOLBAR_UNDO = index++ ;
- toolbutton ->set_sensitive( false );
- toolbutton ->set_tooltip(tooltips, _("Undo Last Operation") );
+ if ( display_undo ) {
+ //Undo button is displayed only if translated language "Resize/Move" is not too long. See above setting of this condition.
+ toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::UNDO));
+ toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_undo) );
+ toolbar_main.append(*toolbutton);
+ TOOLBAR_UNDO = index++ ;
+ toolbutton ->set_sensitive( false );
+ toolbutton ->set_tooltip(tooltips, _("Undo Last Operation") );
+ }
toolbutton = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::APPLY));
toolbutton ->signal_clicked().connect( sigc::mem_fun(*this, &Win_GParted::activate_apply) );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]