Bug #634090: Change some attributes to local variables

Some classes contained private attributes which were used only by a single
member function. Such items were moved to the corresponding function implementations
to stress their limited usage scope.

A few unused variables were also deleted.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
This commit is contained in:
Markus Elfring 2011-06-26 14:03:37 +02:00 committed by Curtis Gedak
parent e7a0fa05ea
commit 91b971691d
14 changed files with 248 additions and 239 deletions

View File

@ -41,15 +41,10 @@ public:
private: private:
void show_filesystem( const FS & fs ) ; void show_filesystem( const FS & fs ) ;
Gtk::HBox *hbox ;
Gtk::HBox *hbox2 ;
Gtk::VBox *vbox ;
Gtk::Image *image ;
Gtk::Expander expander_legend ; Gtk::Expander expander_legend ;
Gtk::TreeView treeview_filesystems; Gtk::TreeView treeview_filesystems;
Gtk::TreeRow treerow; Gtk::TreeRow treerow;
Glib::RefPtr<Gtk::ListStore> liststore_filesystems; Glib::RefPtr<Gtk::ListStore> liststore_filesystems;
Glib::ustring str_temp ;
struct treeview_filesystems_Columns : public Gtk::TreeModelColumnRecord struct treeview_filesystems_Columns : public Gtk::TreeModelColumnRecord
{ {

View File

@ -97,12 +97,8 @@ private:
Gtk::VBox vbox_resize_move; Gtk::VBox vbox_resize_move;
Gtk::Label label_minmax ; Gtk::Label label_minmax ;
Gtk::Table table_resize; Gtk::Table table_resize;
Gtk::HBox hbox_table, hbox_resizer, hbox_resize_move; Gtk::HBox hbox_table, hbox_resizer;
Gtk::Tooltips tooltips;
Gtk::Button button_resize_move ; Gtk::Button button_resize_move ;
Gtk::Image *image_temp ;
Glib::ustring str_temp ;
}; };
} //GParted } //GParted

View File

@ -39,11 +39,8 @@ public:
private: private:
Gtk::Expander expander_advanced ; Gtk::Expander expander_advanced ;
Gtk::HBox *hbox ;
Gtk::VBox *vbox ;
Gtk::Image image ; Gtk::Image image ;
Gtk::ComboBoxText combo_labeltypes ; Gtk::ComboBoxText combo_labeltypes ;
Glib::ustring str_temp ;
std::vector<Glib::ustring> labeltypes ; std::vector<Glib::ustring> labeltypes ;
}; };

View File

@ -52,11 +52,8 @@ private:
Partition partition ; Partition partition ;
Gtk::HBox *hbox ; Gtk::HBox *hbox ;
Gtk::VBox *vbox ;
Gtk::DrawingArea drawingarea ; Gtk::DrawingArea drawingarea ;
Gtk::Frame *frame ; Gtk::Frame *frame ;
Gtk::Image *image;
Gtk::Table *table;
Glib::RefPtr<Gdk::GC> gc; Glib::RefPtr<Gdk::GC> gc;
Glib::RefPtr<Pango::Layout> pango_layout; Glib::RefPtr<Pango::Layout> pango_layout;

View File

@ -40,13 +40,6 @@ public:
Glib::ustring get_new_label(); Glib::ustring get_new_label();
private: private:
Partition partition ;
Gtk::HBox *hbox ;
Gtk::VBox *vbox ;
Gtk::Frame *frame;
Gtk::Image *image;
Gtk::Table *table;
Gtk::Entry *entry; Gtk::Entry *entry;
}; };

View File

@ -48,12 +48,10 @@ private:
Gtk::Entry entry; Gtk::Entry entry;
std::vector<FS> FILESYSTEMS ; std::vector<FS> FILESYSTEMS ;
int cylinder_size ;
//signal handlers //signal handlers
void optionmenu_changed( bool ); void optionmenu_changed( bool );
Gdk::Color color_temp;
unsigned short new_count, first_creatable_fs ; unsigned short new_count, first_creatable_fs ;
}; };

