gdm: move all login/unlock code to auth/ directory

Right now the GDM and unlock code use a mish-mash of files
from ui/ and from gdm/.

This commit consolidates all the files into ui/auth as a
first step toward cleaning up the duplication of code between
the two features.
This commit is contained in:
Ray Strode 2013-06-14 07:50:18 -04:00
parent 2141138a6f
commit 73d8f6c993
9 changed files with 33 additions and 33 deletions

View File

@ -17,11 +17,6 @@ misc/config.js: misc/config.js.in Makefile
jsdir = $(pkgdatadir)/js jsdir = $(pkgdatadir)/js
nobase_dist_js_DATA = \ nobase_dist_js_DATA = \
gdm/fingerprint.js \
gdm/loginDialog.js \
gdm/powerMenu.js \
gdm/realmd.js \
gdm/util.js \
extensionPrefs/main.js \ extensionPrefs/main.js \
misc/batch.js \ misc/batch.js \
misc/config.js \ misc/config.js \
@ -96,7 +91,6 @@ nobase_dist_js_DATA = \
ui/status/bluetooth.js \ ui/status/bluetooth.js \
ui/switcherPopup.js \ ui/switcherPopup.js \
ui/tweener.js \ ui/tweener.js \
ui/unlockDialog.js \
ui/userAvatar.js \ ui/userAvatar.js \
ui/userMenu.js \ ui/userMenu.js \
ui/userWidget.js \ ui/userWidget.js \
@ -109,6 +103,12 @@ nobase_dist_js_DATA = \
ui/workspacesView.js \ ui/workspacesView.js \
ui/workspaceSwitcherPopup.js \ ui/workspaceSwitcherPopup.js \
ui/xdndHandler.js \ ui/xdndHandler.js \
ui/auth/fingerprint.js \
ui/auth/loginDialog.js \
ui/auth/powerMenu.js \
ui/auth/realmd.js \
ui/auth/unlockDialog.js \
ui/auth/util.js \
ui/components/__init__.js \ ui/components/__init__.js \
ui/components/autorunManager.js \ ui/components/autorunManager.js \
ui/components/automountManager.js \ ui/components/automountManager.js \

View File

