implemented mk_label wherever possible

This commit is contained in:
Bart Hakvoort 2004-10-06 19:06:43 +00:00
parent e26341f862
commit bd3152788f
13 changed files with 85 additions and 116 deletions

View File

@ -1,3 +1,7 @@
2004-10-06 Bart Hakvoort <gparted@users.sf.net>
* implemented mk_label wherever possible (means less code, improved readability)
2004-10-06 David Lodge <dave@cirt.net> 2004-10-06 David Lodge <dave@cirt.net>
* configure.in (ALL_LINGUAS): Added "en_GB" (British English). * configure.in (ALL_LINGUAS): Added "en_GB" (British English).

View File

@ -24,13 +24,16 @@
#define DIALOG_ABOUT #define DIALOG_ABOUT
#include "../include/i18n.h" #include "../include/i18n.h"
#include "../include/Utils.h"
#include <gtkmm/dialog.h> #include <gtkmm/dialog.h>
#include <gtkmm/button.h> #include <gtkmm/button.h>
#include <gtkmm/label.h>
#include <gtkmm/stock.h> #include <gtkmm/stock.h>
#include <gtkmm/notebook.h> #include <gtkmm/notebook.h>
namespace GParted
{
class Dialog_About : public Gtk::Dialog class Dialog_About : public Gtk::Dialog
{ {
public: public:
@ -40,9 +43,10 @@ public:
private: private:
void Show_Credits() ; void Show_Credits() ;
Gtk::Label *label_temp ;
Gtk::Button button_credits; Gtk::Button button_credits;
}; };
} //GParted
#endif #endif

View File

@ -42,7 +42,7 @@ namespace GParted
class Dialog_Partition_Info : public Gtk::Dialog class Dialog_Partition_Info : public Gtk::Dialog
{ {
public: public:
Dialog_Partition_Info( const Partition & ); Dialog_Partition_Info( const Partition & partition );
~Dialog_Partition_Info(); ~Dialog_Partition_Info();
private: private:
@ -52,14 +52,13 @@ private:
//signalhandlers //signalhandlers
void drawingarea_on_realize( ); void drawingarea_on_realize( );
bool drawingarea_on_expose( GdkEventExpose * ); bool drawingarea_on_expose( GdkEventExpose *ev );
Partition partition ; Partition partition ;
Gtk::HBox *hbox ; Gtk::HBox *hbox ;
Gtk::DrawingArea drawingarea ; Gtk::DrawingArea drawingarea ;
Gtk::Frame *frame ; Gtk::Frame *frame ;
Gtk::Label *label ;
Gtk::Image *image; Gtk::Image *image;
Gtk::Table *table; Gtk::Table *table;

View File

@ -19,12 +19,15 @@
#define DIALOG_PARTITION_PROGRESS #define DIALOG_PARTITION_PROGRESS
#include "../include/i18n.h" #include "../include/i18n.h"
#include "../include/Utils.h"
#include <gtkmm/dialog.h> #include <gtkmm/dialog.h>
#include <gtkmm/progressbar.h> #include <gtkmm/progressbar.h>
#include <gtkmm/stock.h> #include <gtkmm/stock.h>
#include <gtkmm/label.h> #include <gtkmm/label.h>
namespace GParted
{
class Dialog_Progress : public Gtk::Dialog class Dialog_Progress : public Gtk::Dialog
{ {
@ -40,11 +43,13 @@ public:
int time_left ; int time_left ;
private: private:
Gtk::Label label_all_operations, label_current, *label_temp; Gtk::Label label_current ;
Gtk::ProgressBar progressbar_all, progressbar_current ; Gtk::ProgressBar progressbar_all, progressbar_current ;
double fraction; double fraction;
int count_operations, current_operation_number; int count_operations, current_operation_number;
}; };
}//GParted
#endif //DIALOG_PARTITION_PROGRESS #endif //DIALOG_PARTITION_PROGRESS

View File

@ -63,11 +63,17 @@ inline Sector Abs( Sector sectors )
return sectors < 0 ? sectors - 2*sectors : sectors ; return sectors < 0 ? sectors - 2*sectors : sectors ;
} }
inline Gtk::Label * mk_label( const Glib::ustring & text ) inline Gtk::Label * mk_label( const Glib::ustring & text, bool use_markup = true, bool align_left = true, bool wrap = false )
{ {
Gtk::Label * label = manage( new Gtk::Label() ) ; Gtk::Label * label = manage( new Gtk::Label( text ) ) ;
label ->set_markup( text ) ;
label ->set_use_markup( use_markup ) ;
if ( align_left )
label ->set_alignment( Gtk::ALIGN_LEFT ) ; label ->set_alignment( Gtk::ALIGN_LEFT ) ;
label ->set_line_wrap( wrap ) ;
return label ; return label ;
} }