View File

@ -58,7 +58,6 @@ private:
void on_response( int response_id ) ; void on_response( int response_id ) ;
bool on_delete_event( GdkEventAny * event ) ; bool on_delete_event( GdkEventAny * event ) ;
Gtk::VBox *vbox ;
Gtk::Label label_current ; Gtk::Label label_current ;
Gtk::Label label_current_sub ; Gtk::Label label_current_sub ;
Gtk::ProgressBar progressbar_all, progressbar_current ; Gtk::ProgressBar progressbar_all, progressbar_current ;
@ -96,7 +95,6 @@ private:
pthread_t pthread ; pthread_t pthread ;
double fraction ; double fraction ;
unsigned int t, warnings ; unsigned int t, warnings ;
Glib::ustring str_temp ;
Glib::Dispatcher dispatcher_update_gui_elements ; Glib::Dispatcher dispatcher_update_gui_elements ;
Glib::ustring label_current_sub_text ; Glib::ustring label_current_sub_text ;

View File

@ -44,55 +44,66 @@ DialogFeatures::DialogFeatures()
treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE ); treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE );
treeview_filesystems .set_rules_hint( true ) ; treeview_filesystems .set_rules_hint( true ) ;
hbox = manage( new Gtk::HBox() ) ; {
hbox ->set_border_width( 6 ) ; Gtk::HBox* hbox(manage(new Gtk::HBox()));
hbox ->pack_start( treeview_filesystems ) ;
get_vbox() ->pack_start( *hbox ) ;
//file system support legend hbox->set_border_width(6);
hbox2 = manage( new Gtk::HBox( false, 6 ) ) ; hbox->pack_start(treeview_filesystems);
hbox2 ->set_border_width( 6 ) ; get_vbox()->pack_start(*hbox);
hbox = manage( new Gtk::HBox() ) ; //file system support legend
str_temp = _("This chart shows the actions supported on file systems.") ; Gtk::HBox* hbox2(manage(new Gtk::HBox(false, 6)));
str_temp += "\n" ; hbox2->set_border_width(6);
str_temp += _("Not all actions are available on all file systems, in part due to the nature of file systems and limitations in the required software.") ;
hbox ->pack_start( * Utils::mk_label( str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true ),
Gtk::PACK_SHRINK );
hbox2 -> pack_start( *hbox ) ;
//icon legend hbox = manage(new Gtk::HBox());
vbox = manage( new Gtk::VBox() ) ; {
hbox = manage( new Gtk::HBox() ) ; Glib::ustring str_temp(_("This chart shows the actions supported on file systems."));
image = manage( new Gtk::Image( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ); str_temp += "\n" ;
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ; str_temp += _("Not all actions are available on all file systems, in part due to the nature of file systems and limitations in the required software.");
hbox ->pack_start( * Utils::mk_label( hbox->pack_start(*Utils::mk_label(str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true),
/* TO TRANSLATORS: Available Gtk::PACK_SHRINK);
* means that this action is valid for this file system. hbox2->pack_start(*hbox);
*/
_("Available") ), Gtk::PACK_EXPAND_WIDGET ) ;
vbox ->pack_start( *hbox ) ;
hbox = manage( new Gtk::HBox() ) ; {
image = manage( new Gtk::Image( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ); //icon legend
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ; Gtk::VBox* vbox(manage(new Gtk::VBox()));
hbox ->pack_start( * Utils::mk_label(
/* TO TRANSLATORS: Not Available
* means that this action is not valid for this file system.
*/
_("Not Available") ), Gtk::PACK_EXPAND_WIDGET ) ;
vbox ->pack_start( *hbox ) ;
hbox2 ->pack_start( *vbox ) ;
//legend hbox = manage(new Gtk::HBox());
str_temp = "<b>" ;
str_temp += _("Legend") ;
str_temp += "</b>" ;
expander_legend .set_label( str_temp ) ;
expander_legend .set_use_markup( true ) ;
get_vbox() ->pack_start( expander_legend, Gtk::PACK_SHRINK ) ; {
expander_legend .add( *hbox2 ) ; Gtk::Image* image(manage(new Gtk::Image(Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR)));
hbox->pack_start(*image, Gtk::PACK_SHRINK);
hbox->pack_start(*Utils::mk_label(
/* TO TRANSLATORS: Available
* means that this action is valid for this file system.
*/
_("Available")), Gtk::PACK_EXPAND_WIDGET );
vbox ->pack_start(*hbox);
hbox = manage(new Gtk::HBox());
image = manage(new Gtk::Image(Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR));
hbox->pack_start(*image, Gtk::PACK_SHRINK);
}
hbox->pack_start(*Utils::mk_label(
/* TO TRANSLATORS: Not Available
* means that this action is not valid for this file system.
*/
_("Not Available") ), Gtk::PACK_EXPAND_WIDGET);
vbox->pack_start(*hbox);
hbox2->pack_start(*vbox);
}
str_temp = "<b>";
str_temp += _("Legend");
str_temp += "</b>";
expander_legend.set_label(str_temp);
expander_legend.set_use_markup(true);
}
get_vbox()->pack_start(expander_legend, Gtk::PACK_SHRINK);
expander_legend.add(*hbox2);
}
//initialize icons //initialize icons
icon_yes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_yes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;

View File

@ -212,11 +212,15 @@ void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type )
break ; break ;
case RESIZE_MOVE: case RESIZE_MOVE:
image_temp = manage( new Gtk::Image( Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON ) ); {
hbox_resize_move .pack_start( *image_temp, Gtk::PACK_EXPAND_PADDING ) ; Gtk::Image* image_temp(manage(new Gtk::Image(Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON)));
hbox_resize_move .pack_start( * Utils::mk_label( fixed_start ? _("Resize") : _("Resize/Move") ), Gtk::HBox* box_resize_move(manage(new Gtk::HBox()));
Gtk::PACK_EXPAND_PADDING ) ;
button_resize_move .add( hbox_resize_move ) ; box_resize_move->pack_start(*image_temp, Gtk::PACK_EXPAND_PADDING);
box_resize_move->pack_start(*Utils::mk_label(fixed_start ? _("Resize") : _("Resize/Move")),
Gtk::PACK_EXPAND_PADDING);
button_resize_move.add(*box_resize_move);
}
this ->add_action_widget ( button_resize_move, Gtk::RESPONSE_OK ) ; this ->add_action_widget ( button_resize_move, Gtk::RESPONSE_OK ) ;
button_resize_move .set_sensitive( false ) ; button_resize_move .set_sensitive( false ) ;
@ -231,7 +235,7 @@ void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type )
void Dialog_Base_Partition::Set_MinMax_Text( Sector min, Sector max ) void Dialog_Base_Partition::Set_MinMax_Text( Sector min, Sector max )
{ {
str_temp = String::ucompose( _("Minimum size: %1 MiB"), min ) + "\t\t" ; Glib::ustring str_temp(String::ucompose( _("Minimum size: %1 MiB"), min ) + "\t\t");
str_temp += String::ucompose( _("Maximum size: %1 MiB"), max ) ; str_temp += String::ucompose( _("Maximum size: %1 MiB"), max ) ;
label_minmax .set_text( str_temp ) ; label_minmax .set_text( str_temp ) ;
} }

View File

@ -22,60 +22,68 @@ namespace GParted
{ {
Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std::vector<Glib::ustring> & disklabeltypes ) Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std::vector<Glib::ustring> & disklabeltypes )
: image(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG)
{ {
/*TO TRANSLATORS: dialogtitle, looks like Create partition table on /dev/hda */ /*TO TRANSLATORS: dialogtitle, looks like Create partition table on /dev/hda */
this ->set_title( String::ucompose( _("Create partition table on %1"), device_path ) ); this ->set_title( String::ucompose( _("Create partition table on %1"), device_path ) );
this ->set_has_separator( false ) ; this ->set_has_separator( false ) ;
this ->set_resizable( false ); this ->set_resizable( false );
hbox = manage( new Gtk::HBox() ) ; {
this ->get_vbox() ->pack_start( *hbox, Gtk::PACK_SHRINK ); Gtk::HBox* hbox(manage(new Gtk::HBox()));
vbox = manage( new Gtk::VBox() ) ; get_vbox()->pack_start(*hbox, Gtk::PACK_SHRINK);
vbox ->set_border_width( 10 ) ;
hbox ->pack_start( *vbox, Gtk::PACK_SHRINK );
image .set( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG ) ; Gtk::VBox* vbox(manage(new Gtk::VBox()));
vbox ->pack_start( image, Gtk::PACK_SHRINK );
vbox = manage( new Gtk::VBox() ) ; vbox->set_border_width(10);
vbox ->set_border_width( 10 ) ; hbox->pack_start(*vbox, Gtk::PACK_SHRINK);
hbox ->pack_start( *vbox, Gtk::PACK_SHRINK );
str_temp = "<span weight=\"bold\" size=\"larger\">" ; vbox->pack_start(image, Gtk::PACK_SHRINK);
/*TO TRANSLATORS: looks like WARNING: This will ERASE ALL DATA on the ENTIRE DISK /dev/hda */
str_temp += String::ucompose( _("WARNING: This will ERASE ALL DATA on the ENTIRE DISK %1"), device_path ) ;
str_temp += "</span>\n" ;
vbox ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK );
str_temp = _("Default is to create an MS-DOS partition table.") ; vbox = manage(new Gtk::VBox());
str_temp += "\n" ; vbox->set_border_width(10);
vbox ->pack_start( * Utils::mk_label( str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true ), hbox->pack_start(*vbox, Gtk::PACK_SHRINK);
Gtk::PACK_SHRINK );
//advanced {
str_temp = "<b>" ; Glib::ustring str_temp("<span weight=\"bold\" size=\"larger\">");
str_temp += _("Advanced") ;
expander_advanced .set_label( str_temp + "</b>" ) ;
expander_advanced .set_use_markup( true ) ;
vbox ->pack_start( expander_advanced, Gtk::PACK_SHRINK ) ; /*TO TRANSLATORS: looks like WARNING: This will ERASE ALL DATA on the ENTIRE DISK /dev/hda */
str_temp += String::ucompose(_("WARNING: This will ERASE ALL DATA on the ENTIRE DISK %1"), device_path);
str_temp += "</span>\n";
vbox->pack_start(*Utils::mk_label(str_temp), Gtk::PACK_SHRINK);
hbox = manage( new Gtk::HBox( false, 5 ) ) ; str_temp = _("Default is to create an MS-DOS partition table.");
hbox ->set_border_width( 5 ) ; str_temp += "\n";
str_temp = _("Select new partition table type:") ; vbox->pack_start(*Utils::mk_label(str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true),
str_temp += "\t" ; Gtk::PACK_SHRINK);
hbox ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK );
expander_advanced .add( *hbox ) ;
//create and add combo with partition table types (label types) str_temp = "<b>";
this ->labeltypes = disklabeltypes ; str_temp += _("Advanced");
str_temp += "</b>";
expander_advanced.set_label(str_temp);
expander_advanced.set_use_markup(true);
for ( unsigned int t = 0 ; t < labeltypes .size() ; t++ ) vbox->pack_start(expander_advanced, Gtk::PACK_SHRINK);
combo_labeltypes .append_text( labeltypes[ t ] ) ;
combo_labeltypes .set_active( 0 ) ; hbox = manage(new Gtk::HBox(false, 5));
hbox ->pack_start( combo_labeltypes, Gtk::PACK_SHRINK ) ; hbox->set_border_width(5);
str_temp = _("Select new partition table type:");
str_temp += "\t";
hbox->pack_start(*Utils::mk_label(str_temp), Gtk::PACK_SHRINK);
}
expander_advanced.add(*hbox);
//create and add combo with partition table types (label types)
this ->labeltypes = disklabeltypes ;
for (unsigned int t = 0; t < labeltypes.size(); ++t)
combo_labeltypes.append_text(labeltypes[t]);
combo_labeltypes.set_active(0);
hbox->pack_start(combo_labeltypes, Gtk::PACK_SHRINK);
}
this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ); this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL );
this ->add_button( Gtk::Stock::APPLY, Gtk::RESPONSE_APPLY ); this ->add_button( Gtk::Stock::APPLY, Gtk::RESPONSE_APPLY );

