Added dialog (accessable from 'gparted' menu) which shows supported
* Added dialog (accessable from 'gparted' menu) which shows supported operations for the various filesystems. I plan to put some more info in it, like what is missing etc..
This commit is contained in:
parent
2860691ebf
commit
188b27bc50
|
@ -1,3 +1,8 @@
|
||||||
|
2004-12-15 Bart Hakvoort <gparted@users.sf.net>
|
||||||
|
|
||||||
|
* Added dialog (accessable from 'gparted' menu) which shows supported operations for the various filesystems.
|
||||||
|
I plan to put some more info in it, like what is missing etc..
|
||||||
|
|
||||||
2004-12-15 Bart Hakvoort <gparted@users.sf.net>
|
2004-12-15 Bart Hakvoort <gparted@users.sf.net>
|
||||||
|
|
||||||
* src/Dialog_Partition_Copy: fixed small error with incorrect display of used space and did some cleanups.
|
* src/Dialog_Partition_Copy: fixed small error with incorrect display of used space and did some cleanups.
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
/* Copyright (C) 2004 Bart
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DIALOG_FILESYSTEMS
|
||||||
|
#define DIALOG_FILESYSTEMS
|
||||||
|
|
||||||
|
#include "include/Utils.h"
|
||||||
|
#include "../include/i18n.h"
|
||||||
|
|
||||||
|
#include <gtkmm/dialog.h>
|
||||||
|
#include <gtkmm/stock.h>
|
||||||
|
#include <gtkmm/treeview.h>
|
||||||
|
#include <gtkmm/treestore.h>
|
||||||
|
|
||||||
|
namespace GParted
|
||||||
|
{
|
||||||
|
|
||||||
|
class Dialog_Filesystems : public Gtk::Dialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
Dialog_Filesystems( ) ;
|
||||||
|
void Load_Filesystems( const std::vector< FS > & FILESYSTEMS ) ;
|
||||||
|
~Dialog_Filesystems( ) ;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Show_Filesystem( const FS & fs ) ;
|
||||||
|
|
||||||
|
Gtk::TreeView treeview_filesystems;
|
||||||
|
Gtk::TreeRow treerow;
|
||||||
|
Glib::RefPtr<Gtk::TreeStore> treestore_filesystems;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
treeview_filesystems_Columns( ) { add( filesystem ); add( create ); add( grow ); add( shrink ); add( move ); add( copy ); }
|
||||||
|
};
|
||||||
|
|
||||||
|
treeview_filesystems_Columns treeview_filesystems_columns ;
|
||||||
|
};
|
||||||
|
|
||||||
|
} //GParted
|
||||||
|
|
||||||
|
#endif //DIALOG_FILESYSTEMS
|
|
@ -31,6 +31,7 @@
|
||||||
#include "../include/Dialog_Partition_Copy.h"
|
#include "../include/Dialog_Partition_Copy.h"
|
||||||
#include "../include/GParted_Core.h"
|
#include "../include/GParted_Core.h"
|
||||||
#include "../include/Dialog_Disklabel.h"
|
#include "../include/Dialog_Disklabel.h"
|
||||||
|
#include "../include/Dialog_Filesystems.h"
|
||||||
|
|
||||||
#include <sigc++/class_slot.h>
|
#include <sigc++/class_slot.h>
|
||||||
#include <gtkmm/main.h>
|
#include <gtkmm/main.h>
|
||||||
|
@ -100,6 +101,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
void menu_gparted_refresh_devices();
|
void menu_gparted_refresh_devices();
|
||||||
|
void menu_gparted_filesystems();
|
||||||
void menu_gparted_quit();
|
void menu_gparted_quit();
|
||||||
void menu_view_harddisk_info();
|
void menu_view_harddisk_info();
|
||||||
void menu_view_operations();
|
void menu_view_operations();
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
/* Copyright (C) 2004 Bart
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../include/Dialog_Filesystems.h"
|
||||||
|
|
||||||
|
namespace GParted
|
||||||
|
{
|
||||||
|
|
||||||
|
Dialog_Filesystems::Dialog_Filesystems( )
|
||||||
|
{
|
||||||
|
this ->set_title( _("Filesystems") ) ;
|
||||||
|
this ->set_has_separator( false ) ;
|
||||||
|
this ->set_resizable( false ) ;
|
||||||
|
|
||||||
|
treestore_filesystems = Gtk::TreeStore::create( treeview_filesystems_columns );
|
||||||
|
treeview_filesystems .set_model( treestore_filesystems );
|
||||||
|
treeview_filesystems .append_column( _("Filesystem"), treeview_filesystems_columns .filesystem );
|
||||||
|
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 );
|
||||||
|
|
||||||
|
this ->get_vbox( ) ->pack_start( treeview_filesystems ) ;
|
||||||
|
|
||||||
|
this ->add_button( Gtk::Stock::REFRESH, Gtk::RESPONSE_OK );
|
||||||
|
this ->add_button( Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE );
|
||||||
|
this ->show_all_children( ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Dialog_Filesystems::Load_Filesystems( const std::vector< FS > & FILESYSTEMS )
|
||||||
|
{
|
||||||
|
treestore_filesystems ->clear( ) ;
|
||||||
|
|
||||||
|
for ( unsigned short t = 0; t < FILESYSTEMS .size( ) -1 ; t++ )
|
||||||
|
Show_Filesystem( FILESYSTEMS[ t ] ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Dialog_Filesystems::Show_Filesystem( const FS & fs )
|
||||||
|
{
|
||||||
|
treerow = *( treestore_filesystems ->append( ) );
|
||||||
|
treerow[ treeview_filesystems_columns .filesystem ] = fs .filesystem ;
|
||||||
|
treerow[ treeview_filesystems_columns .create ] = render_icon( fs .create ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU );
|
||||||
|
treerow[ treeview_filesystems_columns .grow ] = render_icon( fs .grow ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU );
|
||||||
|
treerow[ treeview_filesystems_columns .shrink ] = render_icon( fs .shrink ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU );
|
||||||
|
treerow[ treeview_filesystems_columns .move ] = render_icon( fs .move ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU );
|
||||||
|
treerow[ treeview_filesystems_columns .copy ] = render_icon( fs .copy ? Gtk::Stock::APPLY : Gtk::Stock::CANCEL, Gtk::ICON_SIZE_MENU );
|
||||||
|
}
|
||||||
|
|
||||||
|
Dialog_Filesystems::~Dialog_Filesystems( )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
} //GParted
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ gparted_SOURCES = \
|
||||||
Dialog_About.cc\
|
Dialog_About.cc\
|
||||||
Dialog_Base_Partition.cc\
|
Dialog_Base_Partition.cc\
|
||||||
Dialog_Disklabel.cc \
|
Dialog_Disklabel.cc \
|
||||||
|
Dialog_Filesystems.cc \
|
||||||
Dialog_Partition_Copy.cc\
|
Dialog_Partition_Copy.cc\
|
||||||
Dialog_Partition_Info.cc\
|
Dialog_Partition_Info.cc\
|
||||||
Dialog_Partition_New.cc\
|
Dialog_Partition_New.cc\
|
||||||
|
|
|
@ -93,12 +93,14 @@ void Win_GParted::init_menubar()
|
||||||
{
|
{
|
||||||
//fill menubar_main and connect callbacks
|
//fill menubar_main and connect callbacks
|
||||||
//gparted
|
//gparted
|
||||||
menu = manage( new Gtk::Menu() ) ;
|
menu = manage( new Gtk::Menu( ) ) ;
|
||||||
image = manage( new Gtk::Image( Gtk::Stock::REFRESH, Gtk::ICON_SIZE_MENU ) );
|
image = manage( new Gtk::Image( Gtk::Stock::REFRESH, Gtk::ICON_SIZE_MENU ) );
|
||||||
menu ->items() .push_back(Gtk::Menu_Helpers::ImageMenuElem( _("_Refresh devices"), Gtk::AccelKey("<control>r"), *image , sigc::mem_fun(*this, &Win_GParted::menu_gparted_refresh_devices) ) );
|
menu ->items( ) .push_back( Gtk::Menu_Helpers::ImageMenuElem( _("_Refresh devices"), Gtk::AccelKey("<control>r"), *image , sigc::mem_fun(*this, &Win_GParted::menu_gparted_refresh_devices) ) );
|
||||||
menu ->items() .push_back( Gtk::Menu_Helpers::SeparatorElem() );
|
menu ->items( ) .push_back( Gtk::Menu_Helpers::SeparatorElem( ) );
|
||||||
menu ->items() .push_back(Gtk::Menu_Helpers::StockMenuElem( Gtk::Stock::QUIT, sigc::mem_fun(*this, &Win_GParted::menu_gparted_quit) ) );
|
menu ->items( ) .push_back( Gtk::Menu_Helpers::MenuElem( _("Filesystems"), sigc::mem_fun( *this, &Win_GParted::menu_gparted_filesystems ) ) );
|
||||||
menubar_main.items().push_back( Gtk::Menu_Helpers::MenuElem( _("_GParted"), *menu ) );
|
menu ->items( ) .push_back( Gtk::Menu_Helpers::SeparatorElem( ) );
|
||||||
|
menu ->items( ) .push_back( Gtk::Menu_Helpers::StockMenuElem( Gtk::Stock::QUIT, sigc::mem_fun(*this, &Win_GParted::menu_gparted_quit) ) );
|
||||||
|
menubar_main .items( ) .push_back( Gtk::Menu_Helpers::MenuElem( _("_GParted"), *menu ) );
|
||||||
|
|
||||||
//view
|
//view
|
||||||
menu = manage( new Gtk::Menu() ) ;
|
menu = manage( new Gtk::Menu() ) ;
|
||||||
|
@ -733,6 +735,19 @@ void Win_GParted::menu_gparted_refresh_devices()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Win_GParted::menu_gparted_filesystems( )
|
||||||
|
{
|
||||||
|
Dialog_Filesystems dialog ;
|
||||||
|
dialog .set_transient_for( *this ) ;
|
||||||
|
|
||||||
|
dialog .Load_Filesystems( gparted_core .get_fs( ) ) ;
|
||||||
|
while ( dialog .run( ) == Gtk::RESPONSE_OK )
|
||||||
|
{
|
||||||
|
gparted_core .find_supported_filesystems( ) ;
|
||||||
|
dialog .Load_Filesystems( gparted_core .get_fs( ) ) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Win_GParted::menu_gparted_quit()
|
void Win_GParted::menu_gparted_quit()
|
||||||
{
|
{
|
||||||
if ( Quit_Check_Operations( ) )
|
if ( Quit_Check_Operations( ) )
|
||||||
|
|
Loading…
Reference in New Issue