View File

@ -91,8 +91,6 @@ private:
Glib::ustring str_temp ; Glib::ustring str_temp ;
int temp,selected_partition; int temp,selected_partition;
Gtk::Entry *entry_temp; Gtk::Entry *entry_temp;
Gtk::Label *label_temp;
}; };
} //GParted } //GParted

View File

@ -17,6 +17,9 @@
#include "../include/Device.h" #include "../include/Device.h"
namespace GParted
{
/* /*
* This is ridiculous!, if i use this one as a member function realpath starts complaining and won't compile :-S * This is ridiculous!, if i use this one as a member function realpath starts complaining and won't compile :-S
*/ */
@ -58,7 +61,6 @@ PedExceptionOption PedException_Handler (PedException* ex)
if ( show_libparted_message ) if ( show_libparted_message )
{ {
Gtk::Label *label_temp;
Gtk::HBox *hbox_filler; Gtk::HBox *hbox_filler;
Glib::ustring message = "<span weight=\"bold\" size=\"larger\">" + (Glib::ustring) _( "Libparted message" ) + "</span>\n\n" ; Glib::ustring message = "<span weight=\"bold\" size=\"larger\">" + (Glib::ustring) _( "Libparted message" ) + "</span>\n\n" ;
@ -68,31 +70,22 @@ PedExceptionOption PedException_Handler (PedException* ex)
Gtk::MessageDialog dialog( message, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true); Gtk::MessageDialog dialog( message, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true);
Gtk::Frame frame_libparted_message ; Gtk::Frame frame_libparted_message ;
frame_libparted_message .set_size_request( 400, -1 ); frame_libparted_message .set_size_request( 400, -1 );
label_temp = manage( new Gtk::Label("<b>" + (Glib::ustring) _( "Libparted message") + ": </b>" ) ) ; frame_libparted_message .set_label_widget( * mk_label("<b>" + (Glib::ustring) _( "Libparted message") + ": </b>" ) ) ;
label_temp ->set_use_markup( true ) ;
frame_libparted_message .set_label_widget( *label_temp ) ;
frame_libparted_message .set_border_width( 5 ) ; frame_libparted_message .set_border_width( 5 ) ;
label_temp = manage( new Gtk::Label( ) ) ;
label_temp ->set_size_request( 55, -1 ) ; //used like a simple filler ( remember this html cursus :-P )
hbox_filler = manage( new Gtk::HBox() ) ; hbox_filler = manage( new Gtk::HBox() ) ;
hbox_filler ->pack_start ( *label_temp, Gtk::PACK_SHRINK ) ; hbox_filler ->pack_start ( * mk_label( "\t\t" ), Gtk::PACK_SHRINK ) ; //filler
hbox_filler ->pack_start ( frame_libparted_message, Gtk::PACK_SHRINK ) ; hbox_filler ->pack_start ( frame_libparted_message, Gtk::PACK_SHRINK ) ;
dialog .get_vbox() ->pack_start( *hbox_filler, Gtk::PACK_SHRINK ) ; dialog .get_vbox() ->pack_start( *hbox_filler, Gtk::PACK_SHRINK ) ;
Gtk::Label label_libparted_message( "<i>" + error_message + "</i>" ) ; frame_libparted_message.add ( * mk_label( "<i>" + error_message + "</i>", true, false, true ) ) ;
label_libparted_message .set_selectable( true ) ;
label_libparted_message .set_use_markup( true ) ;
label_libparted_message .set_line_wrap( true ) ;
frame_libparted_message.add ( label_libparted_message ) ;
Gtk::CheckButton checkbutton_message( _( "Hide libparted messages for this session" ) ) ; Gtk::CheckButton checkbutton_message( _( "Hide libparted messages for this session" ) ) ;
checkbutton_message .set_border_width( 5 ) ; checkbutton_message .set_border_width( 5 ) ;
label_temp = manage( new Gtk::Label( ) ) ;
label_temp ->set_size_request( 55, -1 ) ;
hbox_filler = manage( new Gtk::HBox() ) ; hbox_filler = manage( new Gtk::HBox() ) ;
hbox_filler ->pack_start ( *label_temp, Gtk::PACK_SHRINK ) ; hbox_filler ->pack_start ( * mk_label( "\t\t" ), Gtk::PACK_SHRINK ) ;
hbox_filler ->pack_start ( checkbutton_message, Gtk::PACK_SHRINK ) ; hbox_filler ->pack_start ( checkbutton_message, Gtk::PACK_SHRINK ) ;
dialog .get_vbox() ->pack_start( *hbox_filler, Gtk::PACK_SHRINK ) ; dialog .get_vbox() ->pack_start( *hbox_filler, Gtk::PACK_SHRINK ) ;
@ -106,10 +99,7 @@ PedExceptionOption PedException_Handler (PedException* ex)
return PED_EXCEPTION_UNHANDLED ; return PED_EXCEPTION_UNHANDLED ;
} }
//--------------Device----------------------------------------------
namespace GParted
{
Device::Device() Device::Device()
{ {
} }

View File

@ -17,6 +17,9 @@
#include "../include/Dialog_About.h" #include "../include/Dialog_About.h"
namespace GParted
{
Dialog_About::Dialog_About() Dialog_About::Dialog_About()
{ {
/*TO TRANSLATORS: this is the dialog title */ /*TO TRANSLATORS: this is the dialog title */
@ -25,26 +28,11 @@ Dialog_About::Dialog_About()
this ->set_resizable( false ); this ->set_resizable( false );
this ->set_has_separator( false ) ; this ->set_has_separator( false ) ;
label_temp = manage( new Gtk::Label() ) ; this ->get_vbox() ->pack_start( * mk_label( "\n<span size='small'>logo here ;)</span>\n", true, false ), Gtk::PACK_SHRINK );
label_temp -> set_markup( "\n<span size='small'>logo here ;)</span>\n" ) ; this ->get_vbox() ->pack_start( * mk_label( "<span size='xx-large'><b>" + (Glib::ustring) _( "GParted" ) + " " + VERSION + "</b></span>", true, false ) ,Gtk::PACK_SHRINK );
this ->get_vbox()->pack_start( *label_temp ,Gtk::PACK_SHRINK ); this ->get_vbox() ->pack_start( * mk_label( "\n" + (Glib::ustring) _( "Gnome Partition Editor based on libparted" ) + "\n", false, false ) ,Gtk::PACK_SHRINK );
this ->get_vbox() ->pack_start( * mk_label( "<span size='small'>" + (Glib::ustring) _( "Copyright (c)" ) + " 2004 Bart Hakvoort</span>", true, false ) ,Gtk::PACK_SHRINK );
label_temp = manage( new Gtk::Label() ) ; this ->get_vbox() ->pack_start( * mk_label( "<span size='small'>http://gparted.sourceforge.net</span>", true, false ) ,Gtk::PACK_SHRINK );
label_temp -> set_markup( "<span size='xx-large'><b>" + (Glib::ustring) _( "GParted" ) + " " + VERSION + "</b></span>" ) ;
this ->get_vbox()->pack_start( *label_temp ,Gtk::PACK_SHRINK );
label_temp = manage( new Gtk::Label() ) ;
label_temp -> set_text( "\n" + (Glib::ustring) _( "Gnome Partition Editor based on libparted" ) + "\n" ) ;
this ->get_vbox()->pack_start( *label_temp ,Gtk::PACK_SHRINK );
label_temp = manage( new Gtk::Label() ) ;
label_temp -> set_markup( "<span size='small'>" + (Glib::ustring) _( "Copyright (c)" ) + " 2004 Bart Hakvoort</span>" ) ;
this ->get_vbox()->pack_start( *label_temp ,Gtk::PACK_SHRINK );
label_temp = manage( new Gtk::Label() ) ;
label_temp -> set_markup( "<span size='small'>http://gparted.sourceforge.net</span>" ) ;
label_temp -> set_selectable( true ) ;
this ->get_vbox()->pack_start( *label_temp ,Gtk::PACK_SHRINK );
button_credits.add_pixlabel( "/usr/share/icons/hicolor/16x16/stock/generic/stock_about.png", "Credits", 0, 0.5 ) ; button_credits.add_pixlabel( "/usr/share/icons/hicolor/16x16/stock/generic/stock_about.png", "Credits", 0, 0.5 ) ;
button_credits.signal_clicked() .connect( sigc::mem_fun( this, &Dialog_About::Show_Credits ) ) ; button_credits.signal_clicked() .connect( sigc::mem_fun( this, &Dialog_About::Show_Credits ) ) ;
@ -54,7 +42,6 @@ Dialog_About::Dialog_About()
this ->add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE ); this ->add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE );
this ->show_all_children() ; this ->show_all_children() ;
} }
void Dialog_About::Show_Credits() void Dialog_About::Show_Credits()
@ -62,26 +49,20 @@ void Dialog_About::Show_Credits()
Gtk::Dialog dialog( _("Credits"), *this ) ; Gtk::Dialog dialog( _("Credits"), *this ) ;
Gtk::Notebook notebook_credits; Gtk::Notebook notebook_credits;
Gtk::VBox vbox_written, vbox_translators ; Gtk::VBox vbox_written, vbox_translators ;
Gtk::Label label_writers, label_translators ;
//written by //written by
vbox_written .set_border_width( 5 ) ; vbox_written .set_border_width( 5 ) ;
label_writers .set_text( "Bart Hakvoort <gparted@users.sf.net>"); vbox_written .pack_start( * mk_label( "Bart Hakvoort <gparted@users.sf.net>", false ), Gtk::PACK_SHRINK ) ;
label_writers .set_selectable( true );
label_writers .set_alignment( Gtk::ALIGN_LEFT ) ;
vbox_written .pack_start( label_writers, Gtk::PACK_SHRINK ) ;
notebook_credits .set_size_request( -1, 200 ) ; notebook_credits .set_size_request( -1, 200 ) ;
/*TO TRANSLATORS: tablabel in aboutdialog */ /*TO TRANSLATORS: tablabel in aboutdialog */
notebook_credits .append_page( vbox_written, _("Written by") ) ; notebook_credits .append_page( vbox_written, _("Written by") ) ;
/*TO TRANSLATORS: your name(s) here please, if there are more translators put newlines (\n) between the names */ /*TO TRANSLATORS: your name(s) here please, if there are more translators put newlines (\n) between the names */
label_translators .set_text( _( "translator-credits") ) ; Glib::ustring str_credits = _("translator-credits") ;
label_translators .set_selectable( true ); if ( str_credits != "translator-credits" )
if ( label_translators .get_text() != "translator-credits" )
{ {
label_translators .set_alignment( Gtk::ALIGN_LEFT ) ; vbox_translators .pack_start( * mk_label( str_credits ), Gtk::PACK_SHRINK ) ;
vbox_translators .pack_start( label_translators, Gtk::PACK_SHRINK ) ;
/*TO TRANSLATORS: tablabel in aboutdialog */ /*TO TRANSLATORS: tablabel in aboutdialog */
notebook_credits .append_page( vbox_translators, _("Translated by") ) ; notebook_credits .append_page( vbox_translators, _("Translated by") ) ;
} }
@ -93,3 +74,5 @@ void Dialog_About::Show_Credits()
dialog .show_all_children() ; dialog .show_all_children() ;
dialog .run() ; dialog .run() ;
} }
}//GParted