View File

@ -42,27 +42,34 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition )
frame = manage( new Gtk::Frame() ); frame = manage( new Gtk::Frame() );
frame ->set_border_width( 10 ); frame ->set_border_width( 10 );
image = manage( new Gtk::Image( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON ) ); {
Gtk::Image* image(manage(new Gtk::Image(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON)));
hbox = manage(new Gtk::HBox());
hbox->pack_start(*image, Gtk::PACK_SHRINK);
}
hbox = manage( new Gtk::HBox() );
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ;
hbox ->pack_start( * Utils::mk_label( "<b> " + Glib::ustring(_("Warning:") ) + " </b>" ), hbox ->pack_start( * Utils::mk_label( "<b> " + Glib::ustring(_("Warning:") ) + " </b>" ),
Gtk::PACK_SHRINK ) ; Gtk::PACK_SHRINK ) ;
frame ->set_label_widget( *hbox ) ; frame ->set_label_widget( *hbox ) ;
//FIXME: for more clarity we should add a listview here with alternating rowcolors.. //FIXME: for more clarity we should add a listview here with alternating rowcolors..
//that way it's easier to tell messages apart.. //that way it's easier to tell messages apart..
vbox = manage( new Gtk::VBox( false, 4 ) ); {
vbox ->set_border_width( 5 ) ; Gtk::VBox* vbox(manage(new Gtk::VBox(false,4)));
for ( unsigned int t = 0 ; t < partition .messages .size() ; t++ ) vbox->set_border_width(5);
vbox ->pack_start( * Utils::mk_label( "<i>" + partition .messages[t] + "</i>",
true, for (unsigned int t = 0; t < partition.messages.size(); ++t)
Gtk::ALIGN_LEFT, vbox->pack_start(*Utils::mk_label("<i>" + partition .messages[t] + "</i>",
Gtk::ALIGN_CENTER, true,
true ), Gtk::ALIGN_LEFT,
Gtk::PACK_SHRINK ) ; Gtk::ALIGN_CENTER,
frame ->add( *vbox ) ; true),
Gtk::PACK_SHRINK);
frame->add(*vbox);
}
this ->get_vbox() ->pack_start( *frame, Gtk::PACK_SHRINK ) ; this ->get_vbox() ->pack_start( *frame, Gtk::PACK_SHRINK ) ;
} }
@ -143,7 +150,8 @@ void Dialog_Partition_Info::Display_Info()
{ {
int top = 0, bottom = 1 ; int top = 0, bottom = 1 ;
table = manage( new Gtk::Table() ) ; Gtk::Table* table(manage(new Gtk::Table()));
table ->set_border_width( 5 ) ; table ->set_border_width( 5 ) ;
table ->set_col_spacings(10 ) ; table ->set_col_spacings(10 ) ;
this ->get_vbox() ->pack_start( *table, Gtk::PACK_SHRINK ) ; this ->get_vbox() ->pack_start( *table, Gtk::PACK_SHRINK ) ;

View File

@ -22,8 +22,6 @@ namespace GParted
Dialog_Partition_Label::Dialog_Partition_Label( const Partition & partition ) Dialog_Partition_Label::Dialog_Partition_Label( const Partition & partition )
{ {
this ->partition = partition ;
this ->set_resizable( false ) ; this ->set_resizable( false ) ;
this ->set_has_separator( false ) ; this ->set_has_separator( false ) ;
this ->set_size_request( 300, 80 ) ; this ->set_size_request( 300, 80 ) ;
@ -31,31 +29,32 @@ Dialog_Partition_Label::Dialog_Partition_Label( const Partition & partition )
/*TO TRANSLATORS: dialog title, looks like Set partition label on /dev/hda3 */ /*TO TRANSLATORS: dialog title, looks like Set partition label on /dev/hda3 */
this ->set_title( String::ucompose( _("Set partition label on %1"), partition .get_path() ) ); this ->set_title( String::ucompose( _("Set partition label on %1"), partition .get_path() ) );
//Table {
int top = 0, bottom = 1 ; int top = 0, bottom = 1;
//Create table to hold Label and entry box //Create table to hold Label and entry box
table = manage( new Gtk::Table() ) ; Gtk::Table* table(manage(new Gtk::Table()));
table ->set_border_width( 5 ) ;
table ->set_col_spacings(10 ) ; table->set_border_width(5);
this ->get_vbox() ->pack_start( *table, Gtk::PACK_SHRINK ) ; table->set_col_spacings(10);
//Label get_vbox()->pack_start(*table, Gtk::PACK_SHRINK);
table ->attach( * Utils::mk_label( "<b>" + Glib::ustring( _("Label:") ) + "</b>" ), table->attach(*Utils::mk_label("<b>" + Glib::ustring(_("Label:")) + "</b>"),
0, 1, 0, 1,
top, bottom, top, bottom,
Gtk::FILL ) ; Gtk::FILL);
//Create Text entry box //Create Text entry box
entry = manage( new Gtk::Entry() ); entry = manage(new Gtk::Entry());
entry ->set_max_length( 30 ); entry->set_max_length(30);
entry ->set_width_chars( 20 ); entry->set_width_chars(20);
entry ->set_activates_default( true ); entry->set_activates_default(true);
entry ->set_text( partition.label ); entry->set_text(partition.label);
entry ->select_region( 0, entry ->get_text_length() ); entry->select_region(0, entry ->get_text_length());
//Add entry box to table //Add entry box to table
table ->attach( *entry, table->attach(*entry,
1, 2, 1, 2,
top++, bottom++, top++, bottom++,
Gtk::FILL ) ; Gtk::FILL);
}
this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ) ; this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ) ;
this ->add_button( Gtk::Stock::OK, Gtk::RESPONSE_OK ) ; this ->add_button( Gtk::Stock::OK, Gtk::RESPONSE_OK ) ;

View File

@ -42,7 +42,6 @@ void Dialog_Partition_New::Set_Data( const Partition & partition,
{ {
this ->new_count = new_count; this ->new_count = new_count;
this ->selected_partition = partition; this ->selected_partition = partition;
this ->cylinder_size = cylinder_size ;
//copy GParted FILESYSTEMS //copy GParted FILESYSTEMS
this ->FILESYSTEMS = FILESYSTEMS ; this ->FILESYSTEMS = FILESYSTEMS ;
@ -307,13 +306,15 @@ void Dialog_Partition_New::optionmenu_changed( bool type )
} }
//set fitting resizer colors //set fitting resizer colors
//backgroundcolor.. {
color_temp .set( optionmenu_type .get_history() == 2 ? "darkgrey" : "white" ) ; Gdk::Color color_temp;
frame_resizer_base ->override_default_rgb_unused_color( color_temp );
//partitioncolor.. color_temp.set((optionmenu_type.get_history() == 2) ? "darkgrey" : "white");
color_temp .set( Utils::get_color( fs .filesystem ) ) ; frame_resizer_base->override_default_rgb_unused_color(color_temp);
frame_resizer_base ->set_rgb_partition_color( color_temp ) ;
color_temp.set(Utils::get_color(fs.filesystem));
frame_resizer_base->set_rgb_partition_color(color_temp);
}
frame_resizer_base ->Draw_Partition() ; frame_resizer_base ->Draw_Partition() ;
} }

