aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-07-02 12:47:36 +0000
committerThierry Vignaud <tv@mandriva.org>2008-07-02 12:47:36 +0000
commit200aceae344d06fb7f9aaa8164789fada94589f8 (patch)
tree64b1bcf8bcc756b27d848b85fa6ccd4204e2600f
parentbae8d4e75bcf20d519c6962968a0bb56408e7773 (diff)
downloadrpmdrake-200aceae344d06fb7f9aaa8164789fada94589f8.tar
rpmdrake-200aceae344d06fb7f9aaa8164789fada94589f8.tar.gz
rpmdrake-200aceae344d06fb7f9aaa8164789fada94589f8.tar.bz2
rpmdrake-200aceae344d06fb7f9aaa8164789fada94589f8.tar.xz
rpmdrake-200aceae344d06fb7f9aaa8164789fada94589f8.zip
save & restore window size (#25932)
-rw-r--r--NEWS1
-rwxr-xr-xrpmdrake5
-rw-r--r--rpmdrake.pm5
3 files changed, 11 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index d83691af..f036c6a1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
- rpmdrake:
o make sure searches with no results clear package list (#34898)
+ o save & restore window size (#25932)
o show 'Group' in details (usefull for search results, #39244)
o stop packaging rpmdrake-remove (#39485)
o update GUI package list
diff --git a/rpmdrake b/rpmdrake
index 7870c595..65985664 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -208,6 +208,7 @@ sub do_search($$$$$$$) {
}
sub quit() {
+ ($rpmdrake_width->[0], $rpmdrake_height->[0]) = $::w->{real_window}->get_size();
Gtk2->main_quit
}
@@ -677,6 +678,10 @@ sub run_treeview_dialog {
$w->{rwindow}->set_default_size($typical_width*2.7, 500) if !$::isEmbedded;
$find_entry->set_text($rpmdrake_options{search}[0]) if $rpmdrake_options{search};
+ if ($rpmdrake_width->[0] && $rpmdrake_height->[0]) {
+ # so that we can shrink back:
+ $w->{real_window}->set_default_size($rpmdrake_width->[0], $rpmdrake_height->[0]);
+ }
$w->{rwindow}->show_all;
$w->{rwindow}->set_sensitive(0);
diff --git a/rpmdrake.pm b/rpmdrake.pm
index f030963c..14ead6cf 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -53,6 +53,8 @@ our @EXPORT = qw(
$max_info_in_descr
$mode
$offered_to_add_sources
+ $rpmdrake_height
+ $rpmdrake_width
$tree_flat
$tree_mode
$typical_width
@@ -151,6 +153,7 @@ $ENV{HOME} = $> == 0 ? $root->[7] : $ENV{HOME} || '/root';
our $configfile = "$ENV{HOME}/.rpmdrake";
our ($already_splashed, $changelog_first_config, $filter, $max_info_in_descr, $mode, $tree_flat, $tree_mode);
our ($mandrakeupdate_wanted_categories, $offered_to_add_sources, $no_confirmation);
+our ($rpmdrake_height, $rpmdrake_width);
our %config = (
mandrakeupdate_wanted_categories => { var => \$mandrakeupdate_wanted_categories, default => [ qw(security) ] },
already_splashed => { var => \$already_splashed, default => [] },
@@ -163,6 +166,8 @@ our %config = (
'no-confirmation' => { var => \$no_confirmation, default => [ 0 ] },
filter => { var => \$filter, default => [ 'all' ] },
mode => { var => \$mode, default => [ 'by_group' ] },
+ rpmdrake_width => { var => \$rpmdrake_width, default => [ 0 ] },
+ rpmdrake_height => { var => \$rpmdrake_height, default => [ 0 ] },
);
sub readconf() {