View File

@ -85,7 +85,7 @@ Dialog_Base_Partition::Dialog_Base_Partition( )
//pack warning about small differences in values.. //pack warning about small differences in values..
this ->get_vbox() ->pack_start( * mk_label( "\n <i>" + (Glib::ustring) _( "NOTE: values on disk may differ slightly from the values entered here.") + "</i>" ), Gtk::PACK_SHRINK ); this ->get_vbox() ->pack_start( * mk_label( "\n <i>" + (Glib::ustring) _( "NOTE: values on disk may differ slightly from the values entered here.") + "</i>" ), Gtk::PACK_SHRINK );
this ->get_vbox() ->pack_start( *( manage( new Gtk::Label( "") ) ), Gtk::PACK_SHRINK ); //filler :-P this ->get_vbox() ->pack_start( * mk_label( "" ), Gtk::PACK_SHRINK ); //filler :-P
this->add_button( Gtk::Stock::CANCEL,Gtk::RESPONSE_CANCEL ); this->add_button( Gtk::Stock::CANCEL,Gtk::RESPONSE_CANCEL );
this ->show_all_children() ; this ->show_all_children() ;

View File

@ -41,20 +41,13 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition )
frame ->set_border_width( 10 ); frame ->set_border_width( 10 );
image = manage( new Gtk::Image( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON ) ); image = manage( new Gtk::Image( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON ) );
label = manage( new Gtk::Label( ) ) ;
label ->set_markup( "<b> " + (Glib::ustring) _( "Libparted message:" ) + " </b>" ) ;
hbox = manage( new Gtk::HBox() ); hbox = manage( new Gtk::HBox() );
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ; hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ;
hbox ->pack_start( *label, Gtk::PACK_SHRINK ) ; hbox ->pack_start( * mk_label( "<b> " + (Glib::ustring) _( "Libparted message:" ) + " </b>" ), Gtk::PACK_SHRINK ) ;
frame ->set_label_widget( *hbox ) ; frame ->set_label_widget( *hbox ) ;
frame ->add( * mk_label( "<i>" + partition.error + "</i>", true, true, true ) );
label = manage( new Gtk::Label( ) ) ;
label ->set_markup( "<i>" + partition.error + "</i>") ;
label ->set_selectable( true ) ;
label ->set_line_wrap( true ) ;
frame ->add( *label );
this ->get_vbox() ->pack_start( *frame, Gtk::PACK_SHRINK ) ; this ->get_vbox() ->pack_start( *frame, Gtk::PACK_SHRINK ) ;
} }

