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:
parent
2141138a6f
commit
73d8f6c993
@ -17,11 +17,6 @@ misc/config.js: misc/config.js.in Makefile
|
||||
jsdir = $(pkgdatadir)/js
|
||||
|
||||
nobase_dist_js_DATA = \
|
||||
gdm/fingerprint.js \
|
||||
gdm/loginDialog.js \
|
||||
gdm/powerMenu.js \
|
||||
gdm/realmd.js \
|
||||
gdm/util.js \
|
||||
extensionPrefs/main.js \
|
||||
misc/batch.js \
|
||||
misc/config.js \
|
||||
@ -96,7 +91,6 @@ nobase_dist_js_DATA = \
|
||||
ui/status/bluetooth.js \
|
||||
ui/switcherPopup.js \
|
||||
ui/tweener.js \
|
||||
ui/unlockDialog.js \
|
||||
ui/userAvatar.js \
|
||||
ui/userMenu.js \
|
||||
ui/userWidget.js \
|
||||
@ -109,6 +103,12 @@ nobase_dist_js_DATA = \
|
||||
ui/workspacesView.js \
|
||||
ui/workspaceSwitcherPopup.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/autorunManager.js \
|
||||
ui/components/automountManager.js \
|
||||
|
@ -28,15 +28,15 @@ const Mainloop = imports.mainloop;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Lang = imports.lang;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Realmd = imports.gdm.realmd;
|
||||
const Realmd = imports.ui.auth.realmd;
|
||||
const Signals = imports.signals;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
const Gdm = imports.gi.Gdm;
|
||||
|
||||
const AuthUtil = imports.ui.auth.util;
|
||||
const Batch = imports.misc.batch;
|
||||
const Fprint = imports.gdm.fingerprint;
|
||||
const GdmUtil = imports.gdm.util;
|
||||
const Fprint = imports.ui.auth.fingerprint;
|
||||
const Main = imports.ui.main;
|
||||
const ModalDialog = imports.ui.modalDialog;
|
||||
const Tweener = imports.ui.tweener;
|
||||
@ -499,7 +499,7 @@ const LoginDialog = new Lang.Class({
|
||||
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('show-message', Lang.bind(this, this._showMessage));
|
||||
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._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));
|
||||
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_TEXT_KEY,
|
||||
this._settings.connect('changed::' + AuthUtil.BANNER_MESSAGE_TEXT_KEY,
|
||||
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));
|
||||
this._settings.connect('changed::' + GdmUtil.LOGO_KEY,
|
||||
this._settings.connect('changed::' + AuthUtil.LOGO_KEY,
|
||||
Lang.bind(this, this._updateLogo));
|
||||
|
||||
this._textureCache = St.TextureCache.get_default();
|
||||
@ -638,7 +638,7 @@ const LoginDialog = new Lang.Class({
|
||||
},
|
||||
|
||||
_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._disableUserList == undefined && disableUserList)
|
||||
@ -653,8 +653,8 @@ const LoginDialog = new Lang.Class({
|
||||
},
|
||||
|
||||
_updateBanner: function() {
|
||||
let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY);
|
||||
let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY);
|
||||
let enabled = this._settings.get_boolean(AuthUtil.BANNER_MESSAGE_KEY);
|
||||
let text = this._settings.get_string(AuthUtil.BANNER_MESSAGE_TEXT_KEY);
|
||||
|
||||
if (enabled && text) {
|
||||
this._bannerLabel.set_text(text);
|
||||
@ -676,7 +676,7 @@ const LoginDialog = new Lang.Class({
|
||||
},
|
||||
|
||||
_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._updateLogoTexture(this._textureCache, this._logoFileUri);
|
||||
@ -1079,7 +1079,7 @@ const LoginDialog = new Lang.Class({
|
||||
|
||||
_hideUserListAndLogIn: function() {
|
||||
this._setUserListExpanded(false);
|
||||
GdmUtil.cloneAndFadeOutActor(this._userSelectionBox);
|
||||
AuthUtil.cloneAndFadeOutActor(this._userSelectionBox);
|
||||
this._askForUsernameAndLogIn();
|
||||
},
|
||||
|
||||
@ -1111,7 +1111,7 @@ const LoginDialog = new Lang.Class({
|
||||
|
||||
_onUserListActivated: function(activatedItem) {
|
||||
let tasks = [function() {
|
||||
return GdmUtil.cloneAndFadeOutActor(this._userSelectionBox);
|
||||
return AuthUtil.cloneAndFadeOutActor(this._userSelectionBox);
|
||||
},
|
||||
function() {
|
||||
this._setUserListExpanded(false);
|
@ -23,7 +23,7 @@ const Lang = imports.lang;
|
||||
|
||||
const LoginManager = imports.misc.loginManager;
|
||||
|
||||
const GdmUtil = imports.gdm.util;
|
||||
const AuthUtil = imports.ui.auth.util;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
|
||||
@ -37,7 +37,7 @@ const PowerMenuButton = new Lang.Class({
|
||||
|
||||
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',
|
||||
Lang.bind(this, this._updateVisibility));
|
||||
|
@ -15,8 +15,8 @@ const ModalDialog = imports.ui.modalDialog;
|
||||
const ShellEntry = imports.ui.shellEntry;
|
||||
const UserWidget = imports.ui.userWidget;
|
||||
|
||||
const AuthUtil = imports.ui.auth.util;
|
||||
const Batch = imports.misc.batch;
|
||||
const GdmUtil = imports.gdm.util;
|
||||
|
||||
// The timeout before going back automatically to the lock screen (in seconds)
|
||||
const IDLE_TIMEOUT = 2 * 60;
|
||||
@ -40,7 +40,7 @@ const UnlockDialog = new Lang.Class({
|
||||
this._firstQuestion = true;
|
||||
|
||||
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._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
|
||||
@ -157,9 +157,9 @@ const UnlockDialog = new Lang.Class({
|
||||
if (message) {
|
||||
this._promptMessage.text = message;
|
||||
this._promptMessage.styleClass = styleClass;
|
||||
GdmUtil.fadeInActor(this._promptMessage);
|
||||
AuthUtil.fadeInActor(this._promptMessage);
|
||||
} else {
|
||||
GdmUtil.fadeOutActor(this._promptMessage);
|
||||
AuthUtil.fadeOutActor(this._promptMessage);
|
||||
}
|
||||
},
|
||||
|
||||
@ -188,11 +188,11 @@ const UnlockDialog = new Lang.Class({
|
||||
|
||||
_showLoginHint: function(verifier, message) {
|
||||
this._promptLoginHint.set_text(message)
|
||||
GdmUtil.fadeInActor(this._promptLoginHint);
|
||||
AuthUtil.fadeInActor(this._promptLoginHint);
|
||||
},
|
||||
|
||||
_hideLoginHint: function() {
|
||||
GdmUtil.fadeOutActor(this._promptLoginHint);
|
||||
AuthUtil.fadeOutActor(this._promptLoginHint);
|
||||
},
|
||||
|
||||
_doUnlock: function() {
|
@ -8,7 +8,7 @@ const Mainloop = imports.mainloop;
|
||||
const Signals = imports.signals;
|
||||
|
||||
const Batch = imports.misc.batch;
|
||||
const Fprint = imports.gdm.fingerprint;
|
||||
const Fprint = imports.ui.auth.fingerprint;
|
||||
const Main = imports.ui.main;
|
||||
const Params = imports.misc.params;
|
||||
const Tweener = imports.ui.tweener;
|
@ -856,7 +856,7 @@ const PANEL_ITEM_IMPLEMENTATIONS = {
|
||||
'battery': imports.ui.status.power.Indicator,
|
||||
'lockScreen': imports.ui.status.lockScreenMenu.Indicator,
|
||||
'keyboard': imports.ui.status.keyboard.InputSourceIndicator,
|
||||
'powerMenu': imports.gdm.powerMenu.PowerMenuButton,
|
||||
'powerMenu': imports.ui.auth.powerMenu.PowerMenuButton,
|
||||
'userMenu': imports.ui.userMenu.UserMenuButton
|
||||
};
|
||||
|
||||
|
@ -42,7 +42,7 @@ const _modes = {
|
||||
hasNotifications: true,
|
||||
isGreeter: true,
|
||||
isPrimary: true,
|
||||
unlockDialog: imports.gdm.loginDialog.LoginDialog,
|
||||
unlockDialog: imports.ui.auth.loginDialog.LoginDialog,
|
||||
components: ['polkitAgent'],
|
||||
panel: {
|
||||
left: [],
|
||||
@ -89,7 +89,7 @@ const _modes = {
|
||||
hasNotifications: true,
|
||||
isLocked: false,
|
||||
isPrimary: true,
|
||||
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
|
||||
unlockDialog: imports.ui.auth.unlockDialog.UnlockDialog,
|
||||
components: ['networkAgent', 'polkitAgent', 'telepathyClient',
|
||||
'keyring', 'recorder', 'autorunManager', 'automountManager'],
|
||||
panel: {
|
||||
|
Loading…
Reference in New Issue
Block a user