override Gtk::Window::on_show instead of connecting to signal_show() added

* include/Win_GParted.h,
  src/Win_GParted.cc: override Gtk::Window::on_show instead of
  connecting to signal_show()
* include/Dialog_Filesystems.h,
  src/Dialog_Filesystems.cc: added columns 'detect' and 'read'
This commit is contained in:
Bart Hakvoort 2006-04-02 14:04:44 +00:00
parent dcf31ca083
commit 321f0a3dd1
5 changed files with 53 additions and 39 deletions

View File

@ -1,3 +1,11 @@
2006-04-02 Bart Hakvoort <hakvoort@cvs.gnome.org>
* include/Win_GParted.h,
src/Win_GParted.cc: override Gtk::Window::on_show instead of
connecting to signal_show()
* include/Dialog_Filesystems.h,
src/Dialog_Filesystems.cc: added columns 'detect' and 'read'
2006-04-02 Bart Hakvoort <hakvoort@cvs.gnome.org> 2006-04-02 Bart Hakvoort <hakvoort@cvs.gnome.org>
* include/Utils.h, * include/Utils.h,

View File

@ -17,8 +17,7 @@
#ifndef DIALOG_FILESYSTEMS #ifndef DIALOG_FILESYSTEMS
#define DIALOG_FILESYSTEMS #define DIALOG_FILESYSTEMS
//FIXME add more info ( at least 'detect' which will be any filesystem we _can_ detect (and should therefore have //FIXME: add classes for all fs'es we can detect so they show up here.
//it's own class) )
#include "../include/Utils.h" #include "../include/Utils.h"
#include <gtkmm/dialog.h> #include <gtkmm/dialog.h>
@ -31,9 +30,8 @@ namespace GParted
class Dialog_Filesystems : public Gtk::Dialog class Dialog_Filesystems : public Gtk::Dialog
{ {
public: public:
Dialog_Filesystems() ; Dialog_Filesystems() ;
void Load_Filesystems( const std::vector< FS > & FILESYSTEMS ) ; void Load_Filesystems( const std::vector<FS> & FILESYSTEMS ) ;
~Dialog_Filesystems() ; ~Dialog_Filesystems() ;
private: private:
@ -46,20 +44,30 @@ private:
struct treeview_filesystems_Columns : public Gtk::TreeModelColumnRecord struct treeview_filesystems_Columns : public Gtk::TreeModelColumnRecord
{ {
Gtk::TreeModelColumn<Glib::ustring> filesystem; Gtk::TreeModelColumn<Glib::ustring> filesystem;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > create; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > detect ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > grow; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > read ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > shrink; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > create ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > move; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > grow ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > copy; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > shrink ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > move ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > copy ;
treeview_filesystems_Columns() treeview_filesystems_Columns()
{ {
add( filesystem ); add( create ); add( grow ); add( filesystem );
add( shrink ); add( move ); add( copy ); add( detect ) ;
add( read ) ;
add( create ) ;
add( grow ) ;
add( shrink ) ;
add( move ) ;
add( copy ) ;
} }
}; };
treeview_filesystems_Columns treeview_filesystems_columns ; treeview_filesystems_Columns treeview_filesystems_columns ;
Glib::RefPtr<Gdk::Pixbuf> icon_yes, icon_no ;
}; };
} //GParted } //GParted

View File

@ -63,7 +63,6 @@ private:
//Fill txtview_device_info_buffer with some information about the selected device //Fill txtview_device_info_buffer with some information about the selected device
void Fill_Label_Device_Info( bool clear = false ); void Fill_Label_Device_Info( bool clear = false );
void Add_Operation( OperationType operationtype, const Partition & new_partition, int index = -1 ) ; void Add_Operation( OperationType operationtype, const Partition & new_partition, int index = -1 ) ;
void Refresh_Visual(); void Refresh_Visual();
bool Quit_Check_Operations(); bool Quit_Check_Operations();
@ -124,8 +123,8 @@ private:
void clear_operationslist() ; void clear_operationslist() ;
void combo_devices_changed(); void combo_devices_changed();
void radio_devices_changed( unsigned int item ) ; void radio_devices_changed( unsigned int item ) ;
void on_signal_show() ;
bool on_delete_event( GdkEventAny* ) ; bool on_delete_event( GdkEventAny* ) ;
void on_show() ;
void menu_gparted_refresh_devices(); void menu_gparted_refresh_devices();
void menu_gparted_filesystems(); void menu_gparted_filesystems();

View File

