41
41
dispatcher_update_gui_elements .connect(
42
42
sigc::mem_fun( this, &Dialog_Progress::dispatcher_on_update_gui_elements ) ) ;
44
vbox = manage( new Gtk::VBox() ) ;
45
vbox ->set_border_width( 10 ) ;
46
this ->get_vbox() ->pack_start( *vbox, Gtk::PACK_SHRINK ) ;
48
Glib::ustring str_temp = _("Depending on the amount and type of operations this might take a long time.") ;
50
vbox ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK );
52
label_current .set_alignment( Gtk::ALIGN_LEFT );
53
vbox ->pack_start( label_current, Gtk::PACK_SHRINK ) ;
55
progressbar_current .set_pulse_step( 0.01 ) ;
56
vbox ->pack_start( progressbar_current, Gtk::PACK_SHRINK );
58
label_current_sub .set_alignment( Gtk::ALIGN_LEFT );
59
vbox ->pack_start( label_current_sub, Gtk::PACK_SHRINK );
61
vbox ->pack_start( * Utils::mk_label( "<b>" + Glib::ustring( _("Completed Operations:") ) + "</b>" ),
63
vbox ->pack_start( progressbar_all, Gtk::PACK_SHRINK );
65
//create some icons here, instead of recreating them every time
66
icon_execute = render_icon( Gtk::Stock::EXECUTE, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
67
icon_succes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
68
icon_error = render_icon( Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
69
icon_info = render_icon( Gtk::Stock::INFO, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
70
icon_n_a = render_icon( Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
72
treestore_operations = Gtk::TreeStore::create( treeview_operations_columns );
73
treeview_operations .set_model( treestore_operations );
74
treeview_operations .set_headers_visible( false );
75
treeview_operations .set_rules_hint( true ) ;
76
treeview_operations .set_size_request( 500, 250 ) ;
77
treeview_operations .append_column( "", treeview_operations_columns .operation_description );
78
treeview_operations .append_column( "", treeview_operations_columns .elapsed_time );
79
treeview_operations .append_column( "", treeview_operations_columns .status_icon );
81
treeview_operations .get_column( 0 ) ->set_expand( true ) ;
82
treeview_operations .get_column( 0 ) ->set_cell_data_func(
83
* ( treeview_operations .get_column( 0 ) ->get_first_cell_renderer() ),
84
sigc::mem_fun(*this, &Dialog_Progress::on_cell_data_description) ) ;
87
for ( unsigned int t = 0 ; t < operations .size() ; t++ )
89
this ->operations[ t ] ->operation_detail .set_description( operations[ t ] ->description, FONT_BOLD ) ;
90
this ->operations[ t ] ->operation_detail .set_treepath( Utils::num_to_str( t ) ) ;
92
treerow = *( treestore_operations ->append() );
93
treerow[ treeview_operations_columns .operation_description ] =
94
this ->operations[ t ] ->operation_detail .get_description() ;
45
Gtk::VBox* vbox(manage(new Gtk::VBox()));
47
vbox->set_border_width(10);
48
this->get_vbox()->pack_start(*vbox, Gtk::PACK_SHRINK);
50
Glib::ustring str_temp(_("Depending on the number and type of operations this might take a long time."));
52
vbox->pack_start(*Utils::mk_label(str_temp), Gtk::PACK_SHRINK);
54
label_current.set_alignment(Gtk::ALIGN_LEFT);
55
vbox->pack_start(label_current, Gtk::PACK_SHRINK);
57
progressbar_current.set_pulse_step(0.01);
58
vbox->pack_start(progressbar_current, Gtk::PACK_SHRINK);
60
label_current_sub.set_alignment(Gtk::ALIGN_LEFT);
61
vbox->pack_start(label_current_sub, Gtk::PACK_SHRINK);
63
vbox->pack_start(*Utils::mk_label("<b>" + Glib::ustring(_("Completed Operations:")) + "</b>"),
65
vbox->pack_start(progressbar_all, Gtk::PACK_SHRINK);
67
//create some icons here, instead of recreating them every time
68
icon_execute = render_icon(Gtk::Stock::EXECUTE, Gtk::ICON_SIZE_LARGE_TOOLBAR);
69
icon_succes = render_icon(Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR);
70
icon_error = render_icon(Gtk::Stock::DIALOG_ERROR, Gtk::ICON_SIZE_LARGE_TOOLBAR);
71
icon_info = render_icon(Gtk::Stock::INFO, Gtk::ICON_SIZE_LARGE_TOOLBAR);
72
icon_n_a = render_icon(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_LARGE_TOOLBAR);
74
treestore_operations = Gtk::TreeStore::create( treeview_operations_columns);
75
treeview_operations.set_model(treestore_operations);
76
treeview_operations.set_headers_visible(false);
77
treeview_operations.set_rules_hint(true);
78
treeview_operations.set_size_request(500, 250);
79
treeview_operations.append_column("", treeview_operations_columns.operation_description);
80
treeview_operations.append_column("", treeview_operations_columns.elapsed_time);
81
treeview_operations.append_column("", treeview_operations_columns.status_icon);
83
treeview_operations.get_column(0)->set_expand(true);
84
treeview_operations.get_column(0)->set_cell_data_func(
85
*(treeview_operations.get_column(0)->get_first_cell_renderer()),
86
sigc::mem_fun(*this, &Dialog_Progress::on_cell_data_description) );
89
for (unsigned int t = 0; t < operations.size(); ++t)
91
this->operations[t]->operation_detail.set_description(operations[t]->description, FONT_BOLD);
92
this->operations[t]->operation_detail.set_treepath(Utils::num_to_str(t));
94
treerow = *(treestore_operations->append());
95
treerow[treeview_operations_columns.operation_description] =
96
this ->operations[t]->operation_detail.get_description();
99
scrolledwindow.set_shadow_type(Gtk::SHADOW_ETCHED_IN);
100
scrolledwindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
101
scrolledwindow.add(treeview_operations);
103
expander_details.set_label("<b>" + Glib::ustring(_("Details")) + "</b>");
104
expander_details.set_use_markup(true);
105
expander_details.property_expanded().signal_changed().connect(
106
sigc::mem_fun(*this, &Dialog_Progress::on_expander_changed) );
107
expander_details.add(scrolledwindow);
109
vbox ->pack_start(expander_details, Gtk::PACK_EXPAND_WIDGET);
110
vbox ->set_spacing(5);
97
scrolledwindow .set_shadow_type( Gtk::SHADOW_ETCHED_IN ) ;
98
scrolledwindow .set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ) ;
99
scrolledwindow .add( treeview_operations ) ;
101
expander_details .set_label( "<b>" + Glib::ustring( _("Details") ) + "</b>" ) ;
102
expander_details .set_use_markup( true ) ;
103
expander_details .property_expanded() .signal_changed() .connect(
104
sigc::mem_fun(*this, &Dialog_Progress::on_expander_changed) );
105
expander_details .add( scrolledwindow ) ;
107
vbox ->pack_start( expander_details, Gtk::PACK_EXPAND_WIDGET ) ;
108
vbox ->set_spacing( 5 ) ;
110
113
this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ) ;
112
115
this ->signal_show() .connect( sigc::mem_fun(*this, &Dialog_Progress::on_signal_show) );