diff --git a/ChangeLog b/ChangeLog index f5a4c1dd..895f95e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-04-02 Bart Hakvoort + + * include/DialogManageFlags.h, + src/DialogManageFlags.cc, + src/Win_GParted.cc: improved behaviour of flagmanagementdialog. + 2006-04-01 Bart Hakvoort * src/OperationResizeMove.cc: fixed another issue in diff --git a/include/DialogManageFlags.h b/include/DialogManageFlags.h index 090bce7c..887f2c17 100644 --- a/include/DialogManageFlags.h +++ b/include/DialogManageFlags.h @@ -31,7 +31,7 @@ namespace GParted class DialogManageFlags : public Gtk::Dialog { public: - DialogManageFlags( const Partition & partition ) ; + DialogManageFlags( const Partition & partition, std::map flag_info ) ; sigc::signal< std::map, const Partition & > signal_get_flags ; sigc::signal< bool, const Partition &, const Glib::ustring &, bool > signal_toggle_flag ; @@ -39,9 +39,7 @@ public: bool any_change ; private: - void on_show() ; - - void load_flags() ; + void load_treeview() ; void on_flag_toggled( const Glib::ustring & path ) ; @@ -64,6 +62,7 @@ private: treeview_flags_Columns treeview_flags_columns ; Partition partition ; + std::map flag_info ; }; } //GParted diff --git a/src/DialogManageFlags.cc b/src/DialogManageFlags.cc index faad6175..8ac22d6f 100644 --- a/src/DialogManageFlags.cc +++ b/src/DialogManageFlags.cc @@ -19,18 +19,18 @@ #include #include +#include namespace GParted { -DialogManageFlags::DialogManageFlags( const Partition & partition ) +DialogManageFlags::DialogManageFlags( const Partition & partition, std::map flag_info ) { any_change = false ; set_title( String::ucompose( _("Manage flags on %1"), partition .get_path() ) ); set_has_separator( false ) ; - set_size_request( 300, -1 ) ; - set_resizable( false ); + set_default_size( -1, 250 ) ; Glib::ustring str_temp = "" ; str_temp += String::ucompose( _("Manage flags on %1"), partition .get_path() ) ; @@ -49,31 +49,22 @@ DialogManageFlags::DialogManageFlags( const Partition & partition ) static_cast( treeview_flags .get_column_cell_renderer( 0 ) ) ->signal_toggled() .connect( sigc::mem_fun( *this, &DialogManageFlags::on_flag_toggled ) ) ; + treeview_flags .set_size_request( 300, -1 ) ; get_vbox() ->pack_start( treeview_flags, Gtk::PACK_SHRINK ) ; this ->partition = partition ; + this ->flag_info = flag_info ; + load_treeview() ; add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_OK ) ->grab_focus() ; show_all_children() ; } -void DialogManageFlags::on_show() -{ - Dialog::on_show() ; - - while ( Gtk::Main::events_pending() ) - Gtk::Main::iteration() ; - - load_flags() ; -} - -void DialogManageFlags::load_flags() +void DialogManageFlags::load_treeview() { liststore_flags ->clear() ; - std::map flag_info = signal_get_flags .emit( partition ) ; - for ( std::map::iterator iter = flag_info .begin() ; iter != flag_info .end() ; ++iter ) { row = *( liststore_flags ->append() ) ; @@ -84,6 +75,11 @@ void DialogManageFlags::load_flags() void DialogManageFlags::on_flag_toggled( const Glib::ustring & path ) { + get_window() ->set_cursor( Gdk::Cursor( Gdk::WATCH ) ) ; + set_sensitive( false ) ; + while ( Gtk::Main::events_pending() ) + Gtk::Main::iteration() ; + any_change = true ; row = *( liststore_flags ->get_iter( path ) ) ; @@ -91,7 +87,11 @@ void DialogManageFlags::on_flag_toggled( const Glib::ustring & path ) signal_toggle_flag .emit( partition, row[ treeview_flags_columns .flag ], row[ treeview_flags_columns .status ] ) ; - load_flags() ; + flag_info = signal_get_flags .emit( partition ) ; + load_treeview() ; + + set_sensitive( true ) ; + get_window() ->set_cursor() ; } }//GParted diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 6110f4cb..8f85fe11 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -932,7 +932,7 @@ void Win_GParted::radio_devices_changed( unsigned int item ) } void Win_GParted::on_signal_show() -{ +{//FIXME: why not simply override Widget::on_show() ? vpaned_main .set_position( vpaned_main .get_height() ) ; close_operationslist() ; @@ -1672,17 +1672,22 @@ void Win_GParted::activate_disklabel() void Win_GParted::activate_manage_flags() { - DialogManageFlags dialog( selected_partition ) ; - dialog .set_transient_for( *this ) ; + get_window() ->set_cursor( Gdk::Cursor( Gdk::WATCH ) ) ; + while ( Gtk::Main::events_pending() ) + Gtk::Main::iteration() ; + DialogManageFlags dialog( selected_partition, gparted_core .get_available_flags( selected_partition ) ) ; + dialog .set_transient_for( *this ) ; dialog .signal_get_flags .connect( sigc::mem_fun( &gparted_core, &GParted_Core::get_available_flags ) ) ; dialog .signal_toggle_flag .connect( sigc::mem_fun( &gparted_core, &GParted_Core::toggle_flag ) ) ; + get_window() ->set_cursor() ; + dialog .run() ; dialog .hide() ; - + if ( dialog .any_change ) menu_gparted_refresh_devices() ; }