deal correctly with the progressdialog's delete_event.
* include/Dialog_Progress.h, src/Dialog_Progress.cc, src/Win_GParted.cc: deal correctly with the progressdialog's delete_event.
This commit is contained in:
parent
8a2624c3b8
commit
e00e9cfa61
|
@ -1,3 +1,10 @@
|
||||||
|
2006-01-26 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
|
|
||||||
|
* include/Dialog_Progress.h,
|
||||||
|
src/Dialog_Progress.cc,
|
||||||
|
src/Win_GParted.cc: deal correctly with the progressdialog's
|
||||||
|
delete_event.
|
||||||
|
|
||||||
2006-01-26 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
2006-01-26 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
|
|
||||||
* include/Dialog_Partition_Info.h,
|
* include/Dialog_Partition_Info.h,
|
||||||
|
|
|
@ -45,8 +45,10 @@ private:
|
||||||
void on_signal_show() ;
|
void on_signal_show() ;
|
||||||
void on_expander_changed() ;
|
void on_expander_changed() ;
|
||||||
static void *static_pthread_apply_operation( void * p_dialog_progress ) ;
|
static void *static_pthread_apply_operation( void * p_dialog_progress ) ;
|
||||||
|
void on_cancel() ;
|
||||||
|
|
||||||
void on_response( int response_id ) ;
|
void on_response( int response_id ) ;
|
||||||
|
bool on_delete_event( GdkEventAny * event ) ;
|
||||||
|
|
||||||
Gtk::Label label_current ;
|
Gtk::Label label_current ;
|
||||||
Gtk::ProgressBar progressbar_all, progressbar_current ;
|
Gtk::ProgressBar progressbar_all, progressbar_current ;
|
||||||
|
|
|
@ -252,10 +252,8 @@ void * Dialog_Progress::static_pthread_apply_operation( void * p_dialog_progress
|
||||||
return NULL ;
|
return NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog_Progress::on_response( int response_id )
|
void Dialog_Progress::on_cancel()
|
||||||
{
|
{
|
||||||
if ( response_id == Gtk::RESPONSE_CANCEL )
|
|
||||||
{
|
|
||||||
Gtk::MessageDialog dialog( *this,
|
Gtk::MessageDialog dialog( *this,
|
||||||
_("Are you sure you want to cancel the current operation?"),
|
_("Are you sure you want to cancel the current operation?"),
|
||||||
false,
|
false,
|
||||||
|
@ -275,9 +273,22 @@ void Dialog_Progress::on_response( int response_id )
|
||||||
pulse = false ;
|
pulse = false ;
|
||||||
succes = false ;
|
succes = false ;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Dialog_Progress::on_response( int response_id )
|
||||||
|
{
|
||||||
|
if ( response_id == Gtk::RESPONSE_CANCEL )
|
||||||
|
on_cancel() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Dialog_Progress::on_delete_event( GdkEventAny * event )
|
||||||
|
{
|
||||||
|
//it seems this get only called at runtime
|
||||||
|
on_cancel() ;
|
||||||
|
return true ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Dialog_Progress::~Dialog_Progress()
|
Dialog_Progress::~Dialog_Progress()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -1394,7 +1394,7 @@ void Win_GParted::activate_apply( )
|
||||||
dialog_progress .signal_apply_operation .connect(
|
dialog_progress .signal_apply_operation .connect(
|
||||||
sigc::mem_fun(gparted_core, &GParted_Core::apply_operation_to_disk) ) ;
|
sigc::mem_fun(gparted_core, &GParted_Core::apply_operation_to_disk) ) ;
|
||||||
|
|
||||||
for ( ; dialog_progress .run() != Gtk::RESPONSE_OK ; ) {}
|
for ( ; dialog_progress .run() == Gtk::RESPONSE_CANCEL ; ) {}
|
||||||
dialog_progress .hide() ;
|
dialog_progress .hide() ;
|
||||||
|
|
||||||
//find out if any of the involved devices is busy
|
//find out if any of the involved devices is busy
|
||||||
|
|
Loading…
Reference in New Issue