~ubuntu-branches/ubuntu/saucy/gparted/saucy

« back to all changes in this revision

Viewing changes to src/Dialog_Progress.cc

  • Committer: Package Import Robot
  • Author(s): Anibal Monsalve Salazar
  • Date: 2011-11-13 09:45:30 UTC
  • mfrom: (6.3.18)
  • Revision ID: package-import@ubuntu.com-20111113094530-bpv6kjk4rwozc1jf
Tags: 0.10.0-1
* New upstream release

  GParted 0.10.0  (2011-11-01)

  * Merge overlapping operations
  * Add ability to resize btrfs file systems
  * Add detection of exfat file systems

  GParted 0.9.1   (2011-09-19)

  * Fix NTFS partition resize fail problem
  * Fix some compiler warnings

  GParted 0.9.0   (2011-07-18)

  * Fix size off by one sector with unrecognized disk label
  * Fix GParted crashes with assertion (head_size <= 63)
    - Requires libparted-2.4 or higher
    - LP: #545911

* Fix out-of-date-standards-version
* Fix debian-rules-missing-recommended-target

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        dispatcher_update_gui_elements .connect( 
42
42
                sigc::mem_fun( this, &Dialog_Progress::dispatcher_on_update_gui_elements ) ) ;
43
43
 
44
 
        vbox = manage( new Gtk::VBox() ) ;
45
 
        vbox ->set_border_width( 10 ) ;
46
 
        this ->get_vbox() ->pack_start( *vbox, Gtk::PACK_SHRINK ) ;
47
 
 
48
 
        Glib::ustring str_temp = _("Depending on the amount and type of operations this might take a long time.") ;
49
 
        str_temp += "\n";
50
 
        vbox ->pack_start( * Utils::mk_label( str_temp ), Gtk::PACK_SHRINK );
51
 
 
52
 
        label_current .set_alignment( Gtk::ALIGN_LEFT );
53
 
        vbox ->pack_start( label_current, Gtk::PACK_SHRINK ) ;
54
 
 
55
 
        progressbar_current .set_pulse_step( 0.01 ) ;
56
 
        vbox ->pack_start( progressbar_current, Gtk::PACK_SHRINK );
57
 
        
58
 
        label_current_sub .set_alignment( Gtk::ALIGN_LEFT );
59
 
        vbox ->pack_start( label_current_sub, Gtk::PACK_SHRINK );
60
 
        
61
 
        vbox ->pack_start( * Utils::mk_label( "<b>" + Glib::ustring( _("Completed Operations:") ) + "</b>" ),
62
 
                                        Gtk::PACK_SHRINK );
63
 
        vbox ->pack_start( progressbar_all, Gtk::PACK_SHRINK );
64
 
        
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 ) ;
71
 
        
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 );
80
 
 
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) ) ;
85
 
 
86
 
        //fill 'er up
87
 
        for ( unsigned int t = 0 ; t < operations .size() ; t++ )
88
44
        {
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 ) ) ;
91
 
                
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()));
 
46
 
 
47
                vbox->set_border_width(10);
 
48
                this->get_vbox()->pack_start(*vbox, Gtk::PACK_SHRINK);
 
49
 
 
50
                Glib::ustring str_temp(_("Depending on the number and type of operations this might take a long time."));
 
51
                str_temp += "\n";
 
52
                vbox->pack_start(*Utils::mk_label(str_temp), Gtk::PACK_SHRINK);
 
53
 
 
54
                label_current.set_alignment(Gtk::ALIGN_LEFT);
 
55
                vbox->pack_start(label_current, Gtk::PACK_SHRINK);
 
56
 
 
57
                progressbar_current.set_pulse_step(0.01);
 
58
                vbox->pack_start(progressbar_current, Gtk::PACK_SHRINK);
 
59
 
 
60
                label_current_sub.set_alignment(Gtk::ALIGN_LEFT);
 
61
                vbox->pack_start(label_current_sub, Gtk::PACK_SHRINK);
 
62
 
 
63
                vbox->pack_start(*Utils::mk_label("<b>" + Glib::ustring(_("Completed Operations:")) + "</b>"),
 
64
                                        Gtk::PACK_SHRINK);
 
65
                vbox->pack_start(progressbar_all, Gtk::PACK_SHRINK);
 
66
 
 
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);
 
73
 
 
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);
 
82
 
 
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) );
 
87
 
 
88
                //fill 'er up
 
89
                for (unsigned int t = 0; t < operations.size(); ++t)
 
90
                {
 
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));
 
93
 
 
94
                        treerow = *(treestore_operations->append());
 
95
                        treerow[treeview_operations_columns.operation_description] =
 
96
                                this ->operations[t]->operation_detail.get_description();
 
97
                }
 
98
 
 
99
                scrolledwindow.set_shadow_type(Gtk::SHADOW_ETCHED_IN);
 
100
                scrolledwindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
 
101
                scrolledwindow.add(treeview_operations);
 
102
 
 
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);
 
108
 
 
109
                vbox ->pack_start(expander_details, Gtk::PACK_EXPAND_WIDGET);
 
110
                vbox ->set_spacing(5);
95
111
        }
96
 
        
97
 
        scrolledwindow .set_shadow_type( Gtk::SHADOW_ETCHED_IN ) ;
98
 
        scrolledwindow .set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ) ;
99
 
        scrolledwindow .add( treeview_operations ) ;
100
112
 
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 ) ;
106
 
        
107
 
        vbox ->pack_start( expander_details, Gtk::PACK_EXPAND_WIDGET ) ; 
108
 
        vbox ->set_spacing( 5 ) ;
109
 
        
110
113
        this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ) ;
111
114
        
112
115
        this ->signal_show() .connect( sigc::mem_fun(*this, &Dialog_Progress::on_signal_show) );
162
165
        else//it's an new od which needs to be added to the model.
163
166
        {
164
167
                unsigned int pos = operationdetail .get_treepath() .rfind( ":" ) ;
165
 
                if ( pos >= 0 && pos < operationdetail .get_treepath() .length() )
 
168
                if ( pos < operationdetail .get_treepath() .length() )
166
169
                        iter = treestore_operations ->get_iter( operationdetail .get_treepath() 
167
170
                                                        .substr( 0, operationdetail .get_treepath() .rfind( ":" ) ) ) ;
168
171
                else
250
253
        //deal with succes/error...
251
254
        if ( succes )
252
255
        {
253
 
                str_temp = _("All operations successfully completed") ;
 
256
                Glib::ustring str_temp(_("All operations successfully completed"));
254
257
 
255
258
                if ( warnings > 0 )
256
259
                        str_temp += " ("
272
275
                                                   Gtk::MESSAGE_ERROR,
273
276
                                                   Gtk::BUTTONS_OK,
274
277
                                                   true ) ;
275
 
                        str_temp = _("See the details for more information.") ;
 
278
                        Glib::ustring str_temp(_("See the details for more information."));
 
279
 
276
280
                        str_temp += "\n\n<i><b>" + Glib::ustring( _("IMPORTANT") ) + "</b>\n" ;
277
281
                        str_temp += _("If you want support, you need to provide the saved details!") ;
278
282
                        str_temp += "\n" + String::ucompose(