Use Gtk::Grid for Win_GParted pt2 (!25)
Gtk::Table was deprecated in Gtk 3.4.0. Replace with Gtk::Grid. This commit makes the change for Win_GParted / pt2. Closes !25 - Modern Gtk3 - part 1
This commit is contained in:
parent
6e07fb051b
commit
d57d79b1c4
|
@ -35,7 +35,7 @@
|
||||||
#include <gtkmm/combobox.h>
|
#include <gtkmm/combobox.h>
|
||||||
#include <gtkmm/progressbar.h>
|
#include <gtkmm/progressbar.h>
|
||||||
#include <gtkmm/window.h>
|
#include <gtkmm/window.h>
|
||||||
#include <gtkmm/table.h>
|
|
||||||
|
|
||||||
namespace GParted
|
namespace GParted
|
||||||
{
|
{
|
||||||
|
@ -230,7 +230,6 @@ private:
|
||||||
Gtk::Statusbar statusbar;
|
Gtk::Statusbar statusbar;
|
||||||
Gtk::Image *image ;
|
Gtk::Image *image ;
|
||||||
Gtk::ScrolledWindow *scrollwindow;
|
Gtk::ScrolledWindow *scrollwindow;
|
||||||
Gtk::Table *table ;
|
|
||||||
Gtk::ProgressBar pulsebar ;
|
Gtk::ProgressBar pulsebar ;
|
||||||
Gtk::TreeRow treerow;
|
Gtk::TreeRow treerow;
|
||||||
|
|
||||||
|
|
|
@ -567,106 +567,88 @@ void Win_GParted::init_device_info()
|
||||||
{
|
{
|
||||||
vbox_info.set_orientation(Gtk::ORIENTATION_VERTICAL);
|
vbox_info.set_orientation(Gtk::ORIENTATION_VERTICAL);
|
||||||
vbox_info.set_spacing( 5 );
|
vbox_info.set_spacing( 5 );
|
||||||
int top = 0, bottom = 1;
|
int top = 0;
|
||||||
|
|
||||||
//title
|
//title
|
||||||
vbox_info .pack_start(
|
vbox_info .pack_start(
|
||||||
* Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Device Information") ) + "</b>" ),
|
* Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Device Information") ) + "</b>" ),
|
||||||
Gtk::PACK_SHRINK );
|
Gtk::PACK_SHRINK );
|
||||||
|
|
||||||
//GENERAL DEVICE INFO
|
//GENERAL DEVICE INFO
|
||||||
table = manage( new Gtk::Table() ) ;
|
Gtk::Grid *grid = manage(new Gtk::Grid());
|
||||||
table ->set_col_spacings( 10 ) ;
|
grid->set_column_spacing(10);
|
||||||
|
|
||||||
//model
|
// Model
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Model:") ) + "</b>" ),
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Model:")) + "</b>"),
|
||||||
0, 1,
|
0, top, 1, 1);
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL ) ;
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
// Serial number
|
// Serial number
|
||||||
table->attach( *Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Serial:") ) + "</b>" ),
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Serial:")) + "</b>"),
|
||||||
0, 1, top, bottom, Gtk::FILL );
|
0, top, 1, 1);
|
||||||
device_info.push_back( Utils::mk_label( "", true, false, true ) );
|
device_info.push_back( Utils::mk_label( "", true, false, true ) );
|
||||||
table->attach( *device_info.back(), 1, 2, top++, bottom++, Gtk::FILL );
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
//size
|
// Size
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Size:") ) + "</b>" ),
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Size:")) + "</b>"),
|
||||||
0, 1,
|
0, top, 1, 1);
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL ) ;
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
//path
|
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Path:") ) + "</b>" ),
|
|
||||||
0, 1,
|
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL ) ;
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
|
||||||
|
|
||||||
vbox_info .pack_start( *table, Gtk::PACK_SHRINK );
|
|
||||||
|
|
||||||
//DETAILED DEVICE INFO
|
|
||||||
top = 0 ; bottom = 1;
|
|
||||||
table = manage( new Gtk::Table() ) ;
|
|
||||||
table ->set_col_spacings( 10 ) ;
|
|
||||||
|
|
||||||
//one blank line
|
|
||||||
table ->attach( * Utils::mk_label( "" ), 1, 2, top++, bottom++, Gtk::FILL );
|
|
||||||
|
|
||||||
//disktype
|
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Partition table:") ) + "</b>" ),
|
|
||||||
0, 1,
|
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL );
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
|
||||||
|
|
||||||
//heads
|
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Heads:") ) + "</b>" ),
|
|
||||||
0, 1,
|
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL ) ;
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
|
||||||
|
|
||||||
//sectors/track
|
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Sectors/track:") ) + "</b>" ),
|
|
||||||
0, 1,
|
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL ) ;
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL );
|
|
||||||
|
|
||||||
//cylinders
|
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Cylinders:") ) + "</b>" ),
|
|
||||||
0, 1,
|
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL ) ;
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
|
||||||
|
|
||||||
//total sectors
|
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Total sectors:") ) + "</b>" ),
|
|
||||||
0, 1,
|
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL );
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
|
||||||
|
|
||||||
//sector size
|
// Path
|
||||||
table ->attach( * Utils::mk_label( " <b>" + static_cast<Glib::ustring>( _("Sector size:") ) + "</b>" ),
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Path:")) + "</b>"),
|
||||||
0, 1,
|
0, top, 1, 1);
|
||||||
top, bottom,
|
|
||||||
Gtk::FILL );
|
|
||||||
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
table ->attach( * device_info .back(), 1, 2, top++, bottom++, Gtk::FILL ) ;
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
vbox_info .pack_start( *table, Gtk::PACK_SHRINK );
|
vbox_info.pack_start(*grid, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
|
//DETAILED DEVICE INFO
|
||||||
|
top = 0;
|
||||||
|
grid = manage(new Gtk::Grid());
|
||||||
|
grid->set_column_spacing(10);
|
||||||
|
|
||||||
|
// One blank line
|
||||||
|
grid->attach(*Utils::mk_label(""), 1, top++, 1, 1);
|
||||||
|
|
||||||
|
// Disktype
|
||||||
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Partition table:")) + "</b>"),
|
||||||
|
0, top, 1, 1);
|
||||||
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
|
// Heads
|
||||||
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Heads:")) + "</b>"),
|
||||||
|
0, top, 1, 1);
|
||||||
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
|
// Sectors / track
|
||||||
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Sectors/track:")) + "</b>"),
|
||||||
|
0, top, 1, 1);
|
||||||
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
|
// Cylinders
|
||||||
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Cylinders:")) + "</b>"),
|
||||||
|
0, top, 1, 1);
|
||||||
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
|
// Total sectors
|
||||||
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Total sectors:")) + "</b>"),
|
||||||
|
0, top, 1, 1);
|
||||||
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
|
// Sector size
|
||||||
|
grid->attach(*Utils::mk_label(" <b>" + static_cast<Glib::ustring>(_("Sector size:")) + "</b>"),
|
||||||
|
0, top, 1, 1);
|
||||||
|
device_info .push_back( Utils::mk_label( "", true, false, true ) ) ;
|
||||||
|
grid->attach(*device_info.back(), 1, top++, 1, 1);
|
||||||
|
|
||||||
|
vbox_info.pack_start(*grid, Gtk::PACK_SHRINK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Win_GParted::init_hpaned_main()
|
void Win_GParted::init_hpaned_main()
|
||||||
|
|
Loading…
Reference in New Issue