Improved File System Support dialog readability.

- Changed title Features to File System Support.
 - Renamed button Refresh to Rescan Support.
 - Created expander for legend and added narrative.
 - Removed columns detect and read.

svn path=/trunk/; revision=966
This commit is contained in:
Curtis Gedak 2008-11-14 20:18:46 +00:00
parent 506c062274
commit e4c2ca33aa
3 changed files with 52 additions and 17 deletions

View File

@ -1,5 +1,13 @@
2008-11-14 Curtis Gedak <gedakc@gmail.com> 2008-11-14 Curtis Gedak <gedakc@gmail.com>
* include/DialogFeatures.h,
src/DialogFeatures.cc: Improved dialog readability.
- Changed title Features to File System Support.
- Renamed button Refresh to Rescan Support.
- Created expander for legend and added narrative.
- Removed columns detect and read.
- Closes GParted bugs #342682, and #353104
* include/Utils.h, * include/Utils.h,
src/Utils.cc: Created method get_filesystem_software(). src/Utils.cc: Created method get_filesystem_software().

View File

@ -21,6 +21,7 @@
#include "../include/Utils.h" #include "../include/Utils.h"
#include <gtkmm/dialog.h> #include <gtkmm/dialog.h>
#include <gtkmm/expander.h>
#include <gtkmm/treeview.h> #include <gtkmm/treeview.h>
#include <gtkmm/liststore.h> #include <gtkmm/liststore.h>
#include <gtkmm/image.h> #include <gtkmm/image.h>
@ -40,16 +41,18 @@ private:
void show_filesystem( const FS & fs ) ; void show_filesystem( const FS & fs ) ;
Gtk::HBox *hbox ; Gtk::HBox *hbox ;
Gtk::HBox *hbox2 ;
Gtk::VBox *vbox ;
Gtk::Image *image ; Gtk::Image *image ;
Gtk::Expander expander_legend ;
Gtk::TreeView treeview_filesystems; Gtk::TreeView treeview_filesystems;
Gtk::TreeRow treerow; Gtk::TreeRow treerow;
Glib::RefPtr<Gtk::ListStore> liststore_filesystems; Glib::RefPtr<Gtk::ListStore> liststore_filesystems;
Glib::ustring str_temp ;
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> > detect ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > read ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > create ; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > create ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > grow ; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > grow ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > shrink ; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > shrink ;
@ -57,12 +60,11 @@ private:
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > copy ; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > copy ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > check ; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > check ;
Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > label ; Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > label ;
Gtk::TreeModelColumn<Glib::ustring> software ;
treeview_filesystems_Columns() treeview_filesystems_Columns()
{ {
add( filesystem ); add( filesystem );
add( detect ) ;
add( read ) ;
add( create ) ; add( create ) ;
add( grow ) ; add( grow ) ;
add( shrink ) ; add( shrink ) ;
@ -70,6 +72,7 @@ private:
add( copy ) ; add( copy ) ;
add( check ) ; add( check ) ;
add( label ) ; add( label ) ;
add( software ) ;
} }
}; };

View File

