[gnome-shell/wip/fmuellner/notification-redux+sass: 105/122] calendar: Remove Source/Notification again
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/notification-redux+sass: 105/122] calendar: Remove Source/Notification again
- Date: Tue, 17 Feb 2015 15:12:48 +0000 (UTC)
commit fd32c69cc523122e4260e96689691f46fb38f012
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Feb 17 02:49:19 2015 +0100
calendar: Remove Source/Notification again
In the end we kept using the ones in MessageTray, so kill those again.
js/ui/calendar.js | 176 -----------------------------------------------------
1 files changed, 0 insertions(+), 176 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index c3f7cbb..b570551 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -701,182 +701,6 @@ const Calendar = new Lang.Class({
Signals.addSignalMethods(Calendar.prototype);
-const Source = new Lang.Class({
- Name: 'MessageListSource',
-
- _init: function(title, iconName) {
- this.title = title;
- this.iconName = iconName;
-
- this.policy = this._createPolicy();
- },
-
- _createPolicy: function() {
- return new NotificationPolicy();
- },
-
- setTitle: function(newTitle) {
- this.title = newTitle;
- this.emit('title-changed');
- },
-
- // Called to create a new icon actor.
- // Provides a sane default implementation, override if you need
- // something more fancy.
- getIcon: function() {
- return new Gio.ThemedIcon({ name: this.iconName });
- },
-
- destroy: function(reason) {
- this.policy.destroy();
- this.emit('destroy');
- },
-
- //// Protected methods ////
- // To be overridden by subclasses
- open: function() {
- }
-});
-Signals.addSignalMethods(Source.prototype);
-
-// Notification:
-// @source: the notification's Source
-// @title: the title
-// @banner: the banner text
-// @params: optional additional params
-//
-// Creates a notification. In the banner mode, the notification
-// will show an icon, @title (in bold) and @banner, all on a single
-// line (with @banner ellipsized if necessary).
-//
-// By default, the icon shown is the same as the source's.
-// However, if @params contains a 'gicon' parameter, the passed in gicon
-// will be used.
-//
-// If @params contains 'bannerMarkup', with the value %true, then
-// the corresponding element is assumed to use pango markup. If the
-// parameter is not present for an element, then anything that looks
-// like markup in that element will appear literally in the output.
-//
-// If @params contains a 'clear' parameter with the value %true, then
-// the content and the action area of the notification will be cleared.
-// The content area is also always cleared if 'customContent' is false
-// because it might contain the @banner that didn't fit in the banner mode.
-//
-// If @params contains 'soundName' or 'soundFile', the corresponding
-// event sound is played when the notification is shown (if the policy for
-// @source allows playing sounds).
-const Notification = new Lang.Class({
- Name: 'Notification',
-
- _init: function(source, title, body, params) {
- this.source = source;
- this.icon = null;
- this.priority = Gio.NotificationPriority.NORMAL;
- this.resident = false;
- // 'transient' is a reserved keyword in JS, so we have to use an alternate variable name
- this.isTransient = false;
- this.forFeedback = false;
- this.acknowledged = false;
- this.buttons = [];
- this._soundName = null;
- this._soundFile = null;
- this._soundPlayed = false;
- this._defaultAction = null;
-
- this._updateProperties(title, body, params);
- },
-
- _updateProperties: function(title, body, params) {
- this.title = title;
- this.body = body;
-
- params = Params.parse(params, { gicon: null,
- soundName: null,
- soundFile: null });
-
- if (params.gicon)
- this.icon = params.gicon;
-
- if (this._soundName != params.soundName ||
- this._soundFile != params.soundFile) {
- this._soundName = params.soundName;
- this._soundFile = params.soundFile;
- this._soundPlayed = false;
- }
- },
-
- // update:
- // @title: the new title
- // @banner: the new banner
- // @params: as in the Notification constructor
- update: function(title, body, params) {
- this._updateProperties(title, body, params);
- this.emit('updated');
- },
-
- addButton: function(button, callback) {
- this.buttons.push({ label: button, callback: callback });
- },
-
- setDefaultAction: function(callback) {
- this.defaultAction = callback;
- },
-
- setPriority: function(priority) {
- this.priority = priority;
- },
-
- setResident: function(resident) {
- this.resident = resident;
- },
-
- setTransient: function(isTransient) {
- this.isTransient = isTransient;
- },
-
- setForFeedback: function(forFeedback) {
- this.forFeedback = forFeedback;
- },
-
- playSound: function() {
- if (this._soundPlayed)
- return;
-
- if (!this.source.policy.enableSound) {
- this._soundPlayed = true;
- return;
- }
-
- if (this._soundName) {
- if (this.source.app) {
- let app = this.source.app;
-
- global.play_theme_sound_full(0, this._soundName,
- this.title, null,
- app.get_id(), app.get_name());
- } else {
- global.play_theme_sound(0, this._soundName, this.title, null);
- }
- } else if (this._soundFile) {
- if (this.source.app) {
- let app = this.source.app;
-
- global.play_sound_file_full(0, this._soundFile,
- this.title, null,
- app.get_id(), app.get_name());
- } else {
- global.play_sound_file(0, this._soundFile, this.title, null);
- }
- }
- },
-
- destroy: function(reason) {
- this.emit('destroy', reason);
- }
-});
-Signals.addSignalMethods(Notification.prototype);
-
function _fixMarkup(text, allowMarkup) {
if (allowMarkup) {
// Support &, ", ', < and >, escape all other
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]