diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2012-08-01 17:16:30 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-11-24 21:28:33 +0100 |
commit | b9e700aea8f8dfae031d9ff923f00393b052fd3d (patch) | |
tree | 77874a7a36987e70b128aa303842ba623ec249e0 /perl-install/standalone/drakfont | |
parent | 2cfaaed875e7caeae898acf23630558077bb668a (diff) | |
download | drakx-b9e700aea8f8dfae031d9ff923f00393b052fd3d.tar drakx-b9e700aea8f8dfae031d9ff923f00393b052fd3d.tar.gz drakx-b9e700aea8f8dfae031d9ff923f00393b052fd3d.tar.bz2 drakx-b9e700aea8f8dfae031d9ff923f00393b052fd3d.tar.xz drakx-b9e700aea8f8dfae031d9ff923f00393b052fd3d.zip |
use Gtk3 namespace instead of Gtk2
Diffstat (limited to 'perl-install/standalone/drakfont')
-rwxr-xr-x | perl-install/standalone/drakfont | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index 4599d76f7..14584c1a4 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -486,15 +486,15 @@ sub interactive_mode() { local $::Wizard_no_previous = 1; gtkadd($window1->{window}, - gtkpack_(Gtk2::VBox->new(0, 2), - if_(!$::isEmbedded, 0, Gtk2::Banner->new("drakfont", N("DrakFont"))), + gtkpack_(Gtk3::VBox->new(0, 2), + if_(!$::isEmbedded, 0, Gtk3::Banner->new("drakfont", N("DrakFont"))), 0, gtknew('Title2', label => N("Font List")), - 1, Gtk2::FontSelection->new, + 1, Gtk3::FontSelection->new, 0, gtkadd(create_hbox(), - gtksignal_connect(Gtk2::Button->new(N("Get Windows Fonts")), clicked => sub { $windows = 1; import_status(); $windows = 0 }), + gtksignal_connect(Gtk3::Button->new(N("Get Windows Fonts")), clicked => sub { $windows = 1; import_status(); $windows = 0 }), ), 0, create_okcancel(my $oc = { - ok_clicked => sub { Gtk2->main_quit }, + ok_clicked => sub { Gtk3->main_quit }, }, undef, undef, '', if_(0, [ N("About"), \&help, 1 ]), @@ -541,14 +541,14 @@ sub appli_choice() { dialog(N("Options"), [ 0, gtknew('Title2', label => N("Choose the applications that will support the fonts:")), - 0, Gtk2::WrappedLabel->new(formatAlaTeX(license_msg())), + 0, Gtk3::WrappedLabel->new(formatAlaTeX(license_msg())), (map { my ($label, $ref) = @$_; - (0, gtkpack_(Gtk2::HBox->new, + (0, gtkpack_(Gtk3::HBox->new, 0, $label, - 1, Gtk2::HBox->new, + 1, Gtk3::HBox->new, # BUG: that code never had supported canceling - 0, gtksignal_connect(gtkset_active(Gtk2::CheckButton->new, $$ref), toggled => sub { $$ref = $$ref ? 0 : 1 }), + 0, gtksignal_connect(gtkset_active(Gtk3::CheckButton->new, $$ref), toggled => sub { $$ref = $$ref ? 0 : 1 }), ), ); } ([ N("Ghostscript"), \$gs ], @@ -559,7 +559,7 @@ sub appli_choice() { ), ], [ - gtksignal_connect(Gtk2::Button->new(N("Ok")), + gtksignal_connect(Gtk3::Button->new(N("Ok")), clicked => \&exitdialog, ), ], @@ -569,10 +569,10 @@ sub appli_choice() { sub font_choice() { my $file_dialog; my $_select_font_msg = N("Select the font file or directory and click on 'Add'"); - $file_dialog = Gtk2::FileChooserDialog->new(N("File Selection"), $::main_window, 'open', N("Cancel") => 'cancel', N("Ok") => 'ok'); # 'select_folder' + $file_dialog = Gtk3::FileChooserDialog->new(N("File Selection"), $::main_window, 'open', N("Cancel") => 'cancel', N("Ok") => 'ok'); # 'select_folder' $file_dialog->set_select_multiple(1); - my $filter = Gtk2::FileFilter->new; + my $filter = Gtk3::FileFilter->new; $filter->set_name(N("Fonts")); $filter->add_pattern("*.$_") foreach @font_extensions, map { uc($_) } @font_extensions; $file_dialog->add_filter($filter); @@ -604,7 +604,7 @@ sub list_remove() { #- TODO : multi-selection $treeStore->remove($iter); } -sub exitdialog() { Gtk2->main_quit } +sub exitdialog() { Gtk3->main_quit } sub dialog { my ($title, $widgets, $buttons, $o_main_loop, $o_options) = @_; @@ -620,7 +620,7 @@ sub dialog { gtkflush(); $o_main_loop->(); } else { - Gtk2->main; + Gtk3->main; } $dialog->destroy if $dialog; undef $dialog; @@ -628,9 +628,9 @@ sub dialog { sub advanced_install() { my $button; - $model = Gtk2::TreeStore->new("Glib::String"); - $list = Gtk2::TreeView->new_with_model($model); - $list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0)); + $model = Gtk3::TreeStore->new("Glib::String"); + $list = Gtk3::TreeView->new_with_model($model); + $list->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0)); $list->set_headers_visible(0); $list->get_selection->set_mode('browse'); $list->set_rules_hint(1); @@ -643,14 +643,14 @@ sub advanced_install() { 1, gtknew('HBox', children => [ 1, create_scrolled_window($list), 0, gtknew('VBox', children_tight => [ - gtksignal_connect(Gtk2::Button->new(N("Add")), clicked => \&font_choice), - gtksignal_connect(Gtk2::Button->new(N("Remove")), clicked => \&list_remove), + gtksignal_connect(Gtk3::Button->new(N("Add")), clicked => \&font_choice), + gtksignal_connect(Gtk3::Button->new(N("Remove")), clicked => \&list_remove), ]), ]), ], [ - gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => \&exitdialog), - gtksignal_connect($button = gtkset_sensitive(Gtk2::Button->new(N("Install")), 0), + gtksignal_connect(Gtk3::Button->new(N("Cancel")), clicked => \&exitdialog), + gtksignal_connect($button = gtkset_sensitive(Gtk3::Button->new(N("Install")), 0), clicked => sub { import_status() if @install; }), @@ -670,9 +670,9 @@ sub list_to_remove() { } sub show_list_to_remove() { - my $model = Gtk2::TreeStore->new("Glib::String"); - my $list = Gtk2::TreeView->new_with_model($model); - $list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0)); + my $model = Gtk3::TreeStore->new("Glib::String"); + my $list = Gtk3::TreeView->new_with_model($model); + $list->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0)); $list->set_headers_visible(0); $list->get_selection->set_mode('browse'); $list->set_rules_hint(1); @@ -681,13 +681,13 @@ sub show_list_to_remove() { dialog(N("Warning"), [ - 0, Gtk2::Label->new(N("Are you sure you want to uninstall the following fonts?")), - 1, gtkpack_(Gtk2::HBox->new(0, 4), 1, create_scrolled_window($list)), + 0, Gtk3::Label->new(N("Are you sure you want to uninstall the following fonts?")), + 1, gtkpack_(Gtk3::HBox->new(0, 4), 1, create_scrolled_window($list)), ], [ - gtksignal_connect(Gtk2::Button->new(N("Yes")), + gtksignal_connect(Gtk3::Button->new(N("Yes")), clicked => sub { import_status_uninstall(); exitdialog() }), - gtksignal_connect(Gtk2::Button->new(N("No")), + gtksignal_connect(Gtk3::Button->new(N("No")), clicked => \&exitdialog ), ], @@ -701,9 +701,9 @@ sub uninstall() { #- TODO : add item to right list with gtksignal_connect chk_empty_xfs_path(); #- left part - $left_model = Gtk2::TreeStore->new("Glib::String"); - $left_list = Gtk2::TreeView->new_with_model($left_model); - $left_list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0)); + $left_model = Gtk3::TreeStore->new("Glib::String"); + $left_list = Gtk3::TreeView->new_with_model($left_model); + $left_list->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0)); $left_list->set_headers_visible(0); $left_list->set_rules_hint(1); $left_list->get_selection->set_mode('multiple'); @@ -711,29 +711,29 @@ sub uninstall() { #- TODO : add item to right list with gtksignal_connect $left_model->append_set(undef, [ 0 => $_ ]) foreach sort @installed_fonts_path; #- right part - $right_model = Gtk2::TreeStore->new("Glib::String"); - $right_list = Gtk2::TreeView->new_with_model($right_model); - $right_list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererText->new, 'text' => 0)); + $right_model = Gtk3::TreeStore->new("Glib::String"); + $right_list = Gtk3::TreeView->new_with_model($right_model); + $right_list->append_column(Gtk3::TreeViewColumn->new_with_attributes(undef, Gtk3::CellRendererText->new, 'text' => 0)); $right_list->set_headers_visible(0); $right_list->get_selection->set_mode('multiple'); $right_list->set_rules_hint(1); dialog(N("Uninstall"), [ - 1, gtkpack_(Gtk2::HBox->new(0, 4), + 1, gtkpack_(Gtk3::HBox->new(0, 4), 1, create_scrolled_window($left_list), #1, create_scrolled_window($right_list) ), ], [ - gtksignal_connect(Gtk2::Button->new(N("Unselect All")), + gtksignal_connect(Gtk3::Button->new(N("Unselect All")), clicked => sub { $left_list->get_selection->unselect_all } ), - gtksignal_connect(Gtk2::Button->new(N("Select All")), + gtksignal_connect(Gtk3::Button->new(N("Select All")), clicked => sub { $left_list->get_selection->select_all } ), - gtksignal_connect(Gtk2::Button->new(N("Remove")), clicked => sub { exitdialog(); list_to_remove() }), - gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => \&exitdialog), + gtksignal_connect(Gtk3::Button->new(N("Remove")), clicked => sub { exitdialog(); list_to_remove() }), + gtksignal_connect(Gtk3::Button->new(N("Cancel")), clicked => \&exitdialog), ], undef, { size => [ -1, 300 ] } @@ -742,10 +742,10 @@ sub uninstall() { #- TODO : add item to right list with gtksignal_connect } sub import_status() { - $pbar = Gtk2::ProgressBar->new; - $pbar1 = Gtk2::ProgressBar->new; - $pbar2 = Gtk2::ProgressBar->new; - $pbar3 = Gtk2::ProgressBar->new; + $pbar = Gtk3::ProgressBar->new; + $pbar1 = Gtk3::ProgressBar->new; + $pbar2 = Gtk3::ProgressBar->new; + $pbar3 = Gtk3::ProgressBar->new; dialog(N("Importing fonts"), [ 0, create_packtable({ col_spacings => 10, row_spacings => 50 }, @@ -762,9 +762,9 @@ sub import_status() { } sub import_status_uninstall() { - $pbar = Gtk2::ProgressBar->new; - $pbar1 = Gtk2::ProgressBar->new; - $pbar2 = Gtk2::ProgressBar->new; + $pbar = Gtk3::ProgressBar->new; + $pbar1 = Gtk3::ProgressBar->new; + $pbar2 = Gtk3::ProgressBar->new; dialog(N("Removing fonts"), [ 0, create_packtable({ col_spacings => 10, row_spacings => 50 }, |