[gnome-shell] endSessionDialog: Use DialogType constants instead of magic numbers
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] endSessionDialog: Use DialogType constants instead of magic numbers
- Date: Thu, 11 Sep 2014 14:05:16 +0000 (UTC)
commit 0258c7a51843538fe2634b1a3e62e9f5e5e86c2d
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Sep 11 14:55:07 2014 +0100
endSessionDialog: Use DialogType constants instead of magic numbers
js/ui/endSessionDialog.js | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index 7222f6e..94ff4a3 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -134,11 +134,18 @@ const restartInstallDialogContent = {
showOtherSessions: true,
};
+const DialogType = {
+ LOGOUT: 0 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_LOGOUT */,
+ SHUTDOWN: 1 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_SHUTDOWN */,
+ RESTART: 2 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_RESTART */,
+ UPDATE_RESTART: 3
+};
+
const DialogContent = {
- 0 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_LOGOUT */: logoutDialogContent,
- 1 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_SHUTDOWN */: shutdownDialogContent,
- 2 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_RESTART */: restartDialogContent,
- 3: restartInstallDialogContent
+ DialogType.LOGOUT: logoutDialogContent,
+ DialogType.SHUTDOWN: shutdownDialogContent,
+ DialogType.RESTART: restartDialogContent,
+ DialogType.UPDATE_RESTART: restartInstallDialogContent
};
const MAX_USERS_IN_SESSION_DIALOG = 5;
@@ -677,8 +684,9 @@ const EndSessionDialog = new Lang.Class({
this._totalSecondsToStayOpen = totalSecondsToStayOpen;
this._type = type;
- if (this._type == 2 && this._updatesFile.query_exists(null))
- this._type = 3;
+ if (this._type == DialogType.RESTART &&
+ this._updatesFile.query_exists(null))
+ this._type = DialogType.UPDATE_RESTART;
this._applications = [];
this._applicationList.destroy_all_children();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]