2004-09-19 14:24:53 -06:00
|
|
|
/* Copyright (C) 2004 Bart
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DIALOG_PARTITION_PROGRESS
|
|
|
|
#define DIALOG_PARTITION_PROGRESS
|
|
|
|
|
2004-09-20 09:46:21 -06:00
|
|
|
#include "../include/i18n.h"
|
2004-10-06 13:06:43 -06:00
|
|
|
#include "../include/Utils.h"
|
2006-01-19 12:15:15 -07:00
|
|
|
#include "../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 ;
|
2004-11-17 06:00:25 -07:00
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
private:
|
2006-01-19 12:15:15 -07:00
|
|
|
void update_operation_details( const Gtk::TreeRow & treerow, const OperationDetails & operation_details ) ;
|
|
|
|
void on_signal_show() ;
|
2006-01-26 08:54:44 -07:00
|
|
|
void on_expander_changed() ;
|
2006-01-28 08:09:50 -07:00
|
|
|
void on_cell_data_description( Gtk::CellRenderer * renderer, const Gtk::TreeModel::iterator & iter) ;
|
2006-01-25 16:30:43 -07:00
|
|
|
static void *static_pthread_apply_operation( void * p_dialog_progress ) ;
|
2006-01-26 15:49:37 -07:00
|
|
|
void on_cancel() ;
|
2006-02-07 08:17:44 -07:00
|
|
|
void on_save() ;
|
|
|
|
void echo_operation_details( const OperationDetails & operation_details, 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 ) ;
|
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 ;
|
|
|
|
|
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_execute ;
|
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_succes ;
|
|
|
|
Glib::RefPtr<Gdk::Pixbuf> icon_error ;
|
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;
|
|
|
|
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > operation_icon;
|
|
|
|
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > status_icon;
|
|
|
|
Gtk::TreeModelColumn<OperationDetails::Status> hidden_status ;
|
|
|
|
|
|
|
|
treeview_operations_Columns()
|
|
|
|
{
|
|
|
|
add( operation_description );
|
|
|
|
add( operation_icon );
|
|
|
|
add( status_icon ) ;
|
|
|
|
add( hidden_status ) ;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
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 ;
|
2006-05-23 15:17:34 -06:00
|
|
|
bool running, succes, cancel, pulse ;
|
2006-01-25 16:30:43 -07:00
|
|
|
pthread_t pthread ;
|
2006-01-19 12:15:15 -07:00
|
|
|
double fraction ;
|
|
|
|
unsigned int t ;
|
|
|
|
Glib::ustring str_temp ;
|
2004-09-19 14:24:53 -06:00
|
|
|
};
|
|
|
|
|
2004-10-06 13:06:43 -06:00
|
|
|
}//GParted
|
|
|
|
|
2004-09-19 14:24:53 -06:00
|
|
|
#endif //DIALOG_PARTITION_PROGRESS
|