From 504f6c89db28716c7038153fb7838565b4ba0583 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 1 Aug 2012 17:16:09 +0200 Subject: use (my|u)gtk3 instead of *tk2 --- perl-install/standalone/drakfloppy | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'perl-install/standalone/drakfloppy') diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index c7a21b1ed..11597c6aa 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -29,23 +29,23 @@ use lib qw(/usr/lib/libDrakX); use standalone; #- warning, standalone must be loaded very first, for 'explanations' use common; -use mygtk2 qw(gtknew); -use ugtk2 qw(:create :dialogs :helpers :wrappers); +use mygtk3 qw(gtknew); +use ugtk3 qw(:create :dialogs :helpers :wrappers); use detect_devices; -$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakfloppy-mdk.png"; +$ugtk3::wm_icon = "/usr/share/mcc/themes/default/drakfloppy-mdk.png"; require_root_capability(); -my $window = ugtk2->new(N("Boot Floppy")); +my $window = ugtk3->new(N("Boot Floppy")); unless ($::isEmbedded) { - $window->{rwindow}->signal_connect(delete_event => sub { ugtk2->exit(0) }); + $window->{rwindow}->signal_connect(delete_event => sub { ugtk3->exit(0) }); $window->{rwindow}->set_border_width(5); ### menus definition # the menus are not shown but they provides shiny shortcut like C-q create_factory_menu($window->{rwindow}, ( { path => N("/_File"), item_type => '' }, - { path => N("/File/_Quit"), accelerator => N("Q"), callback => sub { ugtk2->exit(0) } }, + { path => N("/File/_Quit"), accelerator => N("Q"), callback => sub { ugtk3->exit(0) } }, ) ); } @@ -96,7 +96,7 @@ $window->{window}->add( ), 1, gtknew('VBox'), 0, create_okcancel({ - cancel_clicked => sub { ugtk2->exit(0) }, + cancel_clicked => sub { ugtk3->exit(0) }, ok_clicked => \&build_it, }, undef, undef, '', @@ -108,7 +108,7 @@ $window->{window}->add( $window->{rwindow}->show_all; $window->main; -ugtk2->exit(0); +ugtk3->exit(0); my $remove_but; @@ -301,7 +301,7 @@ sub build_it() { my $log = join('', <$STATUS>); if (close $STATUS) { info_dialog(N("Floppy creation completed"), N("The creation of the boot floppy has been successfully completed \n")); - ugtk2->exit; + ugtk3->exit; } else { err_dialog(N("Error"), #-PO: Do not alter the and tags -- cgit v1.2.1 From b9e700aea8f8dfae031d9ff923f00393b052fd3d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 1 Aug 2012 17:16:30 +0200 Subject: use Gtk3 namespace instead of Gtk2 --- perl-install/standalone/drakfloppy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'perl-install/standalone/drakfloppy') diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index 11597c6aa..74a9105ea 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -119,18 +119,18 @@ sub pref_dialog() { # Create root tree: - $tree_model = Gtk2::TreeStore->new(("Glib::String") x 2, "Glib::Int"); - $tree = Gtk2::TreeView->new_with_model($tree_model); + $tree_model = Gtk3::TreeStore->new(("Glib::String") x 2, "Glib::Int"); + $tree = Gtk3::TreeView->new_with_model($tree_model); $tree->set_headers_visible(0); - $tree->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0)); + $tree->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0)); $tree->signal_connect('row-expanded', \&expand_tree); $tree->get_selection->signal_connect('changed' => \&selected_tree); # Create modules list: - $list_model = Gtk2::ListStore->new(("Glib::String") x 3); # relative path, size, (hidden full path) - $list = Gtk2::TreeView->new_with_model($list_model); + $list_model = Gtk3::ListStore->new(("Glib::String") x 3); # relative path, size, (hidden full path) + $list = Gtk3::TreeView->new_with_model($list_model); each_index { - $list->append_column(my $col = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i)); + $list->append_column(my $col = Gtk3::TreeViewColumn->new_with_attributes($_, Gtk3::CellRendererText->new, 'text' => $::i)); $col->set_sort_column_id($::i); $col->set_min_width((200, 50)[$::i]); } (N("Module name"), N("Size")); @@ -150,7 +150,7 @@ sub pref_dialog() { gtknew('ScrolledWindow', child => $tree), 200, $::isEmbedded ? 0 : 175), gtknew('VBox', children => [ - 1, gtkadd(Gtk2::ScrolledWindow->new, + 1, gtkadd(Gtk3::ScrolledWindow->new, $list ), 0, $remove_but = gtknew('Button', text => N("Remove a module"), -- cgit v1.2.1 From a45c4e4ca33cc642f3dfac9d9b6652a0cb40485f Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 8 Nov 2013 03:29:08 +0100 Subject: those setters no more accept undef --- perl-install/standalone/drakfloppy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl-install/standalone/drakfloppy') diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index 74a9105ea..ec0542f14 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -122,7 +122,7 @@ sub pref_dialog() { $tree_model = Gtk3::TreeStore->new(("Glib::String") x 2, "Glib::Int"); $tree = Gtk3::TreeView->new_with_model($tree_model); $tree->set_headers_visible(0); - $tree->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0)); + $tree->append_column(Gtk3::TreeViewColumn->new_with_attributes("", Gtk3::CellRendererText->new, 'text' => 0)); $tree->signal_connect('row-expanded', \&expand_tree); $tree->get_selection->signal_connect('changed' => \&selected_tree); -- cgit v1.2.1 From a7f8805575a700e5ca8dfc962e8049eff33b71b4 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 8 Nov 2013 03:42:45 +0100 Subject: perlish $dialog->vbox => $dialog->get_child --- perl-install/standalone/drakfloppy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl-install/standalone/drakfloppy') diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index ec0542f14..7c4bdd94b 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -135,7 +135,7 @@ sub pref_dialog() { $col->set_min_width((200, 50)[$::i]); } (N("Module name"), N("Size")); - gtkpack_($dialog->vbox, + gtkpack_($dialog->get_child, 0, gtknew('Frame', text => N("Mkinitrd optional arguments"), child => gtknew('VBox', spacing => 5, children_tight => [ $buttons{force} = gtknew('CheckButton', text => N("force")), -- cgit v1.2.1 From 395e1a77a683369614b6fa1ab37f9d33a6cc790b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 8 Nov 2013 03:47:53 +0100 Subject: perlish $dialog->action_area => $dialog->get_action_area --- perl-install/standalone/drakfloppy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl-install/standalone/drakfloppy') diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index 7c4bdd94b..9154d40a3 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -180,7 +180,7 @@ sub pref_dialog() { $remove_but->set_sensitive(scalar @modules); @temp_modules = (); - gtkadd($dialog->action_area, + gtkadd($dialog->get_action_area, create_okcancel({ cancel_clicked => sub { $dialog->destroy }, ok_clicked => sub { -- cgit v1.2.1 From ca6a026a23f723a74dab9a7d3afc11c2a43c01f2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 3 Nov 2013 15:04:02 +0100 Subject: convert to UIManager --- perl-install/standalone/drakfloppy | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'perl-install/standalone/drakfloppy') diff --git a/perl-install/standalone/drakfloppy b/perl-install/standalone/drakfloppy index 9154d40a3..efb2104df 100755 --- a/perl-install/standalone/drakfloppy +++ b/perl-install/standalone/drakfloppy @@ -43,11 +43,19 @@ unless ($::isEmbedded) { ### menus definition # the menus are not shown but they provides shiny shortcut like C-q - create_factory_menu($window->{rwindow}, ( - { path => N("/_File"), item_type => '' }, - { path => N("/File/_Quit"), accelerator => N("Q"), callback => sub { ugtk3->exit(0) } }, - ) - ); + my $ui = gtknew('UIManager', actions => [ + # [name, stock_id, value, label, accelerator, tooltip, callback] + [ 'FileMenu', undef, N("_File") ], + [ 'Quit', undef, N("_Quit"), N("Q"), undef, sub { ugtk3->exit(0) } ], + ], + string => qq( + + + + + +)); + $window->{rwindow}->add_accel_group($ui->get_accel_group); } -- cgit v1.2.1