~darkxst/ubuntu/saucy/gnome-shell-extensions/lp1212408-fix

« back to all changes in this revision

Viewing changes to .pc/03-Revert-Remove-all-references-to-localedir-from-metad.patch/extensions/example/extension.js

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Josselin Mouette, Michael Biebl
  • Date: 2012-02-11 23:28:53 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120211232853-mc92yae3sgemtz7l
Tags: 3.2.3-1
[ Josselin Mouette ]
* gnome-shell-extensions.gsettings-override: enable the alternative 
  status menu by default. Closes: #648112.
* Use ${gnome:Version} to generate strict dependencies, it’s very 
  unlikely that extensions remain compatible after a major upgrade.

[ Michael Biebl ]
* Upload to unstable.

[ Josselin Mouette ]
* 01_status-menu_disable_accounts.patch: new patch. Drop the unusable
  advertisement for Google. It is already available in the control 
  center anyway.

[ Michael Biebl ]
* New upstream release.
* Drop patches which have been merged upstream:
  - debian/patches/upstream/*
  - debian/patches/fix-*
* Refresh 01_status-menu_disable_accounts.patch.
* Add 02-Revert-all-remove-all-GSettings-usage.patch: Use GSettings since we
  install the extensions system-wide.
* Use dh-autoreconf to generate the build system.
* Add 03-Revert-Remove-all-references-to-localedir-from-metad.patch: Use
  locales from system-wide location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Sample extension code, makes clicking on the panel show a message
 
2
const GLib = imports.gi.GLib;
 
3
const St = imports.gi.St;
 
4
const Mainloop = imports.mainloop;
 
5
 
 
6
const Gettext = imports.gettext.domain('gnome-shell-extensions');
 
7
const _ = Gettext.gettext;
 
8
 
 
9
const Main = imports.ui.main;
 
10
 
 
11
function _showHello() {
 
12
    let text = new St.Label({ style_class: 'helloworld-label', text: _("Hello, world!") });
 
13
    let monitor = Main.layoutManager.primaryMonitor;
 
14
    global.stage.add_actor(text);
 
15
    text.set_position(Math.floor (monitor.width / 2 - text.width / 2), Math.floor(monitor.height / 2 - text.height / 2));
 
16
    Mainloop.timeout_add(3000, function () { text.destroy(); });
 
17
}
 
18
 
 
19
// Put your extension initialization code here
 
20
function init(metadata) {
 
21
    log ('Example extension initalized');
 
22
 
 
23
    imports.gettext.bindtextdomain('gnome-shell-extensions', GLib.build_filenamev([metadata.path, 'locale']));
 
24
}
 
25
 
 
26
let signalId;
 
27
 
 
28
function enable() {
 
29
    log ('Example extension enabled');
 
30
 
 
31
    Main.panel.actor.reactive = true;
 
32
    signalId = Main.panel.actor.connect('button-release-event', _showHello);
 
33
}
 
34
 
 
35
function disable() {
 
36
    log ('Example extension disabled');
 
37
 
 
38
    if (signalId) {
 
39
        Main.panel.actor.disconnect(signalId);
 
40
        signalId = 0;
 
41
    }
 
42
}