@ -28,15 +28,15 @@ const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
const Lang = imports.lang; const Lang = imports.lang;
const Pango = imports.gi.Pango; const Pango = imports.gi.Pango;
const Realmd = imports.gdm.realmd; const Realmd = imports.ui.auth.realmd;
const Signals = imports.signals; const Signals = imports.signals;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const St = imports.gi.St; const St = imports.gi.St;
const Gdm = imports.gi.Gdm; const Gdm = imports.gi.Gdm;
const AuthUtil = imports.ui.auth.util;
const Batch = imports.misc.batch; const Batch = imports.misc.batch;
const Fprint = imports.gdm.fingerprint; const Fprint = imports.ui.auth.fingerprint;
const GdmUtil = imports.gdm.util;
const Main = imports.ui.main; const Main = imports.ui.main;
const ModalDialog = imports.ui.modalDialog; const ModalDialog = imports.ui.modalDialog;
const Tweener = imports.ui.tweener; const Tweener = imports.ui.tweener;
@ -499,7 +499,7 @@ const LoginDialog = new Lang.Class({
Lang.bind(this, this._onTimedLoginRequested)); Lang.bind(this, this._onTimedLoginRequested));
} }
this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient); this._userVerifier = new AuthUtil.ShellUserVerifier(this._greeterClient);
this._userVerifier.connect('ask-question', Lang.bind(this, this._askQuestion)); this._userVerifier.connect('ask-question', Lang.bind(this, this._askQuestion));
this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage)); this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
this._userVerifier.connect('verification-failed', Lang.bind(this, this._verificationFailed)); this._userVerifier.connect('verification-failed', Lang.bind(this, this._verificationFailed));
@ -508,15 +508,15 @@ const LoginDialog = new Lang.Class({
this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint)); this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
this._verifyingUser = false; this._verifyingUser = false;
this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA }); this._settings = new Gio.Settings({ schema: AuthUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_KEY, this._settings.connect('changed::' + AuthUtil.BANNER_MESSAGE_KEY,
Lang.bind(this, this._updateBanner)); Lang.bind(this, this._updateBanner));
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_TEXT_KEY, this._settings.connect('changed::' + AuthUtil.BANNER_MESSAGE_TEXT_KEY,
Lang.bind(this, this._updateBanner)); Lang.bind(this, this._updateBanner));
this._settings.connect('changed::' + GdmUtil.DISABLE_USER_LIST_KEY, this._settings.connect('changed::' + AuthUtil.DISABLE_USER_LIST_KEY,
Lang.bind(this, this._updateDisableUserList)); Lang.bind(this, this._updateDisableUserList));
this._settings.connect('changed::' + GdmUtil.LOGO_KEY, this._settings.connect('changed::' + AuthUtil.LOGO_KEY,
Lang.bind(this, this._updateLogo)); Lang.bind(this, this._updateLogo));
this._textureCache = St.TextureCache.get_default(); this._textureCache = St.TextureCache.get_default();
@ -638,7 +638,7 @@ const LoginDialog = new Lang.Class({
}, },
_updateDisableUserList: function() { _updateDisableUserList: function() {
let disableUserList = this._settings.get_boolean(GdmUtil.DISABLE_USER_LIST_KEY); let disableUserList = this._settings.get_boolean(AuthUtil.DISABLE_USER_LIST_KEY);
// If this is the first time around, set initial focus // If this is the first time around, set initial focus
if (this._disableUserList == undefined && disableUserList) if (this._disableUserList == undefined && disableUserList)
@ -653,8 +653,8 @@ const LoginDialog = new Lang.Class({
}, },
_updateBanner: function() { _updateBanner: function() {
let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY); let enabled = this._settings.get_boolean(AuthUtil.BANNER_MESSAGE_KEY);
let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY); let text = this._settings.get_string(AuthUtil.BANNER_MESSAGE_TEXT_KEY);
if (enabled && text) { if (enabled && text) {
this._bannerLabel.set_text(text); this._bannerLabel.set_text(text);
@ -676,7 +676,7 @@ const LoginDialog = new Lang.Class({
}, },
_updateLogo: function() { _updateLogo: function() {
let path = this._settings.get_string(GdmUtil.LOGO_KEY); let path = this._settings.get_string(AuthUtil.LOGO_KEY);
this._logoFileUri = path ? Gio.file_new_for_path(path).get_uri() : null; this._logoFileUri = path ? Gio.file_new_for_path(path).get_uri() : null;
this._updateLogoTexture(this._textureCache, this._logoFileUri); this._updateLogoTexture(this._textureCache, this._logoFileUri);
@ -1079,7 +1079,7 @@ const LoginDialog = new Lang.Class({
_hideUserListAndLogIn: function() { _hideUserListAndLogIn: function() {
this._setUserListExpanded(false); this._setUserListExpanded(false);
GdmUtil.cloneAndFadeOutActor(this._userSelectionBox); AuthUtil.cloneAndFadeOutActor(this._userSelectionBox);
this._askForUsernameAndLogIn(); this._askForUsernameAndLogIn();
}, },
@ -1111,7 +1111,7 @@ const LoginDialog = new Lang.Class({
_onUserListActivated: function(activatedItem) { _onUserListActivated: function(activatedItem) {
let tasks = [function() { let tasks = [function() {
return GdmUtil.cloneAndFadeOutActor(this._userSelectionBox); return AuthUtil.cloneAndFadeOutActor(this._userSelectionBox);
}, },
function() { function() {
this._setUserListExpanded(false); this._setUserListExpanded(false);

View File

@ -23,7 +23,7 @@ const Lang = imports.lang;
const LoginManager = imports.misc.loginManager; const LoginManager = imports.misc.loginManager;
const GdmUtil = imports.gdm.util; const AuthUtil = imports.ui.auth.util;
const PanelMenu = imports.ui.panelMenu; const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu; const PopupMenu = imports.ui.popupMenu;
@ -37,7 +37,7 @@ const PowerMenuButton = new Lang.Class({
this._loginManager = LoginManager.getLoginManager(); this._loginManager = LoginManager.getLoginManager();
this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA }); this._settings = new Gio.Settings({ schema: AuthUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::disable-restart-buttons', this._settings.connect('changed::disable-restart-buttons',
Lang.bind(this, this._updateVisibility)); Lang.bind(this, this._updateVisibility));

View File

@ -15,8 +15,8 @@ const ModalDialog = imports.ui.modalDialog;
const ShellEntry = imports.ui.shellEntry; const ShellEntry = imports.ui.shellEntry;
const UserWidget = imports.ui.userWidget; const UserWidget = imports.ui.userWidget;
const AuthUtil = imports.ui.auth.util;
const Batch = imports.misc.batch; const Batch = imports.misc.batch;
const GdmUtil = imports.gdm.util;
// The timeout before going back automatically to the lock screen (in seconds) // The timeout before going back automatically to the lock screen (in seconds)
const IDLE_TIMEOUT = 2 * 60; const IDLE_TIMEOUT = 2 * 60;
@ -40,7 +40,7 @@ const UnlockDialog = new Lang.Class({
this._firstQuestion = true; this._firstQuestion = true;
this._greeterClient = new Gdm.Client(); this._greeterClient = new Gdm.Client();
this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient, { reauthenticationOnly: true }); this._userVerifier = new AuthUtil.ShellUserVerifier(this._greeterClient, { reauthenticationOnly: true });
this._userVerified = false; this._userVerified = false;
this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion)); this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
@ -157,9 +157,9 @@ const UnlockDialog = new Lang.Class({
if (message) { if (message) {
this._promptMessage.text = message; this._promptMessage.text = message;
this._promptMessage.styleClass = styleClass; this._promptMessage.styleClass = styleClass;
GdmUtil.fadeInActor(this._promptMessage); AuthUtil.fadeInActor(this._promptMessage);
} else { } else {
GdmUtil.fadeOutActor(this._promptMessage); AuthUtil.fadeOutActor(this._promptMessage);
} }
}, },
@ -188,11 +188,11 @@ const UnlockDialog = new Lang.Class({
_showLoginHint: function(verifier, message) { _showLoginHint: function(verifier, message) {
this._promptLoginHint.set_text(message) this._promptLoginHint.set_text(message)
GdmUtil.fadeInActor(this._promptLoginHint); AuthUtil.fadeInActor(this._promptLoginHint);
}, },
_hideLoginHint: function() { _hideLoginHint: function() {
GdmUtil.fadeOutActor(this._promptLoginHint); AuthUtil.fadeOutActor(this._promptLoginHint);
}, },
_doUnlock: function() { _doUnlock: function() {

View File

@ -8,7 +8,7 @@ const Mainloop = imports.mainloop;
const Signals = imports.signals; const Signals = imports.signals;
const Batch = imports.misc.batch; const Batch = imports.misc.batch;
const Fprint = imports.gdm.fingerprint; const Fprint = imports.ui.auth.fingerprint;
const Main = imports.ui.main; const Main = imports.ui.main;
const Params = imports.misc.params; const Params = imports.misc.params;
const Tweener = imports.ui.tweener; const Tweener = imports.ui.tweener;

View File

@ -856,7 +856,7 @@ const PANEL_ITEM_IMPLEMENTATIONS = {
'battery': imports.ui.status.power.Indicator, 'battery': imports.ui.status.power.Indicator,
'lockScreen': imports.ui.status.lockScreenMenu.Indicator, 'lockScreen': imports.ui.status.lockScreenMenu.Indicator,
'keyboard': imports.ui.status.keyboard.InputSourceIndicator, 'keyboard': imports.ui.status.keyboard.InputSourceIndicator,
'powerMenu': imports.gdm.powerMenu.PowerMenuButton, 'powerMenu': imports.ui.auth.powerMenu.PowerMenuButton,
'userMenu': imports.ui.userMenu.UserMenuButton 'userMenu': imports.ui.userMenu.UserMenuButton
}; };

View File

@ -42,7 +42,7 @@ const _modes = {
hasNotifications: true, hasNotifications: true,
isGreeter: true, isGreeter: true,
isPrimary: true, isPrimary: true,
unlockDialog: imports.gdm.loginDialog.LoginDialog, unlockDialog: imports.ui.auth.loginDialog.LoginDialog,
components: ['polkitAgent'], components: ['polkitAgent'],
panel: { panel: {
left: [], left: [],
@ -89,7 +89,7 @@ const _modes = {
hasNotifications: true, hasNotifications: true,
isLocked: false, isLocked: false,
isPrimary: true, isPrimary: true,
unlockDialog: imports.ui.unlockDialog.UnlockDialog, unlockDialog: imports.ui.auth.unlockDialog.UnlockDialog,
components: ['networkAgent', 'polkitAgent', 'telepathyClient', components: ['networkAgent', 'polkitAgent', 'telepathyClient',
'keyring', 'recorder', 'autorunManager', 'automountManager'], 'keyring', 'recorder', 'autorunManager', 'automountManager'],
panel: { panel: {