View File

@ -41,72 +41,75 @@ Dialog_Progress::Dialog_Progress( const std::vector<Operation *> & operations )
dispatcher_update_gui_elements .connect( dispatcher_update_gui_elements .connect(
sigc::mem_fun( this, &Dialog_Progress::dispatcher_on_update_gui_elements ) ) ; sigc::mem_fun( this, &Dialog_Progress::dispatcher_on_update_gui_elements ) ) ;
vbox = manage( new Gtk::VBox() ) ;
vbox ->set_border_width( 10 ) ;
this ->get_vbox() ->pack_start( *vbox, Gtk::PACK_SHRINK ) ;
Glib::ustring str_temp = _("Depending on the number and type of operations this might take a long time.") ;
str_temp += "\n";
vbox ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK );
label_current .set_alignment( Gtk::ALIGN_LEFT );
vbox ->pack_start( label_current, Gtk::PACK_SHRINK ) ;
progressbar_current .set_pulse_step( 0.01 ) ;
vbox ->pack_start( progressbar_current, Gtk::PACK_SHRINK );
label_current_sub .set_alignment( Gtk::ALIGN_LEFT );
vbox ->pack_start( label_current_sub, Gtk::PACK_SHRINK );
vbox ->pack_start( * Utils::mk_label( "<b>" + Glib::ustring( _("Completed Operations:") ) + "</b>" ),
Gtk::PACK_SHRINK );
vbox ->pack_start( progressbar_all, Gtk::PACK_SHRINK );
//create some icons here, instead of recreating them every time
icon_execute = render_icon( Gtk::Stock::EXECUTE, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
icon_succes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
icon_error = render_icon( Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
icon_info = render_icon( Gtk::Stock::INFO, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
icon_n_a = render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
treestore_operations = Gtk::TreeStore::create( treeview_operations_columns );
treeview_operations .set_model( treestore_operations );
treeview_operations .set_headers_visible( false );
treeview_operations .set_rules_hint( true ) ;
treeview_operations .set_size_request( 500, 250 ) ;
treeview_operations .append_column( "", treeview_operations_columns .operation_description );
treeview_operations .append_column( "", treeview_operations_columns .elapsed_time );
treeview_operations .append_column( "", treeview_operations_columns .status_icon );
treeview_operations .get_column( 0 ) ->set_expand( true ) ;
treeview_operations .get_column( 0 ) ->set_cell_data_func(
* ( treeview_operations .get_column( 0 ) ->get_first_cell_renderer() ),
sigc::mem_fun(*this, &Dialog_Progress::on_cell_data_description) ) ;
//fill 'er up
for ( unsigned int t = 0 ; t < operations .size() ; t++ )
{ {
this ->operations[ t ] ->operation_detail .set_description( operations[ t ] ->description, FONT_BOLD ) ; Gtk::VBox* vbox(manage(new Gtk::VBox()));
this ->operations[ t ] ->operation_detail .set_treepath( Utils::num_to_str( t ) ) ;
treerow = *( treestore_operations ->append() ); vbox->set_border_width(10);
treerow[ treeview_operations_columns .operation_description ] = this->get_vbox()->pack_start(*vbox, Gtk::PACK_SHRINK);
this ->operations[ t ] ->operation_detail .get_description() ;
Glib::ustring str_temp(_("Depending on the number and type of operations this might take a long time."));
str_temp += "\n";
vbox->pack_start(*Utils::mk_label(str_temp), Gtk::PACK_SHRINK);
label_current.set_alignment(Gtk::ALIGN_LEFT);
vbox->pack_start(label_current, Gtk::PACK_SHRINK);
progressbar_current.set_pulse_step(0.01);
vbox->pack_start(progressbar_current, Gtk::PACK_SHRINK);
label_current_sub.set_alignment(Gtk::ALIGN_LEFT);
vbox->pack_start(label_current_sub, Gtk::PACK_SHRINK);
vbox->pack_start(*Utils::mk_label("<b>" + Glib::ustring(_("Completed Operations:")) + "</b>"),
Gtk::PACK_SHRINK);
vbox->pack_start(progressbar_all, Gtk::PACK_SHRINK);
//create some icons here, instead of recreating them every time
icon_execute = render_icon(Gtk::Stock::EXECUTE, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_succes = render_icon(Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_error = render_icon(Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_info = render_icon(Gtk::Stock::INFO, Gtk::ICON_SIZE_LARGE_TOOLBAR);
icon_n_a = render_icon(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_LARGE_TOOLBAR);
treestore_operations = Gtk::TreeStore::create( treeview_operations_columns);
treeview_operations.set_model(treestore_operations);
treeview_operations.set_headers_visible(false);
treeview_operations.set_rules_hint(true);
treeview_operations.set_size_request(500, 250);
treeview_operations.append_column("", treeview_operations_columns.operation_description);
treeview_operations.append_column("", treeview_operations_columns.elapsed_time);
treeview_operations.append_column("", treeview_operations_columns.status_icon);
treeview_operations.get_column(0)->set_expand(true);
treeview_operations.get_column(0)->set_cell_data_func(
*(treeview_operations.get_column(0)->get_first_cell_renderer()),
sigc::mem_fun(*this, &Dialog_Progress::on_cell_data_description) );
//fill 'er up
for (unsigned int t = 0; t < operations.size(); ++t)
{
this->operations[t]->operation_detail.set_description(operations[t]->description, FONT_BOLD);
this->operations[t]->operation_detail.set_treepath(Utils::num_to_str(t));
treerow = *(treestore_operations->append());
treerow[treeview_operations_columns.operation_description] =
this ->operations[t]->operation_detail.get_description();
}
scrolledwindow.set_shadow_type(Gtk::SHADOW_ETCHED_IN);
scrolledwindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
scrolledwindow.add(treeview_operations);
expander_details.set_label("<b>" + Glib::ustring(_("Details")) + "</b>");
expander_details.set_use_markup(true);
expander_details.property_expanded().signal_changed().connect(
sigc::mem_fun(*this, &Dialog_Progress::on_expander_changed) );
expander_details.add(scrolledwindow);
vbox ->pack_start(expander_details, Gtk::PACK_EXPAND_WIDGET);
vbox ->set_spacing(5);
} }
scrolledwindow .set_shadow_type( Gtk::SHADOW_ETCHED_IN ) ;
scrolledwindow .set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ) ;
scrolledwindow .add( treeview_operations ) ;
expander_details .set_label( "<b>" + Glib::ustring( _("Details") ) + "</b>" ) ;
expander_details .set_use_markup( true ) ;
expander_details .property_expanded() .signal_changed() .connect(
sigc::mem_fun(*this, &Dialog_Progress::on_expander_changed) );
expander_details .add( scrolledwindow ) ;
vbox ->pack_start( expander_details, Gtk::PACK_EXPAND_WIDGET ) ;
vbox ->set_spacing( 5 ) ;
this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ) ; this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ) ;
this ->signal_show() .connect( sigc::mem_fun(*this, &Dialog_Progress::on_signal_show) ); this ->signal_show() .connect( sigc::mem_fun(*this, &Dialog_Progress::on_signal_show) );
@ -250,7 +253,7 @@ void Dialog_Progress::on_signal_show()
//deal with succes/error... //deal with succes/error...
if ( succes ) if ( succes )
{ {
str_temp = _("All operations successfully completed") ; Glib::ustring str_temp(_("All operations successfully completed"));
if ( warnings > 0 ) if ( warnings > 0 )
str_temp += " (" str_temp += " ("
@ -272,7 +275,8 @@ void Dialog_Progress::on_signal_show()
Gtk::MESSAGE_ERROR, Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK, Gtk::BUTTONS_OK,
true ) ; true ) ;
str_temp = _("See the details for more information.") ; Glib::ustring str_temp(_("See the details for more information."));
str_temp += "\n\n<i><b>" + Glib::ustring( _("IMPORTANT") ) + "</b>\n" ; str_temp += "\n\n<i><b>" + Glib::ustring( _("IMPORTANT") ) + "</b>\n" ;
str_temp += _("If you want support, you need to provide the saved details!") ; str_temp += _("If you want support, you need to provide the saved details!") ;
str_temp += "\n" + String::ucompose( str_temp += "\n" + String::ucompose(