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:
|
||||
void show_filesystem( const FS & fs ) ;
|
||||
|
||||
Gtk::HBox *hbox ;
|
||||
Gtk::HBox *hbox2 ;
|
||||
Gtk::VBox *vbox ;
|
||||
Gtk::Image *image ;
|
||||
Gtk::Expander expander_legend ;
|
||||
Gtk::TreeView treeview_filesystems;
|
||||
Gtk::TreeRow treerow;
|
||||
Glib::RefPtr<Gtk::ListStore> liststore_filesystems;
|
||||
Glib::ustring str_temp ;
|
||||
|
||||
struct treeview_filesystems_Columns : public Gtk::TreeModelColumnRecord
|
||||
{
|
||||
|
|
|
@ -97,12 +97,8 @@ private:
|
|||
Gtk::VBox vbox_resize_move;
|
||||
Gtk::Label label_minmax ;
|
||||
Gtk::Table table_resize;
|
||||
Gtk::HBox hbox_table, hbox_resizer, hbox_resize_move;
|
||||
Gtk::Tooltips tooltips;
|
||||
Gtk::HBox hbox_table, hbox_resizer;
|
||||
Gtk::Button button_resize_move ;
|
||||
Gtk::Image *image_temp ;
|
||||
|
||||
Glib::ustring str_temp ;
|
||||
};
|
||||
|
||||
} //GParted
|
||||
|
|
|
@ -39,11 +39,8 @@ public:
|
|||
|
||||
private:
|
||||
Gtk::Expander expander_advanced ;
|
||||
Gtk::HBox *hbox ;
|
||||
Gtk::VBox *vbox ;
|
||||
Gtk::Image image ;
|
||||
Gtk::ComboBoxText combo_labeltypes ;
|
||||
Glib::ustring str_temp ;
|
||||
std::vector<Glib::ustring> labeltypes ;
|
||||
};
|
||||
|
||||
|
|
|
@ -52,11 +52,8 @@ private:
|
|||
Partition partition ;
|
||||
|
||||
Gtk::HBox *hbox ;
|
||||
Gtk::VBox *vbox ;
|
||||
Gtk::DrawingArea drawingarea ;
|
||||
Gtk::Frame *frame ;
|
||||
Gtk::Image *image;
|
||||
Gtk::Table *table;
|
||||
|
||||
Glib::RefPtr<Gdk::GC> gc;
|
||||
Glib::RefPtr<Pango::Layout> pango_layout;
|
||||
|
|
|
@ -40,13 +40,6 @@ public:
|
|||
Glib::ustring get_new_label();
|
||||
|
||||
private:
|
||||
Partition partition ;
|
||||
|
||||
Gtk::HBox *hbox ;
|
||||
Gtk::VBox *vbox ;
|
||||
Gtk::Frame *frame;
|
||||
Gtk::Image *image;
|
||||
Gtk::Table *table;
|
||||
Gtk::Entry *entry;
|
||||
};
|
||||
|
||||
|
|
|
@ -48,12 +48,10 @@ private:
|
|||
Gtk::Entry entry;
|
||||
|
||||
std::vector<FS> FILESYSTEMS ;
|
||||
int cylinder_size ;
|
||||
|
||||
//signal handlers
|
||||
void optionmenu_changed( bool );
|
||||
|
||||
Gdk::Color color_temp;
|
||||
unsigned short new_count, first_creatable_fs ;
|
||||
};
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ private:
|
|||
void on_response( int response_id ) ;
|
||||
bool on_delete_event( GdkEventAny * event ) ;
|
||||
|
||||
Gtk::VBox *vbox ;
|
||||
Gtk::Label label_current ;
|
||||
Gtk::Label label_current_sub ;
|
||||
Gtk::ProgressBar progressbar_all, progressbar_current ;
|
||||
|
@ -96,7 +95,6 @@ private:
|
|||
pthread_t pthread ;
|
||||
double fraction ;
|
||||
unsigned int t, warnings ;
|
||||
Glib::ustring str_temp ;
|
||||
|
||||
Glib::Dispatcher dispatcher_update_gui_elements ;
|
||||
Glib::ustring label_current_sub_text ;
|
||||
|
|
|
@ -44,55 +44,66 @@ DialogFeatures::DialogFeatures()
|
|||
treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE );
|
||||
treeview_filesystems .set_rules_hint( true ) ;
|
||||
|
||||
hbox = manage( new Gtk::HBox() ) ;
|
||||
hbox ->set_border_width( 6 ) ;
|
||||
hbox ->pack_start( treeview_filesystems ) ;
|
||||
get_vbox() ->pack_start( *hbox ) ;
|
||||
{
|
||||
Gtk::HBox* hbox(manage(new Gtk::HBox()));
|
||||
|
||||
//file system support legend
|
||||
hbox2 = manage( new Gtk::HBox( false, 6 ) ) ;
|
||||
hbox2 ->set_border_width( 6 ) ;
|
||||
|
||||
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->set_border_width(6);
|
||||
hbox->pack_start(treeview_filesystems);
|
||||
get_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 ) ;
|
||||
//file system support legend
|
||||
Gtk::HBox* hbox2(manage(new Gtk::HBox(false, 6)));
|
||||
hbox2->set_border_width(6);
|
||||
|
||||
//legend
|
||||
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 ) ;
|
||||
hbox = manage(new Gtk::HBox());
|
||||
{
|
||||
Glib::ustring 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
|
||||
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
|
||||
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 ;
|
||||
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 ) ;
|
||||
hbox_resize_move .pack_start( * Utils::mk_label( fixed_start ? _("Resize") : _("Resize/Move") ),
|
||||
Gtk::PACK_EXPAND_PADDING ) ;
|
||||
button_resize_move .add( hbox_resize_move ) ;
|
||||
|
||||
{
|
||||
Gtk::Image* image_temp(manage(new Gtk::Image(Gtk::Stock::GOTO_LAST, Gtk::ICON_SIZE_BUTTON)));
|
||||
Gtk::HBox* box_resize_move(manage(new Gtk::HBox()));
|
||||
|
||||
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 ) ;
|
||||
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 )
|
||||
{
|
||||
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 ) ;
|
||||
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 )
|
||||
: image(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG)
|
||||
{
|
||||
/*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_has_separator( false ) ;
|
||||
this ->set_resizable( false );
|
||||
|
||||
hbox = manage( new Gtk::HBox() ) ;
|
||||
this ->get_vbox() ->pack_start( *hbox, Gtk::PACK_SHRINK );
|
||||
|
||||
vbox = manage( new Gtk::VBox() ) ;
|
||||
vbox ->set_border_width( 10 ) ;
|
||||
hbox ->pack_start( *vbox, Gtk::PACK_SHRINK );
|
||||
{
|
||||
Gtk::HBox* hbox(manage(new Gtk::HBox()));
|
||||
|
||||
image .set( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG ) ;
|
||||
vbox ->pack_start( image, Gtk::PACK_SHRINK );
|
||||
get_vbox()->pack_start(*hbox, Gtk::PACK_SHRINK);
|
||||
|
||||
vbox = manage( new Gtk::VBox() ) ;
|
||||
vbox ->set_border_width( 10 ) ;
|
||||
hbox ->pack_start( *vbox, Gtk::PACK_SHRINK );
|
||||
Gtk::VBox* vbox(manage(new Gtk::VBox()));
|
||||
|
||||
str_temp = "<span weight=\"bold\" size=\"larger\">" ;
|
||||
/*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 );
|
||||
vbox->set_border_width(10);
|
||||
hbox->pack_start(*vbox, 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 );
|
||||
|
||||
//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 ) ;
|
||||
vbox->pack_start(image, 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 ) ;
|
||||
vbox = manage(new Gtk::VBox());
|
||||
vbox->set_border_width(10);
|
||||
hbox->pack_start(*vbox, Gtk::PACK_SHRINK);
|
||||
|
||||
//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 ) ;
|
||||
{
|
||||
Glib::ustring str_temp("<span weight=\"bold\" size=\"larger\">");
|
||||
|
||||
/*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.");
|
||||
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::APPLY, Gtk::RESPONSE_APPLY );
|
||||
|
|
|
@ -42,28 +42,35 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition )
|
|||
frame = manage( new Gtk::Frame() );
|
||||
frame ->set_border_width( 10 );
|
||||
|
||||
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 ) ;
|
||||
{
|
||||
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 ->pack_start( * Utils::mk_label( "<b> " + Glib::ustring(_("Warning:") ) + " </b>" ),
|
||||
Gtk::PACK_SHRINK ) ;
|
||||
|
||||
|
||||
frame ->set_label_widget( *hbox ) ;
|
||||
|
||||
//FIXME: for more clarity we should add a listview here with alternating rowcolors..
|
||||
//that way it's easier to tell messages apart..
|
||||
vbox = manage( new Gtk::VBox( false, 4 ) );
|
||||
vbox ->set_border_width( 5 ) ;
|
||||
for ( unsigned int t = 0 ; t < partition .messages .size() ; t++ )
|
||||
vbox ->pack_start( * Utils::mk_label( "<i>" + partition .messages[t] + "</i>",
|
||||
true,
|
||||
Gtk::ALIGN_LEFT,
|
||||
Gtk::ALIGN_CENTER,
|
||||
true ),
|
||||
Gtk::PACK_SHRINK ) ;
|
||||
frame ->add( *vbox ) ;
|
||||
|
||||
{
|
||||
Gtk::VBox* vbox(manage(new Gtk::VBox(false,4)));
|
||||
vbox->set_border_width(5);
|
||||
|
||||
for (unsigned int t = 0; t < partition.messages.size(); ++t)
|
||||
vbox->pack_start(*Utils::mk_label("<i>" + partition .messages[t] + "</i>",
|
||||
true,
|
||||
Gtk::ALIGN_LEFT,
|
||||
Gtk::ALIGN_CENTER,
|
||||
true),
|
||||
Gtk::PACK_SHRINK);
|
||||
frame->add(*vbox);
|
||||
}
|
||||
|
||||
this ->get_vbox() ->pack_start( *frame, Gtk::PACK_SHRINK ) ;
|
||||
}
|
||||
|
||||
|
@ -143,7 +150,8 @@ void Dialog_Partition_Info::Display_Info()
|
|||
{
|
||||
int top = 0, bottom = 1 ;
|
||||
|
||||
table = manage( new Gtk::Table() ) ;
|
||||
Gtk::Table* table(manage(new Gtk::Table()));
|
||||
|
||||
table ->set_border_width( 5 ) ;
|
||||
table ->set_col_spacings(10 ) ;
|
||||
this ->get_vbox() ->pack_start( *table, Gtk::PACK_SHRINK ) ;
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace GParted
|
|||
|
||||
Dialog_Partition_Label::Dialog_Partition_Label( const Partition & partition )
|
||||
{
|
||||
this ->partition = partition ;
|
||||
|
||||
this ->set_resizable( false ) ;
|
||||
this ->set_has_separator( false ) ;
|
||||
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 */
|
||||
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
|
||||
table = manage( new Gtk::Table() ) ;
|
||||
table ->set_border_width( 5 ) ;
|
||||
table ->set_col_spacings(10 ) ;
|
||||
this ->get_vbox() ->pack_start( *table, Gtk::PACK_SHRINK ) ;
|
||||
//Label
|
||||
table ->attach( * Utils::mk_label( "<b>" + Glib::ustring( _("Label:") ) + "</b>" ),
|
||||
0, 1,
|
||||
top, bottom,
|
||||
Gtk::FILL ) ;
|
||||
//Create Text entry box
|
||||
entry = manage( new Gtk::Entry() );
|
||||
entry ->set_max_length( 30 );
|
||||
entry ->set_width_chars( 20 );
|
||||
entry ->set_activates_default( true );
|
||||
entry ->set_text( partition.label );
|
||||
entry ->select_region( 0, entry ->get_text_length() );
|
||||
//Add entry box to table
|
||||
table ->attach( *entry,
|
||||
1, 2,
|
||||
top++, bottom++,
|
||||
Gtk::FILL ) ;
|
||||
//Create table to hold Label and entry box
|
||||
Gtk::Table* table(manage(new Gtk::Table()));
|
||||
|
||||
table->set_border_width(5);
|
||||
table->set_col_spacings(10);
|
||||
get_vbox()->pack_start(*table, Gtk::PACK_SHRINK);
|
||||
table->attach(*Utils::mk_label("<b>" + Glib::ustring(_("Label:")) + "</b>"),
|
||||
0, 1,
|
||||
top, bottom,
|
||||
Gtk::FILL);
|
||||
//Create Text entry box
|
||||
entry = manage(new Gtk::Entry());
|
||||
entry->set_max_length(30);
|
||||
entry->set_width_chars(20);
|
||||
entry->set_activates_default(true);
|
||||
entry->set_text(partition.label);
|
||||
entry->select_region(0, entry ->get_text_length());
|
||||
//Add entry box to table
|
||||
table->attach(*entry,
|
||||
1, 2,
|
||||
top++, bottom++,
|
||||
Gtk::FILL);
|
||||
}
|
||||
|
||||
this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ) ;
|
||||
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 ->selected_partition = partition;
|
||||
this ->cylinder_size = cylinder_size ;
|
||||
|
||||
//copy GParted FILESYSTEMS
|
||||
this ->FILESYSTEMS = FILESYSTEMS ;
|
||||
|
@ -307,14 +306,16 @@ void Dialog_Partition_New::optionmenu_changed( bool type )
|
|||
}
|
||||
|
||||
//set fitting resizer colors
|
||||
//backgroundcolor..
|
||||
color_temp .set( optionmenu_type .get_history() == 2 ? "darkgrey" : "white" ) ;
|
||||
frame_resizer_base ->override_default_rgb_unused_color( color_temp );
|
||||
|
||||
//partitioncolor..
|
||||
color_temp .set( Utils::get_color( fs .filesystem ) ) ;
|
||||
frame_resizer_base ->set_rgb_partition_color( color_temp ) ;
|
||||
|
||||
{
|
||||
Gdk::Color color_temp;
|
||||
|
||||
color_temp.set((optionmenu_type.get_history() == 2) ? "darkgrey" : "white");
|
||||
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);
|
||||
}
|
||||
|
||||
frame_resizer_base ->Draw_Partition() ;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,72 +41,75 @@ Dialog_Progress::Dialog_Progress( const std::vector<Operation *> & operations )
|
|||
dispatcher_update_gui_elements .connect(
|
||||
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 ) ;
|
||||
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 ) ;
|
||||
Gtk::VBox* 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);
|
||||
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 ->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...
|
||||
if ( succes )
|
||||
{
|
||||
str_temp = _("All operations successfully completed") ;
|
||||
Glib::ustring str_temp(_("All operations successfully completed"));
|
||||
|
||||
if ( warnings > 0 )
|
||||
str_temp += " ("
|
||||
|
@ -272,7 +275,8 @@ void Dialog_Progress::on_signal_show()
|
|||
Gtk::MESSAGE_ERROR,
|
||||
Gtk::BUTTONS_OK,
|
||||
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 += _("If you want support, you need to provide the saved details!") ;
|
||||
str_temp += "\n" + String::ucompose(
|
||||
|
|
Loading…
Reference in New Issue