@ -24,13 +24,15 @@ namespace GParted
Dialog_Filesystems::Dialog_Filesystems() Dialog_Filesystems::Dialog_Filesystems()
{ {
this ->set_title( _("Filesystems") ) ; set_title( _("Filesystems") ) ;
this ->set_has_separator( false ) ; set_has_separator( false ) ;
this ->set_resizable( false ) ; set_resizable( false ) ;
liststore_filesystems = Gtk::ListStore::create( treeview_filesystems_columns ); liststore_filesystems = Gtk::ListStore::create( treeview_filesystems_columns );
treeview_filesystems .set_model( liststore_filesystems ); treeview_filesystems .set_model( liststore_filesystems );
treeview_filesystems .append_column( _("Filesystem"), treeview_filesystems_columns .filesystem ); treeview_filesystems .append_column( _("Filesystem"), treeview_filesystems_columns .filesystem );
treeview_filesystems .append_column( _("Detect"), treeview_filesystems_columns .detect );
treeview_filesystems .append_column( _("Read"), treeview_filesystems_columns .read );
treeview_filesystems .append_column( _("Create"), treeview_filesystems_columns .create ); treeview_filesystems .append_column( _("Create"), treeview_filesystems_columns .create );
treeview_filesystems .append_column( _("Grow"), treeview_filesystems_columns .grow ); treeview_filesystems .append_column( _("Grow"), treeview_filesystems_columns .grow );
treeview_filesystems .append_column( _("Shrink"), treeview_filesystems_columns .shrink ); treeview_filesystems .append_column( _("Shrink"), treeview_filesystems_columns .shrink );
@ -38,14 +40,18 @@ Dialog_Filesystems::Dialog_Filesystems()
treeview_filesystems .append_column( _("Copy"), treeview_filesystems_columns .copy ); treeview_filesystems .append_column( _("Copy"), treeview_filesystems_columns .copy );
treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE ); treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE );
this ->get_vbox() ->pack_start( treeview_filesystems ) ; get_vbox() ->pack_start( treeview_filesystems ) ;
this ->add_button( Gtk::Stock::REFRESH, Gtk::RESPONSE_OK ); //initialize icons
this ->add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE ) ->grab_focus() ; icon_yes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
this ->show_all_children() ; icon_no = render_icon( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
add_button( Gtk::Stock::REFRESH, Gtk::RESPONSE_OK );
add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE ) ->grab_focus() ;
show_all_children() ;
} }
void Dialog_Filesystems::Load_Filesystems( const std::vector< FS > & FILESYSTEMS ) void Dialog_Filesystems::Load_Filesystems( const std::vector<FS> & FILESYSTEMS )
{ {
liststore_filesystems ->clear() ; liststore_filesystems ->clear() ;
@ -58,20 +64,13 @@ void Dialog_Filesystems::Show_Filesystem( const FS & fs )
treerow = *( liststore_filesystems ->append() ); treerow = *( liststore_filesystems ->append() );
treerow[ treeview_filesystems_columns .filesystem ] = Utils::get_filesystem_string( fs .filesystem ) ; treerow[ treeview_filesystems_columns .filesystem ] = Utils::get_filesystem_string( fs .filesystem ) ;
treerow[ treeview_filesystems_columns .create ] = treerow[ treeview_filesystems_columns .detect ] = icon_yes ;
render_icon( fs .create ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR); treerow[ treeview_filesystems_columns .read ] = fs .read ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .create ] = fs .create ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .grow ] = treerow[ treeview_filesystems_columns .grow ] = fs .grow ? icon_yes : icon_no ;
render_icon( fs .grow ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ); treerow[ treeview_filesystems_columns .shrink ] = fs .shrink ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .move ] = fs .move ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .shrink ] = treerow[ treeview_filesystems_columns .copy ] = fs .copy ? icon_yes : icon_no ;
render_icon( fs .shrink ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
treerow[ treeview_filesystems_columns .move ] =
render_icon( fs .move ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
treerow[ treeview_filesystems_columns .copy ] =
render_icon( fs .copy ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
} }
Dialog_Filesystems::~Dialog_Filesystems() Dialog_Filesystems::~Dialog_Filesystems()

View File

@ -64,8 +64,6 @@ Win_GParted::Win_GParted( const std::vector<Glib::ustring> & user_devices )
//Pack the main box //Pack the main box
this ->add( vbox_main ); this ->add( vbox_main );
this ->signal_show() .connect( sigc::mem_fun(*this, &Win_GParted::on_signal_show) );
//menubar.... //menubar....
init_menubar() ; init_menubar() ;
vbox_main .pack_start( menubar_main, Gtk::PACK_SHRINK ); vbox_main .pack_start( menubar_main, Gtk::PACK_SHRINK );
@ -931,8 +929,10 @@ void Win_GParted::radio_devices_changed( unsigned int item )
} }
} }
void Win_GParted::on_signal_show() void Win_GParted::on_show()
{//FIXME: why not simply override Widget::on_show() ? {
Gtk::Window::on_show() ;
vpaned_main .set_position( vpaned_main .get_height() ) ; vpaned_main .set_position( vpaned_main .get_height() ) ;
close_operationslist() ; close_operationslist() ;