Compare commits

...

104 Commits

Author SHA1 Message Date
Ray Strode
d139adc25f authPrompt: support smartcard authentication
This commit detects when a user inserts a smartcard,
and then initiates user verification using the gdm-smartcard
PAM service.

Likewise, if a user removes their smartcard, password verification
(or the user list depending on auth mode and configuration) are initiated

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 20:21:06 -04:00
Ray Strode
0d151f8d94 misc: add code to use settings-daemon smartcard service
gnome-settings-daemon monitors smartcard insertion and removal
events on the system and then exports a model of the current
smartcard topology over the bus using the D-Bus ObjectManager interface.

This commit adds the support code needed in gnome-shell to talk to
the gnome-settings-daemon service.

A future commit will use this code to inform the login screen
when a user inserts a smartcard (so it can react appropriately)

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 20:21:06 -04:00
Ray Strode
e3fdc2858d misc: add objectManager class
The D-Bus ObjectManager interface is fairly recent addition to the
D-Bus specification. Its purpose is to provide a standardized way
to track objects dynamically coming and going for a service, and
to track capabilities dynamically coming and going for those objects
(by means of interfaces).

This commit adds the requisite code needed to make use of the
ObjectManager interface.

It will ultimately be needed to implement smartcard support in the
login screen.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 20:21:06 -04:00
Ray Strode
05dcd8575c gdmUtil: support disabling password authentication
This commit skips trying password authentication if it's
disallowed, favoring fingerprint login instead.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 20:21:06 -04:00
Ray Strode
214440fde4 authPrompt: emit prompted when given a message
Some pam modules prompt without expecting the user to type
an answer back (e.g. "Please swipe finger").  We need to
emit prompted in this case too, so the the dialog will get shown.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 20:21:06 -04:00
Ray Strode
e3621e13ac gdmUtil: pave way for fingeprint to optionally be default auth service
Currently, fingerprint authentication is always a secondary thing.
If a user wants to swipe their finger when the computer is asking
for a password, so be it.

This commit paves the way for making fingerprint auth optionally
be the main way to authenticate.  Currently there's no way to enable
this, but in a future commit will honor

enable-password-authentication=false

in gsettings.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 20:21:03 -04:00
Ray Strode
df0aace025 util: abstract out default auth service in code
Right now, the primary way a user logs in is with
a password. They can also swipe their finger, if their
fingerprint is enrolled, but it's expected the fingerprint
auth service won't ask questions the user has to respond to
by typing. As such, we ignore questions that comes from
anything but the main auth service: gdm-password.

In the future, if a user inserts a smartcard, we'll want
to treat the gdm-smartcard service as the main auth service,
and let any questions from it get to the user.

This commit tries to prepare for that eventuality by storing
the name of the default auth service away in a _defaultService variable
before verification has begun, and then later checking incoming
queries against that service instead of checking against
string 'gdm-password' directly.

Of course, right now, _defaultService is always gdm-password.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 18:54:20 -04:00
Ray Strode
023f4b31d9 authPrompt: add support for auth without username
This commit introduces a new BeginRequestType enum which gets
passed to the 'reset' signal to specify whether
a username should be provided to the begin() method and changes
the loginDialog to comply.

Currently, the signal only ever gets emitted with

AuthPrompt.BeginRequestType.PROVIDE_USERNAME

but that will change in the future when providing smartcard
support.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 18:52:25 -04:00
Ray Strode
16fba7bd5f unlockDialog: only emit 'failed' on reset after failure/cancel
We currently emit "failed" any time the UserVerifier is reset,
and user verification didn't succeed prior.

A more conceptually clear time to emit "failed" would be if
the UserVerifier is reset and user verification failed prior,
and to emit "failed" if the user cancels unlock.

This commit restructures things to do that. Aside from being
more conceptually clear, it also lays the groundwork for us
to be able to reset the unlock screen without failing.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
ebce362c05 authPrompt: cancel user verification if verifying when reset
authPrompt.reset() currently only leaves the authPrompt in a
sane state if the user isn't verifying.

This commit makes sure to cancel verification if a reset happens
while verification is in process.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
c4ca17d127 util: clear user verifier after cancelling it
If we don't clear it, then the connection to gdm will remain open.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
3455dd1e76 authPrompt: consolidate verifyingUser/userVerified
Right now we have two booleans that specify when user verification
is happening and when it succeeded, respectively.

This commit consolidates them into one AuthPromptStatus enumeration.

This clean up will allow us to check for verification failure more
easily.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
57abfab923 loginDialog: don't ever call _reset directly
The only time we ever call _reset directly is when
detecting changes to disable-user-list.  We can implicitly
trigger a reset for this case, just as easily by calling
this._authPrompt.reset()

This commit makes that change for consistency and to make
it easier to adjust the authprompt workflow later.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
3a13e7484a authPrompt: don't muck with cancelButton in onAskQuestion
onAskQuestion has this code:

    if (this.verifyingUser)
        this.cancelButton.show();
    else
        this.cancelButton.hide();

but onAskQuestion can only be called when this.verifyingUser is true.
Also, cancelButton is public, and it only ever otherwise gets hidden
from callers.

This commit drops mucking with cancelButton visibility, leaving it
entirely up to the callers to deal with.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
a04895383a authPrompt: disassociate from userVerifier when destroyed
Otherwise, it won't get GC'd and we'll end up potentially calling
its signal handlers after destruction.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
43357a1b69 loginDialog: fix up cancel button visibility
This commit makes sure we hide when there's nothing to cancel
to and show it when there's something to cancel to.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
2013-07-29 17:40:29 -04:00
Ray Strode
f38d5a9c06 authPrompt: let PAM message wrap if longer than entry
Right now the whole authPrompt spreads out if a PAM message
comes in that longer than the entry.

This commit changes it to wrap instead, by forcing the
auth prompt to be a fixed width (slightly bigger than
the entry width was sized to previously).

https://bugzilla.gnome.org/show_bug.cgi?id=705037
2013-07-29 17:25:41 -04:00
Victor Ibragimov
696efcdf20 Tajik translation updated 2013-07-29 11:22:53 +01:00
Jasper St. Pierre
728c3a72ad network: Introduce a new, rewritten Wi-Fi section
Remove the Wi-Fi chooser from the menu and put it in a dialog instead.
This frees up the submenu to simply have three items: an rfkill toggle,
a button to show the dialog, and a button to show network settings.

Ideally, we'd autodetect the "needs network" case by user initiation
and automatically show the dialog if needed, but lower-level plumbing
is neccessary, so the menu item to show the dialog is an acceptable
compromise instead.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:52:33 -04:00
Jasper St. Pierre
c8c839a569 network: Make sure that the network menu is insensitive when in the lock screen
Since the network section of the aggregate menu will be shown in the lock
screen, we need to ensure that users can't tweak with network settings or
anything like that.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:24 -04:00
Jasper St. Pierre
6827dacb4b network: Remove syncDescription
Replace it with setDeviceDescription, which gives device wrappers
more control about how to handle description changes.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:24 -04:00
Jasper St. Pierre
246271fd9d network: Implement new designs for VPN/modem submenus
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:24 -04:00
Jasper St. Pierre
4305ebc5b0 network: Rework the VPN rewrite to work for modem and bluetooth as well
Replace NMNetworkMenuItem with NMConnectionItem, based on
NMVPNConnectionItem, and replace NMDevice with NMConnectionSection
and NMConnectionDevice.

Since this rips apart NMDevice, and since wi-fi should not be
connection-based, we'll temporarily remove NMDeviceWireless. We'll
add it back in a later commit, along with the new Wi-Fi dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:40:23 -04:00
Jasper St. Pierre
39bff8bfbc network: Don't pass a list of connections to the devices
Instead, just add them after they're constructed. This allows us to
not have to pass the connections to each device, and prevents issues
with having to enumerate the connections in the middle of construction.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
fc6a0c1006 network: Remove the Wired section
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

Note that this does have an interesting side effect of not showing
network connectivity status on wired. This is intentional, and error
states will still be shown in the top bar when they happen.

This also means that if you're connected to both wired and wireless,
even though wired is the default route, we'll first notice the wireless
active connection, and we'll show that in the top bar. New NM API that
will help figuring out the active connection of the default device is
being implemented to stop this from happening.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
d6dc9af5ff network: Remove overflow implementation
The code is complicated by requiring overflow, and in order to incrementally
improve the code to match the designs, remove overflow.

In the new design, we'll have a fixed number of menu items, and Wi-Fi
will be done by a separate design, so we can't be too concerned with
the menu not fitting on the screen.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
e62045eb7f network: Remove the enable networking item
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

Additionally, with this gone, we can clean up how we handle menu
item visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:40 -04:00
Jasper St. Pierre
bda3e53511 network: Remove the global wireless killswitch
"Airplane Mode" is able to be turned on in gnome-control-center,
and it will replace the killswitch UI we have in the menu right
now.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
6295d0fc6c network: Make the device section headers not bold
The new device section headers will be simple text strings
in the new designs.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
3271e65d56 network: Remove separators between device sections
This is not needed in the new design. Doing this allows us to
remove some complex section visibility tracking, also.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
f8225141dc network: Remove the firmware changed signal
According to Dan Williams, if firmware is installed the device
will disappear and reappear, and this is unlikely to change any
time soon. Just make our lives easier by removing the tracking.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Jasper St. Pierre
8e9e583b79 network: Fix the AP strength indicator never getting updated
I intended to make a few code cleanups, but I apparently forgot
to hook up _updateAccessPoint. Merge it with _activeApChanged,
which is where the notify::active-access-point signal is actually
hooked up to.

https://bugzilla.gnome.org/show_bug.cgi?id=704670
2013-07-28 15:39:39 -04:00
Marek Černocký
bbadfce65a Updated Czech translation 2013-07-28 13:12:08 +02:00
Marek Černocký
9e191d681f Updated Czech translation 2013-07-28 13:10:24 +02:00
Colin Walters
a3236997be search: Don't throw if provider directories don't exist
There's no /usr/local/share/gnome-shell/search-providers, so don't
throw if we don't find it.
2013-07-27 10:58:36 -04:00
Jasper St. Pierre
be961cd60e remoteSearch: Load remote search providers synchronously
As we only reload search providers on startup or when the sort order changes,
and given the small number of search providers we'll actually load, I doubt
we'll see any speed decrease.

The simplicity of synchronous code is also much clearer, and fully avoids
all the possible bugs about in-flight requests or similar.

This also prevents issues with multiple search providers showing up at once,
which happen when multiple requests to reload search providers get called
immediately, with the existing in-flight async requests never cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=700283
2013-07-26 19:14:40 -04:00
Jasper St. Pierre
4efd363134 search: Ensure that we correctly remove remote search providers
When we reload the remote search providers, we currently try to remove
all remote providers, and then re-scan. It turns out that we sometimes
remove the wrong providers from the remote provider list, causing us to
have some providers not correctly unloaded.

https://bugzilla.gnome.org/show_bug.cgi?id=700283
2013-07-26 17:39:05 -04:00
Victor Ibragimov
7bdee9ce05 Tajik translation updated 2013-07-26 16:42:13 +01:00
Jasper St. Pierre
7dc9a9bf2f bluetooth: Adapt to new designs for the bluetooth menu
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-26 04:41:49 -04:00
Ray Strode
87245c7b33 authPrompt: Call next button "Unlock" when user switching
When a ShellUserVerifier is asked to verify a user at the login
screen it will transparently first try to reauthenticate the user
against an existing session and then fall back to logging a user
into a new session.  The former is used for user switching.
It's useful to know which type of verification is happening, so
the next button can be made to say "Unlock" instead of "Sign In" when
a user is already signed in.

This commit exports a new "reauthenticating" property on the
ShellUserVerifier that the auth prompt checks when deciding which
label to use for its next button.

https://bugzilla.gnome.org/show_bug.cgi?id=704795
2013-07-25 09:28:22 -04:00
Bastien Nocera
db497a2ecf shellDBus: Export the timestamp of shortcuts through D-Bus
So that apps launched through gnome-settings-daemon can get
focused properly.

https://bugzilla.gnome.org/show_bug.cgi?id=704859
2013-07-25 14:55:25 +02:00
Benjamin Steinwender
9d250bec05 Updated German translation 2013-07-24 22:10:17 +02:00
Piotr Drąg
1371f69810 Updated POTFILES.in 2013-07-24 20:16:16 +02:00
Ray Strode
82ee6aed7f authPrompt: fade out message if user starts to type
If there are no messages in the queue and a user starts to
type then we can safely hide the message label since the
user has probably already read it.

This fixes a weirdness where "Incorrect Password" messages stay
around, even as the user types in the new correct password.

https://bugzilla.gnome.org/show_bug.cgi?id=704817
2013-07-24 13:22:10 -04:00
Ray Strode
d730fd0a5f loginDialog: correct typo
commit 7e7295f259 introduced a typo
(LOGIN instead of LOG_IN).

The follow up commit fixes that.
2013-07-24 11:27:53 -04:00
Florian Müllner
cb4e4bb2db appDisplay: Use hookup_style() to bind app-view-controls spacing
With the monkey-patched ClutterBoxLayout, we no longer need this
code to hook up the 'spacing' property to CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=703905
2013-07-24 15:22:05 +02:00
Florian Müllner
6fd3c0fbb4 environment: Add some convenience LayoutManager monkey-patching
Similar to our ClutterContainer monkey-patching, we can add some
convenience to existing ClutterLayoutManagers:

 - hookup_style() to bind layoutManager properties to CSS properties
 - child_set() to set child properties

https://bugzilla.gnome.org/show_bug.cgi?id=703905
2013-07-24 15:22:05 +02:00
Florian Müllner
13170fbb3c notificationDaemon: Fix clicks on legacy icons
Jasper removed the ShellGlobal:stage-input-mode property after its
"last" use was removed. Adapt the (hopefully) really last use of the
property to the recent input changes.

https://bugzilla.gnome.org/show_bug.cgi?id=704095
2013-07-24 15:22:05 +02:00
Ray Strode
7e7295f259 authPrompt: move unlock and login user verifier code here
There's quite a bit of duplicated code between the login dialog
and the unlock dialog dealing with the various signals from the
ShellUserVerifier.

This commit moves that duplicated code into the AuthPrompt.

https://bugzilla.gnome.org/show_bug.cgi?id=704707
2013-07-24 06:01:12 -04:00
Ray Strode
d30cb2d4d9 gdmUtil: separate AuthPrompt out into its own file
It's cleaner to have it in its own file than to cram it into
util.js, so this commit moves it.

https://bugzilla.gnome.org/show_bug.cgi?id=704707
2013-07-24 06:01:03 -04:00
Adel Gadllah
f4100ac507 message-tray: Really close notifications when the close button is clicked
When the user eclipictly closes a notification, we should really destroy
it not just move it to the tray.

https://bugzilla.gnome.org/show_bug.cgi?id=687016
2013-07-23 19:32:51 +02:00
Daniel Mustieles
1a0415a100 Updated Spanish translation 2013-07-22 13:50:38 +02:00
Jasper St. Pierre
1cc5bb5ec4 shell-app: Fade the app icon on the left in RTL layouts
The point of fading the icon is to make the text displayed over the
icon more legible. In RTL layouts, the text is displayed on the left
of the icon, so fading the right-hand-side of the icon doesn't work
well.

https://bugzilla.gnome.org/show_bug.cgi?id=704583
2013-07-22 07:09:42 -04:00
Jasper St. Pierre
43661fff76 popupMenu: Fix popup menu layouts in RTL directions
The math for inverting RTL layouts (which was copy/pasted from
ClutterBoxLayout) was incorrect for non-zero child offsets.

https://bugzilla.gnome.org/show_bug.cgi?id=704542
2013-07-22 07:09:19 -04:00
Marek Černocký
509bdceac2 Updated Czech translation 2013-07-21 21:12:39 +02:00
Victor Ibragimov
835cb8caa5 Tajik translation updated 2013-07-21 11:23:25 +05:00
Piotr Drąg
ed32adc9bb Updated POTFILES.in 2013-07-19 20:59:02 +02:00
Jasper St. Pierre
44f8fecf84 slider: Explicitly grab the device that was clicked
It seems the Clutter bug mentioned has been fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:36:02 -04:00
Jasper St. Pierre
0cee0e08e9 slider: Make clicking anywhere on the slider menu item pass to the slider
This is a regression from splitting the slider out that never got fixed.
Restore the previous (useful) behavior by adding a public API to the
slider that lets us pass an event through.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:36:02 -04:00
Jasper St. Pierre
73cd595b73 volume: Implement new volume menu design
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

Since the designs require that we have a custom layout for the slider
item, this means that the PopupSliderMenuItem is unused, so remove it
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:35:54 -04:00
Jasper St. Pierre
c50b23e9ca system: Use icons for actions at the bottom of the system menu
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:35:39 -04:00
Jasper St. Pierre
d1a763bc21 system: Move the Switch User and Log Out items to a new submenu
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:35:32 -04:00
Jasper St. Pierre
de8ca5c1b5 system: Remove Install Updates & Restart
This will eventually end up in a redesign of the "end session" dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:35:20 -04:00
Jasper St. Pierre
14372ba7f3 system: Remove suspend from the features of the system menu
This will eventually go up in a redesign of the "end session" dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:35:02 -04:00
Jasper St. Pierre
ca861d8ff9 status: Rebrand the user menu as the system menu
As the user menu no longer really shows anything about the user, and just
power menu and settings, it's not really deserving of the "user menu" name,
so rename it to the ever-blandly-named "system menu".

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:44 -04:00
Jasper St. Pierre
37a316e66c power: Implement new power menu design
This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:30 -04:00
Jasper St. Pierre
22c8be6645 power: Use UPowerGlib for constants
This removes the need to define the constants from headers ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
8cce1b4f6c power: Remove other devices
Simply have one section.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
040bb9354a power: Restyle the power menu for the new design
Remove the icon next to devices, and make the percentage have the
"status" color.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
fb0f9cd1a1 popupMenu: Add a status label and icon to submenu menu items
This will allow us to implement the new submenu designs in the
aggregate menu.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
3816db03f5 popupMenu: Remove combo boxes and child menus
They're no longer used with the removal of the avatar widget.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
d802416dae userMenu: Implement new user menu design
For now, turn it into another system status button with a simple
icon. We'll revamp this when we revamp how panel menus work in
general.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
2cd41773ba status: Remove settings actions
These aren't used in the new system status designs.

This is a part of the new system status design, see
https://wiki.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/
for design details.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:17 -04:00
Jasper St. Pierre
8ce5b087bc userWidget: Rename the default style class of the user widget
As the status chooser is going away, it doesn't make sense to
keep the "status-chooser" name around.

https://bugzilla.gnome.org/show_bug.cgi?id=704368
2013-07-19 05:34:09 -04:00
Milo Casagrande
03fd74da4e [l10n] Updated Italian translation. 2013-07-19 09:27:25 +02:00
Jasper St. Pierre
ed178b702f windowManager: Actually respect hasWorkspaces
We've long had the hasWorkspaces property, but it doesn't seem like
it was ever used. Implement it so that we don't have workspaces in
initial-setup mode.

Since it's difficult to make it change at runtime with a decent set
of semantics, and we never expect that to happen, don't bother
implementing it dynamically.

https://bugzilla.gnome.org/show_bug.cgi?id=698593
2013-07-18 18:04:15 -04:00
Ray Strode
b4567acc6b unlockDialog: Use GdmUtil.AuthPrompt instead of ModalDialog
commit ea02380c15 made the login
screen stop using ModalDialog. It makes sense for the unlock
code to also stop using ModalDialog, too (for similar reasons).

Now that the login screen's auth prompt code has been separated
out, the unlock dialog can use it to get the buttons and spinners
etc, that it was previously getting from ModalDialog.

This commit drops the ModalDialog usage in the unlock dialog, and
makes the unlock dialog use GdmUtil.AuthPrompt instead.

https://bugzilla.gnome.org/show_bug.cgi?id=702308
2013-07-18 16:07:27 -04:00
Ray Strode
953f44bcc5 Revert "add annoying delay"
This reverts commit e9531487d9.

This is a testing commit and snuck in on accident.
2013-07-18 15:43:51 -04:00
Ray Strode
be4f259b71 util: add shell entry menu to auth prompt
This brings us parity with the unlock dialog, and is a prerequisite
for eventually moving the unlock dialog over to using the auth
prompt.

https://bugzilla.gnome.org/show_bug.cgi?id=702308
2013-07-18 15:41:02 -04:00
Ray Strode
e9531487d9 add annoying delay 2013-07-18 15:17:17 -04:00
Ray Strode
d715110961 loginDialog: factor auth prompt code out to utils
Right now there is a lot of duplicated code between the unlock
dialog and the login dialog.

This commit moves the login dialog's auth prompt to a separate
class, so that it can (in a subsequent commit) be used by the
unlock dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=702308
2013-07-18 14:36:00 -04:00
Ray Strode
3c31908e08 loginDialog: s/button-press-event/key-press-event/
A bug got introduced when moving the login dialog away from modal
dialog, such that it listens for escape key presses in a mouse
event handler instead of a keyboard event handler.

This commit fixes that code to correctly listen for key-press-event
instead of button-press-event.

https://bugzilla.gnome.org/show_bug.cgi?id=702308
2013-07-18 13:12:25 -04:00
Ray Strode
09d34a2129 unlockDialog: drop unused variable
https://bugzilla.gnome.org/show_bug.cgi?id=702308
2013-07-18 13:12:21 -04:00
Ray Strode
e5e3f3c299 loginDialog: avoid blinking user list when disable-user-list=true
Right now if disable-user-list is true we show it briefly, just so
that we can fade it out to the user entry.

This commit avoids the fade in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=704471
2013-07-18 13:08:31 -04:00
Kjartan Maraas
bcd1c793ea Updated Norwegian bokmål translation 2013-07-18 15:29:48 +02:00
Lionel Landwerlin
185152a74a popMenu: Fix invalid allocation
https://bugzilla.gnome.org/show_bug.cgi?id=704453
2013-07-18 14:28:33 +01:00
Ray Strode
ded99b9a09 screenShield: defer deactivation until all messages are shown
Right now when a user types their password to unlock their session
we end up getting an unlock signal from GDM right away.  We then
proceed to deactivate the screensaver before the user has a chance
to read his messages.

This commit makes sure we clear out the message queue before processing
the deactivation request.

https://bugzilla.gnome.org/show_bug.cgi?id=704347
2013-07-18 09:24:01 -04:00
Ray Strode
55a04bbf2b unlockDialog: don't unlock explicitly on verification-complete
logind sends out an "unlock" signal separately when
verification completes and we already listen for that,
so we don't need to unlock on verification-complete, too.

https://bugzilla.gnome.org/show_bug.cgi?id=704347
2013-07-18 09:23:15 -04:00
Ray Strode
7d5d7453c2 util: drop call that can't do anything
this._clearMessageQueue() is a noop when this.hasPendingMessages is
false so calling it in that case doesn't make sense.

This commit drops that call.

https://bugzilla.gnome.org/show_bug.cgi?id=704347
2013-07-18 09:23:11 -04:00
Ray Strode
952f58153f util: Fix no-more-messages signal
Now thas hasPendingMessages is fixed, we need to also fix the associated
signal "no-more-messages"

https://bugzilla.gnome.org/show_bug.cgi?id=704347
2013-07-18 09:23:11 -04:00
Adel Gadllah
d0d981435a appSwitcher: Add option to limit to the current workspace
Add an option to limit the appSwitcher to the current workspace. For users
that use workspaces for task separation this more convient then current
behviour. While having to add an option is unfortunate there is no way to make
both groups happy as workspaces usage differes between different users / types
of users.

https://bugzilla.gnome.org/show_bug.cgi?id=703538
2013-07-18 14:33:41 +02:00
Lionel Landwerlin
fd83990d8a st-theme-node: reset paint state when theme node changes
https://bugzilla.gnome.org/show_bug.cgi?id=704430
2013-07-18 01:12:44 +01:00
Lionel Landwerlin
ad0c4caf1c st-theme-node-transition: fix paint state corruption
https://bugzilla.gnome.org/show_bug.cgi?id=704411
2013-07-17 19:38:44 +01:00
Jasper St. Pierre
126f0ed95d popupMenu: Remove non-all-spanning versions of colspan in popup menus
This simplifies the code considerably, and makes 'expand' behave as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=704336
2013-07-17 12:52:22 -04:00
Jasper St. Pierre
a2b499c460 popupMenu: Fix closing submenus when clicking on the expander
We need to make sure that we reset the opened submenu when we close the
submenu, not trick the toplevel into thinking a closed submenu is the
currently opened menu.

https://bugzilla.gnome.org/show_bug.cgi?id=704336
2013-07-17 12:52:22 -04:00
Jasper St. Pierre
5a5b3bf291 popupMenu: Use the parent field for sensitivity chaining
Instead of a signal mess.

https://bugzilla.gnome.org/show_bug.cgi?id=704336
2013-07-17 12:52:22 -04:00
Jasper St. Pierre
a4a6e7cf53 popupMenu: Fix parenting implementation
I got confused between menus and menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=704336
2013-07-17 12:52:22 -04:00
Michael Wood
658db43ad3 popupMenu: Don't count the separator as an item when returning isEmpty
If we have a separator don't use it's possibly-unsynced visibility to
determine if the menu is empty or not.

https://bugzilla.gnome.org/show_bug.cgi?id=70386
2013-07-17 16:40:51 +01:00
Emilio Pozuelo Monfort
cfecd063c9 st-scroll-view: properly check if the scrollbars are visible
We don't set :visible on the scrollbars, but use booleans to track
if they are visible. Thus check the booleans instead of the actor's
properties when allocating the scrollbars.

https://bugzilla.gnome.org/show_bug.cgi?id=704265
2013-07-17 17:33:26 +02:00
Jasper St. Pierre
a8fe063726 util: Fix hasPendingMessages
While the UserVerifier does indeed have a _userVerifier inside
it, the hasPendingMessages property is on ourselves, not
_userVerifier.

https://bugzilla.gnome.org/show_bug.cgi?id=704347
2013-07-16 16:54:54 -04:00
Ray Strode
dcf637edd8 theme: fix spacing for "Log in as another user" button
At some point the Not Listed? button was moved to align it better
in the login screen.  That nudging made the "Log in as another user"
button (which uses the same style class) align worse.

This commit removes the padding at the unlock screen.

https://bugzilla.gnome.org/show_bug.cgi?id=704318
2013-07-16 14:14:26 -04:00
Allan Day
c0345f1088 theme: adjust scroll bar styling to new background color
Since the background color changed, the style of the scroll bar
needs to be adjusted to compensate.

https://bugzilla.gnome.org/show_bug.cgi?id=702305
2013-07-16 15:28:56 +01:00
Allan Day
0cbdfca141 theme: rework lock screen notification layout
Make the notifications wider and adjust the padding so they
aren't as tall. Also make the corner radius consistent with the
rest of the theme.

This makes the notifications look better, is more space
efficient, and is consistent with the latest mockups.

https://bugzilla.gnome.org/show_bug.cgi?id=702305
2013-07-16 15:12:16 +01:00
Allan Day
cb1f696e22 theme: adjust some colors to the new background
The background color is now lighter. That means that text and
button borders also need to be lighter to compensate.

https://bugzilla.gnome.org/show_bug.cgi?id=702305
2013-07-16 13:59:28 +01:00
44 changed files with 3978 additions and 5132 deletions

View File

@@ -186,6 +186,19 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
</key>
</schema>
<schema id="org.gnome.shell.app-switcher"
path="/org/gnome/shell/app-switcher/"
gettext-domain="@GETTEXT_PACKAGE@">
<key type="b" name="current-workspace-only">
<default>false</default>
<summary>Limit switcher to current workspace.</summary>
<description>
If true, only applications that have windows on the current workspace are shown in the switcher.
Otherwise, all applications are included.
</description>
</key>
</schema>
<enum id="org.gnome.shell.window-switcher.AppIconMode">
<value value="1" nick="thumbnail-only"/>
<value value="2" nick="app-icon-only"/>

View File