View File

@ -17,6 +17,9 @@
#include "../include/Dialog_Progress.h" #include "../include/Dialog_Progress.h"
namespace GParted
{
Dialog_Progress::Dialog_Progress( int count_operations, const Glib::ustring & first_operation ) Dialog_Progress::Dialog_Progress( int count_operations, const Glib::ustring & first_operation )
{ {
this ->set_size_request( 500, 275 ) ; this ->set_size_request( 500, 275 ) ;
@ -30,8 +33,6 @@ Dialog_Progress::Dialog_Progress( int count_operations, const Glib::ustring & fi
fraction = (double) 1 / count_operations ; fraction = (double) 1 / count_operations ;
fraction -= 1E-8 ; //minus 1E-8 is to prevent fraction from ever reaching >=1, it needs to be 0.0 < fraction < 1.0 fraction -= 1E-8 ; //minus 1E-8 is to prevent fraction from ever reaching >=1, it needs to be 0.0 < fraction < 1.0
label_temp = manage( new Gtk::Label() ) ;
label_temp ->set_alignment( Gtk::ALIGN_LEFT );
Glib::ustring str_temp = "<span weight=\"bold\" size=\"larger\">" ; Glib::ustring str_temp = "<span weight=\"bold\" size=\"larger\">" ;
str_temp += _( "Applying pending operations" ) ; str_temp += _( "Applying pending operations" ) ;
str_temp += "</span>\n\n" ; str_temp += "</span>\n\n" ;
@ -39,8 +40,7 @@ Dialog_Progress::Dialog_Progress( int count_operations, const Glib::ustring & fi
str_temp += "\n"; str_temp += "\n";
str_temp += _("Clicking Cancel will prevent the next operations from being applied.") ; str_temp += _("Clicking Cancel will prevent the next operations from being applied.") ;
str_temp += "\n"; str_temp += "\n";
label_temp ->set_markup( str_temp ) ; this->get_vbox() ->pack_start( * mk_label( str_temp ), Gtk::PACK_SHRINK );
this->get_vbox() ->pack_start( *label_temp, Gtk::PACK_SHRINK );
progressbar_current.set_text( _("initializing...") ); progressbar_current.set_text( _("initializing...") );
this->get_vbox() ->pack_start( progressbar_current , Gtk::PACK_SHRINK); this->get_vbox() ->pack_start( progressbar_current , Gtk::PACK_SHRINK);
@ -49,9 +49,7 @@ Dialog_Progress::Dialog_Progress( int count_operations, const Glib::ustring & fi
label_current.set_markup( "<i>" + first_operation + "</i>" ) ; label_current.set_markup( "<i>" + first_operation + "</i>" ) ;
this->get_vbox() ->pack_start( label_current, Gtk::PACK_SHRINK ); this->get_vbox() ->pack_start( label_current, Gtk::PACK_SHRINK );
label_all_operations.set_alignment( Gtk::ALIGN_LEFT ); this->get_vbox() ->pack_start( * mk_label( "<b>\n" + (Glib::ustring) _( "Completed Operations" ) + ":</b>" ), Gtk::PACK_SHRINK );
label_all_operations.set_markup( "<b>\n" + (Glib::ustring) _( "Completed Operations" ) + ":</b>");
this->get_vbox() ->pack_start( label_all_operations, Gtk::PACK_SHRINK );
progressbar_all.set_text( String::ucompose( _("%1 of %2 operations completed"), 0, count_operations ) ) ; progressbar_all.set_text( String::ucompose( _("%1 of %2 operations completed"), 0, count_operations ) ) ;
@ -88,3 +86,5 @@ void Dialog_Progress::Set_Progress_Current_Operation( )
else else
progressbar_current.set_text( String::ucompose( _("about %1 minutes and %2 seconds left"), time_left/60, time_left % 60 ) ) ; progressbar_current.set_text( String::ucompose( _("about %1 minutes and %2 seconds left"), time_left/60, time_left % 60 ) ) ;
} }
}//GParted

View File

@ -194,11 +194,6 @@ void VBox_VisualDisk::Build_Legend( )
legende_allow = true; legende_allow = true;
} }
//remove trailing whitespaces of last label_temp...
if ( label_temp )
label_temp ->set_text( label_temp ->get_text() .substr( 0, label_temp ->get_text() .length() -3) ) ;
//if there are any partitions add used/unused //if there are any partitions add used/unused
if ( ! only_unallocated ) if ( ! only_unallocated )
{ {
@ -224,8 +219,7 @@ void VBox_VisualDisk::Add_Legend_Item( const Glib::ustring & filesystem, const G
hbox_legend ->pack_start( *entry_temp, Gtk::PACK_SHRINK ); hbox_legend ->pack_start( *entry_temp, Gtk::PACK_SHRINK );
//and the label //and the label
label_temp = manage( new Gtk::Label( " " + filesystem ) ); hbox_legend ->pack_start( * mk_label( " " + filesystem, false, false ), Gtk::PACK_SHRINK );
hbox_legend ->pack_start( *label_temp, Gtk::PACK_SHRINK );
} }
void VBox_VisualDisk::Set_Selected( const Partition & partition ) void VBox_VisualDisk::Set_Selected( const Partition & partition )

View File

@ -202,10 +202,7 @@ void Win_GParted::init_device_info()
int top =0, bottom = 1; int top =0, bottom = 1;
//title //title
label = manage( new Gtk::Label() ) ; vbox_info .pack_start( * mk_label( " <b>" + (Glib::ustring) _( "Harddisk Information" ) + ":</b>" ), Gtk::PACK_SHRINK );
label ->set_alignment( Gtk::ALIGN_LEFT ) ;
label ->set_markup( " <b>" + (Glib::ustring) _( "Harddisk Information" ) + ":</b>" ) ;
vbox_info .pack_start( *label, Gtk::PACK_SHRINK );
//GENERAL DEVICE INFO //GENERAL DEVICE INFO
table = manage( new Gtk::Table() ) ; table = manage( new Gtk::Table() ) ;
@ -400,10 +397,7 @@ void Win_GParted::Find_Devices()
hbox ->pack_start( *image, Gtk::PACK_SHRINK ); hbox ->pack_start( *image, Gtk::PACK_SHRINK );
//the label... //the label...
label = manage( new Gtk::Label( " " + devices[i] ->Get_Path() + "\t(" + String::ucompose( _("%1 MB"), Sector_To_MB( devices[i] ->Get_Length() ) ) + ")" ) ) ; hbox ->pack_start( *mk_label( " " + devices[i] ->Get_Path() + "\t(" + String::ucompose( _("%1 MB"), Sector_To_MB( devices[i] ->Get_Length() ) ) + ")" ), Gtk::PACK_SHRINK );
label ->set_alignment( Gtk::ALIGN_LEFT );
hbox ->pack_start( *label, Gtk::PACK_SHRINK );
menu_item = manage( new Gtk::MenuItem( *hbox ) ) ; menu_item = manage( new Gtk::MenuItem( *hbox ) ) ;
menu_devices .items().push_back( *menu_item ); menu_devices .items().push_back( *menu_item );
@ -789,11 +783,10 @@ void Win_GParted::activate_resize()
//pffff this whole mess only for this f*cked up filesystem :-( //pffff this whole mess only for this f*cked up filesystem :-(
Gtk::Button button_resize_move ; Gtk::Button button_resize_move ;
Gtk::HBox hbox_resize_move; Gtk::HBox hbox_resize_move;
Gtk::Label label_resize_move( _("Resize/Move") );
image = manage( new Gtk::Image( Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON ) ); image = manage( new Gtk::Image( Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON ) );
hbox_resize_move .pack_start( *image, Gtk::PACK_SHRINK ) ; hbox_resize_move .pack_start( *image, Gtk::PACK_SHRINK ) ;
hbox_resize_move .pack_start( label_resize_move, Gtk::PACK_SHRINK ) ; hbox_resize_move .pack_start( * mk_label( _("Resize/Move") ), Gtk::PACK_SHRINK ) ;
button_resize_move .add( hbox_resize_move ) ; button_resize_move .add( hbox_resize_move ) ;
dialog .add_action_widget ( button_resize_move,Gtk::RESPONSE_OK ) ; dialog .add_action_widget ( button_resize_move,Gtk::RESPONSE_OK ) ;