@ -24,15 +24,14 @@ namespace GParted
DialogFeatures::DialogFeatures() DialogFeatures::DialogFeatures()
{ {
set_title( _("Features") ) ; set_title( _("File System Support") ) ;
set_has_separator( false ) ; set_has_separator( false ) ;
set_resizable( false ) ; set_resizable( false ) ;
//treeview
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( _("File System"), 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 );
@ -40,8 +39,7 @@ DialogFeatures::DialogFeatures()
treeview_filesystems .append_column( _("Copy"), treeview_filesystems_columns .copy ); treeview_filesystems .append_column( _("Copy"), treeview_filesystems_columns .copy );
treeview_filesystems .append_column( _("Check"), treeview_filesystems_columns .check ); treeview_filesystems .append_column( _("Check"), treeview_filesystems_columns .check );
treeview_filesystems .append_column( _("Label"), treeview_filesystems_columns .label ); treeview_filesystems .append_column( _("Label"), treeview_filesystems_columns .label );
//FIXME: add info about the relevant project (e.g an url to the projectpage) treeview_filesystems .append_column( _("Required Software"), treeview_filesystems_columns .software );
//of course this url has to be selectable and (if possible) clickable
treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE ); treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE );
treeview_filesystems .set_rules_hint( true ) ; treeview_filesystems .set_rules_hint( true ) ;
@ -50,24 +48,50 @@ DialogFeatures::DialogFeatures()
hbox ->pack_start( treeview_filesystems ) ; hbox ->pack_start( treeview_filesystems ) ;
get_vbox() ->pack_start( *hbox ) ; get_vbox() ->pack_start( *hbox ) ;
//legend.. //file system support legend
hbox2 = manage( new Gtk::HBox( false, 6 ) ) ;
hbox2 ->set_border_width( 6 ) ;
hbox = manage( new Gtk::HBox() ) ;
str_temp = _("This chart shows the actions supported on file systems.") ;
str_temp += "\n" ;
str_temp += _("Not all actions are available on all file systems, in part due to the nature of file systems and limitations in the required software.") ;
hbox ->pack_start( * Utils::mk_label( str_temp, true, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true ),
Gtk::PACK_SHRINK );
hbox2 -> pack_start( *hbox ) ;
//icon legend
vbox = manage( new Gtk::VBox() ) ;
hbox = manage( new Gtk::HBox() ) ; hbox = manage( new Gtk::HBox() ) ;
image = manage( new Gtk::Image( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ); image = manage( new Gtk::Image( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) );
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ; hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ;
hbox ->pack_start( * Utils::mk_label( _("Available") ), Gtk::PACK_EXPAND_WIDGET ) ; hbox ->pack_start( * Utils::mk_label( _("Available") ), Gtk::PACK_EXPAND_WIDGET ) ;
get_vbox() ->pack_start( *hbox ) ; vbox ->pack_start( *hbox ) ;
hbox = manage( new Gtk::HBox() ) ; hbox = manage( new Gtk::HBox() ) ;
image = manage( new Gtk::Image( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ); image = manage( new Gtk::Image( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) );
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ; hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ;
hbox ->pack_start( * Utils::mk_label( _("Not Available") ), Gtk::PACK_EXPAND_WIDGET ) ; hbox ->pack_start( * Utils::mk_label( _("Not Available") ), Gtk::PACK_EXPAND_WIDGET ) ;
get_vbox() ->pack_start( *hbox ) ; vbox ->pack_start( *hbox ) ;
hbox2 ->pack_start( *vbox ) ;
//legend
hbox = manage( new Gtk::HBox( false, 6 ) ) ;
hbox ->set_border_width( 6 ) ;
str_temp = "<b>" ;
str_temp += _("Legend") ;
str_temp += "</b>" ;
expander_legend .set_label( str_temp ) ;
expander_legend .set_use_markup( true ) ;
get_vbox() ->pack_start( expander_legend, Gtk::PACK_SHRINK ) ;
expander_legend .add( *hbox2 ) ;
//initialize icons //initialize icons
icon_yes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_yes = render_icon( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
icon_no = render_icon( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ; icon_no = render_icon( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) ;
add_button( Gtk::Stock::REFRESH, Gtk::RESPONSE_OK ) ; add_button( _("Rescan Support"), Gtk::RESPONSE_OK );
add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE ) ->grab_focus() ; add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE ) ->grab_focus() ;
show_all_children() ; show_all_children() ;
} }
@ -85,8 +109,6 @@ void DialogFeatures::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 .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 .create ] = fs .create ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .grow ] = fs .grow ? 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 .shrink ] = fs .shrink ? icon_yes : icon_no ;
@ -94,6 +116,8 @@ void DialogFeatures::show_filesystem( const FS & fs )
treerow[ treeview_filesystems_columns .copy ] = fs .copy ? icon_yes : icon_no ; treerow[ treeview_filesystems_columns .copy ] = fs .copy ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .check ] = fs .check ? icon_yes : icon_no ; treerow[ treeview_filesystems_columns .check ] = fs .check ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .label ] = fs .write_label ? icon_yes : icon_no ; treerow[ treeview_filesystems_columns .label ] = fs .write_label ? icon_yes : icon_no ;
treerow[ treeview_filesystems_columns .software ] = Utils::get_filesystem_software( fs .filesystem ) ;
} }
DialogFeatures::~DialogFeatures() DialogFeatures::~DialogFeatures()