@@ -189,13 +189,6 @@ StScrollBar StButton#vhandle:active {
border-width: 0px;
}
.popup-combo-menu {
background-color: rgba(0,0,0,0.9);
padding: 1em 0em;
border: 1px solid #5f5f5f;
border-radius: 9px;
}
/* The remaining popup-menu sizing is all done in ems, so that if you
* override .popup-menu.font-size, everything else will scale with it.
*/
@@ -219,10 +212,6 @@ StScrollBar StButton#vhandle:active {
.popup-image-menu-item {
}
.popup-combobox-item {
spacing: 1em;
}
.popup-separator-menu-item {
-gradient-height: 1px;
-gradient-start: rgba(255,255,255,0.0);
@@ -236,10 +225,6 @@ StScrollBar StButton#vhandle:active {
font-weight: bold;
}
.popup-device-menu-item {
spacing: .5em;
}
.popup-status-menu-item {
font-weight: normal;
color: #999;
@@ -249,19 +234,10 @@ StScrollBar StButton#vhandle:active {
color: white;
}
.popup-subtitle-menu-item, .popup-subtitle-menu-item:insensitive {
font-weight: bold;
color: white;
}
.popup-menu-icon {
icon-size: 1.09em;
}
.popup-battery-percentage {
padding-left: 24px;
}
/* Switches */
.toggle-switch {
width: 65px;
@@ -286,10 +262,51 @@ StScrollBar StButton#vhandle:active {
background-size: contain;
}
.nm-menu-item-icons {
/* Network */
.nm-dialog {
max-height: 400px;
}
.nm-dialog-content {
spacing: 8px;
}
.nm-dialog-header-hbox {
spacing: 4px;
}
.nm-dialog-header-icon {
icon-size: 32px;
}
.nm-dialog-scroll-view {
border: 2px solid #666;
border-radius: 6px;
}
.nm-dialog-header {
font-weight: bold;
}
.nm-dialog-item {
font-size: 12pt;
border-bottom: 1px solid #666;
padding: 12px;
}
.nm-dialog-item:checked {
background-color: #333;
}
.nm-dialog-icons {
spacing: .5em;
}
.nm-dialog-icon {
icon-size: 16px;
}
/* Buttons */
.candidate-page-button,
@@ -361,7 +378,8 @@ StScrollBar StButton#vhandle:active {
.modal-dialog-button,
.notification-button,
.hotplug-notification-item,
.app-view-controls {
.app-view-controls,
#screenShieldNotifications {
border-radius: 18px;
}
@@ -604,58 +622,30 @@ StScrollBar StButton#vhandle:active {
spacing: 8px;
}
/* User Menu */
#panelUserMenu {
spacing: 4px;
}
.status-chooser {
spacing: .4em;
}
.status-chooser .popup-menu-item,
.status-chooser-combo .popup-menu-item {
padding: .4em;
}
.status-chooser-user-icon {
border: 2px solid #8b8b8b;
border-radius: 5px;
width: 48pt;
height: 48pt;
background-size: contain;
}
.status-chooser-user-icon:hover {
border: 2px solid #bbbbbb;
}
.status-chooser-user-name {
font-weight: bold;
font-size: 1.3em;
min-width: 120pt;
}
.status-chooser-combo {
border: 1px solid transparent;
}
.status-chooser-combo.popup-combo-menu {
padding: .4em 0em;
border-radius: 4px;
border: 1px solid #5f5f5f;
}
.status-chooser-status-item,
.status-chooser-combo .popup-combobox-item {
spacing: .4em;
}
.system-status-icon {
icon-size: 1.09em;
}
.system-switch-user-submenu-icon {
icon-size: 24px;
border: 1px solid #8b8b8b;
}
.system-menu-action {
color: #e6e6e6;
border-radius: 4px;
padding: 6px;
}
.system-menu-action:hover {
color: white;
background-color: rgba(255,255,255,0.1);
}
.system-menu-action > StIcon {
icon-size: 32px;
}
/* Overview */
#overview {
@@ -2206,6 +2196,18 @@ StScrollBar StButton#vhandle:active {
/* Login Dialog */
.framed-user-icon {
border: 2px solid #8b8b8b;
border-radius: 5px;
width: 48pt;
height: 48pt;
background-size: contain;
}
.framed-user-icon:hover {
border: 2px solid #bbbbbb;
}
.login-dialog-banner {
font-size: 10pt;
font-weight: bold;
@@ -2320,6 +2322,9 @@ StScrollBar StButton#vhandle:active {
font-weight: bold;
color: #666666;
padding-top: 1em;
}
.login-dialog-user-selection-box .login-dialog-not-listed-label {
padding-left: 2px;
}
@@ -2340,6 +2345,7 @@ StScrollBar StButton#vhandle:active {
padding-top: 24px;
padding-bottom: 12px;
spacing: 8px;
width: 23em;
}
.login-dialog-prompt-label {
@@ -2347,10 +2353,6 @@ StScrollBar StButton#vhandle:active {
font-size: 14px;
}
.login-dialog-prompt-entry {
width: 20em;
}
.login-dialog-session-list-button StIcon {
icon-size: 1.25em;
}
@@ -2477,30 +2479,27 @@ StScrollBar StButton#vhandle:active {
}
#screenShieldNotifications {
border-radius: 8px;
max-height: 500px;
padding: 18px 0;
padding: 12px;
}
.screen-shield-notifications-box {
spacing: 18px;
max-width: 34em;
spacing: 12px;
width: 30em;
}
.screen-shield-notification-source {
padding: 13px 24px;
padding: 3px 6px;
spacing: 5px;
}
.screen-shield-notification-label {
font-size: 1.2em;
font-weight: bold;
padding: 0px 18px;
color: #babdb6;
padding: 0px 0px 0px 12px;
}
.screen-shield-notification-count-text {
padding: 0px 18px;
padding: 0px 0px 0px 12px;
}
/* Remove background from notifications, otherwise
@@ -2518,6 +2517,31 @@ StScrollBar StButton#vhandle:active {
padding-bottom: 0px;
}
#screenShieldNotifications .notification-button,
#screenShieldNotifications .notification-icon-button {
border: 1px rgba(255,255,255,0.5);
}
#screenShieldNotifications StScrollBar StBin#trough {
background-color: rgba(0,0,0,0.2);
}
#screenShieldNotifications StScrollBar StButton#vhandle,
#screenShieldNotifications StScrollBar StButton#hhandle {
background-color: rgba(0,0,0,0.3);
border: none;
}
#screenShieldNotifications StScrollBar StButton#vhandle:hover,
#screenShieldNotifications StScrollBar StButton#hhandle {
background-color: rgba(0,0,0,0.6);
}
#screenShieldNotifications StScrollBar StButton#vhandle:active,
#screenShieldNotifications StScrollBar StButton#hhandle {
background-color: rgba(0,0,0,0.8);
}
.input-source-switcher-symbol {
font-size: 34pt;
width: 96px;

View File

@@ -17,6 +17,7 @@ misc/config.js: misc/config.js.in Makefile
jsdir = $(pkgdatadir)/js
nobase_dist_js_DATA = \
gdm/authPrompt.js \
gdm/batch.js \
gdm/fingerprint.js \
gdm/loginDialog.js \
@@ -33,7 +34,9 @@ nobase_dist_js_DATA = \
misc/jsParse.js \
misc/loginManager.js \
misc/modemManager.js \
misc/objectManager.js \
misc/params.js \
misc/smartcardManager.js \
misc/util.js \
perf/core.js \
ui/altTab.js \
@@ -95,10 +98,10 @@ nobase_dist_js_DATA = \
ui/status/power.js \
ui/status/volume.js \
ui/status/bluetooth.js \
ui/status/system.js \
ui/switcherPopup.js \
ui/tweener.js \
ui/unlockDialog.js \
ui/userMenu.js \
ui/userWidget.js \
ui/viewSelector.js \
ui/wanda.js \

506
js/gdm/authPrompt.js Normal file
View File

@@ -0,0 +1,506 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Lang = imports.lang;
const Signals = imports.signals;
const St = imports.gi.St;
const Animation = imports.ui.animation;
const Batch = imports.gdm.batch;
const GdmUtil = imports.gdm.util;
const Params = imports.misc.params;
const ShellEntry = imports.ui.shellEntry;
const Tweener = imports.ui.tweener;
const UserWidget = imports.ui.userWidget;
const DEFAULT_BUTTON_WELL_ICON_SIZE = 24;
const DEFAULT_BUTTON_WELL_ANIMATION_DELAY = 1.0;
const DEFAULT_BUTTON_WELL_ANIMATION_TIME = 0.3;
const MESSAGE_FADE_OUT_ANIMATION_TIME = 0.5;
const AuthPromptMode = {
UNLOCK_ONLY: 0,
UNLOCK_OR_LOG_IN: 1
};
const AuthPromptStatus = {
NOT_VERIFYING: 0,
VERIFYING: 1,
VERIFICATION_FAILED: 2,
VERIFICATION_SUCCEEDED: 3
};
const BeginRequestType = {
PROVIDE_USERNAME: 0,
DONT_PROVIDE_USERNAME: 1
};
const AuthPrompt = new Lang.Class({
Name: 'AuthPrompt',
_init: function(gdmClient, mode) {
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
this._gdmClient = gdmClient;
this._mode = mode;
let reauthenticationOnly;
if (this._mode == AuthPromptMode.UNLOCK_ONLY)
reauthenticationOnly = true;
else if (this._mode == AuthPromptMode.UNLOCK_OR_LOG_IN)
reauthenticationOnly = false;
this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly: reauthenticationOnly });
this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
this._userVerifier.connect('show-message', Lang.bind(this, this._onShowMessage));
this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
this._userVerifier.connect('show-login-hint', Lang.bind(this, this._onShowLoginHint));
this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._onHideLoginHint));
this._userVerifier.connect('smartcard-status-changed', Lang.bind(this, this._onSmartcardStatusChanged));
this.smartcardDetected = this._userVerifier.smartcardDetected;
this.connect('next', Lang.bind(this, function() {
this.updateSensitivity(false);
this.startSpinning();
if (this._queryingService) {
this._userVerifier.answerQuery(this._queryingService, this._entry.text);
} else {
this._preemptiveAnswer = this._entry.text;
}
}));
this.actor = new St.BoxLayout({ style_class: 'login-dialog-prompt-layout',
vertical: true });
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this.actor.connect('key-press-event',
Lang.bind(this, function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Escape) {
this.cancel();
}
}));
this._userWell = new St.Bin({ x_fill: true,
x_align: St.Align.START });
this.actor.add(this._userWell,
{ x_align: St.Align.START,
x_fill: true,
y_fill: true,
expand: true });
this._label = new St.Label({ style_class: 'login-dialog-prompt-label' });
this.actor.add(this._label,
{ expand: true,
x_fill: true,
y_fill: true,
x_align: St.Align.START });
this._entry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
can_focus: true });
ShellEntry.addContextMenu(this._entry, { isPassword: true });
this.actor.add(this._entry,
{ expand: true,
x_fill: true,
y_fill: false,
x_align: St.Align.START });
this._entry.grab_key_focus();
this._message = new St.Label({ opacity: 0 });
this._message.clutter_text.line_wrap = true;
this.actor.add(this._message, { x_fill: true });
this._loginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint-message' });
this.actor.add(this._loginHint);
this._buttonBox = new St.BoxLayout({ style_class: 'login-dialog-button-box',
vertical: false });
this.actor.add(this._buttonBox,
{ expand: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.END });
this._defaultButtonWell = new St.Widget();
this._defaultButtonWellActor = null;
this._initButtons();
let spinnerIcon = global.datadir + '/theme/process-working.svg';
this._spinner = new Animation.AnimatedIcon(spinnerIcon, DEFAULT_BUTTON_WELL_ICON_SIZE);
this._spinner.actor.opacity = 0;
this._spinner.actor.show();
this._defaultButtonWell.add_child(this._spinner.actor);
},
_onDestroy: function() {
this._userVerifier.clear();
this._userVerifier.disconnectAll();
this._userVerifier = null;
},
_initButtons: function() {
this.cancelButton = new St.Button({ style_class: 'modal-dialog-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true,
can_focus: true,
label: _("Cancel") });
this.cancelButton.connect('clicked',
Lang.bind(this, function() {
this.cancel();
}));
this._buttonBox.add(this.cancelButton,
{ expand: false,
x_fill: false,
y_fill: false,
x_align: St.Align.START,
y_align: St.Align.END });
this._buttonBox.add(this._defaultButtonWell,
{ expand: true,
x_fill: false,
y_fill: false,
x_align: St.Align.END,
y_align: St.Align.MIDDLE });
this.nextButton = new St.Button({ style_class: 'modal-dialog-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true,
can_focus: true,
label: _("Next") });
this.nextButton.connect('clicked',
Lang.bind(this, function() {
this.emit('next');
}));
this.nextButton.add_style_pseudo_class('default');
this._buttonBox.add(this.nextButton,
{ expand: false,
x_fill: false,
y_fill: false,
x_align: St.Align.END,
y_align: St.Align.END });
this._updateNextButtonSensitivity(this._entry.text.length > 0);
this._entry.clutter_text.connect('text-changed',
Lang.bind(this, function() {
if (!this._userVerifier.hasPendingMessages)
this._fadeOutMessage();
this._updateNextButtonSensitivity(this._entry.text.length > 0);
}));
this._entry.clutter_text.connect('activate', Lang.bind(this, function() {
this.emit('next');
}));
},
_onAskQuestion: function(verifier, serviceName, question, passwordChar) {
if (this._preemptiveAnswer) {
this._userVerifier.answerQuery(this._queryingService, this._preemptiveAnswer);
this._preemptiveAnswer = null;
return;
}
if (this._queryingService)
this.clear();
this._queryingService = serviceName;
this.setPasswordChar(passwordChar);
this.setQuestion(question);
if (passwordChar) {
if (this._userVerifier.reauthenticating)
this.nextButton.label = _("Unlock");
else
this.nextButton.label = C_("button", "Sign In");
} else {
this.nextButton.label = _("Next");
}
this.updateSensitivity(true);
this.emit('prompted');
},
_onSmartcardStatusChanged: function() {
this.smartcardDetected = this._userVerifier.smartcardDetected;
// Don't reset on smartcard insertion if we're already verifying
// and the smartcard is the main service
if (this._userVerifier.serviceIsDefault(GdmUtil.SMARTCARD_SERVICE_NAME) &&
this.verificationStatus == AuthPromptStatus.VERIFYING &&
this.smartcardDetected)
return;
if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED)
this.reset();
},
_onShowMessage: function(userVerifier, message, styleClass) {
this.setMessage(message, styleClass);
this.emit('prompted');
},
_onVerificationFailed: function() {
this.clear();
this.updateSensitivity(true);
this.setActorInDefaultButtonWell(null);
this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED;
},
_onVerificationComplete: function() {
this.verificationStatus = AuthPromptStatus.VERIFICATION_SUCCEEDED;
},
_onReset: function() {
if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED) {
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
this.reset();
}
},
_onShowLoginHint: function(verifier, message) {
this.setHint(message);
},
_onHideLoginHint: function() {
this.setHint(null);
},
addActorToDefaultButtonWell: function(actor) {
this._defaultButtonWell.add_child(actor);
actor.add_constraint(new Clutter.AlignConstraint({ source: this._spinner.actor,
align_axis: Clutter.AlignAxis.BOTH,
factor: 0.5 }));
},
setActorInDefaultButtonWell: function(actor, animate) {
if (!this._defaultButtonWellActor &&
!actor)
return;
let oldActor = this._defaultButtonWellActor;
if (oldActor)
Tweener.removeTweens(oldActor);
let isSpinner;
if (actor == this._spinner.actor)
isSpinner = true;
else
isSpinner = false;
if (this._defaultButtonWellActor != actor && oldActor) {
if (!animate) {
oldActor.opacity = 0;
} else {
Tweener.addTween(oldActor,
{ opacity: 0,
time: DEFAULT_BUTTON_WELL_ANIMATION_TIME,
delay: DEFAULT_BUTTON_WELL_ANIMATION_DELAY,
transition: 'linear',
onCompleteScope: this,
onComplete: function() {
if (isSpinner) {
if (this._spinner)
this._spinner.stop();
}
}
});
}
}
if (actor) {
if (isSpinner)
this._spinner.play();
if (!animate)
actor.opacity = 255;
else
Tweener.addTween(actor,
{ opacity: 255,
time: DEFAULT_BUTTON_WELL_ANIMATION_TIME,
delay: DEFAULT_BUTTON_WELL_ANIMATION_DELAY,
transition: 'linear' });
}
this._defaultButtonWellActor = actor;
},
startSpinning: function() {
this.setActorInDefaultButtonWell(this._spinner.actor, true);
},
stopSpinning: function() {
this.setActorInDefaultButtonWell(null, false);
},
clear: function() {
this._entry.text = '';
this.stopSpinning();
},
setPasswordChar: function(passwordChar) {
this._entry.clutter_text.set_password_char(passwordChar);
this._entry.menu.isPassword = passwordChar != '';
},
setQuestion: function(question) {
this._label.set_text(question);
this._label.show();
this._entry.show();
this._loginHint.opacity = 0;
this._loginHint.show();
this._entry.grab_key_focus();
},
getAnswer: function() {
let text = this._entry.get_text();
return text;
},
_fadeOutMessage: function() {
if (this._message.opacity == 0)
return;
Tweener.removeTweens(this._message);
Tweener.addTween(this._message,
{ opacity: 0,
time: MESSAGE_FADE_OUT_ANIMATION_TIME,
transition: 'easeOutQuad'
});
},
setMessage: function(message, styleClass) {
if (message) {
Tweener.removeTweens(this._message);
this._message.text = message;
this._message.styleClass = styleClass;
this._message.opacity = 255;
} else {
this._message.opacity = 0;
}
},
_updateNextButtonSensitivity: function(sensitive) {
this.nextButton.reactive = sensitive;
this.nextButton.can_focus = sensitive;
},
updateSensitivity: function(sensitive) {
this._updateNextButtonSensitivity(sensitive);
this._entry.reactive = sensitive;
this._entry.clutter_text.editable = sensitive;
},
hide: function() {
this.setActorInDefaultButtonWell(null, true);
this.actor.hide();
this._loginHint.opacity = 0;
this.setUser(null);
this.updateSensitivity(true);
this._entry.set_text('');
},
setUser: function(user) {
if (user) {
let userWidget = new UserWidget.UserWidget(user);
this._userWell.set_child(userWidget.actor);
} else {
this._userWell.set_child(null);
}
},
setHint: function(message) {
if (message) {
this._loginHint.set_text(message)
this._loginHint.opacity = 255;
} else {
this._loginHint.opacity = 0;
this._loginHint.set_text('');
}
},
reset: function() {
let oldStatus = this.verificationStatus;
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
if (oldStatus == AuthPromptStatus.VERIFYING)
this._userVerifier.cancel();
this._queryingService = null;
this.clear();
this._message.opacity = 0;
this.setUser(null);
this.stopSpinning();
this.setHint(null);
if (oldStatus == AuthPromptStatus.VERIFICATION_FAILED)
this.emit('failed');
let beginRequestType;
if (this._mode == AuthPromptMode.UNLOCK_ONLY) {
// The user is constant at the unlock screen
beginRequestType = BeginRequestType.PROVIDE_USERNAME;
} else if (this.smartcardDetected &&
this._userVerifier.serviceIsForeground(GdmUtil.SMARTCARD_SERVICE_NAME)) {
// We don't need to know the username if the user preempted the login screen
// with a smartcard.
beginRequestType = BeginRequestType.DONT_PROVIDE_USERNAME;
} else {
// In all other cases, we should get the username up front.
beginRequestType = BeginRequestType.PROVIDE_USERNAME;
}
this.emit('reset', beginRequestType);
},
addCharacter: function(unichar) {
if (!this._entry.visible)
return;
this._entry.grab_key_focus();
this._entry.clutter_text.insert_unichar(unichar);
},
begin: function(params) {
params = Params.parse(params, { userName: null,
hold: null });
this.updateSensitivity(false);
let hold = params.hold;
if (!hold)
hold = new Batch.Hold();
this._userVerifier.begin(params.userName, hold);
this.verificationStatus = AuthPromptStatus.VERIFYING;
},
finish: function(onComplete) {
if (!this._userVerifier.hasPendingMessages) {
onComplete();
return;
}
let signalId = this._userVerifier.connect('no-more-messages',
Lang.bind(this, function() {
this._userVerifier.disconnect(signalId);
onComplete();
}));
},
cancel: function() {
this.reset();
this.emit('cancelled');
}
});
Signals.addSignalMethods(AuthPrompt.prototype);

View File

@@ -32,7 +32,7 @@ const Shell = imports.gi.Shell;
const Signals = imports.signals;
const St = imports.gi.St;
const Animation = imports.ui.animation;
const AuthPrompt = imports.gdm.authPrompt;
const Batch = imports.gdm.batch;
const BoxPointer = imports.ui.boxpointer;
const CtrlAltTab = imports.ui.ctrlAltTab;
@@ -46,20 +46,11 @@ const UserWidget = imports.ui.userWidget;
const _FADE_ANIMATION_TIME = 0.25;
const _SCROLL_ANIMATION_TIME = 0.5;
const _DEFAULT_BUTTON_WELL_ICON_SIZE = 24;
const _DEFAULT_BUTTON_WELL_ANIMATION_DELAY = 1.0;
const _DEFAULT_BUTTON_WELL_ANIMATION_TIME = 0.3;
const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0;
const _LOGO_ICON_HEIGHT = 48;
let _loginDialog = null;
const DefaultButtonWellMode = {
NONE: 0,
SESSION_MENU_BUTTON: 1,
SPINNER: 2
};
const UserListItem = new Lang.Class({
Name: 'UserListItem',
@@ -410,10 +401,10 @@ const LoginDialog = new Lang.Class({
parentActor.add_child(this.actor);
this._userManager = AccountsService.UserManager.get_default()
this._greeterClient = new Gdm.Client();
let gdmClient = new Gdm.Client();
if (GLib.getenv('GDM_GREETER_TEST') != '1') {
this._greeter = this._greeterClient.get_greeter_sync(null);
this._greeter = gdmClient.get_greeter_sync(null);
this._greeter.connect('default-session-name-changed',
Lang.bind(this, this._onDefaultSessionChanged));
@@ -424,15 +415,6 @@ const LoginDialog = new Lang.Class({
Lang.bind(this, this._onTimedLoginRequested));
}
this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient);
this._userVerifier.connect('ask-question', Lang.bind(this, this._askQuestion));
this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
this._userVerifier.connect('verification-failed', Lang.bind(this, this._verificationFailed));
this._userVerifier.connect('reset', Lang.bind(this, this._reset));
this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
this._verifyingUser = false;
this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_KEY,
@@ -449,7 +431,8 @@ const LoginDialog = new Lang.Class({
Lang.bind(this, this._updateLogoTexture));
this._userSelectionBox = new St.BoxLayout({ style_class: 'login-dialog-user-selection-box',
vertical: true });
vertical: true,
visible: false });
this._userSelectionBox.add_constraint(new Clutter.AlignConstraint({ source: this.actor,
align_axis: Clutter.AlignAxis.BOTH,
factor: 0.5 }));
@@ -466,67 +449,19 @@ const LoginDialog = new Lang.Class({
x_fill: true,
y_fill: true });
this._promptBox = new St.BoxLayout({ style_class: 'login-dialog-prompt-layout',
vertical: true });
this._authPrompt = new AuthPrompt.AuthPrompt(gdmClient, AuthPrompt.AuthPromptMode.UNLOCK_OR_LOG_IN);
this._authPrompt.connect('prompted', Lang.bind(this, this._onPrompted));
this._authPrompt.connect('reset', Lang.bind(this, this._onReset));
this._authPrompt.hide();
this._promptBox.connect('button-press-event',
Lang.bind(this, function(actor, event) {
if (event.get_key_symbol() == Clutter.KEY_Escape) {
this.cancel();
}
}));
this._authPrompt.actor.add_constraint(new Clutter.AlignConstraint({ source: this.actor,
align_axis: Clutter.AlignAxis.BOTH,
factor: 0.5 }));
this._promptBox.add_constraint(new Clutter.AlignConstraint({ source: this.actor,
align_axis: Clutter.AlignAxis.BOTH,
factor: 0.5 }));
this.actor.add_child(this._promptBox);
this._userList.actor.add_constraint(new Clutter.BindConstraint({ source: this._promptBox,
this.actor.add_child(this._authPrompt.actor);
this._userList.actor.add_constraint(new Clutter.BindConstraint({ source: this._authPrompt.actor,
coordinate: Clutter.BindCoordinate.WIDTH }));
this._promptUser = new St.Bin({ x_fill: true,
x_align: St.Align.START });
this._promptBox.add(this._promptUser,
{ x_align: St.Align.START,
x_fill: true,
y_fill: true,
expand: true });
this._promptLabel = new St.Label({ style_class: 'login-dialog-prompt-label' });
this._promptBox.add(this._promptLabel,
{ expand: true,
x_fill: true,
y_fill: true,
x_align: St.Align.START });
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
can_focus: true });
this._promptEntryTextChangedId = 0;
this._promptEntryActivateId = 0;
this._promptBox.add(this._promptEntry,
{ expand: true,
x_fill: true,
y_fill: false,
x_align: St.Align.START });
this._promptEntry.grab_key_focus();
this._promptMessage = new St.Label({ opacity: 0 });
this._promptBox.add(this._promptMessage, { x_fill: true });
this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint-message' });
this._promptBox.add(this._promptLoginHint);
this._buttonBox = new St.BoxLayout({ style_class: 'login-dialog-button-box',
vertical: false });
this._promptBox.add(this._buttonBox,
{ expand: true,
x_align: St.Align.MIDDLE,
y_align: St.Align.END });
this._cancelButton = null;
this._signInButton = null;
this._promptBox.hide();
// translators: this message is shown below the user list on the
// login screen. It can be activated to reveal an entry for
// manually entering the username.
@@ -540,7 +475,12 @@ const LoginDialog = new Lang.Class({
x_align: St.Align.START,
x_fill: true });
this._notListedButton.connect('clicked', Lang.bind(this, this._hideUserListAndLogIn));
this._notListedButton.connect('clicked',
Lang.bind(this, function() {
this._authPrompt.cancelButton.show();
this._hideUserListAskForUsernameAndBeginVerification();
}));
this._notListedButton.hide();
this._userSelectionBox.add(this._notListedButton,
@@ -576,8 +516,6 @@ const LoginDialog = new Lang.Class({
this._onUserListActivated(item);
}));
this._defaultButtonWell = new St.Widget();
this._defaultButtonWellMode = DefaultButtonWellMode.NONE;
this._sessionMenuButton = new SessionMenuButton();
this._sessionMenuButton.connect('session-activated',
@@ -586,17 +524,8 @@ const LoginDialog = new Lang.Class({
}));
this._sessionMenuButton.actor.opacity = 0;
this._sessionMenuButton.actor.show();
this._defaultButtonWell.add_child(this._sessionMenuButton.actor);
this._authPrompt.addActorToDefaultButtonWell(this._sessionMenuButton.actor);
let spinnerIcon = global.datadir + '/theme/process-working.svg';
this._workSpinner = new Animation.AnimatedIcon(spinnerIcon, _DEFAULT_BUTTON_WELL_ICON_SIZE);
this._workSpinner.actor.opacity = 0;
this._workSpinner.actor.show();
this._defaultButtonWell.add_child(this._workSpinner.actor);
this._sessionMenuButton.actor.add_constraint(new Clutter.AlignConstraint({ source: this._workSpinner.actor,
align_axis: Clutter.AlignAxis.BOTH,
factor: 0.5 }));
},
_updateDisableUserList: function() {
@@ -605,8 +534,8 @@ const LoginDialog = new Lang.Class({
if (disableUserList != this._disableUserList) {
this._disableUserList = disableUserList;
if (!this._verifyingUser)
this._reset();
if (this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
this._authPrompt.reset();
}
},
@@ -640,122 +569,38 @@ const LoginDialog = new Lang.Class({
this._updateLogoTexture(this._textureCache, this._logoFileUri);
},
_reset: function() {
this._userVerifier.clear();
_onPrompted: function() {
this._sessionMenuButton.updateSensitivity(true);
if (this._shouldShowSessionMenuButton())
this._authPrompt.setActorInDefaultButtonWell(this._sessionMenuButton.actor);
this._showPrompt();
},
_onReset: function(authPrompt, beginRequest) {
this._sessionMenuButton.updateSensitivity(true);
this._updateSensitivity(true);
this._promptMessage.opacity = 0;
this._user = null;
this._verifyingUser = false;
if (this._disableUserList)
this._hideUserListAndLogIn();
else
this._showUserList();
},
_getActorForDefaultButtonWellMode: function(mode) {
let actor;
if (mode == DefaultButtonWellMode.NONE)
actor = null;
else if (mode == DefaultButtonWellMode.SPINNER)
actor = this._workSpinner.actor;
else if (mode == DefaultButtonWellMode.SESSION_MENU_BUTTON)
actor = this._sessionMenuButton.actor;
return actor;
},
_setDefaultButtonWellMode: function(mode, immediately) {
if (this._defaultButtonWellMode == DefaultButtonWellMode.NONE &&
mode == DefaultButtonWellMode.NONE)
return;
let oldActor = this._getActorForDefaultButtonWellMode(this._defaultButtonWellMode);
if (oldActor)
Tweener.removeTweens(oldActor);
let actor = this._getActorForDefaultButtonWellMode(mode);
if (this._defaultButtonWellMode != mode && oldActor) {
if (immediately)
oldActor.opacity = 0;
else
Tweener.addTween(oldActor,
{ opacity: 0,
time: _DEFAULT_BUTTON_WELL_ANIMATION_TIME,
delay: _DEFAULT_BUTTON_WELL_ANIMATION_DELAY,
transition: 'linear',
onCompleteScope: this,
onComplete: function() {
if (mode == DefaultButtonWellMode.SPINNER) {
if (this._workSpinner)
this._workSpinner.stop();
}
}
});
if (beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
if (this._disableUserList) {
this._authPrompt.cancelButton.hide();
this._hideUserListAskForUsernameAndBeginVerification();
} else {
this._showUserList();
}
} else {
this._authPrompt.cancelButton.hide();
this._hideUserListAndBeginVerification();
}
if (actor) {
if (mode == DefaultButtonWellMode.SPINNER)
this._workSpinner.play();
if (immediately)
actor.opacity = 255;
else
Tweener.addTween(actor,
{ opacity: 255,
time: _DEFAULT_BUTTON_WELL_ANIMATION_TIME,
delay: _DEFAULT_BUTTON_WELL_ANIMATION_DELAY,
transition: 'linear' });
}
this._defaultButtonWellMode = mode;
},
_verificationFailed: function() {
this._promptEntry.text = '';
this._updateSensitivity(true);
this._setDefaultButtonWellMode(DefaultButtonWellMode.NONE, true);
},
_onDefaultSessionChanged: function(client, sessionId) {
this._sessionMenuButton.setActiveSession(sessionId);
},
_showMessage: function(userVerifier, message, styleClass) {
if (message) {
this._promptMessage.text = message;
this._promptMessage.styleClass = styleClass;
this._promptMessage.opacity = 255;
} else {
this._promptMessage.opacity = 0;
}
},
_showLoginHint: function(verifier, message) {
this._promptLoginHint.set_text(message)
this._promptLoginHint.opacity = 255;
},
_hideLoginHint: function() {
this._promptLoginHint.opacity = 0;
this._promptLoginHint.set_text('');
},
cancel: function() {
if (this._verifyingUser)
this._userVerifier.cancel();
else
this._reset();
},
_shouldShowSessionMenuButton: function() {
if (this._verifyingUser)
if (this._authPrompt.verifyingUser)
return true;
if (!this._user)
@@ -767,158 +612,15 @@ const LoginDialog = new Lang.Class({
return true;
},
_showPrompt: function(forSecret) {
this._promptLabel.show();
this._promptEntry.show();
this._promptLoginHint.opacity = 0;
this._promptLoginHint.show();
this._promptBox.opacity = 0;
this._promptBox.show();
Tweener.addTween(this._promptBox,
_showPrompt: function() {
if (this._authPrompt.actor.visible)
return;
this._authPrompt.actor.opacity = 0;
this._authPrompt.actor.show();
Tweener.addTween(this._authPrompt.actor,
{ opacity: 255,
time: _FADE_ANIMATION_TIME,
transition: 'easeOutQuad' });
if (this._shouldShowSessionMenuButton())
this._setDefaultButtonWellMode(DefaultButtonWellMode.SESSION_MENU_BUTTON, true);
else
this._setDefaultButtonWellMode(DefaultButtonWellMode.NONE, true);
this._promptEntry.grab_key_focus();
let hold = new Batch.Hold();
let tasks = [function() {
this._prepareDialog(forSecret, hold);
},
hold];
let batch = new Batch.ConcurrentBatch(this, tasks);
return batch.run();
},
_prepareDialog: function(forSecret, hold) {
this._buttonBox.visible = true;
this._buttonBox.remove_all_children();
if (!this._disableUserList || this._verifyingUser) {
this._cancelButton = new St.Button({ style_class: 'modal-dialog-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true,
can_focus: true,
label: _("Cancel") });
this._cancelButton.connect('clicked',
Lang.bind(this, function() {
this.cancel();
}));
this._buttonBox.add(this._cancelButton,
{ expand: false,
x_fill: false,
y_fill: false,
x_align: St.Align.START,
y_align: St.Align.END });
}
this._buttonBox.add(this._defaultButtonWell,
{ expand: true,
x_fill: false,
y_fill: false,
x_align: St.Align.END,
y_align: St.Align.MIDDLE });
this._signInButton = new St.Button({ style_class: 'modal-dialog-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true,
can_focus: true,
label: forSecret ? C_("button", "Sign In") : _("Next") });
this._signInButton.connect('clicked',
Lang.bind(this, function() {
hold.release();
}));
this._signInButton.add_style_pseudo_class('default');
this._buttonBox.add(this._signInButton,
{ expand: false,
x_fill: false,
y_fill: false,
x_align: St.Align.END,
y_align: St.Align.END });
this._updateSignInButtonSensitivity(this._promptEntry.text.length > 0);
this._promptEntryTextChangedId =
this._promptEntry.clutter_text.connect('text-changed',
Lang.bind(this, function() {
this._updateSignInButtonSensitivity(this._promptEntry.text.length > 0);
}));
this._promptEntryActivateId =
this._promptEntry.clutter_text.connect('activate', function() {
hold.release();
});
},
_updateSensitivity: function(sensitive) {
this._promptEntry.reactive = sensitive;
this._promptEntry.clutter_text.editable = sensitive;
this._sessionMenuButton.updateSensitivity(sensitive);
this._updateSignInButtonSensitivity(sensitive);
},
_updateSignInButtonSensitivity: function(sensitive) {
if (this._signInButton) {
this._signInButton.reactive = sensitive;
this._signInButton.can_focus = sensitive;
}
},
_hidePrompt: function() {
if (this._promptEntryTextChangedId > 0) {
this._promptEntry.clutter_text.disconnect(this._promptEntryTextChangedId);
this._promptEntryTextChangedId = 0;
}
if (this._promptEntryActivateId > 0) {
this._promptEntry.clutter_text.disconnect(this._promptEntryActivateId);
this._promptEntryActivateId = 0;
}
this._setDefaultButtonWellMode(DefaultButtonWellMode.NONE, true);
this._promptBox.hide();
this._promptLoginHint.opacity = 0;
this._promptUser.set_child(null);
this._updateSensitivity(true);
this._promptEntry.set_text('');
this._sessionMenuButton.close();
this._promptLoginHint.opacity = 0;
this._buttonBox.remove_all_children();
this._signInButton = null;
this._cancelButton = null;
},
_askQuestion: function(verifier, serviceName, question, passwordChar) {
this._promptLabel.set_text(question);
this._updateSensitivity(true);
this._promptEntry.set_text('');
this._promptEntry.clutter_text.set_password_char(passwordChar);
let tasks = [function() {
return this._showPrompt(!!passwordChar);
},
function() {
let text = this._promptEntry.get_text();
this._updateSensitivity(false);
this._setDefaultButtonWellMode(DefaultButtonWellMode.SPINNER, false);
this._userVerifier.answerQuery(serviceName, text);
}];
let batch = new Batch.ConsecutiveBatch(this, tasks);
return batch.run();
},
_showRealmLoginHint: function(realmManager, hint) {
@@ -931,34 +633,32 @@ const LoginDialog = new Lang.Class({
// Translators: this message is shown below the username entry field
// to clue the user in on how to login to the local network realm
this._showLoginHint(null, _("(e.g., user or %s)").format(hint));
this._authPrompt.setHint(_("(e.g., user or %s)").format(hint));
},
_askForUsernameAndLogIn: function() {
this._promptLabel.set_text(_("Username: "));
this._promptEntry.set_text('');
this._promptEntry.clutter_text.set_password_char('');
_askForUsernameAndBeginVerification: function() {
this._authPrompt.setPasswordChar('');
this._authPrompt.setQuestion(_("Username: "));
let realmManager = new Realmd.Manager();
let signalId = realmManager.connect('login-format-changed',
Lang.bind(this, this._showRealmLoginHint));
let realmSignalId = realmManager.connect('login-format-changed',
Lang.bind(this, this._showRealmLoginHint));
this._showRealmLoginHint(realmManager.loginFormat);
let tasks = [this._showPrompt,
let nextSignalId = this._authPrompt.connect('next',
Lang.bind(this, function() {
this._authPrompt.disconnect(nextSignalId);
this._authPrompt.updateSensitivity(false);
let answer = this._authPrompt.getAnswer();
this._authPrompt.clear();
this._authPrompt.cancelButton.show();
this._authPrompt.startSpinning();
this._authPrompt.begin({ userName: answer });
function() {
let userName = this._promptEntry.get_text();
this._promptEntry.reactive = false;
return this._beginVerificationForUser(userName);
},
function() {
realmManager.disconnect(signalId)
realmManager.release();
}];
let batch = new Batch.ConsecutiveBatch(this, tasks);
return batch.run();
realmManager.disconnect(realmSignalId)
realmManager.release();
}));
this._showPrompt();
},
_startSession: function(serviceName) {
@@ -985,15 +685,9 @@ const LoginDialog = new Lang.Class({
},
_onSessionOpened: function(client, serviceName) {
if (!this._userVerifier.hasPendingMessages) {
this._authPrompt.finish(Lang.bind(this, function() {
this._startSession(serviceName);
} else {
let signalId = this._userVerifier.connect('no-more-messages',
Lang.bind(this, function() {
this._userVerifier.disconnect(signalId);
this._startSession(serviceName);
}));
}
}));
},
_waitForItemForUser: function(userName) {
@@ -1125,39 +819,42 @@ const LoginDialog = new Lang.Class({
this._userSelectionBox.visible = expanded;
},
_hideUserListAndLogIn: function() {
_hideUserList: function() {
this._setUserListExpanded(false);
GdmUtil.cloneAndFadeOutActor(this._userSelectionBox);
this._askForUsernameAndLogIn();
if (this._userSelectionBox.visible)
GdmUtil.cloneAndFadeOutActor(this._userSelectionBox);
},
_hideUserListAskForUsernameAndBeginVerification: function() {
this._hideUserList();
this._askForUsernameAndBeginVerification();
},
_hideUserListAndBeginVerification: function() {
this._hideUserList();
this._authPrompt.begin();
},
_showUserList: function() {
this._hidePrompt();
this._authPrompt.hide();
this._sessionMenuButton.close();
this._authPrompt.cancelButton.show();
this._setUserListExpanded(true);
this._notListedButton.show();
this._userList.actor.grab_key_focus();
},
_beginVerificationForUser: function(userName) {
_beginVerificationForItem: function(item) {
this._authPrompt.setUser(item.user);
let userName = item.user.get_user_name();
let hold = new Batch.Hold();
this._userVerifier.begin(userName, hold);
this._verifyingUser = true;
this._authPrompt.begin({ userName: userName,
hold: hold });
return hold;
},
_beginVerificationForItem: function(item) {
let userWidget = new UserWidget.UserWidget(item.user);
this._promptUser.set_child(userWidget.actor);
let tasks = [function() {
let userName = item.user.get_user_name();
return this._beginVerificationForUser(userName);
}];
let batch = new Batch.ConsecutiveBatch(this, tasks);
return batch.run();
},
_onUserListActivated: function(activatedItem) {
let tasks = [function() {
return GdmUtil.cloneAndFadeOutActor(this._userSelectionBox);
@@ -1216,7 +913,7 @@ const LoginDialog = new Lang.Class({
},
addCharacter: function(unichar) {
this._promptEntry.clutter_text.insert_unichar(unichar);
this._authPrompt.addCharacter(unichar);
},
});
Signals.addSignalMethods(LoginDialog.prototype);

View File

@@ -6,20 +6,26 @@ const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
const St = imports.gi.St;
const Batch = imports.gdm.batch;
const Fprint = imports.gdm.fingerprint;
const Main = imports.ui.main;
const Params = imports.misc.params;
const ShellEntry = imports.ui.shellEntry;
const SmartcardManager = imports.misc.smartcardManager;
const Tweener = imports.ui.tweener;
const PASSWORD_SERVICE_NAME = 'gdm-password';
const FINGERPRINT_SERVICE_NAME = 'gdm-fingerprint';
const SMARTCARD_SERVICE_NAME = 'gdm-smartcard';
const FADE_ANIMATION_TIME = 0.16;
const CLONE_FADE_ANIMATION_TIME = 0.25;
const LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen';
const PASSWORD_AUTHENTICATION_KEY = 'enable-password-authentication';
const FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication';
const SMARTCARD_AUTHENTICATION_KEY = 'enable-smartcard-authentication';
const BANNER_MESSAGE_KEY = 'banner-message-enable';
const BANNER_MESSAGE_TEXT_KEY = 'banner-message-text';
const ALLOWED_FAILURES_KEY = 'allowed-failures';
@@ -114,11 +120,34 @@ const ShellUserVerifier = new Lang.Class({
this._client = client;
this._settings = new Gio.Settings({ schema: LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed',
Lang.bind(this, function() {
this._updateDefaultService();
}));
this._updateDefaultService();
this._fprintManager = new Fprint.FprintManager();
this._smartcardManager = SmartcardManager.getSmartcardManager();
// We check for smartcards right away, since an inserted smartcard
// at startup should result in immediately initiating authentication.
// This is different than fingeprint readers, where we only check them
// after a user has been picked.
this._checkForSmartcard();
this._smartcardManager.connect('smartcard-inserted',
Lang.bind(this, function() {
this._checkForSmartcard();
}));
this._smartcardManager.connect('smartcard-removed',
Lang.bind(this, function() {
this._checkForSmartcard();
}));
this._messageQueue = [];
this._messageQueueTimeoutId = 0;
this.hasPendingMessages = false;
this.reauthenticating = false;
this._failCounter = 0;
},
@@ -127,6 +156,7 @@ const ShellUserVerifier = new Lang.Class({
this._cancellable = new Gio.Cancellable();
this._hold = hold;
this._userName = userName;
this.reauthenticating = false;
this._checkForFingerprintReader();
@@ -144,8 +174,10 @@ const ShellUserVerifier = new Lang.Class({
if (this._cancellable)
this._cancellable.cancel();
if (this._userVerifier)
if (this._userVerifier) {
this._userVerifier.call_cancel_sync(null);
this.clear();
}
},
clear: function() {
@@ -163,15 +195,14 @@ const ShellUserVerifier = new Lang.Class({
},
answerQuery: function(serviceName, answer) {
if (!this._userVerifier.hasPendingMessages) {
this._clearMessageQueue();
if (!this.hasPendingMessages) {
this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
} else {
let signalId = this._userVerifier.connect('no-more-messages',
Lang.bind(this, function() {
this._userVerifier.disconnect(signalId);
this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
}));
let signalId = this.connect('no-more-messages',
Lang.bind(this, function() {
this.disconnect(signalId);
this._userVerifier.call_answer_query(serviceName, answer, this._cancellable, null);
}));
}
},
@@ -241,6 +272,28 @@ const ShellUserVerifier = new Lang.Class({
}));
},
_checkForSmartcard: function() {
let smartcardDetected;
if (!this._settings.get_boolean(SMARTCARD_AUTHENTICATION_KEY))
smartcardDetected = false;
else if (this.reauthenticating)
smartcardDetected = this._smartcardManager.hasInsertedLoginToken();
else
smartcardDetected = this._smartcardManager.hasInsertedTokens();
if (smartcardDetected != this.smartcardDetected) {
this.smartcardDetected = smartcardDetected;
if (this.smartcardDetected)
this._preemptingService = SMARTCARD_SERVICE_NAME;
else if (this._preemptingService == SMARTCARD_SERVICE_NAME)
this._preemptingService = null;
this.emit('smartcard-status-changed');
}
},
_reportInitError: function(where, error) {
logError(error, where);
this._hold.release();
@@ -266,6 +319,7 @@ const ShellUserVerifier = new Lang.Class({
return;
}
this.reauthenticating = true;
this._connectSignals();
this._beginVerification();
this._hold.release();
@@ -296,11 +350,35 @@ const ShellUserVerifier = new Lang.Class({
this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
},
_getForegroundService: function() {
if (this._preemptingService)
return this._preemptingService;
return this._defaultService;
},
serviceIsForeground: function(serviceName) {
return serviceName == this._getForegroundService();
},
serviceIsDefault: function(serviceName) {
return serviceName == this._defaultService;
},
_updateDefaultService: function() {
if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
this._defaultService = PASSWORD_SERVICE_NAME;
else if (this._settings.get_boolean(SMARTCARD_AUTHENTICATION_KEY))
this._defaultService = SMARTCARD_SERVICE_NAME;
else if (this._settings.get_boolean(FINGERPRINT_AUTHENTICATION_KEY))
this._defaultService = FINGERPRINT_SERVICE_NAME;
},
_beginVerification: function() {
this._hold.acquire();
if (this._userName) {
this._userVerifier.call_begin_verification_for_user(PASSWORD_SERVICE_NAME,
this._userVerifier.call_begin_verification_for_user(this._getForegroundService(),
this._userName,
this._cancellable,
Lang.bind(this, function(obj, result) {
@@ -316,7 +394,7 @@ const ShellUserVerifier = new Lang.Class({
this._hold.release();
}));
if (this._haveFingerprintReader) {
if (this._haveFingerprintReader && !this.serviceIsForeground(FINGERPRINT_SERVICE_NAME)) {
this._hold.acquire();
this._userVerifier.call_begin_verification_for_user(FINGERPRINT_SERVICE_NAME,
@@ -336,7 +414,7 @@ const ShellUserVerifier = new Lang.Class({
}));
}
} else {
this._userVerifier.call_begin_verification(PASSWORD_SERVICE_NAME,
this._userVerifier.call_begin_verification(this._getForegroundService(),
this._cancellable,
Lang.bind(this, function(obj, result) {
try {
@@ -354,39 +432,36 @@ const ShellUserVerifier = new Lang.Class({
},
_onInfo: function(client, serviceName, info) {
// We don't display fingerprint messages, because they
// have words like UPEK in them. Instead we use the messages
// as a cue to display our own message.
if (serviceName == FINGERPRINT_SERVICE_NAME &&
if (this.serviceIsForeground(serviceName)) {
this._queueMessage(info, 'login-dialog-message-info');
} else if (serviceName == FINGERPRINT_SERVICE_NAME &&
this._haveFingerprintReader) {
// We don't show fingeprint messages directly since it's
// not the main auth service. Instead we use the messages
// as a cue to display our own message.
// Translators: this message is shown below the password entry field
// to indicate the user can swipe their finger instead
this.emit('show-login-hint', _("(or swipe finger)"));
} else if (serviceName == PASSWORD_SERVICE_NAME) {
this._queueMessage(info, 'login-dialog-message-info');
}
},
_onProblem: function(client, serviceName, problem) {
// we don't want to show auth failed messages to
// users who haven't enrolled their fingerprint.
if (serviceName != PASSWORD_SERVICE_NAME)
if (!this.serviceIsForeground(serviceName))
return;
this._queueMessage(problem, 'login-dialog-message-warning');
},
_onInfoQuery: function(client, serviceName, question) {
// We only expect questions to come from the main auth service
if (serviceName != PASSWORD_SERVICE_NAME)
if (!this.serviceIsForeground(serviceName))
return;
this.emit('ask-question', serviceName, question, '');
},
_onSecretInfoQuery: function(client, serviceName, secretQuestion) {
// We only expect secret requests to come from the main auth service
if (serviceName != PASSWORD_SERVICE_NAME)
if (!this.serviceIsForeground(serviceName))
return;
this.emit('ask-question', serviceName, secretQuestion, '\u25cf');
@@ -395,6 +470,7 @@ const ShellUserVerifier = new Lang.Class({
_onReset: function() {
// Clear previous attempts to authenticate
this._failCounter = 0;
this._updateDefaultService();
this.emit('reset');
},
@@ -423,24 +499,24 @@ const ShellUserVerifier = new Lang.Class({
this._failCounter < this._settings.get_int(ALLOWED_FAILURES_KEY);
if (canRetry) {
if (!this._userVerifier.hasPendingMessages) {
if (!this.hasPendingMessages) {
this._retry();
} else {
let signalId = this._userVerifier.connect('no-more-messages',
Lang.bind(this, function() {
this._userVerifier.disconnect(signalId);
this._retry();
}));
let signalId = this.connect('no-more-messages',
Lang.bind(this, function() {
this.disconnect(signalId);
this._retry();
}));
}
} else {
if (!this._userVerifier.hasPendingMessages) {
if (!this.hasPendingMessages) {
this._cancelAndReset();
} else {
let signalId = this._userVerifier.connect('no-more-messages',
Lang.bind(this, function() {
this._userVerifier.disconnect(signalId);
this._cancelAndReset();
}));
let signalId = this.connect('no-more-messages',
Lang.bind(this, function() {
this.disconnect(signalId);
this._cancelAndReset();
}));
}
}
@@ -451,7 +527,7 @@ const ShellUserVerifier = new Lang.Class({
// if the password service fails, then cancel everything.
// But if, e.g., fingerprint fails, still give
// password authentication a chance to succeed
if (serviceName == PASSWORD_SERVICE_NAME) {
if (this.serviceIsForeground(serviceName)) {
this._verificationFailed(true);
}

275
js/misc/objectManager.js Normal file
View File

@@ -0,0 +1,275 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Params = imports.misc.params;
const Signals = imports.signals;
// Specified in the D-Bus specification here:
// http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager
const ObjectManagerIface = <interface name="org.freedesktop.DBus.ObjectManager">
<method name="GetManagedObjects">
<arg name="objects" type="a{oa{sa{sv}}}" direction="out"/>
</method>
<signal name="InterfacesAdded">
<arg name="objectPath" type="o"/>
<arg name="interfaces" type="a{sa{sv}}" />
</signal>
<signal name="InterfacesRemoved">
<arg name="objectPath" type="o"/>
<arg name="interfaces" type="as" />
</signal>
</interface>
const ObjectManagerInfo = Gio.DBusInterfaceInfo.new_for_xml(ObjectManagerIface);
const ObjectManager = new Lang.Class({
Name: 'ObjectManager',
_init: function(params) {
params = Params.parse(params, { connection: null,
name: null,
objectPath: null,
knownInterfaces: null,
cancellable: null,
onLoaded: null });
this._connection = params.connection;
this._serviceName = params.name;
this._managerPath = params.objectPath;
this._cancellable = params.cancellable;
this._managerProxy = new Gio.DBusProxy({ g_connection: this._connection,
g_interface_name: ObjectManagerInfo.name,
g_interface_info: ObjectManagerInfo,
g_name: this._serviceName,
g_object_path: this._managerPath,
g_flags: Gio.DBusProxyFlags.NONE });
this._interfaceInfos = {};
this._objects = {};
this._interfaces = {};
this._pendingProxies = [];
this._onLoaded = params.onLoaded;
if (params.knownInterfaces)
this._registerInterfaces(params.knownInterfaces);
this._managerProxy.init_async(GLib.PRIORITY_DEFAULT,
this._cancellable,
Lang.bind(this, this._onManagerProxyLoaded));
},
_addInterface: function(objectPath, interfaceName, onFinished) {
let info = this._interfaceInfos[interfaceName];
if (!info)
return;
let proxy = new Gio.DBusProxy({ g_connection: this._connection,
g_name: this._serviceName,
g_object_path: objectPath,
g_interface_name: interfaceName,
g_interface_info: info,
g_flags: Gio.DBusProxyFlags.NONE });
this._pendingProxies.push(proxy);
proxy.init_async(GLib.PRIORITY_DEFAULT,
this._cancellable,
Lang.bind(this, function(initable, result) {
let index = this._pendingProxies.indexOf(proxy);
if (index >= 0)
this._pendingProxies.splice(index, 1);
let error = null;
try {
initable.init_finish(result);
} catch(e) {
logError(e, 'could not initialize proxy for interface ' + interfaceName);
if (onFinished)
onFinished();
return;
}
let isNewObject;
if (!this._objects[objectPath]) {
this._objects[objectPath] = {};
isNewObject = true;
} else {
isNewObject = false;
}
this._objects[objectPath][interfaceName] = proxy;
if (!this._interfaces[interfaceName])
this._interfaces[interfaceName] = [];
this._interfaces[interfaceName].push(proxy);
if (isNewObject)
this.emit('object-added', objectPath);
this.emit('interface-added', interfaceName, proxy);
if (onFinished)
onFinished();
}));
},
_removeInterface: function(objectPath, interfaceName) {
if (!this._objects[objectPath])
return;
let proxy = this._objects[objectPath][interfaceName];
if (this._interfaces[interfaceName]) {
let index = this._interfaces[interfaceName].indexOf(proxy);
if (index >= 0)
this._interfaces[interfaceName].splice(index, 1);
if (this._interfaces[interfaceName].length == 0)
delete this._interfaces[interfaceName];
}
this.emit('interface-removed', interfaceName, proxy);
this._objects[objectPath][interfaceName] = null;
if (Object.keys(this._objects[objectPath]).length == 0) {
delete this._objects[objectPath];
this.emit('object-removed', objectPath);
}
},
_onManagerProxyLoaded: function(initable, result) {
let error = null;
try {
initable.init_finish(result);
} catch(e) {
logError(e, 'could not initialize object manager for object ' + params.name);
if (this._onLoaded)
this._onLoaded();
return;
}
this._managerProxy.connectSignal('InterfacesAdded',
Lang.bind(this, function(objectManager, sender, [objectPath, interfaces]) {
let interfaceNames = Object.keys(interfaces);
for (let i = 0; i < interfaceNames.length; i++)
this._addInterface(objectPath, interfaceNames[i]);
}));
this._managerProxy.connectSignal('InterfacesRemoved',
Lang.bind(this, function(objectManager, sender, [objectPath, interfaceNames]) {
for (let i = 0; i < interfaceNames.length; i++)
this._removeInterface(objectPath, interfaceNames[i]);
}));
this._managerProxy.GetManagedObjectsRemote(Lang.bind(this, function(result, error) {
if (!result) {
if (error) {
logError(error, 'could not get remote objects for service ' + this._serviceName + ' path ' + this._managerPath);
}
if (this._onLoaded)
this._onLoaded();
return;
}
let [objects] = result;
if (Object.keys(this._interfaceInfos).length == 0) {
if (this._onLoaded)
this._onLoaded();
return;
}
let numLoadInhibitors = 0;
// First inhibitor is to prevent onLoaded from getting
// called until all interfaces have started being added.
// Subsequent inhibitors are to prevent onLoaded from getting
// called until all interfaces finish getting added.
numLoadInhibitors++;
let objectPaths = Object.keys(objects);
for (let i = 0; i < objectPaths.length; i++) {
let objectPath = objectPaths[i];
let object = objects[objectPath];
let interfaceNames = Object.keys(object);
for (let j = 0; j < interfaceNames.length; j++) {
let interfaceName = interfaceNames[j];
numLoadInhibitors++;
this._addInterface(objectPath,
interfaceName,
Lang.bind(this, function() {
numLoadInhibitors--;
if (numLoadInhibitors == 0) {
if (this._onLoaded)
this._onLoaded();
}
}));
}
}
numLoadInhibitors--;
if (numLoadInhibitors == 0) {
if (this._onLoaded)
this._onLoaded();
}
}));
},
_registerInterfaces: function(interfaces) {
for (let i = 0; i < interfaces.length; i++) {
let info = Gio.DBusInterfaceInfo.new_for_xml(interfaces[i]);
this._interfaceInfos[info.name] = info;
}
},
getProxy: function(objectPath, interfaceName) {
let object = this._objects[objectPath];
if (!object)
return null;
return object[interfaceName];
},
getProxiesForInterface: function(interfaceName) {
let proxyList = this._interfaces[interfaceName];
if (!proxyList)
return [];
return proxyList;
},
getAllProxies: function() {
let proxies = [];
let objectPaths = Object.keys(this._objects);
for (let i = 0; i < objectPaths.length; i++) {
let object = this._objects[objectPaths];
let interfaceNames = Object.keys(object);
for (let j = 0; i < interfaceNames.length; i++) {
let interfaceName = interfaceNames[i];
if (object[interfaceName])
proxies.push(object(interfaceName));
}
}
return proxies;
}
});
Signals.addSignalMethods(ObjectManager.prototype);

142
js/misc/smartcardManager.js Normal file
View File

@@ -0,0 +1,142 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const Signals = imports.signals;
const ObjectManager = imports.misc.objectManager;
const _SMARTCARD_SERVICE_DBUS_NAME = "org.gnome.SettingsDaemon.Smartcard";
const SmartcardManagerIface = <interface name="org.gnome.SettingsDaemon.Smartcard.Manager">
<method name="GetLoginToken">
<arg name="token" type="o" direction="out"/>
</method>
<method name="GetInsertedTokens">
<arg name="tokens" type="ao" direction="out"/>
</method>
</interface>;
const SmartcardTokenIface = <interface name="org.gnome.SettingsDaemon.Smartcard.Token">
<property name="Name" type="s" access="read"/>
<property name="Driver" type="o" access="read"/>
<property name="IsInserted" type="b" access="read"/>
<property name="UsedToLogin" type="b" access="read"/>
</interface>;
const SmartcardDriverIface = <interface name="org.gnome.SettingsDaemon.Smartcard.Driver">
<property name="Library" type="s" access="read"/>
<property name="Description" type="s" access="read"/>
</interface>;
let _smartcardManager = null;
function getSmartcardManager() {
if (_smartcardManager == null)
_smartcardManager = new SmartcardManager();
return _smartcardManager;
}
const SmartcardManager = new Lang.Class({
Name: 'SmartcardManager',
_init: function() {
this._objectManager = new ObjectManager.ObjectManager({ connection: Gio.DBus.session,
name: _SMARTCARD_SERVICE_DBUS_NAME,
objectPath: '/org/gnome/SettingsDaemon/Smartcard',
knownInterfaces: [ SmartcardManagerIface,
SmartcardTokenIface,
SmartcardDriverIface ],
onLoaded: Lang.bind(this, this._onLoaded) });
this._insertedTokens = {};
this._removedTokens = {};
this._loginToken = null;
},
_onLoaded: function() {
let tokens = this._objectManager.getProxiesForInterface('org.gnome.SettingsDaemon.Smartcard.Token');
for (let i = 0; i < tokens.length; i++)
this._addToken(tokens[i]);
this._objectManager.connect('interface-added', Lang.bind(this, function(objectManager, interfaceName, proxy) {
if (interfaceName == 'org.gnome.SettingsDaemon.Smartcard.Token')
this._addToken(proxy);
}));
this._objectManager.connect('interface-removed', Lang.bind(this, function(objectManager, interfaceName, proxy) {
if (interfaceName == 'org.gnome.SettingsDaemon.Smartcard.Token')
this._removeToken(proxy);
}));
},
_updateToken: function(token) {
let objectPath = token.get_object_path();
delete this._insertedTokens[objectPath];
delete this._removedTokens[objectPath];
if (token.IsInserted)
this._insertedTokens[objectPath] = token;
else
this._removedTokens[objectPath] = token;
if (token.UsedToLogin)
this._loginToken = token;
},
_addToken: function(token) {
this._updateToken(token);
token.connect('g-properties-changed',
Lang.bind(this, function(proxy, properties) {
if ('IsInserted' in properties.deep_unpack()) {
this._updateToken(token);
if (token.IsInserted) {
this.emit('smartcard-inserted', token.Name);
} else {
this.emit('smartcard-removed', token.Name);
}
}
}));
// Emit a smartcard-inserted at startup if it's already plugged in
if (token.IsInserted)
this.emit('smartcard-inserted', token.Name);
},
_removeToken: function(token) {
let objectPath = token.get_object_path();
if (objectPath) {
if (this._removedTokens[objectPath] == token) {
delete this._removedTokens[objectPath];
}
if (this._insertedTokens[objectPath] == token) {
delete this._insertedTokens[objectPath];
this.emit('smartcard-removed', token.Name);
}
}
token.disconnectAll();
},
hasInsertedTokens: function() {
return Object.keys(this._insertedTokens).length > 0;
},
hasInsertedLoginToken: function() {
if (!this._loginToken)
return false;
if (!this._loginToken.IsInserted)
return false;
return true;
}
});
Signals.addSignalMethods(SmartcardManager.prototype);

View File

@@ -436,8 +436,11 @@ const AppSwitcher = new Lang.Class({
this._arrows = [];
let windowTracker = Shell.WindowTracker.get_default();
let settings = new Gio.Settings({ schema: 'org.gnome.shell.app-switcher' });
let workspace = settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace()
: null;
let allWindows = global.display.get_tab_list(Meta.TabList.NORMAL,
global.screen, null);
global.screen, workspace);
// Construct the AppIcons, add to the popup
for (let i = 0; i < apps.length; i++) {
@@ -447,7 +450,9 @@ const AppSwitcher = new Lang.Class({
appIcon.cachedWindows = allWindows.filter(function(w) {
return windowTracker.get_window_app (w) == appIcon.app;
});
this._addIcon(appIcon);
if (workspace == null || appIcon.cachedWindows.length > 0) {
this._addIcon(appIcon);
}
}
this._curApp = -1;

View File

@@ -358,17 +358,6 @@ const ControlsBoxLayout = Lang.Class({
let totalSpacing = this.spacing * (childrenCount - 1);
return [maxMinWidth * childrenCount + totalSpacing,
maxNaturalWidth * childrenCount + totalSpacing];
},
vfunc_set_container: function(container) {
if(this._styleChangedId) {
this._container.disconnect(this._styleChangedId);
this._styleChangedId = 0;
}
if(container != null)
this._styleChangedId = container.connect('style-changed', Lang.bind(this,
function() { this.spacing = this._container.get_theme_node().get_length('spacing'); }));
this._container = container;
}
});
@@ -416,8 +405,9 @@ const AppDisplay = new Lang.Class({
this.actor.add(this._viewStack, { expand: true });
let layout = new ControlsBoxLayout({ homogeneous: true });
this._controls = new St.Widget({ style_class: 'app-view-controls' });
this._controls.set_layout_manager(layout);
this._controls = new St.Widget({ style_class: 'app-view-controls',
layout_manager: layout });
layout.hookup_style(this._controls);
this.actor.add(new St.Bin({ child: this._controls }));

View File

@@ -10,6 +10,7 @@ const Clutter = imports.gi.Clutter;;
const Gettext = imports.gettext;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
@@ -39,6 +40,22 @@ function _patchContainerClass(containerClass) {
};
}
function _patchLayoutClass(layoutClass, styleProps) {
if (styleProps)
layoutClass.prototype.hookup_style = function(container) {
container.connect('style-changed', Lang.bind(this, function() {
let node = container.get_theme_node();
for (let prop in styleProps)
this[prop] = node.get_length(styleProps[prop]);
}));
};
layoutClass.prototype.child_set = function(actor, props) {
let meta = this.get_child_meta(actor.get_parent(), actor);
for (let prop in props)
meta[prop] = props[prop];
};
}
function _makeLoggingFunc(func) {
return function() {
return func([].join.call(arguments, ', '));
@@ -60,6 +77,12 @@ function init() {
_patchContainerClass(St.BoxLayout);
_patchContainerClass(St.Table);
_patchLayoutClass(Clutter.TableLayout, { row_spacing: 'spacing-rows',
column_spacing: 'spacing-columns' });
_patchLayoutClass(Clutter.GridLayout, { row_spacing: 'spacing-rows',
column_spacing: 'spacing-columns' });
_patchLayoutClass(Clutter.BoxLayout, { spacing: 'spacing' });
Clutter.Actor.prototype.toString = function() {
return St.describe_actor(this);
};

View File

@@ -1424,6 +1424,10 @@ const SummaryItem = new Lang.Class({
this.notificationStackWidget.add_actor(this.notificationStackView);
this.closeButton = Util.makeCloseButton();
this.closeButton.connect('clicked', Lang.bind(this, function() {
source.destroy();
source.emit('done-displaying-content');
}));
this.notificationStackWidget.add_actor(this.closeButton);
this._stackedNotifications = [];
@@ -1915,9 +1919,8 @@ const MessageTray = new Lang.Class({
_closeNotification: function() {
if (this._notificationState == State.SHOWN) {
this._closeButton.hide();
this._notificationClosed = true;
this._updateState();
this._notificationClosed = false;
this._notification.emit('done-displaying');
this._notification.destroy();
}
},
@@ -2698,11 +2701,9 @@ const MessageTray = new Lang.Class({
let closeButton = summaryItem.closeButton;
closeButton.show();
this._summaryBoxPointerCloseClickedId = closeButton.connect('clicked', Lang.bind(this, this._hideSummaryBoxPointer));
summaryItem.prepareNotificationStackForShowing();
} else if (this._clickedSummaryItemMouseButton == 3) {
child = summaryItem.rightClickMenu;
this._summaryBoxPointerCloseClickedId = 0;
}
// If the user clicked the middle mouse button, or the item
@@ -2796,10 +2797,7 @@ const MessageTray = new Lang.Class({
this._summaryBoxPointerItem.disconnect(this._summaryBoxPointerContentUpdatedId);
this._summaryBoxPointerContentUpdatedId = 0;
}
if (this._summaryBoxPointerCloseClickedId != 0) {
this._summaryBoxPointerItem.closeButton.disconnect(this._summaryBoxPointerCloseClickedId);
this._summaryBoxPointerCloseClickedId = 0;
}
if (this._sourceDoneDisplayingId) {
this._summaryBoxPointerItem.source.disconnect(this._sourceDoneDisplayingId);
this._sourceDoneDisplayingId = 0;

View File

@@ -717,8 +717,8 @@ const Source = new Lang.Class({
this.notifications.length > 0)
return false;
let id = global.connect('notify::stage-input-mode', Lang.bind(this, function () {
global.disconnect(id);
let id = global.stage.connect('deactivate', Lang.bind(this, function () {
global.stage.disconnect(id);
this.trayIcon.click(event);
}));

View File

@@ -297,13 +297,16 @@ const AppMenuButton = new Lang.Class({
this._updateIconBoxClip();
},
_syncIcon: function() {
let icon = this._targetApp.get_faded_icon(2 * PANEL_ICON_SIZE, this._iconBox.text_direction);
this._iconBox.set_child(icon);
},
_onIconThemeChanged: function() {
if (this._iconBox.child == null)
return;
this._iconBox.child.destroy();
let icon = this._targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
this._iconBox.set_child(icon);
this._syncIcon();
},
_updateIconBoxClip: function() {
@@ -526,12 +529,10 @@ const AppMenuButton = new Lang.Class({
}
this._targetApp = targetApp;
let icon = targetApp.get_faded_icon(2 * PANEL_ICON_SIZE);
this._label.setText(targetApp.get_name());
this.setName(targetApp.get_name());
this._iconBox.set_child(icon);
this._syncIcon();
this._iconBox.show();
if (targetApp.get_state() == Shell.AppState.STARTING ||
@@ -857,7 +858,7 @@ const PANEL_ITEM_IMPLEMENTATIONS = {
'lockScreen': imports.ui.status.lockScreenMenu.Indicator,
'keyboard': imports.ui.status.keyboard.InputSourceIndicator,
'powerMenu': imports.gdm.powerMenu.PowerMenuButton,
'userMenu': imports.ui.userMenu.UserMenuButton
'system': imports.ui.status.system.Indicator,
};
if (Config.HAVE_BLUETOOTH)

View File

@@ -56,6 +56,7 @@ const PopupBaseMenuItem = new Lang.Class({
this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
this.actor._delegate = this;
this._parent = null;
this._children = [];
this._ornament = Ornament.NONE;
this._ornamentLabel = new St.Label({ style_class: 'popup-menu-ornament' });
@@ -65,7 +66,6 @@ const PopupBaseMenuItem = new Lang.Class({
this.active = false;
this._activatable = params.reactive && params.activate;
this._sensitive = true;
this.parentSensitive = true;
if (!this._activatable)
this.actor.add_style_class_name('popup-inactive-menu-item');
@@ -84,6 +84,17 @@ const PopupBaseMenuItem = new Lang.Class({
this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
},
_getTopMenu: function() {
if (this._parent)
return this._parent._getTopMenu();
else
return this;
},
_setParent: function(parent) {
this._parent = parent;
},
_onStyleChanged: function (actor) {
this._spacing = Math.round(actor.get_theme_node().get_length('spacing'));
},
@@ -119,18 +130,16 @@ const PopupBaseMenuItem = new Lang.Class({
this.emit('activate', event);
},
setActive: function (active, params) {
setActive: function (active) {
let activeChanged = active != this.active;
params = Params.parse (params, { grabKeyboard: true });
if (activeChanged) {
this.active = active;
if (active) {
this.actor.add_style_pseudo_class('active');
if (params.grabKeyboard)
this.actor.grab_key_focus();
} else
this.actor.grab_key_focus();
} else {
this.actor.remove_style_pseudo_class('active');
}
this.emit('active-changed', active);
}
},
@@ -144,7 +153,8 @@ const PopupBaseMenuItem = new Lang.Class({
},
getSensitive: function() {
return this._activatable && this._sensitive && this.parentSensitive;
let parentSensitive = this._parent ? this._parent.getSensitive() : true;
return this._activatable && this._sensitive && parentSensitive;
},
setSensitive: function(sensitive) {
@@ -160,14 +170,11 @@ const PopupBaseMenuItem = new Lang.Class({
this.emit('destroy');
},
// adds an actor to the menu item; @params can contain %span
// (column span; defaults to 1, -1 means "all the remaining width"),
// adds an actor to the menu item; @params can contain
// %expand (defaults to #false), and %align (defaults to
// #St.Align.START)
addActor: function(child, params) {
params = Params.parse(params, { span: 1,
expand: false,
align: St.Align.START });
params = Params.parse(params, { expand: false, align: St.Align.START });
params.actor = child;
this._children.push(params);
this.actor.connect('destroy', Lang.bind(this, function () { this._removeChild(child); }));
@@ -214,10 +221,6 @@ const PopupBaseMenuItem = new Lang.Class({
let child = this._children[i];
let [min, natural] = child.actor.get_preferred_width(-1);
widths[col++] = natural;
if (child.span > 1) {
for (let j = 1; j < child.span; j++)
widths[col++] = 0;
}
}
return widths;
},
@@ -251,14 +254,14 @@ const PopupBaseMenuItem = new Lang.Class({
for (let i = 0; i < this._children.length; i++) {
let child = this._children[i];
if (this._columnWidths) {
if (child.span == -1) {
if (child.expand) {
childWidth = 0;
for (let j = i; j < this._columnWidths.length; j++)
childWidth += this._columnWidths[j]
childWidth += this._columnWidths[j];
} else
childWidth = this._columnWidths[i];
} else {
if (child.span == -1)
if (child.expand)
childWidth = forWidth - x;
else
[minWidth, childWidth] = child.actor.get_preferred_width(-1);
@@ -304,20 +307,17 @@ const PopupBaseMenuItem = new Lang.Class({
let [minWidth, naturalWidth] = child.actor.get_preferred_width(-1);
let availWidth;
if (child.span == -1) {
if (child.expand) {
availWidth = box.x2 - x;
} else {
if (this._columnWidths) {
availWidth = 0;
for (let j = 0; j < child.span; j++)
availWidth += this._columnWidths[col++];
} else {
if (this._columnWidths)
availWidth = this._columnWidths[col++];
else
availWidth = naturalWidth;
}
}
if (direction == Clutter.TextDirection.RTL)
childBox.x1 = width - x - availWidth;
childBox.x1 = box.x1 + (box.x2 - x - availWidth);
else
childBox.x1 = x;
childBox.x2 = childBox.x1 + availWidth;
@@ -363,7 +363,7 @@ const PopupSeparatorMenuItem = new Lang.Class({
can_focus: false});
this._box = new St.BoxLayout();
this.addActor(this._box, { span: -1, expand: true });
this.addActor(this._box, { expand: true });
this.label = new St.Label({ text: text || '' });
this._box.add(this.label);
@@ -473,33 +473,6 @@ const PopupAlternatingMenuItem = new Lang.Class({
}
});
const PopupSliderMenuItem = new Lang.Class({
Name: 'PopupSliderMenuItem',
Extends: PopupBaseMenuItem,
_init: function(value) {
this.parent({ activate: false });
this._slider = new Slider.Slider(value);
this._slider.connect('value-changed', Lang.bind(this, function(actor, value) {
this.emit('value-changed', value);
}));
this.addActor(this._slider.actor);
},
setValue: function(value) {
this._slider.setValue(value);
},
get value() {
return this._slider.value;
},
scroll: function (event) {
this._slider.scroll(event);
}
});
const Switch = new Lang.Class({
Name: 'Switch',
@@ -546,8 +519,7 @@ const PopupSwitchMenuItem = new Lang.Class({
this.addActor(this.label);
this._statusBin = new St.Bin({ x_align: St.Align.END });
this.addActor(this._statusBin,
{ expand: true, span: -1, align: St.Align.END });
this.addActor(this._statusBin, { expand: true, align: St.Align.END });
this._statusLabel = new St.Label({ text: '',
style_class: 'popup-status-menu-item'
@@ -659,7 +631,6 @@ const PopupMenuBase = new Lang.Class({
this._settingsActions = { };
this._sensitive = true;
this.parentSensitive = true;
this._sessionUpdatedId = Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
},
@@ -671,8 +642,13 @@ const PopupMenuBase = new Lang.Class({
return this;
},
_setParent: function(parent) {
this._parent = parent;
},
getSensitive: function() {
return this._sensitive && this.parentSensitive;
let parentSensitive = this._parent ? this._parent.getSensitive() : true;
return this._sensitive && parentSensitive;
},
setSensitive: function(sensitive) {
@@ -722,16 +698,14 @@ const PopupMenuBase = new Lang.Class({
isEmpty: function() {
let hasVisibleChildren = this.box.get_children().some(function(child) {
if (child._delegate instanceof PopupSeparatorMenuItem)
return false;
return child.visible;
});
return !hasVisibleChildren;
},
isChildMenu: function() {
return false;
},
itemActivated: function(animate) {
if (animate == undefined)
animate = BoxPointer.PopupAnimation.FULL;
@@ -776,7 +750,6 @@ const PopupMenuBase = new Lang.Class({
}));
menuItem._parentSensitiveChangeId = this.connect('sensitive-changed', Lang.bind(this, function() {
menuItem.parentSensitive = this.getSensitive();
menuItem.syncSensitive();
}));
@@ -861,7 +834,6 @@ const PopupMenuBase = new Lang.Class({
menuItem.emit('menu-closed');
});
let subMenuSensitiveChangedId = this.connect('sensitive-changed', Lang.bind(this, function() {
menuItem.parentSensitive = this.getSensitive();
menuItem.emit('sensitive-changed');
}));
@@ -906,7 +878,7 @@ const PopupMenuBase = new Lang.Class({
else
throw TypeError("Invalid argument to PopupMenuBase.addMenuItem()");
menuItem._parent = this;
menuItem._setParent(this);
this.length++;
},
@@ -1034,7 +1006,6 @@ const PopupMenu = new Lang.Class({
global.focus_manager.add_group(this.actor);
this.actor.reactive = true;
this._childMenus = [];
this._openedSubMenu = null;
},
@@ -1069,28 +1040,6 @@ const PopupMenu = new Lang.Class({
this._boxPointer.setSourceAlignment(alignment);
},
isChildMenu: function(menu) {
return this._childMenus.indexOf(menu) != -1;
},
addChildMenu: function(menu) {
if (this.isChildMenu(menu))
return;
this._childMenus.push(menu);
this.emit('child-menu-added', menu);
},
removeChildMenu: function(menu) {
let index = this._childMenus.indexOf(menu);
if (index == -1)
return;
this._childMenus.splice(index, 1);
this.emit('child-menu-removed', menu);
},
open: function(animate) {
if (this.isOpen)
return;
@@ -1112,10 +1061,6 @@ const PopupMenu = new Lang.Class({
if (this._activeMenuItem)
this._activeMenuItem.setActive(false);
this._childMenus.forEach(function(childMenu) {
childMenu.close();
});
if (this._boxPointer.actor.visible) {
this._boxPointer.hide(animate, Lang.bind(this, function() {
this.emit('menu-closed');
@@ -1139,10 +1084,6 @@ const PopupDummyMenu = new Lang.Class({
this.actor._delegate = this;
},
isChildMenu: function() {
return false;
},
getSensitive: function() {
return true;
},
@@ -1325,14 +1266,23 @@ const PopupSubMenuMenuItem = new Lang.Class({
Name: 'PopupSubMenuMenuItem',
Extends: PopupBaseMenuItem,
_init: function(text) {
_init: function(text, wantIcon) {
this.parent();
this.actor.add_style_class_name('popup-submenu-menu-item');
if (wantIcon) {
this.icon = new St.Icon({ style_class: 'popup-menu-icon' });
this.addActor(this.icon, { align: St.Align.MIDDLE });
}
this.label = new St.Label({ text: text });
this.addActor(this.label);
this.actor.label_actor = this.label;
this.status = new St.Label({ style_class: 'popup-status-menu-item' });
this.addActor(this.status, { align: St.Align.END });
this._triangle = new St.Label({ text: '\u25B8' });
this.addActor(this._triangle, { align: St.Align.END });
@@ -1340,6 +1290,11 @@ const PopupSubMenuMenuItem = new Lang.Class({
this.menu.connect('open-state-changed', Lang.bind(this, this._subMenuOpenStateChanged));
},
_setParent: function(parent) {
this.parent(parent);
this.menu._setParent(parent);
},
syncSensitive: function() {
let sensitive = this.parent();
this._triangle.visible = sensitive;
@@ -1348,12 +1303,13 @@ const PopupSubMenuMenuItem = new Lang.Class({
},
_subMenuOpenStateChanged: function(menu, open) {
if (open)
if (open) {
this.actor.add_style_pseudo_class('open');
else
this._getTopMenu()._setOpenedSubMenu(this.menu);
} else {
this.actor.remove_style_pseudo_class('open');
this._getTopMenu()._setOpenedSubMenu(this.menu);
this._getTopMenu()._setOpenedSubMenu(null);
}
},
destroy: function() {
@@ -1401,248 +1357,6 @@ const PopupSubMenuMenuItem = new Lang.Class({
}
});
const PopupComboMenu = new Lang.Class({
Name: 'PopupComboMenu',
Extends: PopupMenuBase,
_init: function(sourceActor) {
this.parent(sourceActor, 'popup-combo-menu');
this.actor = this.box;
this.actor._delegate = this;
this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
sourceActor.connect('style-changed',
Lang.bind(this, this._onSourceActorStyleChanged));
this._activeItemPos = -1;
global.focus_manager.add_group(this.actor);
},
_onKeyFocusIn: function(actor) {
let items = this._getMenuItems();
let activeItem = items[this._activeItemPos];
activeItem.actor.grab_key_focus();
},
_onSourceActorStyleChanged: function() {
// PopupComboBoxMenuItem clones the active item's actors
// to work with arbitrary items in the menu; this means
// that we need to propagate some style information and
// enforce style updates even when the menu is closed
let activeItem = this._getMenuItems()[this._activeItemPos];
if (this.sourceActor.has_style_pseudo_class('insensitive'))
activeItem.actor.add_style_pseudo_class('insensitive');
else
activeItem.actor.remove_style_pseudo_class('insensitive');
// To propagate the :active style, we need to make sure that the
// internal state of the PopupComboMenu is updated as well, but
// we must not move the keyboard grab
activeItem.setActive(this.sourceActor.has_style_pseudo_class('active'),
{ grabKeyboard: false });
_ensureStyle(this.actor);
},
open: function() {
if (this.isOpen)
return;
if (this.isEmpty())
return;
this.isOpen = true;
let [sourceX, sourceY] = this.sourceActor.get_transformed_position();
let items = this._getMenuItems();
let activeItem = items[this._activeItemPos];
this.actor.set_position(sourceX, sourceY - activeItem.actor.y);
this.actor.width = Math.max(this.actor.width, this.sourceActor.width);
this.actor.raise_top();
this.actor.opacity = 0;
this.actor.show();
Tweener.addTween(this.actor,
{ opacity: 255,
transition: 'linear',
time: BoxPointer.POPUP_ANIMATION_TIME });
this.emit('open-state-changed', true);
},
close: function() {
if (!this.isOpen)
return;
this.isOpen = false;
Tweener.addTween(this.actor,
{ opacity: 0,
transition: 'linear',
time: BoxPointer.POPUP_ANIMATION_TIME,
onComplete: Lang.bind(this,
function() {
this.actor.hide();
})
});
this.emit('open-state-changed', false);
},
setActiveItem: function(position) {
this._activeItemPos = position;
},
getActiveItem: function() {
return this._getMenuItems()[this._activeItemPos];
},
setItemVisible: function(position, visible) {
if (!visible && position == this._activeItemPos) {
log('Trying to hide the active menu item.');
return;
}
this._getMenuItems()[position].actor.visible = visible;
},
getItemVisible: function(position) {
return this._getMenuItems()[position].actor.visible;
}
});
const PopupComboBoxMenuItem = new Lang.Class({
Name: 'PopupComboBoxMenuItem',
Extends: PopupBaseMenuItem,
_init: function (params) {
this.parent(params);
this.actor.accessible_role = Atk.Role.COMBO_BOX;
this._itemBox = new Shell.Stack();
this.addActor(this._itemBox);
let expander = new St.Label({ text: '\u2304' });
this.addActor(expander, { align: St.Align.END,
span: -1 });
this._menu = new PopupComboMenu(this.actor);
Main.uiGroup.add_actor(this._menu.actor);
this._menu.actor.hide();
if (params.style_class)
this._menu.actor.add_style_class_name(params.style_class);
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
this._activeItemPos = -1;
this._items = [];
},
_getTopMenu: function() {
let actor = this.actor.get_parent();
while (actor) {
if (actor._delegate && actor._delegate instanceof PopupMenu)
return actor._delegate;
actor = actor.get_parent();
}
return null;
},
_onScrollEvent: function(actor, event) {
if (this._activeItemPos == -1)
return;
let position = this._activeItemPos;
let direction = event.get_scroll_direction();
if (direction == Clutter.ScrollDirection.DOWN) {
while (position < this._items.length - 1) {
position++;
if (this._menu.getItemVisible(position))
break;
}
} else if (direction == Clutter.ScrollDirection.UP) {
while (position > 0) {
position--;
if (this._menu.getItemVisible(position))
break;
}
}
if (position == this._activeItemPos)
return;
this.setActiveItem(position);
this.emit('active-item-changed', position);
},
activate: function(event) {
let topMenu = this._getTopMenu();
if (!topMenu)
return;
topMenu.addChildMenu(this._menu);
this._menu.toggle();
},
addMenuItem: function(menuItem, position) {
if (position === undefined)
position = this._menu.numMenuItems;
this._menu.addMenuItem(menuItem, position);
_ensureStyle(this._menu.actor);
let item = new St.BoxLayout({ style_class: 'popup-combobox-item' });
let children = menuItem.actor.get_children();
for (let i = 0; i < children.length; i++) {
let clone = new Clutter.Clone({ source: children[i] });
item.add(clone, { y_fill: false });
}
let oldItem = this._items[position];
if (oldItem)
this._itemBox.remove_actor(oldItem);
this._items[position] = item;
this._itemBox.add_actor(item);
menuItem.connect('activate',
Lang.bind(this, this._itemActivated, position));
},
checkAccessibleLabel: function() {
let activeItem = this._menu.getActiveItem();
this.actor.label_actor = activeItem.label;
},
setActiveItem: function(position) {
let item = this._items[position];
if (!item)
return;
if (this._activeItemPos == position)
return;
this._menu.setActiveItem(position);
this._activeItemPos = position;
for (let i = 0; i < this._items.length; i++)
this._items[i].visible = (i == this._activeItemPos);
this.checkAccessibleLabel();
},
setItemVisible: function(position, visible) {
this._menu.setItemVisible(position, visible);
},
_itemActivated: function(menuItem, event, position) {
this.setActiveItem(position);
this.emit('active-item-changed', position);
}
});
/* Basic implementation of a menu manager.
* Call addMenu to add menus
*/
@@ -1662,8 +1376,6 @@ const PopupMenuManager = new Lang.Class({
let menudata = {
menu: menu,
openStateChangeId: menu.connect('open-state-changed', Lang.bind(this, this._onMenuOpenState)),
childMenuAddedId: menu.connect('child-menu-added', Lang.bind(this, this._onChildMenuAdded)),
childMenuRemovedId: menu.connect('child-menu-removed', Lang.bind(this, this._onChildMenuRemoved)),
destroyId: menu.connect('destroy', Lang.bind(this, this._onMenuDestroy)),
enterId: 0,
focusInId: 0
@@ -1693,8 +1405,6 @@ const PopupMenuManager = new Lang.Class({
let menudata = this._menus[position];
menu.disconnect(menudata.openStateChangeId);
menu.disconnect(menudata.childMenuAddedId);
menu.disconnect(menudata.childMenuRemovedId);
menu.disconnect(menudata.destroyId);
if (menudata.enterId)
@@ -1721,7 +1431,7 @@ const PopupMenuManager = new Lang.Class({
_onMenuOpenState: function(menu, open) {
if (open) {
if (this.activeMenu && !this.activeMenu.isChildMenu(menu))
if (this.activeMenu)
this.activeMenu.close(BoxPointer.PopupAnimation.FADE);
this._grabHelper.grab({ actor: menu.actor, focus: menu.sourceActor,
onUngrab: Lang.bind(this, this._closeMenu, menu) });
@@ -1730,14 +1440,6 @@ const PopupMenuManager = new Lang.Class({
}
},
_onChildMenuAdded: function(menu, childMenu) {
this.addMenu(childMenu);
},
_onChildMenuRemoved: function(menu, childMenu) {
this.removeMenu(childMenu);
},
_changeMenu: function(newMenu) {
newMenu.open(this.activeMenu ? BoxPointer.PopupAnimation.FADE
: BoxPointer.PopupAnimation.FULL);
@@ -1750,13 +1452,6 @@ const PopupMenuManager = new Lang.Class({
if (this._grabHelper.isActorGrabbed(menu.actor))
return false;
let isChildMenu = this._grabHelper.grabStack.some(function(grab) {
let existingMenu = grab.actor._delegate;
return existingMenu.isChildMenu(menu);
});
if (isChildMenu)
return false;
this._changeMenu(menu);
return false;
},

View File

@@ -7,7 +7,6 @@ const Lang = imports.lang;
const St = imports.gi.St;
const Shell = imports.gi.Shell;
const FileUtils = imports.misc.fileUtils;
const Search = imports.ui.search;
const KEY_FILE_GROUP = 'Shell Search Provider';
@@ -60,108 +59,114 @@ var SearchProviderProxy = Gio.DBusProxy.makeProxyWrapper(SearchProviderIface);
var SearchProvider2Proxy = Gio.DBusProxy.makeProxyWrapper(SearchProvider2Iface);
function loadRemoteSearchProviders(addProviderCallback) {
let data = { loadedProviders: [],
objectPaths: {},
addProviderCallback: addProviderCallback };
FileUtils.collectFromDatadirsAsync('search-providers',
{ loadedCallback: remoteProvidersLoaded,
processFile: loadRemoteSearchProvider,
data: data
});
}
let objectPaths = {};
let loadedProviders = [];
function loadRemoteSearchProvider(file, info, data) {
let keyfile = new GLib.KeyFile();
let path = file.get_path();
function loadRemoteSearchProvider(file) {
let keyfile = new GLib.KeyFile();
let path = file.get_path();
try {
keyfile.load_from_file(path, 0);
} catch(e) {
return;
}
if (!keyfile.has_group(KEY_FILE_GROUP))
return;
let remoteProvider;
try {
let group = KEY_FILE_GROUP;
let busName = keyfile.get_string(group, 'BusName');
let objectPath = keyfile.get_string(group, 'ObjectPath');
if (data.objectPaths[objectPath])
return;
let appInfo = null;
try {
let desktopId = keyfile.get_string(group, 'DesktopId');
appInfo = Gio.DesktopAppInfo.new(desktopId);
} catch (e) {
log('Ignoring search provider ' + path + ': missing DesktopId');
keyfile.load_from_file(path, 0);
} catch(e) {
return;
}
let version = '1';
if (!keyfile.has_group(KEY_FILE_GROUP))
return;
let remoteProvider;
try {
version = keyfile.get_string(group, 'Version');
} catch (e) {
// ignore error
let group = KEY_FILE_GROUP;
let busName = keyfile.get_string(group, 'BusName');
let objectPath = keyfile.get_string(group, 'ObjectPath');
if (objectPaths[objectPath])
return;
let appInfo = null;
try {
let desktopId = keyfile.get_string(group, 'DesktopId');
appInfo = Gio.DesktopAppInfo.new(desktopId);
} catch (e) {
log('Ignoring search provider ' + path + ': missing DesktopId');
return;
}
let version = '1';
try {
version = keyfile.get_string(group, 'Version');
} catch (e) {
// ignore error
}
if (version >= 2)
remoteProvider = new RemoteSearchProvider2(appInfo, busName, objectPath);
else
remoteProvider = new RemoteSearchProvider(appInfo, busName, objectPath);
objectPaths[objectPath] = remoteProvider;
loadedProviders.push(remoteProvider);
} catch(e) {
log('Failed to add search provider %s: %s'.format(path, e.toString()));
}
if (version >= 2)
remoteProvider = new RemoteSearchProvider2(appInfo, busName, objectPath);
else
remoteProvider = new RemoteSearchProvider(appInfo, busName, objectPath);
data.objectPaths[objectPath] = remoteProvider;
data.loadedProviders.push(remoteProvider);
} catch(e) {
log('Failed to add search provider %s: %s'.format(path, e.toString()));
}
}
function remoteProvidersLoaded(loadState) {
let dataDirs = GLib.get_system_data_dirs();
dataDirs.forEach(function(dataDir) {
let path = GLib.build_filenamev([dataDir, 'gnome-shell', 'search-providers']);
let dir = Gio.File.new_for_path(path);
let fileEnum;
try {
fileEnum = dir.enumerate_children('standard::name,standard::type',
Gio.FileQueryInfoFlags.NONE, null);
} catch (e) {
fileEnum = null;
}
if (fileEnum != null) {
let info;
while ((info = fileEnum.next_file(null)))
loadRemoteSearchProvider(fileEnum.get_child(info));
}
});
let searchSettings = new Gio.Settings({ schema: Search.SEARCH_PROVIDERS_SCHEMA });
let sortOrder = searchSettings.get_strv('sort-order');
// Special case gnome-control-center to be always active and always first
sortOrder.unshift('gnome-control-center.desktop');
loadState.loadedProviders.sort(
function(providerA, providerB) {
let idxA, idxB;
let appIdA, appIdB;
loadedProviders.sort(function(providerA, providerB) {
let idxA, idxB;
let appIdA, appIdB;
appIdA = providerA.appInfo.get_id();
appIdB = providerB.appInfo.get_id();
appIdA = providerA.appInfo.get_id();
appIdB = providerB.appInfo.get_id();
idxA = sortOrder.indexOf(appIdA);
idxB = sortOrder.indexOf(appIdB);
idxA = sortOrder.indexOf(appIdA);
idxB = sortOrder.indexOf(appIdB);
// if no provider is found in the order, use alphabetical order
if ((idxA == -1) && (idxB == -1)) {
let nameA = providerA.appInfo.get_name();
let nameB = providerB.appInfo.get_name();
// if no provider is found in the order, use alphabetical order
if ((idxA == -1) && (idxB == -1)) {
let nameA = providerA.appInfo.get_name();
let nameB = providerB.appInfo.get_name();
return GLib.utf8_collate(nameA, nameB);
}
return GLib.utf8_collate(nameA, nameB);
}
// if providerA isn't found, it's sorted after providerB
if (idxA == -1)
return 1;
// if providerA isn't found, it's sorted after providerB
if (idxA == -1)
return 1;
// if providerB isn't found, it's sorted after providerA
if (idxB == -1)
return -1;
// if providerB isn't found, it's sorted after providerA
if (idxB == -1)
return -1;
// finally, if both providers are found, return their order in the list
return (idxA - idxB);
});
// finally, if both providers are found, return their order in the list
return (idxA - idxB);
});
loadState.loadedProviders.forEach(
function(provider) {
loadState.addProviderCallback(provider);
});
loadedProviders.forEach(addProviderCallback);
}
const RemoteSearchProvider = new Lang.Class({

View File

@@ -23,6 +23,7 @@ const Main = imports.ui.main;
const Overview = imports.ui.overview;
const MessageTray = imports.ui.messageTray;
const ShellDBus = imports.ui.shellDBus;
const SmartcardManager = imports.misc.smartcardManager;
const Tweener = imports.ui.tweener;
const Util = imports.misc.util;
@@ -516,6 +517,13 @@ const ScreenShield = new Lang.Class({
this._screenSaverDBus = new ShellDBus.ScreenSaverDBus(this);
this._smartcardManager = SmartcardManager.getSmartcardManager();
this._smartcardManager.connect('smartcard-inserted',
Lang.bind(this, function() {
if (this._isLocked)
this._liftShield(true, 0);
}));
this._inhibitor = null;
this._aboutToSuspend = false;
this._loginManager = LoginManager.getLoginManager();
@@ -927,7 +935,6 @@ const ScreenShield = new Lang.Class({
}
this._dialog.connect('failed', Lang.bind(this, this._onUnlockFailed));
this._dialog.connect('unlocked', Lang.bind(this, this._onUnlockSucceded));
}
this._dialog.allowCancel = allowCancel;
@@ -937,10 +944,6 @@ const ScreenShield = new Lang.Class({
this._resetLockScreen(true, false);
},
_onUnlockSucceded: function() {
this.deactivate(true);
},
_resetLockScreen: function(animateLockScreen, animateLockDialog) {
// Don't reset the lock screen unless it is completely hidden
// This prevents the shield going down if the lock-delay timeout
@@ -1126,6 +1129,12 @@ const ScreenShield = new Lang.Class({
},
deactivate: function(animate) {
this._dialog.finish(Lang.bind(this, function() {
this._finishDeactivate(animate);
}));
},
_finishDeactivate: function(animate) {
this._hideLockScreen(animate, 0);
if (this._hasLockScreen)

View File

@@ -31,7 +31,7 @@ const SearchSystem = new Lang.Class({
let remoteIndex = this._remoteProviders.indexOf(provider);
if (remoteIndex != -1)
this._remoteProviders.splice(index, 1);
this._remoteProviders.splice(remoteIndex, 1);
},
getProviders: function() {

View File

@@ -60,7 +60,7 @@ const _modes = {
unlockDialog: undefined,
components: ['polkitAgent', 'telepathyClient'],
panel: {
left: ['userMenu'],
left: [],
center: [],
right: ['lockScreen']
},
@@ -72,7 +72,7 @@ const _modes = {
unlockDialog: undefined,
components: ['polkitAgent', 'telepathyClient'],
panel: {
left: ['userMenu'],
left: [],
center: [],
right: ['a11y', 'keyboard', 'lockScreen']
},
@@ -97,7 +97,7 @@ const _modes = {
left: ['activities', 'appMenu'],
center: ['dateMenu'],
right: ['a11y', 'keyboard', 'volume', 'bluetooth',
'network', 'battery', 'userMenu']
'network', 'battery', 'system']
}
}
};

View File

@@ -41,6 +41,7 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
<signal name="AcceleratorActivated">
<arg name="action" type="u" />
<arg name="deviceid" type="u" />
<arg name="timestamp" type="u" />
</signal>
<property name="Mode" type="s" access="read" />
<property name="OverviewActive" type="b" access="readwrite" />
@@ -79,8 +80,8 @@ const GnomeShell = new Lang.Class({
this._grabbers = new Hash.Map();
global.display.connect('accelerator-activated', Lang.bind(this,
function(display, action, deviceid) {
this._emitAcceleratorActivated(action, deviceid);
function(display, action, deviceid, timestamp) {
this._emitAcceleratorActivated(action, deviceid, timestamp);
}));
},
@@ -166,7 +167,7 @@ const GnomeShell = new Lang.Class({
return invocation.return_value(GLib.Variant.new('(b)', [ungrabSucceeded]));
},
_emitAcceleratorActivated: function(action, deviceid) {
_emitAcceleratorActivated: function(action, deviceid, timestamp) {
let destination = this._grabbedAccelerators.get(action);
if (!destination)
return;
@@ -177,7 +178,7 @@ const GnomeShell = new Lang.Class({
this._dbusImpl.get_object_path(),
info ? info.name : null,
'AcceleratorActivated',
GLib.Variant.new('(uu)', [action, deviceid]));
GLib.Variant.new('(uuu)', [action, deviceid, timestamp]));
},
_grabAcceleratorForSender: function(accelerator, flags, sender) {

View File

@@ -98,21 +98,24 @@ const Slider = new Lang.Class({
},
_startDragging: function(actor, event) {
if (this._dragging) // don't allow two drags at the same time
this.startDragging(event);
},
startDragging: function(event) {
if (this._dragging)
return false;
this._dragging = true;
// FIXME: we should only grab the specific device that originated
// the event, but for some weird reason events are still delivered
// outside the slider if using clutter_grab_pointer_for_device
Clutter.grab_pointer(this.actor);
let device = event.get_device();
device.grab(this.actor);
this._grabbedDevice = device;
this._releaseId = this.actor.connect('button-release-event', Lang.bind(this, this._endDragging));
this._motionId = this.actor.connect('motion-event', Lang.bind(this, this._motionEvent));
let absX, absY;
[absX, absY] = event.get_coords();
this._moveHandle(absX, absY);
return true;
},
@@ -121,7 +124,8 @@ const Slider = new Lang.Class({
this.actor.disconnect(this._releaseId);
this.actor.disconnect(this._motionId);
Clutter.ungrab_pointer();
this._grabbedDevice.ungrab();
this._grabbedDevice = null;
this._dragging = false;
this.emit('drag-end');

View File

@@ -68,9 +68,6 @@ const ATIndicator = new Lang.Class({
let mouseKeys = this._buildItem(_("Mouse Keys"), A11Y_SCHEMA, KEY_MOUSE_KEYS_ENABLED);
this.menu.addMenuItem(mouseKeys);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Universal Access Settings"), 'gnome-universal-access-panel.desktop');
this._syncMenuVisibility();
},

View File

@@ -13,13 +13,6 @@ const NotificationDaemon = imports.ui.notificationDaemon;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const ConnectionState = {
DISCONNECTED: 0,
CONNECTED: 1,
DISCONNECTING: 2,
CONNECTING: 3
}
const Indicator = new Lang.Class({
Name: 'BTIndicator',
Extends: PanelMenu.SystemStatusButton,
@@ -27,61 +20,18 @@ const Indicator = new Lang.Class({
_init: function() {
this.parent('bluetooth-disabled-symbolic', _("Bluetooth"));
// The Bluetooth menu only appears when Bluetooth is in use,
// so just statically build it with a "Turn Off" menu item.
this._item = new PopupMenu.PopupSubMenuMenuItem(_("Bluetooth"), true);
this._item.icon.icon_name = 'bluetooth-active-symbolic';
this._item.menu.addAction(_("Turn Off"), Lang.bind(this, function() {
this._applet.killswitch_state = GnomeBluetooth.KillswitchState.SOFT_BLOCKED;
}));
this._item.menu.addSettingsAction(_("Bluetooth Settings"), 'gnome-bluetooth-panel.desktop');
this._applet = new GnomeBluetoothApplet.Applet();
this._killswitch = new PopupMenu.PopupSwitchMenuItem(_("Bluetooth"), false);
this._applet.connect('notify::killswitch-state', Lang.bind(this, this._updateKillswitch));
this._killswitch.connect('toggled', Lang.bind(this, function() {
let current_state = this._applet.killswitch_state;
if (current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED &&
current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER) {
this._applet.killswitch_state = this._killswitch.state ?
GnomeBluetooth.KillswitchState.UNBLOCKED:
GnomeBluetooth.KillswitchState.SOFT_BLOCKED;
} else
this._killswitch.setToggleState(false);
}));
this._discoverable = new PopupMenu.PopupSwitchMenuItem(_("Visibility"), this._applet.discoverable);
this._applet.connect('notify::discoverable', Lang.bind(this, function() {
this._discoverable.setToggleState(this._applet.discoverable);
}));
this._discoverable.connect('toggled', Lang.bind(this, function() {
this._applet.discoverable = this._discoverable.state;
}));
this._updateKillswitch();
this.menu.addMenuItem(this._killswitch);
this.menu.addMenuItem(this._discoverable);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this._fullMenuItems = [new PopupMenu.PopupSeparatorMenuItem(),
new PopupMenu.PopupMenuItem(_("Send Files to Device…")),
new PopupMenu.PopupMenuItem(_("Set Up a New Device…")),
new PopupMenu.PopupSeparatorMenuItem()];
this._hasDevices = false;
this._fullMenuItems[1].connect('activate', function() {
GLib.spawn_command_line_async('bluetooth-sendto');
});
this._fullMenuItems[2].connect('activate', function() {
GLib.spawn_command_line_async('bluetooth-wizard');
});
for (let i = 0; i < this._fullMenuItems.length; i++) {
let item = this._fullMenuItems[i];
this.menu.addMenuItem(item);
}
this._deviceItemPosition = 3;
this._deviceItems = [];
this._applet.connect('devices-changed', Lang.bind(this, this._updateDevices));
this._updateDevices();
this._applet.connect('notify::show-full-menu', Lang.bind(this, this._updateFullMenu));
this._updateFullMenu();
this.menu.addSettingsAction(_("Bluetooth Settings"), 'gnome-bluetooth-panel.desktop');
this._applet.connect('devices-changed', Lang.bind(this, this._sync));
this._sync();
this._applet.connect('pincode-request', Lang.bind(this, this._pinRequest));
this._applet.connect('confirm-request', Lang.bind(this, this._confirmRequest));
@@ -90,199 +40,18 @@ const Indicator = new Lang.Class({
this._applet.connect('cancel-request', Lang.bind(this, this._cancelRequest));
},
_updateKillswitch: function() {
let current_state = this._applet.killswitch_state;
let on = current_state == GnomeBluetooth.KillswitchState.UNBLOCKED;
let has_adapter = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER;
let can_toggle = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER &&
current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED;
_sync: function() {
let connectedDevices = this._applet.get_devices().filter(function(device) {
return device.connected;
});
let nDevices = connectedDevices.length;
this._killswitch.setToggleState(on);
if (can_toggle)
this._killswitch.setStatus(null);
else
/* TRANSLATORS: this means that bluetooth was disabled by hardware rfkill */
this._killswitch.setStatus(_("hardware disabled"));
let on = nDevices > 0;
this.mainIcon.visible = on;
this.actor.visible = on;
this.actor.visible = has_adapter;
if (on) {
this._discoverable.actor.show();
this.setIcon('bluetooth-active-symbolic');
} else {
this._discoverable.actor.hide();
this.setIcon('bluetooth-disabled-symbolic');
}
},
_updateDevices: function() {
let devices = this._applet.get_devices();
let newlist = [ ];
for (let i = 0; i < this._deviceItems.length; i++) {
let item = this._deviceItems[i];
let destroy = true;
for (let j = 0; j < devices.length; j++) {
if (item._device.device_path == devices[j].device_path) {
this._updateDeviceItem(item, devices[j]);
destroy = false;
break;
}
}
if (destroy)
item.destroy();
else
newlist.push(item);
}
this._deviceItems = newlist;
this._hasDevices = newlist.length > 0;
for (let i = 0; i < devices.length; i++) {
let d = devices[i];
if (d._item)
continue;
let item = this._createDeviceItem(d);
if (item) {
this.menu.addMenuItem(item, this._deviceItemPosition + this._deviceItems.length);
this._deviceItems.push(item);
this._hasDevices = true;
}
}
},
_updateDeviceItem: function(item, device) {
if (!device.can_connect && device.capabilities == GnomeBluetoothApplet.Capabilities.NONE) {
item.destroy();
return;
}
let prevDevice = item._device;
let prevCapabilities = prevDevice.capabilities;
let prevCanConnect = prevDevice.can_connect;
// adopt the new device object
item._device = device;
device._item = item;
// update properties
item.label.text = device.alias;
if (prevCapabilities != device.capabilities ||
prevCanConnect != device.can_connect) {
// need to rebuild the submenu
item.menu.removeAll();
this._buildDeviceSubMenu(item, device);
}
// update connected property
if (device.can_connect)
item._connectedMenuItem.setToggleState(device.connected);
},
_createDeviceItem: function(device) {
if (!device.can_connect && device.capabilities == GnomeBluetoothApplet.Capabilities.NONE)
return null;
let item = new PopupMenu.PopupSubMenuMenuItem(device.alias);
// adopt the device object, and add a back link
item._device = device;
device._item = item;
this._buildDeviceSubMenu(item, device);
return item;
},
_buildDeviceSubMenu: function(item, device) {
if (device.can_connect) {
let menuitem = new PopupMenu.PopupSwitchMenuItem(_("Connection"), device.connected);
item._connected = device.connected;
item._connectedMenuItem = menuitem;
menuitem.connect('toggled', Lang.bind(this, function() {
if (item._connected > ConnectionState.CONNECTED) {
// operation already in progress, revert
// (should not happen anyway)
menuitem.setToggleState(menuitem.state);
}
if (item._connected) {
item._connected = ConnectionState.DISCONNECTING;
menuitem.setStatus(_("disconnecting..."));
this._applet.disconnect_device(item._device.device_path, function(applet, success) {
if (success) { // apply
item._connected = ConnectionState.DISCONNECTED;
menuitem.setToggleState(false);
} else { // revert
item._connected = ConnectionState.CONNECTED;
menuitem.setToggleState(true);
}
menuitem.setStatus(null);
});
} else {
item._connected = ConnectionState.CONNECTING;
menuitem.setStatus(_("connecting..."));
this._applet.connect_device(item._device.device_path, function(applet, success) {
if (success) { // apply
item._connected = ConnectionState.CONNECTED;
menuitem.setToggleState(true);
} else { // revert
item._connected = ConnectionState.DISCONNECTED;
menuitem.setToggleState(false);
}
menuitem.setStatus(null);
});
}
}));
item.menu.addMenuItem(menuitem);
}
if (device.capabilities & GnomeBluetoothApplet.Capabilities.OBEX_PUSH) {
item.menu.addAction(_("Send Files…"), Lang.bind(this, function() {
this._applet.send_to_address(device.bdaddr, device.alias);
}));
}
switch (device.type) {
case GnomeBluetoothApplet.Type.KEYBOARD:
item.menu.addSettingsAction(_("Keyboard Settings"), 'gnome-keyboard-panel.desktop');
break;
case GnomeBluetoothApplet.Type.MOUSE:
item.menu.addSettingsAction(_("Mouse Settings"), 'gnome-mouse-panel.desktop');
break;
case GnomeBluetoothApplet.Type.HEADSET:
case GnomeBluetoothApplet.Type.HEADPHONES:
case GnomeBluetoothApplet.Type.OTHER_AUDIO:
item.menu.addSettingsAction(_("Sound Settings"), 'gnome-sound-panel.desktop');
break;
default:
break;
}
},
_updateFullMenu: function() {
if (this._applet.show_full_menu) {
this._showAll(this._fullMenuItems);
if (this._hasDevices)
this._showAll(this._deviceItems);
} else {
this._hideAll(this._fullMenuItems);
this._hideAll(this._deviceItems);
}
},
_showAll: function(items) {
for (let i = 0; i < items.length; i++)
items[i].actor.show();
},
_hideAll: function(items) {
for (let i = 0; i < items.length; i++)
items[i].actor.hide();
},
_destroyAll: function(items) {
for (let i = 0; i < items.length; i++)
items[i].destroy();
if (on)
this._item.status.text = ngettext("%d Connected Device", "%d Connected Devices").format(nDevices);
},
_ensureSource: function() {

View File

@@ -398,8 +398,6 @@ const InputSourceIndicator = new Lang.Class({
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
this.menu.addSettingsAction(_("Region & Language Settings"), 'gnome-region-panel.desktop');
this._sourcesPerWindow = false;
this._focusWindowNotifyId = 0;
this._overviewShowingId = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -2,39 +2,15 @@
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const St = imports.gi.St;
const UPower = imports.gi.UPowerGlib;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const BUS_NAME = 'org.gnome.SettingsDaemon.Power';
const OBJECT_PATH = '/org/gnome/SettingsDaemon/Power';
const UPDeviceType = {
UNKNOWN: 0,
AC_POWER: 1,
BATTERY: 2,
UPS: 3,
MONITOR: 4,
MOUSE: 5,
KEYBOARD: 6,
PDA: 7,
PHONE: 8,
MEDIA_PLAYER: 9,
TABLET: 10,
COMPUTER: 11
};
const UPDeviceState = {
UNKNOWN: 0,
CHARGING: 1,
DISCHARGING: 2,
EMPTY: 3,
FULLY_CHARGED: 4,
PENDING_CHARGE: 5,
PENDING_DISCHARGE: 6
};
const PowerManagerInterface = <interface name="org.gnome.SettingsDaemon.Power">
<method name="GetDevices">
<arg type="a(susdut)" direction="out" />
@@ -55,96 +31,73 @@ const Indicator = new Lang.Class({
this.parent('battery-missing-symbolic', _("Battery"));
this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
Lang.bind(this, function(proxy, error) {
if (error) {
log(error.message);
return;
}
this._proxy.connect('g-properties-changed',
Lang.bind(this, this._devicesChanged));
this._devicesChanged();
}));
Lang.bind(this, function(proxy, error) {
if (error) {
log(error.message);
return;
}
this._proxy.connect('g-properties-changed',
Lang.bind(this, this._sync));
this._sync();
}));
this._deviceItems = [ ];
this._hasPrimary = false;
this._primaryDeviceId = null;
this._item = new PopupMenu.PopupSubMenuMenuItem(_("Battery"), true);
this._item.menu.addSettingsAction(_("Power Settings"), 'gnome-power-panel.desktop');
this.menu.addMenuItem(this._item);
this._batteryItem = new PopupMenu.PopupMenuItem('', { reactive: false });
this._primaryPercentage = new St.Label({ style_class: 'popup-battery-percentage' });
this._batteryItem.addActor(this._primaryPercentage, { align: St.Align.END });
this.menu.addMenuItem(this._batteryItem);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this._otherDevicePosition = 2;
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Power Settings"), 'gnome-power-panel.desktop');
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
},
_readPrimaryDevice: function() {
_sessionUpdated: function() {
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
this.menu.setSensitive(sensitive);
},
_statusForDevice: function(device) {
let [device_id, device_type, icon, percentage, state, seconds] = device;
if (state == UPower.DeviceState.FULLY_CHARGED)
return _("Fully Charged");
let time = Math.round(seconds / 60);
if (time == 0) {
// 0 is reported when UPower does not have enough data
// to estimate battery life
return _("Estimating…");
}
let minutes = time % 60;
let hours = Math.floor(time / 60);
if (state == UPower.DeviceState.DISCHARGING) {
// Translators: this is <hours>:<minutes> Remaining (<percentage>)
return _("%d\u2236%d Remaining (%d%%)".format(hours, minutes, percentage));
}
if (state == UPower.DeviceState.CHARGING) {
// Translators: this is <hours>:<minutes> Until Full (<percentage>)
return _("%d\u2236%d Until Full (%d%%)".format(hours, minutes, percentage));
}
// state is one of PENDING_CHARGING, PENDING_DISCHARGING
return _("Estimating…");
},
_syncStatusLabel: function() {
this._proxy.GetPrimaryDeviceRemote(Lang.bind(this, function(result, error) {
if (error) {
this._hasPrimary = false;
this._primaryDeviceId = null;
this._batteryItem.actor.hide();
this._item.actor.hide();
return;
}
let [[device_id, device_type, icon, percentage, state, seconds]] = result;
if (device_type == UPDeviceType.BATTERY) {
this._hasPrimary = true;
let time = Math.round(seconds / 60);
if (time == 0) {
// 0 is reported when UPower does not have enough data
// to estimate battery life
this._batteryItem.label.text = _("Estimating…");
} else {
let minutes = time % 60;
let hours = Math.floor(time / 60);
let timestring;
if (time >= 60) {
if (minutes == 0) {
timestring = ngettext("%d hour remaining", "%d hours remaining", hours).format(hours);
} else {
/* TRANSLATORS: this is a time string, as in "%d hours %d minutes remaining" */
let template = _("%d %s %d %s remaining");
timestring = template.format (hours, ngettext("hour", "hours", hours), minutes, ngettext("minute", "minutes", minutes));
}
} else
timestring = ngettext("%d minute remaining", "%d minutes remaining", minutes).format(minutes);
this._batteryItem.label.text = timestring;
}
this._primaryPercentage.text = C_("percent of battery remaining", "%d%%").format(Math.round(percentage));
this._batteryItem.actor.show();
let [device] = result;
let [device_id, device_type] = device;
if (device_type == UPower.DeviceKind.BATTERY) {
this._item.status.text = this._statusForDevice(device);
this._item.actor.show();
} else {
this._hasPrimary = false;
this._batteryItem.actor.hide();
}
this._primaryDeviceId = device_id;
}));
},
_readOtherDevices: function() {
this._proxy.GetDevicesRemote(Lang.bind(this, function(result, error) {
this._deviceItems.forEach(function(i) { i.destroy(); });
this._deviceItems = [];
if (error) {
return;
}
let position = 0;
let [devices] = result;
for (let i = 0; i < devices.length; i++) {
let [device_id, device_type] = devices[i];
if (device_type == UPDeviceType.AC_POWER || device_id == this._primaryDeviceId)
continue;
let item = new DeviceItem (devices[i]);
this._deviceItems.push(item);
this.menu.addMenuItem(item, this._otherDevicePosition + position);
position++;
this._item.actor.hide();
}
}));
},
@@ -156,71 +109,15 @@ const Indicator = new Lang.Class({
if (icon) {
let gicon = Gio.icon_new_for_string(icon);
this.setGIcon(gicon);
this._item.icon.gicon = gicon;
hasIcon = true;
}
this.mainIcon.visible = hasIcon;
this.actor.visible = hasIcon;
},
_devicesChanged: function() {
_sync: function() {
this._syncIcon();
this._readPrimaryDevice();
this._readOtherDevices();
}
});
const DeviceItem = new Lang.Class({
Name: 'DeviceItem',
Extends: PopupMenu.PopupBaseMenuItem,
_init: function(device) {
this.parent({ reactive: false });
let [device_id, device_type, icon, percentage, state, time] = device;
this._box = new St.BoxLayout({ style_class: 'popup-device-menu-item' });
this._label = new St.Label({ text: this._deviceTypeToString(device_type) });
this._icon = new St.Icon({ gicon: Gio.icon_new_for_string(icon),
style_class: 'popup-menu-icon' });
this._box.add_actor(this._icon);
this._box.add_actor(this._label);
this.addActor(this._box);
let percentLabel = new St.Label({ text: C_("percent of battery remaining", "%d%%").format(Math.round(percentage)),
style_class: 'popup-battery-percentage' });
this.addActor(percentLabel, { align: St.Align.END });
//FIXME: ideally we would like to expose this._label and percentLabel
this.actor.label_actor = percentLabel;
},
_deviceTypeToString: function(type) {
switch (type) {
case UPDeviceType.AC_POWER:
return _("AC Adapter");
case UPDeviceType.BATTERY:
return _("Laptop Battery");
case UPDeviceType.UPS:
return _("UPS");
case UPDeviceType.MONITOR:
return _("Monitor");
case UPDeviceType.MOUSE:
return _("Mouse");
case UPDeviceType.KEYBOARD:
return _("Keyboard");
case UPDeviceType.PDA:
return _("PDA");
case UPDeviceType.PHONE:
return _("Cell Phone");
case UPDeviceType.MEDIA_PLAYER:
return _("Media Player");
case UPDeviceType.TABLET:
return _("Tablet");
case UPDeviceType.COMPUTER:
return _("Computer");
default:
return C_("device", "Unknown");
}
this._syncStatusLabel();
}
});

358
js/ui/status/system.js Normal file
View File

@@ -0,0 +1,358 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const AccountsService = imports.gi.AccountsService;
const Gdm = imports.gi.Gdm;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Clutter = imports.gi.Clutter;
const BoxPointer = imports.ui.boxpointer;
const GnomeSession = imports.misc.gnomeSession;
const LoginManager = imports.misc.loginManager;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Util = imports.misc.util;
const UserWidget = imports.ui.userWidget;
const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
const PRIVACY_SCHEMA = 'org.gnome.desktop.privacy'
const DISABLE_USER_SWITCH_KEY = 'disable-user-switching';
const DISABLE_LOCK_SCREEN_KEY = 'disable-lock-screen';
const DISABLE_LOG_OUT_KEY = 'disable-log-out';
const ALWAYS_SHOW_LOG_OUT_KEY = 'always-show-log-out';
const MAX_USERS_IN_SESSION_DIALOG = 5;
const SystemdLoginSessionIface = <interface name='org.freedesktop.login1.Session'>
<property name="Id" type="s" access="read"/>
<property name="Remote" type="b" access="read"/>
<property name="Class" type="s" access="read"/>
<property name="Type" type="s" access="read"/>
<property name="State" type="s" access="read"/>
</interface>;
const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
const Indicator = new Lang.Class({
Name: 'SystemIndicator',
Extends: PanelMenu.SystemStatusButton,
_init: function() {
this.parent('system-shutdown-symbolic', _("System"));
this._screenSaverSettings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA });
this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
this._privacySettings = new Gio.Settings({ schema: PRIVACY_SCHEMA });
this._session = new GnomeSession.SessionManager();
this._haveShutdown = true;
this._loginManager = LoginManager.getLoginManager();
this._userManager = AccountsService.UserManager.get_default();
this._user = this._userManager.get_user(GLib.get_user_name());
this._createSubMenu();
this._userManager.connect('notify::is-loaded',
Lang.bind(this, this._updateMultiUser));
this._userManager.connect('notify::has-multiple-users',
Lang.bind(this, this._updateMultiUser));
this._userManager.connect('user-added',
Lang.bind(this, this._updateMultiUser));
this._userManager.connect('user-removed',
Lang.bind(this, this._updateMultiUser));
this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
Lang.bind(this, this._updateMultiUser));
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
Lang.bind(this, this._updateMultiUser));
this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
Lang.bind(this, this._updateLockScreen));
global.settings.connect('changed::' + ALWAYS_SHOW_LOG_OUT_KEY,
Lang.bind(this, this._updateMultiUser));
this._updateSwitchUser();
this._updateMultiUser();
// Whether shutdown is available or not depends on both lockdown
// settings (disable-log-out) and Polkit policy - the latter doesn't
// notify, so we update the menu item each time the menu opens or
// the lockdown setting changes, which should be close enough.
this.menu.connect('open-state-changed', Lang.bind(this,
function(menu, open) {
if (!open)
return;
this._updateHaveShutdown();
}));
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
Lang.bind(this, this._updateHaveShutdown));
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._sessionUpdated();
},
_sessionUpdated: function() {
this._updateLockScreen();
this._updatePowerOff();
this._settingsAction.visible = Main.sessionMode.allowSettings;
},
_updateMultiUser: function() {
let shouldShowInMode = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
let hasSwitchUser = this._updateSwitchUser();
let hasLogout = this._updateLogout();
this._switchUserSubMenu.actor.visible = shouldShowInMode && (hasSwitchUser || hasLogout);
},
_updateSwitchUser: function() {
let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
let multiUser = this._userManager.can_switch() && this._userManager.has_multiple_users;
let visible = allowSwitch && multiUser;
this._loginScreenItem.actor.visible = visible;
return visible;
},
_updateLogout: function() {
let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY);
let alwaysShow = global.settings.get_boolean(ALWAYS_SHOW_LOG_OUT_KEY);
let systemAccount = this._user.system_account;
let localAccount = this._user.local_account;
let multiUser = this._userManager.has_multiple_users;
let multiSession = Gdm.get_session_ids().length > 1;
let visible = allowLogout && (alwaysShow || multiUser || multiSession || systemAccount || !localAccount);
this._logoutItem.actor.visible = visible;
return visible;
},
_updateSwitchUserSubMenu: function() {
this._switchUserSubMenu.label.text = this._user.get_real_name();
let iconFile = this._user.get_icon_file();
if (iconFile && !GLib.file_test(iconFile, GLib.FileTest.EXISTS))
iconFile = null;
if (iconFile) {
let file = Gio.File.new_for_path(iconFile);
let gicon = new Gio.FileIcon({ file: file });
this._switchUserSubMenu.icon.gicon = gicon;
} else {
this._switchUserSubMenu.icon_name = 'avatar-default-symbolic';
}
},
_updateLockScreen: function() {
let showLock = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
let allowLockScreen = !this._lockdownSettings.get_boolean(DISABLE_LOCK_SCREEN_KEY);
this._lockScreenAction.visible = showLock && allowLockScreen && LoginManager.canLock();
},
_updateHaveShutdown: function() {
this._session.CanShutdownRemote(Lang.bind(this,
function(result, error) {
if (!error) {
this._haveShutdown = result[0];
this._updatePowerOff();
}
}));
},
_updatePowerOff: function() {
this._powerOffAction.visible = this._haveShutdown && !Main.sessionMode.isLocked;
},
_createActionButton: function(iconName, accessibleName) {
let icon = new St.Button({ reactive: true,
can_focus: true,
track_hover: true,
accessible_name: accessibleName,
style_class: 'system-menu-action' });
icon.child = new St.Icon({ icon_name: iconName });
return icon;
},
_createSubMenu: function() {
let item;
this._switchUserSubMenu = new PopupMenu.PopupSubMenuMenuItem('', true);
this._switchUserSubMenu.icon.style_class = 'system-switch-user-submenu-icon';
item = new PopupMenu.PopupMenuItem(_("Switch User"));
item.connect('activate', Lang.bind(this, this._onLoginScreenActivate));
this._switchUserSubMenu.menu.addMenuItem(item);
this._loginScreenItem = item;
item = new PopupMenu.PopupMenuItem(_("Log Out"));
item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
this._switchUserSubMenu.menu.addMenuItem(item);
this._logoutItem = item;
this._user.connect('notify::is-loaded', Lang.bind(this, this._updateSwitchUserSubMenu));
this._user.connect('changed', Lang.bind(this, this._updateSwitchUserSubMenu));
this.menu.addMenuItem(this._switchUserSubMenu);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
let hbox = new St.BoxLayout({ style_class: 'system-menu-actions-box' });
this._settingsAction = this._createActionButton('preferences-system-symbolic', _("Settings"));
this._settingsAction.connect('clicked', Lang.bind(this, this._onSettingsClicked));
hbox.add(this._settingsAction, { expand: true, x_fill: false });
this._lockScreenAction = this._createActionButton('changes-prevent-symbolic', _("Lock"));
this._lockScreenAction.connect('clicked', Lang.bind(this, this._onLockScreenClicked));
hbox.add(this._lockScreenAction, { expand: true, x_fill: false });
this._powerOffAction = this._createActionButton('system-shutdown-symbolic', _("Power Off"));
this._powerOffAction.connect('clicked', Lang.bind(this, this._onPowerOffClicked));
hbox.add(this._powerOffAction, { expand: true, x_fill: false });
item = new PopupMenu.PopupBaseMenuItem({ reactive: false,
can_focus: false });
item.addActor(hbox, { expand: true });
this.menu.addMenuItem(item);
},
_onSettingsClicked: function() {
this.menu.itemActivated();
let app = Shell.AppSystem.get_default().lookup_app('gnome-control-center.desktop');
Main.overview.hide();
app.activate();
},
_onLockScreenClicked: function() {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
Main.overview.hide();
Main.screenShield.lock(true);
},
_onLoginScreenActivate: function() {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
Main.overview.hide();
if (Main.screenShield)
Main.screenShield.lock(false);
Gdm.goto_login_session_sync(null);
},
_onQuitSessionActivate: function() {
Main.overview.hide();
this._session.LogoutRemote(0);
},
_openSessionWarnDialog: function(sessions) {
let dialog = new ModalDialog.ModalDialog();
let subjectLabel = new St.Label({ style_class: 'end-session-dialog-subject',
text: _("Other users are logged in.") });
dialog.contentLayout.add(subjectLabel, { y_fill: true,
y_align: St.Align.START });
let descriptionLabel = new St.Label({ style_class: 'end-session-dialog-description'});
descriptionLabel.set_text(_("Shutting down might cause them to lose unsaved work."));
descriptionLabel.clutter_text.line_wrap = true;
dialog.contentLayout.add(descriptionLabel, { x_fill: true,
y_fill: true,
y_align: St.Align.START });
let scrollView = new St.ScrollView({ style_class: 'end-session-dialog-app-list' });
scrollView.add_style_class_name('vfade');
scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
dialog.contentLayout.add(scrollView, { x_fill: true, y_fill: true });
let userList = new St.BoxLayout({ vertical: true });
scrollView.add_actor(userList);
for (let i = 0; i < sessions.length; i++) {
let session = sessions[i];
let userEntry = new St.BoxLayout({ style_class: 'login-dialog-user-list-item',
vertical: false });
let avatar = new UserWidget.Avatar(session.user);
avatar.update();
userEntry.add(avatar.actor);
let userLabelText = "";;
let userName = session.user.get_real_name() ?
session.user.get_real_name() : session.username;
if (session.info.remote)
/* Translators: Remote here refers to a remote session, like a ssh login */
userLabelText = _("%s (remote)").format(userName);
else if (session.info.type == "tty")
/* Translators: Console here refers to a tty like a VT console */
userLabelText = _("%s (console)").format(userName);
else
userLabelText = userName;
let textLayout = new St.BoxLayout({ style_class: 'login-dialog-user-list-item-text-box',
vertical: true });
textLayout.add(new St.Label({ text: userLabelText }),
{ y_fill: false,
y_align: St.Align.MIDDLE,
expand: true });
userEntry.add(textLayout, { expand: true });
userList.add(userEntry, { x_fill: true });
}
let cancelButton = { label: _("Cancel"),
action: function() { dialog.close(); },
key: Clutter.Escape };
let powerOffButton = { label: _("Power Off"), action: Lang.bind(this, function() {
dialog.close();
this._session.ShutdownRemote();
}), default: true };
dialog.setButtons([cancelButton, powerOffButton]);
dialog.open();
},
_onPowerOffClicked: function() {
this.menu.itemActivated();
Main.overview.hide();
this._loginManager.listSessions(Lang.bind(this, function(result) {
let sessions = [];
let n = 0;
for (let i = 0; i < result.length; i++) {
let[id, uid, userName, seat, sessionPath] = result[i];
let proxy = new SystemdLoginSession(Gio.DBus.system,
'org.freedesktop.login1',
sessionPath);
if (proxy.Class != 'user')
continue;
if (proxy.State == 'closing')
continue;
if (proxy.Id == GLib.getenv('XDG_SESSION_ID'))
continue;
sessions.push({ user: this._userManager.get_user(userName),
username: userName,
info: { type: proxy.Type,
remote: proxy.Remote }
});
// limit the number of entries
n++;
if (n == MAX_USERS_IN_SESSION_DIALOG)
break;
}
if (n != 0)
this._openSessionWarnDialog(sessions);
else
this._session.ShutdownRemote();
}));
}
});

View File

@@ -9,6 +9,7 @@ const Signals = imports.signals;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Slider = imports.ui.slider;
const VOLUME_NOTIFY_ID = 1;
@@ -28,18 +29,23 @@ function getMixerControl() {
const StreamSlider = new Lang.Class({
Name: 'StreamSlider',
_init: function(control, title) {
_init: function(control) {
this._control = control;
this.item = new PopupMenu.PopupMenuSection();
this.item = new PopupMenu.PopupBaseMenuItem({ activate: false });
this._title = new PopupMenu.PopupMenuItem(title, { reactive: false });
this._slider = new PopupMenu.PopupSliderMenuItem(0);
this._slider = new Slider.Slider(0);
this._slider.connect('value-changed', Lang.bind(this, this._sliderChanged));
this._slider.connect('drag-end', Lang.bind(this, this._notifyVolumeChange));
this.item.addMenuItem(this._title);
this.item.addMenuItem(this._slider);
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
this.item.addActor(this._icon, { align: St.Align.MIDDLE });
this.item.addActor(this._slider.actor, { expand: true });
this.item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) {
this._slider.startDragging(event);
}));
this._stream = null;
},
@@ -83,8 +89,7 @@ const StreamSlider = new Lang.Class({
_updateVisibility: function() {
let visible = this._shouldBeVisible();
this._title.actor.visible = visible;
this._slider.actor.visible = visible;
this.item.actor.visible = visible;
},
scroll: function(event) {
@@ -178,11 +183,17 @@ const OutputStreamSlider = new Lang.Class({
this._portChangedId = 0;
},
_updateSliderIcon: function() {
this._icon.icon_name = (this._hasHeadphones ?
'audio-headphones-symbolic' :
'audio-speakers-symbolic');
},
_portChanged: function() {
let hasHeadphones = this._findHeadphones(this._stream);
if (hasHeadphones != this._hasHeadphones) {
this._hasHeadphones = hasHeadphones;
this.emit('headphones-changed', this._hasHeadphones);
this._updateSliderIcon();
}
}
});
@@ -191,10 +202,11 @@ const InputStreamSlider = new Lang.Class({
Name: 'InputStreamSlider',
Extends: StreamSlider,
_init: function(control, title) {
this.parent(control, title);
_init: function(control) {
this.parent(control);
this._control.connect('stream-added', Lang.bind(this, this._maybeShowInput));
this._control.connect('stream-removed', Lang.bind(this, this._maybeShowInput));
this._icon.icon_name = 'audio-input-microphone-symbolic';
},
_connectStream: function(stream) {
@@ -242,17 +254,13 @@ const VolumeMenu = new Lang.Class({
this._control.connect('default-sink-changed', Lang.bind(this, this._readOutput));
this._control.connect('default-source-changed', Lang.bind(this, this._readInput));
/* Translators: This is the label for audio volume */
this._output = new OutputStreamSlider(this._control, _("Volume"));
this._output = new OutputStreamSlider(this._control);
this._output.connect('stream-updated', Lang.bind(this, function() {
this.emit('icon-changed');
}));
this._output.connect('headphones-changed', Lang.bind(this, function(stream, value) {
this.emit('headphones-changed', value);
}));
this.addMenuItem(this._output.item);
this._input = new InputStreamSlider(this._control, _("Microphone"));
this._input = new InputStreamSlider(this._control);
this.addMenuItem(this._input.item);
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
@@ -300,18 +308,9 @@ const Indicator = new Lang.Class({
this.actor.visible = (icon != null);
this.setIcon(icon);
}));
this._volumeMenu.connect('headphones-changed', Lang.bind(this, function(menu, value) {
this._headphoneIcon.visible = value;
}));
this._headphoneIcon = this.addIcon(new Gio.ThemedIcon({ name: 'audio-headphones-symbolic' }));
this._headphoneIcon.visible = false;
this.menu.addMenuItem(this._volumeMenu);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.menu.addSettingsAction(_("Sound Settings"), 'gnome-sound-panel.desktop');
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
},

View File

@@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const AccountsService = imports.gi.AccountsService;
const Atk = imports.gi.Atk;
const Clutter = imports.gi.Clutter;
const Gdm = imports.gi.Gdm;
const Gio = imports.gi.Gio;
@@ -12,13 +13,13 @@ const Signals = imports.signals;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Layout = imports.ui.layout;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const Panel = imports.ui.panel;
const ShellEntry = imports.ui.shellEntry;
const Tweener = imports.ui.tweener;
const UserWidget = imports.ui.userWidget;
const AuthPrompt = imports.gdm.authPrompt;
const Batch = imports.gdm.batch;
const GdmUtil = imports.gdm.util;
const LoginDialog = imports.gdm.loginDialog;
@@ -28,91 +29,35 @@ const IDLE_TIMEOUT = 2 * 60;
const UnlockDialog = new Lang.Class({
Name: 'UnlockDialog',
Extends: ModalDialog.ModalDialog,
_init: function(parentActor) {
this.parent({ shellReactive: true,
styleClass: 'login-dialog',
keybindingMode: Shell.KeyBindingMode.UNLOCK_SCREEN,
parentActor: parentActor
});
this.actor = new St.Widget({ accessible_role: Atk.Role.WINDOW,
style_class: 'login-dialog',
visible: false });
this.actor.add_constraint(new Layout.MonitorConstraint({ primary: true }));
parentActor.add_child(this.actor);
this._userManager = AccountsService.UserManager.get_default();
this._userName = GLib.get_user_name();
this._user = this._userManager.get_user(this._userName);
this._failCounter = 0;
this._firstQuestion = true;
this._promptBox = new St.BoxLayout({ vertical: true });
this.actor.add_child(this._promptBox);
this._promptBox.add_constraint(new Clutter.AlignConstraint({ source: this.actor,
align_axis: Clutter.AlignAxis.BOTH,
factor: 0.5 }));
this._greeterClient = new Gdm.Client();
this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient, { reauthenticationOnly: true });
this._userVerified = false;
this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
this._authPrompt.connect('failed', Lang.bind(this, this._fail));
this._authPrompt.connect('cancelled', Lang.bind(this, this._fail));
this._authPrompt.connect('reset', Lang.bind(this, this._onReset));
this._authPrompt.setPasswordChar('\u25cf');
this._authPrompt.nextButton.label = _("Unlock");
this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
this._userWidget = new UserWidget.UserWidget(this._user);
this.contentLayout.add_actor(this._userWidget.actor);
this._promptLayout = new St.BoxLayout({ style_class: 'login-dialog-prompt-layout',
vertical: true });
this._promptLabel = new St.Label({ style_class: 'login-dialog-prompt-label' });
this._promptLayout.add(this._promptLabel,
{ x_align: St.Align.START });
this._promptEntry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
can_focus: true });
this._promptEntry.clutter_text.connect('activate', Lang.bind(this, this._doUnlock));
this._promptEntry.clutter_text.set_password_char('\u25cf');
ShellEntry.addContextMenu(this._promptEntry, { isPassword: true });
this.setInitialKeyFocus(this._promptEntry);
this._promptEntry.clutter_text.connect('text-changed', Lang.bind(this, function() {
this._updateOkButtonSensitivity(this._promptEntry.text.length > 0);
}));
this._promptLayout.add(this._promptEntry,
{ expand: true,
x_fill: true });
this.contentLayout.add_actor(this._promptLayout);
this._promptMessage = new St.Label({ visible: false });
this.contentLayout.add(this._promptMessage, { x_fill: true });
this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint' });
this._promptLoginHint.hide();
this.contentLayout.add_actor(this._promptLoginHint);
this._promptBox.add_child(this._authPrompt.actor);
this.allowCancel = false;
this.buttonLayout.visible = true;
this.addButton({ label: _("Cancel"),
action: Lang.bind(this, this._escape),
key: Clutter.KEY_Escape },
{ expand: true,
x_fill: false,
y_fill: false,
x_align: St.Align.START,
y_align: St.Align.MIDDLE });
this.placeSpinner({ expand: false,
x_fill: false,
y_fill: false,
x_align: St.Align.END,
y_align: St.Align.MIDDLE });
this._okButton = this.addButton({ label: _("Unlock"),
action: Lang.bind(this, this._doUnlock),
default: true },
{ expand: false,
x_fill: false,
y_fill: false,
x_align: St.Align.END,
y_align: St.Align.MIDDLE });
let screenSaverSettings = new Gio.Settings({ schema: 'org.gnome.desktop.screensaver' });
if (screenSaverSettings.get_boolean('user-switch-enabled')) {
@@ -125,174 +70,100 @@ const UnlockDialog = new Lang.Class({
x_align: St.Align.START,
x_fill: true });
this._otherUserButton.connect('clicked', Lang.bind(this, this._otherUserClicked));
this.dialogLayout.add(this._otherUserButton,
{ x_align: St.Align.START,
x_fill: false });
this._promptBox.add_child(this._otherUserButton);
} else {
this._otherUserButton = null;
}
this._authPrompt.reset();
this._updateSensitivity(true);
let batch = new Batch.Hold();
this._userVerifier.begin(this._userName, batch);
Main.ctrlAltTabManager.addGroup(this.dialogLayout, _("Unlock Window"), 'dialog-password-symbolic');
Main.ctrlAltTabManager.addGroup(this.actor, _("Unlock Window"), 'dialog-password-symbolic');
this._idleMonitor = new GnomeDesktop.IdleMonitor();
this._idleWatchId = this._idleMonitor.add_idle_watch(IDLE_TIMEOUT * 1000, Lang.bind(this, this._escape));
},
_updateSensitivity: function(sensitive) {
this._promptEntry.reactive = sensitive;
this._promptEntry.clutter_text.editable = sensitive;
this._updateOkButtonSensitivity(sensitive && this._promptEntry.text.length > 0);
this._authPrompt.updateSensitivity(sensitive);
if (this._otherUserButton) {
this._otherUserButton.reactive = sensitive;
this._otherUserButton.can_focus = sensitive;
}
},
_updateOkButtonSensitivity: function(sensitive) {
this._okButton.reactive = sensitive;
this._okButton.can_focus = sensitive;
_fail: function() {
this.emit('failed');
},
_showMessage: function(userVerifier, message, styleClass) {
if (message) {
this._promptMessage.text = message;
this._promptMessage.styleClass = styleClass;
GdmUtil.fadeInActor(this._promptMessage);
_onReset: function(authPrompt, beginRequest) {
let userName;
if (beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
this._authPrompt.setUser(this._user);
userName = this._userName;
} else {
GdmUtil.fadeOutActor(this._promptMessage);
}
},
_onAskQuestion: function(verifier, serviceName, question, passwordChar) {
if (this._firstQuestion && this._firstQuestionAnswer) {
this._userVerifier.answerQuery(serviceName, this._firstQuestionAnswer);
this._firstQuestionAnswer = null;
this._firstQuestion = false;
return;
userName = null;
}
this._promptLabel.text = question;
if (!this._firstQuestion)
this._promptEntry.text = '';
else
this._firstQuestion = false;
this._promptEntry.clutter_text.set_password_char(passwordChar);
this._promptEntry.menu.isPassword = passwordChar != '';
this._currentQuery = serviceName;
this._updateSensitivity(true);
this.setWorking(false);
},
_showLoginHint: function(verifier, message) {
this._promptLoginHint.set_text(message)
GdmUtil.fadeInActor(this._promptLoginHint);
},
_hideLoginHint: function() {
GdmUtil.fadeOutActor(this._promptLoginHint);
},
_doUnlock: function() {
if (this._firstQuestion) {
// we haven't received a query yet, so stash the answer
// and make ourself non-reactive
// the actual reply to GDM will be sent as soon as asked
this._firstQuestionAnswer = this._promptEntry.text;
this._updateSensitivity(false);
this.setWorking(true);
return;
}
if (!this._currentQuery)
return;
let query = this._currentQuery;
this._currentQuery = null;
this._updateSensitivity(false);
this.setWorking(true);
this._userVerifier.answerQuery(query, this._promptEntry.text);
},
_finishUnlock: function() {
this._userVerifier.clear();
this.emit('unlocked');
},
_onVerificationComplete: function() {
this._userVerified = true;
if (!this._userVerifier.hasPendingMessages) {
this._finishUnlock();
} else {
let signalId = this._userVerifier.connect('no-more-messages',
Lang.bind(this, function() {
this._userVerifier.disconnect(signalId);
this._finishUnlock();
}));
}
},
_onReset: function() {
if (!this._userVerified) {
this._userVerifier.clear();
this.emit('failed');
}
},
_onVerificationFailed: function() {
this._currentQuery = null;
this._firstQuestion = true;
this._userVerified = false;
this._promptEntry.text = '';
this._promptEntry.clutter_text.set_password_char('\u25cf');
this._promptEntry.menu.isPassword = true;
this._updateSensitivity(false);
this.setWorking(false);
this._authPrompt.begin({ userName: userName });
},
_escape: function() {
if (this.allowCancel) {
this._userVerifier.cancel();
this.emit('failed');
}
if (this.allowCancel)
this._authPrompt.cancel();
},
_otherUserClicked: function(button, event) {
Gdm.goto_login_session_sync(null);
this._userVerifier.cancel();
this.emit('failed');
this._authPrompt.cancel();
},
destroy: function() {
this._userVerifier.clear();
this.popModal();
this.actor.destroy();
if (this._idleWatchId) {
this._idleMonitor.remove_watch(this._idleWatchId);
this._idleWatchId = 0;
}
this.parent();
},
cancel: function() {
this._userVerifier.cancel(null);
this._authPrompt.cancel();
this.destroy();
},
addCharacter: function(unichar) {
this._promptEntry.clutter_text.insert_unichar(unichar);
this._authPrompt.addCharacter(unichar);
},
finish: function(onComplete) {
this._authPrompt.finish(onComplete);
},
open: function(timestamp) {
this.actor.show();
if (this._isModal)
return true;
if (!Main.pushModal(this.actor, { timestamp: timestamp,
keybindingMode: Shell.KeyBindingMode.UNLOCK_SCREEN }))
return false;
this._isModal = true;
return true;
},
popModal: function(timestamp) {
if (this._isModal) {
Main.popModal(this.actor, timestamp);
this._isModal = false;
}
}
});
Signals.addSignalMethods(UnlockDialog.prototype);

View File

@@ -1,944 +0,0 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const AccountsService = imports.gi.AccountsService;
const Gdm = imports.gi.Gdm;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const Pango = imports.gi.Pango;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Tp = imports.gi.TelepathyGLib;
const Atk = imports.gi.Atk;
const Clutter = imports.gi.Clutter;
const BoxPointer = imports.ui.boxpointer;
const GnomeSession = imports.misc.gnomeSession;
const LoginManager = imports.misc.loginManager;
const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Util = imports.misc.util;
const UserWidget = imports.ui.userWidget;
const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
const PRIVACY_SCHEMA = 'org.gnome.desktop.privacy'
const DISABLE_USER_SWITCH_KEY = 'disable-user-switching';
const DISABLE_LOCK_SCREEN_KEY = 'disable-lock-screen';
const DISABLE_LOG_OUT_KEY = 'disable-log-out';
const ALWAYS_SHOW_LOG_OUT_KEY = 'always-show-log-out';
const SHOW_FULL_NAME_IN_TOP_BAR_KEY = 'show-full-name-in-top-bar';
const MAX_USERS_IN_SESSION_DIALOG = 5;
const IMStatus = {
AVAILABLE: 0,
BUSY: 1,
HIDDEN: 2,
AWAY: 3,
IDLE: 4,
OFFLINE: 5,
LAST: 6
};
const SystemdLoginSessionIface = <interface name='org.freedesktop.login1.Session'>
<property name="Id" type="s" access="read"/>
<property name="Remote" type="b" access="read"/>
<property name="Class" type="s" access="read"/>
<property name="Type" type="s" access="read"/>
<property name="State" type="s" access="read"/>
</interface>;
const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
const IMStatusItem = new Lang.Class({
Name: 'IMStatusItem',
Extends: PopupMenu.PopupBaseMenuItem,
_init: function(label, iconName) {
this.parent();
this.actor.add_style_class_name('status-chooser-status-item');
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
this.addActor(this._icon);
if (iconName)
this._icon.icon_name = iconName;
this.label = new St.Label({ text: label });
this.actor.label_actor = this.label;
this.addActor(this.label);
}
});
const IMUserNameItem = new Lang.Class({
Name: 'IMUserNameItem',
Extends: PopupMenu.PopupBaseMenuItem,
_init: function() {
this.parent({ reactive: false,
can_focus: false,
style_class: 'status-chooser-user-name' });
this._wrapper = new Shell.GenericContainer();
this._wrapper.connect('get-preferred-width',
Lang.bind(this, this._wrapperGetPreferredWidth));
this._wrapper.connect('get-preferred-height',
Lang.bind(this, this._wrapperGetPreferredHeight));
this._wrapper.connect('allocate',
Lang.bind(this, this._wrapperAllocate));
this.addActor(this._wrapper, { expand: true, span: -1 });
this.label = new St.Label();
this.label.clutter_text.set_line_wrap(true);
this.label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
this._wrapper.add_actor(this.label);
},
_wrapperGetPreferredWidth: function(actor, forHeight, alloc) {
alloc.min_size = 1;
alloc.natural_size = 1;
},
_wrapperGetPreferredHeight: function(actor, forWidth, alloc) {
[alloc.min_size, alloc.natural_size] = this.label.get_preferred_height(forWidth);
},
_wrapperAllocate: function(actor, box, flags) {
this.label.allocate(box, flags);
}
});
const IMStatusChooserItem = new Lang.Class({
Name: 'IMStatusChooserItem',
Extends: PopupMenu.PopupBaseMenuItem,
_init: function() {
this.parent({ reactive: false,
can_focus: false,
style_class: 'status-chooser' });
this._userManager = AccountsService.UserManager.get_default();
this._user = this._userManager.get_user(GLib.get_user_name());
this._avatar = new UserWidget.Avatar(this._user, { reactive: true });
this._iconBin = new St.Button({ child: this._avatar.actor });
this.addActor(this._iconBin);
this._iconBin.connect('clicked', Lang.bind(this,
function() {
this.activate();
}));
this._section = new PopupMenu.PopupMenuSection();
this.addActor(this._section.actor);
this._name = new IMUserNameItem();
this._section.addMenuItem(this._name);
this._combo = new PopupMenu.PopupComboBoxMenuItem({ style_class: 'status-chooser-combo' });
this._section.addMenuItem(this._combo);
let item;
item = new IMStatusItem(_("Available"), 'user-available-symbolic');
this._combo.addMenuItem(item, IMStatus.AVAILABLE);
item = new IMStatusItem(_("Busy"), 'user-busy-symbolic');
this._combo.addMenuItem(item, IMStatus.BUSY);
item = new IMStatusItem(_("Invisible"), 'user-invisible-symbolic');
this._combo.addMenuItem(item, IMStatus.HIDDEN);
item = new IMStatusItem(_("Away"), 'user-away-symbolic');
this._combo.addMenuItem(item, IMStatus.AWAY);
item = new IMStatusItem(_("Idle"), 'user-idle-symbolic');
this._combo.addMenuItem(item, IMStatus.IDLE);
item = new IMStatusItem(_("Offline"), 'user-offline-symbolic');
this._combo.addMenuItem(item, IMStatus.OFFLINE);
this._combo.connect('active-item-changed',
Lang.bind(this, this._changeIMStatus));
this._presence = new GnomeSession.Presence();
this._presence.connectSignal('StatusChanged', Lang.bind(this, function(proxy, senderName, [status]) {
this._sessionStatusChanged(status);
}));
this._sessionPresenceRestored = false;
this._imPresenceRestored = false;
this._currentPresence = undefined;
this._accountMgr = Tp.AccountManager.dup();
this._accountMgr.connect('most-available-presence-changed',
Lang.bind(this, this._IMStatusChanged));
this._accountMgr.connect('account-enabled',
Lang.bind(this, this._IMAccountsChanged));
this._accountMgr.connect('account-disabled',
Lang.bind(this, this._IMAccountsChanged));
this._accountMgr.connect('account-removed',
Lang.bind(this, this._IMAccountsChanged));
this._accountMgr.connect('account-validity-changed',
Lang.bind(this, this._IMAccountsChanged));
this._accountMgr.prepare_async(null, Lang.bind(this,
function(mgr) {
this._IMAccountsChanged(mgr);
if (this._networkMonitor.network_available)
this._restorePresence();
else
this._setComboboxPresence(Tp.ConnectionPresenceType.OFFLINE);
}));
this._networkMonitor = Gio.NetworkMonitor.get_default();
this._networkMonitor.connect('network-changed',
Lang.bind(this, function(monitor, available) {
this._IMAccountsChanged(this._accountMgr);
if (available && !this._imPresenceRestored)
this._restorePresence();
}));
this._userLoadedId = this._user.connect('notify::is-loaded',
Lang.bind(this,
this._updateUser));
this._userChangedId = this._user.connect('changed',
Lang.bind(this,
this._updateUser));
this.actor.connect('notify::mapped', Lang.bind(this, function() {
if (this.actor.mapped)
this._updateUser();
}));
this.connect('sensitive-changed', function(sensitive) {
this._avatar.setSensitive(sensitive);
});
},
_restorePresence: function() {
let [presence, status, msg] = this._accountMgr.get_most_available_presence();
let savedPresence = global.settings.get_int('saved-im-presence');
if (savedPresence == presence) {
this._IMStatusChanged(this._accountMgr, presence, status, msg);
} else {
this._setComboboxPresence(savedPresence);
status = this._statusForPresence(savedPresence);
msg = msg ? msg : '';
this._accountMgr.set_all_requested_presences(savedPresence, status, msg);
}
},
destroy: function() {
// clean up signal handlers
if (this._userLoadedId != 0) {
this._user.disconnect(this._userLoadedId);
this._userLoadedId = 0;
}
if (this._userChangedId != 0) {
this._user.disconnect(this._userChangedId);
this._userChangedId = 0;
}
this.parent();
},
// Override getColumnWidths()/setColumnWidths() to make the item
// independent from the overall column layout of the menu
getColumnWidths: function() {
return [];
},
setColumnWidths: function(widths) {
},
_updateUser: function() {
if (this._user.is_loaded)
this._name.label.set_text(this._user.get_real_name());
else
this._name.label.set_text("");
this._avatar.update();
},
_statusForPresence: function(presence) {
switch(presence) {
case Tp.ConnectionPresenceType.AVAILABLE:
return 'available';
case Tp.ConnectionPresenceType.BUSY:
return 'busy';
case Tp.ConnectionPresenceType.OFFLINE:
return 'offline';
case Tp.ConnectionPresenceType.HIDDEN:
return 'hidden';
case Tp.ConnectionPresenceType.AWAY:
return 'away';
case Tp.ConnectionPresenceType.EXTENDED_AWAY:
return 'xa';
default:
return 'unknown';
}
},
_IMAccountsChanged: function(mgr) {
let accounts = mgr.get_valid_accounts().filter(function(account) {
return account.enabled;
});
let sensitive = accounts.length > 0 && this._networkMonitor.network_available;
this._combo.setSensitive(sensitive);
},
_IMStatusChanged: function(accountMgr, presence, status, message) {
if (!this._imPresenceRestored)
this._imPresenceRestored = true;
if (presence == this._currentPresence)
return;
this._currentPresence = presence;
this._setComboboxPresence(presence);
if (!this._sessionPresenceRestored) {
this._sessionStatusChanged(this._presence.status);
return;
}
if (presence == Tp.ConnectionPresenceType.AVAILABLE)
this._presence.status = GnomeSession.PresenceStatus.AVAILABLE;
// We ignore the actual value of _expectedPresence and never safe
// the first presence change after an "automatic" change, assuming
// that it is the response to our request; this is to account for
// mission control falling back to "similar" presences if an account
// type does not implement the requested presence.
if (!this._expectedPresence)
global.settings.set_int('saved-im-presence', presence);
else
this._expectedPresence = undefined;
},
_setComboboxPresence: function(presence) {
let activatedItem;
if (presence == Tp.ConnectionPresenceType.AVAILABLE)
activatedItem = IMStatus.AVAILABLE;
else if (presence == Tp.ConnectionPresenceType.BUSY)
activatedItem = IMStatus.BUSY;
else if (presence == Tp.ConnectionPresenceType.HIDDEN)
activatedItem = IMStatus.HIDDEN;
else if (presence == Tp.ConnectionPresenceType.AWAY)
activatedItem = IMStatus.AWAY;
else if (presence == Tp.ConnectionPresenceType.EXTENDED_AWAY)
activatedItem = IMStatus.IDLE;
else
activatedItem = IMStatus.OFFLINE;
this._combo.setActiveItem(activatedItem);
for (let i = 0; i < IMStatus.LAST; i++) {
if (i == IMStatus.AVAILABLE || i == IMStatus.OFFLINE)
continue; // always visible
this._combo.setItemVisible(i, i == activatedItem);
}
},
_changeIMStatus: function(menuItem, id) {
let [presence, s, msg] = this._accountMgr.get_most_available_presence();
let newPresence, status;
if (id == IMStatus.AVAILABLE) {
newPresence = Tp.ConnectionPresenceType.AVAILABLE;
} else if (id == IMStatus.OFFLINE) {
newPresence = Tp.ConnectionPresenceType.OFFLINE;
} else
return;
status = this._statusForPresence(newPresence);
msg = msg ? msg : '';
this._accountMgr.set_all_requested_presences(newPresence, status, msg);
},
getIMPresenceForSessionStatus: function(sessionStatus) {
// Restore the last user-set presence when coming back from
// BUSY/IDLE (otherwise the last user-set presence matches
// the current one)
if (sessionStatus == GnomeSession.PresenceStatus.AVAILABLE)
return global.settings.get_int('saved-im-presence');
if (sessionStatus == GnomeSession.PresenceStatus.BUSY) {
// Only change presence if the current one is "more present" than
// busy, or if coming back from idle
if (this._currentPresence == Tp.ConnectionPresenceType.AVAILABLE ||
this._currentPresence == Tp.ConnectionPresenceType.EXTENDED_AWAY)
return Tp.ConnectionPresenceType.BUSY;
}
if (sessionStatus == GnomeSession.PresenceStatus.IDLE) {
// Only change presence if the current one is "more present" than
// idle
if (this._currentPresence != Tp.ConnectionPresenceType.OFFLINE &&
this._currentPresence != Tp.ConnectionPresenceType.HIDDEN)
return Tp.ConnectionPresenceType.EXTENDED_AWAY;
}
return this._currentPresence;
},
_sessionStatusChanged: function(sessionStatus) {
if (!this._imPresenceRestored)
return;
let savedStatus = global.settings.get_int('saved-session-presence');
if (!this._sessionPresenceRestored) {
// We should never save/restore a status other than AVAILABLE
// or BUSY
if (savedStatus != GnomeSession.PresenceStatus.AVAILABLE &&
savedStatus != GnomeSession.PresenceStatus.BUSY)
savedStatus = GnomeSession.PresenceStatus.AVAILABLE;
if (sessionStatus != savedStatus) {
this._presence.status = savedStatus;
return;
}
this._sessionPresenceRestored = true;
}
if ((sessionStatus == GnomeSession.PresenceStatus.AVAILABLE ||
sessionStatus == GnomeSession.PresenceStatus.BUSY) &&
savedStatus != sessionStatus)
global.settings.set_int('saved-session-presence', sessionStatus);
let [presence, s, msg] = this._accountMgr.get_most_available_presence();
let newPresence, status;
let newPresence = this.getIMPresenceForSessionStatus(sessionStatus);
if (!newPresence || newPresence == presence)
return;
status = this._statusForPresence(newPresence);
msg = msg ? msg : '';
this._expectedPresence = newPresence;
this._accountMgr.set_all_requested_presences(newPresence, status, msg);
}
});
const UserMenuButton = new Lang.Class({
Name: 'UserMenuButton',
Extends: PanelMenu.Button,
_init: function() {
this.parent(0.0);
this.actor.accessible_role = Atk.Role.MENU;
let box = new St.BoxLayout({ name: 'panelUserMenu' });
this.actor.add_actor(box);
this._screenSaverSettings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA });
this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
this._privacySettings = new Gio.Settings({ schema: PRIVACY_SCHEMA });
this._userManager = AccountsService.UserManager.get_default();
this._user = this._userManager.get_user(GLib.get_user_name());
this._presence = new GnomeSession.Presence();
this._session = new GnomeSession.SessionManager();
this._haveShutdown = true;
this._haveSuspend = true;
this._accountMgr = Tp.AccountManager.dup();
this._loginManager = LoginManager.getLoginManager();
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this._iconBox = new St.Bin();
box.add(this._iconBox, { y_align: St.Align.MIDDLE, y_fill: false });
let textureCache = St.TextureCache.get_default();
this._offlineIcon = new St.Icon({ icon_name: 'user-offline-symbolic',
style_class: 'popup-menu-icon' });
this._availableIcon = new St.Icon({ icon_name: 'user-available-symbolic',
style_class: 'popup-menu-icon' });
this._busyIcon = new St.Icon({ icon_name: 'user-busy-symbolic',
style_class: 'popup-menu-icon' });
this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible-symbolic',
style_class: 'popup-menu-icon' });
this._awayIcon = new St.Icon({ icon_name: 'user-away-symbolic',
style_class: 'popup-menu-icon' });
this._idleIcon = new St.Icon({ icon_name: 'user-idle-symbolic',
style_class: 'popup-menu-icon' });
this._pendingIcon = new St.Icon({ icon_name: 'user-status-pending-symbolic',
style_class: 'popup-menu-icon' });
this._lockedIcon = new St.Icon({ icon_name: 'changes-prevent-symbolic',
style_class: 'popup-menu-icon' });
this._accountMgr.connect('most-available-presence-changed',
Lang.bind(this, this._updatePresenceIcon));
this._accountMgr.connect('account-enabled',
Lang.bind(this, this._onAccountEnabled));
this._accountMgr.connect('account-removed',
Lang.bind(this, this._onAccountRemoved));
this._accountMgr.prepare_async(null, Lang.bind(this,
function(mgr) {
let [presence, s, msg] = mgr.get_most_available_presence();
this._updatePresenceIcon(mgr, presence, s, msg);
this._setupAccounts();
}));
this._name = new St.Label();
this.actor.label_actor = this._name;
box.add(this._name, { y_align: St.Align.MIDDLE, y_fill: false });
this._userLoadedId = this._user.connect('notify::is-loaded', Lang.bind(this, this._updateUserName));
this._userChangedId = this._user.connect('changed', Lang.bind(this, this._updateUserName));
this._updateUserName();
this._createSubMenu();
this._updateSwitch(this._presence.status);
this._presence.connectSignal('StatusChanged', Lang.bind(this, function (proxy, senderName, [status]) {
this._updateSwitch(status);
}));
this._userManager.connect('notify::is-loaded',
Lang.bind(this, this._updateMultiUser));
this._userManager.connect('notify::has-multiple-users',
Lang.bind(this, this._updateMultiUser));
this._userManager.connect('user-added',
Lang.bind(this, this._updateMultiUser));
this._userManager.connect('user-removed',
Lang.bind(this, this._updateMultiUser));
this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
Lang.bind(this, this._updateSwitchUser));
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
Lang.bind(this, this._updateLogout));
this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
Lang.bind(this, this._updateLockScreen));
global.settings.connect('changed::' + ALWAYS_SHOW_LOG_OUT_KEY,
Lang.bind(this, this._updateLogout));
this._screenSaverSettings.connect('changed::' + SHOW_FULL_NAME_IN_TOP_BAR_KEY,
Lang.bind(this, this._updateUserName));
this._privacySettings.connect('changed::' + SHOW_FULL_NAME_IN_TOP_BAR_KEY,
Lang.bind(this, this._updateUserName));
this._updateSwitchUser();
this._updateLogout();
this._updateLockScreen();
this._updatesFile = Gio.File.new_for_path('/var/lib/PackageKit/prepared-update');
this._updatesMonitor = this._updatesFile.monitor(Gio.FileMonitorFlags.NONE, null);
this._updatesMonitor.connect('changed', Lang.bind(this, this._updateInstallUpdates));
// Whether shutdown is available or not depends on both lockdown
// settings (disable-log-out) and Polkit policy - the latter doesn't
// notify, so we update the menu item each time the menu opens or
// the lockdown setting changes, which should be close enough.
this.menu.connect('open-state-changed', Lang.bind(this,
function(menu, open) {
if (!open)
return;
this._updateHaveShutdown();
this._updateHaveSuspend();
}));
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
Lang.bind(this, this._updateHaveShutdown));
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
if (Main.screenShield)
Main.screenShield.connect('locked-changed', Lang.bind(this, this._updatePresenceIcon));
this._sessionUpdated();
},
_sessionUpdated: function() {
this.actor.visible = !Main.sessionMode.isGreeter;
let allowSettings = Main.sessionMode.allowSettings;
this._statusChooser.setSensitive(allowSettings);
this.setSensitive(!Main.sessionMode.isLocked);
this._updatePresenceIcon();
this._updateUserName();
},
_onDestroy: function() {
this._user.disconnect(this._userLoadedId);
this._user.disconnect(this._userChangedId);
},
_updateUserName: function() {
let settings = this._privacySettings;
if (Main.sessionMode.isLocked)
settings = this._screenSaverSettings;
if (this._user.is_loaded && settings.get_boolean(SHOW_FULL_NAME_IN_TOP_BAR_KEY))
this._name.set_text(this._user.get_real_name());
else
this._name.set_text("");
},
_updateMultiUser: function() {
this._updateSwitchUser();
this._updateLogout();
},
_updateSwitchUser: function() {
let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
let multiUser = this._userManager.can_switch() && this._userManager.has_multiple_users;
this._loginScreenItem.actor.visible = allowSwitch && multiUser;
},
_updateLogout: function() {
let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY);
let alwaysShow = global.settings.get_boolean(ALWAYS_SHOW_LOG_OUT_KEY);
let systemAccount = this._user.system_account;
let localAccount = this._user.local_account;
let multiUser = this._userManager.has_multiple_users;
let multiSession = Gdm.get_session_ids().length > 1;
this._logoutItem.actor.visible = allowLogout && (alwaysShow || multiUser || multiSession || systemAccount || !localAccount);
},
_updateLockScreen: function() {
let allowLockScreen = !this._lockdownSettings.get_boolean(DISABLE_LOCK_SCREEN_KEY);
this._lockScreenItem.actor.visible = allowLockScreen && LoginManager.canLock();
},
_updateInstallUpdates: function() {
let haveUpdates = this._updatesFile.query_exists(null);
this._installUpdatesItem.actor.visible = haveUpdates && this._haveShutdown;
},
_updateHaveShutdown: function() {
this._session.CanShutdownRemote(Lang.bind(this,
function(result, error) {
if (!error) {
this._haveShutdown = result[0];
this._updateInstallUpdates();
this._updateSuspendOrPowerOff();
}
}));
},
_updateHaveSuspend: function() {
this._loginManager.canSuspend(Lang.bind(this,
function(result) {
this._haveSuspend = result;
this._updateSuspendOrPowerOff();
}));
},
_updateSuspendOrPowerOff: function() {
if (!this._suspendOrPowerOffItem)
return;
this._suspendOrPowerOffItem.actor.visible = this._haveShutdown || this._haveSuspend;
// If we can't power off show Suspend instead
// and disable the alt key
if (!this._haveShutdown) {
this._suspendOrPowerOffItem.updateText(_("Suspend"), null);
} else if (!this._haveSuspend) {
this._suspendOrPowerOffItem.updateText(_("Power Off"), null);
} else {
this._suspendOrPowerOffItem.updateText(_("Power Off"), _("Suspend"));
}
},
_updateSwitch: function(status) {
let active = status == GnomeSession.PresenceStatus.AVAILABLE;
this._notificationsSwitch.setToggleState(active);
},
_updatePresenceIcon: function(accountMgr, presence, status, message) {
if (Main.sessionMode.isLocked)
this._iconBox.child = this._lockedIcon;
else if (presence == Tp.ConnectionPresenceType.AVAILABLE)
this._iconBox.child = this._availableIcon;
else if (presence == Tp.ConnectionPresenceType.BUSY)
this._iconBox.child = this._busyIcon;
else if (presence == Tp.ConnectionPresenceType.HIDDEN)
this._iconBox.child = this._invisibleIcon;
else if (presence == Tp.ConnectionPresenceType.AWAY)
this._iconBox.child = this._awayIcon;
else if (presence == Tp.ConnectionPresenceType.EXTENDED_AWAY)
this._iconBox.child = this._idleIcon;
else
this._iconBox.child = this._offlineIcon;
if (Main.sessionMode.isLocked)
this._iconBox.visible = Main.screenShield.locked;
else
this._iconBox.visible = true;
},
_setupAccounts: function() {
let accounts = this._accountMgr.get_valid_accounts();
for (let i = 0; i < accounts.length; i++) {
accounts[i]._changingId = accounts[i].connect('notify::connection-status',
Lang.bind(this, this._updateChangingPresence));
}
this._updateChangingPresence();
},
_onAccountEnabled: function(accountMgr, account) {
if (!account._changingId)
account._changingId = account.connect('notify::connection-status',
Lang.bind(this, this._updateChangingPresence));
this._updateChangingPresence();
},
_onAccountRemoved: function(accountMgr, account) {
if (account._changingId) {
account.disconnect(account._changingId);
account._changingId = 0;
}
this._updateChangingPresence();
},
_updateChangingPresence: function() {
let accounts = this._accountMgr.get_valid_accounts();
let changing = false;
for (let i = 0; i < accounts.length; i++) {
if (accounts[i].connection_status == Tp.ConnectionStatus.CONNECTING) {
changing = true;
break;
}
}
if (changing) {
this._iconBox.child = this._pendingIcon;
} else {
let [presence, s, msg] = this._accountMgr.get_most_available_presence();
this._updatePresenceIcon(this._accountMgr, presence, s, msg);
}
},
_createSubMenu: function() {
let item;
item = new IMStatusChooserItem();
item.connect('activate', Lang.bind(this, this._onMyAccountActivate));
this.menu.addMenuItem(item);
this._statusChooser = item;
item = new PopupMenu.PopupSwitchMenuItem(_("Notifications"));
item.connect('toggled', Lang.bind(this, this._updatePresenceStatus));
this.menu.addMenuItem(item);
this._notificationsSwitch = item;
item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item);
this.menu.addSettingsAction(_("Settings"), 'gnome-control-center.desktop');
item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item);
item = new PopupMenu.PopupMenuItem(_("Switch User"));
item.connect('activate', Lang.bind(this, this._onLoginScreenActivate));
this.menu.addMenuItem(item);
this._loginScreenItem = item;
item = new PopupMenu.PopupMenuItem(_("Log Out"));
item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
this.menu.addMenuItem(item);
this._logoutItem = item;
item = new PopupMenu.PopupMenuItem(_("Lock"));
item.connect('activate', Lang.bind(this, this._onLockScreenActivate));
this.menu.addMenuItem(item);
this._lockScreenItem = item;
item = new PopupMenu.PopupSeparatorMenuItem();
this.menu.addMenuItem(item);
item = new PopupMenu.PopupAlternatingMenuItem(_("Power Off"),
_("Suspend"));
this.menu.addMenuItem(item);
item.connect('activate', Lang.bind(this, this._onSuspendOrPowerOffActivate));
this._suspendOrPowerOffItem = item;
this._updateSuspendOrPowerOff();
item = new PopupMenu.PopupMenuItem(_("Install Updates & Restart"));
item.connect('activate', Lang.bind(this, this._onInstallUpdatesActivate));
this.menu.addMenuItem(item);
this._installUpdatesItem = item;
},
_updatePresenceStatus: function(item, event) {
let status;
if (item.state) {
status = GnomeSession.PresenceStatus.AVAILABLE;
} else {
status = GnomeSession.PresenceStatus.BUSY;
let [presence, s, msg] = this._accountMgr.get_most_available_presence();
let newPresence = this._statusChooser.getIMPresenceForSessionStatus(status);
if (newPresence != presence &&
newPresence == Tp.ConnectionPresenceType.BUSY)
Main.notify(_("Your chat status will be set to busy"),
_("Notifications are now disabled, including chat messages. Your online status has been adjusted to let others know that you might not see their messages."));
}
this._presence.status = status;
},
_onMyAccountActivate: function() {
Main.overview.hide();
let app = Shell.AppSystem.get_default().lookup_app('gnome-user-accounts-panel.desktop');
app.activate();
},
_onLockScreenActivate: function() {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
Main.overview.hide();
Main.screenShield.lock(true);
},
_onLoginScreenActivate: function() {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
Main.overview.hide();
if (Main.screenShield)
Main.screenShield.lock(false);
Gdm.goto_login_session_sync(null);
},
_onQuitSessionActivate: function() {
Main.overview.hide();
this._session.LogoutRemote(0);
},
_onInstallUpdatesActivate: function() {
Main.overview.hide();
Util.spawn(['pkexec', '/usr/libexec/pk-trigger-offline-update']);
this._session.RebootRemote();
},
_openSessionWarnDialog: function(sessions) {
let dialog = new ModalDialog.ModalDialog();
let subjectLabel = new St.Label({ style_class: 'end-session-dialog-subject',
text: _("Other users are logged in.") });
dialog.contentLayout.add(subjectLabel, { y_fill: true,
y_align: St.Align.START });
let descriptionLabel = new St.Label({ style_class: 'end-session-dialog-description'});
descriptionLabel.set_text(_("Shutting down might cause them to lose unsaved work."));
descriptionLabel.clutter_text.line_wrap = true;
dialog.contentLayout.add(descriptionLabel, { x_fill: true,
y_fill: true,
y_align: St.Align.START });
let scrollView = new St.ScrollView({ style_class: 'end-session-dialog-app-list' });
scrollView.add_style_class_name('vfade');
scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
dialog.contentLayout.add(scrollView, { x_fill: true, y_fill: true });
let userList = new St.BoxLayout({ vertical: true });
scrollView.add_actor(userList);
for (let i = 0; i < sessions.length; i++) {
let session = sessions[i];
let userEntry = new St.BoxLayout({ style_class: 'login-dialog-user-list-item',
vertical: false });
let avatar = new UserWidget.Avatar(session.user);
avatar.update();
userEntry.add(avatar.actor);
let userLabelText = "";;
let userName = session.user.get_real_name() ?
session.user.get_real_name() : session.username;
if (session.info.remote)
/* Translators: Remote here refers to a remote session, like a ssh login */
userLabelText = _("%s (remote)").format(userName);
else if (session.info.type == "tty")
/* Translators: Console here refers to a tty like a VT console */
userLabelText = _("%s (console)").format(userName);
else
userLabelText = userName;
let textLayout = new St.BoxLayout({ style_class: 'login-dialog-user-list-item-text-box',
vertical: true });
textLayout.add(new St.Label({ text: userLabelText }),
{ y_fill: false,
y_align: St.Align.MIDDLE,
expand: true });
userEntry.add(textLayout, { expand: true });
userList.add(userEntry, { x_fill: true });
}
let cancelButton = { label: _("Cancel"),
action: function() { dialog.close(); },
key: Clutter.Escape };
let powerOffButton = { label: _("Power Off"), action: Lang.bind(this, function() {
dialog.close();
this._session.ShutdownRemote();
}), default: true };
dialog.setButtons([cancelButton, powerOffButton]);
dialog.open();
},
_onSuspendOrPowerOffActivate: function() {
Main.overview.hide();
if (this._haveShutdown &&
this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
this._loginManager.listSessions(Lang.bind(this,
function(result) {
let sessions = [];
let n = 0;
for (let i = 0; i < result.length; i++) {
let[id, uid, userName, seat, sessionPath] = result[i];
let proxy = new SystemdLoginSession(Gio.DBus.system,
'org.freedesktop.login1',
sessionPath);
if (proxy.Class != 'user')
continue;
if (proxy.State == 'closing')
continue;
if (proxy.Id == GLib.getenv('XDG_SESSION_ID'))
continue;
sessions.push({ user: this._userManager.get_user(userName),
username: userName,
info: { type: proxy.Type,
remote: proxy.Remote }
});
// limit the number of entries
n++;
if (n == MAX_USERS_IN_SESSION_DIALOG)
break;
}
if (n != 0)
this._openSessionWarnDialog(sessions);
else
this._session.ShutdownRemote();
}));
} else {
this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
this._loginManager.suspend();
}
}
});

View File

@@ -24,7 +24,7 @@ const Avatar = new Lang.Class({
this._user = user;
params = Params.parse(params, { reactive: false,
iconSize: AVATAR_ICON_SIZE,
styleClass: 'status-chooser-user-icon' });
styleClass: 'framed-user-icon' });
this._iconSize = params.iconSize;
this.actor = new St.Bin({ style_class: params.styleClass,

View File

@@ -473,13 +473,17 @@ const WindowManager = new Lang.Class({
this._dimWindow(this._dimmedWindows[i]);
}));
this._workspaceTracker = new WorkspaceTracker(this);
if (Main.sessionMode.hasWorkspaces)
this._workspaceTracker = new WorkspaceTracker(this);
global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,
false, -1, 1);
},
keepWorkspaceAlive: function(workspace, duration) {
if (!this._workspaceTracker)
return;
this._workspaceTracker.keepWorkspaceAlive(workspace, duration);
},
@@ -829,7 +833,7 @@ const WindowManager = new Lang.Class({
},
_switchWorkspace : function(shellwm, from, to, direction) {
if (!this._shouldAnimate()) {
if (!Main.sessionMode.hasWorkspaces || !this._shouldAnimate()) {
shellwm.completed_switch_workspace();
return;
}
@@ -982,6 +986,9 @@ const WindowManager = new Lang.Class({
},
_showWorkspaceSwitcher : function(display, screen, window, binding) {
if (!Main.sessionMode.hasWorkspaces)
return;
if (screen.n_workspaces == 1)
return;
@@ -1023,14 +1030,19 @@ const WindowManager = new Lang.Class({
},
actionMoveWorkspace: function(workspace) {
if (!Main.sessionMode.hasWorkspaces)
return;
let activeWorkspace = global.screen.get_active_workspace();
if (activeWorkspace != workspace)
workspace.activate(global.get_current_time());
},
actionMoveWindow: function(window, workspace) {
if (!Main.sessionMode.hasWorkspaces)
return;
let activeWorkspace = global.screen.get_active_workspace();
if (activeWorkspace != workspace) {
@@ -1043,6 +1055,5 @@ const WindowManager = new Lang.Class({
global.display.clear_mouse_mode();
workspace.activate_with_focus (window, global.get_current_time());
}
},
});

View File

@@ -7,6 +7,7 @@ data/gnome-shell.desktop.in.in
data/gnome-shell-extension-prefs.desktop.in.in
data/org.gnome.shell.gschema.xml.in.in
js/extensionPrefs/main.js
js/gdm/authPrompt.js
js/gdm/loginDialog.js
js/gdm/powerMenu.js
js/gdm/util.js
@@ -48,9 +49,9 @@ js/ui/status/keyboard.js
js/ui/status/lockScreenMenu.js
js/ui/status/network.js
js/ui/status/power.js
js/ui/status/system.js
js/ui/status/volume.js
js/ui/unlockDialog.js
js/ui/userMenu.js
js/ui/viewSelector.js
js/ui/wanda.js
js/ui/windowAttentionHandler.js

450
po/cs.po
View File

@@ -12,8 +12,8 @@ msgstr ""
"Project-Id-Version: gnome-shell\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2013-06-27 11:02+0000\n"
"PO-Revision-Date: 2013-06-28 18:32+0200\n"
"POT-Creation-Date: 2013-07-26 08:43+0000\n"
"PO-Revision-Date: 2013-07-28 13:09+0200\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
"Language: cs\n"
@@ -32,7 +32,7 @@ msgstr "Snímky obrazovky"
msgid "Record a screencast"
msgstr "Nahrát dění na obrazovce"
#: ../data/50-gnome-shell-system.xml.in.h:1
#: ../data/50-gnome-shell-system.xml.in.h:1 ../js/ui/status/system.js:48
msgid "System"
msgstr "Systém"
@@ -363,41 +363,45 @@ msgid "Select an extension to configure using the combobox above."
msgstr ""
"Pomocí rozbalovacího seznamu výše zvolte rozšíření, které chete nastavit."
#: ../js/gdm/loginDialog.js:308
#: ../js/gdm/authPrompt.js:132 ../js/ui/components/networkAgent.js:137
#: ../js/ui/components/polkitAgent.js:161 ../js/ui/endSessionDialog.js:376
#: ../js/ui/extensionDownloader.js:195 ../js/ui/shellMountOperation.js:399
#: ../js/ui/status/bluetooth.js:218 ../js/ui/status/system.js:305
msgid "Cancel"
msgstr "Zrušit"
#: ../js/gdm/authPrompt.js:154 ../js/gdm/authPrompt.js:206
msgid "Next"
msgstr "Následující"
#: ../js/gdm/authPrompt.js:202 ../js/ui/shellMountOperation.js:403
#: ../js/ui/unlockDialog.js:55
msgid "Unlock"
msgstr "Odemknout"
#: ../js/gdm/authPrompt.js:204
msgctxt "button"
msgid "Sign In"
msgstr "Přihlásit se"
#: ../js/gdm/loginDialog.js:299
msgid "Choose Session"
msgstr "Vybrat sezení"
#: ../js/gdm/loginDialog.js:326
#: ../js/gdm/loginDialog.js:317
msgid "Session"
msgstr "Sezení"
#. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: ../js/gdm/loginDialog.js:528
#: ../js/gdm/loginDialog.js:468
msgid "Not listed?"
msgstr "Nejste na seznamu?"
#: ../js/gdm/loginDialog.js:810 ../js/ui/components/networkAgent.js:137
#: ../js/ui/components/polkitAgent.js:161 ../js/ui/endSessionDialog.js:376
#: ../js/ui/extensionDownloader.js:195 ../js/ui/shellMountOperation.js:399
#: ../js/ui/status/bluetooth.js:449 ../js/ui/unlockDialog.js:95
#: ../js/ui/userMenu.js:884
msgid "Cancel"
msgstr "Zrušit"
#: ../js/gdm/loginDialog.js:833
msgctxt "button"
msgid "Sign In"
msgstr "Přihlásit se"
#: ../js/gdm/loginDialog.js:833
msgid "Next"
msgstr "Následující"
#. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm
#: ../js/gdm/loginDialog.js:934
#: ../js/gdm/loginDialog.js:630
#, c-format
msgid "(e.g., user or %s)"
msgstr "(např. uživatel nebo %s)"
@@ -405,12 +409,12 @@ msgstr "(např. uživatel nebo %s)"
#. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one)
#: ../js/gdm/loginDialog.js:938 ../js/ui/components/networkAgent.js:260
#: ../js/gdm/loginDialog.js:635 ../js/ui/components/networkAgent.js:260
#: ../js/ui/components/networkAgent.js:278
msgid "Username: "
msgstr "Uživatelské jméno: "
#: ../js/gdm/loginDialog.js:1205
#: ../js/gdm/loginDialog.js:886
msgid "Login Window"
msgstr "Přihlašovací okno"
@@ -419,8 +423,7 @@ msgstr "Přihlašovací okno"
msgid "Power"
msgstr "Vypnout"
#: ../js/gdm/powerMenu.js:93 ../js/ui/userMenu.js:651 ../js/ui/userMenu.js:655
#: ../js/ui/userMenu.js:768
#: ../js/gdm/powerMenu.js:93
msgid "Suspend"
msgstr "Uspat do paměti"
@@ -428,18 +431,18 @@ msgstr "Uspat do paměti"
msgid "Restart"
msgstr "Restartovat"
#: ../js/gdm/powerMenu.js:103 ../js/ui/userMenu.js:653
#: ../js/ui/userMenu.js:655 ../js/ui/userMenu.js:767 ../js/ui/userMenu.js:888
#: ../js/gdm/powerMenu.js:103 ../js/ui/status/system.js:215
#: ../js/ui/status/system.js:309
msgid "Power Off"
msgstr "Vypnout"
#: ../js/gdm/util.js:248
#: ../js/gdm/util.js:251
msgid "Authentication error"
msgstr "Chyba ověření"
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: ../js/gdm/util.js:365
#: ../js/gdm/util.js:369
msgid "(or swipe finger)"
msgstr "(nebo otiskněte prst)"
@@ -458,23 +461,23 @@ msgstr "Nelze analyzovat příkaz:"
msgid "Execution of '%s' failed:"
msgstr "Vykonání „%s“ selhalo:"
#: ../js/ui/appDisplay.js:397
#: ../js/ui/appDisplay.js:386
msgid "Frequent"
msgstr "Časté"
#: ../js/ui/appDisplay.js:404
#: ../js/ui/appDisplay.js:393
msgid "All"
msgstr "Všechny"
#: ../js/ui/appDisplay.js:996
#: ../js/ui/appDisplay.js:986
msgid "New Window"
msgstr "Nové okno"
#: ../js/ui/appDisplay.js:999 ../js/ui/dash.js:284
#: ../js/ui/appDisplay.js:989 ../js/ui/dash.js:284
msgid "Remove from Favorites"
msgstr "Odstranit z oblíbených"
#: ../js/ui/appDisplay.js:1000
#: ../js/ui/appDisplay.js:990
msgid "Add to Favorites"
msgstr "Přidat mezi oblíbené"
@@ -488,7 +491,7 @@ msgstr "%s byl přidán mezi oblíbené."
msgid "%s has been removed from your favorites."
msgstr "%s byl odstraněn z oblíbených."
#: ../js/ui/backgroundMenu.js:19 ../js/ui/userMenu.js:744
#: ../js/ui/backgroundMenu.js:19 ../js/ui/status/system.js:207
msgid "Settings"
msgstr "Nastavení"
@@ -1152,7 +1155,6 @@ msgid "Download and install '%s' from extensions.gnome.org?"
msgstr "Stáhnout a nainstalovat „%s“ z extensions.gnome.org?"
#: ../js/ui/keyboard.js:619 ../js/ui/status/keyboard.js:333
#: ../js/ui/status/power.js:211
msgid "Keyboard"
msgstr "Klávesnice"
@@ -1204,35 +1206,35 @@ msgstr "Zobrazit zdroj"
msgid "Web Page"
msgstr "Webová stránka"
#: ../js/ui/messageTray.js:1182
#: ../js/ui/messageTray.js:1241
msgid "Open"
msgstr "Otevřít"
#: ../js/ui/messageTray.js:1189
#: ../js/ui/messageTray.js:1248
msgid "Remove"
msgstr "Odstranit"
#: ../js/ui/messageTray.js:1501
#: ../js/ui/messageTray.js:1564
msgid "Clear Messages"
msgstr "Vymazat zprávy"
#: ../js/ui/messageTray.js:1528
#: ../js/ui/messageTray.js:1591
msgid "Notification Settings"
msgstr "Nastavení upozornění"
#: ../js/ui/messageTray.js:1711
#: ../js/ui/messageTray.js:1774
msgid "No Messages"
msgstr "Žádné zprávy"
#: ../js/ui/messageTray.js:1784
#: ../js/ui/messageTray.js:1846
msgid "Message Tray"
msgstr "Lišta zpráv"
#: ../js/ui/messageTray.js:2811
#: ../js/ui/messageTray.js:2852
msgid "System Information"
msgstr "Informace o systému"
#: ../js/ui/notificationDaemon.js:629 ../src/shell-app.c:378
#: ../js/ui/notificationDaemon.js:629 ../src/shell-app.c:396
msgctxt "program"
msgid "Unknown"
msgstr "Neznámé"
@@ -1261,17 +1263,17 @@ msgstr "Přehled"
msgid "Type to search…"
msgstr "Vyhledávejte psaním…"
#: ../js/ui/panel.js:567
#: ../js/ui/panel.js:568
msgid "Quit"
msgstr "Ukončit"
#. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:618
#: ../js/ui/panel.js:619
msgid "Activities"
msgstr "Činnosti"
#: ../js/ui/panel.js:914
#: ../js/ui/panel.js:915
msgid "Top Bar"
msgstr "Horní lišta"
@@ -1280,7 +1282,7 @@ msgstr "Horní lišta"
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle
#. switches containing "◯" and "|"). Other values will
#. simply result in invisible toggle switches.
#: ../js/ui/popupMenu.js:549
#: ../js/ui/popupMenu.js:488
msgid "toggle-switch-us"
msgstr "toggle-switch-intl"
@@ -1306,7 +1308,7 @@ msgstr[0] "%d nové upozornění"
msgstr[1] "%d nová upozornění"
msgstr[2] "%d nových upozornění"
#: ../js/ui/screenShield.js:449 ../js/ui/userMenu.js:759
#: ../js/ui/screenShield.js:449 ../js/ui/status/system.js:211
msgid "Lock"
msgstr "Uzamknout"
@@ -1321,11 +1323,11 @@ msgstr "GNOME potřebuje uzamknout obrazovku"
#.
#. XXX: another option is to kick the user into the gdm login
#. screen, where we're not affected by grabs
#: ../js/ui/screenShield.js:775 ../js/ui/screenShield.js:1215
#: ../js/ui/screenShield.js:788 ../js/ui/screenShield.js:1216
msgid "Unable to lock"
msgstr "Nelze uzamknout obrazovku"
#: ../js/ui/screenShield.js:776 ../js/ui/screenShield.js:1216
#: ../js/ui/screenShield.js:789 ../js/ui/screenShield.js:1217
msgid "Lock was blocked by an application"
msgstr "Zamknutí bylo zablokováno některou z aplikací"
@@ -1361,10 +1363,6 @@ msgstr "Heslo"
msgid "Remember Password"
msgstr "Pamatovat si heslo"
#: ../js/ui/shellMountOperation.js:403 ../js/ui/unlockDialog.js:108
msgid "Unlock"
msgstr "Odemknout"
#: ../js/ui/status/accessibility.js:36
msgid "Accessibility"
msgstr "Zpřístupnění"
@@ -1401,142 +1399,107 @@ msgstr "Vícenásobné stisky kláves"
msgid "Mouse Keys"
msgstr "Myš klávesnicí"
#: ../js/ui/status/accessibility.js:72
msgid "Universal Access Settings"
msgstr "Nastavení zpřístupnění"
#: ../js/ui/status/accessibility.js:129
#: ../js/ui/status/accessibility.js:126
msgid "High Contrast"
msgstr "Vysoký kontrast"
#: ../js/ui/status/accessibility.js:178
#: ../js/ui/status/accessibility.js:175
msgid "Large Text"
msgstr "Styl velkého textu"
#: ../js/ui/status/bluetooth.js:28 ../js/ui/status/bluetooth.js:32
#: ../js/ui/status/bluetooth.js:290 ../js/ui/status/bluetooth.js:327
#: ../js/ui/status/bluetooth.js:355 ../js/ui/status/bluetooth.js:391
#: ../js/ui/status/bluetooth.js:422 ../js/ui/status/network.js:713
#. The Bluetooth menu only appears when Bluetooth is in use,
#. so just statically build it with a "Turn Off" menu item.
#: ../js/ui/status/bluetooth.js:21 ../js/ui/status/bluetooth.js:25
#: ../js/ui/status/bluetooth.js:59 ../js/ui/status/bluetooth.js:96
#: ../js/ui/status/bluetooth.js:124 ../js/ui/status/bluetooth.js:160
#: ../js/ui/status/bluetooth.js:191 ../js/ui/status/network.js:713
msgid "Bluetooth"
msgstr "Bluetooth"
#: ../js/ui/status/bluetooth.js:45
msgid "Visibility"
msgstr "Viditelnost"
#: ../js/ui/status/bluetooth.js:27
msgid "Turn Off"
msgstr "Vypnout"
#: ../js/ui/status/bluetooth.js:59
msgid "Send Files to Device…"
msgstr "Odeslat soubory do zařízení…"
#: ../js/ui/status/bluetooth.js:60
msgid "Set Up a New Device…"
msgstr "Nastavit nové zařízení…"
#: ../js/ui/status/bluetooth.js:84
#: ../js/ui/status/bluetooth.js:30
#| msgid "Bluetooth"
msgid "Bluetooth Settings"
msgstr "Nastavit Bluetooth"
msgstr "Nastavení Bluetooth"
#. TRANSLATORS: this means that bluetooth was disabled by hardware rfkill
#: ../js/ui/status/bluetooth.js:105 ../js/ui/status/network.js:140
msgid "hardware disabled"
msgstr "zařízení zakázáno"
#: ../js/ui/status/bluetooth.js:54
#, c-format
msgid "%d Connected Device"
msgid_plural "%d Connected Devices"
msgstr[0] "%d připojené zařízení"
msgstr[1] "%d připojená zařízení"
msgstr[2] "%d připojených zařízení"
#: ../js/ui/status/bluetooth.js:198
msgid "Connection"
msgstr "Připojení"
#: ../js/ui/status/bluetooth.js:209 ../js/ui/status/network.js:399
msgid "disconnecting..."
msgstr "odpojování…"
#: ../js/ui/status/bluetooth.js:222 ../js/ui/status/network.js:405
#: ../js/ui/status/network.js:1298
msgid "connecting..."
msgstr "připojování…"
#: ../js/ui/status/bluetooth.js:240
msgid "Send Files…"
msgstr "Odeslat soubory…"
#: ../js/ui/status/bluetooth.js:247
msgid "Keyboard Settings"
msgstr "Nastavení klávesnice"
#: ../js/ui/status/bluetooth.js:250
msgid "Mouse Settings"
msgstr "Nastavení myši"
#: ../js/ui/status/bluetooth.js:255 ../js/ui/status/volume.js:313
msgid "Sound Settings"
msgstr "Nastavení zvuku"
#: ../js/ui/status/bluetooth.js:328 ../js/ui/status/bluetooth.js:356
#: ../js/ui/status/bluetooth.js:97 ../js/ui/status/bluetooth.js:125
#, c-format
msgid "Authorization request from %s"
msgstr "Požadavek na autorizaci od %s"
#: ../js/ui/status/bluetooth.js:334 ../js/ui/status/bluetooth.js:399
#: ../js/ui/status/bluetooth.js:430
#: ../js/ui/status/bluetooth.js:103 ../js/ui/status/bluetooth.js:168
#: ../js/ui/status/bluetooth.js:199
#, c-format
msgid "Device %s wants to pair with this computer"
msgstr "Zařízení %s se chce spárovat s tímto počítačem"
#: ../js/ui/status/bluetooth.js:336
#: ../js/ui/status/bluetooth.js:105
msgid "Allow"
msgstr "Povolit"
#: ../js/ui/status/bluetooth.js:337
#: ../js/ui/status/bluetooth.js:106
msgid "Deny"
msgstr "Zamítnout"
#: ../js/ui/status/bluetooth.js:362
#: ../js/ui/status/bluetooth.js:131
#, c-format
msgid "Device %s wants access to the service '%s'"
msgstr "Zařízení %s požaduje přístup ke službě „%s“"
#: ../js/ui/status/bluetooth.js:364
#: ../js/ui/status/bluetooth.js:133
msgid "Always grant access"
msgstr "Vždy udělovat přístup"
#: ../js/ui/status/bluetooth.js:365
#: ../js/ui/status/bluetooth.js:134
msgid "Grant this time only"
msgstr "Udělit pouze tentokrát"
#: ../js/ui/status/bluetooth.js:366
#: ../js/ui/status/bluetooth.js:135
msgid "Reject"
msgstr "Odmítnout"
#. Translators: argument is the device short name
#: ../js/ui/status/bluetooth.js:393
#: ../js/ui/status/bluetooth.js:162
#, c-format
msgid "Pairing confirmation for %s"
msgstr "Potvrzení spárování pro %s"
#: ../js/ui/status/bluetooth.js:400
#: ../js/ui/status/bluetooth.js:169
#, c-format
msgid ""
"Please confirm whether the Passkey '%06d' matches the one on the device."
msgstr "Ověřte prosím, zda klíč „%06d“ odpovídá tomu na zařízení."
#. Translators: this is the verb, not the noun
#: ../js/ui/status/bluetooth.js:403
#: ../js/ui/status/bluetooth.js:172
msgid "Matches"
msgstr "Souhlasí"
#: ../js/ui/status/bluetooth.js:404
#: ../js/ui/status/bluetooth.js:173
msgid "Does not match"
msgstr "Nesouhlasí"
#: ../js/ui/status/bluetooth.js:423
#: ../js/ui/status/bluetooth.js:192
#, c-format
msgid "Pairing request for %s"
msgstr "Požadavek na spárování pro %s"
#: ../js/ui/status/bluetooth.js:431
#: ../js/ui/status/bluetooth.js:200
msgid "Please enter the PIN mentioned on the device."
msgstr "Zadejte prosím PIN, který je uveden na zařízení."
#: ../js/ui/status/bluetooth.js:448
#: ../js/ui/status/bluetooth.js:217
msgid "OK"
msgstr "Budiž"
@@ -1544,10 +1507,6 @@ msgstr "Budiž"
msgid "Show Keyboard Layout"
msgstr "Zobrazit rozložení klávesnice"
#: ../js/ui/status/keyboard.js:401
msgid "Region & Language Settings"
msgstr "Místní a jazyková nastavení"
#: ../js/ui/status/lockScreenMenu.js:43
msgid "Volume, network, battery"
msgstr "Hlasitost, síť, baterie"
@@ -1560,6 +1519,10 @@ msgstr "<neznámé>"
msgid "Wi-Fi"
msgstr "Wi-Fi"
#: ../js/ui/status/network.js:140
msgid "hardware disabled"
msgstr "zařízení zakázáno"
#. Translators: this indicates that wireless or wwan is disabled by hardware killswitch
#: ../js/ui/status/network.js:162
msgid "disabled"
@@ -1571,6 +1534,14 @@ msgstr "zakázáno"
msgid "unmanaged"
msgstr "nespravováno"
#: ../js/ui/status/network.js:399
msgid "disconnecting..."
msgstr "odpojování…"
#: ../js/ui/status/network.js:405 ../js/ui/status/network.js:1298
msgid "connecting..."
msgstr "připojování…"
#. Translators: this is for network connections that require some kind of key or password
#: ../js/ui/status/network.js:408 ../js/ui/status/network.js:1301
msgid "authentication required"
@@ -1614,220 +1585,97 @@ msgstr "Mobilní širokopásmová"
msgid "Enable networking"
msgstr "Povolit síť"
#: ../js/ui/status/network.js:1522
msgid "Network Settings"
msgstr "Nastavení sítě"
#: ../js/ui/status/network.js:1539
#: ../js/ui/status/network.js:1537
msgid "Network Manager"
msgstr "Network Manager"
#: ../js/ui/status/network.js:1623
#: ../js/ui/status/network.js:1621
msgid "Connection failed"
msgstr "Připojení selhalo"
#: ../js/ui/status/network.js:1624
#: ../js/ui/status/network.js:1622
msgid "Activation of network connection failed"
msgstr "Aktivace síťového připojení selhala"
#: ../js/ui/status/network.js:1937
#: ../js/ui/status/network.js:1936
msgid "Networking is disabled"
msgstr "Síť je zakázána"
#: ../js/ui/status/power.js:55
#: ../js/ui/status/power.js:31 ../js/ui/status/power.js:44
msgid "Battery"
msgstr "Baterie"
#: ../js/ui/status/power.js:81
#: ../js/ui/status/power.js:45
msgid "Power Settings"
msgstr "Nastavení napájení"
#: ../js/ui/status/power.js:61
msgid "Fully Charged"
msgstr "Plně nabito"
#. 0 is reported when UPower does not have enough data
#. to estimate battery life
#: ../js/ui/status/power.js:99
#. state is one of PENDING_CHARGING, PENDING_DISCHARGING
#: ../js/ui/status/power.js:67 ../js/ui/status/power.js:84
msgid "Estimating…"
msgstr "Odhaduje se…"
#: ../js/ui/status/power.js:106
#. Translators: this is <hours>:<minutes> Remaining (<percentage>)
#: ../js/ui/status/power.js:75
#, c-format
msgid "%d hour remaining"
msgid_plural "%d hours remaining"
msgstr[0] "Zbývá %d hodina"
msgstr[1] "Zbývají %d hodiny"
msgstr[2] "Zbývá %d hodin"
msgid "%d\\u2236%d Remaining (%d%%)"
msgstr "Zbývá %d\\u2236%d (%d%%)"
#. TRANSLATORS: this is a time string, as in "%d hours %d minutes remaining"
#: ../js/ui/status/power.js:109
#. Translators: this is <hours>:<minutes> Until Full (<percentage>)
#: ../js/ui/status/power.js:80
#, c-format
msgid "%d %s %d %s remaining"
msgstr "Zbývá %d %s %d %s"
msgid "%d\\u2236%d Until Full (%d%%)"
msgstr "%d\\u2236%d do nabití (%d%%)"
#: ../js/ui/status/power.js:111
msgid "hour"
msgid_plural "hours"
msgstr[0] "hodina"
msgstr[1] "hodiny"
msgstr[2] "hodin"
#: ../js/ui/status/power.js:111
msgid "minute"
msgid_plural "minutes"
msgstr[0] "minuta"
msgstr[1] "minuty"
msgstr[2] "minut"
#: ../js/ui/status/power.js:114
#, c-format
msgid "%d minute remaining"
msgid_plural "%d minutes remaining"
msgstr[0] "zbývá %d minuta"
msgstr[1] "zbývají %d minuty"
msgstr[2] "zbývá %d minut"
#: ../js/ui/status/power.js:117 ../js/ui/status/power.js:191
#, c-format
msgctxt "percent of battery remaining"
msgid "%d%%"
msgstr "%d%%"
#: ../js/ui/status/power.js:201
msgid "AC Adapter"
msgstr "Napájecí adaptér"
#: ../js/ui/status/power.js:203
msgid "Laptop Battery"
msgstr "Baterie notebooku"
#: ../js/ui/status/power.js:205
msgid "UPS"
msgstr "Záložní zdroj"
#: ../js/ui/status/power.js:207
msgid "Monitor"
msgstr "Monitor"
#: ../js/ui/status/power.js:209
msgid "Mouse"
msgstr "Myš"
#: ../js/ui/status/power.js:213
msgid "PDA"
msgstr "PDA"
#: ../js/ui/status/power.js:215
msgid "Cell Phone"
msgstr "Mobilní telefon"
#: ../js/ui/status/power.js:217
msgid "Media Player"
msgstr "Multimediální přehrávač"
#: ../js/ui/status/power.js:219
msgid "Tablet"
msgstr "Tablet"
#: ../js/ui/status/power.js:221
msgid "Computer"
msgstr "Počítač"
#: ../js/ui/status/power.js:223
msgctxt "device"
msgid "Unknown"
msgstr "Neznámé"
#: ../js/ui/status/volume.js:121
msgid "Volume changed"
msgstr "Hlasitost změněna"
#. Translators: This is the label for audio volume
#: ../js/ui/status/volume.js:246 ../js/ui/status/volume.js:294
msgid "Volume"
msgstr "Hlasitost"
#: ../js/ui/status/volume.js:255
msgid "Microphone"
msgstr "Mikrofon"
#: ../js/ui/unlockDialog.js:119
msgid "Log in as another user"
msgstr "Přihlásit se jako jiný uživatel"
#: ../js/ui/unlockDialog.js:140
msgid "Unlock Window"
msgstr "Odemykací okno"
#: ../js/ui/userMenu.js:149
msgid "Available"
msgstr "Přítomen"
#: ../js/ui/userMenu.js:152
msgid "Busy"
msgstr "Zaneprázdněn"
#: ../js/ui/userMenu.js:155
msgid "Invisible"
msgstr "Neviditelný"
#: ../js/ui/userMenu.js:158
msgid "Away"
msgstr "Nepřítomen"
#: ../js/ui/userMenu.js:161
msgid "Idle"
msgstr "Nečinný"
#: ../js/ui/userMenu.js:164
msgid "Offline"
msgstr "Odpojen"
#: ../js/ui/userMenu.js:736
msgid "Notifications"
msgstr "Upozornění"
#: ../js/ui/userMenu.js:749
#: ../js/ui/status/system.js:188
msgid "Switch User"
msgstr "Přepnout uživatele"
#: ../js/ui/userMenu.js:754
#: ../js/ui/status/system.js:193
msgid "Log Out"
msgstr "Odhlásit se"
#: ../js/ui/userMenu.js:774
msgid "Install Updates & Restart"
msgstr "Nainstalovat aktualizace a restartovat"
#: ../js/ui/userMenu.js:792
msgid "Your chat status will be set to busy"
msgstr "Váš stav v konverzacích byl nastaven na „Zaneprázdněn“"
#: ../js/ui/userMenu.js:793
msgid ""
"Notifications are now disabled, including chat messages. Your online status "
"has been adjusted to let others know that you might not see their messages."
msgstr ""
"Upozornění jsou nyní vypnuta, včetně zpráv v konverzacích. Váš stav on-line "
"byl změněn tak, aby ostatní věděli, že si jejich zprávy nemusíte přečíst."
#: ../js/ui/userMenu.js:834
#: ../js/ui/status/system.js:255
msgid "Other users are logged in."
msgstr "Jsou přihlášeni jiní uživatelé."
#: ../js/ui/userMenu.js:839
#: ../js/ui/status/system.js:260
msgid "Shutting down might cause them to lose unsaved work."
msgstr "Vypnutí by mohlo způsobit ztrátu jejich neuložené práce."
#. Translators: Remote here refers to a remote session, like a ssh login
#: ../js/ui/userMenu.js:867
#: ../js/ui/status/system.js:288
#, c-format
msgid "%s (remote)"
msgstr "%s (vzdálený)"
#. Translators: Console here refers to a tty like a VT console
#: ../js/ui/userMenu.js:870
#: ../js/ui/status/system.js:291
#, c-format
msgid "%s (console)"
msgstr "%s (konzole)"
#: ../js/ui/status/volume.js:126
msgid "Volume changed"
msgstr "Hlasitost změněna"
#: ../js/ui/status/volume.js:302
msgid "Volume"
msgstr "Hlasitost"
#: ../js/ui/unlockDialog.js:63
msgid "Log in as another user"
msgstr "Přihlásit se jako jiný uživatel"
#: ../js/ui/unlockDialog.js:80
msgid "Unlock Window"
msgstr "Odemykací okno"
#: ../js/ui/viewSelector.js:100
msgid "Applications"
msgstr "Aplikace"
@@ -1899,7 +1747,7 @@ msgstr "Použít pro přihlašovací obrazovku určitý mód, např. „gdm“."
msgid "List possible modes"
msgstr "Vypsat možné režimy"
#: ../src/shell-app.c:626
#: ../src/shell-app.c:644
#, c-format
msgid "Failed to launch '%s'"
msgstr "Nelze spustit „%s“"
@@ -1914,4 +1762,4 @@ msgstr "Heslo nemůže být prázdné."
#: ../src/shell-polkit-authentication-agent.c:343
msgid "Authentication dialog was dismissed by the user"
msgstr "Dialogové okno ověření bylo uživatelem zrušeno"
msgstr "Dialogové okno ověření bylo uživatelem zrušeno"

521
po/de.po
View File

@@ -13,14 +13,15 @@
# Wolfgang Stöggl <c72578@yahoo.de>, 2012.
# Tobias Endrigkeit <tobiasendrigkeit@googlemail.com>, 2012, 2013.
# Christian Kirbach <christian.kirbach@gmail.com>, 2009, 2010, 2011, 2012, 2013.
# Benjamin Steinwender <b@stbe.at>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: gnome-shell master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2013-07-04 13:18+0000\n"
"PO-Revision-Date: 2013-07-02 06:35+0100\n"
"POT-Creation-Date: 2013-07-24 18:16+0000\n"
"PO-Revision-Date: 2013-07-23 19:42+0100\n"
"Last-Translator: Benjamin Steinwender <b@stbe.at>\n"
"Language-Team: Deutsch <gnome-de@gnome.org>\n"
"Language: de_DE\n"
@@ -28,7 +29,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.5.5\n"
"X-Generator: Poedit 1.5.7\n"
#: ../data/50-gnome-shell-screenshot.xml.in.h:1
msgid "Screenshots"
@@ -38,7 +39,7 @@ msgstr "Bildschirmfotos"
msgid "Record a screencast"
msgstr "Eine Bildschirmaufzeichnung erstellen"
#: ../data/50-gnome-shell-system.xml.in.h:1
#: ../data/50-gnome-shell-system.xml.in.h:1 ../js/ui/status/system.js:48
msgid "System"
msgstr "System"
@@ -387,41 +388,45 @@ msgstr "Erweiterung"
msgid "Select an extension to configure using the combobox above."
msgstr "Wählen Sie oben eine Erweiterung aus, die Sie konfigurieren wollen."
#: ../js/gdm/loginDialog.js:308
#: ../js/gdm/authPrompt.js:132 ../js/ui/components/networkAgent.js:137
#: ../js/ui/components/polkitAgent.js:161 ../js/ui/endSessionDialog.js:376
#: ../js/ui/extensionDownloader.js:195 ../js/ui/shellMountOperation.js:399
#: ../js/ui/status/bluetooth.js:431 ../js/ui/status/system.js:305
msgid "Cancel"
msgstr "Abbrechen"
#: ../js/gdm/authPrompt.js:154 ../js/gdm/authPrompt.js:206
msgid "Next"
msgstr "Nächstes"
#: ../js/gdm/authPrompt.js:202 ../js/ui/shellMountOperation.js:403
#: ../js/ui/unlockDialog.js:55
msgid "Unlock"
msgstr "Entsperren"
#: ../js/gdm/authPrompt.js:204
msgctxt "button"
msgid "Sign In"
msgstr "Anmelden"
#: ../js/gdm/loginDialog.js:299
msgid "Choose Session"
msgstr "Sitzung wählen"
#: ../js/gdm/loginDialog.js:326
#: ../js/gdm/loginDialog.js:317
msgid "Session"
msgstr "Sitzung"
#. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: ../js/gdm/loginDialog.js:528
#: ../js/gdm/loginDialog.js:468
msgid "Not listed?"
msgstr "Nicht aufgeführt?"
#: ../js/gdm/loginDialog.js:810 ../js/ui/components/networkAgent.js:137
#: ../js/ui/components/polkitAgent.js:161 ../js/ui/endSessionDialog.js:376
#: ../js/ui/extensionDownloader.js:195 ../js/ui/shellMountOperation.js:399
#: ../js/ui/status/bluetooth.js:449 ../js/ui/unlockDialog.js:95
#: ../js/ui/userMenu.js:884
msgid "Cancel"
msgstr "Abbrechen"
#: ../js/gdm/loginDialog.js:833
msgctxt "button"
msgid "Sign In"
msgstr "Anmelden"
#: ../js/gdm/loginDialog.js:833
msgid "Next"
msgstr "Nächstes"
#. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm
#: ../js/gdm/loginDialog.js:934
#: ../js/gdm/loginDialog.js:630
#, c-format
msgid "(e.g., user or %s)"
msgstr "(z.B. Benutzer oder %s)"
@@ -429,12 +434,12 @@ msgstr "(z.B. Benutzer oder %s)"
#. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one)
#: ../js/gdm/loginDialog.js:938 ../js/ui/components/networkAgent.js:260
#: ../js/gdm/loginDialog.js:635 ../js/ui/components/networkAgent.js:260
#: ../js/ui/components/networkAgent.js:278
msgid "Username: "
msgstr "Benutzername:"
#: ../js/gdm/loginDialog.js:1205
#: ../js/gdm/loginDialog.js:886
msgid "Login Window"
msgstr "Anmeldefenster"
@@ -443,8 +448,7 @@ msgstr "Anmeldefenster"
msgid "Power"
msgstr "Ausschalten"
#: ../js/gdm/powerMenu.js:93 ../js/ui/userMenu.js:651 ../js/ui/userMenu.js:655
#: ../js/ui/userMenu.js:768
#: ../js/gdm/powerMenu.js:93
msgid "Suspend"
msgstr "Bereitschaft"
@@ -452,18 +456,18 @@ msgstr "Bereitschaft"
msgid "Restart"
msgstr "Neu starten"
#: ../js/gdm/powerMenu.js:103 ../js/ui/userMenu.js:653
#: ../js/ui/userMenu.js:655 ../js/ui/userMenu.js:767 ../js/ui/userMenu.js:888
#: ../js/gdm/powerMenu.js:103 ../js/ui/status/system.js:215
#: ../js/ui/status/system.js:309
msgid "Power Off"
msgstr "Ausschalten"
#: ../js/gdm/util.js:248
#: ../js/gdm/util.js:249
msgid "Authentication error"
msgstr "Legitimationsfehler"
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: ../js/gdm/util.js:365
#: ../js/gdm/util.js:366
msgid "(or swipe finger)"
msgstr "(oder benutzen Sie den Fingerabdruckleser)"
@@ -482,23 +486,23 @@ msgstr "Befehl konnte nicht verarbeitet werden:"
msgid "Execution of '%s' failed:"
msgstr "Ausführung von »%s« ist gescheitert:"
#: ../js/ui/appDisplay.js:397
#: ../js/ui/appDisplay.js:386
msgid "Frequent"
msgstr "Häufig"
#: ../js/ui/appDisplay.js:404
#: ../js/ui/appDisplay.js:393
msgid "All"
msgstr "Alle"
#: ../js/ui/appDisplay.js:996
#: ../js/ui/appDisplay.js:986
msgid "New Window"
msgstr "Neues Fenster"
#: ../js/ui/appDisplay.js:999 ../js/ui/dash.js:284
#: ../js/ui/appDisplay.js:989 ../js/ui/dash.js:284
msgid "Remove from Favorites"
msgstr "Aus Favoriten entfernen"
#: ../js/ui/appDisplay.js:1000
#: ../js/ui/appDisplay.js:990
msgid "Add to Favorites"
msgstr "Zu Favoriten hinzufügen"
@@ -512,7 +516,7 @@ msgstr "%s wurde zu Ihren Favoriten hinzugefügt"
msgid "%s has been removed from your favorites."
msgstr "%s wurde aus Ihren Favoriten entfernt"
#: ../js/ui/backgroundMenu.js:19 ../js/ui/userMenu.js:744
#: ../js/ui/backgroundMenu.js:19 ../js/ui/status/system.js:207
msgid "Settings"
msgstr "Einstellungen"
@@ -1184,7 +1188,6 @@ msgid "Download and install '%s' from extensions.gnome.org?"
msgstr "»%s« von extensions.gnome.org herunterladen und installieren?"
#: ../js/ui/keyboard.js:619 ../js/ui/status/keyboard.js:333
#: ../js/ui/status/power.js:211
msgid "Keyboard"
msgstr "Tastatur"
@@ -1236,35 +1239,35 @@ msgstr "Quelle zeigen"
msgid "Web Page"
msgstr "Webseite"
#: ../js/ui/messageTray.js:1182
#: ../js/ui/messageTray.js:1241
msgid "Open"
msgstr "Öffnen"
#: ../js/ui/messageTray.js:1189
#: ../js/ui/messageTray.js:1248
msgid "Remove"
msgstr "Entfernen"
#: ../js/ui/messageTray.js:1501
#: ../js/ui/messageTray.js:1564
msgid "Clear Messages"
msgstr "Nachrichten leeren"
#: ../js/ui/messageTray.js:1528
#: ../js/ui/messageTray.js:1591
msgid "Notification Settings"
msgstr "Benachrichtigungseinstellungen"
#: ../js/ui/messageTray.js:1711
#: ../js/ui/messageTray.js:1774
msgid "No Messages"
msgstr "Keine Nachrichten"
#: ../js/ui/messageTray.js:1784
#: ../js/ui/messageTray.js:1846
msgid "Message Tray"
msgstr "Benachrichtigungsfeld"
#: ../js/ui/messageTray.js:2811
#: ../js/ui/messageTray.js:2852
msgid "System Information"
msgstr "Systeminformationen"
#: ../js/ui/notificationDaemon.js:629 ../src/shell-app.c:378
#: ../js/ui/notificationDaemon.js:629 ../src/shell-app.c:396
msgctxt "program"
msgid "Unknown"
msgstr "Unbekannt"
@@ -1292,17 +1295,17 @@ msgstr "Übersicht"
msgid "Type to search…"
msgstr "Suchbegriff eingeben …"
#: ../js/ui/panel.js:567
#: ../js/ui/panel.js:568
msgid "Quit"
msgstr "Beenden"
#. Translators: If there is no suitable word for "Activities"
#. in your language, you can use the word for "Overview".
#: ../js/ui/panel.js:618
#: ../js/ui/panel.js:619
msgid "Activities"
msgstr "Aktivitäten"
#: ../js/ui/panel.js:914
#: ../js/ui/panel.js:915
msgid "Top Bar"
msgstr "Oberes Panel"
@@ -1311,7 +1314,7 @@ msgstr "Oberes Panel"
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle
#. switches containing "◯" and "|"). Other values will
#. simply result in invisible toggle switches.
#: ../js/ui/popupMenu.js:549
#: ../js/ui/popupMenu.js:488
msgid "toggle-switch-us"
msgstr "toggle-switch-intl"
@@ -1339,7 +1342,7 @@ msgid_plural "%d new notifications"
msgstr[0] "%d neue Benachrichtigung"
msgstr[1] "%d neue Benachrichtigungen"
#: ../js/ui/screenShield.js:449 ../js/ui/userMenu.js:759
#: ../js/ui/screenShield.js:449 ../js/ui/status/system.js:211
msgid "Lock"
msgstr "Sperren"
@@ -1354,11 +1357,11 @@ msgstr "GNOME muss den Bildschirm sperren"
#.
#. XXX: another option is to kick the user into the gdm login
#. screen, where we're not affected by grabs
#: ../js/ui/screenShield.js:788 ../js/ui/screenShield.js:1215
#: ../js/ui/screenShield.js:788 ../js/ui/screenShield.js:1216
msgid "Unable to lock"
msgstr "Sperrung fehlgeschlagen"
#: ../js/ui/screenShield.js:789 ../js/ui/screenShield.js:1216
#: ../js/ui/screenShield.js:789 ../js/ui/screenShield.js:1217
msgid "Lock was blocked by an application"
msgstr "Sperrung wurde von einer Anwendung blockiert"
@@ -1394,10 +1397,6 @@ msgstr "Passwort"
msgid "Remember Password"
msgstr "An Passwort erinnern"
#: ../js/ui/shellMountOperation.js:403 ../js/ui/unlockDialog.js:108
msgid "Unlock"
msgstr "Entsperren"
#: ../js/ui/status/accessibility.js:36
msgid "Accessibility"
msgstr "Barrierefreiheit"
@@ -1434,22 +1433,18 @@ msgstr "Springende Tasten"
msgid "Mouse Keys"
msgstr "Tastaturmaus"
#: ../js/ui/status/accessibility.js:72
msgid "Universal Access Settings"
msgstr "Einstellungen zur Barrierefreiheit"
#: ../js/ui/status/accessibility.js:129
#: ../js/ui/status/accessibility.js:126
msgid "High Contrast"
msgstr "Hoher Kontrast"
#: ../js/ui/status/accessibility.js:178
#: ../js/ui/status/accessibility.js:175
msgid "Large Text"
msgstr "Große Schrift"
#: ../js/ui/status/bluetooth.js:28 ../js/ui/status/bluetooth.js:32
#: ../js/ui/status/bluetooth.js:290 ../js/ui/status/bluetooth.js:327
#: ../js/ui/status/bluetooth.js:355 ../js/ui/status/bluetooth.js:391
#: ../js/ui/status/bluetooth.js:422 ../js/ui/status/network.js:713
#: ../js/ui/status/bluetooth.js:272 ../js/ui/status/bluetooth.js:309
#: ../js/ui/status/bluetooth.js:337 ../js/ui/status/bluetooth.js:373
#: ../js/ui/status/bluetooth.js:404 ../js/ui/status/network.js:713
msgid "Bluetooth"
msgstr "Bluetooth"
@@ -1465,87 +1460,71 @@ msgstr "Dateien an Gerät senden …"
msgid "Set Up a New Device…"
msgstr "Ein neues Gerät einrichten …"
#: ../js/ui/status/bluetooth.js:84
msgid "Bluetooth Settings"
msgstr "Bluetooth-Einstellungen"
#. TRANSLATORS: this means that bluetooth was disabled by hardware rfkill
#: ../js/ui/status/bluetooth.js:105 ../js/ui/status/network.js:140
#: ../js/ui/status/bluetooth.js:103 ../js/ui/status/network.js:140
msgid "hardware disabled"
msgstr "Hardware deaktiviert"
#: ../js/ui/status/bluetooth.js:198
#: ../js/ui/status/bluetooth.js:196
msgid "Connection"
msgstr "Verbindung"
#: ../js/ui/status/bluetooth.js:209 ../js/ui/status/network.js:399
#: ../js/ui/status/bluetooth.js:207 ../js/ui/status/network.js:399
msgid "disconnecting..."
msgstr "Verbindungsabbau …"
#: ../js/ui/status/bluetooth.js:222 ../js/ui/status/network.js:405
#: ../js/ui/status/bluetooth.js:220 ../js/ui/status/network.js:405
#: ../js/ui/status/network.js:1298
msgid "connecting..."
msgstr "Verbindungsaufbau …"
#: ../js/ui/status/bluetooth.js:240
#: ../js/ui/status/bluetooth.js:238
msgid "Send Files…"
msgstr "Dateien senden …"
#: ../js/ui/status/bluetooth.js:247
msgid "Keyboard Settings"
msgstr "Tastatureinstellungen"
#: ../js/ui/status/bluetooth.js:250
msgid "Mouse Settings"
msgstr "Maus-Einstellungen"
#: ../js/ui/status/bluetooth.js:255 ../js/ui/status/volume.js:313
msgid "Sound Settings"
msgstr "Klangeinstellungen"
#: ../js/ui/status/bluetooth.js:328 ../js/ui/status/bluetooth.js:356
#: ../js/ui/status/bluetooth.js:310 ../js/ui/status/bluetooth.js:338
#, c-format
msgid "Authorization request from %s"
msgstr "Legitimierungsanfrage von %s"
#: ../js/ui/status/bluetooth.js:334 ../js/ui/status/bluetooth.js:399
#: ../js/ui/status/bluetooth.js:430
#: ../js/ui/status/bluetooth.js:316 ../js/ui/status/bluetooth.js:381
#: ../js/ui/status/bluetooth.js:412
#, c-format
msgid "Device %s wants to pair with this computer"
msgstr "Gerät »%s« möchte mit diesem Rechner gekoppelt werden"
#: ../js/ui/status/bluetooth.js:336
#: ../js/ui/status/bluetooth.js:318
msgid "Allow"
msgstr "Erlauben"
#: ../js/ui/status/bluetooth.js:337
#: ../js/ui/status/bluetooth.js:319
msgid "Deny"
msgstr "Verweigern"
#: ../js/ui/status/bluetooth.js:362
#: ../js/ui/status/bluetooth.js:344
#, c-format
msgid "Device %s wants access to the service '%s'"
msgstr "Gerät »%s« bittet um Zugriff auf den Dienst »%s«"
#: ../js/ui/status/bluetooth.js:364
#: ../js/ui/status/bluetooth.js:346
msgid "Always grant access"
msgstr "Immer Zugriff gewähren"
#: ../js/ui/status/bluetooth.js:365
#: ../js/ui/status/bluetooth.js:347
msgid "Grant this time only"
msgstr "Nur dieses Mal gewähren"
#: ../js/ui/status/bluetooth.js:366
#: ../js/ui/status/bluetooth.js:348
msgid "Reject"
msgstr "Abweisen"
#. Translators: argument is the device short name
#: ../js/ui/status/bluetooth.js:393
#: ../js/ui/status/bluetooth.js:375
#, c-format
msgid "Pairing confirmation for %s"
msgstr "Koppelungsbestätigung für %s"
#: ../js/ui/status/bluetooth.js:400
#: ../js/ui/status/bluetooth.js:382
#, c-format
msgid ""
"Please confirm whether the Passkey '%06d' matches the one on the device."
@@ -1553,24 +1532,24 @@ msgstr ""
"Bitte bestätigen Sie, ob die PIN »%06d« mit der des Gerätes übereinstimmt."
#. Translators: this is the verb, not the noun
#: ../js/ui/status/bluetooth.js:403
#: ../js/ui/status/bluetooth.js:385
msgid "Matches"
msgstr "Stimmt überein"
#: ../js/ui/status/bluetooth.js:404
#: ../js/ui/status/bluetooth.js:386
msgid "Does not match"
msgstr "Stimmt nicht überein"
#: ../js/ui/status/bluetooth.js:423
#: ../js/ui/status/bluetooth.js:405
#, c-format
msgid "Pairing request for %s"
msgstr "Koppelungsanfrage für %s"
#: ../js/ui/status/bluetooth.js:431
#: ../js/ui/status/bluetooth.js:413
msgid "Please enter the PIN mentioned on the device."
msgstr "Bitte geben Sie die auf dem Gerät angezeigte PIN ein."
#: ../js/ui/status/bluetooth.js:448
#: ../js/ui/status/bluetooth.js:430
msgid "OK"
msgstr "OK"
@@ -1578,10 +1557,6 @@ msgstr "OK"
msgid "Show Keyboard Layout"
msgstr "Tastaturbelegung zeigen"
#: ../js/ui/status/keyboard.js:401
msgid "Region & Language Settings"
msgstr "Einstellungen für Region und Sprache"
#: ../js/ui/status/lockScreenMenu.js:43
msgid "Volume, network, battery"
msgstr "Lautstärke, Netzwerk, Batterie"
@@ -1648,217 +1623,97 @@ msgstr "Mobiles Breitband"
msgid "Enable networking"
msgstr "Netzwerk aktivieren"
#: ../js/ui/status/network.js:1522
msgid "Network Settings"
msgstr "Netzwerkeinstellungen"
#: ../js/ui/status/network.js:1539
#: ../js/ui/status/network.js:1537
msgid "Network Manager"
msgstr "Netzwerk-Verwaltung"
#: ../js/ui/status/network.js:1623
#: ../js/ui/status/network.js:1621
msgid "Connection failed"
msgstr "Verbindung gescheitert"
#: ../js/ui/status/network.js:1624
#: ../js/ui/status/network.js:1622
msgid "Activation of network connection failed"
msgstr "Aktivierung der Netzwerkverbindung ist gescheitert"
#: ../js/ui/status/network.js:1938
#: ../js/ui/status/network.js:1936
msgid "Networking is disabled"
msgstr "Netzwerk ist deaktiviert"
#: ../js/ui/status/power.js:55
#: ../js/ui/status/power.js:31 ../js/ui/status/power.js:44
msgid "Battery"
msgstr "Akku"
#: ../js/ui/status/power.js:81
#: ../js/ui/status/power.js:45
msgid "Power Settings"
msgstr "Energieeinstellungen"
#: ../js/ui/status/power.js:61
msgid "Fully Charged"
msgstr "Vollständig geladen"
#. 0 is reported when UPower does not have enough data
#. to estimate battery life
#: ../js/ui/status/power.js:99
#. state is one of PENDING_CHARGING, PENDING_DISCHARGING
#: ../js/ui/status/power.js:67 ../js/ui/status/power.js:84
msgid "Estimating…"
msgstr "Schätzung …"
#: ../js/ui/status/power.js:106
#. Translators: this is <hours>:<minutes> Remaining (<percentage>)
#: ../js/ui/status/power.js:75
#, c-format
msgid "%d hour remaining"
msgid_plural "%d hours remaining"
msgstr[0] "%d Stunde verbleibend"
msgstr[1] "%d Stunden verbleibend"
msgid "%d\\u2236%d Remaining (%d%%)"
msgstr "%d\\u2236%d verbleibend (%d%%)"
#. TRANSLATORS: this is a time string, as in "%d hours %d minutes remaining"
#: ../js/ui/status/power.js:109
#. Translators: this is <hours>:<minutes> Until Full (<percentage>)
#: ../js/ui/status/power.js:80
#, c-format
msgid "%d %s %d %s remaining"
msgstr "%d %s %d %s verbleibend"
msgid "%d\\u2236%d Until Full (%d%%)"
msgstr "%d\\u2236%d bis geladen (%d%%)"
#: ../js/ui/status/power.js:111
msgid "hour"
msgid_plural "hours"
msgstr[0] "Stunde"
msgstr[1] "Stunden"
#: ../js/ui/status/power.js:111
msgid "minute"
msgid_plural "minutes"
msgstr[0] "Minute"
msgstr[1] "Minuten"
#: ../js/ui/status/power.js:114
#, c-format
msgid "%d minute remaining"
msgid_plural "%d minutes remaining"
msgstr[0] "%d Minute verbleibend"
msgstr[1] "%d Minuten verbleibend"
#: ../js/ui/status/power.js:117 ../js/ui/status/power.js:191
#, c-format
msgctxt "percent of battery remaining"
msgid "%d%%"
msgstr "%d%%"
#: ../js/ui/status/power.js:201
msgid "AC Adapter"
msgstr "Netzteil"
#: ../js/ui/status/power.js:203
msgid "Laptop Battery"
msgstr "Laptop-Akku"
#: ../js/ui/status/power.js:205
msgid "UPS"
msgstr "Notstromversorgung"
#: ../js/ui/status/power.js:207
msgid "Monitor"
msgstr "Bildschirm"
#: ../js/ui/status/power.js:209
msgid "Mouse"
msgstr "Maus"
#: ../js/ui/status/power.js:213
msgid "PDA"
msgstr "PDA"
#: ../js/ui/status/power.js:215
msgid "Cell Phone"
msgstr "Mobiltelefon"
#: ../js/ui/status/power.js:217
msgid "Media Player"
msgstr "Medienwiedergabe"
#: ../js/ui/status/power.js:219
msgid "Tablet"
msgstr "Tablet"
#: ../js/ui/status/power.js:221
msgid "Computer"
msgstr "Rechner"
#: ../js/ui/status/power.js:223
msgctxt "device"
msgid "Unknown"
msgstr "Unbekannt"
#: ../js/ui/status/volume.js:121
msgid "Volume changed"
msgstr "Lautstärke geändert"
#. Translators: This is the label for audio volume
#: ../js/ui/status/volume.js:246 ../js/ui/status/volume.js:294
msgid "Volume"
msgstr "Lautstärke"
#: ../js/ui/status/volume.js:255
msgid "Microphone"
msgstr "Mikrofon"
#: ../js/ui/unlockDialog.js:119
msgid "Log in as another user"
msgstr "Als anderer Benutzer anmelden"
#: ../js/ui/unlockDialog.js:140
msgid "Unlock Window"
msgstr "Fenster entsperren"
#: ../js/ui/userMenu.js:149
msgid "Available"
msgstr "Verfügbar"
#: ../js/ui/userMenu.js:152
msgid "Busy"
msgstr "Beschäftigt"
#: ../js/ui/userMenu.js:155
msgid "Invisible"
msgstr "Unsichtbar"
#: ../js/ui/userMenu.js:158
msgid "Away"
msgstr "Abwesend"
#: ../js/ui/userMenu.js:161
msgid "Idle"
msgstr "Untätig"
#: ../js/ui/userMenu.js:164
msgid "Offline"
msgstr "Abgemeldet"
#: ../js/ui/userMenu.js:736
msgid "Notifications"
msgstr "Benachrichtigungen"
#: ../js/ui/userMenu.js:749
#: ../js/ui/status/system.js:188
msgid "Switch User"
msgstr "Benutzer wechseln"
#: ../js/ui/userMenu.js:754
#: ../js/ui/status/system.js:193
msgid "Log Out"
msgstr "Abmelden"
#: ../js/ui/userMenu.js:774
msgid "Install Updates & Restart"
msgstr "Aktualisierungen installieren und neustarten"
#: ../js/ui/userMenu.js:792
msgid "Your chat status will be set to busy"
msgstr "Ihr Anwesenheitsstatus wird auf »Beschäftigt« gesetzt"
#: ../js/ui/userMenu.js:793
msgid ""
"Notifications are now disabled, including chat messages. Your online status "
"has been adjusted to let others know that you might not see their messages."
msgstr ""
"Benachrichtigungen sind nun deaktiviert, einschließlich Sofortnachrichten. "
"Ihr Anwesenheitsstatus wurde nun dahingehend geändert, dass andere darüber "
"informiert werden, dass Sie deren Nachrichten nicht sehen könnten."
#: ../js/ui/userMenu.js:834
#: ../js/ui/status/system.js:255
msgid "Other users are logged in."
msgstr "Andere Benutzer sind angemeldet."
#: ../js/ui/userMenu.js:839
#: ../js/ui/status/system.js:260
msgid "Shutting down might cause them to lose unsaved work."
msgstr "Herunterfahren könnte Datenverlust herbeiführen."
#. Translators: Remote here refers to a remote session, like a ssh login
#: ../js/ui/userMenu.js:867
#: ../js/ui/status/system.js:288
#, c-format
msgid "%s (remote)"
msgstr "%s (Entfernt)"
#. Translators: Console here refers to a tty like a VT console
#: ../js/ui/userMenu.js:870
#: ../js/ui/status/system.js:291
#, c-format
msgid "%s (console)"
msgstr "%s (Konsole)"
#: ../js/ui/status/volume.js:126
msgid "Volume changed"
msgstr "Lautstärke geändert"
#: ../js/ui/status/volume.js:302
msgid "Volume"
msgstr "Lautstärke"
#: ../js/ui/unlockDialog.js:63
msgid "Log in as another user"
msgstr "Als anderer Benutzer anmelden"
#: ../js/ui/unlockDialog.js:80
msgid "Unlock Window"
msgstr "Fenster entsperren"
#: ../js/ui/viewSelector.js:100
msgid "Applications"
msgstr "Anwendungen"
@@ -1929,7 +1784,7 @@ msgstr ""
msgid "List possible modes"
msgstr "Die möglichen Modi auflisten"
#: ../src/shell-app.c:626
#: ../src/shell-app.c:644
#, c-format
msgid "Failed to launch '%s'"
msgstr "»%s« konnte nicht gestartet werden"
@@ -1946,6 +1801,128 @@ msgstr "Das Passwort darf nicht leer sein"
msgid "Authentication dialog was dismissed by the user"
msgstr "Der Dialog zur Legitimierung wurde vom Benutzer geschlossen"
#~ msgid "Universal Access Settings"
#~ msgstr "Einstellungen zur Barrierefreiheit"
#~ msgid "Bluetooth Settings"
#~ msgstr "Bluetooth-Einstellungen"
#~ msgid "Keyboard Settings"
#~ msgstr "Tastatureinstellungen"
#~ msgid "Mouse Settings"
#~ msgstr "Maus-Einstellungen"
#~ msgid "Sound Settings"
#~ msgstr "Klangeinstellungen"
#~ msgid "Region & Language Settings"
#~ msgstr "Einstellungen für Region und Sprache"
#~ msgid "Network Settings"
#~ msgstr "Netzwerkeinstellungen"
#~ msgid "%d hour remaining"
#~ msgid_plural "%d hours remaining"
#~ msgstr[0] "%d Stunde verbleibend"
#~ msgstr[1] "%d Stunden verbleibend"
#~ msgid "%d %s %d %s remaining"
#~ msgstr "%d %s %d %s verbleibend"
#~ msgid "hour"
#~ msgid_plural "hours"
#~ msgstr[0] "Stunde"
#~ msgstr[1] "Stunden"
#~ msgid "minute"
#~ msgid_plural "minutes"
#~ msgstr[0] "Minute"
#~ msgstr[1] "Minuten"
#~ msgid "%d minute remaining"
#~ msgid_plural "%d minutes remaining"
#~ msgstr[0] "%d Minute verbleibend"
#~ msgstr[1] "%d Minuten verbleibend"
#~ msgctxt "percent of battery remaining"
#~ msgid "%d%%"
#~ msgstr "%d%%"
#~ msgid "AC Adapter"
#~ msgstr "Netzteil"
#~ msgid "Laptop Battery"
#~ msgstr "Laptop-Akku"
#~ msgid "UPS"
#~ msgstr "Notstromversorgung"
#~ msgid "Monitor"
#~ msgstr "Bildschirm"
#~ msgid "Mouse"
#~ msgstr "Maus"
#~ msgid "PDA"
#~ msgstr "PDA"
#~ msgid "Cell Phone"
#~ msgstr "Mobiltelefon"
#~ msgid "Media Player"
#~ msgstr "Medienwiedergabe"
#~ msgid "Tablet"
#~ msgstr "Tablet"
#~ msgid "Computer"
#~ msgstr "Rechner"
#~ msgctxt "device"
#~ msgid "Unknown"
#~ msgstr "Unbekannt"
#~ msgid "Microphone"
#~ msgstr "Mikrofon"
#~ msgid "Available"
#~ msgstr "Verfügbar"
#~ msgid "Busy"
#~ msgstr "Beschäftigt"
#~ msgid "Invisible"
#~ msgstr "Unsichtbar"
#~ msgid "Away"
#~ msgstr "Abwesend"
#~ msgid "Idle"
#~ msgstr "Untätig"
#~ msgid "Offline"
#~ msgstr "Abgemeldet"
#~ msgid "Notifications"
#~ msgstr "Benachrichtigungen"
#~ msgid "Install Updates & Restart"
#~ msgstr "Aktualisierungen installieren und neustarten"
#~ msgid "Your chat status will be set to busy"
#~ msgstr "Ihr Anwesenheitsstatus wird auf »Beschäftigt« gesetzt"
#~ msgid ""
#~ "Notifications are now disabled, including chat messages. Your online "
#~ "status has been adjusted to let others know that you might not see their "
#~ "messages."
#~ msgstr ""
#~ "Benachrichtigungen sind nun deaktiviert, einschließlich "
#~ "Sofortnachrichten. Ihr Anwesenheitsstatus wurde nun dahingehend geändert, "
#~ "dass andere darüber informiert werden, dass Sie deren Nachrichten nicht "
#~ "sehen könnten."
#~ msgid "cable unplugged"
#~ msgstr "Kabel nicht angeschlossen"

478
po/es.po
View File

@@ -10,8 +10,8 @@ msgstr ""
"Project-Id-Version: gnome-shell.master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
"shell&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2013-06-26 18:42+0000\n"
"PO-Revision-Date: 2013-06-27 12:33+0200\n"
"POT-Creation-Date: 2013-07-19 18:59+0000\n"
"PO-Revision-Date: 2013-07-22 13:22+0200\n"
"Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n"
"Language-Team: Español <gnome-es-list@gnome.org>\n"
"Language: \n"
@@ -29,7 +29,7 @@ msgstr "Capturas de pantalla"
msgid "Record a screencast"
msgstr "Grabar una captura de pantalla"
#: ../data/50-gnome-shell-system.xml.in.h:1
#: ../data/50-gnome-shell-system.xml.in.h:1 ../js/ui/status/system.js:48
msgid "System"
msgstr "Sistema"
@@ -369,43 +369,33 @@ msgid "Select an extension to configure using the combobox above."
msgstr ""
"Seleccione una extensión que configurar usando la caja combinada de arriba."
#: ../js/gdm/loginDialog.js:302
#| msgid "Switch Session"
#: ../js/gdm/loginDialog.js:298
msgid "Choose Session"
msgstr "Elegir sesión"
#: ../js/gdm/loginDialog.js:320
#| msgid "Session…"
#: ../js/gdm/loginDialog.js:316
msgid "Session"
msgstr "Sesión"
#. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: ../js/gdm/loginDialog.js:522
#: ../js/gdm/loginDialog.js:478
msgid "Not listed?"
msgstr "¿No está en la lista?"
#: ../js/gdm/loginDialog.js:739 ../js/ui/components/networkAgent.js:137
#: ../js/ui/components/polkitAgent.js:161 ../js/ui/endSessionDialog.js:376
#: ../js/ui/extensionDownloader.js:195 ../js/ui/shellMountOperation.js:399
#: ../js/ui/status/bluetooth.js:449 ../js/ui/unlockDialog.js:95
#: ../js/ui/userMenu.js:884
msgid "Cancel"
msgstr "Cancelar"
#: ../js/gdm/loginDialog.js:768
#: ../js/gdm/loginDialog.js:663
msgctxt "button"
msgid "Sign In"
msgstr "Iniciar sesión"
#: ../js/gdm/loginDialog.js:768
#: ../js/gdm/loginDialog.js:665 ../js/gdm/util.js:561
msgid "Next"
msgstr "Siguiente"
#. Translators: this message is shown below the username entry field
#. to clue the user in on how to login to the local network realm
#: ../js/gdm/loginDialog.js:869
#: ../js/gdm/loginDialog.js:716
#, c-format
msgid "(e.g., user or %s)"
msgstr "(ej., usuario o %s)"
@@ -413,12 +403,12 @@ msgstr "(ej., usuario o %s)"
#. TTLS and PEAP are actually much more complicated, but this complication
#. is not visible here since we only care about phase2 authentication
#. (and don't even care of which one)
#: ../js/gdm/loginDialog.js:873 ../js/ui/components/networkAgent.js:260
#: ../js/gdm/loginDialog.js:721 ../js/ui/components/networkAgent.js:260
#: ../js/ui/components/networkAgent.js:278
msgid "Username: "
msgstr "Nombre de usuario:"
#: ../js/gdm/loginDialog.js:1140
#: ../js/gdm/loginDialog.js:987
msgid "Login Window"
msgstr "Ventana de inicio de sesión"
@@ -427,8 +417,7 @@ msgstr "Ventana de inicio de sesión"
msgid "Power"
msgstr "Energía"
#: ../js/gdm/powerMenu.js:93 ../js/ui/userMenu.js:651 ../js/ui/userMenu.js:655
#: ../js/ui/userMenu.js:768
#: ../js/gdm/powerMenu.js:93
msgid "Suspend"
msgstr "Suspender"
@@ -436,21 +425,28 @@ msgstr "Suspender"
msgid "Restart"
msgstr "Reiniciar"
#: ../js/gdm/powerMenu.js:103 ../js/ui/userMenu.js:653
#: ../js/ui/userMenu.js:655 ../js/ui/userMenu.js:767 ../js/ui/userMenu.js:888
#: ../js/gdm/powerMenu.js:103 ../js/ui/status/system.js:215
#: ../js/ui/status/system.js:309
msgid "Power Off"
msgstr "Apagar"
#: ../js/gdm/util.js:248
#: ../js/gdm/util.js:255
msgid "Authentication error"
msgstr "Error de autenticación"
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: ../js/gdm/util.js:365
#: ../js/gdm/util.js:372
msgid "(or swipe finger)"
msgstr "(o pase el dedo)"
#: ../js/gdm/util.js:539 ../js/ui/components/networkAgent.js:137
#: ../js/ui/components/polkitAgent.js:161 ../js/ui/endSessionDialog.js:376
#: ../js/ui/extensionDownloader.js:195 ../js/ui/shellMountOperation.js:399
#: ../js/ui/status/bluetooth.js:431 ../js/ui/status/system.js:305
msgid "Cancel"
msgstr "Cancelar"
#: ../js/misc/util.js:97
msgid "Command not found"
msgstr "Comando no encontrado"
@@ -496,7 +492,7 @@ msgstr "Se ha añadido %s a sus favoritos."
msgid "%s has been removed from your favorites."
msgstr "Se ha quitado %s de sus favoritos."
#: ../js/ui/backgroundMenu.js:19 ../js/ui/userMenu.js:744
#: ../js/ui/backgroundMenu.js:19 ../js/ui/status/system.js:207
msgid "Settings"
msgstr "Configuración"
@@ -1160,7 +1156,6 @@ msgid "Download and install '%s' from extensions.gnome.org?"
msgstr "¿Descargar e instalar «%s» desde extensions.gnome.org?"
#: ../js/ui/keyboard.js:619 ../js/ui/status/keyboard.js:333
#: ../js/ui/status/power.js:211
msgid "Keyboard"
msgstr "Teclado"
@@ -1212,31 +1207,31 @@ msgstr "Ver fuente"
msgid "Web Page"
msgstr "Página web"
#: ../js/ui/messageTray.js:1182
#: ../js/ui/messageTray.js:1241
msgid "Open"
msgstr "Abrir"
#: ../js/ui/messageTray.js:1189
#: ../js/ui/messageTray.js:1248
msgid "Remove"
msgstr "Quitar"
#: ../js/ui/messageTray.js:1501
#: ../js/ui/messageTray.js:1560
msgid "Clear Messages"
msgstr "Limpiar mensajes"
#: ../js/ui/messageTray.js:1528
#: ../js/ui/messageTray.js:1587
msgid "Notification Settings"
msgstr "Configuración de las notificaciones"
#: ../js/ui/messageTray.js:1711
#: ../js/ui/messageTray.js:1770
msgid "No Messages"
msgstr "No hay mensajes"
#: ../js/ui/messageTray.js:1784
#: ../js/ui/messageTray.js:1842
msgid "Message Tray"
msgstr "Bandeja de mensajes"
#: ../js/ui/messageTray.js:2811
#: ../js/ui/messageTray.js:2854
msgid "System Information"
msgstr "Información del sistema"
@@ -1287,7 +1282,7 @@ msgstr "Barra superior"
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle
#. switches containing "◯" and "|"). Other values will
#. simply result in invisible toggle switches.
#: ../js/ui/popupMenu.js:549
#: ../js/ui/popupMenu.js:488
msgid "toggle-switch-us"
msgstr "toggle-switch-intl"
@@ -1312,7 +1307,7 @@ msgid_plural "%d new notifications"
msgstr[0] "%d notificación nueva"
msgstr[1] "%d notificaciones nuevas"
#: ../js/ui/screenShield.js:449 ../js/ui/userMenu.js:759
#: ../js/ui/screenShield.js:449 ../js/ui/status/system.js:211
msgid "Lock"
msgstr "Bloquear"
@@ -1327,11 +1322,11 @@ msgstr "GNOME necesita bloquear la pantalla"
#.
#. XXX: another option is to kick the user into the gdm login
#. screen, where we're not affected by grabs
#: ../js/ui/screenShield.js:773 ../js/ui/screenShield.js:1213
#: ../js/ui/screenShield.js:788 ../js/ui/screenShield.js:1216
msgid "Unable to lock"
msgstr "No se pudo bloquear"
#: ../js/ui/screenShield.js:774 ../js/ui/screenShield.js:1214
#: ../js/ui/screenShield.js:789 ../js/ui/screenShield.js:1217
msgid "Lock was blocked by an application"
msgstr "Una aplicación impidió el bloqueo"
@@ -1367,7 +1362,7 @@ msgstr "Contraseña"
msgid "Remember Password"
msgstr "Recordar contraseña"
#: ../js/ui/shellMountOperation.js:403 ../js/ui/unlockDialog.js:108
#: ../js/ui/shellMountOperation.js:403 ../js/ui/unlockDialog.js:68
msgid "Unlock"
msgstr "Desbloquear"
@@ -1407,22 +1402,18 @@ msgstr "Rechazo de teclas"
msgid "Mouse Keys"
msgstr "Teclas del ratón"
#: ../js/ui/status/accessibility.js:72
msgid "Universal Access Settings"
msgstr "Configuración del acceso universal"
#: ../js/ui/status/accessibility.js:129
#: ../js/ui/status/accessibility.js:126
msgid "High Contrast"
msgstr "Contraste alto"
#: ../js/ui/status/accessibility.js:178
#: ../js/ui/status/accessibility.js:175
msgid "Large Text"
msgstr "Texto grande"
#: ../js/ui/status/bluetooth.js:28 ../js/ui/status/bluetooth.js:32
#: ../js/ui/status/bluetooth.js:290 ../js/ui/status/bluetooth.js:327
#: ../js/ui/status/bluetooth.js:355 ../js/ui/status/bluetooth.js:391
#: ../js/ui/status/bluetooth.js:422 ../js/ui/status/network.js:713
#: ../js/ui/status/bluetooth.js:272 ../js/ui/status/bluetooth.js:309
#: ../js/ui/status/bluetooth.js:337 ../js/ui/status/bluetooth.js:373
#: ../js/ui/status/bluetooth.js:404 ../js/ui/status/network.js:713
msgid "Bluetooth"
msgstr "Bluetooth"
@@ -1438,87 +1429,71 @@ msgstr "Enviar archivos al dispositivo…"
msgid "Set Up a New Device…"
msgstr "Configurar un dispositivo nuevo…"
#: ../js/ui/status/bluetooth.js:84
msgid "Bluetooth Settings"
msgstr "Configuración de Bluetooth"
#. TRANSLATORS: this means that bluetooth was disabled by hardware rfkill
#: ../js/ui/status/bluetooth.js:105 ../js/ui/status/network.js:140
#: ../js/ui/status/bluetooth.js:103 ../js/ui/status/network.js:140
msgid "hardware disabled"
msgstr "hardware desactivado"
#: ../js/ui/status/bluetooth.js:198
#: ../js/ui/status/bluetooth.js:196
msgid "Connection"
msgstr "Conexión"
#: ../js/ui/status/bluetooth.js:209 ../js/ui/status/network.js:399
#: ../js/ui/status/bluetooth.js:207 ../js/ui/status/network.js:399
msgid "disconnecting..."
msgstr "deconectando…"
#: ../js/ui/status/bluetooth.js:222 ../js/ui/status/network.js:405
#: ../js/ui/status/bluetooth.js:220 ../js/ui/status/network.js:405
#: ../js/ui/status/network.js:1298
msgid "connecting..."
msgstr "conectando…"
#: ../js/ui/status/bluetooth.js:240
#: ../js/ui/status/bluetooth.js:238
msgid "Send Files…"
msgstr "Enviar archivos…"
#: ../js/ui/status/bluetooth.js:247
msgid "Keyboard Settings"
msgstr "Configuración del teclado"
#: ../js/ui/status/bluetooth.js:250
msgid "Mouse Settings"
msgstr "Configuración del ratón…"
#: ../js/ui/status/bluetooth.js:255 ../js/ui/status/volume.js:313
msgid "Sound Settings"
msgstr "Configuración del sonido"
#: ../js/ui/status/bluetooth.js:328 ../js/ui/status/bluetooth.js:356
#: ../js/ui/status/bluetooth.js:310 ../js/ui/status/bluetooth.js:338
#, c-format
msgid "Authorization request from %s"
msgstr "Solicitud de autorización de %s"
#: ../js/ui/status/bluetooth.js:334 ../js/ui/status/bluetooth.js:399
#: ../js/ui/status/bluetooth.js:430
#: ../js/ui/status/bluetooth.js:316 ../js/ui/status/bluetooth.js:381
#: ../js/ui/status/bluetooth.js:412
#, c-format
msgid "Device %s wants to pair with this computer"
msgstr "El dispositivo «%s» quiere emparejarse con este equipo"
#: ../js/ui/status/bluetooth.js:336
#: ../js/ui/status/bluetooth.js:318
msgid "Allow"
msgstr "Permitir"
#: ../js/ui/status/bluetooth.js:337
#: ../js/ui/status/bluetooth.js:319
msgid "Deny"
msgstr "Denegar"
#: ../js/ui/status/bluetooth.js:362
#: ../js/ui/status/bluetooth.js:344
#, c-format
msgid "Device %s wants access to the service '%s'"
msgstr "El dispositivo %s quiere acceder al servicio «%s»"
#: ../js/ui/status/bluetooth.js:364
#: ../js/ui/status/bluetooth.js:346
msgid "Always grant access"
msgstr "Conceder acceso siempre"
#: ../js/ui/status/bluetooth.js:365
#: ../js/ui/status/bluetooth.js:347
msgid "Grant this time only"
msgstr "Conceder sólo esta vez"
#: ../js/ui/status/bluetooth.js:366
#: ../js/ui/status/bluetooth.js:348
msgid "Reject"
msgstr "Rechazar"
#. Translators: argument is the device short name
#: ../js/ui/status/bluetooth.js:393
#: ../js/ui/status/bluetooth.js:375
#, c-format
msgid "Pairing confirmation for %s"
msgstr "Confirmación de emparejamiento para «%s»"
#: ../js/ui/status/bluetooth.js:400
#: ../js/ui/status/bluetooth.js:382
#, c-format
msgid ""
"Please confirm whether the Passkey '%06d' matches the one on the device."
@@ -1526,24 +1501,24 @@ msgstr ""
"Confirme que la clave mostrada en «%06d» coincide con la del dispositivo."
#. Translators: this is the verb, not the noun
#: ../js/ui/status/bluetooth.js:403
#: ../js/ui/status/bluetooth.js:385
msgid "Matches"
msgstr "Coincide"
#: ../js/ui/status/bluetooth.js:404
#: ../js/ui/status/bluetooth.js:386
msgid "Does not match"
msgstr "No coincide"
#: ../js/ui/status/bluetooth.js:423
#: ../js/ui/status/bluetooth.js:405
#, c-format
msgid "Pairing request for %s"
msgstr "Solicitud de emparejamiento para «%s»"
#: ../js/ui/status/bluetooth.js:431
#: ../js/ui/status/bluetooth.js:413
msgid "Please enter the PIN mentioned on the device."
msgstr "Introduzca el PIN mencionado en el dispositivo."
#: ../js/ui/status/bluetooth.js:448
#: ../js/ui/status/bluetooth.js:430
msgid "OK"
msgstr "Aceptar"
@@ -1551,10 +1526,6 @@ msgstr "Aceptar"
msgid "Show Keyboard Layout"
msgstr "Mostrar la distribución del teclado"
#: ../js/ui/status/keyboard.js:401
msgid "Region & Language Settings"
msgstr "Configuración de región e idioma"
#: ../js/ui/status/lockScreenMenu.js:43
msgid "Volume, network, battery"
msgstr "Volumen, red, batería"
@@ -1621,217 +1592,97 @@ msgstr "Banda ancha móvil"
msgid "Enable networking"
msgstr "Activar red"
#: ../js/ui/status/network.js:1522
msgid "Network Settings"
msgstr "Configuración de la red"
#: ../js/ui/status/network.js:1539
#: ../js/ui/status/network.js:1537
msgid "Network Manager"
msgstr "Gestor de la red"
#: ../js/ui/status/network.js:1623
#: ../js/ui/status/network.js:1621
msgid "Connection failed"
msgstr "Falló la conexión"
#: ../js/ui/status/network.js:1624
#: ../js/ui/status/network.js:1622
msgid "Activation of network connection failed"
msgstr "Falló la activación de la conexión de red"
#: ../js/ui/status/network.js:1937
#: ../js/ui/status/network.js:1936
msgid "Networking is disabled"
msgstr "La red está desactivada"
#: ../js/ui/status/power.js:55
#: ../js/ui/status/power.js:31 ../js/ui/status/power.js:44
msgid "Battery"
msgstr "Batería"
#: ../js/ui/status/power.js:81
#: ../js/ui/status/power.js:45
msgid "Power Settings"
msgstr "Configuración de energía"
#: ../js/ui/status/power.js:61
msgid "Fully Charged"
msgstr "Cargada completamente"
#. 0 is reported when UPower does not have enough data
#. to estimate battery life
#: ../js/ui/status/power.js:99
#. state is one of PENDING_CHARGING, PENDING_DISCHARGING
#: ../js/ui/status/power.js:67 ../js/ui/status/power.js:84
msgid "Estimating…"
msgstr "Estimando…"
#: ../js/ui/status/power.js:106
#. Translators: this is <hours>:<minutes> Remaining (<percentage>)
#: ../js/ui/status/power.js:75
#, c-format
msgid "%d hour remaining"
msgid_plural "%d hours remaining"
msgstr[0] "Queda %d hora"
msgstr[1] "Queda %d horas"
msgid "%d\\u2236%d Remaining (%d%%)"
msgstr "Quedan %d\\u2236%d (%d%%)"
#. TRANSLATORS: this is a time string, as in "%d hours %d minutes remaining"
#: ../js/ui/status/power.js:109
#. Translators: this is <hours>:<minutes> Until Full (<percentage>)
#: ../js/ui/status/power.js:80
#, c-format
msgid "%d %s %d %s remaining"
msgstr "Quedan %d %s %d %s"
msgid "%d\\u2236%d Until Full (%d%%)"
msgstr "%d\\u2236%d para la carga completa (%d%%)"
#: ../js/ui/status/power.js:111
msgid "hour"
msgid_plural "hours"
msgstr[0] "hora"
msgstr[1] "horas"
#: ../js/ui/status/power.js:111
msgid "minute"
msgid_plural "minutes"
msgstr[0] "minuto"
msgstr[1] "minutos"
#: ../js/ui/status/power.js:114
#, c-format
msgid "%d minute remaining"
msgid_plural "%d minutes remaining"
msgstr[0] "Queda %d minuto"
msgstr[1] "Quedan %d minutos"
#: ../js/ui/status/power.js:117 ../js/ui/status/power.js:191
#, c-format
msgctxt "percent of battery remaining"
msgid "%d%%"
msgstr "%d%%"
#: ../js/ui/status/power.js:201
msgid "AC Adapter"
msgstr "Adaptador de corriente"
#: ../js/ui/status/power.js:203
msgid "Laptop Battery"
msgstr "Batería del portátil"
#: ../js/ui/status/power.js:205
msgid "UPS"
msgstr "SAI"
#: ../js/ui/status/power.js:207
msgid "Monitor"
msgstr "Monitor"
#: ../js/ui/status/power.js:209
msgid "Mouse"
msgstr "Ratón"
#: ../js/ui/status/power.js:213
msgid "PDA"
msgstr "PDA"
#: ../js/ui/status/power.js:215
msgid "Cell Phone"
msgstr "Teléfono móvil"
#: ../js/ui/status/power.js:217
msgid "Media Player"
msgstr "Reproductor multimedia"
#: ../js/ui/status/power.js:219
msgid "Tablet"
msgstr "Tableta"
#: ../js/ui/status/power.js:221
msgid "Computer"
msgstr "Equipo"
#: ../js/ui/status/power.js:223
msgctxt "device"
msgid "Unknown"
msgstr "Desconocido"
#: ../js/ui/status/volume.js:121
msgid "Volume changed"
msgstr "Volumen modificado"
#. Translators: This is the label for audio volume
#: ../js/ui/status/volume.js:246 ../js/ui/status/volume.js:294
msgid "Volume"
msgstr "Volumen"
#: ../js/ui/status/volume.js:255
msgid "Microphone"
msgstr "Micrófono"
#: ../js/ui/unlockDialog.js:119
msgid "Log in as another user"
msgstr "Iniciar sesión como otro usuario"
#: ../js/ui/unlockDialog.js:140
msgid "Unlock Window"
msgstr "Desbloquear ventana"
#: ../js/ui/userMenu.js:149
msgid "Available"
msgstr "Disponible"
#: ../js/ui/userMenu.js:152
msgid "Busy"
msgstr "Ocupado"
#: ../js/ui/userMenu.js:155
msgid "Invisible"
msgstr "Invisible"
#: ../js/ui/userMenu.js:158
msgid "Away"
msgstr "Ausente"
#: ../js/ui/userMenu.js:161
msgid "Idle"
msgstr "Inactivo"
#: ../js/ui/userMenu.js:164
msgid "Offline"
msgstr "Desconectado"
#: ../js/ui/userMenu.js:736
msgid "Notifications"
msgstr "Notificaciones"
#: ../js/ui/userMenu.js:749
#: ../js/ui/status/system.js:188
msgid "Switch User"
msgstr "Cambiar de usuario"
#: ../js/ui/userMenu.js:754
#: ../js/ui/status/system.js:193
msgid "Log Out"
msgstr "Cerrar la sesión"
#: ../js/ui/userMenu.js:774
msgid "Install Updates & Restart"
msgstr "Instalar actualizaciones y reiniciar"
#: ../js/ui/userMenu.js:792
msgid "Your chat status will be set to busy"
msgstr "Su estado del chat se establecerá a «ocupado»"
#: ../js/ui/userMenu.js:793
msgid ""
"Notifications are now disabled, including chat messages. Your online status "
"has been adjusted to let others know that you might not see their messages."
msgstr ""
"Las notificaciones están ahora desactivadas, incluyendo los mensajes de "
"chat. Su estado en línea se ha ajustado para que otros sepan que puede no "
"leer sus mensajes."
#: ../js/ui/userMenu.js:834
#: ../js/ui/status/system.js:255
msgid "Other users are logged in."
msgstr "Hay otros usuarios con la sesión iniciada"
#: ../js/ui/userMenu.js:839
#: ../js/ui/status/system.js:260
msgid "Shutting down might cause them to lose unsaved work."
msgstr "Apagar puede hacer que pierdan el trabajo que no hayan guardado."
#. Translators: Remote here refers to a remote session, like a ssh login
#: ../js/ui/userMenu.js:867
#: ../js/ui/status/system.js:288
#, c-format
msgid "%s (remote)"
msgstr "%s (remoto)"
#. Translators: Console here refers to a tty like a VT console
#: ../js/ui/userMenu.js:870
#: ../js/ui/status/system.js:291
#, c-format
msgid "%s (console)"
msgstr "%s (consola)"
#: ../js/ui/status/volume.js:126
msgid "Volume changed"
msgstr "Volumen modificado"
#: ../js/ui/status/volume.js:302
msgid "Volume"
msgstr "Volumen"
#: ../js/ui/unlockDialog.js:78
msgid "Log in as another user"
msgstr "Iniciar sesión como otro usuario"
#: ../js/ui/unlockDialog.js:97
msgid "Unlock Window"
msgstr "Desbloquear ventana"
#: ../js/ui/viewSelector.js:100
msgid "Applications"
msgstr "Aplicaciones"
@@ -1920,6 +1771,127 @@ msgstr "La contraseña no puede estar vacía"
msgid "Authentication dialog was dismissed by the user"
msgstr "El usuario rechazó el diálogo de autenticación"
#~ msgid "Universal Access Settings"
#~ msgstr "Configuración del acceso universal"
#~ msgid "Bluetooth Settings"
#~ msgstr "Configuración de Bluetooth"
#~ msgid "Keyboard Settings"
#~ msgstr "Configuración del teclado"
#~ msgid "Mouse Settings"
#~ msgstr "Configuración del ratón…"
#~ msgid "Sound Settings"
#~ msgstr "Configuración del sonido"
#~ msgid "Region & Language Settings"
#~ msgstr "Configuración de región e idioma"
#~ msgid "Network Settings"
#~ msgstr "Configuración de la red"
#~ msgid "%d hour remaining"
#~ msgid_plural "%d hours remaining"
#~ msgstr[0] "Queda %d hora"
#~ msgstr[1] "Queda %d horas"
#~ msgid "%d %s %d %s remaining"
#~ msgstr "Quedan %d %s %d %s"
#~ msgid "hour"
#~ msgid_plural "hours"
#~ msgstr[0] "hora"
#~ msgstr[1] "horas"
#~ msgid "minute"
#~ msgid_plural "minutes"
#~ msgstr[0] "minuto"
#~ msgstr[1] "minutos"
#~ msgid "%d minute remaining"
#~ msgid_plural "%d minutes remaining"
#~ msgstr[0] "Queda %d minuto"
#~ msgstr[1] "Quedan %d minutos"
#~ msgctxt "percent of battery remaining"
#~ msgid "%d%%"
#~ msgstr "%d%%"
#~ msgid "AC Adapter"
#~ msgstr "Adaptador de corriente"
#~ msgid "Laptop Battery"
#~ msgstr "Batería del portátil"
#~ msgid "UPS"
#~ msgstr "SAI"
#~ msgid "Monitor"
#~ msgstr "Monitor"
#~ msgid "Mouse"
#~ msgstr "Ratón"
#~ msgid "PDA"
#~ msgstr "PDA"
#~ msgid "Cell Phone"
#~ msgstr "Teléfono móvil"
#~ msgid "Media Player"
#~ msgstr "Reproductor multimedia"
#~ msgid "Tablet"
#~ msgstr "Tableta"
#~ msgid "Computer"
#~ msgstr "Equipo"
#~ msgctxt "device"
#~ msgid "Unknown"
#~ msgstr "Desconocido"
#~ msgid "Microphone"
#~ msgstr "Micrófono"
#~ msgid "Available"
#~ msgstr "Disponible"
#~ msgid "Busy"
#~ msgstr "Ocupado"
#~ msgid "Invisible"
#~ msgstr "Invisible"
#~ msgid "Away"
#~ msgstr "Ausente"
#~ msgid "Idle"
#~ msgstr "Inactivo"
#~ msgid "Offline"
#~ msgstr "Desconectado"
#~ msgid "Notifications"
#~ msgstr "Notificaciones"
#~ msgid "Install Updates & Restart"
#~ msgstr "Instalar actualizaciones y reiniciar"
#~ msgid "Your chat status will be set to busy"
#~ msgstr "Su estado del chat se establecerá a «ocupado»"
#~ msgid ""
#~ "Notifications are now disabled, including chat messages. Your online "
#~ "status has been adjusted to let others know that you might not see their "
#~ "messages."
#~ msgstr ""
#~ "Las notificaciones están ahora desactivadas, incluyendo los mensajes de "
#~ "chat. Su estado en línea se ha ajustado para que otros sepan que puede no "
#~ "leer sus mensajes."
#~ msgid "cable unplugged"
#~ msgstr "cable desconectado"

643
po/it.po

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-shell 3.9.x\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-07-04 11:09+0200\n"
"POT-Creation-Date: 2013-07-18 15:29+0200\n"
"PO-Revision-Date: 2013-07-04 11:09+0200\n"
"Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n"
"Language-Team: Norwegian bokmål <i18n-nb@lister.ping.uio.no>\n"
@@ -342,7 +342,7 @@ msgstr "Økt"
#. translators: this message is shown below the user list on the
#. login screen. It can be activated to reveal an entry for
#. manually entering the username.
#: ../js/gdm/loginDialog.js:528
#: ../js/gdm/loginDialog.js:533
msgid "Not listed?"
msgstr "Ikke listet?"
@@ -401,13 +401,13 @@ msgstr "Start på nytt"
msgid "Power Off"
msgstr "Slå av"
#: ../js/gdm/util.js:248
#: ../js/gdm/util.js:247
msgid "Authentication error"
msgstr "Autentiseringsfeil"
#. Translators: this message is shown below the password entry field
#. to indicate the user can swipe their finger instead
#: ../js/gdm/util.js:365
#: ../js/gdm/util.js:364
msgid "(or swipe finger)"
msgstr "(eller dra finger)"
@@ -1170,31 +1170,31 @@ msgstr "Vis kildekode"
msgid "Web Page"
msgstr "Nettside"
#: ../js/ui/messageTray.js:1182
#: ../js/ui/messageTray.js:1241
msgid "Open"
msgstr "Åpne"
#: ../js/ui/messageTray.js:1189
#: ../js/ui/messageTray.js:1248
msgid "Remove"
msgstr "Fjern"
#: ../js/ui/messageTray.js:1501
#: ../js/ui/messageTray.js:1560
msgid "Clear Messages"
msgstr "Tøm meldinger"
#: ../js/ui/messageTray.js:1528
#: ../js/ui/messageTray.js:1587
msgid "Notification Settings"
msgstr "Innstillinger for varsling"
#: ../js/ui/messageTray.js:1711
#: ../js/ui/messageTray.js:1770
msgid "No Messages"
msgstr "Ingen meldinger"
#: ../js/ui/messageTray.js:1784
#: ../js/ui/messageTray.js:1842
msgid "Message Tray"
msgstr "Meldingstrau"
#: ../js/ui/messageTray.js:2811
#: ../js/ui/messageTray.js:2854
msgid "System Information"
msgstr "Systeminformasjon"
@@ -1245,7 +1245,7 @@ msgstr "Topp-panel"
#. "ON" and "OFF") or "toggle-switch-intl" (for toggle
#. switches containing "◯" and "|"). Other values will
#. simply result in invisible toggle switches.
#: ../js/ui/popupMenu.js:549
#: ../js/ui/popupMenu.js:517
msgid "toggle-switch-us"
msgstr "toggle-switch-intl"
@@ -1285,11 +1285,11 @@ msgstr "GNOME må låse skjermen"
#.
#. XXX: another option is to kick the user into the gdm login
#. screen, where we're not affected by grabs
#: ../js/ui/screenShield.js:775 ../js/ui/screenShield.js:1215
#: ../js/ui/screenShield.js:788 ../js/ui/screenShield.js:1216
msgid "Unable to lock"
msgstr "Kan ikke låse"
#: ../js/ui/screenShield.js:776 ../js/ui/screenShield.js:1216
#: ../js/ui/screenShield.js:789 ../js/ui/screenShield.js:1217
msgid "Lock was blocked by an application"
msgstr "Låsing ble stoppet av et program"

664
po/tg.po

File diff suppressed because it is too large Load Diff

View File

@@ -214,6 +214,7 @@ shell_app_create_icon_texture (ShellApp *app,
typedef struct {
ShellApp *app;
int size;
ClutterTextDirection direction;
} CreateFadedIconData;
static CoglHandle
@@ -231,7 +232,7 @@ shell_app_create_faded_icon_cpu (StTextureCache *cache,
guint8 n_channels;
gboolean have_alpha;
gint fade_start;
gint fade_range;
gint fade_end;
guint i, j;
guint pixbuf_byte_size;
guint8 *orig_pixels;
@@ -283,14 +284,26 @@ shell_app_create_faded_icon_cpu (StTextureCache *cache,
pixels = g_malloc0 (rowstride * height);
memcpy (pixels, orig_pixels, pixbuf_byte_size);
fade_start = width / 2;
fade_range = width - fade_start;
for (i = fade_start; i < width; i++)
/* fade on the right side for LTR, left side for RTL */
if (data->direction == CLUTTER_TEXT_DIRECTION_LTR)
{
fade_start = width / 2;
fade_end = width;
}
else
{
fade_start = 0;
fade_end = width / 2;
}
for (i = fade_start; i < fade_end; i++)
{
for (j = 0; j < height; j++)
{
guchar *pixel = &pixels[j * rowstride + i * n_channels];
float fade = 1.0 - ((float) i - fade_start) / fade_range;
float fade = ((float) i - fade_start) / (fade_end - fade_start);
if (data->direction == CLUTTER_TEXT_DIRECTION_LTR)
fade = 1.0 - fade;
pixel[0] = 0.5 + pixel[0] * fade;
pixel[1] = 0.5 + pixel[1] * fade;
pixel[2] = 0.5 + pixel[2] * fade;
@@ -316,13 +329,14 @@ shell_app_create_faded_icon_cpu (StTextureCache *cache,
* shell_app_get_faded_icon:
* @app: A #ShellApp
* @size: Size in pixels
* @direction: Whether to fade on the left or right
*
* Return an actor with a horizontally faded look.
*
* Return value: (transfer none): A floating #ClutterActor, or %NULL if no icon
*/
ClutterActor *
shell_app_get_faded_icon (ShellApp *app, int size)
shell_app_get_faded_icon (ShellApp *app, int size, ClutterTextDirection direction)
{
CoglHandle texture;
ClutterActor *result;
@@ -338,9 +352,13 @@ shell_app_get_faded_icon (ShellApp *app, int size)
/* Use icon: prefix so that we get evicted from the cache on
* icon theme changes. */
cache_key = g_strdup_printf ("icon:%s,size=%d,faded", shell_app_get_id (app), size);
cache_key = g_strdup_printf ("icon:%s,size=%d,faded-%s",
shell_app_get_id (app),
size,
direction == CLUTTER_TEXT_DIRECTION_RTL ? "rtl" : "ltr");
data.app = app;
data.size = size;
data.direction = direction;
texture = st_texture_cache_load (st_texture_cache_get_default (),
cache_key,
ST_TEXTURE_CACHE_POLICY_FOREVER,

View File

@@ -43,7 +43,7 @@ GMenuTreeEntry *shell_app_get_tree_entry (ShellApp *app);
GDesktopAppInfo *shell_app_get_app_info (ShellApp *app);
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, ClutterTextDirection direction);
const char *shell_app_get_name (ShellApp *app);
const char *shell_app_get_description (ShellApp *app);
gboolean shell_app_is_window_backed (ShellApp *app);

View File

@@ -598,7 +598,7 @@ st_scroll_view_allocate (ClutterActor *actor,
*/
/* Vertical scrollbar */
if (CLUTTER_ACTOR_IS_VISIBLE (priv->vscroll))
if (vscrollbar_visible)
{
if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL)
{
@@ -617,7 +617,7 @@ st_scroll_view_allocate (ClutterActor *actor,
}
/* Horizontal scrollbar */
if (CLUTTER_ACTOR_IS_VISIBLE (priv->hscroll))
if (hscrollbar_visible)
{
if (clutter_actor_get_text_direction (actor) == CLUTTER_TEXT_DIRECTION_RTL)
{

View File

@@ -2392,7 +2392,13 @@ st_theme_node_paint (StThemeNode *node,
if (width <= 0 || height <= 0)
return;
if (st_theme_node_needs_new_box_shadow_for_size (state, node, width, height))
/* Check whether we need to recreate the textures of the paint
* state, either because :
* 1) the theme node associated to the paint state has changed
* 2) the allocation size change requires recreating textures
*/
if (state->node != node ||
st_theme_node_needs_new_box_shadow_for_size (state, node, width, height))
{
/* If we had the ability to cache textures on the node, then we
can just copy them over to the paint state and avoid all

View File

@@ -148,9 +148,13 @@ st_theme_node_transition_update (StThemeNodeTransition *transition,
if (st_theme_node_equal (new_node, old_node))
{
{
StThemeNodePaintState tmp = priv->old_paint_state;
priv->old_paint_state = priv->new_paint_state;
priv->new_paint_state = tmp;
StThemeNodePaintState tmp;
st_theme_node_paint_state_init (&tmp);
st_theme_node_paint_state_copy (&tmp, &priv->old_paint_state);
st_theme_node_paint_state_copy (&priv->old_paint_state, &priv->new_paint_state);
st_theme_node_paint_state_copy (&priv->new_paint_state, &tmp);
st_theme_node_paint_state_free (&tmp);
}
if (clutter_timeline_get_elapsed_time (priv->timeline) > 0)