summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rwxr-xr-xmgaapplet38
-rw-r--r--mgaapplet.pm47
3 files changed, 49 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index 08741f20..182e8429 100644
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,7 @@ install: all
install -m644 pixmaps/*.png $(PIXDIR)/pixmaps
perl -pi -e "s/version = 1/version = '$(VERSION)'/" mgaonline.pm
install -m644 mgaonline.pm $(FBLIBDIR)
+ install -m644 mgaapplet.pm $(FBLIBDIR)
install -m644 mgaapplet_gui.pm $(FBLIBDIR)
install -m644 mgaapplet_urpm.pm $(FBLIBDIR)
for d in $(SUBDIRS); do make -C $$d $@; done
diff --git a/mgaapplet b/mgaapplet
index 43a2f863..77b6f6dd 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -35,6 +35,7 @@ use mygtk3 qw(gtknew); #- do not import gtkadd which conflicts with ugtk3 versio
use ugtk3 qw(:all);
use lib qw(/usr/lib/libDrakX/drakfirsttime);
use mgaonline;
+use mgaapplet;
use mgaapplet_gui;
use Gtk3::Notify '-init', 'mgaapplet';
use Net::DBus qw(:typing);
@@ -158,43 +159,6 @@ Then, restart \"%s\".", N("Enabled"), 'mgaapplet') ],
},
);
-my %comm_codes = (
- locked => {
- code => 2,
- status => 'locked',
- log => "urpmi database locked, skipping updating urpmi database",
- },
- error_updating => {
- code => 3,
- status => 'critical',
- log => N_("Error updating media"),
- },
- no_update_medium => {
- code => 4,
- status => 'no_update_medium',
- log => "no update media configured",
- },
- no_enabled_medium => {
- code => 5,
- status => 'no_enabled_medium',
- log => "all update media are disabled",
- },
- updates => {
- code => 6,
- status => 'updates',
- log => "Checking... Updates are available\n\n",
- },
- uptodate => {
- code => 7,
- status => 'okay',
- log => "Packages are up to date\n",
- },
- db_not_open => {
- code => 8,
- status => 'critical',
- log => "Failed to open urpmi database\n",
- },
-);
my %actions = (
'update' => { name => N("Install updates"), launch => \&installUpdates },
diff --git a/mgaapplet.pm b/mgaapplet.pm
new file mode 100644
index 00000000..faabfc75
--- /dev/null
+++ b/mgaapplet.pm
@@ -0,0 +1,47 @@
+package mgaapplet;
+
+use Exporter;
+use lib qw(/usr/lib/libDrakX);
+use common;
+our @ISA = 'Exporter';
+our @EXPORT = qw(%comm_codes);
+
+our %comm_codes = (
+ locked => {
+ code => 2,
+ status => 'locked',
+ log => "urpmi database locked, skipping updating urpmi database",
+ },
+ error_updating => {
+ code => 3,
+ status => 'critical',
+ log => N_("Error updating media"),
+ },
+ no_update_medium => {
+ code => 4,
+ status => 'no_update_medium',
+ log => "no update media configured",
+ },
+ no_enabled_medium => {
+ code => 5,
+ status => 'no_enabled_medium',
+ log => "all update media are disabled",
+ },
+ updates => {
+ code => 6,
+ status => 'updates',
+ log => "Checking... Updates are available\n\n",
+ },
+ uptodate => {
+ code => 7,
+ status => 'okay',
+ log => "Packages are up to date\n",
+ },
+ db_not_open => {
+ code => 8,
+ status => 'critical',
+ log => "Failed to open urpmi database\n",
+ },
+);
+
+1;