Compare commits

..

3 Commits

Author SHA1 Message Date
986afdc0c5 Port client side code to GDBus
This continues the series of patches for GDBus porting, affecting
all code that accesses remote DBus objects. This includes modemManager,
automount, autorun (for the hotplug sniffer), calendar, network (for
nm-applet only), power, scripting (for perf monitor interface)

https://bugzilla.gnome.org/show_bug.cgi?id=648651
2011-11-15 08:55:53 -05:00
e6dc843786 notificationDaemon, magnifierDBus: port to GDBus
Move /org/freedesktop/Notifications and /org/gnome/Magnifier to the
GDBus connection, so they're matched with the appropriate DBus name.

https://bugzilla.gnome.org/show_bug.cgi?id=648651
2011-11-15 08:55:35 -05:00
9eb671bb08 screensaver, gnomesession: port to GDBus based bindings
Port org.gnome.ScreenSaver and org.gnome.SessionManager glue code
to use GDBus, and move /org/gnome/Shell/EndSessionDialog to the
GDBus connection, so it is backed by the org.gnome.Shell name.

https://bugzilla.gnome.org/show_bug.cgi?id=648651
2011-11-15 08:54:39 -05:00
81 changed files with 2347 additions and 3393 deletions

63
NEWS
View File

@ -1,66 +1,3 @@
3.3.2
=====
* Port D-Bus usage in the shell to GDBus [Giovanni, Marc-Antoine, Florian,
Jasper, Matthias; #648651, #658078, #663902, #663941]
* Message tray
- Add right-click option to chats to mute the conversation [Ana; #659962]
- Don't steal the focus when popping up under the pointer [Rui; #661358]
* Looking Glass
- Add alt-Tab completion [Jason; #661054]
- Show errors from extensions in the extensions tab [Jasper; #660546]
- Allow switching tabs with <Control>PageUp/PageDown
- Theme consistently with the rest of the shell [Jason; 650900]
* Extension system
- Don't try to load disabled extensions at all [Jasper; #661815, #662704]
- Enable and disable plugins in a consistent order [Jasper; #661815, #662704]
- Add options to enable/disable extensions to gnome-shell-extension-tool
[Jasper; #661815]
* Adapt to Mutter change to GSettings [Florian, Matthias; #663429]
* Allow creating a new workspace by dragging a window or launcher in the
middle of two existing ones [Jasper; #646409]
* Allow using Alt-Tab while during drag-and-drop and other operations
that grab the pointer [Adel; #660457]
* Do a better job of finding the right user to authenticate
as when showing a PolKit dialog [Matthias; #651547]
* Control the D-Bus Eval() method by the developer-tools GSetting which
is used for looking glass and screen recorder. [Jasper; #662891]
* Fix browser plugin to work under WebKit-based browser [Jasper; #663823]
* Fix certain stacking issues with alt-Tab [Jasper; #660650]
* Fixes for GLib deprecations [Jasper; #662011]p
* Fixes for GTK+ deprecations [Florian, Rico; #662245]p
* Fixes for Clutter deprecations [Jasper; #662627]
* Visual improvements and UI tweaks [Florian, Jakub, Jasper;
#662800, #658096, #662226]
* Hard-code "Home" as the name for the home dir, rather than looking
it up via GSettings; avoids schema dependency [Cosimo; #559895]
* Don't show "Switch User" on single user machines [Florian; #657011]
* Generate documentation for St toolkit [Florian]
* Improve marking of strings for translation [Matthias, Piotr; #658664]
* Networking menu bug fixes [Giovanni; #650007, #651378, #659277, #663278]
* Code cleanups and leak fixes to StTextureCache
[Jasper, Florian; #660968, #662998]
* Code cleanups [Adel, Florian, Jasper; #662238, #663584]
* Build fixes [Adel, Colin, Florian, Ming Han]
* Misc bug fixes [Adel, Florian, "Fry", Jasper, Giovanni, Ray, Rui, Stefan;
#660520, #661029, #661231, #661623, #661921, #662235, #662236, #662502,
#662394, #662799, #662969, #663175, #663277, #663815, #663891, #662967]
Contributors:
Giovanni Campagna, Cosimo Cecchi, Matthias Clasen, Piotr Drąg, Adel Gadllah,
Rui Matos, Florian Müllner, Marc-Antoine Perennou, Ana Risteska,
Jason Siefken, Jakub Steiner, Ray Strode, Jasper St. Pierre, Ming Han Teh,
Rico Tzschichholz, Colin Walters, Stefan Zwanenburg
Translation:
Alexander Shopov [bg], Marek Černocký [cs], Mario Blättermann [de],
Kostas Papadimas [el], Bruce Cowan [en_GB], Kristjan Schmidt [eo],
Jorge González, Daniel Mustieles, Benjamín Valero Espinosa [es],
Mattias Põldaru [et], Arash Mousavi [fa], Ville-Pekka Vainio [fi],
Fran Diéguez [gl], Yaron Shahrabani [he], Hideki Yamane [ja],
Algimantas Margevičius [lt], Kjartan Maraas [nb], Daniel Nylander [se],
Matej Urbančič [sl], Praveen Illa [te], Muhammet Kara [tr],
Nguyễn Thái Ngọc Duy [vi], Cheng-Chia Tseng [zh_HK, zh_TW]
3.2.1 3.2.1
===== =====
* Restore the IM state on startup - if you were available in when you logged * Restore the IM state on startup - if you were available in when you logged

View File

@ -1,5 +1,5 @@
AC_PREREQ(2.63) AC_PREREQ(2.63)
AC_INIT([gnome-shell],[3.3.2],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell]) AC_INIT([gnome-shell],[3.2.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/shell-global.c]) AC_CONFIG_SRCDIR([src/shell-global.c])
@ -63,7 +63,7 @@ AM_CONDITIONAL(BUILD_RECORDER, $build_recorder)
CLUTTER_MIN_VERSION=1.7.5 CLUTTER_MIN_VERSION=1.7.5
GOBJECT_INTROSPECTION_MIN_VERSION=0.10.1 GOBJECT_INTROSPECTION_MIN_VERSION=0.10.1
GJS_MIN_VERSION=1.29.18 GJS_MIN_VERSION=1.29.18
MUTTER_MIN_VERSION=3.3.2 MUTTER_MIN_VERSION=3.2.1
FOLKS_MIN_VERSION=0.5.2 FOLKS_MIN_VERSION=0.5.2
GTK_MIN_VERSION=3.0.0 GTK_MIN_VERSION=3.0.0
GIO_MIN_VERSION=2.31.0 GIO_MIN_VERSION=2.31.0
@ -82,7 +82,7 @@ PKG_CHECK_MODULES(GNOME_SHELL, gio-unix-2.0 >= $GIO_MIN_VERSION
folks >= $FOLKS_MIN_VERSION folks >= $FOLKS_MIN_VERSION
libmutter >= $MUTTER_MIN_VERSION libmutter >= $MUTTER_MIN_VERSION
gjs-internals-1.0 >= $GJS_MIN_VERSION gjs-internals-1.0 >= $GJS_MIN_VERSION
libgnome-menu-3.0 $recorder_modules libgnome-menu-3.0 $recorder_modules gconf-2.0
gdk-x11-3.0 libsoup-2.4 gdk-x11-3.0 libsoup-2.4
clutter-x11-1.0 >= $CLUTTER_MIN_VERSION clutter-x11-1.0 >= $CLUTTER_MIN_VERSION
clutter-glx-1.0 >= $CLUTTER_MIN_VERSION clutter-glx-1.0 >= $CLUTTER_MIN_VERSION
@ -117,6 +117,7 @@ CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS LIBS=$saved_LIBS
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.2 gnome-desktop-3.0 >= 2.90.0 x11) PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.2 gnome-desktop-3.0 >= 2.90.0 x11)
PKG_CHECK_MODULES(GDMUSER, dbus-glib-1 gtk+-3.0)
PKG_CHECK_MODULES(TRAY, gtk+-3.0) PKG_CHECK_MODULES(TRAY, gtk+-3.0)
PKG_CHECK_MODULES(GVC, libpulse libpulse-mainloop-glib gobject-2.0) PKG_CHECK_MODULES(GVC, libpulse libpulse-mainloop-glib gobject-2.0)
PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 0.1.7) PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 0.1.7)

View File

@ -1267,8 +1267,7 @@ StTooltip StLabel {
} }
.notification-icon-button > StIcon { .notification-icon-button > StIcon {
icon-size: 16px; icon-size: 36px;
padding: 8px;
} }
.hotplug-transient-box { .hotplug-transient-box {

View File

@ -21,9 +21,11 @@
const Lang = imports.lang; const Lang = imports.lang;
const Signals = imports.signals; const Signals = imports.signals;
const Task = new Lang.Class({ function Task() {
Name: 'Task', this._init.apply(this, arguments);
}
Task.prototype = {
_init: function(scope, handler) { _init: function(scope, handler) {
if (scope) if (scope)
this.scope = scope; this.scope = scope;
@ -39,17 +41,22 @@ const Task = new Lang.Class({
return null; return null;
}, },
}); };
Signals.addSignalMethods(Task.prototype); Signals.addSignalMethods(Task.prototype);
const Hold = new Lang.Class({ function Hold() {
Name: 'Hold', this._init.apply(this, arguments);
Extends: Task, }
Hold.prototype = {
__proto__: Task.prototype,
_init: function() { _init: function() {
this.parent(this, function () { Task.prototype._init.call(this,
return this; this,
}); function () {
return this;
});
this._acquisitions = 1; this._acquisitions = 1;
}, },
@ -81,15 +88,18 @@ const Hold = new Lang.Class({
isAcquired: function() { isAcquired: function() {
return this._acquisitions > 0; return this._acquisitions > 0;
} }
}); }
Signals.addSignalMethods(Hold.prototype); Signals.addSignalMethods(Hold.prototype);
const Batch = new Lang.Class({ function Batch() {
Name: 'Batch', this._init.apply(this, arguments);
Extends: Task, }
Batch.prototype = {
__proto__: Task.prototype,
_init: function(scope, tasks) { _init: function(scope, tasks) {
this.parent(); Task.prototype._init.call(this);
this.tasks = []; this.tasks = [];
@ -156,12 +166,20 @@ const Batch = new Lang.Class({
cancel: function() { cancel: function() {
this.tasks = this.tasks.splice(0, this._currentTaskIndex + 1); this.tasks = this.tasks.splice(0, this._currentTaskIndex + 1);
} }
});
};
Signals.addSignalMethods(Batch.prototype); Signals.addSignalMethods(Batch.prototype);
const ConcurrentBatch = new Lang.Class({ function ConcurrentBatch() {
Name: 'ConcurrentBatch', this._init.apply(this, arguments);
Extends: Batch, }
ConcurrentBatch.prototype = {
__proto__: Batch.prototype,
_init: function(scope, tasks) {
Batch.prototype._init.call(this, scope, tasks);
},
process: function() { process: function() {
let hold = this.runTask(); let hold = this.runTask();
@ -175,12 +193,19 @@ const ConcurrentBatch = new Lang.Class({
// concurrently. // concurrently.
this.nextTask(); this.nextTask();
} }
}); };
Signals.addSignalMethods(ConcurrentBatch.prototype); Signals.addSignalMethods(ConcurrentBatch.prototype);
const ConsecutiveBatch = new Lang.Class({ function ConsecutiveBatch() {
Name: 'ConsecutiveBatch', this._init.apply(this, arguments);
Extends: Batch, }
ConsecutiveBatch.prototype = {
__proto__: Batch.prototype,
_init: function(scope, tasks) {
Batch.prototype._init.call(this, scope, tasks);
},
process: function() { process: function() {
let hold = this.runTask(); let hold = this.runTask();
@ -199,5 +224,5 @@ const ConsecutiveBatch = new Lang.Class({
this.nextTask(); this.nextTask();
} }
} }
}); };
Signals.addSignalMethods(ConsecutiveBatch.prototype); Signals.addSignalMethods(ConsecutiveBatch.prototype);

View File

@ -1,22 +1,32 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio; const DBus = imports.dbus;
const ConsoleKitManagerIface = <interface name='org.freedesktop.ConsoleKit.Manager'> const ConsoleKitManagerIface = {
<method name='CanRestart'> name: 'org.freedesktop.ConsoleKit.Manager',
<arg type='b' direction='out'/> methods: [{ name: 'CanRestart',
</method> inSignature: '',
<method name='CanStop'> outSignature: 'b' },
<arg type='b' direction='out'/> { name: 'CanStop',
</method> inSignature: '',
<method name='Restart' /> outSignature: 'b' },
<method name='Stop' /> { name: 'Restart',
</interface>; inSignature: '',
outSignature: '' },
const ConsoleKitProxy = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface); { name: 'Stop',
inSignature: '',
outSignature: '' }]
};
function ConsoleKitManager() { function ConsoleKitManager() {
return new ConsoleKitProxy(Gio.DBus.system, this._init();
'org.freedesktop.ConsoleKit',
'/org/freedesktop/ConsoleKit/Manager');
}; };
ConsoleKitManager.prototype = {
_init: function() {
DBus.system.proxifyObject(this,
'org.freedesktop.ConsoleKit',
'/org/freedesktop/ConsoleKit/Manager');
}
};
DBus.proxifyPrototype(ConsoleKitManager.prototype, ConsoleKitManagerIface);

View File

@ -1,20 +1,26 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio; const DBus = imports.dbus;
const Lang = imports.lang; const Lang = imports.lang;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const Signals = imports.signals; const Signals = imports.signals;
const FprintManagerIface = <interface name='net.reactivated.Fprint.Manager'> const FprintManagerIface = {
<method name='GetDefaultDevice'> name: 'net.reactivated.Fprint.Manager',
<arg type='o' direction='out' /> methods: [{ name: 'GetDefaultDevice',
</method> inSignature: '',
</interface>; outSignature: 'o' }]
};
const FprintManagerProxy = Gio.DBusProxy.makeProxyWrapper(FprintManagerIface);
function FprintManager() { function FprintManager() {
return new FprintManagerProxy(Gio.DBus.system, this._init();
'net.reactivated.Fprint',
'/net/reactivated/Fprint/Manager');
}; };
FprintManager.prototype = {
_init: function() {
DBus.system.proxifyObject(this,
'net.reactivated.Fprint',
'/net/reactivated/Fprint/Manager');
}
};
DBus.proxifyPrototype(FprintManager.prototype, FprintManagerIface);

View File

@ -33,6 +33,7 @@ const St = imports.gi.St;
const GdmGreeter = imports.gi.GdmGreeter; const GdmGreeter = imports.gi.GdmGreeter;
const Batch = imports.gdm.batch; const Batch = imports.gdm.batch;
const DBus = imports.dbus;
const Fprint = imports.gdm.fingerprint; const Fprint = imports.gdm.fingerprint;
const Lightbox = imports.ui.lightbox; const Lightbox = imports.ui.lightbox;
const Main = imports.ui.main; const Main = imports.ui.main;
@ -140,9 +141,11 @@ function _smoothlyResizeActor(actor, width, height) {
return hold; return hold;
} }
const UserListItem = new Lang.Class({ function UserListItem(user, reason) {
Name: 'UserListItem', this._init(user, reason);
}
UserListItem.prototype = {
_init: function(user) { _init: function(user) {
this.user = user; this.user = user;
this._userChangedId = this.user.connect('changed', this._userChangedId = this.user.connect('changed',
@ -271,12 +274,15 @@ const UserListItem = new Lang.Class({
}); });
return hold; return hold;
} }
});
};
Signals.addSignalMethods(UserListItem.prototype); Signals.addSignalMethods(UserListItem.prototype);
const UserList = new Lang.Class({ function UserList() {
Name: 'UserList', this._init.apply(this, arguments);
}
UserList.prototype = {
_init: function() { _init: function() {
this.actor = new St.ScrollView({ style_class: 'login-dialog-user-list-view'}); this.actor = new St.ScrollView({ style_class: 'login-dialog-user-list-view'});
this.actor.set_policy(Gtk.PolicyType.NEVER, this.actor.set_policy(Gtk.PolicyType.NEVER,
@ -532,12 +538,14 @@ const UserList = new Lang.Class({
item.actor.destroy(); item.actor.destroy();
delete this._items[userName]; delete this._items[userName];
} }
}); };
Signals.addSignalMethods(UserList.prototype); Signals.addSignalMethods(UserList.prototype);
const SessionListItem = new Lang.Class({ function SessionListItem(id, name) {
Name: 'SessionListItem', this._init(id, name);
}
SessionListItem.prototype = {
_init: function(id, name) { _init: function(id, name) {
this.id = id; this.id = id;
@ -592,12 +600,14 @@ const SessionListItem = new Lang.Class({
_onClicked: function() { _onClicked: function() {
this.emit('activate'); this.emit('activate');
} }
}); };
Signals.addSignalMethods(SessionListItem.prototype); Signals.addSignalMethods(SessionListItem.prototype);
const SessionList = new Lang.Class({ function SessionList() {
Name: 'SessionList', this._init();
}
SessionList.prototype = {
_init: function() { _init: function() {
this.actor = new St.Bin(); this.actor = new St.Bin();
@ -728,15 +738,24 @@ const SessionList = new Lang.Class({
})); }));
} }
} }
}); };
Signals.addSignalMethods(SessionList.prototype); Signals.addSignalMethods(SessionList.prototype);
const LoginDialog = new Lang.Class({ function LoginDialog() {
Name: 'LoginDialog', if (_loginDialog == null) {
Extends: ModalDialog.ModalDialog, this._init();
_loginDialog = this;
}
return _loginDialog;
}
LoginDialog.prototype = {
__proto__: ModalDialog.ModalDialog.prototype,
_init: function() { _init: function() {
this.parent({ shellReactive: true, styleClass: 'login-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { shellReactive: true,
styleClass: 'login-dialog' });
this.connect('destroy', this.connect('destroy',
Lang.bind(this, this._onDestroy)); Lang.bind(this, this._onDestroy));
this.connect('opened', this.connect('opened',
@ -889,7 +908,7 @@ const LoginDialog = new Lang.Class({
if (!this._settings.get_boolean(_FINGERPRINT_AUTHENTICATION_KEY)) if (!this._settings.get_boolean(_FINGERPRINT_AUTHENTICATION_KEY))
return; return;
this._fprintManager.GetDefaultDeviceRemote(Gio.DBusCallFlags.NONE, Lang.bind(this, this._fprintManager.GetDefaultDeviceRemote(DBus.CALL_FLAG_START, Lang.bind(this,
function(device, error) { function(device, error) {
if (!error && device) if (!error && device)
this._haveFingerprintReader = true; this._haveFingerprintReader = true;
@ -1380,8 +1399,8 @@ const LoginDialog = new Lang.Class({
}, },
close: function() { close: function() {
this.parent(); ModalDialog.ModalDialog.prototype.close.call(this);
Main.ctrlAltTabManager.removeGroup(this._group); Main.ctrlAltTabManager.removeGroup(this._group);
} }
}); };

View File

@ -25,12 +25,15 @@ const ConsoleKit = imports.gdm.consoleKit;
const PanelMenu = imports.ui.panelMenu; const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu; const PopupMenu = imports.ui.popupMenu;
const PowerMenuButton = new Lang.Class({ function PowerMenuButton() {
Name: 'PowerMenuButton', this._init();
Extends: PanelMenu.SystemStatusButton, }
PowerMenuButton.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype,
_init: function() { _init: function() {
this.parent('system-shutdown', null); PanelMenu.SystemStatusButton.prototype._init.call(this, 'system-shutdown', null);
this._consoleKitManager = new ConsoleKit.ConsoleKitManager(); this._consoleKitManager = new ConsoleKit.ConsoleKitManager();
this._upClient = new UPowerGlib.Client(); this._upClient = new UPowerGlib.Client();
@ -140,4 +143,4 @@ const PowerMenuButton = new Lang.Class({
if (this._haveShutdown) if (this._haveShutdown)
this._consoleKitManager.StopRemote(); this._consoleKitManager.StopRemote();
} }
}); };

View File

@ -8,9 +8,11 @@ const Search = imports.ui.search;
const THUMBNAIL_ICON_MARGIN = 2; const THUMBNAIL_ICON_MARGIN = 2;
const DocInfo = new Lang.Class({ function DocInfo(recentInfo) {
Name: 'DocInfo', this._init(recentInfo);
}
DocInfo.prototype = {
_init : function(recentInfo) { _init : function(recentInfo) {
this.recentInfo = recentInfo; this.recentInfo = recentInfo;
// We actually used get_modified() instead of get_visited() // We actually used get_modified() instead of get_visited()
@ -47,7 +49,7 @@ const DocInfo = new Lang.Class({
} }
return mtype; return mtype;
} }
}); };
var docManagerInstance = null; var docManagerInstance = null;
@ -60,9 +62,11 @@ function getDocManager() {
/** /**
* DocManager wraps the DocSystem, primarily to expose DocInfo objects. * DocManager wraps the DocSystem, primarily to expose DocInfo objects.
*/ */
const DocManager = new Lang.Class({ function DocManager() {
Name: 'DocManager', this._init();
}
DocManager.prototype = {
_init: function() { _init: function() {
this._docSystem = Shell.DocSystem.get_default(); this._docSystem = Shell.DocSystem.get_default();
this._infosByTimestamp = []; this._infosByTimestamp = [];
@ -131,6 +135,6 @@ const DocManager = new Lang.Class({
return this._infosByUri[url]; return this._infosByUri[url];
})), terms); })), terms);
} }
}); };
Signals.addSignalMethods(DocManager.prototype); Signals.addSignalMethods(DocManager.prototype);

View File

@ -7,9 +7,11 @@ const Params = imports.misc.params;
const DEFAULT_LIMIT = 512; const DEFAULT_LIMIT = 512;
const HistoryManager = new Lang.Class({ function HistoryManager(params) {
Name: 'HistoryManager', this._init(params);
}
HistoryManager.prototype = {
_init: function(params) { _init: function(params) {
params = Params.parse(params, { gsettingsKey: null, params = Params.parse(params, { gsettingsKey: null,
limit: DEFAULT_LIMIT, limit: DEFAULT_LIMIT,
@ -109,5 +111,5 @@ const HistoryManager = new Lang.Class({
if (this._key) if (this._key)
global.settings.set_strv(this._key, this._history); global.settings.set_strv(this._key, this._history);
} }
}); };
Signals.addSignalMethods(HistoryManager.prototype); Signals.addSignalMethods(HistoryManager.prototype);

View File

@ -54,9 +54,11 @@ function _getProvidersTable() {
return _providersTable = providers; return _providersTable = providers;
} }
const ModemGsm = new Lang.Class({ function ModemGsm() {
Name: 'ModemGsm', this._init.apply(this, arguments);
}
ModemGsm.prototype = {
_init: function(path) { _init: function(path) {
this._proxy = new ModemGsmNetworkProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path); this._proxy = new ModemGsmNetworkProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
@ -154,12 +156,14 @@ const ModemGsm = new Lang.Class({
return name3 || name2 || null; return name3 || name2 || null;
} }
}); }
Signals.addSignalMethods(ModemGsm.prototype); Signals.addSignalMethods(ModemGsm.prototype);
const ModemCdma = new Lang.Class({ function ModemCdma() {
Name: 'ModemCdma', this._init.apply(this, arguments);
}
ModemCdma.prototype = {
_init: function(path) { _init: function(path) {
this._proxy = new ModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path); this._proxy = new ModemCdmaProxy(Gio.DBus.system, 'org.freedesktop.ModemManager', path);
@ -227,5 +231,5 @@ const ModemCdma = new Lang.Class({
return null; return null;
} }
}); };
Signals.addSignalMethods(ModemCdma.prototype); Signals.addSignalMethods(ModemCdma.prototype);

View File

@ -43,9 +43,11 @@ function primaryModifier(mask) {
return primary; return primary;
} }
const AltTabPopup = new Lang.Class({ function AltTabPopup() {
Name: 'AltTabPopup', this._init();
}
AltTabPopup.prototype = {
_init : function() { _init : function() {
this.actor = new Shell.GenericContainer({ name: 'altTabPopup', this.actor = new Shell.GenericContainer({ name: 'altTabPopup',
reactive: true, reactive: true,
@ -538,11 +540,13 @@ const AltTabPopup = new Lang.Class({
onComplete: Lang.bind(this, function () { this.thumbnailsVisible = true; }) onComplete: Lang.bind(this, function () { this.thumbnailsVisible = true; })
}); });
} }
}); };
const SwitcherList = new Lang.Class({ function SwitcherList(squareItems) {
Name: 'SwitcherList', this._init(squareItems);
}
SwitcherList.prototype = {
_init : function(squareItems) { _init : function(squareItems) {
this.actor = new Shell.GenericContainer({ style_class: 'switcher-list' }); this.actor = new Shell.GenericContainer({ style_class: 'switcher-list' });
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
@ -847,13 +851,15 @@ const SwitcherList = new Lang.Class({
// Clip the area for scrolling // Clip the area for scrolling
this._clipBin.set_clip(0, -topPadding, (this.actor.allocation.x2 - this.actor.allocation.x1) - leftPadding - rightPadding, this.actor.height + bottomPadding); this._clipBin.set_clip(0, -topPadding, (this.actor.allocation.x2 - this.actor.allocation.x1) - leftPadding - rightPadding, this.actor.height + bottomPadding);
} }
}); };
Signals.addSignalMethods(SwitcherList.prototype); Signals.addSignalMethods(SwitcherList.prototype);
const AppIcon = new Lang.Class({ function AppIcon(app) {
Name: 'AppIcon', this._init(app);
}
AppIcon.prototype = {
_init: function(app) { _init: function(app) {
this.app = app; this.app = app;
this.actor = new St.BoxLayout({ style_class: 'alt-tab-app', this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
@ -871,14 +877,17 @@ const AppIcon = new Lang.Class({
this._iconBin.set_size(size, size); this._iconBin.set_size(size, size);
this._iconBin.child = this.icon; this._iconBin.child = this.icon;
} }
}); };
const AppSwitcher = new Lang.Class({ function AppSwitcher() {
Name: 'AppSwitcher', this._init.apply(this, arguments);
Extends: SwitcherList, }
AppSwitcher.prototype = {
__proto__ : SwitcherList.prototype,
_init : function(localApps, otherApps, altTabPopup) { _init : function(localApps, otherApps, altTabPopup) {
this.parent(true); SwitcherList.prototype._init.call(this, true);
// Construct the AppIcons, add to the popup // Construct the AppIcons, add to the popup
let activeWorkspace = global.screen.get_active_workspace(); let activeWorkspace = global.screen.get_active_workspace();
@ -957,7 +966,7 @@ const AppSwitcher = new Lang.Class({
_allocate: function (actor, box, flags) { _allocate: function (actor, box, flags) {
// Allocate the main list items // Allocate the main list items
this.parent(actor, box, flags); SwitcherList.prototype._allocate.call(this, actor, box, flags);
let arrowHeight = Math.floor(this.actor.get_theme_node().get_padding(St.Side.BOTTOM) / 3); let arrowHeight = Math.floor(this.actor.get_theme_node().get_padding(St.Side.BOTTOM) / 3);
let arrowWidth = arrowHeight * 2; let arrowWidth = arrowHeight * 2;
@ -1012,7 +1021,7 @@ const AppSwitcher = new Lang.Class({
this._arrows[this._curApp].remove_style_pseudo_class('highlighted'); this._arrows[this._curApp].remove_style_pseudo_class('highlighted');
} }
this.parent(n, justOutline); SwitcherList.prototype.highlight.call(this, n, justOutline);
this._curApp = n; this._curApp = n;
if (this._curApp != -1) { if (this._curApp != -1) {
@ -1036,14 +1045,17 @@ const AppSwitcher = new Lang.Class({
if (appIcon.cachedWindows.length == 1) if (appIcon.cachedWindows.length == 1)
arrow.hide(); arrow.hide();
} }
}); };
const ThumbnailList = new Lang.Class({ function ThumbnailList(windows) {
Name: 'ThumbnailList', this._init(windows);
Extends: SwitcherList, }
ThumbnailList.prototype = {
__proto__ : SwitcherList.prototype,
_init : function(windows) { _init : function(windows) {
this.parent(false); SwitcherList.prototype._init.call(this);
let activeWorkspace = global.screen.get_active_workspace(); let activeWorkspace = global.screen.get_active_workspace();
@ -1121,7 +1133,7 @@ const ThumbnailList = new Lang.Class({
// Make sure we only do this once // Make sure we only do this once
this._thumbnailBins = new Array(); this._thumbnailBins = new Array();
} }
}); };
function _drawArrow(area, side) { function _drawArrow(area, side) {
let themeNode = area.get_theme_node(); let themeNode = area.get_theme_node();

View File

@ -26,9 +26,11 @@ const MAX_APPLICATION_WORK_MILLIS = 75;
const MENU_POPUP_TIMEOUT = 600; const MENU_POPUP_TIMEOUT = 600;
const SCROLL_TIME = 0.1; const SCROLL_TIME = 0.1;
const AlphabeticalView = new Lang.Class({ function AlphabeticalView() {
Name: 'AlphabeticalView', this._init();
}
AlphabeticalView.prototype = {
_init: function() { _init: function() {
this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START }); this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START });
this._appSystem = Shell.AppSystem.get_default(); this._appSystem = Shell.AppSystem.get_default();
@ -128,11 +130,13 @@ const AlphabeticalView = new Lang.Class({
this._addApp(app); this._addApp(app);
} }
} }
}); };
const ViewByCategories = new Lang.Class({ function ViewByCategories() {
Name: 'ViewByCategories', this._init();
}
ViewByCategories.prototype = {
_init: function() { _init: function() {
this._appSystem = Shell.AppSystem.get_default(); this._appSystem = Shell.AppSystem.get_default();
this.actor = new St.BoxLayout({ style_class: 'all-app' }); this.actor = new St.BoxLayout({ style_class: 'all-app' });
@ -277,14 +281,16 @@ const ViewByCategories = new Lang.Class({
this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
} }
} }
}); };
/* This class represents a display containing a collection of application items. /* This class represents a display containing a collection of application items.
* The applications are sorted based on their name. * The applications are sorted based on their name.
*/ */
const AllAppDisplay = new Lang.Class({ function AllAppDisplay() {
Name: 'AllAppDisplay', this._init();
}
AllAppDisplay.prototype = {
_init: function() { _init: function() {
this._appSystem = Shell.AppSystem.get_default(); this._appSystem = Shell.AppSystem.get_default();
this._appSystem.connect('installed-changed', Lang.bind(this, function() { this._appSystem.connect('installed-changed', Lang.bind(this, function() {
@ -300,15 +306,17 @@ const AllAppDisplay = new Lang.Class({
_redisplay: function() { _redisplay: function() {
this._appView.refresh(); this._appView.refresh();
} }
}); };
const AppSearchProvider = new Lang.Class({ function AppSearchProvider() {
Name: 'AppSearchProvider', this._init();
Extends: Search.SearchProvider, }
AppSearchProvider.prototype = {
__proto__: Search.SearchProvider.prototype,
_init: function() { _init: function() {
this.parent(_("APPLICATIONS")); Search.SearchProvider.prototype._init.call(this, _("APPLICATIONS"));
this._appSys = Shell.AppSystem.get_default(); this._appSys = Shell.AppSystem.get_default();
}, },
@ -356,15 +364,17 @@ const AppSearchProvider = new Lang.Class({
let icon = new AppWellIcon(app); let icon = new AppWellIcon(app);
return icon.actor; return icon.actor;
} }
}); };
const SettingsSearchProvider = new Lang.Class({ function SettingsSearchProvider() {
Name: 'SettingsSearchProvider', this._init();
Extends: Search.SearchProvider, }
SettingsSearchProvider.prototype = {
__proto__: Search.SearchProvider.prototype,
_init: function() { _init: function() {
this.parent(_("SETTINGS")); Search.SearchProvider.prototype._init.call(this, _("SETTINGS"));
this._appSys = Shell.AppSystem.get_default(); this._appSys = Shell.AppSystem.get_default();
this._gnomecc = this._appSys.lookup_app('gnome-control-center.desktop'); this._gnomecc = this._appSys.lookup_app('gnome-control-center.desktop');
}, },
@ -402,28 +412,35 @@ const SettingsSearchProvider = new Lang.Class({
let icon = new AppWellIcon(app); let icon = new AppWellIcon(app);
return icon.actor; return icon.actor;
} }
}); };
const AppIcon = new Lang.Class({ function AppIcon(app, params) {
Name: 'AppIcon', this._init(app, params);
Extends: IconGrid.BaseIcon, }
AppIcon.prototype = {
__proto__: IconGrid.BaseIcon.prototype,
_init : function(app, params) { _init : function(app, params) {
this.app = app; this.app = app;
let label = this.app.get_name(); let label = this.app.get_name();
this.parent(label, params); IconGrid.BaseIcon.prototype._init.call(this,
label,
params);
}, },
createIcon: function(iconSize) { createIcon: function(iconSize) {
return this.app.create_icon_texture(iconSize); return this.app.create_icon_texture(iconSize);
} }
}); };
const AppWellIcon = new Lang.Class({ function AppWellIcon(app, iconParams, onActivateOverride) {
Name: 'AppWellIcon', this._init(app, iconParams, onActivateOverride);
}
AppWellIcon.prototype = {
_init : function(app, iconParams, onActivateOverride) { _init : function(app, iconParams, onActivateOverride) {
this.app = app; this.app = app;
this.actor = new St.Button({ style_class: 'app-well-app', this.actor = new St.Button({ style_class: 'app-well-app',
@ -603,19 +620,22 @@ const AppWellIcon = new Lang.Class({
getDragActorSource: function() { getDragActorSource: function() {
return this.icon.icon; return this.icon.icon;
} }
}); };
Signals.addSignalMethods(AppWellIcon.prototype); Signals.addSignalMethods(AppWellIcon.prototype);
const AppIconMenu = new Lang.Class({ function AppIconMenu(source) {
Name: 'AppIconMenu', this._init(source);
Extends: PopupMenu.PopupMenu, }
AppIconMenu.prototype = {
__proto__: PopupMenu.PopupMenu.prototype,
_init: function(source) { _init: function(source) {
let side = St.Side.LEFT; let side = St.Side.LEFT;
if (St.Widget.get_default_direction() == St.TextDirection.RTL) if (St.Widget.get_default_direction() == St.TextDirection.RTL)
side = St.Side.RIGHT; side = St.Side.RIGHT;
this.parent(source.actor, 0.5, side); PopupMenu.PopupMenu.prototype._init.call(this, source.actor, 0.5, side);
// We want to keep the item hovered while the menu is up // We want to keep the item hovered while the menu is up
this.blockSourceEvents = true; this.blockSourceEvents = true;
@ -703,5 +723,5 @@ const AppIconMenu = new Lang.Class({
} }
this.close(); this.close();
} }
}); };
Signals.addSignalMethods(AppIconMenu.prototype); Signals.addSignalMethods(AppIconMenu.prototype);

View File

@ -6,9 +6,11 @@ const Signals = imports.signals;
const Main = imports.ui.main; const Main = imports.ui.main;
const AppFavorites = new Lang.Class({ function AppFavorites() {
Name: 'AppFavorites', this._init();
}
AppFavorites.prototype = {
FAVORITE_APPS_KEY: 'favorite-apps', FAVORITE_APPS_KEY: 'favorite-apps',
_init: function() { _init: function() {
@ -120,7 +122,7 @@ const AppFavorites = new Lang.Class({
this._addFavorite(appId, pos); this._addFavorite(appId, pos);
})); }));
} }
}); };
Signals.addSignalMethods(AppFavorites.prototype); Signals.addSignalMethods(AppFavorites.prototype);
var appFavoritesInstance = null; var appFavoritesInstance = null;

View File

@ -64,9 +64,11 @@ function ConsoleKitManager() {
return self; return self;
} }
const AutomountManager = new Lang.Class({ function AutomountManager() {
Name: 'AutomountManager', this._init();
}
AutomountManager.prototype = {
_init: function() { _init: function() {
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA }); this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
this._volumeQueue = []; this._volumeQueue = [];
@ -266,4 +268,4 @@ const AutomountManager = new Lang.Class({
return false; return false;
}); });
} }
}); }

View File

@ -75,9 +75,11 @@ function HotplugSniffer() {
'/org/gnome/Shell/HotplugSniffer'); '/org/gnome/Shell/HotplugSniffer');
} }
const ContentTypeDiscoverer = new Lang.Class({ function ContentTypeDiscoverer(callback) {
Name: 'ContentTypeDiscoverer', this._init(callback);
}
ContentTypeDiscoverer.prototype = {
_init: function(callback) { _init: function(callback) {
this._callback = callback; this._callback = callback;
}, },
@ -134,11 +136,13 @@ const ContentTypeDiscoverer = new Lang.Class({
this._callback(mount, apps, contentTypes); this._callback(mount, apps, contentTypes);
} }
}); }
const AutorunManager = new Lang.Class({ function AutorunManager() {
Name: 'AutorunManager', this._init();
}
AutorunManager.prototype = {
_init: function() { _init: function() {
this._volumeMonitor = Gio.VolumeMonitor.get(); this._volumeMonitor = Gio.VolumeMonitor.get();
@ -255,14 +259,17 @@ const AutorunManager = new Lang.Class({
+ ': ' + e.toString()); + ': ' + e.toString());
} }
}, },
}); }
const AutorunResidentSource = new Lang.Class({ function AutorunResidentSource() {
Name: 'AutorunResidentSource', this._init();
Extends: MessageTray.Source, }
AutorunResidentSource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function() { _init: function() {
this.parent(_("Removable Devices")); MessageTray.Source.prototype._init.call(this, _("Removable Devices"));
this._mounts = []; this._mounts = [];
@ -317,14 +324,19 @@ const AutorunResidentSource = new Lang.Class({
icon_type: St.IconType.FULLCOLOR, icon_type: St.IconType.FULLCOLOR,
icon_size: this.ICON_SIZE }); icon_size: this.ICON_SIZE });
} }
}); }
const AutorunResidentNotification = new Lang.Class({ function AutorunResidentNotification(source) {
Name: 'AutorunResidentNotification', this._init(source);
Extends: MessageTray.Notification, }
AutorunResidentNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source) { _init: function(source) {
this.parent(source, source.title, null, { customContent: true }); MessageTray.Notification.prototype._init.call(this, source,
source.title, null,
{ customContent: true });
// set the notification as resident // set the notification as resident
this.setResident(true); this.setResident(true);
@ -398,11 +410,13 @@ const AutorunResidentNotification = new Lang.Class({
return item; return item;
}, },
}); }
const AutorunTransientDispatcher = new Lang.Class({ function AutorunTransientDispatcher() {
Name: 'AutorunTransientDispatcher', this._init();
}
AutorunTransientDispatcher.prototype = {
_init: function() { _init: function() {
this._sources = []; this._sources = [];
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA }); this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
@ -493,14 +507,17 @@ const AutorunTransientDispatcher = new Lang.Class({
// destroy the notification source // destroy the notification source
source.destroy(); source.destroy();
} }
}); }
const AutorunTransientSource = new Lang.Class({ function AutorunTransientSource(mount, apps) {
Name: 'AutorunTransientSource', this._init(mount, apps);
Extends: MessageTray.Source, }
AutorunTransientSource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function(mount, apps) { _init: function(mount, apps) {
this.parent(mount.get_name()); MessageTray.Source.prototype._init.call(this, mount.get_name());
this.mount = mount; this.mount = mount;
this.apps = apps; this.apps = apps;
@ -517,14 +534,19 @@ const AutorunTransientSource = new Lang.Class({
return new St.Icon({ gicon: this.mount.get_icon(), return new St.Icon({ gicon: this.mount.get_icon(),
icon_size: this.ICON_SIZE }); icon_size: this.ICON_SIZE });
} }
}); }
const AutorunTransientNotification = new Lang.Class({ function AutorunTransientNotification(source) {
Name: 'AutorunTransientNotification', this._init(source);
Extends: MessageTray.Notification, }
AutorunTransientNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source) { _init: function(source) {
this.parent(source, source.title, null, { customContent: true }); MessageTray.Notification.prototype._init.call(this, source,
source.title, null,
{ customContent: true });
this._box = new St.BoxLayout({ style_class: 'hotplug-transient-box', this._box = new St.BoxLayout({ style_class: 'hotplug-transient-box',
vertical: true }); vertical: true });
@ -599,5 +621,5 @@ const AutorunTransientNotification = new Lang.Class({
return button; return button;
} }
}); }

View File

@ -21,9 +21,11 @@ const POPUP_ANIMATION_TIME = 0.15;
* placed. The arrow position may be controlled via setArrowOrigin(). * placed. The arrow position may be controlled via setArrowOrigin().
* *
*/ */
const BoxPointer = new Lang.Class({ function BoxPointer(side, binProperties) {
Name: 'BoxPointer', this._init(side, binProperties);
}
BoxPointer.prototype = {
_init: function(arrowSide, binProperties) { _init: function(arrowSide, binProperties) {
this._arrowSide = arrowSide; this._arrowSide = arrowSide;
this._arrowOrigin = 0; this._arrowOrigin = 0;
@ -450,4 +452,4 @@ const BoxPointer = new Lang.Class({
get opacity() { get opacity() {
return this.actor.opacity; return this.actor.opacity;
} }
}); };

View File

@ -155,24 +155,28 @@ function _getEventDayAbbreviation(dayNumber) {
// Abstraction for an appointment/event in a calendar // Abstraction for an appointment/event in a calendar
const CalendarEvent = new Lang.Class({ function CalendarEvent(date, end, summary, allDay) {
Name: 'CalendarEvent', this._init(date, end, summary, allDay);
}
CalendarEvent.prototype = {
_init: function(date, end, summary, allDay) { _init: function(date, end, summary, allDay) {
this.date = date; this.date = date;
this.end = end; this.end = end;
this.summary = summary; this.summary = summary;
this.allDay = allDay; this.allDay = allDay;
} }
}); };
// Interface for appointments/events - e.g. the contents of a calendar // Interface for appointments/events - e.g. the contents of a calendar
// //
// First, an implementation with no events // First, an implementation with no events
const EmptyEventSource = new Lang.Class({ function EmptyEventSource() {
Name: 'EmptyEventSource', this._init();
}
EmptyEventSource.prototype = {
_init: function() { _init: function() {
}, },
@ -187,7 +191,7 @@ const EmptyEventSource = new Lang.Class({
hasEvents: function(day) { hasEvents: function(day) {
return false; return false;
} }
}); };
Signals.addSignalMethods(EmptyEventSource.prototype); Signals.addSignalMethods(EmptyEventSource.prototype);
const CalendarServerIface = <interface name="org.gnome.Shell.CalendarServer"> const CalendarServerIface = <interface name="org.gnome.Shell.CalendarServer">
@ -215,6 +219,11 @@ function CalendarServer() {
return self; return self;
} }
// an implementation that reads data from a session bus service
function DBusEventSource() {
this._init();
}
function _datesEqual(a, b) { function _datesEqual(a, b) {
if (a < b) if (a < b)
return false; return false;
@ -233,10 +242,8 @@ function _dateIntervalsOverlap(a0, a1, b0, b1)
return true; return true;
} }
// an implementation that reads data from a session bus service
const DBusEventSource = new Lang.Class({
Name: 'DBusEventSource',
DBusEventSource.prototype = {
_init: function() { _init: function() {
this._resetCache(); this._resetCache();
@ -337,15 +344,17 @@ const DBusEventSource = new Lang.Class({
return true; return true;
} }
}); };
Signals.addSignalMethods(DBusEventSource.prototype); Signals.addSignalMethods(DBusEventSource.prototype);
// Calendar: // Calendar:
// @eventSource: is an object implementing the EventSource API, e.g. the // @eventSource: is an object implementing the EventSource API, e.g. the
// requestRange(), getEvents(), hasEvents() methods and the ::changed signal. // requestRange(), getEvents(), hasEvents() methods and the ::changed signal.
const Calendar = new Lang.Class({ function Calendar(eventSource) {
Name: 'Calendar', this._init(eventSource);
}
Calendar.prototype = {
_init: function(eventSource) { _init: function(eventSource) {
if (eventSource) { if (eventSource) {
this._eventSource = eventSource; this._eventSource = eventSource;
@ -611,13 +620,15 @@ const Calendar = new Lang.Class({
if (this._eventSource) if (this._eventSource)
this._eventSource.requestRange(beginDate, iter, forceReload); this._eventSource.requestRange(beginDate, iter, forceReload);
} }
}); };
Signals.addSignalMethods(Calendar.prototype); Signals.addSignalMethods(Calendar.prototype);
const EventsList = new Lang.Class({ function EventsList(eventSource) {
Name: 'EventsList', this._init(eventSource);
}
EventsList.prototype = {
_init: function(eventSource) { _init: function(eventSource) {
this.actor = new St.BoxLayout({ vertical: true, style_class: 'events-header-vbox'}); this.actor = new St.BoxLayout({ vertical: true, style_class: 'events-header-vbox'});
this._date = new Date(); this._date = new Date();
@ -748,4 +759,4 @@ const EventsList = new Lang.Class({
this._showOtherDay(this._date); this._showOtherDay(this._date);
} }
} }
}); };

View File

@ -20,9 +20,11 @@ function launchContact(id) {
/* This class represents a shown contact search result in the overview */ /* This class represents a shown contact search result in the overview */
const Contact = new Lang.Class({ function Contact(id) {
Name: 'Contact', this._init(id);
}
Contact.prototype = {
_init: function(id) { _init: function(id) {
this._contactSys = Shell.ContactSystem.get_default(); this._contactSys = Shell.ContactSystem.get_default();
this.individual = this._contactSys.get_individual(id); this.individual = this._contactSys.get_individual(id);
@ -129,16 +131,19 @@ const Contact = new Lang.Class({
return tc.load_icon_name(null, 'avatar-default', St.IconType.FULLCOLOR, size); return tc.load_icon_name(null, 'avatar-default', St.IconType.FULLCOLOR, size);
} }
}, },
}); };
/* Searches for and returns contacts */ /* Searches for and returns contacts */
const ContactSearchProvider = new Lang.Class({ function ContactSearchProvider() {
Name: 'ContactSearchProvider', this._init();
Extends: Search.SearchProvider, }
ContactSearchProvider.prototype = {
__proto__: Search.SearchProvider.prototype,
_init: function() { _init: function() {
this.parent(_("CONTACTS")); Search.SearchProvider.prototype._init.call(this, _("CONTACTS"));
this._contactSys = Shell.ContactSystem.get_default(); this._contactSys = Shell.ContactSystem.get_default();
}, },
@ -177,4 +182,4 @@ const ContactSearchProvider = new Lang.Class({
activateResult: function(id, params) { activateResult: function(id, params) {
launchContact(id); launchContact(id);
} }
}); };

View File

@ -22,9 +22,11 @@ const SortGroup = {
BOTTOM: 2 BOTTOM: 2
}; };
const CtrlAltTabManager = new Lang.Class({ function CtrlAltTabManager() {
Name: 'CtrlAltTabManager', this._init();
}
CtrlAltTabManager.prototype = {
_init: function() { _init: function() {
this._items = []; this._items = [];
this._focusManager = St.FocusManager.get_for_stage(global.stage); this._focusManager = St.FocusManager.get_for_stage(global.stage);
@ -132,15 +134,17 @@ const CtrlAltTabManager = new Lang.Class({
})); }));
} }
} }
}); };
function mod(a, b) { function mod(a, b) {
return (a + b) % b; return (a + b) % b;
} }
const CtrlAltTabPopup = new Lang.Class({ function CtrlAltTabPopup() {
Name: 'CtrlAltTabPopup', this._init();
}
CtrlAltTabPopup.prototype = {
_init : function() { _init : function() {
this.actor = new Shell.GenericContainer({ name: 'ctrlAltTabPopup', this.actor = new Shell.GenericContainer({ name: 'ctrlAltTabPopup',
reactive: true }); reactive: true });
@ -299,14 +303,17 @@ const CtrlAltTabPopup = new Lang.Class({
this._selection = num; this._selection = num;
this._switcher.highlight(num); this._switcher.highlight(num);
} }
}); };
const CtrlAltTabSwitcher = new Lang.Class({ function CtrlAltTabSwitcher(items) {
Name: 'CtrlAltTabSwitcher', this._init(items);
Extends: AltTab.SwitcherList, }
CtrlAltTabSwitcher.prototype = {
__proto__ : AltTab.SwitcherList.prototype,
_init : function(items) { _init : function(items) {
this.parent(true); AltTab.SwitcherList.prototype._init.call(this, true);
for (let i = 0; i < items.length; i++) for (let i = 0; i < items.length; i++)
this._addIcon(items[i]); this._addIcon(items[i]);
@ -329,4 +336,4 @@ const CtrlAltTabSwitcher = new Lang.Class({
this.addItem(box, text); this.addItem(box, text);
} }
}); };

View File

@ -19,9 +19,11 @@ const DASH_ANIMATION_TIME = 0.2;
// A container like StBin, but taking the child's scale into account // A container like StBin, but taking the child's scale into account
// when requesting a size // when requesting a size
const DashItemContainer = new Lang.Class({ function DashItemContainer() {
Name: 'DashItemContainer', this._init();
}
DashItemContainer.prototype = {
_init: function() { _init: function() {
this.actor = new Shell.GenericContainer({ style_class: 'dash-item-container' }); this.actor = new Shell.GenericContainer({ style_class: 'dash-item-container' });
this.actor.connect('get-preferred-width', this.actor.connect('get-preferred-width',
@ -155,14 +157,17 @@ const DashItemContainer = new Lang.Class({
get childOpacity() { get childOpacity() {
return this._childOpacity; return this._childOpacity;
} }
}); };
const RemoveFavoriteIcon = new Lang.Class({ function RemoveFavoriteIcon() {
Name: 'RemoveFavoriteIcon', this._init();
Extends: DashItemContainer, }
RemoveFavoriteIcon.prototype = {
__proto__: DashItemContainer.prototype,
_init: function() { _init: function() {
this.parent(); DashItemContainer.prototype._init.call(this);
this._iconBin = new St.Bin({ style_class: 'remove-favorite' }); this._iconBin = new St.Bin({ style_class: 'remove-favorite' });
this._iconActor = null; this._iconActor = null;
@ -214,21 +219,28 @@ const RemoveFavoriteIcon = new Lang.Class({
return true; return true;
} }
}); };
const DragPlaceholderItem = new Lang.Class({
Name: 'DragPlaceholderItem', function DragPlaceholderItem() {
Extends: DashItemContainer, this._init();
}
DragPlaceholderItem.prototype = {
__proto__: DashItemContainer.prototype,
_init: function() { _init: function() {
this.parent(); DashItemContainer.prototype._init.call(this);
this.setChild(new St.Bin({ style_class: 'placeholder' })); this.setChild(new St.Bin({ style_class: 'placeholder' }));
} }
}); };
const Dash = new Lang.Class({
Name: 'Dash',
function Dash() {
this._init();
}
Dash.prototype = {
_init : function() { _init : function() {
this._maxHeight = -1; this._maxHeight = -1;
this.iconSize = 64; this.iconSize = 64;
@ -750,6 +762,6 @@ const Dash = new Lang.Class({
return true; return true;
} }
}); };
Signals.addSignalMethods(Dash.prototype); Signals.addSignalMethods(Dash.prototype);

View File

@ -40,9 +40,12 @@ function _onVertSepRepaint (area)
cr.stroke(); cr.stroke();
}; };
const DateMenuButton = new Lang.Class({ function DateMenuButton() {
Name: 'DateMenuButton', this._init.apply(this, arguments);
Extends: PanelMenu.Button, }
DateMenuButton.prototype = {
__proto__: PanelMenu.Button.prototype,
_init: function(params) { _init: function(params) {
params = Params.parse(params, { showEvents: true }); params = Params.parse(params, { showEvents: true });
@ -54,7 +57,7 @@ const DateMenuButton = new Lang.Class({
let menuAlignment = 0.25; let menuAlignment = 0.25;
if (St.Widget.get_default_direction() == St.TextDirection.RTL) if (St.Widget.get_default_direction() == St.TextDirection.RTL)
menuAlignment = 1.0 - menuAlignment; menuAlignment = 1.0 - menuAlignment;
this.parent(menuAlignment); PanelMenu.Button.prototype._init.call(this, menuAlignment);
this._clock = new St.Label(); this._clock = new St.Label();
this.actor.add_actor(this._clock); this.actor.add_actor(this._clock);
@ -236,4 +239,4 @@ const DateMenuButton = new Lang.Class({
} }
} }
} }
}); };

View File

@ -69,9 +69,11 @@ function removeDragMonitor(monitor) {
} }
} }
const _Draggable = new Lang.Class({ function _Draggable(actor, params) {
Name: 'Draggable', this._init(actor, params);
}
_Draggable.prototype = {
_init : function(actor, params) { _init : function(actor, params) {
params = Params.parse(params, { manualMode: false, params = Params.parse(params, { manualMode: false,
restoreOnSuccess: false, restoreOnSuccess: false,
@ -594,7 +596,7 @@ const _Draggable = new Lang.Class({
this._dragActor = undefined; this._dragActor = undefined;
currentDraggable = null; currentDraggable = null;
} }
}); };
Signals.addSignalMethods(_Draggable.prototype); Signals.addSignalMethods(_Draggable.prototype);

View File

@ -1,16 +1,19 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const DocInfo = imports.misc.docInfo; const DocInfo = imports.misc.docInfo;
const Lang = imports.lang;
const Params = imports.misc.params; const Params = imports.misc.params;
const Search = imports.ui.search; const Search = imports.ui.search;
const DocSearchProvider = new Lang.Class({
Name: 'DocSearchProvider', function DocSearchProvider() {
Extends: Search.SearchProvider, this._init();
}
DocSearchProvider.prototype = {
__proto__: Search.SearchProvider.prototype,
_init: function(name) { _init: function(name) {
this.parent(_("RECENT ITEMS")); Search.SearchProvider.prototype._init.call(this, _("RECENT ITEMS"));
this._docManager = DocInfo.getDocManager(); this._docManager = DocInfo.getDocManager();
}, },
@ -41,4 +44,4 @@ const DocSearchProvider = new Lang.Class({
getSubsearchResultSet: function(previousResults, terms) { getSubsearchResultSet: function(previousResults, terms) {
return this._docManager.subsearch(previousResults, terms); return this._docManager.subsearch(previousResults, terms);
} }
}); };

View File

@ -142,9 +142,11 @@ function findAppFromInhibitor(inhibitor) {
return app; return app;
} }
const ListItem = new Lang.Class({ function ListItem(app, reason) {
Name: 'ListItem', this._init(app, reason);
}
ListItem.prototype = {
_init: function(app, reason) { _init: function(app, reason) {
this._app = app; this._app = app;
this._reason = reason; this._reason = reason;
@ -190,7 +192,7 @@ const ListItem = new Lang.Class({
this.emit('activate'); this.emit('activate');
this._app.activate(); this._app.activate();
} }
}); };
Signals.addSignalMethods(ListItem.prototype); Signals.addSignalMethods(ListItem.prototype);
// The logout timer only shows updates every 10 seconds // The logout timer only shows updates every 10 seconds
@ -228,19 +230,27 @@ function _setLabelText(label, text) {
} }
} }
function EndSessionDialog() {
if (_endSessionDialog == null) {
this._init();
_endSessionDialog = this;
}
return _endSessionDialog;
}
function init() { function init() {
// This always returns the same singleton object // This always returns the same singleton object
// By instantiating it initially, we register the // By instantiating it initially, we register the
// bus object, etc. // bus object, etc.
_endSessionDialog = new EndSessionDialog(); let dialog = new EndSessionDialog();
} }
const EndSessionDialog = new Lang.Class({ EndSessionDialog.prototype = {
Name: 'EndSessionDialog', __proto__: ModalDialog.ModalDialog.prototype,
Extends: ModalDialog.ModalDialog,
_init: function() { _init: function() {
this.parent({ styleClass: 'end-session-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'end-session-dialog' });
this._user = AccountsService.UserManager.get_default().get_user(GLib.get_user_name()); this._user = AccountsService.UserManager.get_default().get_user(GLib.get_user_name());
@ -431,7 +441,7 @@ const EndSessionDialog = new Lang.Class({
}, },
close: function() { close: function() {
this.parent(); ModalDialog.ModalDialog.prototype.close.call(this);
this._dbusImpl.emit_signal('Closed', null); this._dbusImpl.emit_signal('Closed', null);
}, },
@ -533,4 +543,4 @@ const EndSessionDialog = new Lang.Class({
this.disconnect(signalId); this.disconnect(signalId);
})); }));
} }
}); };

View File

@ -502,12 +502,15 @@ function loadExtensions() {
_loadExtensionsIn(userExtensionsDir, ExtensionType.PER_USER); _loadExtensionsIn(userExtensionsDir, ExtensionType.PER_USER);
} }
const InstallExtensionDialog = new Lang.Class({ function InstallExtensionDialog(uuid, version_tag, name) {
Name: 'InstallExtensionDialog', this._init(uuid, version_tag, name);
Extends: ModalDialog.ModalDialog, }
InstallExtensionDialog.prototype = {
__proto__: ModalDialog.ModalDialog.prototype,
_init: function(uuid, version_tag, name) { _init: function(uuid, version_tag, name) {
this.parent({ styleClass: 'extension-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'extension-dialog' });
this._uuid = uuid; this._uuid = uuid;
this._version_tag = version_tag; this._version_tag = version_tag;
@ -567,4 +570,4 @@ const InstallExtensionDialog = new Lang.Class({
this.close(global.get_current_time()); this.close(global.get_current_time());
} }
}); };

View File

@ -10,9 +10,11 @@ const Params = imports.misc.params;
const ICON_SIZE = 48; const ICON_SIZE = 48;
const BaseIcon = new Lang.Class({ function BaseIcon(label, createIcon) {
Name: 'BaseIcon', this._init(label, createIcon);
}
BaseIcon.prototype = {
_init : function(label, params) { _init : function(label, params) {
params = Params.parse(params, { createIcon: null, params = Params.parse(params, { createIcon: null,
setSizeManually: false, setSizeManually: false,
@ -147,11 +149,13 @@ const BaseIcon = new Lang.Class({
this._createIconTexture(size); this._createIconTexture(size);
} }
}); };
const IconGrid = new Lang.Class({ function IconGrid(params) {
Name: 'IconGrid', this._init(params);
}
IconGrid.prototype = {
_init: function(params) { _init: function(params) {
params = Params.parse(params, { rowLimit: null, params = Params.parse(params, { rowLimit: null,
columnLimit: null, columnLimit: null,
@ -320,4 +324,4 @@ const IconGrid = new Lang.Class({
visibleItemsCount: function() { visibleItemsCount: function() {
return this._grid.get_children().length - this._grid.get_n_skip_paint(); return this._grid.get_children().length - this._grid.get_n_skip_paint();
} }
}); };

View File

@ -39,31 +39,34 @@ const PRETTY_KEYS = {
'Alt_L': 'Alt' 'Alt_L': 'Alt'
}; };
const CaribouKeyboardIface = <interface name='org.gnome.Caribou.Keyboard'> const CaribouKeyboardIface = {
<method name='Show'> name: 'org.gnome.Caribou.Keyboard',
<arg type='u' direction='in' /> methods: [ { name: 'Show',
</method> inSignature: 'u',
<method name='Hide'> outSignature: ''
<arg type='u' direction='in' /> },
</method> { name: 'Hide',
<method name='SetCursorLocation'> inSignature: 'u',
<arg type='i' direction='in' /> outSignature: ''
<arg type='i' direction='in' /> },
<arg type='i' direction='in' /> { name: 'SetCursorLocation',
<arg type='i' direction='in' /> inSignature: 'iiii',
</method> outSignature: ''
<method name='SetEntryLocation'> },
<arg type='i' direction='in' /> { name: 'SetEntryLocation',
<arg type='i' direction='in' /> inSignature: 'iiii',
<arg type='i' direction='in' /> outSignature: ''
<arg type='i' direction='in' /> } ],
</method> properties: [ { name: 'Name',
<property name='Name' access='read' type='s' /> signature: 's',
</interface>; access: 'read' } ]
};
const Key = new Lang.Class({ function Key() {
Name: 'Key', this._init.apply(this, arguments);
}
Key.prototype = {
_init : function(key) { _init : function(key) {
this._key = key; this._key = key;
@ -189,15 +192,15 @@ const Key = new Lang.Class({
this._boxPointer.hide(true); this._boxPointer.hide(true);
} }
} }
}); };
const Keyboard = new Lang.Class({ function Keyboard() {
// HACK: we can't set Name, because it collides with Name dbus property this._init.apply(this, arguments);
// Name: 'Keyboard', }
Keyboard.prototype = {
_init: function () { _init: function () {
this._impl = Gio.DBusExportedObject.wrapJSObject(CaribouKeyboardIface, this); DBus.session.exportObject('/org/gnome/Caribou/Keyboard', this);
this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard');
this.actor = null; this.actor = null;
@ -529,15 +532,19 @@ const Keyboard = new Lang.Class({
get Name() { get Name() {
return 'gnome-shell'; return 'gnome-shell';
} }
}); };
DBus.conformExport(Keyboard.prototype, CaribouKeyboardIface);
const KeyboardSource = new Lang.Class({ function KeyboardSource() {
Name: 'KeyboardSource', this._init.apply(this, arguments);
Extends: MessageTray.Source, }
KeyboardSource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function(keyboard) { _init: function(keyboard) {
this.parent(_("Keyboard"));
this._keyboard = keyboard; this._keyboard = keyboard;
MessageTray.Source.prototype._init.call(this, _("Keyboard"));
this._setSummaryIcon(this.createNotificationIcon()); this._setSummaryIcon(this.createNotificationIcon());
}, },
@ -548,7 +555,7 @@ const KeyboardSource = new Lang.Class({
icon_size: this.ICON_SIZE }); icon_size: this.ICON_SIZE });
}, },
handleSummaryClick: function() { handleSummaryClick: function() {
let event = Clutter.get_current_event(); let event = Clutter.get_current_event();
if (event.type() != Clutter.EventType.BUTTON_RELEASE) if (event.type() != Clutter.EventType.BUTTON_RELEASE)
return false; return false;
@ -560,4 +567,4 @@ const KeyboardSource = new Lang.Class({
open: function() { open: function() {
this._keyboard.show(); this._keyboard.show();
} }
}); };

View File

@ -17,9 +17,11 @@ const HOT_CORNER_ACTIVATION_TIMEOUT = 0.5;
const STARTUP_ANIMATION_TIME = 0.2; const STARTUP_ANIMATION_TIME = 0.2;
const KEYBOARD_ANIMATION_TIME = 0.5; const KEYBOARD_ANIMATION_TIME = 0.5;
const LayoutManager = new Lang.Class({ function LayoutManager() {
Name: 'LayoutManager', this._init.apply(this, arguments);
}
LayoutManager.prototype = {
_init: function () { _init: function () {
this._rtl = (St.Widget.get_default_direction() == St.TextDirection.RTL); this._rtl = (St.Widget.get_default_direction() == St.TextDirection.RTL);
this.monitors = []; this.monitors = [];
@ -372,7 +374,7 @@ const LayoutManager = new Lang.Class({
findMonitorForActor: function(actor) { findMonitorForActor: function(actor) {
return this._chrome.findMonitorForActor(actor); return this._chrome.findMonitorForActor(actor);
} }
}); };
Signals.addSignalMethods(LayoutManager.prototype); Signals.addSignalMethods(LayoutManager.prototype);
@ -380,9 +382,11 @@ Signals.addSignalMethods(LayoutManager.prototype);
// //
// This class manages a "hot corner" that can toggle switching to // This class manages a "hot corner" that can toggle switching to
// overview. // overview.
const HotCorner = new Lang.Class({ function HotCorner() {
Name: 'HotCorner', this._init();
}
HotCorner.prototype = {
_init : function() { _init : function() {
// We use this flag to mark the case where the user has entered the // We use this flag to mark the case where the user has entered the
// hot corner and has not left both the hot corner and a surrounding // hot corner and has not left both the hot corner and a surrounding
@ -544,7 +548,7 @@ const HotCorner = new Lang.Class({
return true; return true;
return false; return false;
} }
}); };
// This manages the shell "chrome"; the UI that's visible in the // This manages the shell "chrome"; the UI that's visible in the
@ -557,9 +561,11 @@ const defaultParams = {
affectsInputRegion: true affectsInputRegion: true
}; };
const Chrome = new Lang.Class({ function Chrome() {
Name: 'Chrome', this._init.apply(this, arguments);
}
Chrome.prototype = {
_init: function(layoutManager) { _init: function(layoutManager) {
this._layoutManager = layoutManager; this._layoutManager = layoutManager;
@ -975,4 +981,4 @@ const Chrome = new Lang.Class({
return false; return false;
} }
}); };

View File

@ -30,9 +30,11 @@ const Tweener = imports.ui.tweener;
* @container and will track any changes in its size. You can override * @container and will track any changes in its size. You can override
* this by passing an explicit width and height in @params. * this by passing an explicit width and height in @params.
*/ */
const Lightbox = new Lang.Class({ function Lightbox(container, params) {
Name: 'Lightbox', this._init(container, params);
}
Lightbox.prototype = {
_init : function(container, params) { _init : function(container, params) {
params = Params.parse(params, { inhibitEvents: false, params = Params.parse(params, { inhibitEvents: false,
width: null, width: null,
@ -194,4 +196,4 @@ const Lightbox = new Lang.Class({
this.highlight(null); this.highlight(null);
} }
}); };

View File

@ -4,9 +4,11 @@ const Lang = imports.lang;
const Signals = imports.signals; const Signals = imports.signals;
const St = imports.gi.St; const St = imports.gi.St;
const Link = new Lang.Class({ function Link(props) {
Name: 'Link', this._init(props);
}
Link.prototype = {
_init : function(props) { _init : function(props) {
let realProps = { reactive: true, let realProps = { reactive: true,
track_hover: true, track_hover: true,
@ -17,5 +19,6 @@ const Link = new Lang.Class({
this.actor = new St.Button(realProps); this.actor = new St.Button(realProps);
} }
}); };
Signals.addSignalMethods(Link.prototype); Signals.addSignalMethods(Link.prototype);

View File

@ -55,9 +55,11 @@ function _getAutoCompleteGlobalKeywords() {
return keywords.concat(windowProperties).concat(headerProperties); return keywords.concat(windowProperties).concat(headerProperties);
} }
const AutoComplete = new Lang.Class({ function AutoComplete(entry) {
Name: 'AutoComplete', this._init(entry);
}
AutoComplete.prototype = {
_init: function(entry) { _init: function(entry) {
this._entry = entry; this._entry = entry;
this._entry.connect('key-press-event', Lang.bind(this, this._entryKeyPressEvent)); this._entry.connect('key-press-event', Lang.bind(this, this._entryKeyPressEvent));
@ -116,13 +118,15 @@ const AutoComplete = new Lang.Class({
this._entry.clutter_text.insert_text(additionalCompletionText, cursorPos); this._entry.clutter_text.insert_text(additionalCompletionText, cursorPos);
} }
}); };
Signals.addSignalMethods(AutoComplete.prototype); Signals.addSignalMethods(AutoComplete.prototype);
const Notebook = new Lang.Class({ function Notebook() {
Name: 'Notebook', this._init();
}
Notebook.prototype = {
_init: function() { _init: function() {
this.actor = new St.BoxLayout({ vertical: true }); this.actor = new St.BoxLayout({ vertical: true });
@ -246,7 +250,7 @@ const Notebook = new Lang.Class({
this.selectIndex(prevIndex); this.selectIndex(prevIndex);
} }
}); };
Signals.addSignalMethods(Notebook.prototype); Signals.addSignalMethods(Notebook.prototype);
function objectToString(o) { function objectToString(o) {
@ -258,9 +262,12 @@ function objectToString(o) {
} }
} }
const ObjLink = new Lang.Class({ function ObjLink(o, title) {
Name: 'ObjLink', this._init(o, title);
Extends: Link.Link, }
ObjLink.prototype = {
__proto__: Link.Link,
_init: function(o, title) { _init: function(o, title) {
let text; let text;
@ -270,8 +277,7 @@ const ObjLink = new Lang.Class({
text = objectToString(o); text = objectToString(o);
text = GLib.markup_escape_text(text, -1); text = GLib.markup_escape_text(text, -1);
this._obj = o; this._obj = o;
Link.Link.prototype._init.call(this, { label: text });
this.parent({ label: text });
this.actor.get_child().single_line_mode = true; this.actor.get_child().single_line_mode = true;
this.actor.connect('clicked', Lang.bind(this, this._onClicked)); this.actor.connect('clicked', Lang.bind(this, this._onClicked));
}, },
@ -279,11 +285,13 @@ const ObjLink = new Lang.Class({
_onClicked: function (link) { _onClicked: function (link) {
Main.lookingGlass.inspectObject(this._obj, this.actor); Main.lookingGlass.inspectObject(this._obj, this.actor);
} }
}); };
const Result = new Lang.Class({ function Result(command, o, index) {
Name: 'Result', this._init(command, o, index);
}
Result.prototype = {
_init : function(command, o, index) { _init : function(command, o, index) {
this.index = index; this.index = index;
this.o = o; this.o = o;
@ -305,11 +313,13 @@ const Result = new Lang.Class({
padBin.add_actor(line); padBin.add_actor(line);
this.actor.add(padBin); this.actor.add(padBin);
} }
}); };
const WindowList = new Lang.Class({ function WindowList() {
Name: 'WindowList', this._init();
}
WindowList.prototype = {
_init : function () { _init : function () {
this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' }); this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
@ -350,12 +360,14 @@ const WindowList = new Lang.Class({
} }
} }
} }
}); };
Signals.addSignalMethods(WindowList.prototype); Signals.addSignalMethods(WindowList.prototype);
const ObjInspector = new Lang.Class({ function ObjInspector() {
Name: 'ObjInspector', this._init();
}
ObjInspector.prototype = {
_init : function () { _init : function () {
this._obj = null; this._obj = null;
this._previousObj = null; this._previousObj = null;
@ -455,7 +467,7 @@ const ObjInspector = new Lang.Class({
_onBack: function() { _onBack: function() {
this.selectObject(this._previousObj, true); this.selectObject(this._previousObj, true);
} }
}); };
function addBorderPaintHook(actor) { function addBorderPaintHook(actor) {
let signalId = actor.connect_after('paint', let signalId = actor.connect_after('paint',
@ -481,9 +493,11 @@ function addBorderPaintHook(actor) {
return signalId; return signalId;
} }
const Inspector = new Lang.Class({ function Inspector() {
Name: 'Inspector', this._init();
}
Inspector.prototype = {
_init: function() { _init: function() {
let container = new Shell.GenericContainer({ width: 0, let container = new Shell.GenericContainer({ width: 0,
height: 0 }); height: 0 });
@ -622,13 +636,15 @@ const Inspector = new Lang.Class({
this._borderPaintId = addBorderPaintHook(this._target); this._borderPaintId = addBorderPaintHook(this._target);
} }
} }
}); };
Signals.addSignalMethods(Inspector.prototype); Signals.addSignalMethods(Inspector.prototype);
const ErrorLog = new Lang.Class({ function ErrorLog() {
Name: 'ErrorLog', this._init();
}
ErrorLog.prototype = {
_init: function() { _init: function() {
this.actor = new St.BoxLayout(); this.actor = new St.BoxLayout();
this.text = new St.Label(); this.text = new St.Label();
@ -663,11 +679,13 @@ const ErrorLog = new Lang.Class({
} }
this.text.text = text; this.text.text = text;
} }
}); };
const Memory = new Lang.Class({ function Memory() {
Name: 'Memory', this._init();
}
Memory.prototype = {
_init: function() { _init: function() {
this.actor = new St.BoxLayout({ vertical: true }); this.actor = new St.BoxLayout({ vertical: true });
this._glibc_uordblks = new St.Label(); this._glibc_uordblks = new St.Label();
@ -712,11 +730,13 @@ const Memory = new Lang.Class({
this._gjs_closure.text = 'gjs_closure: ' + memInfo.gjs_closure; this._gjs_closure.text = 'gjs_closure: ' + memInfo.gjs_closure;
this._last_gc_seconds_ago.text = 'last_gc_seconds_ago: ' + memInfo.last_gc_seconds_ago; this._last_gc_seconds_ago.text = 'last_gc_seconds_ago: ' + memInfo.last_gc_seconds_ago;
} }
}); };
const Extensions = new Lang.Class({ function Extensions() {
Name: 'Extensions', this._init();
}
Extensions.prototype = {
_init: function() { _init: function() {
this.actor = new St.BoxLayout({ vertical: true, this.actor = new St.BoxLayout({ vertical: true,
name: 'lookingGlassExtensions' }); name: 'lookingGlassExtensions' });
@ -846,11 +866,13 @@ const Extensions = new Lang.Class({
return box; return box;
} }
}); };
const LookingGlass = new Lang.Class({ function LookingGlass() {
Name: 'LookingGlass', this._init();
}
LookingGlass.prototype = {
_init : function() { _init : function() {
this._borderPaintTarget = null; this._borderPaintTarget = null;
this._borderPaintId = 0; this._borderPaintId = 0;
@ -867,8 +889,7 @@ const LookingGlass = new Lang.Class({
this.actor = new St.BoxLayout({ name: 'LookingGlassDialog', this.actor = new St.BoxLayout({ name: 'LookingGlassDialog',
style_class: 'lg-dialog', style_class: 'lg-dialog',
vertical: true, vertical: true,
visible: false, visible: false });
reactive: true });
this.actor.connect('key-press-event', Lang.bind(this, this._globalKeyPressEvent)); this.actor.connect('key-press-event', Lang.bind(this, this._globalKeyPressEvent));
this._interfaceSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' }); this._interfaceSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' });
@ -1207,5 +1228,5 @@ const LookingGlass = new Lang.Class({
}) })
}); });
} }
}); };
Signals.addSignalMethods(LookingGlass.prototype); Signals.addSignalMethods(LookingGlass.prototype);

View File

@ -36,9 +36,11 @@ const CROSS_HAIRS_CLIP_KEY = 'cross-hairs-clip';
let magDBusService = null; let magDBusService = null;
const Magnifier = new Lang.Class({ function Magnifier() {
Name: 'Magnifier', this._init();
}
Magnifier.prototype = {
_init: function() { _init: function() {
// Magnifier is a manager of ZoomRegions. // Magnifier is a manager of ZoomRegions.
this._zoomRegions = []; this._zoomRegions = [];
@ -541,12 +543,14 @@ const Magnifier = new Lang.Class({
); );
} }
} }
}); };
Signals.addSignalMethods(Magnifier.prototype); Signals.addSignalMethods(Magnifier.prototype);
const ZoomRegion = new Lang.Class({ function ZoomRegion(magnifier, mouseSourceActor) {
Name: 'ZoomRegion', this._init(magnifier, mouseSourceActor);
}
ZoomRegion.prototype = {
_init: function(magnifier, mouseSourceActor) { _init: function(magnifier, mouseSourceActor) {
this._magnifier = magnifier; this._magnifier = magnifier;
@ -1146,11 +1150,13 @@ const ZoomRegion = new Lang.Class({
yMagMouse - groupHeight / 2); yMagMouse - groupHeight / 2);
} }
} }
}); };
const Crosshairs = new Lang.Class({ function Crosshairs() {
Name: 'Crosshairs', this._init();
}
Crosshairs.prototype = {
_init: function() { _init: function() {
// Set the group containing the crosshairs to three times the desktop // Set the group containing the crosshairs to three times the desktop
@ -1406,4 +1412,4 @@ const Crosshairs = new Lang.Class({
this._vertTopHair.set_position((groupWidth - thickness) / 2, top); this._vertTopHair.set_position((groupWidth - thickness) / 2, top);
this._vertBottomHair.set_position((groupWidth - thickness) / 2, bottom); this._vertBottomHair.set_position((groupWidth - thickness) / 2, bottom);
} }
}); };

View File

@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const Lang = imports.lang; const GLib = imports.gi.GLib;
const Main = imports.ui.main; const Main = imports.ui.main;
const MAG_SERVICE_NAME = 'org.gnome.Magnifier'; const MAG_SERVICE_NAME = 'org.gnome.Magnifier';
@ -96,9 +96,11 @@ const ZoomRegionIface = <interface name={ZOOM_SERVICE_NAME}>
// '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc. // '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc.
let _zoomRegionInstanceCount = 0; let _zoomRegionInstanceCount = 0;
const ShellMagnifier = new Lang.Class({ function ShellMagnifier() {
Name: 'ShellMagnifier', this._init();
}
ShellMagnifier.prototype = {
_init: function() { _init: function() {
this._zoomers = {}; this._zoomers = {};
@ -324,7 +326,7 @@ const ShellMagnifier = new Lang.Class({
// Drop the leading '#'. // Drop the leading '#'.
return parseInt(colorString.slice(1), 16); return parseInt(colorString.slice(1), 16);
} }
}); };
/** /**
* ShellMagnifierZoomRegion: * ShellMagnifierZoomRegion:
@ -332,9 +334,11 @@ const ShellMagnifier = new Lang.Class({
* @zoomerObjectPath: String that is the path to a DBus ZoomRegion. * @zoomerObjectPath: String that is the path to a DBus ZoomRegion.
* @zoomRegion: The actual zoom region associated with the object path. * @zoomRegion: The actual zoom region associated with the object path.
*/ */
const ShellMagnifierZoomRegion = new Lang.Class({ function ShellMagnifierZoomRegion(zoomerObjectPath, zoomRegion) {
Name: 'ShellMagnifierZoomRegion', this._init(zoomerObjectPath, zoomRegion);
}
ShellMagnifierZoomRegion.prototype = {
_init: function(zoomerObjectPath, zoomRegion) { _init: function(zoomerObjectPath, zoomRegion) {
this._zoomRegion = zoomRegion; this._zoomRegion = zoomRegion;
@ -419,4 +423,4 @@ const ShellMagnifierZoomRegion = new Lang.Class({
destroy: function() { destroy: function() {
this._dbusImpl.unexport(); this._dbusImpl.unexport();
} }
}); };

View File

@ -132,11 +132,15 @@ function _initUserSession() {
ExtensionSystem.init(); ExtensionSystem.init();
ExtensionSystem.loadExtensions(); ExtensionSystem.loadExtensions();
Meta.keybindings_set_custom_handler('panel-run-dialog', function() { let shellwm = global.window_manager;
shellwm.takeover_keybinding('panel-run-dialog');
shellwm.connect('keybinding::panel-run-dialog', function () {
getRunDialog().open(); getRunDialog().open();
}); });
Meta.keybindings_set_custom_handler('panel-main-menu', function () { shellwm.takeover_keybinding('panel-main-menu');
shellwm.connect('keybinding::panel-main-menu', function () {
overview.toggle(); overview.toggle();
}); });

View File

@ -83,9 +83,11 @@ function _fixMarkup(text, allowMarkup) {
return GLib.markup_escape_text(text, -1); return GLib.markup_escape_text(text, -1);
} }
const URLHighlighter = new Lang.Class({ function URLHighlighter(text, lineWrap, allowMarkup) {
Name: 'URLHighlighter', this._init(text, lineWrap, allowMarkup);
}
URLHighlighter.prototype = {
_init: function(text, lineWrap, allowMarkup) { _init: function(text, lineWrap, allowMarkup) {
if (!text) if (!text)
text = ''; text = '';
@ -209,11 +211,13 @@ const URLHighlighter = new Lang.Class({
} }
return -1; return -1;
} }
}); };
const FocusGrabber = new Lang.Class({ function FocusGrabber() {
Name: 'FocusGrabber', this._init();
}
FocusGrabber.prototype = {
_init: function() { _init: function() {
this.actor = null; this.actor = null;
@ -347,7 +351,7 @@ const FocusGrabber = new Lang.Class({
this._togglingFocusGrabMode = false; this._togglingFocusGrabMode = false;
} }
} }
}); }
Signals.addSignalMethods(FocusGrabber.prototype); Signals.addSignalMethods(FocusGrabber.prototype);
// Notification: // Notification:
@ -404,9 +408,11 @@ Signals.addSignalMethods(FocusGrabber.prototype);
// the content and the action area of the notification will be cleared. // the content and the action area of the notification will be cleared.
// The content area is also always cleared if 'customContent' is false // The content area is also always cleared if 'customContent' is false
// because it might contain the @banner that didn't fit in the banner mode. // because it might contain the @banner that didn't fit in the banner mode.
const Notification = new Lang.Class({ function Notification(source, title, banner, params) {
Name: 'Notification', this._init(source, title, banner, params);
}
Notification.prototype = {
IMAGE_SIZE: 125, IMAGE_SIZE: 125,
_init: function(source, title, banner, params) { _init: function(source, title, banner, params) {
@ -947,12 +953,14 @@ const Notification = new Lang.Class({
this.actor.destroy(); this.actor.destroy();
this.actor._delegate = null; this.actor._delegate = null;
} }
}); };
Signals.addSignalMethods(Notification.prototype); Signals.addSignalMethods(Notification.prototype);
const Source = new Lang.Class({ function Source(title) {
Name: 'MessageTraySource', this._init(title);
}
Source.prototype = {
ICON_SIZE: 24, ICON_SIZE: 24,
_init: function(title) { _init: function(title) {
@ -1134,12 +1142,14 @@ const Source = new Lang.Class({
_lastNotificationRemoved: function() { _lastNotificationRemoved: function() {
this.destroy(); this.destroy();
} }
}); };
Signals.addSignalMethods(Source.prototype); Signals.addSignalMethods(Source.prototype);
const SummaryItem = new Lang.Class({ function SummaryItem(source) {
Name: 'SummaryItem', this._init(source);
}
SummaryItem.prototype = {
_init: function(source) { _init: function(source) {
this.source = source; this.source = source;
this.source.connect('notification-added', Lang.bind(this, this._notificationAddedToSource)); this.source.connect('notification-added', Lang.bind(this, this._notificationAddedToSource));
@ -1330,12 +1340,14 @@ const SummaryItem = new Lang.Class({
if (this.notificationStack.get_children().length > 0) if (this.notificationStack.get_children().length > 0)
this.notificationStack.get_children()[0]._delegate.setIconVisible(true); this.notificationStack.get_children()[0]._delegate.setIconVisible(true);
} }
}); };
Signals.addSignalMethods(SummaryItem.prototype); Signals.addSignalMethods(SummaryItem.prototype);
const MessageTray = new Lang.Class({ function MessageTray() {
Name: 'MessageTray', this._init();
}
MessageTray.prototype = {
_init: function() { _init: function() {
this._presence = new GnomeSession.Presence(Lang.bind(this, function(proxy, error) { this._presence = new GnomeSession.Presence(Lang.bind(this, function(proxy, error) {
this._onStatusChanged(proxy.status); this._onStatusChanged(proxy.status);
@ -2414,14 +2426,17 @@ const MessageTray = new Lang.Class({
if (this._clickedSummaryItem) if (this._clickedSummaryItem)
this._updateState(); this._updateState();
} }
}); };
const SystemNotificationSource = new Lang.Class({ function SystemNotificationSource() {
Name: 'SystemNotificationSource', this._init();
Extends: Source, }
SystemNotificationSource.prototype = {
__proto__: Source.prototype,
_init: function() { _init: function() {
this.parent(_("System Information")); Source.prototype._init.call(this, _("System Information"));
this._setSummaryIcon(this.createNotificationIcon()); this._setSummaryIcon(this.createNotificationIcon());
}, },
@ -2435,4 +2450,4 @@ const SystemNotificationSource = new Lang.Class({
open: function() { open: function() {
this.destroy(); this.destroy();
} }
}); };

View File

@ -29,9 +29,11 @@ const State = {
FADED_OUT: 4 FADED_OUT: 4
}; };
const ModalDialog = new Lang.Class({ function ModalDialog() {
Name: 'ModalDialog', this._init();
}
ModalDialog.prototype = {
_init: function(params) { _init: function(params) {
params = Params.parse(params, { shellReactive: false, params = Params.parse(params, { shellReactive: false,
styleClass: null }); styleClass: null });
@ -301,5 +303,5 @@ const ModalDialog = new Lang.Class({
}) })
}); });
} }
}); };
Signals.addSignalMethods(ModalDialog.prototype); Signals.addSignalMethods(ModalDialog.prototype);

View File

@ -32,12 +32,15 @@ const ModalDialog = imports.ui.modalDialog;
const PopupMenu = imports.ui.popupMenu; const PopupMenu = imports.ui.popupMenu;
const ShellEntry = imports.ui.shellEntry; const ShellEntry = imports.ui.shellEntry;
const NetworkSecretDialog = new Lang.Class({ function NetworkSecretDialog() {
Name: 'NetworkSecretDialog', this._init.apply(this, arguments);
Extends: ModalDialog.ModalDialog, }
NetworkSecretDialog.prototype = {
__proto__: ModalDialog.ModalDialog.prototype,
_init: function(agent, requestId, connection, settingName, hints) { _init: function(agent, requestId, connection, settingName, hints) {
this.parent({ styleClass: 'polkit-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'polkit-dialog' });
this._agent = agent; this._agent = agent;
this._requestId = requestId; this._requestId = requestId;
@ -355,11 +358,13 @@ const NetworkSecretDialog = new Lang.Class({
return content; return content;
} }
}); };
const NetworkAgent = new Lang.Class({ function NetworkAgent() {
Name: 'NetworkAgent', this._init.apply(this, arguments);
}
NetworkAgent.prototype = {
_init: function() { _init: function() {
this._native = new Shell.NetworkAgent({ auto_register: true, this._native = new Shell.NetworkAgent({ auto_register: true,
identifier: 'org.gnome.Shell.NetworkAgent' }); identifier: 'org.gnome.Shell.NetworkAgent' });
@ -382,4 +387,4 @@ const NetworkAgent = new Lang.Class({
this._dialogs[requestId].close(global.get_current_time()); this._dialogs[requestId].close(global.get_current_time());
this._dialogs[requestId].destroy(); this._dialogs[requestId].destroy();
} }
}); };

View File

@ -87,9 +87,11 @@ const rewriteRules = {
] ]
}; };
const NotificationDaemon = new Lang.Class({ function NotificationDaemon() {
Name: 'NotificationDaemon', this._init();
}
NotificationDaemon.prototype = {
_init: function() { _init: function() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(NotificationDaemonIface, this); this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(NotificationDaemonIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications'); this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/Notifications');
@ -472,14 +474,17 @@ const NotificationDaemon = new Lang.Class({
if (source) if (source)
source.destroy(); source.destroy();
} }
}); };
const Source = new Lang.Class({ function Source(title, pid, sender) {
Name: 'NotificationDaemonSource', this._init(title, pid, sender);
Extends: MessageTray.Source, }
Source.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function(title, pid, sender) { _init: function(title, pid, sender) {
this.parent(title); MessageTray.Source.prototype._init.call(this, title);
this._pid = pid; this._pid = pid;
if (sender) if (sender)
@ -601,6 +606,6 @@ const Source = new Lang.Class({
this._nameWatcherId = 0; this._nameWatcherId = 0;
} }
this.parent(); MessageTray.Source.prototype.destroy.call(this);
} }
}); };

View File

@ -46,9 +46,11 @@ const SwipeScrollResult = {
CLICK: 2 CLICK: 2
}; };
const ShellInfo = new Lang.Class({ function ShellInfo() {
Name: 'ShellInfo', this._init();
}
ShellInfo.prototype = {
_init: function() { _init: function() {
this._source = null; this._source = null;
this._undoCallback = null; this._undoCallback = null;
@ -93,11 +95,13 @@ const ShellInfo = new Lang.Class({
this._source.notify(notification); this._source.notify(notification);
} }
}); };
const Overview = new Lang.Class({ function Overview() {
Name: 'Overview', this._init.apply(this, arguments);
}
Overview.prototype = {
_init : function(params) { _init : function(params) {
params = Params.parse(params, { isDummy: false }); params = Params.parse(params, { isDummy: false });
@ -807,5 +811,5 @@ const Overview = new Lang.Class({
this._needsFakePointerEvent = false; this._needsFakePointerEvent = false;
} }
} }
}); };
Signals.addSignalMethods(Overview.prototype); Signals.addSignalMethods(Overview.prototype);

View File

@ -3,7 +3,6 @@
const Cairo = imports.cairo; const Cairo = imports.cairo;
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Pango = imports.gi.Pango; const Pango = imports.gi.Pango;
@ -99,9 +98,11 @@ function _unpremultiply(color) {
}; };
const AnimatedIcon = new Lang.Class({ function AnimatedIcon(name, size) {
Name: 'AnimatedIcon', this._init(name, size);
}
AnimatedIcon.prototype = {
_init: function(name, size) { _init: function(name, size) {
this.actor = new St.Bin({ visible: false }); this.actor = new St.Bin({ visible: false });
this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
@ -138,11 +139,13 @@ const AnimatedIcon = new Lang.Class({
if (this._timeoutId) if (this._timeoutId)
Mainloop.source_remove(this._timeoutId); Mainloop.source_remove(this._timeoutId);
} }
}); };
const TextShadower = new Lang.Class({ function TextShadower() {
Name: 'TextShadower', this._init();
}
TextShadower.prototype = {
_init: function() { _init: function() {
this.actor = new Shell.GenericContainer(); this.actor = new Shell.GenericContainer();
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
@ -222,7 +225,7 @@ const TextShadower = new Lang.Class({
child.allocate(childBox, flags); child.allocate(childBox, flags);
} }
} }
}); };
/** /**
* AppMenuButton: * AppMenuButton:
@ -232,16 +235,17 @@ const TextShadower = new Lang.Class({
* this menu also handles startup notification for it. So when we * this menu also handles startup notification for it. So when we
* have an active startup notification, we switch modes to display that. * have an active startup notification, we switch modes to display that.
*/ */
const AppMenuButton = new Lang.Class({ function AppMenuButton() {
Name: 'AppMenuButton', this._init();
Extends: PanelMenu.Button, }
_init: function(menuManager) { AppMenuButton.prototype = {
this.parent(0.0, true); __proto__: PanelMenu.Button.prototype,
_init: function() {
PanelMenu.Button.prototype._init.call(this, 0.0);
this._startingApps = []; this._startingApps = [];
this._menuManager = menuManager;
this._targetApp = null; this._targetApp = null;
let bin = new St.Bin({ name: 'appMenu' }); let bin = new St.Bin({ name: 'appMenu' });
@ -267,6 +271,10 @@ const AppMenuButton = new Lang.Class({
this._iconBottomClip = 0; this._iconBottomClip = 0;
this._quitMenu = new PopupMenu.PopupMenuItem('');
this.menu.addMenuItem(this._quitMenu);
this._quitMenu.connect('activate', Lang.bind(this, this._onQuit));
this._visible = !Main.overview.visible; this._visible = !Main.overview.visible;
if (!this._visible) if (!this._visible)
this.actor.hide(); this.actor.hide();
@ -445,6 +453,12 @@ const AppMenuButton = new Lang.Class({
} }
}, },
_onQuit: function() {
if (this._targetApp == null)
return;
this._targetApp.request_quit();
},
_onAppStateChanged: function(appSys, app) { _onAppStateChanged: function(appSys, app) {
let state = app.state; let state = app.state;
if (state != Shell.AppState.STARTING) { if (state != Shell.AppState.STARTING) {
@ -506,10 +520,8 @@ const AppMenuButton = new Lang.Class({
} }
if (targetApp == this._targetApp) { if (targetApp == this._targetApp) {
if (targetApp && targetApp.get_state() != Shell.AppState.STARTING) { if (targetApp && targetApp.get_state() != Shell.AppState.STARTING)
this.stopAnimation(); this.stopAnimation();
this._maybeSetMenu();
}
return; return;
} }
@ -523,54 +535,33 @@ const AppMenuButton = new Lang.Class({
let icon = targetApp.get_faded_icon(2 * PANEL_ICON_SIZE); let icon = targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
this._label.setText(targetApp.get_name()); this._label.setText(targetApp.get_name());
// TODO - _quit() doesn't really work on apps in state STARTING yet
this._quitMenu.label.set_text(_("Quit %s").format(targetApp.get_name()));
this._iconBox.set_child(icon); this._iconBox.set_child(icon);
this._iconBox.show(); this._iconBox.show();
if (targetApp.get_state() == Shell.AppState.STARTING) if (targetApp.get_state() == Shell.AppState.STARTING)
this.startAnimation(); this.startAnimation();
else
this._maybeSetMenu();
this.emit('changed'); this.emit('changed');
},
_maybeSetMenu: function() {
let menu;
if (this._targetApp.action_group) {
if (this.menu instanceof PopupMenu.RemoteMenu &&
this.menu.actionGroup == this._targetApp.action_group)
return;
menu = new PopupMenu.RemoteMenu(this.actor, this._targetApp.menu, this._targetApp.action_group);
} else {
if (this.menu && !(this.menu instanceof PopupMenu.RemoteMenu))
return;
// fallback to older menu
menu = new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.TOP, 0);
menu.addAction(_("Quit"), Lang.bind(this, function() {
this._targetApp.request_quit();
}));
}
this.setMenu(menu);
this._menuManager.addMenu(menu);
} }
}); };
Signals.addSignalMethods(AppMenuButton.prototype); Signals.addSignalMethods(AppMenuButton.prototype);
// Activities button. Because everything else in the top bar is a // Activities button. Because everything else in the top bar is a
// PanelMenu.Button, it simplifies some things to make this be one too. // PanelMenu.Button, it simplifies some things to make this be one too.
// We just hack it up to not actually have a menu attached to it. // We just hack it up to not actually have a menu attached to it.
const ActivitiesButton = new Lang.Class({ function ActivitiesButton() {
Name: 'ActivitiesButton', this._init.apply(this, arguments);
Extends: PanelMenu.Button, }
ActivitiesButton.prototype = {
__proto__: PanelMenu.Button.prototype,
_init: function() { _init: function() {
this.parent(0.0); PanelMenu.Button.prototype._init.call(this, 0.0);
let container = new Shell.GenericContainer(); let container = new Shell.GenericContainer();
container.connect('get-preferred-width', Lang.bind(this, this._containerGetPreferredWidth)); container.connect('get-preferred-width', Lang.bind(this, this._containerGetPreferredWidth));
@ -707,11 +698,13 @@ const ActivitiesButton = new Lang.Class({
Mainloop.source_remove(this._xdndTimeOut); Mainloop.source_remove(this._xdndTimeOut);
this._xdndTimeOut = 0; this._xdndTimeOut = 0;
} }
}); };
const PanelCorner = new Lang.Class({ function PanelCorner(panel, side) {
Name: 'PanelCorner', this._init(panel, side);
}
PanelCorner.prototype = {
_init: function(box, side) { _init: function(box, side) {
this._side = side; this._side = side;
@ -887,12 +880,14 @@ const PanelCorner = new Lang.Class({
this.actor.set_size(cornerRadius, innerBorderWidth + cornerRadius); this.actor.set_size(cornerRadius, innerBorderWidth + cornerRadius);
this.actor.set_anchor_point(0, innerBorderWidth); this.actor.set_anchor_point(0, innerBorderWidth);
} }
}); };
const Panel = new Lang.Class({ function Panel() {
Name: 'Panel', this._init();
}
Panel.prototype = {
_init : function() { _init : function() {
this.actor = new Shell.GenericContainer({ name: 'panel', this.actor = new Shell.GenericContainer({ name: 'panel',
reactive: true }); reactive: true });
@ -943,8 +938,9 @@ const Panel = new Lang.Class({
// more cleanly with the rest of the panel // more cleanly with the rest of the panel
this._menus.addMenu(this._activitiesButton.menu); this._menus.addMenu(this._activitiesButton.menu);
this._appMenu = new AppMenuButton(this._menus); this._appMenu = new AppMenuButton();
this._leftBox.add(this._appMenu.actor); this._leftBox.add(this._appMenu.actor);
this._menus.addMenu(this._appMenu.menu);
} }
/* center */ /* center */
@ -1118,4 +1114,5 @@ const Panel = new Lang.Class({
if (box && box._delegate instanceof PanelMenu.ButtonBox) if (box && box._delegate instanceof PanelMenu.ButtonBox)
box.destroy(); box.destroy();
}, },
});
};

View File

@ -11,9 +11,11 @@ const Main = imports.ui.main;
const Params = imports.misc.params; const Params = imports.misc.params;
const PopupMenu = imports.ui.popupMenu; const PopupMenu = imports.ui.popupMenu;
const ButtonBox = new Lang.Class({ function ButtonBox(params) {
Name: 'ButtonBox', this._init.apply(this, arguments);
};
ButtonBox.prototype = {
_init: function(params) { _init: function(params) {
params = Params.parse(params, { style_class: 'panel-button' }, true); params = Params.parse(params, { style_class: 'panel-button' }, true);
this.actor = new Shell.GenericContainer(params); this.actor = new Shell.GenericContainer(params);
@ -90,45 +92,31 @@ const ButtonBox = new Lang.Class({
child.allocate(childBox, flags); child.allocate(childBox, flags);
}, },
}); }
const Button = new Lang.Class({ function Button(menuAlignment) {
Name: 'PanelMenuButton', this._init(menuAlignment);
Extends: ButtonBox, }
_init: function(menuAlignment, dontCreateMenu) { Button.prototype = {
this.parent({ reactive: true, __proto__: ButtonBox.prototype,
can_focus: true,
track_hover: true }); _init: function(menuAlignment) {
ButtonBox.prototype._init.call(this, { reactive: true,
can_focus: true,
track_hover: true });
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
this.actor.connect('key-press-event', Lang.bind(this, this._onSourceKeyPress)); this.actor.connect('key-press-event', Lang.bind(this, this._onSourceKeyPress));
this.menu = new PopupMenu.PopupMenu(this.actor, menuAlignment, St.Side.TOP);
if (dontCreateMenu) this.menu.actor.add_style_class_name('panel-menu');
this.menu = null; this.menu.connect('open-state-changed', Lang.bind(this, this._onOpenStateChanged));
else this.menu.actor.connect('key-press-event', Lang.bind(this, this._onMenuKeyPress));
this.setMenu(new PopupMenu.PopupMenu(this.actor, menuAlignment, St.Side.TOP, 0)); Main.uiGroup.add_actor(this.menu.actor);
}, this.menu.actor.hide();
setMenu: function(menu) {
if (this.menu)
this.menu.destroy();
this.menu = menu;
if (this.menu) {
this.menu.actor.add_style_class_name('panel-menu');
this.menu.connect('open-state-changed', Lang.bind(this, this._onOpenStateChanged));
this.menu.actor.connect('key-press-event', Lang.bind(this, this._onMenuKeyPress));
Main.uiGroup.add_actor(this.menu.actor);
this.menu.actor.hide();
}
}, },
_onButtonPress: function(actor, event) { _onButtonPress: function(actor, event) {
if (!this.menu)
return;
if (!this.menu.isOpen) { if (!this.menu.isOpen) {
// Setting the max-height won't do any good if the minimum height of the // Setting the max-height won't do any good if the minimum height of the
// menu is higher then the screen; it's useful if part of the menu is // menu is higher then the screen; it's useful if part of the menu is
@ -142,9 +130,6 @@ const Button = new Lang.Class({
}, },
_onSourceKeyPress: function(actor, event) { _onSourceKeyPress: function(actor, event) {
if (!this.menu)
return false;
let symbol = event.get_key_symbol(); let symbol = event.get_key_symbol();
if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) { if (symbol == Clutter.KEY_space || symbol == Clutter.KEY_Return) {
this.menu.toggle(); this.menu.toggle();
@ -190,7 +175,7 @@ const Button = new Lang.Class({
this.emit('destroy'); this.emit('destroy');
} }
}); };
Signals.addSignalMethods(Button.prototype); Signals.addSignalMethods(Button.prototype);
/* SystemStatusButton: /* SystemStatusButton:
@ -199,13 +184,15 @@ Signals.addSignalMethods(Button.prototype);
* volume, bluetooth...), which is just a PanelMenuButton with an * volume, bluetooth...), which is just a PanelMenuButton with an
* icon and a tooltip * icon and a tooltip
*/ */
const SystemStatusButton = new Lang.Class({ function SystemStatusButton() {
Name: 'SystemStatusButton', this._init.apply(this, arguments);
Extends: Button, }
SystemStatusButton.prototype = {
__proto__: Button.prototype,
_init: function(iconName,tooltipText) { _init: function(iconName,tooltipText) {
this.parent(0.0); Button.prototype._init.call(this, 0.0);
this._iconActor = new St.Icon({ icon_name: iconName, this._iconActor = new St.Icon({ icon_name: iconName,
icon_type: St.IconType.SYMBOLIC, icon_type: St.IconType.SYMBOLIC,
style_class: 'system-status-icon' }); style_class: 'system-status-icon' });
@ -232,4 +219,4 @@ const SystemStatusButton = new Lang.Class({
this.tooltip = null; this.tooltip = null;
} }
} }
}); };

View File

@ -22,9 +22,11 @@ const Util = imports.misc.util;
* @iconFactory: A JavaScript callback which will create an icon texture given a size parameter * @iconFactory: A JavaScript callback which will create an icon texture given a size parameter
* @launch: A JavaScript callback to launch the entry * @launch: A JavaScript callback to launch the entry
*/ */
const PlaceInfo = new Lang.Class({ function PlaceInfo(id, name, iconFactory, launch) {
Name: 'PlaceInfo', this._init(id, name, iconFactory, launch);
}
PlaceInfo.prototype = {
_init: function(id, name, iconFactory, launch) { _init: function(id, name, iconFactory, launch) {
this.id = id; this.id = id;
this.name = name; this.name = name;
@ -53,7 +55,7 @@ const PlaceInfo = new Lang.Class({
isRemovable: function() { isRemovable: function() {
return false; return false;
} }
}); };
// Helper function to translate launch parameters into a GAppLaunchContext // Helper function to translate launch parameters into a GAppLaunchContext
function _makeLaunchContext(params) function _makeLaunchContext(params)
@ -70,9 +72,12 @@ function _makeLaunchContext(params)
return launchContext; return launchContext;
} }
const PlaceDeviceInfo = new Lang.Class({ function PlaceDeviceInfo(mount) {
Name: 'PlaceDeviceInfo', this._init(mount);
Extends: PlaceInfo, }
PlaceDeviceInfo.prototype = {
__proto__: PlaceInfo.prototype,
_init: function(mount) { _init: function(mount) {
this._mount = mount; this._mount = mount;
@ -118,11 +123,13 @@ const PlaceDeviceInfo = new Lang.Class({
_("Retry")); _("Retry"));
} }
} }
}); };
const PlacesManager = new Lang.Class({ function PlacesManager() {
Name: 'PlacesManager', this._init();
}
PlacesManager.prototype = {
_init: function() { _init: function() {
this._defaultPlaces = []; this._defaultPlaces = [];
this._mounts = []; this._mounts = [];
@ -353,15 +360,19 @@ const PlacesManager = new Lang.Class({
_removeById: function(sourceArray, id) { _removeById: function(sourceArray, id) {
sourceArray.splice(this._lookupIndexById(sourceArray, id), 1); sourceArray.splice(this._lookupIndexById(sourceArray, id), 1);
} }
}); };
Signals.addSignalMethods(PlacesManager.prototype); Signals.addSignalMethods(PlacesManager.prototype);
const PlaceSearchProvider = new Lang.Class({
Name: 'PlaceSearchProvider', function PlaceSearchProvider() {
Extends: Search.SearchProvider, this._init();
}
PlaceSearchProvider.prototype = {
__proto__: Search.SearchProvider.prototype,
_init: function() { _init: function() {
this.parent(_("PLACES & DEVICES")); Search.SearchProvider.prototype._init.call(this, _("PLACES & DEVICES"));
}, },
getResultMeta: function(resultId) { getResultMeta: function(resultId) {
@ -423,4 +434,4 @@ const PlaceSearchProvider = new Lang.Class({
let places = previousResults.map(function (id) { return Main.placesManager.lookupPlaceById(id); }); let places = previousResults.map(function (id) { return Main.placesManager.lookupPlaceById(id); });
return this._searchPlaces(places, terms); return this._searchPlaces(places, terms);
} }
}); };

View File

@ -27,7 +27,6 @@ const AccountsService = imports.gi.AccountsService;
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const St = imports.gi.St; const St = imports.gi.St;
const Pango = imports.gi.Pango; const Pango = imports.gi.Pango;
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Polkit = imports.gi.Polkit; const Polkit = imports.gi.Polkit;
@ -36,12 +35,15 @@ const PolkitAgent = imports.gi.PolkitAgent;
const ModalDialog = imports.ui.modalDialog; const ModalDialog = imports.ui.modalDialog;
const ShellEntry = imports.ui.shellEntry; const ShellEntry = imports.ui.shellEntry;
const AuthenticationDialog = new Lang.Class({ function AuthenticationDialog(actionId, message, cookie, userNames) {
Name: 'AuthenticationDialog', this._init(actionId, message, cookie, userNames);
Extends: ModalDialog.ModalDialog, }
AuthenticationDialog.prototype = {
__proto__: ModalDialog.ModalDialog.prototype,
_init: function(actionId, message, cookie, userNames) { _init: function(actionId, message, cookie, userNames) {
this.parent({ styleClass: 'polkit-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'polkit-dialog' });
this.actionId = actionId; this.actionId = actionId;
this.message = message; this.message = message;
@ -86,14 +88,10 @@ const AuthenticationDialog = new Lang.Class({
if (userNames.length > 1) { if (userNames.length > 1) {
log('polkitAuthenticationAgent: Received ' + userNames.length + log('polkitAuthenticationAgent: Received ' + userNames.length +
' identities that can be used for authentication. Only ' + ' identities that can be used for authentication. Only ' +
'considering one.'); 'considering the first one.');
} }
let userName = GLib.get_user_name(); let userName = userNames[0];
if (userNames.indexOf(userName) < 0)
userName = 'root';
if (userNames.indexOf(userName) < 0)
userName = userNames[0];
this._user = AccountsService.UserManager.get_default().get_user(userName); this._user = AccountsService.UserManager.get_default().get_user(userName);
let userRealName = this._user.get_real_name() let userRealName = this._user.get_real_name()
@ -332,12 +330,15 @@ const AuthenticationDialog = new Lang.Class({
this.close(global.get_current_time()); this.close(global.get_current_time());
this._emitDone(false, true); this._emitDone(false, true);
}, },
});
};
Signals.addSignalMethods(AuthenticationDialog.prototype); Signals.addSignalMethods(AuthenticationDialog.prototype);
const AuthenticationAgent = new Lang.Class({ function AuthenticationAgent() {
Name: 'AuthenticationAgent', this._init();
}
AuthenticationAgent.prototype = {
_init: function() { _init: function() {
this._native = new Shell.PolkitAuthenticationAgent(); this._native = new Shell.PolkitAuthenticationAgent();
this._native.connect('initiate', Lang.bind(this, this._onInitiate)); this._native.connect('initiate', Lang.bind(this, this._onInitiate));
@ -398,7 +399,7 @@ const AuthenticationAgent = new Lang.Class({
this._reallyCompleteRequest(wasDismissed); this._reallyCompleteRequest(wasDismissed);
} }
} }
}); }
function init() { function init() {
let agent = new AuthenticationAgent(); let agent = new AuthenticationAgent();

View File

@ -2,9 +2,7 @@
const Cairo = imports.cairo; const Cairo = imports.cairo;
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk; const Gtk = imports.gi.Gtk;
const Gio = imports.gi.Gio;
const Lang = imports.lang; const Lang = imports.lang;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const Signals = imports.signals; const Signals = imports.signals;
@ -28,9 +26,11 @@ function _ensureStyle(actor) {
actor.ensure_style(); actor.ensure_style();
} }
const PopupBaseMenuItem = new Lang.Class({ function PopupBaseMenuItem(params) {
Name: 'PopupBaseMenuItem', this._init(params);
}
PopupBaseMenuItem.prototype = {
_init: function (params) { _init: function (params) {
params = Params.parse (params, { reactive: true, params = Params.parse (params, { reactive: true,
activate: true, activate: true,
@ -377,27 +377,33 @@ const PopupBaseMenuItem = new Lang.Class({
x -= availWidth + this._spacing; x -= availWidth + this._spacing;
} }
} }
}); };
Signals.addSignalMethods(PopupBaseMenuItem.prototype); Signals.addSignalMethods(PopupBaseMenuItem.prototype);
const PopupMenuItem = new Lang.Class({ function PopupMenuItem() {
Name: 'PopupMenuItem', this._init.apply(this, arguments);
Extends: PopupBaseMenuItem, }
PopupMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function (text, params) { _init: function (text, params) {
this.parent(params); PopupBaseMenuItem.prototype._init.call(this, params);
this.label = new St.Label({ text: text }); this.label = new St.Label({ text: text });
this.addActor(this.label); this.addActor(this.label);
} }
}); };
const PopupSeparatorMenuItem = new Lang.Class({ function PopupSeparatorMenuItem() {
Name: 'PopupSeparatorMenuItem', this._init();
Extends: PopupBaseMenuItem, }
PopupSeparatorMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function () { _init: function () {
this.parent({ reactive: false }); PopupBaseMenuItem.prototype._init.call(this, { reactive: false });
this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' }); this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' });
this.addActor(this._drawingArea, { span: -1, expand: true }); this.addActor(this._drawingArea, { span: -1, expand: true });
@ -423,19 +429,22 @@ const PopupSeparatorMenuItem = new Lang.Class({
cr.rectangle(margin, gradientOffset, gradientWidth, gradientHeight); cr.rectangle(margin, gradientOffset, gradientWidth, gradientHeight);
cr.fill(); cr.fill();
} }
}); };
const PopupAlternatingMenuItemState = { const PopupAlternatingMenuItemState = {
DEFAULT: 0, DEFAULT: 0,
ALTERNATIVE: 1 ALTERNATIVE: 1
} }
const PopupAlternatingMenuItem = new Lang.Class({ function PopupAlternatingMenuItem() {
Name: 'PopupAlternatingMenuItem', this._init.apply(this, arguments);
Extends: PopupBaseMenuItem, }
PopupAlternatingMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function(text, alternateText, params) { _init: function(text, alternateText, params) {
this.parent(params); PopupBaseMenuItem.prototype._init.call(this, params);
this.actor.add_style_class_name('popup-alternating-menu-item'); this.actor.add_style_class_name('popup-alternating-menu-item');
this._text = text; this._text = text;
@ -521,14 +530,17 @@ const PopupAlternatingMenuItem = new Lang.Class({
this._updateLabel(); this._updateLabel();
} }
}); };
const PopupSliderMenuItem = new Lang.Class({ function PopupSliderMenuItem() {
Name: 'PopupSliderMenuItem', this._init.apply(this, arguments);
Extends: PopupBaseMenuItem, }
PopupSliderMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function(value) { _init: function(value) {
this.parent({ activate: false }); PopupBaseMenuItem.prototype._init.call(this, { activate: false });
this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
@ -704,11 +716,13 @@ const PopupSliderMenuItem = new Lang.Class({
} }
return false; return false;
} }
}); };
const Switch = new Lang.Class({ function Switch() {
Name: 'Switch', this._init.apply(this, arguments);
}
Switch.prototype = {
_init: function(state) { _init: function(state) {
this.actor = new St.Bin({ style_class: 'toggle-switch' }); this.actor = new St.Bin({ style_class: 'toggle-switch' });
// Translators: this MUST be either "toggle-switch-us" // Translators: this MUST be either "toggle-switch-us"
@ -731,14 +745,17 @@ const Switch = new Lang.Class({
toggle: function() { toggle: function() {
this.setToggleState(!this.state); this.setToggleState(!this.state);
} }
}); };
const PopupSwitchMenuItem = new Lang.Class({ function PopupSwitchMenuItem() {
Name: 'PopupSwitchMenuItem', this._init.apply(this, arguments);
Extends: PopupBaseMenuItem, }
PopupSwitchMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function(text, active, params) { _init: function(text, active, params) {
this.parent(params); PopupBaseMenuItem.prototype._init.call(this, params);
this.label = new St.Label({ text: text }); this.label = new St.Label({ text: text });
this._switch = new Switch(active); this._switch = new Switch(active);
@ -773,7 +790,7 @@ const PopupSwitchMenuItem = new Lang.Class({
this.toggle(); this.toggle();
} }
this.parent(event); PopupBaseMenuItem.prototype.activate.call(this, event);
}, },
toggle: function() { toggle: function() {
@ -788,14 +805,17 @@ const PopupSwitchMenuItem = new Lang.Class({
setToggleState: function(state) { setToggleState: function(state) {
this._switch.setToggleState(state); this._switch.setToggleState(state);
} }
}); };
const PopupImageMenuItem = new Lang.Class({ function PopupImageMenuItem() {
Name: 'PopupImageMenuItem', this._init.apply(this, arguments);
Extends: PopupBaseMenuItem, }
PopupImageMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function (text, iconName, params) { _init: function (text, iconName, params) {
this.parent(params); PopupBaseMenuItem.prototype._init.call(this, params);
this.label = new St.Label({ text: text }); this.label = new St.Label({ text: text });
this.addActor(this.label); this.addActor(this.label);
@ -808,12 +828,13 @@ const PopupImageMenuItem = new Lang.Class({
setIcon: function(name) { setIcon: function(name) {
this._icon.icon_name = name; this._icon.icon_name = name;
} }
}); };
const PopupMenuBase = new Lang.Class({ function PopupMenuBase() {
Name: 'PopupMenuBase', throw new TypeError('Trying to instantiate abstract class PopupMenuBase');
Abstract: true, }
PopupMenuBase.prototype = {
_init: function(sourceActor, styleClass) { _init: function(sourceActor, styleClass) {
this.sourceActor = sourceActor; this.sourceActor = sourceActor;
@ -1118,15 +1139,18 @@ const PopupMenuBase = new Lang.Class({
this.emit('destroy'); this.emit('destroy');
} }
}); };
Signals.addSignalMethods(PopupMenuBase.prototype); Signals.addSignalMethods(PopupMenuBase.prototype);
const PopupMenu = new Lang.Class({ function PopupMenu() {
Name: 'PopupMenu', this._init.apply(this, arguments);
Extends: PopupMenuBase, }
PopupMenu.prototype = {
__proto__: PopupMenuBase.prototype,
_init: function(sourceActor, arrowAlignment, arrowSide) { _init: function(sourceActor, arrowAlignment, arrowSide) {
this.parent(sourceActor, 'popup-menu-content'); PopupMenuBase.prototype._init.call (this, sourceActor, 'popup-menu-content');
this._arrowAlignment = arrowAlignment; this._arrowAlignment = arrowAlignment;
this._arrowSide = arrowSide; this._arrowSide = arrowSide;
@ -1211,14 +1235,17 @@ const PopupMenu = new Lang.Class({
this.isOpen = false; this.isOpen = false;
this.emit('open-state-changed', false); this.emit('open-state-changed', false);
} }
}); };
const PopupSubMenu = new Lang.Class({ function PopupSubMenu() {
Name: 'PopupSubMenu', this._init.apply(this, arguments);
Extends: PopupMenuBase, }
PopupSubMenu.prototype = {
__proto__: PopupMenuBase.prototype,
_init: function(sourceActor, sourceArrow) { _init: function(sourceActor, sourceArrow) {
this.parent(sourceActor); PopupMenuBase.prototype._init.call(this, sourceActor);
this._arrow = sourceArrow; this._arrow = sourceArrow;
this._arrow.rotation_center_z_gravity = Clutter.Gravity.CENTER; this._arrow.rotation_center_z_gravity = Clutter.Gravity.CENTER;
@ -1373,7 +1400,7 @@ const PopupSubMenu = new Lang.Class({
return false; return false;
} }
}); };
/** /**
* PopupMenuSection: * PopupMenuSection:
@ -1383,12 +1410,15 @@ const PopupSubMenu = new Lang.Class({
* can add it to another menu), but is completely transparent * can add it to another menu), but is completely transparent
* to the user * to the user
*/ */
const PopupMenuSection = new Lang.Class({ function PopupMenuSection() {
Name: 'PopupMenuSection', this._init.apply(this, arguments);
Extends: PopupMenuBase, }
PopupMenuSection.prototype = {
__proto__: PopupMenuBase.prototype,
_init: function() { _init: function() {
this.parent(); PopupMenuBase.prototype._init.call(this);
this.actor = this.box; this.actor = this.box;
this.actor._delegate = this; this.actor._delegate = this;
@ -1399,14 +1429,17 @@ const PopupMenuSection = new Lang.Class({
// corresponding signal so children can still pick it up // corresponding signal so children can still pick it up
open: function(animate) { this.emit('open-state-changed', true); }, open: function(animate) { this.emit('open-state-changed', true); },
close: function() { this.emit('open-state-changed', false); }, close: function() { this.emit('open-state-changed', false); },
}); }
const PopupSubMenuMenuItem = new Lang.Class({ function PopupSubMenuMenuItem() {
Name: 'PopupSubMenuMenuItem', this._init.apply(this, arguments);
Extends: PopupBaseMenuItem, }
PopupSubMenuMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function(text) { _init: function(text) {
this.parent(); PopupBaseMenuItem.prototype._init.call(this);
this.actor.add_style_class_name('popup-submenu-menu-item'); this.actor.add_style_class_name('popup-submenu-menu-item');
@ -1428,8 +1461,7 @@ const PopupSubMenuMenuItem = new Lang.Class({
destroy: function() { destroy: function() {
this.menu.destroy(); this.menu.destroy();
PopupBaseMenuItem.prototype.destroy.call(this);
this.parent();
}, },
_onKeyPressEvent: function(actor, event) { _onKeyPressEvent: function(actor, event) {
@ -1444,7 +1476,7 @@ const PopupSubMenuMenuItem = new Lang.Class({
return true; return true;
} }
return this.parent(actor, event); return PopupBaseMenuItem.prototype._onKeyPressEvent.call(this, actor, event);
}, },
activate: function(event) { activate: function(event) {
@ -1454,15 +1486,18 @@ const PopupSubMenuMenuItem = new Lang.Class({
_onButtonReleaseEvent: function(actor) { _onButtonReleaseEvent: function(actor) {
this.menu.toggle(); this.menu.toggle();
} }
}); };
const PopupComboMenu = new Lang.Class({ function PopupComboMenu() {
Name: 'PopupComboMenu', this._init.apply(this, arguments);
Extends: PopupMenuBase, }
PopupComboMenu.prototype = {
__proto__: PopupMenuBase.prototype,
_init: function(sourceActor) { _init: function(sourceActor) {
this.parent(sourceActor, 'popup-combo-menu'); PopupMenuBase.prototype._init.call(this,
sourceActor, 'popup-combo-menu');
this.actor = this.box; this.actor = this.box;
this.actor._delegate = this; this.actor._delegate = this;
this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent)); this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
@ -1567,14 +1602,17 @@ const PopupComboMenu = new Lang.Class({
getItemVisible: function(position) { getItemVisible: function(position) {
return this._getMenuItems()[position].actor.visible; return this._getMenuItems()[position].actor.visible;
} }
}); };
const PopupComboBoxMenuItem = new Lang.Class({ function PopupComboBoxMenuItem() {
Name: 'PopupComboBoxMenuItem', this._init.apply(this, arguments);
Extends: PopupBaseMenuItem, }
PopupComboBoxMenuItem.prototype = {
__proto__: PopupBaseMenuItem.prototype,
_init: function (params) { _init: function (params) {
this.parent(params); PopupBaseMenuItem.prototype._init.call(this, params);
this._itemBox = new Shell.Stack(); this._itemBox = new Shell.Stack();
this.addActor(this._itemBox); this.addActor(this._itemBox);
@ -1692,262 +1730,16 @@ const PopupComboBoxMenuItem = new Lang.Class({
this.setActiveItem(position); this.setActiveItem(position);
this.emit('active-item-changed', position); this.emit('active-item-changed', position);
} }
}); };
/**
* RemoteMenu:
*
* A PopupMenu that tracks a GMenuModel and shows its actions
* (exposed by GApplication/GActionGroup)
*/
const RemoteMenu = new Lang.Class({
Name: 'RemoteMenu',
Extends: PopupMenu,
_init: function(sourceActor, model, actionGroup) {
this.parent(sourceActor, 0.0, St.Side.TOP);
this.model = model;
this.actionGroup = actionGroup;
this._actions = { };
this._modelChanged(this.model, 0, 0, this.model.get_n_items(), this);
this._actionStateChangeId = this.actionGroup.connect('action-state-changed', Lang.bind(this, this._actionStateChanged));
this._actionEnableChangeId = this.actionGroup.connect('action-enabled-changed', Lang.bind(this, this._actionEnabledChanged));
},
destroy: function() {
if (this._actionStateChangeId) {
this.actionGroup.disconnect(this._actionStateChangeId);
this._actionStateChangeId = 0;
}
if (this._actionEnableChangeId) {
this.actionGroup.disconnect(this._actionEnableChangeId);
this._actionEnableChangeId = 0;
}
this.parent();
},
_createMenuItem: function(model, index) {
let section_link = model.get_item_link(index, Gio.MENU_LINK_SECTION);
if (section_link) {
let item = new PopupMenuSection();
this._modelChanged(section_link, 0, 0, section_link.get_n_items(), item);
return [item, true, ''];
}
// labels are not checked for existance, as they're required for all items
let label = model.get_item_attribute_value(index, Gio.MENU_ATTRIBUTE_LABEL, null).deep_unpack();
// remove all underscores that are not followed by another underscore
label = label.replace(/_([^_])/, '$1');
let submenu_link = model.get_item_link(index, Gio.MENU_LINK_SUBMENU);
if (submenu_link) {
let item = new PopupSubMenuMenuItem(label);
this._modelChanged(submenu_link, 0, 0, submenu_link.get_n_items(), item.menu);
return [item, false, ''];
}
let action_id = model.get_item_attribute_value(index, Gio.MENU_ATTRIBUTE_ACTION, null).deep_unpack();
if (!this.actionGroup.has_action(action_id)) {
// the action may not be there yet, wait for action-added
return [null, false, 'action-added'];
}
if (!this._actions[action_id])
this._actions[action_id] = { enabled: this.actionGroup.get_action_enabled(action_id),
state: this.actionGroup.get_action_state(action_id),
items: [ ],
};
let action = this._actions[action_id];
let item, target, destroyId, specificSignalId;
if (action.state) {
// Docs have get_state_hint(), except that the DBus protocol
// has no provision for it (so ShellApp does not implement it,
// and neither GApplication), and g_action_get_state_hint()
// always returns null
// Funny :)
switch (String.fromCharCode(action.state.classify())) {
case 'b':
item = new PopupSwitchMenuItem(label, action.state.get_boolean());
action.items.push(item);
specificSignalId = item.connect('toggled', Lang.bind(this, function(item) {
this.actionGroup.change_action_state(action_id, GLib.Variant.new_boolean(item.state));
}));
break;
case 'd':
item = new PopupSliderMenuItem(label, action.state.get_double());
action.items.push(item);
// value-changed is emitted for each motion-event, maybe an idle is more appropriate here?
specificSignalId = item.connect('value-changed', Lang.bind(this, function(item) {
this.actionGroup.change_action_state(action_id, GLib.Variant.new_double(item.value));
}));
break;
case 's':
item = new PopupMenuItem(label);
item._remoteTarget = model.get_item_attribute_value(index, Gio.MENU_ATTRIBUTE_TARGET, null).deep_unpack();
action.items.push(item);
item.setShowDot(action.state.deep_unpack() == item._remoteTarget);
specificSignalId = item.connect('activate', Lang.bind(this, function(item) {
this.actionGroup.change_action_state(action_id, GLib.Variant.new_string(item._remoteTarget));
}));
break;
default:
log('Action "%s" has state of type %s, which is not supported'.format(action_id, action.state.get_type_string()));
return [null, false, 'action-state-changed'];
}
} else {
target = model.get_item_attribute_value(index, Gio.MENU_ATTRIBUTE_TARGET, null);
item = new PopupMenuItem(label);
action.items.push(item);
specificSignalId = item.connect('activate', Lang.bind(this, function() {
this.actionGroup.activate_action(action_id, target);
}));
}
item.actor.reactive = item.actor.can_focus = action.enabled;
if (action.enabled)
item.actor.remove_style_pseudo_class('insensitive');
else
item.actor.add_style_pseudo_class('insensitive');
destroyId = item.connect('destroy', Lang.bind(this, function() {
item.disconnect(destroyId);
item.disconnect(specificSignalId);
let pos = action.items.indexOf(item);
if (pos != -1)
action.items.splice(pos, 1);
}));
return [item, false, ''];
},
_modelChanged: function(model, position, removed, added, target) {
let j, k;
let j0, k0;
let currentItems = target._getMenuItems();
for (j0 = 0, k0 = 0; j0 < position; j0++, k0++) {
if (currentItems[k0] instanceof PopupSeparatorMenuItem)
k0++;
}
if (removed == -1) {
// special flag to indicate we should destroy everything
for (k = k0; k < currentItems.length; k++)
currentItems[k].destroy();
} else {
for (j = j0, k = k0; j < j0 + removed; j++, k++) {
currentItems[k].destroy();
if (currentItems[k] instanceof PopupSeparatorMenuItem)
j--;
}
}
for (j = j0, k = k0; j < j0 + added; j++, k++) {
let [item, addSeparator, changeSignal] = this._createMenuItem(model, j);
if (item) {
// separators must be added in the parent to make autohiding work
if (addSeparator) {
target.addMenuItem(new PopupSeparatorMenuItem(), k+1);
k++;
}
target.addMenuItem(item, k);
if (addSeparator) {
target.addMenuItem(new PopupSeparatorMenuItem(), k+1);
k++;
}
} else if (changeSignal) {
let signalId = this.actionGroup.connect(changeSignal, Lang.bind(this, function() {
this.actionGroup.disconnect(signalId);
// force a full update
this._modelChanged(model, 0, -1, model.get_n_items(), target);
}));
}
}
if (!model._changedId) {
model._changedId = model.connect('items-changed', Lang.bind(this, this._modelChanged, target));
model._destroyId = target.connect('destroy', function() {
if (model._changedId)
model.disconnect(model._changedId);
if (model._destroyId)
target.disconnect(model._destroyId);
model._changedId = 0;
model._destroyId = 0;
});
}
if (target instanceof PopupMenuSection) {
target.actor.visible = target.numMenuItems != 0;
} else {
let sourceItem = target.sourceActor._delegate;
if (sourceItem instanceof PopupSubMenuMenuItem)
sourceItem.actor.visible = target.numMenuItems != 0;
}
},
_actionStateChanged: function(actionGroup, action_id) {
let action = this._actions[action_id];
if (!action)
return;
action.state = actionGroup.get_action_state(action_id);
if (action.items.length) {
switch (String.fromCharCode(action.state.classify())) {
case 'b':
for (let i = 0; i < action.items.length; i++)
action.items[i].setToggleState(action.state.get_boolean());
break;
case 'd':
for (let i = 0; i < action.items.length; i++)
action.items[i].setValue(action.state.get_double());
break;
case 's':
for (let i = 0; i < action.items.length; i++)
action.items[i].setShowDot(action.items[i]._remoteTarget == action.state.deep_unpack());
}
}
},
_actionEnabledChanged: function(actionGroup, action_id) {
let action = this._actions[action_id];
if (!action)
return;
action.enabled = actionGroup.get_action_enabled(action_id);
if (action.items.length) {
for (let i = 0; i < action.items.length; i++) {
let item = action.items[i];
item.actor.reactive = item.actor.can_focus = action.enabled;
if (action.enabled)
item.actor.remove_style_pseudo_class('insensitive');
else
item.actor.add_style_pseudo_class('insensitive');
}
}
}
});
/* Basic implementation of a menu manager. /* Basic implementation of a menu manager.
* Call addMenu to add menus * Call addMenu to add menus
*/ */
const PopupMenuManager = new Lang.Class({ function PopupMenuManager(owner) {
Name: 'PopupMenuManager', this._init(owner);
}
PopupMenuManager.prototype = {
_init: function(owner) { _init: function(owner) {
this._owner = owner; this._owner = owner;
this.grabbed = false; this.grabbed = false;
@ -2219,4 +2011,4 @@ const PopupMenuManager = new Lang.Class({
if (this._activeMenu != null) if (this._activeMenu != null)
this._activeMenu.close(true); this._activeMenu.close(true);
} }
}); };

View File

@ -30,9 +30,11 @@ const EXEC_ARG_KEY = 'exec-arg';
const DIALOG_GROW_TIME = 0.1; const DIALOG_GROW_TIME = 0.1;
const CommandCompleter = new Lang.Class({ function CommandCompleter() {
Name: 'CommandCompleter', this._init();
}
CommandCompleter.prototype = {
_init : function() { _init : function() {
this._changedCount = 0; this._changedCount = 0;
this._paths = GLib.getenv('PATH').split(':'); this._paths = GLib.getenv('PATH').split(':');
@ -160,14 +162,16 @@ const CommandCompleter = new Lang.Class({
return common.substr(text.length); return common.substr(text.length);
return common; return common;
} }
}); };
const RunDialog = new Lang.Class({ function RunDialog() {
Name: 'RunDialog', this._init();
Extends: ModalDialog.ModalDialog, }
RunDialog.prototype = {
__proto__: ModalDialog.ModalDialog.prototype,
_init : function() { _init : function() {
this.parent({ styleClass: 'run-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'run-dialog' });
this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA }); this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
this._terminalSettings = new Gio.Settings({ schema: TERMINAL_SCHEMA }); this._terminalSettings = new Gio.Settings({ schema: TERMINAL_SCHEMA });
@ -380,7 +384,8 @@ const RunDialog = new Lang.Class({
if (this._lockdownSettings.get_boolean(DISABLE_COMMAND_LINE_KEY)) if (this._lockdownSettings.get_boolean(DISABLE_COMMAND_LINE_KEY))
return; return;
this.parent(); ModalDialog.ModalDialog.prototype.open.call(this);
}, },
});
};
Signals.addSignalMethods(RunDialog.prototype); Signals.addSignalMethods(RunDialog.prototype);

View File

@ -23,9 +23,11 @@ const MatchType = {
MULTIPLE_PREFIX: 4 MULTIPLE_PREFIX: 4
}; };
const SearchResultDisplay = new Lang.Class({ function SearchResultDisplay(provider) {
Name: 'SearchResultDisplay', this._init(provider);
}
SearchResultDisplay.prototype = {
_init: function(provider) { _init: function(provider) {
this.provider = provider; this.provider = provider;
this.actor = null; this.actor = null;
@ -94,7 +96,7 @@ const SearchResultDisplay = new Lang.Class({
activateSelected: function() { activateSelected: function() {
throw new Error('Not implemented'); throw new Error('Not implemented');
} }
}); };
/** /**
* SearchProvider: * SearchProvider:
@ -103,9 +105,11 @@ const SearchResultDisplay = new Lang.Class({
* to the search system, then call registerProvider() * to the search system, then call registerProvider()
* in SearchSystem with an instance. * in SearchSystem with an instance.
*/ */
const SearchProvider = new Lang.Class({ function SearchProvider(title) {
Name: 'SearchProvider', this._init(title);
}
SearchProvider.prototype = {
_init: function(title) { _init: function(title) {
this.title = title; this.title = title;
this.searchSystem = null; this.searchSystem = null;
@ -239,12 +243,14 @@ const SearchProvider = new Lang.Class({
activateResult: function(id) { activateResult: function(id) {
throw new Error('Not implemented'); throw new Error('Not implemented');
} }
}); };
Signals.addSignalMethods(SearchProvider.prototype); Signals.addSignalMethods(SearchProvider.prototype);
const OpenSearchSystem = new Lang.Class({ function OpenSearchSystem() {
Name: 'OpenSearchSystem', this._init();
}
OpenSearchSystem.prototype = {
_init: function() { _init: function() {
this._providers = []; this._providers = [];
global.settings.connect('changed::' + DISABLED_OPEN_SEARCH_PROVIDERS_KEY, Lang.bind(this, this._refresh)); global.settings.connect('changed::' + DISABLED_OPEN_SEARCH_PROVIDERS_KEY, Lang.bind(this, this._refresh));
@ -332,12 +338,14 @@ const OpenSearchSystem = new Lang.Class({
} }
})); }));
} }
}); }
Signals.addSignalMethods(OpenSearchSystem.prototype); Signals.addSignalMethods(OpenSearchSystem.prototype);
const SearchSystem = new Lang.Class({ function SearchSystem() {
Name: 'SearchSystem', this._init();
}
SearchSystem.prototype = {
_init: function() { _init: function() {
this._providers = []; this._providers = [];
this.reset(); this.reset();
@ -425,5 +433,5 @@ const SearchSystem = new Lang.Class({
this._previousResults = results; this._previousResults = results;
this.emit('search-completed', results); this.emit('search-completed', results);
}, },
}); };
Signals.addSignalMethods(SearchSystem.prototype); Signals.addSignalMethods(SearchSystem.prototype);

View File

@ -15,9 +15,11 @@ const Search = imports.ui.search;
const MAX_SEARCH_RESULTS_ROWS = 1; const MAX_SEARCH_RESULTS_ROWS = 1;
const SearchResult = new Lang.Class({ function SearchResult(provider, metaInfo, terms) {
Name: 'SearchResult', this._init(provider, metaInfo, terms);
}
SearchResult.prototype = {
_init: function(provider, metaInfo, terms) { _init: function(provider, metaInfo, terms) {
this.provider = provider; this.provider = provider;
this.metaInfo = metaInfo; this.metaInfo = metaInfo;
@ -95,16 +97,18 @@ const SearchResult = new Lang.Class({
else else
this.provider.activateResult(this.metaInfo.id, params); this.provider.activateResult(this.metaInfo.id, params);
} }
}); };
const GridSearchResults = new Lang.Class({ function GridSearchResults(provider, grid) {
Name: 'GridSearchResults', this._init(provider, grid);
Extends: Search.SearchResultDisplay, }
GridSearchResults.prototype = {
__proto__: Search.SearchResultDisplay.prototype,
_init: function(provider, grid) { _init: function(provider, grid) {
this.parent(provider); Search.SearchResultDisplay.prototype._init.call(this, provider);
this._grid = grid || new IconGrid.IconGrid({ rowLimit: MAX_SEARCH_RESULTS_ROWS, this._grid = grid || new IconGrid.IconGrid({ rowLimit: MAX_SEARCH_RESULTS_ROWS,
xAlign: St.Align.START }); xAlign: St.Align.START });
this.actor = new St.Bin({ x_align: St.Align.START }); this.actor = new St.Bin({ x_align: St.Align.START });
@ -175,11 +179,14 @@ const GridSearchResults = new Lang.Class({
let targetActor = this._grid.getItemAtIndex(this.selectionIndex); let targetActor = this._grid.getItemAtIndex(this.selectionIndex);
targetActor._delegate.activate(); targetActor._delegate.activate();
} }
}); };
const SearchResults = new Lang.Class({
Name: 'SearchResults',
function SearchResults(searchSystem, openSearchSystem) {
this._init(searchSystem, openSearchSystem);
}
SearchResults.prototype = {
_init: function(searchSystem, openSearchSystem) { _init: function(searchSystem, openSearchSystem) {
this._searchSystem = searchSystem; this._searchSystem = searchSystem;
this._searchSystem.connect('search-updated', Lang.bind(this, this._updateCurrentResults)); this._searchSystem.connect('search-updated', Lang.bind(this, this._updateCurrentResults));
@ -479,4 +486,4 @@ const SearchResults = new Lang.Class({
resultDisplay.activateSelected(); resultDisplay.activateSelected();
Main.overview.hide(); Main.overview.hide();
} }
}); };

View File

@ -66,9 +66,11 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
</signal> </signal>
</interface>; </interface>;
const GnomeShell = new Lang.Class({ function GnomeShell() {
Name: 'GnomeShellDBus', this._init();
}
GnomeShell.prototype = {
_init: function() { _init: function() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellIface, this); this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell'); this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
@ -154,7 +156,7 @@ const GnomeShell = new Lang.Class({
}, },
ListExtensions: function() { ListExtensions: function() {
let out = {}; let out;
for (let uuid in ExtensionSystem.extensionMeta) { for (let uuid in ExtensionSystem.extensionMeta) {
let dbusObj = this.GetExtensionInfo(uuid); let dbusObj = this.GetExtensionInfo(uuid);
out[uuid] = dbusObj; out[uuid] = dbusObj;
@ -164,19 +166,19 @@ const GnomeShell = new Lang.Class({
GetExtensionInfo: function(uuid) { GetExtensionInfo: function(uuid) {
let meta = ExtensionSystem.extensionMeta[uuid] || {}; let meta = ExtensionSystem.extensionMeta[uuid] || {};
let out = {}; let out;
for (let key in meta) { for (let key in meta) {
let val = meta[key]; let val = meta[key];
let type; let type;
switch (typeof val) { switch (typeof val) {
case 'object':
throw Error('Extension had a nested object in the metadata. This is not supported');
case 'string': case 'string':
type = 's'; type = 's';
break; break;
case 'number': case 'number':
type = 'd'; type = 'd';
break; break;
default:
continue;
} }
out[key] = GLib.Variant.new(type, val); out[key] = GLib.Variant.new(type, val);
} }
@ -228,4 +230,4 @@ const GnomeShell = new Lang.Class({
this._dbusImpl.emit_signal('ExtensionStatusChanged', this._dbusImpl.emit_signal('ExtensionStatusChanged',
GLib.Variant.new('(sis)', [newState.uuid, newState.state, newState.error])); GLib.Variant.new('(sis)', [newState.uuid, newState.state, newState.error]));
} }
}); };

View File

@ -7,14 +7,18 @@ const Main = imports.ui.main;
const Params = imports.misc.params; const Params = imports.misc.params;
const PopupMenu = imports.ui.popupMenu; const PopupMenu = imports.ui.popupMenu;
const _EntryMenu = new Lang.Class({
Name: 'ShellEntryMenu', function _EntryMenu(entry, params) {
Extends: PopupMenu.PopupMenu, this._init(entry, params);
};
_EntryMenu.prototype = {
__proto__: PopupMenu.PopupMenu.prototype,
_init: function(entry, params) { _init: function(entry, params) {
params = Params.parse (params, { isPassword: false }); params = Params.parse (params, { isPassword: false });
this.parent(entry, 0, St.Side.TOP); PopupMenu.PopupMenu.prototype._init.call(this, entry, 0, St.Side.TOP);
this.actor.add_style_class_name('entry-context-menu'); this.actor.add_style_class_name('entry-context-menu');
@ -56,7 +60,7 @@ const _EntryMenu = new Lang.Class({
if (!this.actor.navigate_focus(null, direction, false)) if (!this.actor.navigate_focus(null, direction, false))
this.actor.grab_key_focus(); this.actor.grab_key_focus();
this.parent(); PopupMenu.PopupMenu.prototype.open.call(this);
}, },
_updateCopyItem: function() { _updateCopyItem: function() {
@ -99,7 +103,8 @@ const _EntryMenu = new Lang.Class({
let visible = !!(this._entry.clutter_text.password_char); let visible = !!(this._entry.clutter_text.password_char);
this._entry.clutter_text.set_password_char(visible ? '' : '\u25cf'); this._entry.clutter_text.set_password_char(visible ? '' : '\u25cf');
} }
}); };
function _setMenuAlignment(entry, stageX) { function _setMenuAlignment(entry, stageX) {
let [success, entryX, entryY] = entry.transform_stage_point(stageX, 0); let [success, entryX, entryY] = entry.transform_stage_point(stageX, 0);

View File

@ -50,9 +50,11 @@ function _setLabelsForMessage(dialog, message) {
/* -------------------------------------------------------- */ /* -------------------------------------------------------- */
const ListItem = new Lang.Class({ function ListItem(app) {
Name: 'ListItem', this._init(app);
}
ListItem.prototype = {
_init: function(app) { _init: function(app) {
this._app = app; this._app = app;
@ -84,12 +86,14 @@ const ListItem = new Lang.Class({
this.emit('activate'); this.emit('activate');
this._app.activate(); this._app.activate();
} }
}); };
Signals.addSignalMethods(ListItem.prototype); Signals.addSignalMethods(ListItem.prototype);
const ShellMountOperation = new Lang.Class({ function ShellMountOperation(source, params) {
Name: 'ShellMountOperation', this._init(source, params);
}
ShellMountOperation.prototype = {
_init: function(source, params) { _init: function(source, params) {
params = Params.parse(params, { reaskPassword: false }); params = Params.parse(params, { reaskPassword: false });
@ -186,14 +190,17 @@ const ShellMountOperation = new Lang.Class({
this._processesDialog.update(message, processes, choices); this._processesDialog.update(message, processes, choices);
}, },
}); }
const ShellMountQuestionDialog = new Lang.Class({ function ShellMountQuestionDialog(icon) {
Name: 'ShellMountQuestionDialog', this._init(icon);
Extends: ModalDialog.ModalDialog, }
ShellMountQuestionDialog.prototype = {
__proto__: ModalDialog.ModalDialog.prototype,
_init: function(icon) { _init: function(icon) {
this.parent({ styleClass: 'mount-question-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'mount-question-dialog' });
let mainContentLayout = new St.BoxLayout(); let mainContentLayout = new St.BoxLayout();
this.contentLayout.add(mainContentLayout, { x_fill: true, this.contentLayout.add(mainContentLayout, { x_fill: true,
@ -229,16 +236,19 @@ const ShellMountQuestionDialog = new Lang.Class({
_setLabelsForMessage(this, message); _setLabelsForMessage(this, message);
_setButtonsForChoices(this, choices); _setButtonsForChoices(this, choices);
} }
}); }
Signals.addSignalMethods(ShellMountQuestionDialog.prototype); Signals.addSignalMethods(ShellMountQuestionDialog.prototype);
const ShellMountPasswordSource = new Lang.Class({ function ShellMountPasswordSource(message, icon, reaskPassword) {
Name: 'ShellMountPasswordSource', this._init(message, icon, reaskPassword);
Extends: MessageTray.Source, }
ShellMountPasswordSource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function(message, icon, reaskPassword) { _init: function(message, icon, reaskPassword) {
let strings = message.split('\n'); let strings = message.split('\n');
this.parent(strings[0]); MessageTray.Source.prototype._init.call(this, strings[0]);
this._notification = new ShellMountPasswordNotification(this, strings, icon, reaskPassword); this._notification = new ShellMountPasswordNotification(this, strings, icon, reaskPassword);
@ -246,15 +256,21 @@ const ShellMountPasswordSource = new Lang.Class({
Main.messageTray.add(this); Main.messageTray.add(this);
this.notify(this._notification); this.notify(this._notification);
}, },
}); }
Signals.addSignalMethods(ShellMountPasswordSource.prototype); Signals.addSignalMethods(ShellMountPasswordSource.prototype);
const ShellMountPasswordNotification = new Lang.Class({ function ShellMountPasswordNotification(source, strings, icon, reaskPassword) {
Name: 'ShellMountPasswordNotification', this._init(source, strings, icon, reaskPassword);
Extends: MessageTray.Notification, }
ShellMountPasswordNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, strings, icon, reaskPassword) { _init: function(source, strings, icon, reaskPassword) {
this.parent(source, strings[0], null, { customContent: true, icon: icon }); MessageTray.Notification.prototype._init.call(this, source,
strings[0], null,
{ customContent: true,
icon: icon });
// set the notification to transient and urgent, so that it // set the notification to transient and urgent, so that it
// expands out // expands out
@ -289,14 +305,17 @@ const ShellMountPasswordNotification = new Lang.Class({
this.source.emit('password-ready', text); this.source.emit('password-ready', text);
} }
}); }
const ShellProcessesDialog = new Lang.Class({ function ShellProcessesDialog(icon) {
Name: 'ShellProcessesDialog', this._init(icon);
Extends: ModalDialog.ModalDialog, }
ShellProcessesDialog.prototype = {
__proto__: ModalDialog.ModalDialog.prototype,
_init: function(icon) { _init: function(icon) {
this.parent({ styleClass: 'show-processes-dialog' }); ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'show-processes-dialog' });
let mainContentLayout = new St.BoxLayout(); let mainContentLayout = new St.BoxLayout();
this.contentLayout.add(mainContentLayout, { x_fill: true, this.contentLayout.add(mainContentLayout, { x_fill: true,
@ -382,5 +401,5 @@ const ShellProcessesDialog = new Lang.Class({
_setLabelsForMessage(this, message); _setLabelsForMessage(this, message);
_setButtonsForChoices(this, choices); _setButtonsForChoices(this, choices);
} }
}); }
Signals.addSignalMethods(ShellProcessesDialog.prototype); Signals.addSignalMethods(ShellProcessesDialog.prototype);

View File

@ -1,5 +1,6 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const DBus = imports.dbus;
const GDesktopEnums = imports.gi.GDesktopEnums; const GDesktopEnums = imports.gi.GDesktopEnums;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const Gtk = imports.gi.Gtk; const Gtk = imports.gi.Gtk;
@ -39,12 +40,15 @@ const KEY_TEXT_SCALING_FACTOR = 'text-scaling-factor';
const HIGH_CONTRAST_THEME = 'HighContrast'; const HIGH_CONTRAST_THEME = 'HighContrast';
const ATIndicator = new Lang.Class({ function ATIndicator() {
Name: 'ATIndicator', this._init.apply(this, arguments);
Extends: PanelMenu.SystemStatusButton, }
ATIndicator.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype,
_init: function() { _init: function() {
this.parent('preferences-desktop-accessibility', null); PanelMenu.SystemStatusButton.prototype._init.call(this, 'preferences-desktop-accessibility', null);
let highContrast = this._buildHCItem(); let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast); this.menu.addMenuItem(highContrast);
@ -168,4 +172,5 @@ const ATIndicator = new Lang.Class({
}); });
return widget; return widget;
} }
}); };
Signals.addSignalMethods(ATIndicator.prototype);

View File

@ -23,12 +23,15 @@ const ConnectionState = {
CONNECTING: 3 CONNECTING: 3
} }
const Indicator = new Lang.Class({ function Indicator() {
Name: 'BTIndicator', this._init.apply(this, arguments);
Extends: PanelMenu.SystemStatusButton, }
Indicator.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype,
_init: function() { _init: function() {
this.parent('bluetooth-disabled', null); PanelMenu.SystemStatusButton.prototype._init.call(this, 'bluetooth-disabled', null);
GLib.spawn_command_line_sync ('pkill -f "^bluetooth-applet$"'); GLib.spawn_command_line_sync ('pkill -f "^bluetooth-applet$"');
this._applet = new GnomeBluetoothApplet.Applet(); this._applet = new GnomeBluetoothApplet.Applet();
@ -332,14 +335,17 @@ const Indicator = new Lang.Class({
_cancelRequest: function() { _cancelRequest: function() {
this._source.destroy(); this._source.destroy();
} }
}); }
const Source = new Lang.Class({ function Source() {
Name: 'BluetoothSource', this._init.apply(this, arguments);
Extends: MessageTray.Source, }
Source.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function() { _init: function() {
this.parent(_("Bluetooth")); MessageTray.Source.prototype._init.call(this, _("Bluetooth"));
this._setSummaryIcon(this.createNotificationIcon()); this._setSummaryIcon(this.createNotificationIcon());
}, },
@ -353,7 +359,7 @@ const Source = new Lang.Class({
} }
})); }));
this.parent(notification); MessageTray.Source.prototype.notify.call(this, notification);
}, },
createNotificationIcon: function() { createNotificationIcon: function() {
@ -361,17 +367,21 @@ const Source = new Lang.Class({
icon_type: St.IconType.SYMBOLIC, icon_type: St.IconType.SYMBOLIC,
icon_size: this.ICON_SIZE }); icon_size: this.ICON_SIZE });
} }
}); }
const AuthNotification = new Lang.Class({ function AuthNotification() {
Name: 'AuthNotification', this._init.apply(this, arguments);
Extends: MessageTray.Notification, }
AuthNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, applet, device_path, name, long_name, uuid) { _init: function(source, applet, device_path, name, long_name, uuid) {
this.parent(source, MessageTray.Notification.prototype._init.call(this,
_("Bluetooth"), source,
_("Authorization request from %s").format(name), _("Bluetooth"),
{ customContent: true }); _("Authorization request from %s").format(name),
{ customContent: true });
this.setResident(true); this.setResident(true);
this._applet = applet; this._applet = applet;
@ -397,17 +407,21 @@ const AuthNotification = new Lang.Class({
this.destroy(); this.destroy();
})); }));
} }
}); }
const ConfirmNotification = new Lang.Class({ function ConfirmNotification() {
Name: 'ConfirmNotification', this._init.apply(this, arguments);
Extends: MessageTray.Notification, }
ConfirmNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, applet, device_path, name, long_name, pin) { _init: function(source, applet, device_path, name, long_name, pin) {
this.parent(source, MessageTray.Notification.prototype._init.call(this,
_("Bluetooth"), source,
_("Pairing confirmation for %s").format(name), _("Bluetooth"),
{ customContent: true }); _("Pairing confirmation for %s").format(name),
{ customContent: true });
this.setResident(true); this.setResident(true);
this._applet = applet; this._applet = applet;
@ -426,17 +440,21 @@ const ConfirmNotification = new Lang.Class({
this.destroy(); this.destroy();
})); }));
} }
}); }
const PinNotification = new Lang.Class({ function PinNotification() {
Name: 'PinNotification', this._init.apply(this, arguments);
Extends: MessageTray.Notification, }
PinNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, applet, device_path, name, long_name, numeric) { _init: function(source, applet, device_path, name, long_name, numeric) {
this.parent(source, MessageTray.Notification.prototype._init.call(this,
_("Bluetooth"), source,
_("Pairing request for %s").format(name), _("Bluetooth"),
{ customContent: true }); _("Pairing request for %s").format(name),
{ customContent: true });
this.setResident(true); this.setResident(true);
this._applet = applet; this._applet = applet;
@ -485,7 +503,7 @@ const PinNotification = new Lang.Class({
}, },
grabFocus: function(lockTray) { grabFocus: function(lockTray) {
this.parent(lockTray); MessageTray.Notification.prototype.grabFocus.call(this, lockTray);
global.stage.set_key_focus(this._entry); global.stage.set_key_focus(this._entry);
} }
}); }

View File

@ -14,12 +14,15 @@ const PopupMenu = imports.ui.popupMenu;
const PanelMenu = imports.ui.panelMenu; const PanelMenu = imports.ui.panelMenu;
const Util = imports.misc.util; const Util = imports.misc.util;
const LayoutMenuItem = new Lang.Class({ function LayoutMenuItem() {
Name: 'LayoutMenuItem', this._init.apply(this, arguments);
Extends: PopupMenu.PopupBaseMenuItem, }
LayoutMenuItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
_init: function(config, id, indicator, long_name) { _init: function(config, id, indicator, long_name) {
this.parent(); PopupMenu.PopupBaseMenuItem.prototype._init.call(this);
this._config = config; this._config = config;
this._id = id; this._id = id;
@ -30,18 +33,20 @@ const LayoutMenuItem = new Lang.Class({
}, },
activate: function(event) { activate: function(event) {
this.parent(event); PopupMenu.PopupBaseMenuItem.prototype.activate.call(this);
this._config.lock_group(this._id); this._config.lock_group(this._id);
} }
}); };
const XKBIndicator = new Lang.Class({ function XKBIndicator() {
Name: 'XKBIndicator', this._init.call(this);
Extends: PanelMenu.Button, }
XKBIndicator.prototype = {
__proto__: PanelMenu.Button.prototype,
_init: function() { _init: function() {
this.parent(0.0); PanelMenu.Button.prototype._init.call(this, St.Align.START);
this._container = new Shell.GenericContainer(); this._container = new Shell.GenericContainer();
this._container.connect('get-preferred-width', Lang.bind(this, this._containerGetPreferredWidth)); this._container.connect('get-preferred-width', Lang.bind(this, this._containerGetPreferredWidth));
@ -216,4 +221,4 @@ const XKBIndicator = new Lang.Class({
for (let i = 0; i < this._labelActors.length; i++) for (let i = 0; i < this._labelActors.length; i++)
this._labelActors[i].allocate_align_fill(box, 0.5, 0, false, false, flags); this._labelActors[i].allocate_align_fill(box, 0.5, 0, false, false, flags);
} }
}); };

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const ByteArray = imports.byteArray; const ByteArray = imports.byteArray;
const GLib = imports.gi.GLib; const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const GObject = imports.gi.GObject; const GObject = imports.gi.GObject;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
@ -97,12 +98,15 @@ function ssidToLabel(ssid) {
return label; return label;
} }
const NMNetworkMenuItem = new Lang.Class({ function NMNetworkMenuItem() {
Name: 'NMNetworkMenuItem', this._init.apply(this, arguments);
Extends: PopupMenu.PopupBaseMenuItem, }
NMNetworkMenuItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
_init: function(accessPoints, title, params) { _init: function(accessPoints, title, params) {
this.parent(params); PopupMenu.PopupBaseMenuItem.prototype._init.call(this, params);
accessPoints = sortAccessPoints(accessPoints); accessPoints = sortAccessPoints(accessPoints);
this.bestAP = accessPoints[0]; this.bestAP = accessPoints[0];
@ -181,18 +185,21 @@ const NMNetworkMenuItem = new Lang.Class({
apObj.updateId = 0; apObj.updateId = 0;
} }
this.parent(); PopupMenu.PopupBaseMenuItem.prototype.destroy.call(this);
} }
}); };
const NMWiredSectionTitleMenuItem = new Lang.Class({ function NMWiredSectionTitleMenuItem() {
Name: 'NMWiredSectionTitleMenuItem', this._init.apply(this, arguments);
Extends: PopupMenu.PopupSwitchMenuItem, }
NMWiredSectionTitleMenuItem.prototype = {
__proto__: PopupMenu.PopupSwitchMenuItem.prototype,
_init: function(label, params) { _init: function(label, params) {
params = params || { }; params = params || { };
params.style_class = 'popup-subtitle-menu-item'; params.style_class = 'popup-subtitle-menu-item';
this.parent(label, false, params); PopupMenu.PopupSwitchMenuItem.prototype._init.call(this, label, false, params);
}, },
updateForDevice: function(device) { updateForDevice: function(device) {
@ -205,7 +212,7 @@ const NMWiredSectionTitleMenuItem = new Lang.Class({
}, },
activate: function(event) { activate: function(event) {
this.parent(event); PopupMenu.PopupSwitchMenuItem.prototype.activate.call(this, event);
if (!this._device) { if (!this._device) {
log('Section title activated when there is more than one device, should be non reactive'); log('Section title activated when there is more than one device, should be non reactive');
@ -224,16 +231,19 @@ const NMWiredSectionTitleMenuItem = new Lang.Class({
else else
this._device.deactivate(); this._device.deactivate();
} }
}); };
const NMWirelessSectionTitleMenuItem = new Lang.Class({ function NMWirelessSectionTitleMenuItem() {
Name: 'NMWirelessSectionTitleMenuItem', this._init.apply(this, arguments);
Extends: PopupMenu.PopupSwitchMenuItem, }
NMWirelessSectionTitleMenuItem.prototype = {
__proto__: PopupMenu.PopupSwitchMenuItem.prototype,
_init: function(client, property, title, params) { _init: function(client, property, title, params) {
params = params || { }; params = params || { };
params.style_class = 'popup-subtitle-menu-item'; params.style_class = 'popup-subtitle-menu-item';
this.parent(title, false, params); PopupMenu.PopupSwitchMenuItem.prototype._init.call(this, title, false, params);
this._client = client; this._client = client;
this._property = property + '_enabled'; this._property = property + '_enabled';
@ -259,7 +269,7 @@ const NMWirelessSectionTitleMenuItem = new Lang.Class({
}, },
activate: function(event) { activate: function(event) {
this.parent(event); PopupMenu.PopupSwitchMenuItem.prototype.activate.call(this, event);
this._client[this._setEnabledFunc](this._switch.state); this._client[this._setEnabledFunc](this._switch.state);
}, },
@ -276,12 +286,13 @@ const NMWirelessSectionTitleMenuItem = new Lang.Class({
this.emit('enabled-changed', enabled); this.emit('enabled-changed', enabled);
} }
}); };
const NMDevice = new Lang.Class({ function NMDevice() {
Name: 'NMDevice', throw new TypeError('Instantanting abstract class NMDevice');
Abstract: true, }
NMDevice.prototype = {
_init: function(client, device, connections) { _init: function(client, device, connections) {
this.device = device; this.device = device;
if (device) { if (device) {
@ -663,23 +674,26 @@ const NMDevice = new Lang.Class({
return out; return out;
} }
}); };
Signals.addSignalMethods(NMDevice.prototype); Signals.addSignalMethods(NMDevice.prototype);
const NMDeviceWired = new Lang.Class({ function NMDeviceWired() {
Name: 'NMDeviceWired', this._init.apply(this, arguments);
Extends: NMDevice, }
NMDeviceWired.prototype = {
__proto__: NMDevice.prototype,
_init: function(client, device, connections) { _init: function(client, device, connections) {
this._autoConnectionName = _("Auto Ethernet"); this._autoConnectionName = _("Auto Ethernet");
this.category = NMConnectionCategory.WIRED; this.category = NMConnectionCategory.WIRED;
this.parent(client, device, connections); NMDevice.prototype._init.call(this, client, device, connections);
}, },
_createSection: function() { _createSection: function() {
this.parent(); NMDevice.prototype._createSection.call(this);
// if we have only one connection (normal or automatic) // if we have only one connection (normal or automatic)
// we hide the connection list, and use the switch to control // we hide the connection list, and use the switch to control
@ -704,11 +718,14 @@ const NMDeviceWired = new Lang.Class({
})); }));
return connection; return connection;
} }
}); };
const NMDeviceModem = new Lang.Class({ function NMDeviceModem() {
Name: 'NMDeviceModem', this._init.apply(this, arguments);
Extends: NMDevice, }
NMDeviceModem.prototype = {
__proto__: NMDevice.prototype,
_init: function(client, device, connections) { _init: function(client, device, connections) {
let is_wwan = false; let is_wwan = false;
@ -757,7 +774,7 @@ const NMDeviceModem = new Lang.Class({
})); }));
} }
this.parent(client, device, connections); NMDevice.prototype._init.call(this, client, device, connections);
}, },
setEnabled: function(enabled) { setEnabled: function(enabled) {
@ -770,7 +787,7 @@ const NMDeviceModem = new Lang.Class({
this.statusItem.setStatus(this.getStatusLabel()); this.statusItem.setStatus(this.getStatusLabel());
} }
this.parent(enabled); NMDevice.prototype.setEnabled.call(this, enabled);
}, },
get connected() { get connected() {
@ -787,7 +804,7 @@ const NMDeviceModem = new Lang.Class({
this._signalQualityId = 0; this._signalQualityId = 0;
} }
this.parent(); NMDevice.prototype.destroy.call(this);
}, },
_getSignalIcon: function() { _getSignalIcon: function() {
@ -808,13 +825,13 @@ const NMDeviceModem = new Lang.Class({
this.section.addMenuItem(this._operatorItem); this.section.addMenuItem(this._operatorItem);
} }
this.parent(); NMDevice.prototype._createSection.call(this);
}, },
_clearSection: function() { _clearSection: function() {
this._operatorItem = null; this._operatorItem = null;
this.parent(); NMDevice.prototype._clearSection.call(this);
}, },
_createAutomaticConnection: function() { _createAutomaticConnection: function() {
@ -824,11 +841,14 @@ const NMDeviceModem = new Lang.Class({
'connect-3g', this.device.get_path()]); 'connect-3g', this.device.get_path()]);
return null; return null;
} }
}); };
const NMDeviceBluetooth = new Lang.Class({ function NMDeviceBluetooth() {
Name: 'NMDeviceBluetooth', this._init.apply(this, arguments);
Extends: NMDevice, }
NMDeviceBluetooth.prototype = {
__proto__: NMDevice.prototype,
_init: function(client, device, connections) { _init: function(client, device, connections) {
this._autoConnectionName = this._makeConnectionName(device); this._autoConnectionName = this._makeConnectionName(device);
@ -836,7 +856,7 @@ const NMDeviceBluetooth = new Lang.Class({
this.category = NMConnectionCategory.WWAN; this.category = NMConnectionCategory.WWAN;
this.parent(client, device, connections); NMDevice.prototype._init.call(this, client, device, connections);
}, },
_createAutomaticConnection: function() { _createAutomaticConnection: function() {
@ -866,20 +886,23 @@ const NMDeviceBluetooth = new Lang.Class({
this._clearSection(); this._clearSection();
this._createSection(); this._createSection();
} }
}); };
// Not a real device, but I save a lot code this way // Not a real device, but I save a lot code this way
const NMDeviceVPN = new Lang.Class({ function NMDeviceVPN() {
Name: 'NMDeviceVPN', this._init.apply(this, arguments);
Extends: NMDevice, }
NMDeviceVPN.prototype = {
__proto__: NMDevice.prototype,
_init: function(client) { _init: function(client) {
// Disable autoconnections // Disable autoconnections
this._autoConnectionName = null; this._autoConnectionName = null;
this.category = NMConnectionCategory.VPN; this.category = NMConnectionCategory.VPN;
this.parent(client, null, [ ]); NMDevice.prototype._init.call(this, client, null, [ ]);
}, },
connectionValid: function(connection) { connectionValid: function(connection) {
@ -895,7 +918,7 @@ const NMDeviceVPN = new Lang.Class({
}, },
setActiveConnection: function(activeConnection) { setActiveConnection: function(activeConnection) {
this.parent(activeConnection); NMDevice.prototype.setActiveConnection.call(this, activeConnection);
this.emit('active-connection-changed'); this.emit('active-connection-changed');
}, },
@ -912,11 +935,14 @@ const NMDeviceVPN = new Lang.Class({
getStatusLabel: function() { getStatusLabel: function() {
return null; return null;
} }
}); };
const NMDeviceWireless = new Lang.Class({ function NMDeviceWireless() {
Name: 'NMDeviceWireless', this._init.apply(this, arguments);
Extends: NMDevice, }
NMDeviceWireless.prototype = {
__proto__: NMDevice.prototype,
_init: function(client, device, connections) { _init: function(client, device, connections) {
this.category = NMConnectionCategory.WIRELESS; this.category = NMConnectionCategory.WIRELESS;
@ -988,7 +1014,7 @@ const NMDeviceWireless = new Lang.Class({
this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded)); this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded));
this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, this._accessPointRemoved)); this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, this._accessPointRemoved));
this.parent(client, device, validConnections); NMDevice.prototype._init.call(this, client, device, validConnections);
}, },
destroy: function() { destroy: function() {
@ -1008,7 +1034,7 @@ const NMDeviceWireless = new Lang.Class({
this._apRemovedId = 0; this._apRemovedId = 0;
} }
this.parent(); NMDevice.prototype.destroy.call(this);
}, },
setEnabled: function(enabled) { setEnabled: function(enabled) {
@ -1322,7 +1348,7 @@ const NMDeviceWireless = new Lang.Class({
}, },
_clearSection: function() { _clearSection: function() {
this.parent(); NMDevice.prototype._clearSection.call(this);
for (let i = 0; i < this._networks.length; i++) for (let i = 0; i < this._networks.length; i++)
this._networks[i].item = null; this._networks[i].item = null;
@ -1530,14 +1556,16 @@ const NMDeviceWireless = new Lang.Class({
this._createNetworkItem(apObj, j + activeOffset); this._createNetworkItem(apObj, j + activeOffset);
} }
}, },
}); };
const NMApplet = new Lang.Class({ function NMApplet() {
Name: 'NMApplet', this._init.apply(this, arguments);
Extends: PanelMenu.SystemStatusButton, }
NMApplet.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype,
_init: function() { _init: function() {
this.parent('network-error', null); PanelMenu.SystemStatusButton.prototype._init.call(this, 'network-error');
this._client = NMClient.Client.new(); this._client = NMClient.Client.new();
@ -2103,14 +2131,17 @@ const NMApplet = new Lang.Class({
this._mobileUpdateId = 0; this._mobileUpdateId = 0;
} }
} }
}); };
const NMMessageTraySource = new Lang.Class({ function NMMessageTraySource() {
Name: 'NMMessageTraySource', this._init();
Extends: MessageTray.Source, }
NMMessageTraySource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function() { _init: function() {
this.parent(_("Network Manager")); MessageTray.Source.prototype._init.call(this, _("Network Manager"));
let icon = new St.Icon({ icon_name: 'network-transmit-receive', let icon = new St.Icon({ icon_name: 'network-transmit-receive',
icon_type: St.IconType.SYMBOLIC, icon_type: St.IconType.SYMBOLIC,
@ -2118,4 +2149,4 @@ const NMMessageTraySource = new Lang.Class({
}); });
this._setSummaryIcon(icon); this._setSummaryIcon(icon);
} }
}); };

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang; const Lang = imports.lang;
const Mainloop = imports.mainloop; const Mainloop = imports.mainloop;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
@ -52,13 +53,15 @@ const PowerManagerInterface = <interface name="org.gnome.SettingsDaemon.Power">
const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(PowerManagerInterface); const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(PowerManagerInterface);
const Indicator = new Lang.Class({ function Indicator() {
Name: 'PowerIndicator', this._init.apply(this, arguments);
Extends: PanelMenu.SystemStatusButton, }
Indicator.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype,
_init: function() { _init: function() {
this.parent('battery-missing', null); PanelMenu.SystemStatusButton.prototype._init.call(this, 'battery-missing');
this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH); this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
this._deviceItems = [ ]; this._deviceItems = [ ];
@ -161,14 +164,17 @@ const Indicator = new Lang.Class({
this._readPrimaryDevice(); this._readPrimaryDevice();
this._readOtherDevices(); this._readOtherDevices();
} }
}); };
const DeviceItem = new Lang.Class({ function DeviceItem() {
Name: 'DeviceItem', this._init.apply(this, arguments);
Extends: PopupMenu.PopupBaseMenuItem, }
DeviceItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
_init: function(device) { _init: function(device) {
this.parent({ reactive: false }); PopupMenu.PopupBaseMenuItem.prototype._init.call(this, { reactive: false });
let [device_id, device_type, icon, percentage, state, time] = device; let [device_id, device_type, icon, percentage, state, time] = device;
@ -215,4 +221,4 @@ const DeviceItem = new Lang.Class({
return _("Unknown"); return _("Unknown");
} }
} }
}); }

View File

@ -17,12 +17,15 @@ const VOLUME_ADJUSTMENT_STEP = 0.05; /* Volume adjustment step in % */
const VOLUME_NOTIFY_ID = 1; const VOLUME_NOTIFY_ID = 1;
const Indicator = new Lang.Class({ function Indicator() {
Name: 'VolumeIndicator', this._init.apply(this, arguments);
Extends: PanelMenu.SystemStatusButton, }
Indicator.prototype = {
__proto__: PanelMenu.SystemStatusButton.prototype,
_init: function() { _init: function() {
this.parent('audio-volume-muted', null); PanelMenu.SystemStatusButton.prototype._init.call(this, 'audio-volume-muted', null);
this._control = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' }); this._control = new Gvc.MixerControl({ name: 'GNOME Shell Volume Control' });
this._control.connect('state-changed', Lang.bind(this, this._onControlStateChanged)); this._control.connect('state-changed', Lang.bind(this, this._onControlStateChanged));
@ -211,4 +214,4 @@ const Indicator = new Lang.Class({
if (property == '_output' && !this._output.is_muted) if (property == '_output' && !this._output.is_muted)
this.setIcon(this._volumeToIcon(this._output.volume)); this.setIcon(this._volumeToIcon(this._output.volume));
} }
}); };

View File

@ -23,9 +23,11 @@ const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
'ibus-ui-gtk': 'input-method' 'ibus-ui-gtk': 'input-method'
}; };
const StatusIconDispatcher = new Lang.Class({ function StatusIconDispatcher() {
Name: 'StatusIconDispatcher', this._init();
}
StatusIconDispatcher.prototype = {
_init: function() { _init: function() {
this._traymanager = new Shell.TrayManager(); this._traymanager = new Shell.TrayManager();
this._traymanager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded)); this._traymanager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
@ -59,5 +61,5 @@ const StatusIconDispatcher = new Lang.Class({
else else
this.emit('message-icon-removed', icon); this.emit('message-icon-removed', icon);
} }
}); };
Signals.addSignalMethods(StatusIconDispatcher.prototype); Signals.addSignalMethods(StatusIconDispatcher.prototype);

View File

@ -72,9 +72,11 @@ function makeMessageFromTplEvent(event) {
}; };
} }
const Client = new Lang.Class({ function Client() {
Name: 'Client', this._init();
};
Client.prototype = {
_init : function() { _init : function() {
// channel path -> ChatSource // channel path -> ChatSource
this._chatSources = {}; this._chatSources = {};
@ -477,14 +479,17 @@ const Client = new Lang.Class({
return this._accountSource; return this._accountSource;
} }
}); };
const ChatSource = new Lang.Class({ function ChatSource(account, conn, channel, contact, client) {
Name: 'ChatSource', this._init(account, conn, channel, contact, client);
Extends: MessageTray.Source, }
ChatSource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function(account, conn, channel, contact, client) { _init: function(account, conn, channel, contact, client) {
this.parent(contact.get_alias()); MessageTray.Source.prototype._init.call(this, contact.get_alias());
this.isChat = true; this.isChat = true;
@ -692,7 +697,7 @@ const ChatSource = new Lang.Class({
}, },
notify: function() { notify: function() {
this.parent(this._notification); MessageTray.Source.prototype.notify.call(this, this._notification);
}, },
respond: function(text) { respond: function(text) {
@ -793,14 +798,17 @@ const ChatSource = new Lang.Class({
this._shouldAck = false; this._shouldAck = false;
} }
}); };
const ChatNotification = new Lang.Class({ function ChatNotification(source) {
Name: 'ChatNotification', this._init(source);
Extends: MessageTray.Notification, }
ChatNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source) { _init: function(source) {
this.parent(source, source.title, null, { customContent: true }); MessageTray.Notification.prototype._init.call(this, source, source.title, null, { customContent: true });
this.setResident(true); this.setResident(true);
this._responseEntry = new St.Entry({ style_class: 'chat-response', this._responseEntry = new St.Entry({ style_class: 'chat-response',
@ -1083,14 +1091,17 @@ const ChatNotification = new Lang.Class({
this.source.setChatState(Tp.ChannelChatState.ACTIVE); this.source.setChatState(Tp.ChannelChatState.ACTIVE);
} }
} }
}); };
const ApproverSource = new Lang.Class({ function ApproverSource(dispatchOp, text, gicon) {
Name: 'ApproverSource', this._init(dispatchOp, text, gicon);
Extends: MessageTray.Source, }
ApproverSource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function(dispatchOp, text, gicon) { _init: function(dispatchOp, text, gicon) {
this.parent(text); MessageTray.Source.prototype._init.call(this, text);
this._gicon = gicon; this._gicon = gicon;
this._setSummaryIcon(this.createNotificationIcon()); this._setSummaryIcon(this.createNotificationIcon());
@ -1111,7 +1122,7 @@ const ApproverSource = new Lang.Class({
this._invalidId = 0; this._invalidId = 0;
} }
this.parent(); MessageTray.Source.prototype.destroy.call(this);
}, },
createNotificationIcon: function() { createNotificationIcon: function() {
@ -1119,19 +1130,23 @@ const ApproverSource = new Lang.Class({
icon_type: St.IconType.FULLCOLOR, icon_type: St.IconType.FULLCOLOR,
icon_size: this.ICON_SIZE }); icon_size: this.ICON_SIZE });
} }
}); }
const RoomInviteNotification = new Lang.Class({ function RoomInviteNotification(source, dispatchOp, channel, inviter) {
Name: 'RoomInviteNotification', this._init(source, dispatchOp, channel, inviter);
Extends: MessageTray.Notification, }
RoomInviteNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, dispatchOp, channel, inviter) { _init: function(source, dispatchOp, channel, inviter) {
this.parent(source, MessageTray.Notification.prototype._init.call(this,
/* translators: argument is a room name like source,
* room@jabber.org for example. */ /* translators: argument is a room name like
_("Invitation to %s").format(channel.get_identifier()), * room@jabber.org for example. */
null, _("Invitation to %s").format(channel.get_identifier()),
{ customContent: true }); null,
{ customContent: true });
this.setResident(true); this.setResident(true);
/* translators: first argument is the name of a contact and the second /* translators: first argument is the name of a contact and the second
@ -1158,12 +1173,15 @@ const RoomInviteNotification = new Lang.Class({
this.destroy(); this.destroy();
})); }));
} }
}); };
// Audio Video // Audio Video
const AudioVideoNotification = new Lang.Class({ function AudioVideoNotification(source, dispatchOp, channel, contact, isVideo) {
Name: 'AudioVideoNotification', this._init(source, dispatchOp, channel, contact, isVideo);
Extends: MessageTray.Notification, }
AudioVideoNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, dispatchOp, channel, contact, isVideo) { _init: function(source, dispatchOp, channel, contact, isVideo) {
let title = ''; let title = '';
@ -1175,7 +1193,11 @@ const AudioVideoNotification = new Lang.Class({
/* translators: argument is a contact name like Alice for example. */ /* translators: argument is a contact name like Alice for example. */
title = _("Call from %s").format(contact.get_alias()); title = _("Call from %s").format(contact.get_alias());
this.parent(this, source, title, null, { customContent: true }); MessageTray.Notification.prototype._init.call(this,
source,
title,
null,
{ customContent: true });
this.setResident(true); this.setResident(true);
this.addButton('reject', _("Reject")); this.addButton('reject', _("Reject"));
@ -1198,25 +1220,28 @@ const AudioVideoNotification = new Lang.Class({
this.destroy(); this.destroy();
})); }));
} }
}); };
// File Transfer // File Transfer
const FileTransferNotification = new Lang.Class({ function FileTransferNotification(source, dispatchOp, channel, contact) {
Name: 'FileTransferNotification', this._init(source, dispatchOp, channel, contact);
Extends: MessageTray.Notification, }
FileTransferNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, dispatchOp, channel, contact) { _init: function(source, dispatchOp, channel, contact) {
this.parent(this, MessageTray.Notification.prototype._init.call(this,
source, source,
/* To translators: The first parameter is /* To translators: The first parameter is
* the contact's alias and the second one is the * the contact's alias and the second one is the
* file name. The string will be something * file name. The string will be something
* like: "Alice is sending you test.ogg" * like: "Alice is sending you test.ogg"
*/ */
_("%s is sending you %s").format(contact.get_alias(), _("%s is sending you %s").format(contact.get_alias(),
channel.get_filename()), channel.get_filename()),
null, null,
{ customContent: true }); { customContent: true });
this.setResident(true); this.setResident(true);
this.addButton('decline', _("Decline")); this.addButton('decline', _("Decline"));
@ -1238,15 +1263,18 @@ const FileTransferNotification = new Lang.Class({
this.destroy(); this.destroy();
})); }));
} }
}); };
// A notification source that can embed multiple notifications // A notification source that can embed multiple notifications
const MultiNotificationSource = new Lang.Class({ function MultiNotificationSource(title, icon) {
Name: 'MultiNotificationSource', this._init(title, icon);
Extends: MessageTray.Source, }
MultiNotificationSource.prototype = {
__proto__: MessageTray.Source.prototype,
_init: function(title, icon) { _init: function(title, icon) {
this.parent(title); MessageTray.Source.prototype._init.call(this, title);
this._icon = icon; this._icon = icon;
this._setSummaryIcon(this.createNotificationIcon()); this._setSummaryIcon(this.createNotificationIcon());
@ -1254,7 +1282,7 @@ const MultiNotificationSource = new Lang.Class({
}, },
notify: function(notification) { notify: function(notification) {
this.parent(notification); MessageTray.Source.prototype.notify.call(this, notification);
this._nbNotifications += 1; this._nbNotifications += 1;
@ -1272,18 +1300,21 @@ const MultiNotificationSource = new Lang.Class({
icon_type: St.IconType.FULLCOLOR, icon_type: St.IconType.FULLCOLOR,
icon_size: this.ICON_SIZE }); icon_size: this.ICON_SIZE });
} }
}); };
// Subscription request // Subscription request
const SubscriptionRequestNotification = new Lang.Class({ function SubscriptionRequestNotification(source, contact) {
Name: 'SubscriptionRequestNotification', this._init(source, contact);
Extends: MessageTray.Notification, }
SubscriptionRequestNotification.prototype = {
__proto__: MessageTray.Notification.prototype,
_init: function(source, contact) { _init: function(source, contact) {
this.parent(this, source, MessageTray.Notification.prototype._init.call(this, source,
/* To translators: The parameter is the contact's alias */ /* To translators: The parameter is the contact's alias */
_("%s would like permission to see when you are online").format(contact.get_alias()), _("%s would like permission to see when you are online").format(contact.get_alias()),
null, { customContent: true }); null, { customContent: true });
this._contact = contact; this._contact = contact;
this._connection = contact.get_connection(); this._connection = contact.get_connection();
@ -1357,7 +1388,7 @@ const SubscriptionRequestNotification = new Lang.Class({
this._invalidatedId = 0; this._invalidatedId = 0;
} }
this.parent(); MessageTray.Notification.prototype.destroy.call(this);
}, },
_subscriptionStatesChangedCb: function(contact, subscribe, publish, msg) { _subscriptionStatesChangedCb: function(contact, subscribe, publish, msg) {
@ -1366,7 +1397,12 @@ const SubscriptionRequestNotification = new Lang.Class({
if (publish != Tp.SubscriptionState.ASK) if (publish != Tp.SubscriptionState.ASK)
this.destroy(); this.destroy();
} }
}); };
function AccountNotification(source, account, connectionError) {
this._init(source, account, connectionError);
}
// Messages from empathy/libempathy/empathy-utils.c // Messages from empathy/libempathy/empathy-utils.c
// create_errors_to_message_hash() // create_errors_to_message_hash()
@ -1421,16 +1457,15 @@ _connectionErrorMessages[Tp.error_get_dbus_name(Tp.Error.CERT_INSECURE)]
_connectionErrorMessages[Tp.error_get_dbus_name(Tp.Error.CERT_LIMIT_EXCEEDED)] _connectionErrorMessages[Tp.error_get_dbus_name(Tp.Error.CERT_LIMIT_EXCEEDED)]
= _("The length of the server certificate, or the depth of the server certificate chain, exceed the limits imposed by the cryptography library"); = _("The length of the server certificate, or the depth of the server certificate chain, exceed the limits imposed by the cryptography library");
const AccountNotification = new Lang.Class({ AccountNotification.prototype = {
Name: 'AccountNotification', __proto__: MessageTray.Notification.prototype,
Extends: MessageTray.Notification,
_init: function(source, account, connectionError) { _init: function(source, account, connectionError) {
this.parent(source, MessageTray.Notification.prototype._init.call(this, source,
/* translators: argument is the account name, like /* translators: argument is the account name, like
* name@jabber.org for example. */ * name@jabber.org for example. */
_("Connection to %s failed").format(account.get_display_name()), _("Connection to %s failed").format(account.get_display_name()),
null, { customContent: true }); null, { customContent: true });
this._label = new St.Label(); this._label = new St.Label();
this.addActor(this._label); this.addActor(this._label);
@ -1506,6 +1541,6 @@ const AccountNotification = new Lang.Class({
this._connectionStatusId = 0; this._connectionStatusId = 0;
} }
this.parent(); MessageTray.Notification.prototype.destroy.call(this);
} }
}); };

View File

@ -202,9 +202,11 @@ function registerSpecialPropertySplitter(name, splitFunction, parameters) {
// time updates; even better is to pay attention to the vertical // time updates; even better is to pay attention to the vertical
// vblank and sync to that when possible.) // vblank and sync to that when possible.)
// //
const ClutterFrameTicker = new Lang.Class({ function ClutterFrameTicker() {
Name: 'ClutterFrameTicker', this._init();
}
ClutterFrameTicker.prototype = {
FRAME_RATE : 60, FRAME_RATE : 60,
_init : function() { _init : function() {
@ -259,6 +261,6 @@ const ClutterFrameTicker = new Lang.Class({
this._startTime = -1; this._startTime = -1;
global.end_work(); global.end_work();
} }
}); };
Signals.addSignalMethods(ClutterFrameTicker.prototype); Signals.addSignalMethods(ClutterFrameTicker.prototype);

View File

@ -40,12 +40,15 @@ const IMStatus = {
// Copyright (C) 2008,2009 Red Hat, Inc. // Copyright (C) 2008,2009 Red Hat, Inc.
const IMStatusItem = new Lang.Class({ function IMStatusItem(label, iconName) {
Name: 'IMStatusItem', this._init(label, iconName);
Extends: PopupMenu.PopupBaseMenuItem, }
IMStatusItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
_init: function(label, iconName) { _init: function(label, iconName) {
this.parent(); PopupMenu.PopupBaseMenuItem.prototype._init.call(this);
this.actor.add_style_class_name('status-chooser-status-item'); this.actor.add_style_class_name('status-chooser-status-item');
@ -58,15 +61,19 @@ const IMStatusItem = new Lang.Class({
this.label = new St.Label({ text: label }); this.label = new St.Label({ text: label });
this.addActor(this.label); this.addActor(this.label);
} }
}); };
const IMUserNameItem = new Lang.Class({ function IMUserNameItem() {
Name: 'IMUserNameItem', this._init();
Extends: PopupMenu.PopupBaseMenuItem, }
IMUserNameItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
_init: function() { _init: function() {
this.parent({ reactive: false, PopupMenu.PopupBaseMenuItem.prototype._init.call(this,
style_class: 'status-chooser-user-name' }); { reactive: false,
style_class: 'status-chooser-user-name' });
this._wrapper = new Shell.GenericContainer(); this._wrapper = new Shell.GenericContainer();
this._wrapper.connect('get-preferred-width', this._wrapper.connect('get-preferred-width',
@ -95,15 +102,19 @@ const IMUserNameItem = new Lang.Class({
_wrapperAllocate: function(actor, box, flags) { _wrapperAllocate: function(actor, box, flags) {
this.label.allocate(box, flags); this.label.allocate(box, flags);
} }
}); };
const IMStatusChooserItem = new Lang.Class({ function IMStatusChooserItem() {
Name: 'IMStatusChooserItem', this._init();
Extends: PopupMenu.PopupBaseMenuItem, }
IMStatusChooserItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
_init: function() { _init: function() {
this.parent({ reactive: false, PopupMenu.PopupBaseMenuItem.prototype._init.call (this,
style_class: 'status-chooser' }); { reactive: false,
style_class: 'status-chooser' });
this._iconBin = new St.Button({ style_class: 'status-chooser-user-icon' }); this._iconBin = new St.Button({ style_class: 'status-chooser-user-icon' });
this.addActor(this._iconBin); this.addActor(this._iconBin);
@ -209,7 +220,7 @@ const IMStatusChooserItem = new Lang.Class({
this._userChangedId = 0; this._userChangedId = 0;
} }
this.parent(); PopupMenu.PopupBaseMenuItem.prototype.destroy.call(this);
}, },
// Override getColumnWidths()/setColumnWidths() to make the item // Override getColumnWidths()/setColumnWidths() to make the item
@ -298,7 +309,9 @@ const IMStatusChooserItem = new Lang.Class({
this._setComboboxPresence(presence); this._setComboboxPresence(presence);
if (!this._sessionPresenceRestored) { if (!this._sessionPresenceRestored) {
this._sessionStatusChanged(this._presence.status); this._presence.connectSignal('StatusChanged', Lang.bind(this, function (proxy, senderName, [status]) {
this._sessionStatusChanged(status);
}));
return; return;
} }
@ -411,16 +424,18 @@ const IMStatusChooserItem = new Lang.Class({
this._expectedPresence = newPresence; this._expectedPresence = newPresence;
this._accountMgr.set_all_requested_presences(newPresence, status, msg); this._accountMgr.set_all_requested_presences(newPresence, status, msg);
} }
}); };
const UserMenuButton = new Lang.Class({ function UserMenuButton() {
Name: 'UserMenuButton', this._init();
Extends: PanelMenu.Button, }
UserMenuButton.prototype = {
__proto__: PanelMenu.Button.prototype,
_init: function() { _init: function() {
this.parent(0.0); PanelMenu.Button.prototype._init.call(this, 0.0);
let box = new St.BoxLayout({ name: 'panelUserMenu' }); let box = new St.BoxLayout({ name: 'panelUserMenu' });
this.actor.add_actor(box); this.actor.add_actor(box);
@ -456,6 +471,10 @@ const UserMenuButton = new Lang.Class({
this._idleIcon = new St.Icon({ icon_name: 'user-idle', this._idleIcon = new St.Icon({ icon_name: 'user-idle',
style_class: 'popup-menu-icon' }); style_class: 'popup-menu-icon' });
this._presence.connectSignal('StatusChanged', Lang.bind(this, function (proxy, senderName, [status]) {
this._updateSwitch(status);
}));
this._accountMgr.connect('most-available-presence-changed', this._accountMgr.connect('most-available-presence-changed',
Lang.bind(this, this._updatePresenceIcon)); Lang.bind(this, this._updatePresenceIcon));
this._accountMgr.prepare_async(null, Lang.bind(this, this._accountMgr.prepare_async(null, Lang.bind(this,
@ -723,4 +742,4 @@ const UserMenuButton = new Lang.Class({
this._session.ShutdownRemote(); this._session.ShutdownRemote();
} }
} }
}); };

View File

@ -15,9 +15,11 @@ const SearchDisplay = imports.ui.searchDisplay;
const ShellEntry = imports.ui.shellEntry; const ShellEntry = imports.ui.shellEntry;
const Tweener = imports.ui.tweener; const Tweener = imports.ui.tweener;
const BaseTab = new Lang.Class({ function BaseTab(titleActor, pageActor, name, a11yIcon) {
Name: 'BaseTab', this._init(titleActor, pageActor, name, a11yIcon);
}
BaseTab.prototype = {
_init: function(titleActor, pageActor, name, a11yIcon) { _init: function(titleActor, pageActor, name, a11yIcon) {
this.title = titleActor; this.title = titleActor;
this.page = new St.Bin({ child: pageActor, this.page = new St.Bin({ child: pageActor,
@ -73,13 +75,16 @@ const BaseTab = new Lang.Class({
_activate: function() { _activate: function() {
this.emit('activated'); this.emit('activated');
} }
}); };
Signals.addSignalMethods(BaseTab.prototype); Signals.addSignalMethods(BaseTab.prototype);
const ViewTab = new Lang.Class({ function ViewTab(id, label, pageActor, a11yIcon) {
Name: 'ViewTab', this._init(id, label, pageActor, a11yIcon);
Extends: BaseTab, }
ViewTab.prototype = {
__proto__: BaseTab.prototype,
_init: function(id, label, pageActor, a11yIcon) { _init: function(id, label, pageActor, a11yIcon) {
this.id = id; this.id = id;
@ -88,14 +93,17 @@ const ViewTab = new Lang.Class({
style_class: 'view-tab-title' }); style_class: 'view-tab-title' });
titleActor.connect('clicked', Lang.bind(this, this._activate)); titleActor.connect('clicked', Lang.bind(this, this._activate));
this.parent(titleActor, pageActor, label, a11yIcon); BaseTab.prototype._init.call(this, titleActor, pageActor, label, a11yIcon);
} }
}); };
const SearchTab = new Lang.Class({ function SearchTab() {
Name: 'SearchTab', this._init();
Extends: BaseTab, }
SearchTab.prototype = {
__proto__: BaseTab.prototype,
_init: function() { _init: function() {
this.active = false; this.active = false;
@ -128,7 +136,11 @@ const SearchTab = new Lang.Class({
this._iconClickedId = 0; this._iconClickedId = 0;
this._searchResults = new SearchDisplay.SearchResults(this._searchSystem, this._openSearchSystem); this._searchResults = new SearchDisplay.SearchResults(this._searchSystem, this._openSearchSystem);
this.parent(this._entry, this._searchResults.actor, _("Search"), 'edit-find'); BaseTab.prototype._init.call(this,
this._entry,
this._searchResults.actor,
_("Search"),
'edit-find');
this._text.connect('text-changed', Lang.bind(this, this._onTextChanged)); this._text.connect('text-changed', Lang.bind(this, this._onTextChanged));
this._text.connect('key-press-event', Lang.bind(this, function (o, e) { this._text.connect('key-press-event', Lang.bind(this, function (o, e) {
@ -154,7 +166,7 @@ const SearchTab = new Lang.Class({
}, },
hide: function() { hide: function() {
this.parent(); BaseTab.prototype.hide.call(this);
// Leave the entry focused when it doesn't have any text; // Leave the entry focused when it doesn't have any text;
// when replacing a selected search term, Clutter emits // when replacing a selected search term, Clutter emits
@ -298,12 +310,14 @@ const SearchTab = new Lang.Class({
return false; return false;
} }
}); };
const ViewSelector = new Lang.Class({ function ViewSelector() {
Name: 'ViewSelector', this._init();
}
ViewSelector.prototype = {
_init : function() { _init : function() {
this.actor = new St.BoxLayout({ name: 'viewSelector', this.actor = new St.BoxLayout({ name: 'viewSelector',
vertical: true }); vertical: true });
@ -563,5 +577,5 @@ const ViewSelector = new Lang.Class({
removeSearchProvider: function(provider) { removeSearchProvider: function(provider) {
this._searchTab.removeSearchProvider(provider); this._searchTab.removeSearchProvider(provider);
} }
}); };
Signals.addSignalMethods(ViewSelector.prototype); Signals.addSignalMethods(ViewSelector.prototype);

View File

@ -6,9 +6,11 @@ const Shell = imports.gi.Shell;
const Main = imports.ui.main; const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray; const MessageTray = imports.ui.messageTray;
const WindowAttentionHandler = new Lang.Class({ function WindowAttentionHandler() {
Name: 'WindowAttentionHandler', this._init();
}
WindowAttentionHandler.prototype = {
_init : function() { _init : function() {
this._tracker = Shell.WindowTracker.get_default(); this._tracker = Shell.WindowTracker.get_default();
global.display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention)); global.display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention));
@ -41,14 +43,17 @@ const WindowAttentionHandler = new Lang.Class({
notification.update(title, banner); notification.update(title, banner);
}))); })));
} }
}); };
const Source = new Lang.Class({ function Source(app, window) {
Name: 'WindowAttentionSource', this._init(app, window);
Extends: MessageTray.Source, }
Source.prototype = {
__proto__ : MessageTray.Source.prototype,
_init: function(app, window) { _init: function(app, window) {
this.parent(app.get_name()); MessageTray.Source.prototype._init.call(this, app.get_name());
this._window = window; this._window = window;
this._app = app; this._app = app;
this._setSummaryIcon(this.createNotificationIcon()); this._setSummaryIcon(this.createNotificationIcon());
@ -76,4 +81,4 @@ const Source = new Lang.Class({
Main.activateWindow(this._window); Main.activateWindow(this._window);
this.destroy(); this.destroy();
} }
}); };

View File

@ -31,9 +31,11 @@ function getTopInvisibleBorder(metaWindow) {
return outerRect.y - inputRect.y; return outerRect.y - inputRect.y;
} }
const WindowDimmer = new Lang.Class({ function WindowDimmer(actor) {
Name: 'WindowDimmer', this._init(actor);
}
WindowDimmer.prototype = {
_init: function(actor) { _init: function(actor) {
if (Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL)) { if (Clutter.feature_available(Clutter.FeatureFlags.SHADERS_GLSL)) {
this._effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER }); this._effect = new Clutter.ShaderEffect({ shader_type: Clutter.ShaderType.FRAGMENT_SHADER });
@ -73,7 +75,7 @@ const WindowDimmer = new Lang.Class({
}, },
_dimFraction: 0.0 _dimFraction: 0.0
}); };
function getWindowDimmer(actor) { function getWindowDimmer(actor) {
if (!actor._windowDimmer) if (!actor._windowDimmer)
@ -82,12 +84,15 @@ function getWindowDimmer(actor) {
return actor._windowDimmer; return actor._windowDimmer;
} }
const WindowManager = new Lang.Class({ function WindowManager() {
Name: 'WindowManager', this._init();
}
WindowManager.prototype = {
_init : function() { _init : function() {
this._shellwm = global.window_manager; this._shellwm = global.window_manager;
this._keyBindingHandlers = [];
this._minimizing = []; this._minimizing = [];
this._maximizing = []; this._maximizing = [];
this._unmaximizing = []; this._unmaximizing = [];
@ -116,24 +121,15 @@ const WindowManager = new Lang.Class({
this._shellwm.connect('destroy', Lang.bind(this, this._destroyWindow)); this._shellwm.connect('destroy', Lang.bind(this, this._destroyWindow));
this._workspaceSwitcherPopup = null; this._workspaceSwitcherPopup = null;
Meta.keybindings_set_custom_handler('switch-to-workspace-left', this.setKeybindingHandler('switch-to-workspace-left', Lang.bind(this, this._showWorkspaceSwitcher));
Lang.bind(this, this._showWorkspaceSwitcher)); this.setKeybindingHandler('switch-to-workspace-right', Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('switch-to-workspace-right', this.setKeybindingHandler('switch-to-workspace-up', Lang.bind(this, this._showWorkspaceSwitcher));
Lang.bind(this, this._showWorkspaceSwitcher)); this.setKeybindingHandler('switch-to-workspace-down', Lang.bind(this, this._showWorkspaceSwitcher));
Meta.keybindings_set_custom_handler('switch-to-workspace-up', this.setKeybindingHandler('switch-windows', Lang.bind(this, this._startAppSwitcher));
Lang.bind(this, this._showWorkspaceSwitcher)); this.setKeybindingHandler('switch-group', Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-to-workspace-down', this.setKeybindingHandler('switch-windows-backward', Lang.bind(this, this._startAppSwitcher));
Lang.bind(this, this._showWorkspaceSwitcher)); this.setKeybindingHandler('switch-group-backward', Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-windows', this.setKeybindingHandler('switch-panels', Lang.bind(this, this._startA11ySwitcher));
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group',
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-windows-backward',
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group-backward',
Lang.bind(this, this._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-panels',
Lang.bind(this, this._startA11ySwitcher));
Main.overview.connect('showing', Lang.bind(this, function() { Main.overview.connect('showing', Lang.bind(this, function() {
for (let i = 0; i < this._dimmedWindows.length; i++) for (let i = 0; i < this._dimmedWindows.length; i++)
@ -145,6 +141,16 @@ const WindowManager = new Lang.Class({
})); }));
}, },
setKeybindingHandler: function(keybinding, handler){
if (this._keyBindingHandlers[keybinding])
this._shellwm.disconnect(this._keyBindingHandlers[keybinding]);
else
this._shellwm.takeover_keybinding(keybinding);
this._keyBindingHandlers[keybinding] =
this._shellwm.connect('keybinding::' + keybinding, handler);
},
blockAnimations: function() { blockAnimations: function() {
this._animationBlockCount++; this._animationBlockCount++;
}, },
@ -528,41 +534,37 @@ const WindowManager = new Lang.Class({
shellwm.completed_switch_workspace(); shellwm.completed_switch_workspace();
}, },
_startAppSwitcher : function(display, screen, window, binding) { _startAppSwitcher : function(shellwm, binding, mask, window, backwards) {
/* prevent a corner case where both popups show up at once */ /* prevent a corner case where both popups show up at once */
if (this._workspaceSwitcherPopup != null) if (this._workspaceSwitcherPopup != null)
this._workspaceSwitcherPopup.actor.hide(); this._workspaceSwitcherPopup.actor.hide();
let tabPopup = new AltTab.AltTabPopup(); let tabPopup = new AltTab.AltTabPopup();
let modifiers = binding.get_modifiers(); if (!tabPopup.show(backwards, binding, mask))
let backwards = modifiers & Meta.VirtualModifier.SHIFT_MASK;
if (!tabPopup.show(backwards, binding.get_name(), binding.get_mask()))
tabPopup.destroy(); tabPopup.destroy();
}, },
_startA11ySwitcher : function(display, screen, window, binding) { _startA11ySwitcher : function(shellwm, binding, mask, window, backwards) {
let modifiers = binding.get_modifiers(); Main.ctrlAltTabManager.popup(backwards, mask);
let backwards = modifiers & Meta.VirtualModifier.SHIFT_MASK;
Main.ctrlAltTabManager.popup(backwards, binding.get_mask());
}, },
_showWorkspaceSwitcher : function(display, screen, window, binding) { _showWorkspaceSwitcher : function(shellwm, binding, mask, window, backwards) {
if (screen.n_workspaces == 1) if (global.screen.n_workspaces == 1)
return; return;
if (this._workspaceSwitcherPopup == null) if (this._workspaceSwitcherPopup == null)
this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup();
if (binding.get_name() == 'switch-to-workspace-up') if (binding == 'switch-to-workspace-up')
this.actionMoveWorkspaceUp(); this.actionMoveWorkspaceUp();
else if (binding.get_name() == 'switch-to-workspace-down') else if (binding == 'switch-to-workspace-down')
this.actionMoveWorkspaceDown(); this.actionMoveWorkspaceDown();
// left/right would effectively act as synonyms for up/down if we enabled them; // left/right would effectively act as synonyms for up/down if we enabled them;
// but that could be considered confusing. // but that could be considered confusing.
// else if (binding.get_name() == 'switch-to-workspace-left') // else if (binding == 'switch-to-workspace-left')
// this.actionMoveWorkspaceLeft(); // this.actionMoveWorkspaceLeft();
// else if (binding.get_name() == 'switch-to-workspace-right') // else if (binding == 'switch-to-workspace-right')
// this.actionMoveWorkspaceRight(); // this.actionMoveWorkspaceRight();
}, },
@ -623,4 +625,4 @@ const WindowManager = new Lang.Class({
if (!Main.overview.visible) if (!Main.overview.visible)
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.DOWN, indexToActivate); this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.DOWN, indexToActivate);
} }
}); };

View File

@ -56,13 +56,11 @@ function _clamp(value, min, max) {
} }
const ScaledPoint = new Lang.Class({ function ScaledPoint(x, y, scaleX, scaleY) {
Name: 'ScaledPoint', [this.x, this.y, this.scaleX, this.scaleY] = arguments;
}
_init: function(x, y, scaleX, scaleY) {
[this.x, this.y, this.scaleX, this.scaleY] = arguments;
},
ScaledPoint.prototype = {
getPosition : function() { getPosition : function() {
return [this.x, this.y]; return [this.x, this.y];
}, },
@ -88,12 +86,14 @@ const ScaledPoint = new Lang.Class({
return [_interpolate(this.scaleX, other.scaleX, step), return [_interpolate(this.scaleX, other.scaleX, step),
_interpolate(this.scaleY, other.scaleY, step)]; _interpolate(this.scaleY, other.scaleY, step)];
} }
}); };
const WindowClone = new Lang.Class({ function WindowClone(realWindow) {
Name: 'WindowClone', this._init(realWindow);
}
WindowClone.prototype = {
_init : function(realWindow) { _init : function(realWindow) {
this.realWindow = realWindow; this.realWindow = realWindow;
this.metaWindow = realWindow.meta_window; this.metaWindow = realWindow.meta_window;
@ -418,7 +418,7 @@ const WindowClone = new Lang.Class({
this.emit('drag-end'); this.emit('drag-end');
} }
}); };
Signals.addSignalMethods(WindowClone.prototype); Signals.addSignalMethods(WindowClone.prototype);
@ -427,9 +427,11 @@ Signals.addSignalMethods(WindowClone.prototype);
* @parentActor: The actor which will be the parent of all overlay items * @parentActor: The actor which will be the parent of all overlay items
* such as app icon and window caption * such as app icon and window caption
*/ */
const WindowOverlay = new Lang.Class({ function WindowOverlay(windowClone, parentActor) {
Name: 'WindowOverlay', this._init(windowClone, parentActor);
}
WindowOverlay.prototype = {
_init : function(windowClone, parentActor) { _init : function(windowClone, parentActor) {
let metaWindow = windowClone.metaWindow; let metaWindow = windowClone.metaWindow;
@ -640,7 +642,7 @@ const WindowOverlay = new Lang.Class({
this._parentActor.queue_relayout(); this._parentActor.queue_relayout();
} }
}); };
Signals.addSignalMethods(WindowOverlay.prototype); Signals.addSignalMethods(WindowOverlay.prototype);
const WindowPositionFlags = { const WindowPositionFlags = {
@ -651,9 +653,11 @@ const WindowPositionFlags = {
/** /**
* @metaWorkspace: a #Meta.Workspace, or null * @metaWorkspace: a #Meta.Workspace, or null
*/ */
const Workspace = new Lang.Class({ function Workspace(metaWorkspace, monitorIndex) {
Name: 'Workspace', this._init(metaWorkspace, monitorIndex);
}
Workspace.prototype = {
_init : function(metaWorkspace, monitorIndex) { _init : function(metaWorkspace, monitorIndex) {
// When dragging a window, we use this slot for reserve space. // When dragging a window, we use this slot for reserve space.
this._reservedSlot = null; this._reservedSlot = null;
@ -1514,6 +1518,6 @@ const Workspace = new Lang.Class({
return false; return false;
} }
}); };
Signals.addSignalMethods(Workspace.prototype); Signals.addSignalMethods(Workspace.prototype);

View File

@ -15,9 +15,11 @@ const DISPLAY_TIMEOUT = 600;
const UP = -1; const UP = -1;
const DOWN = 1; const DOWN = 1;
const WorkspaceSwitcherPopup = new Lang.Class({ function WorkspaceSwitcherPopup() {
Name: 'WorkspaceSwitcherPopup', this._init();
}
WorkspaceSwitcherPopup.prototype = {
_init : function() { _init : function() {
this.actor = new St.Group({ reactive: true, this.actor = new St.Group({ reactive: true,
x: 0, x: 0,
@ -156,4 +158,4 @@ const WorkspaceSwitcherPopup = new Lang.Class({
onCompleteScope: this onCompleteScope: this
}); });
} }
}); };

View File

@ -25,9 +25,11 @@ const SLIDE_ANIMATION_TIME = 0.2;
// placeholder exactly. // placeholder exactly.
const WORKSPACE_CUT_SIZE = 10; const WORKSPACE_CUT_SIZE = 10;
const WindowClone = new Lang.Class({ function WindowClone(realWindow) {
Name: 'WindowClone', this._init(realWindow);
}
WindowClone.prototype = {
_init : function(realWindow) { _init : function(realWindow) {
this.actor = new Clutter.Clone({ source: realWindow.get_texture(), this.actor = new Clutter.Clone({ source: realWindow.get_texture(),
reactive: true }); reactive: true });
@ -124,7 +126,7 @@ const WindowClone = new Lang.Class({
this.emit('drag-end'); this.emit('drag-end');
} }
}); };
Signals.addSignalMethods(WindowClone.prototype); Signals.addSignalMethods(WindowClone.prototype);
@ -142,9 +144,11 @@ const ThumbnailState = {
/** /**
* @metaWorkspace: a #Meta.Workspace * @metaWorkspace: a #Meta.Workspace
*/ */
const WorkspaceThumbnail = new Lang.Class({ function WorkspaceThumbnail(metaWorkspace) {
Name: 'WorkspaceThumbnail', this._init(metaWorkspace);
}
WorkspaceThumbnail.prototype = {
_init : function(metaWorkspace) { _init : function(metaWorkspace) {
this.metaWorkspace = metaWorkspace; this.metaWorkspace = metaWorkspace;
this.monitorIndex = Main.layoutManager.primaryIndex; this.monitorIndex = Main.layoutManager.primaryIndex;
@ -465,14 +469,16 @@ const WorkspaceThumbnail = new Lang.Class({
return false; return false;
} }
}); };
Signals.addSignalMethods(WorkspaceThumbnail.prototype); Signals.addSignalMethods(WorkspaceThumbnail.prototype);
const ThumbnailsBox = new Lang.Class({ function ThumbnailsBox() {
Name: 'ThumbnailsBox', this._init();
}
ThumbnailsBox.prototype = {
_init: function() { _init: function() {
this.actor = new Shell.GenericContainer({ style_class: 'workspace-thumbnails', this.actor = new Shell.GenericContainer({ style_class: 'workspace-thumbnails',
request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT }); request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT });
@ -591,7 +597,7 @@ const ThumbnailsBox = new Lang.Class({
// ... and bam, a workspace, good as new. // ... and bam, a workspace, good as new.
source.metaWindow.change_workspace_by_index(newWorkspaceIndex, source.metaWindow.change_workspace_by_index(newWorkspaceIndex,
true, time); true, time);
else if (source.shellWorkspaceLaunch) else (source.shellWorkspaceLaunch)
source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex, source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex,
timestamp: time }); timestamp: time });
@ -1022,4 +1028,4 @@ const ThumbnailsBox = new Lang.Class({
onCompleteScope: this onCompleteScope: this
}); });
} }
}); };

View File

@ -23,9 +23,11 @@ const MAX_WORKSPACES = 16;
const CONTROLS_POP_IN_TIME = 0.1; const CONTROLS_POP_IN_TIME = 0.1;
const WorkspacesView = new Lang.Class({ function WorkspacesView(workspaces) {
Name: 'WorkspacesView', this._init(workspaces);
}
WorkspacesView.prototype = {
_init: function(workspaces) { _init: function(workspaces) {
this.actor = new St.Group({ style_class: 'workspaces-view' }); this.actor = new St.Group({ style_class: 'workspaces-view' });
@ -450,13 +452,15 @@ const WorkspacesView = new Lang.Class({
_getWorkspaceIndexToRemove: function() { _getWorkspaceIndexToRemove: function() {
return global.screen.get_active_workspace_index(); return global.screen.get_active_workspace_index();
} }
}); };
Signals.addSignalMethods(WorkspacesView.prototype); Signals.addSignalMethods(WorkspacesView.prototype);
const WorkspacesDisplay = new Lang.Class({ function WorkspacesDisplay() {
Name: 'WorkspacesDisplay', this._init();
}
WorkspacesDisplay.prototype = {
_init: function() { _init: function() {
this.actor = new Shell.GenericContainer(); this.actor = new Shell.GenericContainer();
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
@ -848,5 +852,5 @@ const WorkspacesDisplay = new Lang.Class({
break; break;
} }
} }
}); };
Signals.addSignalMethods(WorkspacesDisplay.prototype); Signals.addSignalMethods(WorkspacesDisplay.prototype);

View File

@ -6,9 +6,11 @@ const Shell = imports.gi.Shell;
const Signals = imports.signals; const Signals = imports.signals;
const DND = imports.ui.dnd; const DND = imports.ui.dnd;
const XdndHandler = new Lang.Class({ function XdndHandler() {
Name: 'XdndHandler', this._init();
}
XdndHandler.prototype = {
_init: function() { _init: function() {
// Used to display a clone of the cursor window when the // Used to display a clone of the cursor window when the
// window group is hidden (like it happens in the overview) // window group is hidden (like it happens in the overview)
@ -123,6 +125,6 @@ const XdndHandler = new Lang.Class({
pickedActor = pickedActor.get_parent(); pickedActor = pickedActor.get_parent();
} }
} }
}); }
Signals.addSignalMethods(XdndHandler.prototype); Signals.addSignalMethods(XdndHandler.prototype);

1405
po/el.po

File diff suppressed because it is too large Load Diff

504
po/es.po

File diff suppressed because it is too large Load Diff

298
po/fi.po
View File

@ -19,20 +19,18 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnome-shell\n" "Project-Id-Version: gnome-shell\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "Report-Msgid-Bugs-To: \n"
"shell&keywords=I18N+L10N&component=general\n" "POT-Creation-Date: 2011-09-26 15:40+0300\n"
"POT-Creation-Date: 2011-10-18 19:39+0000\n" "PO-Revision-Date: 2011-09-26 15:39+0300\n"
"PO-Revision-Date: 2011-11-15 22:19+0200\n" "Last-Translator: Tommi Vainikainen <thv@iki.fi>\n"
"Last-Translator: Ville-Pekka Vainio <vpvainio@iki.fi>\n"
"Language-Team: Finnish <gnome-fi-laatu@lists.sourceforge.net>\n" "Language-Team: Finnish <gnome-fi-laatu@lists.sourceforge.net>\n"
"Language: fi\n" "Language: fi\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Virtaal 0.7.1-rc1\n" "X-Generator: Virtaal 0.6.1\n"
"X-DamnedLies-Scope: partial\n" "X-DamnedLies-Scope: partial\n"
"X-Project-Style: gnome\n"
#: ../data/gnome-shell.desktop.in.in.h:1 #: ../data/gnome-shell.desktop.in.in.h:1
msgid "GNOME Shell" msgid "GNOME Shell"
@ -42,7 +40,6 @@ msgstr "Gnomen ikkunanhallinta"
msgid "Window management and application launching" msgid "Window management and application launching"
msgstr "Ikkunanhallinta ja sovelluksien käynnistäminen" msgstr "Ikkunanhallinta ja sovelluksien käynnistäminen"
#: ../data/org.gnome.shell.gschema.xml.in.h:1
msgid "" msgid ""
"Allows access to internal debugging and monitoring tools using the Alt-F2 " "Allows access to internal debugging and monitoring tools using the Alt-F2 "
"dialog." "dialog."
@ -50,20 +47,16 @@ msgstr ""
"Salli pääsy sisäiseen vianselvitys- ja monitorointityökaluun Alt-F2-ikkunan " "Salli pääsy sisäiseen vianselvitys- ja monitorointityökaluun Alt-F2-ikkunan "
"kautta." "kautta."
#: ../data/org.gnome.shell.gschema.xml.in.h:2
msgid "Enable internal tools useful for developers and testers from Alt-F2" msgid "Enable internal tools useful for developers and testers from Alt-F2"
msgstr "" msgstr ""
"Ota käyttöön sisäiset kehittäjiä ja testaajia hyödyttävät työkalut Alt-F2:sta" "Ota käyttöön sisäiset kehittäjiä ja testaajia hyödyttävät työkalut Alt-F2:sta"
#: ../data/org.gnome.shell.gschema.xml.in.h:3
msgid "File extension used for storing the screencast" msgid "File extension used for storing the screencast"
msgstr "Tiedostopääte ruutunauhoitusten tallentamiseen" msgstr "Tiedostopääte ruutunauhoitusten tallentamiseen"
#: ../data/org.gnome.shell.gschema.xml.in.h:4
msgid "Framerate used for recording screencasts." msgid "Framerate used for recording screencasts."
msgstr "Ruutunauhoitusten kuvataajuus." msgstr "Ruutunauhoitusten kuvataajuus."
#: ../data/org.gnome.shell.gschema.xml.in.h:5
msgid "" msgid ""
"GNOME Shell extensions have a uuid property; this key lists extensions which " "GNOME Shell extensions have a uuid property; this key lists extensions which "
"should be loaded. disabled-extensions overrides this setting for extensions " "should be loaded. disabled-extensions overrides this setting for extensions "
@ -74,31 +67,24 @@ msgstr ""
"kytketyt laajennukset) ylittää tämän asetuksen mikäli laajennus esiintyy " "kytketyt laajennukset) ylittää tämän asetuksen mikäli laajennus esiintyy "
"molemmissa luetteloissa." "molemmissa luetteloissa."
#: ../data/org.gnome.shell.gschema.xml.in.h:6
msgid "History for command (Alt-F2) dialog" msgid "History for command (Alt-F2) dialog"
msgstr "Historia komentoikkunalle (Alt-F2)" msgstr "Historia komentoikkunalle (Alt-F2)"
#: ../data/org.gnome.shell.gschema.xml.in.h:7
msgid "History for the looking glass dialog" msgid "History for the looking glass dialog"
msgstr "Historia näyttölasi-ikkunalle" msgstr "Historia näyttölasi-ikkunalle"
#: ../data/org.gnome.shell.gschema.xml.in.h:8
msgid "If true, display date in the clock, in addition to time." msgid "If true, display date in the clock, in addition to time."
msgstr "Jos tosi, näytä päivämäärä kellossa ajan lisäksi." msgstr "Jos tosi, näytä päivämäärä kellossa ajan lisäksi."
#: ../data/org.gnome.shell.gschema.xml.in.h:9
msgid "If true, display seconds in time." msgid "If true, display seconds in time."
msgstr "Jos tosi, näytä sekunnit ajassa." msgstr "Jos tosi, näytä sekunnit ajassa."
#: ../data/org.gnome.shell.gschema.xml.in.h:10
msgid "If true, display the ISO week date in the calendar." msgid "If true, display the ISO week date in the calendar."
msgstr "Jos tosi, näytä ISO-viikonpäivät kalenterissa." msgstr "Jos tosi, näytä ISO-viikonpäivät kalenterissa."
#: ../data/org.gnome.shell.gschema.xml.in.h:11
msgid "List of desktop file IDs for favorite applications" msgid "List of desktop file IDs for favorite applications"
msgstr "Luettelo työpöytätiedostojen tunnisteista lempisovelluksille" msgstr "Luettelo työpöytätiedostojen tunnisteista lempisovelluksille"
#: ../data/org.gnome.shell.gschema.xml.in.h:13
#, no-c-format #, no-c-format
msgid "" msgid ""
"Sets the GStreamer pipeline used to encode recordings. It follows the syntax " "Sets the GStreamer pipeline used to encode recordings. It follows the syntax "
@ -124,25 +110,20 @@ msgstr ""
"muotoon VP8-koodekilla. %T korvautuu arvauksella parhaan suorituskyvy " "muotoon VP8-koodekilla. %T korvautuu arvauksella parhaan suorituskyvy "
"antavasta säiemäärästä järjestelmässä." "antavasta säiemäärästä järjestelmässä."
#: ../data/org.gnome.shell.gschema.xml.in.h:14
msgid "Show date in clock" msgid "Show date in clock"
msgstr "Näytä päivämäärä kellossa" msgstr "Näytä päivämäärä kellossa"
#: ../data/org.gnome.shell.gschema.xml.in.h:15
msgid "Show the week date in the calendar" msgid "Show the week date in the calendar"
msgstr "Näytä viikonpäivä kalenterissa" msgstr "Näytä viikonpäivä kalenterissa"
#: ../data/org.gnome.shell.gschema.xml.in.h:16
msgid "Show time with seconds" msgid "Show time with seconds"
msgstr "Näytä aika sekuntien kera" msgstr "Näytä aika sekuntien kera"
#: ../data/org.gnome.shell.gschema.xml.in.h:17
msgid "" msgid ""
"The applications corresponding to these identifiers will be displayed in the " "The applications corresponding to these identifiers will be displayed in the "
"favorites area." "favorites area."
msgstr "Näitä tunnisteita vastaavat sovellukset näytetään suosikkien alueella." msgstr "Näitä tunnisteita vastaavat sovellukset näytetään suosikkien alueella."
#: ../data/org.gnome.shell.gschema.xml.in.h:18
msgid "" msgid ""
"The filename for recorded screencasts will be a unique filename based on the " "The filename for recorded screencasts will be a unique filename based on the "
"current date, and use this extension. It should be changed when recording to " "current date, and use this extension. It should be changed when recording to "
@ -152,7 +133,6 @@ msgstr ""
"nykyisen päivämäärän ja tämän tiedostopäätteen mukaisesti. Tiedostopääte " "nykyisen päivämäärän ja tämän tiedostopäätteen mukaisesti. Tiedostopääte "
"tulisi vaihtaa mikäli nauhoitetaan eri tallennusmuotoon." "tulisi vaihtaa mikäli nauhoitetaan eri tallennusmuotoon."
#: ../data/org.gnome.shell.gschema.xml.in.h:19
msgid "" msgid ""
"The framerate of the resulting screencast recordered by GNOME Shell's " "The framerate of the resulting screencast recordered by GNOME Shell's "
"screencast recorder in frames-per-second." "screencast recorder in frames-per-second."
@ -160,11 +140,9 @@ msgstr ""
"Nauhoituksesta tuloksena saatavan ruutunauhoituksen kuvataajuus kun käytössä " "Nauhoituksesta tuloksena saatavan ruutunauhoituksen kuvataajuus kun käytössä "
"on GNOMEn ikkunanhallinnan nauhoitin, kuvaa per sekunti." "on GNOMEn ikkunanhallinnan nauhoitin, kuvaa per sekunti."
#: ../data/org.gnome.shell.gschema.xml.in.h:20
msgid "The gstreamer pipeline used to encode the screencast" msgid "The gstreamer pipeline used to encode the screencast"
msgstr "Gstreamer-liukuhihna jolla ruutunauhoitukset pakataan" msgstr "Gstreamer-liukuhihna jolla ruutunauhoitukset pakataan"
#: ../data/org.gnome.shell.gschema.xml.in.h:21
msgid "" msgid ""
"The shell normally monitors active applications in order to present the most " "The shell normally monitors active applications in order to present the most "
"used ones (e.g. in launchers). While this data will be kept private, you may " "used ones (e.g. in launchers). While this data will be kept private, you may "
@ -177,72 +155,52 @@ msgstr ""
"yksityisyyden vuoksi. Huomaa että pois kytkeminen ei poista aiemmin " "yksityisyyden vuoksi. Huomaa että pois kytkeminen ei poista aiemmin "
"tallennettuja tietoja." "tallennettuja tietoja."
#: ../data/org.gnome.shell.gschema.xml.in.h:22
msgid "The type of keyboard to use." msgid "The type of keyboard to use."
msgstr "Käytettävän näppäimistön tyyppi." msgstr "Käytettävän näppäimistön tyyppi."
#: ../data/org.gnome.shell.gschema.xml.in.h:23
msgid "Uuids of extensions to enable" msgid "Uuids of extensions to enable"
msgstr "Käyttöön otettavien laajennosten UUID:t" msgstr "Käyttöön otettavien laajennosten UUID:t"
#: ../data/org.gnome.shell.gschema.xml.in.h:24
msgid "Whether to collect stats about applications usage" msgid "Whether to collect stats about applications usage"
msgstr "Kerätäänkö sovellusten käytöstä tilastoja" msgstr "Kerätäänkö sovellusten käytöstä tilastoja"
#: ../data/org.gnome.shell.gschema.xml.in.h:25
msgid "Which keyboard to use" msgid "Which keyboard to use"
msgstr "Mitä näppäimistöä käytetään" msgstr "Mitä näppäimistöä käytetään"
#: ../data/org.gnome.shell.gschema.xml.in.h:26
msgid "disabled OpenSearch providers" msgid "disabled OpenSearch providers"
msgstr "käytöstä poistetut OpenSearch-tarjoajat" msgstr "käytöstä poistetut OpenSearch-tarjoajat"
#: ../js/gdm/loginDialog.js:633
msgid "Session..." msgid "Session..."
msgstr "Istunto…" msgstr "Istunto…"
#: ../js/gdm/loginDialog.js:804
msgctxt "title" msgctxt "title"
msgid "Sign In" msgid "Sign In"
msgstr "Kirjaudu sisään" msgstr "Kirjaudu sisään"
#. translators: this message is shown below the password entry field #. translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead #. to indicate the user can swipe their finger instead
#: ../js/gdm/loginDialog.js:849
msgid "(or swipe finger)" msgid "(or swipe finger)"
msgstr "(tai pyyhkäise sormella)" msgstr "(tai pyyhkäise sormella)"
#: ../js/gdm/loginDialog.js:867
msgid "Not listed?" msgid "Not listed?"
msgstr "Ei luettelossa?" msgstr "Ei luettelossa?"
#: ../js/gdm/loginDialog.js:1035 ../js/ui/endSessionDialog.js:426
#: ../js/ui/extensionSystem.js:477 ../js/ui/networkAgent.js:148
#: ../js/ui/polkitAuthenticationAgent.js:173 ../js/ui/status/bluetooth.js:480
msgid "Cancel" msgid "Cancel"
msgstr "Peru" msgstr "Peru"
#: ../js/gdm/loginDialog.js:1040
msgctxt "button" msgctxt "button"
msgid "Sign In" msgid "Sign In"
msgstr "Kirjaudu sisään" msgstr "Kirjaudu sisään"
#: ../js/gdm/loginDialog.js:1392
msgid "Login Window" msgid "Login Window"
msgstr "Kirjautumisikkuna" msgstr "Kirjautumisikkuna"
#: ../js/gdm/powerMenu.js:116 ../js/ui/userMenu.js:554
#: ../js/ui/userMenu.js:556 ../js/ui/userMenu.js:625
msgid "Suspend" msgid "Suspend"
msgstr "Valmiustila" msgstr "Valmiustila"
#: ../js/gdm/powerMenu.js:121 ../js/ui/endSessionDialog.js:89
#: ../js/ui/endSessionDialog.js:97 ../js/ui/endSessionDialog.js:106
msgid "Restart" msgid "Restart"
msgstr "Käynnistä uudelleen" msgstr "Käynnistä uudelleen"
#: ../js/gdm/powerMenu.js:126 ../js/ui/endSessionDialog.js:80
#: ../js/ui/endSessionDialog.js:91
msgid "Power Off" msgid "Power Off"
msgstr "Sammuta" msgstr "Sammuta"
@ -296,16 +254,13 @@ msgstr "%s on lisätty suosikkeihin."
msgid "%s has been removed from your favorites." msgid "%s has been removed from your favorites."
msgstr "%s on poistettu suosikeista." msgstr "%s on poistettu suosikeista."
#: ../js/ui/autorunManager.js:280
msgid "Removable Devices" msgid "Removable Devices"
msgstr "Irroitettavat laitteet" msgstr "Irroitettavat laitteet"
#: ../js/ui/autorunManager.js:590
#, c-format #, c-format
msgid "Open with %s" msgid "Open with %s"
msgstr "Avaa käyttäen sovellusta %s" msgstr "Avaa käyttäen %s"
#: ../js/ui/autorunManager.js:616
msgid "Eject" msgid "Eject"
msgstr "Poista asemasta" msgstr "Poista asemasta"
@ -457,32 +412,28 @@ msgstr "Tällä viikolla"
msgid "Next week" msgid "Next week"
msgstr "Ensi viikolla" msgstr "Ensi viikolla"
#: ../js/ui/contactDisplay.js:65 ../js/ui/notificationDaemon.js:459 #: ../js/ui/contactDisplay.js:59 ../js/ui/notificationDaemon.js:444
#: ../js/ui/status/power.js:223 ../src/shell-app.c:353 #: ../js/ui/status/power.js:223 ../src/shell-app.c:355
msgid "Unknown" msgid "Unknown"
msgstr "Tuntematon" msgstr "Tuntematon"
#: ../js/ui/contactDisplay.js:86 ../js/ui/userMenu.js:139
msgid "Available" msgid "Available"
msgstr "Tavoitettavissa" msgstr "Tavoitettavissa"
#: ../js/ui/contactDisplay.js:91 ../js/ui/userMenu.js:148
msgid "Away" msgid "Away"
msgstr "Poissa" msgstr "Poissa"
#: ../js/ui/contactDisplay.js:95 ../js/ui/userMenu.js:142
msgid "Busy" msgid "Busy"
msgstr "Kiireinen" msgstr "Kiireinen"
#: ../js/ui/contactDisplay.js:99 #: ../js/ui/contactDisplay.js:93
msgid "Offline" msgid "Offline"
msgstr "Ei linjoilla" msgstr "Ei linjoilla"
#: ../js/ui/contactDisplay.js:146 #: ../js/ui/contactDisplay.js:140
msgid "CONTACTS" msgid "CONTACTS"
msgstr "YHTEYSTIEDOT" msgstr "YHTEYSTIEDOT"
#: ../js/ui/dash.js:174 ../js/ui/messageTray.js:1206
msgid "Remove" msgid "Remove"
msgstr "Poista" msgstr "Poista"
@ -632,131 +583,108 @@ msgstr "Asenna"
msgid "Download and install '%s' from extensions.gnome.org?" msgid "Download and install '%s' from extensions.gnome.org?"
msgstr "Lataa ja asenna ”%s” sivustolta extensions.gnome.org?" msgstr "Lataa ja asenna ”%s” sivustolta extensions.gnome.org?"
#: ../js/ui/keyboard.js:325
msgid "tray"
msgstr "ilmoitusalue"
#: ../js/ui/keyboard.js:547 ../js/ui/status/power.js:211
msgid "Keyboard" msgid "Keyboard"
msgstr "Näppäimistö" msgstr "Näppäimistö"
#: ../js/ui/lookingGlass.js:646 #: ../js/ui/lookingGlass.js:645
msgid "No extensions installed" msgid "No extensions installed"
msgstr "Laajennuksia ei asennettu" msgstr "Laajennuksia ei asennettu"
#: ../js/ui/lookingGlass.js:692 #: ../js/ui/lookingGlass.js:691
msgid "Enabled" msgid "Enabled"
msgstr "Käytössä" msgstr "Käytössä"
#. translators: #. translators:
#. * The device has been disabled #. * The device has been disabled
#: ../js/ui/lookingGlass.js:694 ../src/gvc/gvc-mixer-control.c:1093 #: ../js/ui/lookingGlass.js:693 ../src/gvc/gvc-mixer-control.c:1093
msgid "Disabled" msgid "Disabled"
msgstr "Ei käytössä" msgstr "Ei käytössä"
#: ../js/ui/lookingGlass.js:696 #: ../js/ui/lookingGlass.js:695
msgid "Error" msgid "Error"
msgstr "Virhe" msgstr "Virhe"
#: ../js/ui/lookingGlass.js:698 #: ../js/ui/lookingGlass.js:697
msgid "Out of date" msgid "Out of date"
msgstr "Ei ajan tasalla" msgstr "Ei ajan tasalla"
#: ../js/ui/lookingGlass.js:700 #: ../js/ui/lookingGlass.js:699
msgid "Downloading" msgid "Downloading"
msgstr "Noudetaan" msgstr "Noudetaan"
#: ../js/ui/lookingGlass.js:721 #: ../js/ui/lookingGlass.js:724
msgid "View Source" msgid "View Source"
msgstr "Näytä lähde" msgstr "Näytä lähde"
#: ../js/ui/lookingGlass.js:727 #: ../js/ui/lookingGlass.js:730
msgid "Web Page" msgid "Web Page"
msgstr "WWW-sivu" msgstr "WWW-sivu"
#: ../js/ui/messageTray.js:1199
msgid "Open" msgid "Open"
msgstr "Avaa" msgstr "Avaa"
#: ../js/ui/messageTray.js:2408
msgid "System Information" msgid "System Information"
msgstr "Järjestelmän tiedot" msgstr "Järjestelmän tiedot"
#: ../js/ui/networkAgent.js:143 msgid "Show password"
msgstr "Näytä salasana"
msgid "Connect" msgid "Connect"
msgstr "Yhdistä" msgstr "Yhdistä"
#. Cisco LEAP #. Cisco LEAP
#: ../js/ui/networkAgent.js:238 ../js/ui/networkAgent.js:250
#: ../js/ui/networkAgent.js:277 ../js/ui/networkAgent.js:297
#: ../js/ui/networkAgent.js:307
msgid "Password: " msgid "Password: "
msgstr "Salasana: " msgstr "Salasana: "
#. static WEP #. static WEP
#: ../js/ui/networkAgent.js:243
msgid "Key: " msgid "Key: "
msgstr "Avain: " msgstr "Avain: "
#. TTLS and PEAP are actually much more complicated, but this complication #. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication #. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one) #. (and don't even care of which one)
#: ../js/ui/networkAgent.js:275 ../js/ui/networkAgent.js:293
msgid "Username: " msgid "Username: "
msgstr "Käyttäjänimi: " msgstr "Käyttäjänimi: "
#: ../js/ui/networkAgent.js:281
msgid "Identity: " msgid "Identity: "
msgstr "Henkilöllisyys: " msgstr "Henkilöllisyys: "
#: ../js/ui/networkAgent.js:283
msgid "Private key password: " msgid "Private key password: "
msgstr "Salaisen avaimen salasana: " msgstr "Salaisen avaimen salasana: "
#: ../js/ui/networkAgent.js:295
msgid "Service: " msgid "Service: "
msgstr "Palvelu: " msgstr "Palvelu: "
#: ../js/ui/networkAgent.js:324
msgid "Authentication required by wireless network" msgid "Authentication required by wireless network"
msgstr "Langaton verkko vaatii tunnistautumisen" msgstr "Langaton verkko vaatii tunnistautumisen"
#: ../js/ui/networkAgent.js:325
#, c-format #, c-format
msgid "" msgid ""
"Passwords or encryption keys are required to access the wireless network '%" "Passwords or encryption keys are required to access the wireless network "
"s'." "'%s'."
msgstr "Langaton verkko %s vaatii salasanan tai salausavaimia." msgstr "Langaton verkko %s vaatii salasanan tai salausavaimia."
#: ../js/ui/networkAgent.js:329
msgid "Wired 802.1X authentication" msgid "Wired 802.1X authentication"
msgstr "Kiinteän 802.1X-yhteyden tunnistautuminen" msgstr "Kiinteän 802.1X-yhteyden tunnistautuminen"
#: ../js/ui/networkAgent.js:331
msgid "Network name: " msgid "Network name: "
msgstr "Verkon nimi: " msgstr "Verkon nimi: "
#: ../js/ui/networkAgent.js:336
msgid "DSL authentication" msgid "DSL authentication"
msgstr "DSL-tunnistautuminen" msgstr "DSL-tunnistautuminen"
#: ../js/ui/networkAgent.js:343
msgid "PIN code required" msgid "PIN code required"
msgstr "PIN-koodi vaaditaan" msgstr "PIN-koodi vaaditaan"
#: ../js/ui/networkAgent.js:344
msgid "PIN code is needed for the mobile broadband device" msgid "PIN code is needed for the mobile broadband device"
msgstr "Mobiililaajakaista vaatii PIN-koodin" msgstr "Mobiililaajakaista vaatii PIN-koodin"
#: ../js/ui/networkAgent.js:345
msgid "PIN: " msgid "PIN: "
msgstr "PIN: " msgstr "PIN: "
#: ../js/ui/networkAgent.js:351
msgid "Mobile broadband network password" msgid "Mobile broadband network password"
msgstr "Mobiililaajakaistan verkkosalasana" msgstr "Mobiililaajakaistan verkkosalasana"
#: ../js/ui/networkAgent.js:352
#, c-format #, c-format
msgid "A password is required to connect to '%s'." msgid "A password is required to connect to '%s'."
msgstr "Salasana vaaditaan kohteeseen %s yhdistämiseksi." msgstr "Salasana vaaditaan kohteeseen %s yhdistämiseksi."
@ -780,18 +708,15 @@ msgid "Dash"
msgstr "Pikavalikko" msgstr "Pikavalikko"
#. TODO - _quit() doesn't really work on apps in state STARTING yet #. TODO - _quit() doesn't really work on apps in state STARTING yet
#: ../js/ui/panel.js:539
#, c-format #, c-format
msgid "Quit %s" msgid "Quit %s"
msgstr "Lopeta %s" msgstr "Lopeta %s"
#. Translators: If there is no suitable word for "Activities" #. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview". #. in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:575
msgid "Activities" msgid "Activities"
msgstr "Toiminnot" msgstr "Toiminnot"
#: ../js/ui/panel.js:967
msgid "Top Bar" msgid "Top Bar"
msgstr "Yläpalkki" msgstr "Yläpalkki"
@ -812,15 +737,14 @@ msgstr "Yhdistä…"
msgid "PLACES & DEVICES" msgid "PLACES & DEVICES"
msgstr "SIJAINNIT JA LAITTEET" msgstr "SIJAINNIT JA LAITTEET"
#: ../js/ui/polkitAuthenticationAgent.js:73 #: ../js/ui/polkitAuthenticationAgent.js:72
msgid "Authentication Required" msgid "Authentication Required"
msgstr "Tunnistautuminen vaaditaan" msgstr "Tunnistautuminen vaaditaan"
#: ../js/ui/polkitAuthenticationAgent.js:107 #: ../js/ui/polkitAuthenticationAgent.js:106
msgid "Administrator" msgid "Administrator"
msgstr "Ylläpitäjä" msgstr "Ylläpitäjä"
#: ../js/ui/polkitAuthenticationAgent.js:177
msgid "Authenticate" msgid "Authenticate"
msgstr "Tunnistaudu" msgstr "Tunnistaudu"
@ -828,11 +752,9 @@ msgstr "Tunnistaudu"
#. * requested authentication was not gained; this can happen #. * requested authentication was not gained; this can happen
#. * because of an authentication error (like invalid password), #. * because of an authentication error (like invalid password),
#. * for instance. #. * for instance.
#: ../js/ui/polkitAuthenticationAgent.js:258
msgid "Sorry, that didn't work. Please try again." msgid "Sorry, that didn't work. Please try again."
msgstr "Tunnistautuminen epäonnistui. Yritä uudelleen." msgstr "Tunnistautuminen epäonnistui. Yritä uudelleen."
#: ../js/ui/polkitAuthenticationAgent.js:270
msgid "Password:" msgid "Password:"
msgstr "Salasana:" msgstr "Salasana:"
@ -841,11 +763,10 @@ msgstr "Salasana:"
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle #. "ON" and "OFF") or "toggle-switch-intl" (for toggle
#. switches containing "◯" and "|"). Other values will #. switches containing "◯" and "|"). Other values will
#. simply result in invisible toggle switches. #. simply result in invisible toggle switches.
#: ../js/ui/popupMenu.js:731
msgid "toggle-switch-us" msgid "toggle-switch-us"
msgstr "toggle-switch-intl" msgstr "toggle-switch-intl"
#: ../js/ui/runDialog.js:209 #: ../js/ui/runDialog.js:208
msgid "Please enter a command:" msgid "Please enter a command:"
msgstr "Syötä komento:" msgstr "Syötä komento:"
@ -857,22 +778,6 @@ msgstr "Haetaan…"
msgid "No matching results." msgid "No matching results."
msgstr "Ei tuloksia." msgstr "Ei tuloksia."
#: ../js/ui/shellEntry.js:30
msgid "Copy"
msgstr "Kopioi"
#: ../js/ui/shellEntry.js:35
msgid "Paste"
msgstr "Liitä"
#: ../js/ui/shellEntry.js:81
msgid "Show Text"
msgstr "Näytä teksti"
#: ../js/ui/shellEntry.js:83
msgid "Hide Text"
msgstr "Piilota teksti"
#: ../js/ui/shellMountOperation.js:285 #: ../js/ui/shellMountOperation.js:285
msgid "Wrong password, please try again" msgid "Wrong password, please try again"
msgstr "Väärä salasana, yritä uudelleen" msgstr "Väärä salasana, yritä uudelleen"
@ -884,7 +789,6 @@ msgstr "Lähennys"
#. let screenReader = this._buildItem(_("Screen Reader"), APPLICATIONS_SCHEMA, #. let screenReader = this._buildItem(_("Screen Reader"), APPLICATIONS_SCHEMA,
#. 'screen-reader-enabled'); #. 'screen-reader-enabled');
#. this.menu.addMenuItem(screenReader); #. this.menu.addMenuItem(screenReader);
#: ../js/ui/status/accessibility.js:71
msgid "Screen Keyboard" msgid "Screen Keyboard"
msgstr "Näyttönäppäimistö" msgstr "Näyttönäppäimistö"
@ -1006,7 +910,7 @@ msgstr "Salli pääsy aina"
msgid "Grant this time only" msgid "Grant this time only"
msgstr "Salli vain tällä kerralla" msgstr "Salli vain tällä kerralla"
#: ../js/ui/status/bluetooth.js:392 ../js/ui/telepathyClient.js:1204 #: ../js/ui/status/bluetooth.js:392 ../js/ui/telepathyClient.js:1196
msgid "Reject" msgid "Reject"
msgstr "Hylkää" msgstr "Hylkää"
@ -1046,11 +950,9 @@ msgstr "Kirjoita laitteella mainittu PIN-koodi."
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
#: ../js/ui/status/keyboard.js:73
msgid "Show Keyboard Layout" msgid "Show Keyboard Layout"
msgstr "Näytä näppäimistön asettelu" msgstr "Näytä näppäimistön asettelu"
#: ../js/ui/status/keyboard.js:78
msgid "Region and Language Settings" msgid "Region and Language Settings"
msgstr "Kielen ja alueen asetukset" msgstr "Kielen ja alueen asetukset"
@ -1095,13 +997,11 @@ msgstr "ei käytettävissä"
msgid "connection failed" msgid "connection failed"
msgstr "yhteys katkesi" msgstr "yhteys katkesi"
#: ../js/ui/status/network.js:575 ../js/ui/status/network.js:1523
msgid "More..." msgid "More..."
msgstr "Lisää…" msgstr "Lisää…"
#. TRANSLATORS: this is the indication that a connection for another logged in user is active, #. TRANSLATORS: this is the indication that a connection for another logged in user is active,
#. and we cannot access its settings (including the name) #. and we cannot access its settings (including the name)
#: ../js/ui/status/network.js:611 ../js/ui/status/network.js:1458
msgid "Connected (private)" msgid "Connected (private)"
msgstr "Yhdistetty (yksityinen)" msgstr "Yhdistetty (yksityinen)"
@ -1118,7 +1018,6 @@ msgid "Auto dial-up"
msgstr "Automaattinen, puhelinverkko" msgstr "Automaattinen, puhelinverkko"
#. TRANSLATORS: this the automatic wireless connection name (including the network name) #. TRANSLATORS: this the automatic wireless connection name (including the network name)
#: ../js/ui/status/network.js:878 ../js/ui/status/network.js:1470
#, c-format #, c-format
msgid "Auto %s" msgid "Auto %s"
msgstr "Automaattinen: %s" msgstr "Automaattinen: %s"
@ -1127,47 +1026,36 @@ msgstr "Automaattinen: %s"
msgid "Auto bluetooth" msgid "Auto bluetooth"
msgstr "Automaattinen: Bluetooth" msgstr "Automaattinen: Bluetooth"
#: ../js/ui/status/network.js:1472
msgid "Auto wireless" msgid "Auto wireless"
msgstr "Automaattinen: langaton" msgstr "Automaattinen: langaton"
#: ../js/ui/status/network.js:1566
msgid "Enable networking" msgid "Enable networking"
msgstr "Ota verkko käyttöön" msgstr "Ota verkko käyttöön"
#: ../js/ui/status/network.js:1578
msgid "Wired" msgid "Wired"
msgstr "Kiinteä" msgstr "Kiinteä"
#: ../js/ui/status/network.js:1589
msgid "Wireless" msgid "Wireless"
msgstr "Langaton" msgstr "Langaton"
#: ../js/ui/status/network.js:1599
msgid "Mobile broadband" msgid "Mobile broadband"
msgstr "Mobiililaajakaista" msgstr "Mobiililaajakaista"
#: ../js/ui/status/network.js:1609
msgid "VPN Connections" msgid "VPN Connections"
msgstr "VPN-yhteydet" msgstr "VPN-yhteydet"
#: ../js/ui/status/network.js:1620
msgid "Network Settings" msgid "Network Settings"
msgstr "Verkkoasetukset" msgstr "Verkkoasetukset"
#: ../js/ui/status/network.js:1757
msgid "Connection failed" msgid "Connection failed"
msgstr "Yhteys epäonnistui" msgstr "Yhteys epäonnistui"
#: ../js/ui/status/network.js:1758
msgid "Activation of network connection failed" msgid "Activation of network connection failed"
msgstr "Verkkoyhteyden aktivointi epäonnistui" msgstr "Verkkoyhteyden aktivointi epäonnistui"
#: ../js/ui/status/network.js:2008
msgid "Networking is disabled" msgid "Networking is disabled"
msgstr "Verkko ei ole käytössä" msgstr "Verkko ei ole käytössä"
#: ../js/ui/status/network.js:2133
msgid "Network Manager" msgid "Network Manager"
msgstr "Verkon hallinta" msgstr "Verkon hallinta"
@ -1275,39 +1163,39 @@ msgid "Invitation"
msgstr "Kutsu" msgstr "Kutsu"
#. We got the TpContact #. We got the TpContact
#: ../js/ui/telepathyClient.js:327 #: ../js/ui/telepathyClient.js:325
msgid "Call" msgid "Call"
msgstr "Soita" msgstr "Soita"
#. We got the TpContact #. We got the TpContact
#: ../js/ui/telepathyClient.js:357 #: ../js/ui/telepathyClient.js:353
msgid "File Transfer" msgid "File Transfer"
msgstr "Tiedostonsiirto" msgstr "Tiedostonsiirto"
#: ../js/ui/telepathyClient.js:438 #: ../js/ui/telepathyClient.js:434
msgid "Subscription request" msgid "Subscription request"
msgstr "Tilauspyyntö" msgstr "Tilauspyyntö"
#: ../js/ui/telepathyClient.js:474 #: ../js/ui/telepathyClient.js:470
msgid "Connection error" msgid "Connection error"
msgstr "Yhteysvirhe" msgstr "Yhteysvirhe"
#: ../js/ui/telepathyClient.js:741 #: ../js/ui/telepathyClient.js:733
#, c-format #, c-format
msgid "%s is online." msgid "%s is online."
msgstr "%s on linjoilla." msgstr "%s on linjoilla."
#: ../js/ui/telepathyClient.js:746 #: ../js/ui/telepathyClient.js:738
#, c-format #, c-format
msgid "%s is offline." msgid "%s is offline."
msgstr "%s on poissa linjoilta." msgstr "%s on poissa linjoilta."
#: ../js/ui/telepathyClient.js:749 #: ../js/ui/telepathyClient.js:741
#, c-format #, c-format
msgid "%s is away." msgid "%s is away."
msgstr "%s on poissa." msgstr "%s on poissa."
#: ../js/ui/telepathyClient.js:752 #: ../js/ui/telepathyClient.js:744
#, c-format #, c-format
msgid "%s is busy." msgid "%s is busy."
msgstr "%s on kiireinen." msgstr "%s on kiireinen."
@ -1315,35 +1203,35 @@ msgstr "%s on kiireinen."
#. Translators: this is a time format string followed by a date. #. Translators: this is a time format string followed by a date.
#. If applicable, replace %X with a strftime format valid for your #. If applicable, replace %X with a strftime format valid for your
#. locale, without seconds. #. locale, without seconds.
#: ../js/ui/telepathyClient.js:986 #: ../js/ui/telepathyClient.js:978
#, no-c-format #, no-c-format
msgid "Sent at <b>%X</b> on <b>%A</b>" msgid "Sent at <b>%X</b> on <b>%A</b>"
msgstr "Lähetetty <b>%Ana</b> kello <b>%H.%M</b>" msgstr "Lähetetty <b>%Ana</b> kello <b>%H.%M</b>"
#. Translators: this is a time format in the style of "Wednesday, May 25", #. Translators: this is a time format in the style of "Wednesday, May 25",
#. shown when you get a chat message in the same year. #. shown when you get a chat message in the same year.
#: ../js/ui/telepathyClient.js:992 #: ../js/ui/telepathyClient.js:984
#, no-c-format #, no-c-format
msgid "Sent on <b>%A</b>, <b>%B %d</b>" msgid "Sent on <b>%A</b>, <b>%B %d</b>"
msgstr "Lähetetty <b>%Ana</b> <b>%d. %Bta</b>" msgstr "Lähetetty <b>%Ana</b> <b>%d. %Bta</b>"
#. Translators: this is a time format in the style of "Wednesday, May 25, 2012", #. Translators: this is a time format in the style of "Wednesday, May 25, 2012",
#. shown when you get a chat message in a different year. #. shown when you get a chat message in a different year.
#: ../js/ui/telepathyClient.js:997 #: ../js/ui/telepathyClient.js:989
#, no-c-format #, no-c-format
msgid "Sent on <b>%A</b>, <b>%B %d</b>, %Y" msgid "Sent on <b>%A</b>, <b>%B %d</b>, %Y"
msgstr "Lähetetty <b>%Ana</b> <b>%d. %Bta</b> %Y" msgstr "Lähetetty <b>%Ana</b> <b>%d. %Bta</b> %Y"
#. Translators: this is the other person changing their old IM name to their new #. Translators: this is the other person changing their old IM name to their new
#. IM name. #. IM name.
#: ../js/ui/telepathyClient.js:1039 #: ../js/ui/telepathyClient.js:1031
#, c-format #, c-format
msgid "%s is now known as %s" msgid "%s is now known as %s"
msgstr "%s on nyt nimeltään %s" msgstr "%s on nyt nimeltään %s"
#. translators: argument is a room name like #. translators: argument is a room name like
#. * room@jabber.org for example. #. * room@jabber.org for example.
#: ../js/ui/telepathyClient.js:1148 #: ../js/ui/telepathyClient.js:1140
#, c-format #, c-format
msgid "Invitation to %s" msgid "Invitation to %s"
msgstr "Kutsu huoneeseen %s" msgstr "Kutsu huoneeseen %s"
@ -1351,35 +1239,34 @@ msgstr "Kutsu huoneeseen %s"
#. translators: first argument is the name of a contact and the second #. translators: first argument is the name of a contact and the second
#. * one the name of a room. "Alice is inviting you to join room@jabber.org #. * one the name of a room. "Alice is inviting you to join room@jabber.org
#. * for example. #. * for example.
#: ../js/ui/telepathyClient.js:1156 #: ../js/ui/telepathyClient.js:1148
#, c-format #, c-format
msgid "%s is inviting you to join %s" msgid "%s is inviting you to join %s"
msgstr "%s kutsuu sinut huoneeseen %s" msgstr "%s kutsuu sinut huoneeseen %s"
#: ../js/ui/telepathyClient.js:1158 ../js/ui/telepathyClient.js:1248 #: ../js/ui/telepathyClient.js:1150 ../js/ui/telepathyClient.js:1239
#: ../js/ui/telepathyClient.js:1352 #: ../js/ui/telepathyClient.js:1343
msgid "Decline" msgid "Decline"
msgstr "Kieltäydy" msgstr "Kieltäydy"
#: ../js/ui/telepathyClient.js:1159 ../js/ui/telepathyClient.js:1249 #: ../js/ui/telepathyClient.js:1151 ../js/ui/telepathyClient.js:1240
#: ../js/ui/telepathyClient.js:1353 #: ../js/ui/telepathyClient.js:1344
msgid "Accept" msgid "Accept"
msgstr "Hyväksy" msgstr "Hyväksy"
#. translators: argument is a contact name like Alice for example. #. translators: argument is a contact name like Alice for example.
#: ../js/ui/telepathyClient.js:1192 #: ../js/ui/telepathyClient.js:1184
#, c-format #, c-format
msgid "Video call from %s" msgid "Video call from %s"
msgstr "Videopuhelu käyttäjältä %s" msgstr "Videopuhelu käyttäjältä %s"
#. translators: argument is a contact name like Alice for example. #. translators: argument is a contact name like Alice for example.
#: ../js/ui/telepathyClient.js:1195 #: ../js/ui/telepathyClient.js:1187
#, c-format #, c-format
msgid "Call from %s" msgid "Call from %s"
msgstr "Puhelu käyttäjältä %s" msgstr "Puhelu käyttäjältä %s"
#. translators: this is a button label (verb), not a noun #: ../js/ui/telepathyClient.js:1197
#: ../js/ui/telepathyClient.js:1206
msgid "Answer" msgid "Answer"
msgstr "Vastaa" msgstr "Vastaa"
@ -1388,108 +1275,108 @@ msgstr "Vastaa"
#. * file name. The string will be something #. * file name. The string will be something
#. * like: "Alice is sending you test.ogg" #. * like: "Alice is sending you test.ogg"
#. #.
#: ../js/ui/telepathyClient.js:1242 #: ../js/ui/telepathyClient.js:1233
#, c-format #, c-format
msgid "%s is sending you %s" msgid "%s is sending you %s"
msgstr "%s on lähettämässä sinulle tiedostoa %s" msgstr "%s on lähettämässä sinulle tiedostoa %s"
#. To translators: The parameter is the contact's alias #. To translators: The parameter is the contact's alias
#: ../js/ui/telepathyClient.js:1317 #: ../js/ui/telepathyClient.js:1308
#, c-format #, c-format
msgid "%s would like permission to see when you are online" msgid "%s would like permission to see when you are online"
msgstr "%s haluaisi saada luvan nähdä, milloin olet linjoilla" msgstr "%s haluaisi saada luvan nähdä, milloin olet linjoilla"
#: ../js/ui/telepathyClient.js:1415 #: ../js/ui/telepathyClient.js:1406
msgid "Network error" msgid "Network error"
msgstr "Verkkovirhe" msgstr "Verkkovirhe"
#: ../js/ui/telepathyClient.js:1417 #: ../js/ui/telepathyClient.js:1408
msgid "Authentication failed" msgid "Authentication failed"
msgstr "Tunnistautuminen epäonnistui" msgstr "Tunnistautuminen epäonnistui"
#: ../js/ui/telepathyClient.js:1419 #: ../js/ui/telepathyClient.js:1410
msgid "Encryption error" msgid "Encryption error"
msgstr "Salausvirhe" msgstr "Salausvirhe"
#: ../js/ui/telepathyClient.js:1421 #: ../js/ui/telepathyClient.js:1412
msgid "Certificate not provided" msgid "Certificate not provided"
msgstr "Varmennetta ei annettu" msgstr "Varmennetta ei annettu"
#: ../js/ui/telepathyClient.js:1423 #: ../js/ui/telepathyClient.js:1414
msgid "Certificate untrusted" msgid "Certificate untrusted"
msgstr "Varmenteeseen ei luoteta" msgstr "Varmenteeseen ei luoteta"
#: ../js/ui/telepathyClient.js:1425 #: ../js/ui/telepathyClient.js:1416
msgid "Certificate expired" msgid "Certificate expired"
msgstr "Varmenne on vanhentunut" msgstr "Varmenne on vanhentunut"
#: ../js/ui/telepathyClient.js:1427 #: ../js/ui/telepathyClient.js:1418
msgid "Certificate not activated" msgid "Certificate not activated"
msgstr "Varmennetta ei ole aktivoitu" msgstr "Varmennetta ei ole aktivoitu"
#: ../js/ui/telepathyClient.js:1429 #: ../js/ui/telepathyClient.js:1420
msgid "Certificate hostname mismatch" msgid "Certificate hostname mismatch"
msgstr "Varmenteen konenimiristiriita" msgstr "Varmenteen konenimiristiriita"
#: ../js/ui/telepathyClient.js:1431 #: ../js/ui/telepathyClient.js:1422
msgid "Certificate fingerprint mismatch" msgid "Certificate fingerprint mismatch"
msgstr "Varmenteen sormenjälkiristiriita" msgstr "Varmenteen sormenjälkiristiriita"
#: ../js/ui/telepathyClient.js:1433 #: ../js/ui/telepathyClient.js:1424
msgid "Certificate self-signed" msgid "Certificate self-signed"
msgstr "Varmenne on itseallekirjoitettu" msgstr "Varmenne on itseallekirjoitettu"
#: ../js/ui/telepathyClient.js:1435 #: ../js/ui/telepathyClient.js:1426
msgid "Status is set to offline" msgid "Status is set to offline"
msgstr "Tilaksi on asetettu ”poissa linjoilta”" msgstr "Tilaksi on asetettu ”poissa linjoilta”"
#: ../js/ui/telepathyClient.js:1437 #: ../js/ui/telepathyClient.js:1428
msgid "Encryption is not available" msgid "Encryption is not available"
msgstr "Salaus ei ole käytettävissä" msgstr "Salaus ei ole käytettävissä"
#: ../js/ui/telepathyClient.js:1439 #: ../js/ui/telepathyClient.js:1430
msgid "Certificate is invalid" msgid "Certificate is invalid"
msgstr "Varmenne ei kelpaa" msgstr "Varmenne ei kelpaa"
#: ../js/ui/telepathyClient.js:1441 #: ../js/ui/telepathyClient.js:1432
msgid "Connection has been refused" msgid "Connection has been refused"
msgstr "Yhteys on evätty" msgstr "Yhteys on evätty"
#: ../js/ui/telepathyClient.js:1443 #: ../js/ui/telepathyClient.js:1434
msgid "Connection can't be established" msgid "Connection can't be established"
msgstr "Yhteyttä ei voida muodostaa" msgstr "Yhteyttä ei voida muodostaa"
#: ../js/ui/telepathyClient.js:1445 #: ../js/ui/telepathyClient.js:1436
msgid "Connection has been lost" msgid "Connection has been lost"
msgstr "Yhteys on katkennut" msgstr "Yhteys on katkennut"
#: ../js/ui/telepathyClient.js:1447 #: ../js/ui/telepathyClient.js:1438
msgid "This resource is already connected to the server" msgid "This resource is already connected to the server"
msgstr "Tämä resurssi on jo yhteydessä palvelimeen" msgstr "Tämä resurssi on jo yhteydessä palvelimeen"
#: ../js/ui/telepathyClient.js:1449 #: ../js/ui/telepathyClient.js:1440
msgid "" msgid ""
"Connection has been replaced by a new connection using the same resource" "Connection has been replaced by a new connection using the same resource"
msgstr "Yhteys on korvattu uudella samaa resurssia käyttävällä yhteydellä" msgstr "Yhteys on korvattu uudella samaa resurssia käyttävällä yhteydellä"
#: ../js/ui/telepathyClient.js:1451 #: ../js/ui/telepathyClient.js:1442
msgid "The account already exists on the server" msgid "The account already exists on the server"
msgstr "Tili on jo olemassa palvelimella" msgstr "Tili on jo olemassa palvelimella"
#: ../js/ui/telepathyClient.js:1453 #: ../js/ui/telepathyClient.js:1444
msgid "Server is currently too busy to handle the connection" msgid "Server is currently too busy to handle the connection"
msgstr "Palvelin on tällä hetkellä liian kiireinen käsittelemään yhteyttä" msgstr "Palvelin on tällä hetkellä liian kiireinen käsittelemään yhteyttä"
#: ../js/ui/telepathyClient.js:1455 #: ../js/ui/telepathyClient.js:1446
msgid "Certificate has been revoked" msgid "Certificate has been revoked"
msgstr "Varmenne on kumottu" msgstr "Varmenne on kumottu"
#: ../js/ui/telepathyClient.js:1457 #: ../js/ui/telepathyClient.js:1448
msgid "" msgid ""
"Certificate uses an insecure cipher algorithm or is cryptographically weak" "Certificate uses an insecure cipher algorithm or is cryptographically weak"
msgstr "Varmenne käyttää turvatonta salausmenetelmää" msgstr "Varmenne käyttää turvatonta salausmenetelmää"
#: ../js/ui/telepathyClient.js:1459 #: ../js/ui/telepathyClient.js:1450
msgid "" msgid ""
"The length of the server certificate, or the depth of the server certificate " "The length of the server certificate, or the depth of the server certificate "
"chain, exceed the limits imposed by the cryptography library" "chain, exceed the limits imposed by the cryptography library"
@ -1498,68 +1385,56 @@ msgstr ""
#. translators: argument is the account name, like #. translators: argument is the account name, like
#. * name@jabber.org for example. #. * name@jabber.org for example.
#: ../js/ui/telepathyClient.js:1468 #: ../js/ui/telepathyClient.js:1459
#, c-format #, c-format
msgid "Connection to %s failed" msgid "Connection to %s failed"
msgstr "Yhteys kohteeseen %s katkesi" msgstr "Yhteys kohteeseen %s katkesi"
#: ../js/ui/telepathyClient.js:1477 #: ../js/ui/telepathyClient.js:1468
msgid "Reconnect" msgid "Reconnect"
msgstr "Yhdistä uudelleen" msgstr "Yhdistä uudelleen"
#: ../js/ui/telepathyClient.js:1478 #: ../js/ui/telepathyClient.js:1469
msgid "Edit account" msgid "Edit account"
msgstr "Muokkaa tiliä" msgstr "Muokkaa tiliä"
#: ../js/ui/telepathyClient.js:1524 #: ../js/ui/telepathyClient.js:1515
msgid "Unknown reason" msgid "Unknown reason"
msgstr "Tuntematon syy" msgstr "Tuntematon syy"
#: ../js/ui/userMenu.js:145
msgid "Hidden" msgid "Hidden"
msgstr "Piilotettu" msgstr "Piilotettu"
#: ../js/ui/userMenu.js:151
msgid "Idle" msgid "Idle"
msgstr "Jouten" msgstr "Jouten"
#: ../js/ui/userMenu.js:154
msgid "Unavailable" msgid "Unavailable"
msgstr "Ei tavoitettavissa" msgstr "Ei tavoitettavissa"
#: ../js/ui/userMenu.js:552 ../js/ui/userMenu.js:556 ../js/ui/userMenu.js:626
msgid "Power Off..." msgid "Power Off..."
msgstr "Sammuta…" msgstr "Sammuta…"
#: ../js/ui/userMenu.js:588
msgid "Notifications" msgid "Notifications"
msgstr "Ilmoitukset" msgstr "Ilmoitukset"
#: ../js/ui/userMenu.js:596
msgid "Online Accounts" msgid "Online Accounts"
msgstr "Verkkotilit" msgstr "Verkkotilit"
#: ../js/ui/userMenu.js:600
msgid "System Settings" msgid "System Settings"
msgstr "Järjestelmän asetukset" msgstr "Järjestelmän asetukset"
#: ../js/ui/userMenu.js:607
msgid "Lock Screen" msgid "Lock Screen"
msgstr "Lukitse näyttö" msgstr "Lukitse näyttö"
#: ../js/ui/userMenu.js:612
msgid "Switch User" msgid "Switch User"
msgstr "Vaihda käyttäjää" msgstr "Vaihda käyttäjää"
#: ../js/ui/userMenu.js:617
msgid "Log Out..." msgid "Log Out..."
msgstr "Kirjaudu ulos…" msgstr "Kirjaudu ulos…"
#: ../js/ui/userMenu.js:645
msgid "Your chat status will be set to busy" msgid "Your chat status will be set to busy"
msgstr "Pikaviestitilaksi asetetaan ”kiireinen”" msgstr "Pikaviestitilaksi asetetaan ”kiireinen”"
#: ../js/ui/userMenu.js:646
msgid "" msgid ""
"Notifications are now disabled, including chat messages. Your online status " "Notifications are now disabled, including chat messages. Your online status "
"has been adjusted to let others know that you might not see their messages." "has been adjusted to let others know that you might not see their messages."
@ -1572,15 +1447,20 @@ msgstr ""
#. in the search entry when no search is #. in the search entry when no search is
#. active; it should not exceed ~30 #. active; it should not exceed ~30
#. characters. #. characters.
#: ../js/ui/viewSelector.js:121 #: ../js/ui/viewSelector.js:120
msgid "Type to search..." msgid "Type to search..."
msgstr "Kirjoita hakeaksesi…" msgstr "Kirjoita hakeaksesi…"
#: ../js/ui/viewSelector.js:142 ../src/shell-util.c:261 #: ../js/ui/viewSelector.js:140 ../src/shell-util.c:261
msgid "Search" msgid "Search"
msgstr "Haku" msgstr "Haku"
#: ../js/ui/windowAttentionHandler.js:35 #: ../js/ui/windowAttentionHandler.js:39
#, c-format
msgid "%s has finished starting"
msgstr "%s on käynnistynyt"
#: ../js/ui/windowAttentionHandler.js:41
#, c-format #, c-format
msgid "'%s' is ready" msgid "'%s' is ready"
msgstr "%s on valmis" msgstr "%s on valmis"
@ -1615,7 +1495,7 @@ msgstr "Tulosta versio"
msgid "Mode used by GDM for login screen" msgid "Mode used by GDM for login screen"
msgstr "GDM:n kirjautumisruudussa käyttämä tila" msgstr "GDM:n kirjautumisruudussa käyttämä tila"
#: ../src/shell-app.c:579 #: ../src/shell-app.c:581
#, c-format #, c-format
msgid "Failed to launch '%s'" msgid "Failed to launch '%s'"
msgstr "Sovelluksen ”%s” käynnistäminen epäonnistui" msgstr "Sovelluksen ”%s” käynnistäminen epäonnistui"
@ -1652,12 +1532,6 @@ msgstr "Tiedostojärjestelmä"
msgid "%1$s: %2$s" msgid "%1$s: %2$s"
msgstr "%1$s: %2$s" msgstr "%1$s: %2$s"
#~ msgid "Show password"
#~ msgstr "Näytä salasana"
#~ msgid "%s has finished starting"
#~ msgstr "%s on käynnistynyt"
#~ msgid "Connectivity lost" #~ msgid "Connectivity lost"
#~ msgstr "Yhteys katkesi" #~ msgstr "Yhteys katkesi"

View File

@ -58,9 +58,7 @@ shell_dbus_acquire_name (GDBusProxy *bus,
NULL, /* cancellable */ NULL, /* cancellable */
&error))) &error)))
{ {
g_printerr ("failed to acquire %s: %s\n", name, error->message); g_printerr ("failed to acquire org.gnome.Shell: %s\n", error->message);
if (!fatal)
return;
exit (1); exit (1);
} }
g_variant_get (request_name_variant, "(u)", request_name_result); g_variant_get (request_name_variant, "(u)", request_name_result);

View File

@ -27,9 +27,6 @@ void _shell_app_do_match (ShellApp *app,
GSList **prefix_results, GSList **prefix_results,
GSList **substring_results); GSList **substring_results);
void _shell_app_set_dbus_name (ShellApp *app,
const char *name);
G_END_DECLS G_END_DECLS
#endif /* __SHELL_APP_PRIVATE_H__ */ #endif /* __SHELL_APP_PRIVATE_H__ */

View File

@ -37,13 +37,6 @@ typedef struct {
/* Whether or not we need to resort the windows; this is done on demand */ /* Whether or not we need to resort the windows; this is done on demand */
gboolean window_sort_stale : 1; gboolean window_sort_stale : 1;
/* See GApplication documentation */
guint name_watcher_id;
gchar *dbus_name;
GDBusActionGroup *remote_actions;
GMenuProxy *remote_menu;
GCancellable *dbus_cancellable;
} ShellAppRunningState; } ShellAppRunningState;
/** /**
@ -79,13 +72,11 @@ struct _ShellApp
char *casefolded_exec; char *casefolded_exec;
}; };
G_DEFINE_TYPE (ShellApp, shell_app, G_TYPE_OBJECT);
enum { enum {
PROP_0, PROP_0,
PROP_STATE, PROP_STATE
PROP_ID,
PROP_DBUS_ID,
PROP_ACTION_GROUP,
PROP_MENU
}; };
enum { enum {
@ -98,8 +89,6 @@ static guint shell_app_signals[LAST_SIGNAL] = { 0 };
static void create_running_state (ShellApp *app); static void create_running_state (ShellApp *app);
static void unref_running_state (ShellAppRunningState *state); static void unref_running_state (ShellAppRunningState *state);
G_DEFINE_TYPE (ShellApp, shell_app, G_TYPE_OBJECT)
static void static void
shell_app_get_property (GObject *gobject, shell_app_get_property (GObject *gobject,
guint prop_id, guint prop_id,
@ -113,20 +102,6 @@ shell_app_get_property (GObject *gobject,
case PROP_STATE: case PROP_STATE:
g_value_set_enum (value, app->state); g_value_set_enum (value, app->state);
break; break;
case PROP_ID:
g_value_set_string (value, shell_app_get_id (app));
break;
case PROP_DBUS_ID:
g_value_set_string (value, shell_app_get_dbus_id (app));
break;
case PROP_ACTION_GROUP:
if (app->running_state)
g_value_set_object (value, app->running_state->remote_actions);
break;
case PROP_MENU:
if (app->running_state)
g_value_set_object (value, app->running_state->remote_menu);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break; break;
@ -176,15 +151,6 @@ window_backed_app_get_icon (ShellApp *app,
return actor; return actor;
} }
const char *
shell_app_get_dbus_id (ShellApp *app)
{
if (app->running_state)
return app->running_state->dbus_name;
else
return NULL;
}
/** /**
* shell_app_create_icon_texture: * shell_app_create_icon_texture:
* *
@ -982,142 +948,6 @@ _shell_app_remove_window (ShellApp *app,
g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0); g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0);
} }
static void
on_action_group_acquired (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
ShellApp *self = SHELL_APP (user_data);
ShellAppRunningState *state = self->running_state;
GError *error = NULL;
char *object_path;
state->remote_actions = g_dbus_action_group_new_finish (result,
&error);
if (error)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
!g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD))
{
g_warning ("Unexpected error while reading application actions: %s", error->message);
}
g_clear_error (&error);
g_clear_object (&state->dbus_cancellable);
if (state->name_watcher_id)
{
g_bus_unwatch_name (state->name_watcher_id);
state->name_watcher_id = 0;
}
g_free (state->dbus_name);
state->dbus_name = NULL;
g_object_unref (self);
return;
}
object_path = g_strconcat ("/", state->dbus_name, NULL);
g_strdelimit (object_path, ".", '/');
state->remote_menu = g_menu_proxy_get (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL),
state->dbus_name,
object_path);
g_object_notify (G_OBJECT (self), "dbus-id");
g_object_notify (G_OBJECT (self), "action-group");
g_object_notify (G_OBJECT (self), "menu");
g_object_unref (self);
g_free (object_path);
}
static void
on_dbus_name_appeared (GDBusConnection *bus,
const gchar *name,
const gchar *name_owner,
gpointer user_data)
{
ShellApp *self = SHELL_APP (user_data);
ShellAppRunningState *state = self->running_state;
char *object_path;
g_assert (state != NULL);
object_path = g_strconcat ("/", name, NULL);
g_strdelimit (object_path, ".", '/');
if (!state->dbus_cancellable)
state->dbus_cancellable = g_cancellable_new ();
g_dbus_action_group_new (bus,
name,
object_path,
G_DBUS_ACTION_GROUP_FLAGS_NONE,
state->dbus_cancellable,
on_action_group_acquired,
g_object_ref (self));
g_free (object_path);
}
static void
on_dbus_name_disappeared (GDBusConnection *bus,
const gchar *name,
gpointer user_data)
{
ShellApp *self = SHELL_APP (user_data);
ShellAppRunningState *state = self->running_state;
g_assert (state != NULL);
if (state->dbus_cancellable)
{
g_cancellable_cancel (state->dbus_cancellable);
g_clear_object (&state->dbus_cancellable);
}
g_clear_object (&state->remote_actions);
g_clear_object (&state->remote_menu);
g_free (state->dbus_name);
state->dbus_name = NULL;
g_bus_unwatch_name (state->name_watcher_id);
state->name_watcher_id = 0;
}
void
_shell_app_set_dbus_name (ShellApp *app,
const char *bus_name)
{
g_return_if_fail (app->running_state != NULL);
if (app->running_state->dbus_name != NULL)
{
/* already associating with another name
(can only happen if you restart the shell in the
middle of the session, in which case it will try
all names seen on the bus; otherwise, it uses
the Hello signal from GApplication and thus knows
for sure which name is the right one)
*/
return;
}
app->running_state->dbus_name = g_strdup (bus_name);
app->running_state->name_watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
bus_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
on_dbus_name_appeared,
on_dbus_name_disappeared,
g_object_ref (app),
g_object_unref);
}
/** /**
* shell_app_get_pids: * shell_app_get_pids:
* @app: a #ShellApp * @app: a #ShellApp
@ -1337,28 +1167,13 @@ unref_running_state (ShellAppRunningState *state)
{ {
MetaScreen *screen; MetaScreen *screen;
g_assert (state->refcount > 0);
state->refcount--; state->refcount--;
if (state->refcount > 0) if (state->refcount > 0)
return; return;
screen = shell_global_get_screen (shell_global_get ()); screen = shell_global_get_screen (shell_global_get ());
g_signal_handler_disconnect (screen, state->workspace_switch_id); g_signal_handler_disconnect (screen, state->workspace_switch_id);
if (state->dbus_cancellable)
{
g_cancellable_cancel (state->dbus_cancellable);
g_object_unref (state->dbus_cancellable);
}
g_clear_object (&state->remote_actions);
g_clear_object (&state->remote_menu);
g_free (state->dbus_name);
if (state->name_watcher_id)
g_bus_unwatch_name (state->name_watcher_id);
g_slice_free (ShellAppRunningState, state); g_slice_free (ShellAppRunningState, state);
} }
@ -1534,9 +1349,6 @@ shell_app_dispose (GObject *object)
while (app->running_state->windows) while (app->running_state->windows)
_shell_app_remove_window (app, app->running_state->windows->data); _shell_app_remove_window (app, app->running_state->windows->data);
} }
/* We should have been transitioned when we removed all of our windows */
g_assert (app->state == SHELL_APP_STATE_STOPPED);
g_assert (app->running_state == NULL);
G_OBJECT_CLASS(shell_app_parent_class)->dispose (object); G_OBJECT_CLASS(shell_app_parent_class)->dispose (object);
} }
@ -1587,60 +1399,4 @@ shell_app_class_init(ShellAppClass *klass)
SHELL_TYPE_APP_STATE, SHELL_TYPE_APP_STATE,
SHELL_APP_STATE_STOPPED, SHELL_APP_STATE_STOPPED,
G_PARAM_READABLE)); G_PARAM_READABLE));
/**
* ShellApp:id:
*
* The id of this application (a desktop filename, or a special string
* like window:0xabcd1234)
*/
g_object_class_install_property (gobject_class,
PROP_ID,
g_param_spec_string ("id",
"Application id",
"The desktop file id of this ShellApp",
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/**
* ShellApp:dbus-id:
*
* The DBus well-known name of the application, if one can be associated
* to this ShellApp (it means that the application is using GApplication)
*/
g_object_class_install_property (gobject_class,
PROP_DBUS_ID,
g_param_spec_string ("dbus-id",
"Application DBus Id",
"The DBus well-known name of the application",
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/**
* ShellApp:action-group:
*
* The #GDBusActionGroup associated with this ShellApp, if any. See the
* documentation of #GApplication and #GActionGroup for details.
*/
g_object_class_install_property (gobject_class,
PROP_ACTION_GROUP,
g_param_spec_object ("action-group",
"Application Action Group",
"The action group exported by the remote application",
G_TYPE_DBUS_ACTION_GROUP,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/**
* ShellApp:menu:
*
* The #GMenuProxy associated with this ShellApp, if any. See the
* documentation of #GMenuModel for details.
*/
g_object_class_install_property (gobject_class,
PROP_MENU,
g_param_spec_object ("menu",
"Application Menu",
"The primary menu exported by the remote application",
G_TYPE_MENU_PROXY,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
} }

View File

@ -13,7 +13,6 @@ G_BEGIN_DECLS
typedef struct _ShellApp ShellApp; typedef struct _ShellApp ShellApp;
typedef struct _ShellAppClass ShellAppClass; typedef struct _ShellAppClass ShellAppClass;
typedef struct _ShellAppPrivate ShellAppPrivate; typedef struct _ShellAppPrivate ShellAppPrivate;
typedef struct _ShellAppAction ShellAppAction;
#define SHELL_TYPE_APP (shell_app_get_type ()) #define SHELL_TYPE_APP (shell_app_get_type ())
#define SHELL_APP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_APP, ShellApp)) #define SHELL_APP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_APP, ShellApp))
@ -37,12 +36,9 @@ typedef enum {
GType shell_app_get_type (void) G_GNUC_CONST; GType shell_app_get_type (void) G_GNUC_CONST;
const char *shell_app_get_id (ShellApp *app); const char *shell_app_get_id (ShellApp *app);
GMenuTreeEntry *shell_app_get_tree_entry (ShellApp *app); GMenuTreeEntry *shell_app_get_tree_entry (ShellApp *app);
GDesktopAppInfo *shell_app_get_app_info (ShellApp *app); GDesktopAppInfo *shell_app_get_app_info (ShellApp *app);
const char *shell_app_get_dbus_id (ShellApp *app);
ClutterActor *shell_app_create_icon_texture (ShellApp *app, int size); ClutterActor *shell_app_create_icon_texture (ShellApp *app, int size);
ClutterActor *shell_app_get_faded_icon (ShellApp *app, int size); ClutterActor *shell_app_get_faded_icon (ShellApp *app, int size);
const char *shell_app_get_name (ShellApp *app); const char *shell_app_get_name (ShellApp *app);

View File

@ -49,9 +49,6 @@ struct _ShellWindowTracker
/* <MetaWindow * window, ShellApp *app> */ /* <MetaWindow * window, ShellApp *app> */
GHashTable *window_to_app; GHashTable *window_to_app;
/* <int, gchar *> */
GHashTable *pid_to_dbus_connection;
/* <int, ShellApp *app> */ /* <int, ShellApp *app> */
GHashTable *launched_pid_to_app; GHashTable *launched_pid_to_app;
}; };
@ -439,8 +436,6 @@ track_window (ShellWindowTracker *self,
MetaWindow *window) MetaWindow *window)
{ {
ShellApp *app; ShellApp *app;
GPid pid;
gchar *dbus_name;
if (!shell_window_tracker_is_window_interesting (window)) if (!shell_window_tracker_is_window_interesting (window))
return; return;
@ -456,15 +451,6 @@ track_window (ShellWindowTracker *self,
_shell_app_add_window (app, window); _shell_app_add_window (app, window);
/* Try to associate this ShellApp with a GApplication id, if one exists */
pid = meta_window_get_pid (window);
dbus_name = g_hash_table_lookup (self->pid_to_dbus_connection, GINT_TO_POINTER ((int) pid));
if (dbus_name != NULL)
{
_shell_app_set_dbus_name (app, dbus_name);
g_hash_table_remove (self->pid_to_dbus_connection, GINT_TO_POINTER ((int) pid));
}
g_signal_emit (self, signals[TRACKED_WINDOWS_CHANGED], 0); g_signal_emit (self, signals[TRACKED_WINDOWS_CHANGED], 0);
} }
@ -595,161 +581,13 @@ on_startup_sequence_changed (MetaScreen *screen,
g_signal_emit (G_OBJECT (self), signals[STARTUP_SEQUENCE_CHANGED], 0, sequence); g_signal_emit (G_OBJECT (self), signals[STARTUP_SEQUENCE_CHANGED], 0, sequence);
} }
typedef struct {
ShellWindowTracker *tracker;
gchar *bus_name;
} LookupAppDBusData;
static void
on_get_connection_unix_pid_reply (GObject *connection,
GAsyncResult *result,
gpointer user_data)
{
LookupAppDBusData *data = user_data;
GError *error = NULL;
GVariant *reply;
guint32 pid;
ShellApp *app;
reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (connection), result, &error);
if (!reply)
{
if (!g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER))
g_warning ("%s\n", error->message);
g_clear_error (&error);
goto out;
}
if (!g_variant_is_of_type (reply, G_VARIANT_TYPE ("(u)")))
{
g_variant_unref (reply);
goto out;
}
g_variant_get (reply, "(u)", &pid);
g_variant_unref (reply);
app = shell_window_tracker_get_app_from_pid (data->tracker, (int)pid);
if (app)
_shell_app_set_dbus_name (app, data->bus_name);
else
{
g_hash_table_insert (data->tracker->pid_to_dbus_connection,
GINT_TO_POINTER ((int) pid),
data->bus_name);
data->bus_name = NULL;
}
out:
g_object_unref (data->tracker);
g_free (data->bus_name);
g_slice_free (LookupAppDBusData, data);
}
static void
lookup_application_from_name (ShellWindowTracker *self,
GDBusConnection *connection,
const gchar *bus_name)
{
LookupAppDBusData *data;
data = g_slice_new0 (LookupAppDBusData);
data->tracker = g_object_ref (self);
data->bus_name = g_strdup (bus_name);
/*
* TODO: Add something to GtkApplication so it definitely knows the .desktop file.
*/
g_dbus_connection_call (connection,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"GetConnectionUnixProcessID",
g_variant_new ("(s)", bus_name),
NULL, 0, -1, NULL, on_get_connection_unix_pid_reply, data);
}
static void
on_application_signal (GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
ShellWindowTracker *tracker = SHELL_WINDOW_TRACKER (user_data);
gchar *bus_name = NULL;
g_variant_get (parameters, "(&s)", &bus_name);
lookup_application_from_name (tracker, connection, bus_name);
g_variant_unref (parameters);
}
static void
on_list_names_end (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
GDBusConnection *connection = G_DBUS_CONNECTION (object);
ShellWindowTracker *self = SHELL_WINDOW_TRACKER (user_data);
GError *error = NULL;
GVariantIter iter;
gchar *bus_name = NULL;
GVariant *res = g_dbus_connection_call_finish (connection, result, &error);
if (!res)
{
g_warning ("ListNames failed: %s", error->message);
g_error_free (error);
return;
}
g_variant_iter_init (&iter, g_variant_get_child_value (res, 0));
while (g_variant_iter_loop (&iter, "s", &bus_name))
{
if (bus_name[0] == ':')
{
/* unique name, uninteresting */
continue;
}
lookup_application_from_name (self, connection, bus_name);
}
g_variant_unref (res);
}
static void static void
shell_window_tracker_init (ShellWindowTracker *self) shell_window_tracker_init (ShellWindowTracker *self)
{ {
MetaScreen *screen; MetaScreen *screen;
g_dbus_connection_signal_subscribe (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL), self->window_to_app = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, NULL, (GDestroyNotify) g_object_unref);
"org.gtk.Application",
"Hello",
NULL,
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
on_application_signal,
self, NULL);
g_dbus_connection_call (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL),
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListNames",
NULL, /* parameters */
G_VARIANT_TYPE ("(as)"),
G_DBUS_CALL_FLAGS_NONE,
-1, /* timeout */
NULL, /* cancellable */
on_list_names_end, self);
self->window_to_app = g_hash_table_new_full (NULL, NULL, NULL, g_object_unref);
self->pid_to_dbus_connection = g_hash_table_new_full (NULL, NULL, NULL, g_free);
self->launched_pid_to_app = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_object_unref); self->launched_pid_to_app = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_object_unref);
@ -769,7 +607,6 @@ shell_window_tracker_finalize (GObject *object)
g_hash_table_destroy (self->window_to_app); g_hash_table_destroy (self->window_to_app);
g_hash_table_destroy (self->launched_pid_to_app); g_hash_table_destroy (self->launched_pid_to_app);
g_hash_table_destroy (self->pid_to_dbus_connection);
G_OBJECT_CLASS (shell_window_tracker_parent_class)->finalize(object); G_OBJECT_CLASS (shell_window_tracker_parent_class)->finalize(object);
} }

View File

@ -28,6 +28,8 @@ enum
KILL_SWITCH_WORKSPACE, KILL_SWITCH_WORKSPACE,
KILL_WINDOW_EFFECTS, KILL_WINDOW_EFFECTS,
KEYBINDING,
LAST_SIGNAL LAST_SIGNAL
}; };
@ -124,6 +126,34 @@ shell_wm_class_init (ShellWMClass *klass)
g_cclosure_marshal_VOID__OBJECT, g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
META_TYPE_WINDOW_ACTOR); META_TYPE_WINDOW_ACTOR);
/**
* ShellWM::keybinding:
* @shellwm: the #ShellWM
* @binding: the keybinding name
* @mask: the modifier mask used
* @window: for window keybindings, the #MetaWindow
* @backwards: for "reversible" keybindings, whether or not
* the backwards (Shifted) variant was invoked
*
* Emitted when a keybinding captured via
* shell_wm_takeover_keybinding() is invoked. The keybinding name
* (which has underscores, not hyphens) is also included as the
* detail of the signal name, so you can connect just specific
* keybindings.
*/
shell_wm_signals[KEYBINDING] =
g_signal_new ("keybinding",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
0,
NULL, NULL,
_shell_marshal_VOID__STRING_UINT_OBJECT_BOOLEAN,
G_TYPE_NONE, 4,
G_TYPE_STRING,
G_TYPE_UINT,
META_TYPE_WINDOW,
G_TYPE_BOOLEAN);
} }
void void
@ -294,3 +324,37 @@ shell_wm_new (MetaPlugin *plugin)
return wm; return wm;
} }
static void
shell_wm_key_handler (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding,
gpointer data)
{
ShellWM *wm = data;
gboolean backwards = (event->xkey.state & ShiftMask);
g_signal_emit (wm, shell_wm_signals[KEYBINDING],
g_quark_from_string (binding->name),
binding->name, binding->mask, window, backwards);
}
/**
* shell_wm_takeover_keybinding:
* @wm: the #ShellWM
* @binding_name: a meta keybinding name
*
* Tells mutter to forward keypresses for @binding_name to the shell
* rather than processing them internally. This will cause a
* #ShellWM::keybinding signal to be emitted when that key is pressed.
*/
void
shell_wm_takeover_keybinding (ShellWM *wm,
const char *binding_name)
{
meta_keybindings_set_custom_handler (binding_name,
shell_wm_key_handler,
wm, NULL);
}

View File

@ -39,6 +39,10 @@ void shell_wm_completed_destroy (ShellWM *wm,
MetaWindowActor *actor); MetaWindowActor *actor);
void shell_wm_completed_switch_workspace (ShellWM *wm); void shell_wm_completed_switch_workspace (ShellWM *wm);
/* Keybinding stuff */
void shell_wm_takeover_keybinding (ShellWM *wm,
const char *binding_name);
G_END_DECLS G_END_DECLS
#endif /* __SHELL_WM_H__ */ #endif /* __SHELL_WM_H__ */

View File

@ -1,99 +0,0 @@
#!/usr/bin/env gjs
const Gdk = imports.gi.Gdk;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
function do_action(action, parameter) {
print ("Action '" + action.name + "' invoked");
}
function do_action_param(action, parameter) {
print ("Action '" + action.name + "' invoked with parameter " + parameter.print(true));
}
function do_action_state_change(action) {
print ("Action '" + action.name + "' has now state '" + action.state.deep_unpack() + "'");
}
function main() {
Gtk.init(null, null);
let app = new Gtk.Application({ application_id: 'org.gnome.Shell.GtkApplicationTest' });
app.connect('activate', function() {
print ("Activated");
});
let group = new Gio.SimpleActionGroup();
let action = Gio.SimpleAction.new('one', null);
action.connect('activate', do_action);
group.insert(action);
let action = Gio.SimpleAction.new('two', null);
action.connect('activate', do_action);
group.insert(action);
let action = Gio.SimpleAction.new_stateful('toggle', null, GLib.Variant.new('b', false));
action.connect('activate', do_action);
action.connect('notify::state', do_action_state_change);
group.insert(action);
let action = Gio.SimpleAction.new('disable', null);
action.set_enabled(false);
action.connect('activate', do_action);
group.insert(action);
let action = Gio.SimpleAction.new('parameter-int', GLib.VariantType.new('u'));
action.connect('activate', do_action_param);
group.insert(action);
let action = Gio.SimpleAction.new('parameter-string', GLib.VariantType.new('s'));
action.connect('activate', do_action_param);
group.insert(action);
app.action_group = group;
let menu = new Gio.Menu();
menu.append('An action', 'one');
let section = new Gio.Menu();
section.append('Another action', 'two');
section.append('Same as above', 'two');
menu.append_section(null, section);
// another section, to check separators
section = new Gio.Menu();
section.append('Checkbox', 'toggle');
section.append('Disabled', 'disable');
menu.append_section(null, section);
// empty sections or submenus should be invisible
menu.append_section('Empty section', new Gio.Menu());
menu.append_submenu('Empty submenu', new Gio.Menu());
let submenu = new Gio.Menu();
submenu.append('Open c:\\', 'parameter-string::c:\\');
submenu.append('Open /home', 'parameter-string::/home');
menu.append_submenu('Recent files', submenu);
let item = Gio.MenuItem.new('Say 42', null);
item.set_action_and_target_value('parameter-int', GLib.Variant.new('u', 42));
menu.append_item(item);
let item = Gio.MenuItem.new('Say 43', null);
item.set_action_and_target_value('parameter-int', GLib.Variant.new('u', 43));
menu.append_item(item);
app.menu = menu;
app.connect('startup', function(app) {
let window = new Gtk.Window({ title: "Test Application", application: app });
window.present();
});
app.run(null);
}
main();

View File

@ -21,7 +21,6 @@ TEST_JS = \
testcommon/ui.js \ testcommon/ui.js \
unit/format.js \ unit/format.js \
unit/markup.js \ unit/markup.js \
unit/jsParse.js \
unit/url.js unit/url.js
EXTRA_DIST += $(TEST_JS) EXTRA_DIST += $(TEST_JS)