2004-09-19 14:24:53 -06:00
|
|
|
/* Copyright (C) 2004 Bart
|
2009-11-05 11:08:32 -07:00
|
|
|
* Copyright (C) 2009 Curtis Gedak
|
2004-09-19 14:24:53 -06:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2014-01-23 03:59:48 -07:00
|
|
|
* GNU General Public License for more details.
|
2004-09-19 14:24:53 -06:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-23 03:59:48 -07:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2004-09-19 14:24:53 -06:00
|
|
|
*/
|
|
|
|
|
2013-05-27 05:20:16 -06:00
|
|
|
#ifndef GPARTED_DIALOG_PROGRESS_H
|
|
|
|
#define GPARTED_DIALOG_PROGRESS_H
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2016-10-18 16:45:28 -06:00
|
|
|
#include "i18n.h"
|
|
|
|
#include "Utils.h"
|
|
|
|
#include "Operation.h"
|
2004-09-20 09:46:21 -06:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
#include <gtkmm/dialog.h>
|
|
|
|
#include <gtkmm/progressbar.h>
|
2006-01-19 12:15:15 -07:00
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/treestore.h>
|
2004-11-17 06:00:25 -07:00
|
|
|
#include <gtkmm/scrolledwindow.h>
|
2006-01-19 12:15:15 -07:00
|
|
|
#include <gtkmm/expander.h>
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2006-02-07 08:17:44 -07:00
|
|
|
#include <fstream>
|
|
|
|
|
2004-10-06 13:06:43 -06:00
|
|
|
namespace GParted
|
|
|
|
{
|
2004-09-24 19:10:21 -06:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
class Dialog_Progress : public Gtk::Dialog
|
|
|
|
{
|
|
|
|
public:
|
2006-03-24 12:08:41 -07:00
|
|
|
Dialog_Progress( const std::vector<Operation *> & operations ) ;
|
2006-01-19 12:15:15 -07:00
|
|
|
~Dialog_Progress();
|
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
sigc::signal< bool, Operation * > signal_apply_operation ;
|
2006-12-01 06:01:46 -07:00
|
|
|
sigc::signal< Glib::ustring > signal_get_libparted_version ;
|
2004-11-17 06:00:25 -07:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
private:
|
2006-08-20 03:33:54 -06:00
|
|
|
void on_signal_update( const OperationDetail & operationdetail ) ;
|
2013-02-21 17:57:33 -07:00
|
|
|
void update_gui_elements() ;
|
2006-01-19 12:15:15 -07:00
|
|
|
void on_signal_show() ;
|
2006-01-28 08:09:50 -07:00
|
|
|
void on_cell_data_description( Gtk::CellRenderer * renderer, const Gtk::TreeModel::iterator & iter) ;
|
2006-01-26 15:49:37 -07:00
|
|
|
void on_cancel() ;
|
2006-02-07 08:17:44 -07:00
|
|
|
void on_save() ;
|
2006-07-29 02:27:28 -06:00
|
|
|
void echo_operation_details( const OperationDetail & operation_detail, std::ofstream & out ) ;
|
2006-01-24 05:31:58 -07:00
|
|
|
|
|
|
|
void on_response( int response_id ) ;
|
2006-01-26 15:49:37 -07:00
|
|
|
bool on_delete_event( GdkEventAny * event ) ;
|
2013-01-14 19:20:49 -07:00
|
|
|
bool pulsebar_pulse();
|
2004-11-17 06:00:25 -07:00
|
|
|
|
2004-10-06 13:06:43 -06:00
|
|
|
Gtk::Label label_current ;
|
2006-05-23 15:17:34 -06:00
|
|
|
Gtk::Label label_current_sub ;
|
2004-09-19 14:24:53 -06:00
|
|
|
Gtk::ProgressBar progressbar_all, progressbar_current ;
|
2006-01-19 12:15:15 -07:00
|
|
|
Gtk::TreeView treeview_operations ;
|
|
|
|
Gtk::TreeRow treerow ;
|
2004-11-17 06:00:25 -07:00
|
|
|
Gtk::ScrolledWindow scrolledwindow ;
|
2006-01-19 12:15:15 -07:00
|
|
|
Gtk::Expander expander_details ;
|
2012-01-24 18:15:20 -07:00
|
|
|
Gtk::Button *cancelbutton;
|
2006-01-19 12:15:15 -07:00
|
|
|
|
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_execute ;
|
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_succes ;
|
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_error ;
|
2006-07-30 09:13:41 -06:00
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_info ;
|
2006-07-19 14:54:08 -06:00
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_n_a ;
|
2006-01-19 12:15:15 -07:00
|
|
|
|
|
|
|
Glib::RefPtr<Gtk::TreeStore> treestore_operations;
|
2004-11-17 06:00:25 -07:00
|
|
|
|
2006-01-19 12:15:15 -07:00
|
|
|
struct treeview_operations_Columns : public Gtk::TreeModelColumnRecord
|
|
|
|
{
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> operation_description;
|
2006-08-22 13:29:59 -06:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> elapsed_time ;
|
2006-01-19 12:15:15 -07:00
|
|
|
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > status_icon;
|
|
|
|
|
|
|
|
treeview_operations_Columns()
|
|
|
|
{
|
|
|
|
add( operation_description );
|
2006-08-22 13:29:59 -06:00
|
|
|
add( elapsed_time );
|
2006-01-19 12:15:15 -07:00
|
|
|
add( status_icon ) ;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
treeview_operations_Columns treeview_operations_columns;
|
2004-09-19 14:24:53 -06:00
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
std::vector<Operation *> operations ;
|
2014-04-01 20:04:01 -06:00
|
|
|
Glib::ustring progress_text;
|
2013-01-14 19:20:49 -07:00
|
|
|
bool succes, cancel;
|
2006-01-19 12:15:15 -07:00
|
|
|
double fraction ;
|
2006-09-09 04:58:48 -06:00
|
|
|
unsigned int t, warnings ;
|
2013-01-14 19:20:49 -07:00
|
|
|
sigc::connection pulsetimer;
|
2006-08-20 03:33:54 -06:00
|
|
|
Glib::ustring label_current_sub_text ;
|
2013-01-20 19:50:55 -07:00
|
|
|
unsigned int cancel_countdown;
|
|
|
|
sigc::connection canceltimer;
|
|
|
|
bool cancel_timeout();
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
2004-10-06 13:06:43 -06:00
|
|
|
}//GParted
|
|
|
|
|
2013-05-27 05:20:16 -06:00
|
|
|
#endif /* GPARTED_DIALOG_PROGRESS_H */
|