summaryrefslogtreecommitdiffstats
path: root/mdkapplet
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2004-03-18 23:26:55 +0000
committerDaouda Lo <daouda@mandriva.com>2004-03-18 23:26:55 +0000
commita2aac9011dc639afad743f25cd06cc596a11ee52 (patch)
tree1819016691476221646ee88bcc59d4c318606fda /mdkapplet
parent507fae0ee568f3d40c6d47f5098408758462c8df (diff)
downloadmgaonline-a2aac9011dc639afad743f25cd06cc596a11ee52.tar
mgaonline-a2aac9011dc639afad743f25cd06cc596a11ee52.tar.gz
mgaonline-a2aac9011dc639afad743f25cd06cc596a11ee52.tar.bz2
mgaonline-a2aac9011dc639afad743f25cd06cc596a11ee52.tar.xz
mgaonline-a2aac9011dc639afad743f25cd06cc596a11ee52.zip
-setLabel func
Diffstat (limited to 'mdkapplet')
-rwxr-xr-xmdkapplet9
1 files changed, 7 insertions, 2 deletions
diff --git a/mdkapplet b/mdkapplet
index 6de9c5e6..d93dbfa8 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -38,6 +38,7 @@ my ($menu, $url, $timeout, $refreshtm);
my $nowindow = 1;
my $arch = arch();
my $av_pkgs;
+my $update_label;
my ($need_update, $raisedwindow, $isAvailable) = (0, 0, 0);
my $conffile = '/etc/sysconfig/mdkonline';
@@ -135,7 +136,7 @@ sub showMainWindow() {
gtkpack_(Gtk2::VBox->new(0, 3),
1, gtksignal_connect(Gtk2::Button->new(N("Install updates")), clicked => sub { installUpdates() }),
1, gtksignal_connect(Gtk2::Button->new(N("Configure")), clicked => sub { configure() }),
- 1, gtksignal_connect(Gtk2::Button->new(N("Check updates")), clicked => sub { checkUpdates() }),
+ 1, gtksignal_connect(Gtk2::Button->new(N("Check updates")), clicked => sub { setLabel(N("Checking...")); checkUpdates(); setLabel($isAvailable ? N("Available") : N("Not Available")) }),
1, gtksignal_connect(Gtk2::Button->new(N("See logs")), clicked => sub { displayLogs() }),
)
),
@@ -147,7 +148,7 @@ sub showMainWindow() {
),
0, gtkpack_(Gtk2::HBox->new(0, 3),
0, Gtk2::Label->new(N("New Updates: ")),
- 0, Gtk2::Label->new($isAvailable ? N("Available") : N("Not Available"))
+ 0, $update_label = Gtk2::Label->new($isAvailable ? N("Available") : N("Not Available"))
),
0, gtkpack_(Gtk2::HBox->new(0, 3),
0, Gtk2::Label->new(N("Last check: ")),
@@ -163,6 +164,10 @@ sub showMainWindow() {
));
$w->show_all
}
+sub setLabel {
+ my $label = shift;
+ $update_label->set_label($label);
+}
sub confNetwork { system "/usr/sbin/drakconnect &" }
sub launchUpdate { system "/usr/sbin/MandrakeUpdate &" }
sub installUpdates { system "/usr/sbin/mdkupdate", "--applet" }