summaryrefslogtreecommitdiffstats
path: root/perl-install/dbus_object.pm
blob: dc9df0d54c6c891effb8add669c8c4b37c918b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package dbus_object;

sub system_bus {
    my %params = @_;
    #- use nomainloop => 1 to disable Net::DBus::Reactor main loop
    require Net::DBus;
    Net::DBus->system(%params);
}

sub new {
    my ($type, $bus, $service, $path, $interface) = @_;
    my $o = {
	bus => $bus,
	service => $service,
	path => $path,
	interface => $interface,
    };
    attach_object($o);
    bless $o, $type;
}

sub attach_object {
    my ($o) = @_;
    my $service = $o->{bus}->get_service($o->{service});
    $o->{object} = $service->get_object($o->{path}, $o->{interface});
}

sub call_method {
    my ($o, $method, @args) = @_;
    $o->{object}->$method(@args);
}

sub safe_call_method {
    my ($o, $method, @args) = @_;
    my @ret;
    eval {
        @ret = $o->call_method($method, @args);
    };
    if ($@) {
        print STDERR "($method) exception: $@\n";
        $o->{bus}{connection}->dispatch;
        return;
    }
    @ret;
}

sub set_gtk2_watch {
    my ($o) = @_;
    set_gtk2_watch_helper($o->{bus});
}

sub set_gtk2_watch_helper {
    my ($bus) = @_;
    $bus->{connection}->set_watch_callbacks(sub {
        my ($con, $watch) = @_;
        my $flags = $watch->get_flags;
        require Net::DBus::Binding::Watch;
	require Gtk2::Helper;
        if ($flags & &Net::DBus::Binding::Watch::READABLE) {
            Gtk2::Helper->add_watch($watch->get_fileno, 'in', sub {
                $watch->handle(&Net::DBus::Binding::Watch::READABLE);
                $con->dispatch;
                1;
            });
        }
        #- do nothing for WRITABLE watch, we dispatch when needed
    }, undef, undef); #- do nothing when watch is disabled or toggled yet

    $bus->{connection}->dispatch;
}

1;
nály" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "KDE Workstation" msgstr "KDE stanica" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "" "The K Desktop Environment, the basic graphical environment with a collection " "of accompanying tools" msgstr "" "K Desktop Enviroment, grafické prostredie s množstvom pribalených programov" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Graphical Environment" msgstr "Grafické prostredie" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Gnome Workstation" msgstr "Gnome stanica" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "" "A graphical environment with user-friendly set of applications and desktop " "tools" msgstr "Grafické rozhranie s aplikáciami a desktopovými nástrojmi" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Other Graphical Desktops" msgstr "Iné grafické prostredia" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Icewm, Window Maker, Enlightenment, Fvwm, etc" msgstr "Icewm, Window Maker, Enlightenment, Fvwm, atď" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO msgid "Development" msgstr "Vývojárska" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "C and C++ development libraries, programs and include files" msgstr "C a C++ vývojove knižnice, programy a include súbory" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Documentation" msgstr "Dokumentácia" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Books and Howto's on Linux and Free Software" msgstr "Knihy a návody pre Linux a iný voľný softvér" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "LSB" msgstr "LSB" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Linux Standard Base. Third party applications support" msgstr "Linux Standard Base. Aplikačná podpora od tretej strany" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Web/FTP" msgstr "Web/FTP" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Apache, Pro-ftpd" msgstr "Apache a Pro-ftpd" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Mail/Groupware/News" msgstr "Mail/Groupware/News" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Postfix mail server, Inn news server" msgstr "Postfix email server, Inn news server" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Database" msgstr "Databázy" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "PostgreSQL or MySQL database server" msgstr "PostgreSQL, alebo MySQL databázový server" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Firewall/Router" msgstr "Firewall/Router" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Internet gateway" msgstr "Brána k internetu" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "DNS/NIS " msgstr "DNS/NIS " # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Domain Name and Network Information Server" msgstr "Domain Name a Network Information Server" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Network Computer server" msgstr "Sieťový server" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "NFS server, SMB server, Proxy server, ssh server" msgstr "NFS server, SMB server, Proxy server, SSH server" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Office" msgstr "Kancelária" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Set of tools for mail, news, web, file transfer, and chat" msgstr "Nástroje pre elektronickú poštu, správy, web, prenos súborov, a chat" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Multimedia - Graphics" msgstr "Multimédia - Grafika" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Graphics programs such as The Gimp" msgstr "Grafické programy ako napr. The Gimp" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Multimedia - Sound" msgstr "Multimédia - Zvuk" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Audio-related tools: mp3 or midi players, mixers, etc" msgstr "Nástroje pre audio: mpš alebo midi prehrávače, etc" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Multimedia - Video" msgstr "Multimédia - Video" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Video players and editors" msgstr "Prehrávače a editory videa" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Multimedia - CD Burning" msgstr "Multimédia - CD napaľovanie" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Tools to create and burn CD's" msgstr "Nástroje na vytvorenie a napálenie CD" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "More Graphical Desktops (Gnome, IceWM)" msgstr "Viac grafických prostredí (Gnome, IceWM)" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Gnome, Icewm, Window Maker, Enlightenment, Fvwm, etc" msgstr "Gnome, Icewm, Window Maker, Enlightenment, Fvwm, atď" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Personal Information Management" msgstr "Osobný informačný manažment" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Tools for your Palm Pilot or your Visor" msgstr "Nástroje pre Váš Palm Pilot alebo Visor" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Personal Finance" msgstr "Osobné financie" # DO NOT BOTHER TO MODIFY HERE, BUT IN DRAKX PO #: ../../share/compssUsers:999 msgid "Programs to manage your finances, such as gnucash" msgstr "Programy na správu vašich financií, napr. gnucash"