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:
parent
e7a0fa05ea
commit
91b971691d
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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 ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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 ;
|
||||||
|
|
|
@ -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() ) ;
|
|
||||||
str_temp = _("This chart shows the actions supported on file systems.") ;
|
|
||||||
str_temp += "\n" ;
|
|
||||||
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
|
|
||||||
vbox = manage( new Gtk::VBox() ) ;
|
|
||||||
hbox = manage( new Gtk::HBox() ) ;
|
|
||||||
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() ) ;
|
//file system support legend
|
||||||
image = manage( new Gtk::Image( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) );
|
Gtk::HBox* hbox2(manage(new Gtk::HBox(false, 6)));
|
||||||
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ;
|
hbox2->set_border_width(6);
|
||||||
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") ;
|
Glib::ustring str_temp(_("This chart shows the actions supported on file systems."));
|
||||||
str_temp += "</b>" ;
|
str_temp += "\n" ;
|
||||||
expander_legend .set_label( str_temp ) ;
|
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.");
|
||||||
expander_legend .set_use_markup( true ) ;
|
hbox->pack_start(*Utils::mk_label(str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true),
|
||||||
|
Gtk::PACK_SHRINK);
|
||||||
get_vbox() ->pack_start( expander_legend, Gtk::PACK_SHRINK ) ;
|
hbox2->pack_start(*hbox);
|
||||||
expander_legend .add( *hbox2 ) ;
|
|
||||||
|
{
|
||||||
|
//icon legend
|
||||||
|
Gtk::VBox* vbox(manage(new Gtk::VBox()));
|
||||||
|
|
||||||
|
hbox = manage(new Gtk::HBox());
|
||||||
|
|
||||||
|
{
|
||||||
|
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 ) ;
|
||||||
|
|
|
@ -212,12 +212,16 @@ 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 ) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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() ) ;
|
|
||||||
vbox ->set_border_width( 10 ) ;
|
|
||||||
hbox ->pack_start( *vbox, Gtk::PACK_SHRINK );
|
|
||||||
|
|
||||||
image .set( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG ) ;
|
get_vbox()->pack_start(*hbox, Gtk::PACK_SHRINK);
|
||||||
vbox ->pack_start( image, Gtk::PACK_SHRINK );
|
|
||||||
|
|
||||||
vbox = manage( new Gtk::VBox() ) ;
|
Gtk::VBox* vbox(manage(new Gtk::VBox()));
|
||||||
vbox ->set_border_width( 10 ) ;
|
|
||||||
hbox ->pack_start( *vbox, Gtk::PACK_SHRINK );
|
|
||||||
|
|
||||||
str_temp = "<span weight=\"bold\" size=\"larger\">" ;
|
vbox->set_border_width(10);
|
||||||
/*TO TRANSLATORS: looks like WARNING: This will ERASE ALL DATA on the ENTIRE DISK /dev/hda */
|
hbox->pack_start(*vbox, Gtk::PACK_SHRINK);
|
||||||
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->pack_start(image, Gtk::PACK_SHRINK);
|
||||||
str_temp += "\n" ;
|
|
||||||
vbox ->pack_start( * Utils::mk_label( str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true ),
|
|
||||||
Gtk::PACK_SHRINK );
|
|
||||||
|
|
||||||
//advanced
|
|
||||||
str_temp = "<b>" ;
|
|
||||||
str_temp += _("Advanced") ;
|
|
||||||
expander_advanced .set_label( str_temp + "</b>" ) ;
|
|
||||||
expander_advanced .set_use_markup( true ) ;
|
|
||||||
|
|
||||||
vbox ->pack_start( expander_advanced, Gtk::PACK_SHRINK ) ;
|
|
||||||
|
|
||||||
hbox = manage( new Gtk::HBox( false, 5 ) ) ;
|
vbox = manage(new Gtk::VBox());
|
||||||
hbox ->set_border_width( 5 ) ;
|
vbox->set_border_width(10);
|
||||||
str_temp = _("Select new partition table type:") ;
|
hbox->pack_start(*vbox, Gtk::PACK_SHRINK);
|
||||||
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 ;
|
Glib::ustring str_temp("<span weight=\"bold\" size=\"larger\">");
|
||||||
|
|
||||||
for ( unsigned int t = 0 ; t < labeltypes .size() ; t++ )
|
/*TO TRANSLATORS: looks like WARNING: This will ERASE ALL DATA on the ENTIRE DISK /dev/hda */
|
||||||
combo_labeltypes .append_text( labeltypes[ t ] ) ;
|
str_temp += String::ucompose(_("WARNING: This will ERASE ALL DATA on the ENTIRE DISK %1"), device_path);
|
||||||
|
str_temp += "</span>\n";
|
||||||
combo_labeltypes .set_active( 0 ) ;
|
vbox->pack_start(*Utils::mk_label(str_temp), Gtk::PACK_SHRINK);
|
||||||
hbox ->pack_start( combo_labeltypes, Gtk::PACK_SHRINK ) ;
|
|
||||||
|
str_temp = _("Default is to create an MS-DOS partition table.");
|
||||||
|
str_temp += "\n";
|
||||||
|
vbox->pack_start(*Utils::mk_label(str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true),
|
||||||
|
Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
|
str_temp = "<b>";
|
||||||
|
str_temp += _("Advanced");
|
||||||
|
str_temp += "</b>";
|
||||||
|
expander_advanced.set_label(str_temp);
|
||||||
|
expander_advanced.set_use_markup(true);
|
||||||
|
|
||||||
|
vbox->pack_start(expander_advanced, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
|
hbox = manage(new Gtk::HBox(false, 5));
|
||||||
|
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 );
|
||||||
|
|
|
@ -42,28 +42,35 @@ 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 ) ;
|
||||||
|
|
|
@ -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 ) ;
|
||||||
|
|
|
@ -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,14 +306,16 @@ 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 );
|
|
||||||
|
color_temp.set((optionmenu_type.get_history() == 2) ? "darkgrey" : "white");
|
||||||
//partitioncolor..
|
frame_resizer_base->override_default_rgb_unused_color(color_temp);
|
||||||
color_temp .set( Utils::get_color( fs .filesystem ) ) ;
|
|
||||||
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() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 ) ) ;
|
|
||||||
|
vbox->set_border_width(10);
|
||||||
treerow = *( treestore_operations ->append() );
|
this->get_vbox()->pack_start(*vbox, Gtk::PACK_SHRINK);
|
||||||
treerow[ treeview_operations_columns .operation_description ] =
|
|
||||||
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);
|
||||||
scrolledwindow .set_shadow_type( Gtk::SHADOW_ETCHED_IN ) ;
|
|
||||||
scrolledwindow .set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ) ;
|
label_current.set_alignment(Gtk::ALIGN_LEFT);
|
||||||
scrolledwindow .add( treeview_operations ) ;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
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(
|
||||||
|
|
Loading…
Reference in New Issue