Mageia Bugzilla – Attachment 11651 Details for
Bug 22425
GUI draksnapshot-config dies with no further output (or maybe with "terminated abnormally")
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch for changing gtk2 to gtk3 + chnage from interval to retain keywork
draksnapshot-config.patch (text/plain), 4.65 KB, created by
Nicolas Nicolas
on 2020-05-18 08:52:37 CEST
(
hide
)
Description:
Patch for changing gtk2 to gtk3 + chnage from interval to retain keywork
Filename:
MIME Type:
Creator:
Nicolas Nicolas
Created:
2020-05-18 08:52:37 CEST
Size:
4.65 KB
patch
obsolete
>--- draksnapshot-config 2018-09-20 01:15:18.000000000 +0200 >+++ draksnapshot-config.corrige 2020-05-18 08:10:40.571938187 +0200 >@@ -26,17 +26,17 @@ > use common; > use interactive; > use MDV::Snapshot::Common; >-use MDV::Snapshot::Hal; >+#use MDV::Snapshot::Hal; > > # i18n: IMPORTANT: to get correct namespace (drakconf instead of libDrakX) > BEGIN { unshift @::textdomains, 'draksnapshot' } > >-use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version >-use ugtk2 qw(:create :dialogs :helpers :wrappers); >-use Gtk2::SimpleList; >+use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version >+use ugtk3 qw(:create :dialogs :helpers :wrappers); >+use Gtk3::SimpleList; > use interactive; > >-ugtk2::add_icon_path("/usr/share/draksnapshot/pixmaps/"); >+ugtk3::add_icon_path("/usr/share/draksnapshot/pixmaps/"); > > ######### read config > >@@ -46,7 +46,7 @@ > > my ($backup_list, $exclude_list) = map { > my $key = $_; >- my $list = Gtk2::SimpleList->new('' => 'text'); >+ my $list = Gtk3::SimpleList->new('' => 'text'); > # properly size when not embedded: > $list->set_size_request($::isEmbedded ? -1 : 500, 100); > $list->set_headers_visible(0); >@@ -55,26 +55,25 @@ > } qw(backup exclude); > > >-my %default_intervals = ( >- map { >- if (my ($type, $interval) = /^interval\s*(\S*)\s*(\S*)/) { >- $type => $interval; >+ my %default_intervals = ( >+ map { >+ if (my ($type, $retain) = /^retain\s*(\S*)\s*(\S*)/) { >+ $type => $retain; > } >- } grep { /^interval\s/ } cat_($config_file) >+ } grep { /^retain\s/ } cat_($config_file) > ); > > # initialize commented out fields: >-$default_intervals{$_} ||= undef foreach @ordered_intervals; >- >+$default_intervals{$_} ||= undef foreach $ordered_intervals; > > ######### GUI > >-$ugtk2::wm_icon = "draksnapshot-big"; >-my $my_win = ugtk2->new(N("Backup snapshots configuration")); >+$ugtk3::wm_icon = "draksnapshot-big"; >+my $my_win = ugtk3->new(N("Backup snapshots configuration")); > > unless ($::isEmbedded) { > $my_win->{window}->set_border_width(5); >- #$my_win->{window}->set_default_size(540,460); >+ $my_win->{window}->set_default_size(540,460); > } > $my_win->{window}->signal_connect(delete_event => \&quit); > >@@ -88,7 +87,8 @@ > { path => N("/_Help"), item_type => '<LastBranch>' }, > { path => N("/Help/_About...") } > ); >-my $_menubar = $::isEmbedded ? create_factory_menu($my_win->{rwindow}, @menu_items) : undef; >+my $_menubar = $::isEmbedded ? ugtk2::create_factory_menu($my_win->{rwindow}, @menu_items) : undef; >+#my $_menubar = create_factory_menu($my_win->{rwindow}, @menu_items); > ######### menus end > > >@@ -111,7 +111,7 @@ > } > } > >-my $dialog = ugtk2->new(N("Backup snapshots configuration")); >+my $dialog = ugtk3::new(N("Backup snapshots configuration")); > my $d_window = $dialog->{window}; > gtkadd($dialog->{rwindow}, > gtknew('VBox', children => [ >@@ -130,7 +130,7 @@ > my ($box, $button); > gtkadd($my_win->{window}, > gtknew('VBox', children => [ >- if_(!$::isEmbedded, 0, Gtk2::Banner->new('draksnapshot-big', >+ if_(!$::isEmbedded, 0, Gtk3::Banner->new('draksnapshot-big', > N("Backup snapshots configuration"))), > 0, gtknew('Title1', label => N("Settings")), > 0, gtknew('CheckButton', text => N("Enable Backups"), active_ref => \$is_enabled, >@@ -200,7 +200,7 @@ > my ($list, $o_check) = @_; > gtknew('HBox', > children => [ >- 0, gtkset_size_request(Gtk2::Alignment->new(0, 0, 0, 0), 35, 1), >+ 0, gtkset_size_request(Gtk3::Alignment->new(0, 0, 0, 0), 35, 1), > 1, gtknew('ScrolledWindow', child => $list), > 0, gtknew('VBox', border_width => 5, spacing => 5, > children_tight => [ >@@ -221,7 +221,7 @@ > ); > } > >-sub quit() { ugtk2->exit(0) } >+sub quit() { ugtk3->exit(0) } > > > sub add { >@@ -234,7 +234,7 @@ > my $alrd_exsts = defined $o_iter; > > $browse->signal_connect(clicked => sub { >- my $file_dlg = Gtk2::FileSelection->new(N("Path selection")); >+ my $file_dlg = Gtk3::FileSelection->new(N("Path selection")); > $file_dlg->set_modal(1); > $file_dlg->set_transient_for($dlg); > $file_dlg->show; >@@ -285,7 +285,7 @@ > sub save() { > save_keyword('interval', map { > my $val = $entries{$_}->get_text; >- if_($val, join("\t", 'interval', $_, $val)); >+ if_($val, join("\t", 'retain', $_, $val)); > } @ordered_intervals); > > if (!$button->get('sensitive')) { # Mandriva defaults
--- draksnapshot-config 2018-09-20 01:15:18.000000000 +0200 +++ draksnapshot-config.corrige 2020-05-18 08:10:40.571938187 +0200 @@ -26,17 +26,17 @@ use common; use interactive; use MDV::Snapshot::Common; -use MDV::Snapshot::Hal; +#use MDV::Snapshot::Hal; # i18n: IMPORTANT: to get correct namespace (drakconf instead of libDrakX) BEGIN { unshift @::textdomains, 'draksnapshot' } -use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version -use ugtk2 qw(:create :dialogs :helpers :wrappers); -use Gtk2::SimpleList; +use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version +use ugtk3 qw(:create :dialogs :helpers :wrappers); +use Gtk3::SimpleList; use interactive; -ugtk2::add_icon_path("/usr/share/draksnapshot/pixmaps/"); +ugtk3::add_icon_path("/usr/share/draksnapshot/pixmaps/"); ######### read config @@ -46,7 +46,7 @@ my ($backup_list, $exclude_list) = map { my $key = $_; - my $list = Gtk2::SimpleList->new('' => 'text'); + my $list = Gtk3::SimpleList->new('' => 'text'); # properly size when not embedded: $list->set_size_request($::isEmbedded ? -1 : 500, 100); $list->set_headers_visible(0); @@ -55,26 +55,25 @@ } qw(backup exclude); -my %default_intervals = ( - map { - if (my ($type, $interval) = /^interval\s*(\S*)\s*(\S*)/) { - $type => $interval; + my %default_intervals = ( + map { + if (my ($type, $retain) = /^retain\s*(\S*)\s*(\S*)/) { + $type => $retain; } - } grep { /^interval\s/ } cat_($config_file) + } grep { /^retain\s/ } cat_($config_file) ); # initialize commented out fields: -$default_intervals{$_} ||= undef foreach @ordered_intervals; - +$default_intervals{$_} ||= undef foreach $ordered_intervals; ######### GUI -$ugtk2::wm_icon = "draksnapshot-big"; -my $my_win = ugtk2->new(N("Backup snapshots configuration")); +$ugtk3::wm_icon = "draksnapshot-big"; +my $my_win = ugtk3->new(N("Backup snapshots configuration")); unless ($::isEmbedded) { $my_win->{window}->set_border_width(5); - #$my_win->{window}->set_default_size(540,460); + $my_win->{window}->set_default_size(540,460); } $my_win->{window}->signal_connect(delete_event => \&quit); @@ -88,7 +87,8 @@ { path => N("/_Help"), item_type => '<LastBranch>' }, { path => N("/Help/_About...") } ); -my $_menubar = $::isEmbedded ? create_factory_menu($my_win->{rwindow}, @menu_items) : undef; +my $_menubar = $::isEmbedded ? ugtk2::create_factory_menu($my_win->{rwindow}, @menu_items) : undef; +#my $_menubar = create_factory_menu($my_win->{rwindow}, @menu_items); ######### menus end @@ -111,7 +111,7 @@ } } -my $dialog = ugtk2->new(N("Backup snapshots configuration")); +my $dialog = ugtk3::new(N("Backup snapshots configuration")); my $d_window = $dialog->{window}; gtkadd($dialog->{rwindow}, gtknew('VBox', children => [ @@ -130,7 +130,7 @@ my ($box, $button); gtkadd($my_win->{window}, gtknew('VBox', children => [ - if_(!$::isEmbedded, 0, Gtk2::Banner->new('draksnapshot-big', + if_(!$::isEmbedded, 0, Gtk3::Banner->new('draksnapshot-big', N("Backup snapshots configuration"))), 0, gtknew('Title1', label => N("Settings")), 0, gtknew('CheckButton', text => N("Enable Backups"), active_ref => \$is_enabled, @@ -200,7 +200,7 @@ my ($list, $o_check) = @_; gtknew('HBox', children => [ - 0, gtkset_size_request(Gtk2::Alignment->new(0, 0, 0, 0), 35, 1), + 0, gtkset_size_request(Gtk3::Alignment->new(0, 0, 0, 0), 35, 1), 1, gtknew('ScrolledWindow', child => $list), 0, gtknew('VBox', border_width => 5, spacing => 5, children_tight => [ @@ -221,7 +221,7 @@ ); } -sub quit() { ugtk2->exit(0) } +sub quit() { ugtk3->exit(0) } sub add { @@ -234,7 +234,7 @@ my $alrd_exsts = defined $o_iter; $browse->signal_connect(clicked => sub { - my $file_dlg = Gtk2::FileSelection->new(N("Path selection")); + my $file_dlg = Gtk3::FileSelection->new(N("Path selection")); $file_dlg->set_modal(1); $file_dlg->set_transient_for($dlg); $file_dlg->show; @@ -285,7 +285,7 @@ sub save() { save_keyword('interval', map { my $val = $entries{$_}->get_text; - if_($val, join("\t", 'interval', $_, $val)); + if_($val, join("\t", 'retain', $_, $val)); } @ordered_intervals); if (!$button->get('sensitive')) { # Mandriva defaults
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22425
: 11651 |
11653