2008-04-07 13:41:18 -06:00
|
|
|
/* Copyright (C) 2004, 2005, 2006, 2007, 2008 Bart Hakvoort
|
2004-12-15 09:38:37 -07:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2006-04-05 03:33:04 -06:00
|
|
|
#include "../include/DialogFeatures.h"
|
2004-12-15 09:38:37 -07:00
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
#include <gtkmm/stock.h>
|
|
|
|
|
2004-12-15 09:38:37 -07:00
|
|
|
namespace GParted
|
|
|
|
{
|
|
|
|
|
2006-04-05 03:33:04 -06:00
|
|
|
DialogFeatures::DialogFeatures()
|
2004-12-15 09:38:37 -07:00
|
|
|
{
|
2006-04-05 03:33:04 -06:00
|
|
|
set_title( _("Features") ) ;
|
2006-04-02 08:04:44 -06:00
|
|
|
set_has_separator( false ) ;
|
|
|
|
set_resizable( false ) ;
|
2006-09-16 06:44:36 -06:00
|
|
|
|
2004-12-18 08:51:48 -07:00
|
|
|
liststore_filesystems = Gtk::ListStore::create( treeview_filesystems_columns );
|
|
|
|
treeview_filesystems .set_model( liststore_filesystems );
|
2004-12-15 09:38:37 -07:00
|
|
|
treeview_filesystems .append_column( _("Filesystem"), treeview_filesystems_columns .filesystem );
|
2006-04-02 08:04:44 -06:00
|
|
|
treeview_filesystems .append_column( _("Detect"), treeview_filesystems_columns .detect );
|
|
|
|
treeview_filesystems .append_column( _("Read"), treeview_filesystems_columns .read );
|
2004-12-15 09:38:37 -07:00
|
|
|
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 );
|
|
|
|
treeview_filesystems .append_column( _("Move"), treeview_filesystems_columns .move );
|
|
|
|
treeview_filesystems .append_column( _("Copy"), treeview_filesystems_columns .copy );
|
2006-04-03 12:48:53 -06:00
|
|
|
treeview_filesystems .append_column( _("Check"), treeview_filesystems_columns .check );
|
2008-04-07 13:41:18 -06:00
|
|
|
treeview_filesystems .append_column( _("Label"), treeview_filesystems_columns .label );
|
2006-05-31 14:03:49 -06:00
|
|
|
//FIXME: add info about the relevant project (e.g an url to the projectpage)
|
|
|
|
//of course this url has to be selectable and (if possible) clickable
|
2006-03-24 12:08:41 -07:00
|
|
|
treeview_filesystems .get_selection() ->set_mode( Gtk::SELECTION_NONE );
|
2006-05-31 14:03:49 -06:00
|
|
|
treeview_filesystems .set_rules_hint( true ) ;
|
2006-09-16 06:44:36 -06:00
|
|
|
|
|
|
|
hbox = manage( new Gtk::HBox() ) ;
|
|
|
|
hbox ->set_border_width( 6 ) ;
|
|
|
|
hbox ->pack_start( treeview_filesystems ) ;
|
|
|
|
get_vbox() ->pack_start( *hbox ) ;
|
2006-08-27 13:29:24 -06:00
|
|
|
|
|
|
|
//legend..
|
2006-09-16 06:44:36 -06:00
|
|
|
hbox = manage( new Gtk::HBox() ) ;
|
2006-08-27 13:29:24 -06:00
|
|
|
image = manage( new Gtk::Image( Gtk::Stock::APPLY, Gtk::ICON_SIZE_LARGE_TOOLBAR ) );
|
|
|
|
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ;
|
|
|
|
hbox ->pack_start( * Utils::mk_label( _("Available") ), Gtk::PACK_EXPAND_WIDGET ) ;
|
|
|
|
get_vbox() ->pack_start( *hbox ) ;
|
|
|
|
|
2006-09-16 06:44:36 -06:00
|
|
|
hbox = manage( new Gtk::HBox() ) ;
|
2006-08-27 13:29:24 -06:00
|
|
|
image = manage( new Gtk::Image( Gtk::Stock::CANCEL, Gtk::ICON_SIZE_LARGE_TOOLBAR ) );
|
|
|
|
hbox ->pack_start( *image, Gtk::PACK_SHRINK ) ;
|
|
|
|
hbox ->pack_start( * Utils::mk_label( _("Not Available") ), Gtk::PACK_EXPAND_WIDGET ) ;
|
|
|
|
get_vbox() ->pack_start( *hbox ) ;
|
2006-04-02 08:04:44 -06:00
|
|
|
|
|
|
|
//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 ) ;
|
2004-12-15 09:38:37 -07:00
|
|
|
|
2006-04-03 12:48:53 -06:00
|
|
|
add_button( Gtk::Stock::REFRESH, Gtk::RESPONSE_OK ) ;
|
2006-04-02 08:04:44 -06:00
|
|
|
add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE ) ->grab_focus() ;
|
|
|
|
show_all_children() ;
|
2004-12-15 09:38:37 -07:00
|
|
|
}
|
|
|
|
|
2006-04-05 03:33:04 -06:00
|
|
|
void DialogFeatures::load_filesystems( const std::vector<FS> & FILESYSTEMS )
|
2004-12-15 09:38:37 -07:00
|
|
|
{
|
2006-03-24 12:08:41 -07:00
|
|
|
liststore_filesystems ->clear() ;
|
2004-12-15 09:38:37 -07:00
|
|
|
|
2006-03-24 12:08:41 -07:00
|
|
|
for ( unsigned short t = 0; t < FILESYSTEMS .size() -1 ; t++ )
|
2006-04-05 03:33:04 -06:00
|
|
|
show_filesystem( FILESYSTEMS[ t ] ) ;
|
2004-12-15 09:38:37 -07:00
|
|
|
}
|
|
|
|
|
2006-04-05 03:33:04 -06:00
|
|
|
void DialogFeatures::show_filesystem( const FS & fs )
|
2004-12-15 09:38:37 -07:00
|
|
|
{
|
2006-03-24 12:08:41 -07:00
|
|
|
treerow = *( liststore_filesystems ->append() );
|
2006-03-28 05:40:29 -07:00
|
|
|
treerow[ treeview_filesystems_columns .filesystem ] = Utils::get_filesystem_string( fs .filesystem ) ;
|
2005-11-26 17:57:11 -07:00
|
|
|
|
2006-04-02 08:04:44 -06:00
|
|
|
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 ;
|
2006-04-03 12:48:53 -06:00
|
|
|
treerow[ treeview_filesystems_columns .check ] = fs .check ? icon_yes : icon_no ;
|
2008-04-07 13:41:18 -06:00
|
|
|
treerow[ treeview_filesystems_columns .label ] = fs .set_label ? icon_yes : icon_no ;
|
2004-12-15 09:38:37 -07:00
|
|
|
}
|
|
|
|
|
2006-04-05 03:33:04 -06:00
|
|
|
DialogFeatures::~DialogFeatures()
|
2004-12-15 09:38:37 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
} //GParted
|
|
|
|
|
|
|
|
|