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>
* include/Utils.h,

View File

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

View File

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

View File

@ -24,13 +24,15 @@ namespace GParted
Dialog_Filesystems::Dialog_Filesystems()
{
this ->set_title( _("Filesystems") ) ;
this ->set_has_separator( false ) ;
this ->set_resizable( false ) ;
set_title( _("Filesystems") ) ;
set_has_separator( false ) ;
set_resizable( false ) ;
liststore_filesystems = Gtk::ListStore::create( treeview_filesystems_columns );
treeview_filesystems .set_model( liststore_filesystems );
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( _("Grow"), treeview_filesystems_columns .grow );
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 .get_selection() ->set_mode( Gtk::SELECTION_NONE );
this ->get_vbox() ->pack_start( treeview_filesystems ) ;
get_vbox() ->pack_start( treeview_filesystems ) ;
//initialize icons
icon_yes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
icon_no = render_icon( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
this ->add_button( Gtk::Stock::REFRESH, Gtk::RESPONSE_OK );
this ->add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE ) ->grab_focus() ;
this ->show_all_children() ;
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() ;
@ -58,20 +64,13 @@ void Dialog_Filesystems::Show_Filesystem( const FS & fs )
treerow = *( liststore_filesystems ->append() );
treerow[ treeview_filesystems_columns .filesystem ] = Utils::get_filesystem_string( fs .filesystem ) ;
treerow[ treeview_filesystems_columns .create ] =
render_icon( fs .create ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR);
treerow[ treeview_filesystems_columns .grow ] =
render_icon( fs .grow ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR );
treerow[ treeview_filesystems_columns .shrink ] =
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 );
treerow[ treeview_filesystems_columns .detect ] = icon_yes ;
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 ] = fs .grow ? icon_yes : icon_no ;
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 .copy ] = fs .copy ? icon_yes : icon_no ;
}
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
this ->add( vbox_main );
this ->signal_show() .connect( sigc::mem_fun(*this, &Win_GParted::on_signal_show) );
//menubar....
init_menubar() ;
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()
{//FIXME: why not simply override Widget::on_show() ?
void Win_GParted::on_show()
{
Gtk::Window::on_show() ;
vpaned_main .set_position( vpaned_main .get_height() ) ;
close_operationslist() ;