some small changes to make the GUI more consistent (#353140)

* include/Win_GParted.h,
  src/Win_GParted.cc: some small changes to make the GUI more
  consistent (#353140)
This commit is contained in:
Bart Hakvoort 2006-09-16 11:27:05 +00:00
parent 3b920ef093
commit fc8014115e
3 changed files with 28 additions and 42 deletions

View File

@ -1,3 +1,9 @@
2006-09-16 Bart Hakvoort <hakvoort@cvs.gnome.org>
* include/Win_GParted.h,
src/Win_GParted.cc: some small changes to make the GUI more
consistent (#353140)
2006-09-14 Bart Hakvoort <hakvoort@cvs.gnome.org>
* configure.in: changed libpartedcheck a bit. from now on we declare

View File

@ -104,16 +104,20 @@ private:
void allow_info( bool state ) {
toggle_item( state, MENU_INFO ) ; }
void allow_undo( bool state ) {
void allow_undo_clear_apply( bool state )
{
toggle_item( state, -1, TOOLBAR_UNDO ) ;
static_cast<Gtk::CheckMenuItem *>( & menubar_main .items()[ 1 ] .get_submenu() ->items()[ 0 ] )
->set_sensitive( state ) ; }
void allow_apply( bool state ) {
toggle_item( state, -1, TOOLBAR_APPLY ) ;
->set_sensitive( state ) ;
static_cast<Gtk::CheckMenuItem *>( & menubar_main .items()[ 1 ] .get_submenu() ->items()[ 1 ] )
->set_sensitive( state ) ; }
->set_sensitive( state ) ;
toggle_item( state, -1, TOOLBAR_APPLY ) ;
static_cast<Gtk::CheckMenuItem *>( & menubar_main .items()[ 1 ] .get_submenu() ->items()[ 2 ] )
->set_sensitive( state ) ;
}
//threads..
void thread_refresh_devices() ;
@ -169,7 +173,7 @@ private:
//gui stuff
Gtk::HPaned hpaned_main;
Gtk::VPaned vpaned_main;
Gtk::VBox vbox_main,vbox_info, *vbox;
Gtk::VBox vbox_main,vbox_info ;
Gtk::HBox hbox_toolbar, hbox_operations, *hbox;
Gtk::Toolbar toolbar_main;
Gtk::MenuBar menubar_main;
@ -181,7 +185,6 @@ private:
Gtk::ScrolledWindow *scrollwindow;
Gtk::Label label_device_info1, label_device_info2, *label;
Gtk::Tooltips tooltips ;
Gtk::Button *button;
Gtk::Table *table ;
Gtk::MenuItem *menu_item;
Gtk::ProgressBar pulsebar ;

View File

@ -138,7 +138,10 @@ void Win_GParted::init_menubar()
//edit
menu = manage( new Gtk::Menu() ) ;
menu ->items() .push_back( Gtk::Menu_Helpers::StockMenuElem( Gtk::Stock::UNDO, Gtk::AccelKey("<control>z"), sigc::mem_fun(*this, &Win_GParted::activate_undo) ) );
menu ->items() .push_back( Gtk::Menu_Helpers::StockMenuElem(
Gtk::Stock::UNDO, Gtk::AccelKey("<control>z"), sigc::mem_fun(*this, &Win_GParted::activate_undo) ) );
menu ->items() .push_back( Gtk::Menu_Helpers::StockMenuElem(
Gtk::Stock::CLEAR, sigc::mem_fun(*this, &Win_GParted::clear_operationslist) ) );
menu ->items() .push_back( Gtk::Menu_Helpers::StockMenuElem( Gtk::Stock::APPLY, sigc::mem_fun(*this, &Win_GParted::activate_apply) ) );
menubar_main .items() .push_back( Gtk::Menu_Helpers::MenuElem( _("_Edit"), *menu ) );
@ -454,39 +457,17 @@ void Win_GParted::init_operationslist()
treeview_operations .append_column( "", treeview_operations_columns .operation_icon );
treeview_operations .append_column( "", treeview_operations_columns .operation_description );
treeview_operations .get_selection() ->set_mode( Gtk::SELECTION_NONE );
//init scrollwindow_operations
scrollwindow = manage( new Gtk::ScrolledWindow( ) ) ;
scrollwindow ->set_shadow_type( Gtk::SHADOW_ETCHED_IN );
scrollwindow ->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
scrollwindow ->add ( treeview_operations ) ;
//set up the close and clear buttons and pack them in a vbox
vbox = manage( new Gtk::VBox( ) ) ;
//CLOSE
button = manage( new Gtk::Button( ) );
image = manage( new Gtk::Image( Gtk::Stock::CLOSE, Gtk::ICON_SIZE_MENU ) );
button ->add( *image ) ;
button ->set_relief( Gtk::RELIEF_NONE );
tooltips .set_tip( *button, _("Hide operationslist") );
button ->signal_clicked( ) .connect( sigc::mem_fun( *this, &Win_GParted::close_operationslist ) );
vbox ->pack_start( *button, Gtk::PACK_SHRINK );
//CLEAR
button = manage( new Gtk::Button( ) );
image = manage( new Gtk::Image( Gtk::Stock::CLEAR, Gtk::ICON_SIZE_MENU ) );
button ->add( *image ) ;
button ->set_relief( Gtk::RELIEF_NONE );
tooltips .set_tip( *button, _("Clear operationslist") );
button ->signal_clicked( ) .connect( sigc::mem_fun( *this, &Win_GParted::clear_operationslist ) );
vbox ->pack_start( *button, Gtk::PACK_SHRINK );
//add vbox and scrollwindow_operations to hbox_operations
hbox_operations .pack_start( *vbox, Gtk::PACK_SHRINK );
hbox_operations .pack_start( *scrollwindow, Gtk::PACK_EXPAND_WIDGET );
}
void Win_GParted::init_hpaned_main( )
void Win_GParted::init_hpaned_main()
{
//left scrollwindow (holds device info)
scrollwindow = manage( new Gtk::ScrolledWindow( ) ) ;
@ -632,9 +613,7 @@ void Win_GParted::Add_Operation( Operation * operation, int index )
else
operations .push_back( operation );
allow_undo( true ) ;
allow_apply( true ) ;
allow_undo_clear_apply( true ) ;
Refresh_Visual();
if ( operations .size() == 1 ) //first operation, open operationslist
@ -684,10 +663,7 @@ void Win_GParted::Refresh_Visual()
statusbar .push( _( "1 operation pending" ) );
if ( ! operations .size() )
{
allow_undo( false );
allow_apply( false );
}
allow_undo_clear_apply( false ) ;
//count primary's and check for extended
index_extended = -1 ;
@ -927,6 +903,7 @@ void Win_GParted::close_operationslist()
void Win_GParted::clear_operationslist()
{
remove_operation( -1, true ) ;
close_operationslist() ;
Refresh_Visual() ;
}
@ -969,7 +946,7 @@ void Win_GParted::on_show()
menu_gparted_refresh_devices() ;
}
void Win_GParted::thread_refresh_devices()
{
gparted_core .set_devices( devices ) ;