Commit 726d701e authored by Michael Liang's avatar Michael Liang

le-interface: add help buttom in the panel

Signed-off-by: default avatarMichael Liang <ml09@c3sl.ufpr.br>
parent ec3184fb
......@@ -32,6 +32,7 @@ divertList="
$GNOMEICONS/22x22/places/ubuntu-logo.png \
$GNOMEICONS/24x24/places/ubuntu-logo.png \
$GNOMEICONS/32x32/places/ubuntu-logo.png \
$GNOMEICONS/scalable/status/dialog-information-symbolic.svg \
"
# Divert files
......
......@@ -32,6 +32,7 @@ divertList="
$GNOMEICONS/22x22/places/ubuntu-logo.png \
$GNOMEICONS/24x24/places/ubuntu-logo.png \
$GNOMEICONS/32x32/places/ubuntu-logo.png \
$GNOMEICONS/scalable/status/dialog-information-symbolic.svg \
"
# Divert files
......
/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */
const Gettext = imports.gettext;
const Gio = imports.gi.Gio;
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
/**
* initTranslations:
* @domain: (optional): the gettext domain to use
*
* Initialize Gettext to load translations from extensionsdir/locale.
* If @domain is not provided, it will be taken from metadata['gettext-domain']
*/
function initTranslations(domain) {
let extension = ExtensionUtils.getCurrentExtension();
domain = domain || extension.metadata['gettext-domain'];
// check if this extension was built with "make zip-file", and thus
// has the locale files in a subfolder
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell
let localeDir = extension.dir.get_child('locale');
if (localeDir.query_exists(null))
Gettext.bindtextdomain(domain, localeDir.get_path());
else
Gettext.bindtextdomain(domain, Config.LOCALEDIR);
}
/**
* getSettings:
* @schema: (optional): the GSettings schema id
*
* Builds and return a GSettings schema for @schema, using schema files
* in extensionsdir/schemas. If @schema is not provided, it is taken from
* metadata['settings-schema'].
*/
function getSettings(schema) {
let extension = ExtensionUtils.getCurrentExtension();
schema = schema || extension.metadata['settings-schema'];
const GioSSS = Gio.SettingsSchemaSource;
// check if this extension was built with "make zip-file", and thus
// has the schema files in a subfolder
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell (and therefore schemas are available
// in the standard folders)
let schemaDir = extension.dir.get_child('schemas');
let schemaSource;
if (schemaDir.query_exists(null))
schemaSource = GioSSS.new_from_directory(schemaDir.get_path(),
GioSSS.get_default(),
false);
else
schemaSource = GioSSS.get_default();
let schemaObj = schemaSource.lookup(schema, true);
if (!schemaObj)
throw new Error('Schema ' + schema + ' could not be found for extension '
+ extension.metadata.uuid + '. Please check your installation.');
return new Gio.Settings({ settings_schema: schemaObj });
}
const Gdk = imports.gi.Gdk;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Gio = imports.gi.Gio;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Panel = imports.ui.panel;
const Gettext = imports.gettext.domain('gnome-shell-extensions');
const _ = Gettext.gettext;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const ICON_SIZE = 22;
//let compatible_MBlogs = [ "x", "y"];
let compatible_Ajuda = [ "yelp" ];
const MessageMenuItem = new Lang.Class({
Name: 'MessageMenu.MessageMenuItem',
Extends: PopupMenu.PopupBaseMenuItem,
_init: function(app) {
this.parent();
this._app = app;
this.label = new St.Label({ text:app.get_name(), style_class: 'program-label' });
this.addActor(this.label);
this._icon = app.create_icon_texture(ICON_SIZE);
/*this.addActor(this._icon, { align: St.Align.END, span: -1 });*/
},
activate: function(event) {
this._app.activate_full(-1, event.get_time());
this.parent(event);
}
});
const MessageMenu = new Lang.Class({
Name: 'MessageMenu.MessageMenu',
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('dialog-information-symbolic');
/*this.new_msg_string = _("");
this.contacts_string = _("");*/
this._availableAjuda = new Array ();
this._availableMBlogs = new Array ();
this._getApps();
this._buildMenu();
},
_buildMenu: function()
{
for (var t=0; t<this._availableAjuda.length; t++) {
let e_app=this._availableAjuda[t];
let newLauncher = new MessageMenuItem(e_app);
this.menu.addMenuItem(newLauncher);
}
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
// insert Blogging Clients into menu
/*for (var l=0; l<this._availableMBlogs.length; l++) {
let newLauncher = new MessageMenuItem(this._availableMBlogs[l]);
this.menu.addMenuItem(newLauncher);
}*/
},
_getApps: function() {
let appsys = Shell.AppSystem.get_default();
//get available Apps
for (var p=0; p<compatible_Ajuda.length; p++) {
let app_name = compatible_Ajuda[p];
let app = appsys.lookup_app(app_name+'.desktop');
if (app != null) {
this._availableAjuda.push(app);
}
}
//get available Blogging Apps
/* for (var u=0; u<compatible_MBlogs.length; u++) {
let app_name = compatible_MBlogs[u];
let app = appsys.lookup_app(app_name+'.desktop');
if (app != null) {
this._availableMBlogs.push(app);
}
}*/
},
});
function init(extensionMeta) {
Convenience.initTranslations();
let theme = imports.gi.Gtk.IconTheme.get_default();
theme.append_search_path(extensionMeta.path + "/icons");
}
let _indicator;
function enable() {
_indicator = new MessageMenu;
Main.panel.addToStatusArea('message-menu', _indicator,1);
}
function disable() {
_indicator.destroy();
}
const Gdk = imports.gi.Gdk;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Gio = imports.gi.Gio;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Panel = imports.ui.panel;
const Gettext = imports.gettext.domain('gnome-shell-extensions');
const _ = Gettext.gettext;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const ICON_SIZE = 22;
//let compatible_MBlogs = [ "x", "y"];
let compatible_Ajuda = [ "yelp" ];
const MessageMenuItem = new Lang.Class({
Name: 'MessageMenu.MessageMenuItem',
Extends: PopupMenu.PopupBaseMenuItem,
_init: function(app) {
this.parent();
this._app = app;
this.label = new St.Label({ text:app.get_name(), style_class: 'program-label' });
/* this.addActor(this.label);*/
this._icon = app.create_icon_texture(ICON_SIZE);
this.addActor(this._icon, { align: St.Align.END, span: -1 });
},
activate: function(event) {
this._app.activate_full(-1, event.get_time());
this.parent(event);
}
});
const MessageMenu = new Lang.Class({
Name: 'MessageMenu.MessageMenu',
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('dialog-information-symbolic');
/*this.new_msg_string = _("");
this.contacts_string = _("");*/
this._availableAjuda = new Array ();
this._availableMBlogs = new Array ();
this._getApps();
this._buildMenu();
},
_buildMenu: function()
{
for (var t=0; t<this._availableAjuda.length; t++) {
let e_app=this._availableAjuda[t];
let newLauncher = new MessageMenuItem(e_app);
this.menu.addMenuItem(newLauncher);
}
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
// insert Blogging Clients into menu
/*for (var l=0; l<this._availableMBlogs.length; l++) {
let newLauncher = new MessageMenuItem(this._availableMBlogs[l]);
this.menu.addMenuItem(newLauncher);
}*/
},
_getApps: function() {
let appsys = Shell.AppSystem.get_default();
//get available Apps
for (var p=0; p<compatible_Ajuda.length; p++) {
let app_name = compatible_Ajuda[p];
let app = appsys.lookup_app(app_name+'.desktop');
if (app != null) {
this._availableAjuda.push(app);
}
}
//get available Blogging Apps
/* for (var u=0; u<compatible_MBlogs.length; u++) {
let app_name = compatible_MBlogs[u];
let app = appsys.lookup_app(app_name+'.desktop');
if (app != null) {
this._availableMBlogs.push(app);
}
}*/
},
});
function init(extensionMeta) {
Convenience.initTranslations();
let theme = imports.gi.Gtk.IconTheme.get_default();
theme.append_search_path(extensionMeta.path + "/icons");
}
let _indicator;
function enable() {
_indicator = new MessageMenu;
Main.panel.addToStatusArea('message-menu', _indicator,1);
}
function disable() {
_indicator.destroy();
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg7384"
height="16"
width="16"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="dialog-information-symbolic.svg">
<defs
id="defs3157" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="712"
id="namedview3155"
showgrid="false"
inkscape:zoom="34.125"
inkscape:cx="8"
inkscape:cy="8"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg7384" />
<metadata
id="metadata90">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<g
style="fill-rule:evenodd"
id="g3054"
transform="matrix(45.251948,0,0,45.1073,0.14640421,0.04626518)">
<symbol
viewBox="-5.09934 -3.69102 0.284139 0.76339"
id="x6-6-0">
<path
id="path3028"
d="m -5.02467,-3.69084 c -0.058986,0.0054 -0.089114,0.093003 -0.045882,0.133515 0.136624,0.13666 0.136624,0.355772 0,0.492396 -0.034896,0.026701 -0.038785,0.085126 -0.00771,0.116215 0.031054,0.031079 0.089514,0.027201 0.116215,-0.00771 0.195791,-0.195789 0.195791,-0.513591 0,-0.70938 -0.015679,-0.017164 -0.039415,-0.026668 -0.062628,-0.02504 z m 0,0 z"
class="fil0"
inkscape:connector-curvature="0"
style="fill:#bebebe;fill-rule:nonzero" />
</symbol>
<symbol
viewBox="-5.41857 -1.46094 0.583637 0.286497"
id="x8-8-0">
<path
id="path3031"
d="m -5.41689,-1.25806 c 0.013175,0.076826 0.127481,0.111125 0.180743,0.054218 0.062592,-0.062592 0.159447,-0.062592 0.222039,0 0.03921,0.03921 0.110566,0.03921 0.149773,0 0.039207,-0.039208 0.039207,-0.110563 0,-0.149771 -0.143099,-0.143091 -0.378451,-0.143091 -0.521576,0 -0.025292,0.024054 -0.037336,0.061254 -0.030979,0.095553 z m 0,0 z"
class="fil0"
inkscape:connector-curvature="0"
style="fill:#bebebe;fill-rule:nonzero" />
</symbol>
<symbol
viewBox="-5.86923 -2.09641 1.47701 0.47111"
id="x10-10-0">
<path
id="path3034"
d="m -5.86276,-1.68981 c 0.025002,0.066788 0.12684,0.087168 0.175588,0.035101 0.309456,-0.309454 0.814251,-0.309454 1.12371,0 0.078136,0.078174 0.227402,-0.071099 0.149238,-0.149227 -0.38996,-0.389963 -1.03223,-0.389963 -1.42219,0 -0.030167,0.028357 -0.041017,0.075406 -0.026322,0.114126 l -2.82e-5,0 z m 0,0 z"
class="fil0"
inkscape:connector-curvature="0"
style="fill:#bebebe;fill-rule:nonzero" />
</symbol>
<symbol
viewBox="-5.25682 -3.5263 0.210466 0.428712"
id="x5-5-0">
<path
id="path3037"
d="m -5.19539,-3.52507 c -0.056443,0.00968 -0.081627,0.093638 -0.039841,0.132774 0.04599,0.045954 0.04599,0.117128 0,0.163118 -0.028793,0.028793 -0.028793,0.081212 0,0.109994 0.028819,0.028793 0.081201,0.028793 0.11003,0 0.105119,-0.105119 0.105119,-0.278023 0,-0.383142 -0.017661,-0.018573 -0.04497,-0.027409 -0.070189,-0.022744 z m 0,0 z"
class="fil0"
inkscape:connector-curvature="0"
style="fill:#bebebe;fill-rule:nonzero" />
</symbol>
<symbol
viewBox="-4.92568 -3.85761 0.346062 1.08501"
id="x7-7-0">
<path
id="path3040"
d="m -4.87829,-3.85283 c -0.049066,0.018327 -0.06404,0.093138 -0.025791,0.128955 0.227304,0.22734 0.227304,0.598158 0,0.82549 -0.05743,0.057402 0.052213,0.167042 0.109607,0.109605 0.286469,-0.286426 0.286469,-0.758267 0,-1.04474 -0.020808,-0.022146 -0.055387,-0.030131 -0.083816,-0.019314 z m 0,0 z"
class="fil0"
inkscape:connector-curvature="0"
style="fill:#bebebe;fill-rule:nonzero" />
</symbol>
<symbol
viewBox="-5.64247 -1.77561 1.03918 0.386785"
id="x9-9-0">
<path
id="path3043"
d="m -5.64222,-1.49049 c 0.00732,0.080317 0.126596,0.121334 0.181776,0.062484 0.186005,-0.186015 0.484265,-0.186015 0.67028,0 0.036342,0.04751 0.11589,0.052775 0.158173,0.010491 0.042319,-0.042319 0.037021,-0.121867 -0.010489,-0.158209 -0.266512,-0.266514 -0.699145,-0.266514 -0.965649,0 -0.023385,0.021331 -0.036314,0.053649 -0.034091,0.085233 z m 0,0 z"
class="fil0"
inkscape:connector-curvature="0"
style="fill:#bebebe;fill-rule:nonzero" />
</symbol>
<g
id="Layer_x0020_1">
<metadata
id="CorelCorpID_0Corel-Layer" />
<path
id="path3047"
d="m 0.044111,0.0588061 c -0.0588138,0.0661319 -0.0588087,0.166137 0,0.232264 L 0.1157565,0.2194246 c -0.0197934,-0.0262605 -0.0197934,-0.0627125 0,-0.0889731 L 0.044111,0.058806 z m 0.0146951,0.246959 c 0.0661268,0.0588087 0.166132,0.0588138 0.232264,0 L 0.2194246,0.2341196 c -0.0262605,0.0197934 -0.0627125,0.0197934 -0.0889731,0 L 0.058806,0.3057651 z M 0.3057651,0.29107 c 0.0588138,-0.0661319 0.0588087,-0.166137 0,-0.232264 L 0.2341196,0.1304515 c 0.0197934,0.0262605 0.0197934,0.0627125 0,0.0889731 L 0.3057651,0.2910701 z M 0.29107,0.044111 c -0.0661268,-0.0588087 -0.166132,-0.0588138 -0.232264,0 l 0.0716455,0.0716455 c 0.0262605,-0.0197934 0.0627125,-0.0197934 0.0889731,0 L 0.2910701,0.044111 z"
class="fil1"
inkscape:connector-curvature="0"
style="fill:#18537d" />
</g>
</g>
</svg>
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "A Messaging Menu for the Gnome Shell. All Email and Chat Applications in one Place.",
"gettext-domain": "gnome-shell-extensions",
"name": "Menu Extra",
"shell-version": [
"3.4",
"3.6"
],
"url": "http://git.c3sl.ufpr.br/",
"uuid": "menuextra@c3sl.ufpr.br",
"version": 3
}
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "A Messaging Menu for the Gnome Shell. All Email and Chat Applications in one Place.",
"gettext-domain": "gnome-shell-extensions",
"name": "Messaging Menu",
"shell-version": [
"3.4",
"3.6"
],
"url": "https://github.com/screenfreeze/messagingmenu.git",
"uuid": "messagingmenu@screenfreeze.net",
"version": 3
}
\ No newline at end of file
.messagemenu {
width: 20px;
}
.program-label {
font-weight: bold;
min-width: 170px;
}
.messagemenu {
/*width: 20px;*/
}
.program-label {
font-weight: bold;
min-width: 170px;
}
/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */
const Gettext = imports.gettext;
const Gio = imports.gi.Gio;
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
/**
* initTranslations:
* @domain: (optional): the gettext domain to use
*
* Initialize Gettext to load translations from extensionsdir/locale.
* If @domain is not provided, it will be taken from metadata['gettext-domain']
*/
function initTranslations(domain) {
let extension = ExtensionUtils.getCurrentExtension();
domain = domain || extension.metadata['gettext-domain'];
// check if this extension was built with "make zip-file", and thus
// has the locale files in a subfolder
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell
let localeDir = extension.dir.get_child('locale');
if (localeDir.query_exists(null))
Gettext.bindtextdomain(domain, localeDir.get_path());
else
Gettext.bindtextdomain(domain, Config.LOCALEDIR);
}
/**
* getSettings:
* @schema: (optional): the GSettings schema id
*
* Builds and return a GSettings schema for @schema, using schema files
* in extensionsdir/schemas. If @schema is not provided, it is taken from
* metadata['settings-schema'].
*/
function getSettings(schema) {
let extension = ExtensionUtils.getCurrentExtension();
schema = schema || extension.metadata['settings-schema'];
const GioSSS = Gio.SettingsSchemaSource;
// check if this extension was built with "make zip-file", and thus
// has the schema files in a subfolder
// otherwise assume that extension has been installed in the
// same prefix as gnome-shell (and therefore schemas are available
// in the standard folders)
let schemaDir = extension.dir.get_child('schemas');
let schemaSource;