fixed a11y thingy (#316108) get labeltypes from libparted instead of
* src/Dialog_Filesystems.cc: fixed a11y thingy (#316108) * include/GParted_Core.h, src/GParted_Core.cc, include/Dialog_Disklabel.h, src/Dialog_Disklabel.cc, src/Win_GParted.cc : get labeltypes from libparted instead of hardcoding them, also changed some text (#315979)
This commit is contained in:
parent
61cd0ce778
commit
2b47fea3de
|
@ -1,3 +1,12 @@
|
||||||
|
2005-09-13 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
|
* src/Dialog_Filesystems.cc: fixed a11y thingy (#316108)
|
||||||
|
* include/GParted_Core.h,
|
||||||
|
src/GParted_Core.cc,
|
||||||
|
include/Dialog_Disklabel.h,
|
||||||
|
src/Dialog_Disklabel.cc,
|
||||||
|
src/Win_GParted.cc : get labeltypes from libparted instead of hardcoding them,
|
||||||
|
also changed some text (#315979)
|
||||||
|
|
||||||
2005-09-13 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
2005-09-13 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
* lots of stuff and cleanups, including fixing getting used/unused space of hfs/hfs+/fat16/fat32
|
* lots of stuff and cleanups, including fixing getting used/unused space of hfs/hfs+/fat16/fat32
|
||||||
* also fixes bug #161362
|
* also fixes bug #161362
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace GParted
|
||||||
class Dialog_Disklabel : public Gtk::Dialog
|
class Dialog_Disklabel : public Gtk::Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Dialog_Disklabel( const Glib::ustring & device_path ) ;
|
Dialog_Disklabel( const Glib::ustring & device_path, const std::vector <Glib::ustring> & disklabeltypes ) ;
|
||||||
|
|
||||||
Glib::ustring Get_Disklabel( ) ;
|
Glib::ustring Get_Disklabel( ) ;
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
const std::vector<FS> & get_filesystems( ) const ;
|
const std::vector<FS> & get_filesystems( ) const ;
|
||||||
const FS & get_fs( const Glib::ustring & filesystem ) const ;
|
const FS & get_fs( const Glib::ustring & filesystem ) const ;
|
||||||
Glib::RefPtr<Gtk::TextBuffer> get_textbuffer( ) ;
|
Glib::RefPtr<Gtk::TextBuffer> get_textbuffer( ) ;
|
||||||
|
std::vector<Glib::ustring> get_disklabeltypes( ) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Glib::ustring Get_Filesystem( ) ; //temporary function.. asa new checks ripple through in libparted i'll remove it.
|
Glib::ustring Get_Filesystem( ) ; //temporary function.. asa new checks ripple through in libparted i'll remove it.
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
namespace GParted
|
namespace GParted
|
||||||
{
|
{
|
||||||
|
|
||||||
Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path )
|
Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path, const std::vector <Glib::ustring> & disklabeltypes )
|
||||||
{
|
{
|
||||||
this ->set_title( String::ucompose( _("Set Disklabel on %1"), device_path ) );
|
this ->set_title( String::ucompose( _("Set Disklabel on %1"), device_path ) );
|
||||||
this ->set_has_separator( false ) ;
|
this ->set_has_separator( false ) ;
|
||||||
|
@ -45,7 +45,7 @@ Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path )
|
||||||
str_temp += "</span>\n" ;
|
str_temp += "</span>\n" ;
|
||||||
vbox ->pack_start( * mk_label( str_temp ), Gtk::PACK_SHRINK );
|
vbox ->pack_start( * mk_label( str_temp ), Gtk::PACK_SHRINK );
|
||||||
|
|
||||||
str_temp = _("A disklabel is a file at the beginning of the disk that indicates where each partition begins and how many sectors it occupies.") ;
|
str_temp = _("A disklabel is a piece of data stored at a well known place on the disk, that indicates where each partition begins and how many sectors it occupies.") ;
|
||||||
str_temp += "\n" ;
|
str_temp += "\n" ;
|
||||||
str_temp += _("You need a disklabel if you want to create partitions on this disk.") ;
|
str_temp += _("You need a disklabel if you want to create partitions on this disk.") ;
|
||||||
str_temp += "\n\n" ;
|
str_temp += "\n\n" ;
|
||||||
|
@ -69,14 +69,8 @@ Dialog_Disklabel::Dialog_Disklabel( const Glib::ustring & device_path )
|
||||||
expander_advanced .add( *hbox ) ;
|
expander_advanced .add( *hbox ) ;
|
||||||
|
|
||||||
//create and add optionmenu
|
//create and add optionmenu
|
||||||
labeltypes .push_back( "msdos" ) ;
|
this ->labeltypes = disklabeltypes ;
|
||||||
labeltypes .push_back( "bsd" ) ;
|
|
||||||
labeltypes .push_back( "loop" ) ;
|
|
||||||
labeltypes .push_back( "gpt" ) ;
|
|
||||||
labeltypes .push_back( "mac" ) ;
|
|
||||||
labeltypes .push_back( "pc98" ) ;
|
|
||||||
labeltypes .push_back( "sun" ) ;
|
|
||||||
|
|
||||||
for ( unsigned int t = 0 ; t < labeltypes .size( ) ; t++ )
|
for ( unsigned int t = 0 ; t < labeltypes .size( ) ; t++ )
|
||||||
menu_labeltypes .items( ) .push_back( Gtk::Menu_Helpers::MenuElem( labeltypes[ t ] + "\t" ) ) ;
|
menu_labeltypes .items( ) .push_back( Gtk::Menu_Helpers::MenuElem( labeltypes[ t ] + "\t" ) ) ;
|
||||||
|
|
||||||
|
|
|
@ -55,11 +55,11 @@ void Dialog_Filesystems::Show_Filesystem( const FS & fs )
|
||||||
{
|
{
|
||||||
treerow = *( liststore_filesystems ->append( ) );
|
treerow = *( liststore_filesystems ->append( ) );
|
||||||
treerow[ treeview_filesystems_columns .filesystem ] = fs .filesystem ;
|
treerow[ treeview_filesystems_columns .filesystem ] = fs .filesystem ;
|
||||||
treerow[ treeview_filesystems_columns .create ] = render_icon( fs .create ? Gtk::Stock::YES : Gtk::Stock::NO, Gtk::ICON_SIZE_MENU );
|
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::YES : Gtk::Stock::NO, 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::YES : Gtk::Stock::NO, 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::YES : Gtk::Stock::NO, 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::YES : Gtk::Stock::NO, 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( )
|
Dialog_Filesystems::~Dialog_Filesystems( )
|
||||||
|
|
|
@ -508,6 +508,21 @@ Glib::RefPtr<Gtk::TextBuffer> GParted_Core::get_textbuffer( )
|
||||||
return textbuffer ;
|
return textbuffer ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Glib::ustring> GParted_Core::get_disklabeltypes( )
|
||||||
|
{
|
||||||
|
std::vector<Glib::ustring> disklabeltypes ;
|
||||||
|
|
||||||
|
//msdos should be first in the list
|
||||||
|
disklabeltypes .push_back( "msdos" ) ;
|
||||||
|
|
||||||
|
PedDiskType *disk_type ;
|
||||||
|
for ( disk_type = ped_disk_type_get_next( NULL ) ; disk_type ; disk_type = ped_disk_type_get_next( disk_type ) )
|
||||||
|
if ( static_cast<Glib::ustring>( disk_type->name ) != "msdos" )
|
||||||
|
disklabeltypes .push_back( disk_type->name ) ;
|
||||||
|
|
||||||
|
return disklabeltypes ;
|
||||||
|
}
|
||||||
|
|
||||||
Glib::ustring GParted_Core::get_sym_path( const Glib::ustring & real_path )
|
Glib::ustring GParted_Core::get_sym_path( const Glib::ustring & real_path )
|
||||||
{
|
{
|
||||||
int major, minor, size;
|
int major, minor, size;
|
||||||
|
|
|
@ -249,7 +249,7 @@ void Win_GParted::init_device_info()
|
||||||
table ->attach( * mk_label( "" ), 1, 2, top++, bottom++, Gtk::FILL );
|
table ->attach( * mk_label( "" ), 1, 2, top++, bottom++, Gtk::FILL );
|
||||||
|
|
||||||
//disktype
|
//disktype
|
||||||
table ->attach( * mk_label( " <b>" + (Glib::ustring) _( "DiskType:" ) + "</b>" ), 0, 1, top, bottom, Gtk::FILL );
|
table ->attach( * mk_label( " <b>" + (Glib::ustring) _( "DiskLabelType:" ) + "</b>" ), 0, 1, top, bottom, Gtk::FILL );
|
||||||
device_info .push_back( mk_label( "" ) ) ;
|
device_info .push_back( mk_label( "" ) ) ;
|
||||||
table ->attach( * device_info .back( ), 1, 2, top++, bottom++, Gtk::FILL );
|
table ->attach( * device_info .back( ), 1, 2, top++, bottom++, Gtk::FILL );
|
||||||
|
|
||||||
|
@ -1162,7 +1162,7 @@ void Win_GParted::activate_unmount( )
|
||||||
|
|
||||||
void Win_GParted::activate_disklabel( )
|
void Win_GParted::activate_disklabel( )
|
||||||
{
|
{
|
||||||
Dialog_Disklabel dialog( devices[ current_device ] .path ) ;
|
Dialog_Disklabel dialog( devices[ current_device ] .path, gparted_core .get_disklabeltypes( ) ) ;
|
||||||
dialog .set_transient_for( *this );
|
dialog .set_transient_for( *this );
|
||||||
|
|
||||||
if ( dialog .run( ) == Gtk::RESPONSE_OK )
|
if ( dialog .run( ) == Gtk::RESPONSE_OK )
|
||||||
|
|
Loading…
Reference in New Issue