├── .gitignore ├── Conf.js ├── EmailAccount.js ├── GmailScanner.js ├── InboxScanner.js ├── LICENSE ├── Notification.js ├── NotificationFactory.js ├── Notifier.js ├── OutlookScanner.js ├── README.md ├── console.js ├── contributors.txt ├── extension.js ├── locale ├── ar │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── ca │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── cs │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── da │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── de │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── el │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── es │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── eu │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── fr │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── gl │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── hi │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── hu │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── it │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── ja │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── nl │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── pl │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── pt │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── pt_BR │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── ru │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── se │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── sk │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── tr │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po ├── uk │ └── LC_MESSAGES │ │ ├── gmail_notify.mo │ │ └── gmail_notify.po └── ur │ └── LC_MESSAGES │ ├── gmail_notify.mo │ └── gmail_notify.po ├── metadata.json ├── prefs.js ├── rexml.js ├── schemas ├── gschemas.compiled └── org.gnome.shell.extensions.gmailmessagetray.gschema.xml └── screenshot.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .idea/ 3 | -------------------------------------------------------------------------------- /Conf.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | * Authors: 19 | * Adam Jabłoński 20 | * Shuming Chan 21 | * 22 | */ 23 | "use strict"; 24 | const Gettext = imports.gettext; 25 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 26 | const {Gio, GLib} = imports.gi; 27 | 28 | /** 29 | * Controls configuration for extension. 30 | */ 31 | var Conf = class { 32 | /** 33 | * Creates a new conf for an extension 34 | * @param {Extension} extension - the extension to control 35 | */ 36 | constructor(extension) { 37 | 38 | this.settings = Conf.getSettings(); 39 | if (extension === undefined) return; 40 | this.settings.connect("changed::timeout", () => { 41 | extension.stopTimeout(); 42 | extension.startTimeout(); 43 | }); 44 | } 45 | 46 | /** 47 | * Gets time between calls to email server. 48 | * @returns {number} 49 | */ 50 | getTimeout() { 51 | return this.settings.get_int('timeout'); 52 | } 53 | 54 | /** 55 | * Sets time between calls to email server. 56 | * @param {number} timeout 57 | */ 58 | setTimeout(timeout) { 59 | this.settings.set_int('timeout', timeout); 60 | } 61 | 62 | /** 63 | * Returns 1 if we should use default email client instead of browser. 0 otherwise. 64 | * @returns {number} 65 | */ 66 | getReader() { 67 | return this.settings.get_int('usemail'); 68 | } 69 | 70 | /** 71 | * Sets 1 if we should use default email client instead of browser. 0 otherwise. 72 | * @param {number} reader 73 | */ 74 | setReader(reader) { 75 | return this.settings.set_int('usemail', reader); 76 | } 77 | 78 | /** 79 | * Returns an array of ids of messages already shown 80 | * @returns {Array} array of ids 81 | */ 82 | getMessagesShown() { 83 | const val = this.settings.get_value('messagesshown'); 84 | return val.deep_unpack(); 85 | } 86 | 87 | /** 88 | * Replaces the array of ids of messages already shown 89 | * @param {Array} array - array of ids 90 | */ 91 | setMessagesShown(array) { 92 | const gVariant = new GLib.Variant('as', array); 93 | this.settings.set_value('messagesshown', gVariant); 94 | } 95 | 96 | /** 97 | * Returns the Gmail system label for the mailbox to read 98 | * @returns {string} 99 | */ 100 | getGmailSystemLabel() { 101 | return this.settings.get_string('gmailsystemlabel'); 102 | } 103 | 104 | /** 105 | * Sets the Gmail system label for the mailbox to read 106 | * @param {number} reader 107 | */ 108 | setGmailSystemLabel(gmail_system_label) { 109 | return this.settings.set_string('gmailsystemlabel', gmail_system_label); 110 | } 111 | 112 | /** 113 | * Gets the settings from Gio. 114 | * @returns {Gio.Settings} 115 | */ 116 | static getSettings() { 117 | let schemaName = 'org.gnome.shell.extensions.gmailmessagetray'; 118 | let schemaDir = Me.dir.get_child('schemas').get_path(); 119 | 120 | let schemaSource = Gio.SettingsSchemaSource.new_from_directory(schemaDir, 121 | Gio.SettingsSchemaSource.get_default(), 122 | false); 123 | let schema = schemaSource.lookup(schemaName, false); 124 | 125 | return new Gio.Settings({settings_schema: schema}); 126 | } 127 | 128 | /** 129 | * Sets up translations from locale directory. 130 | */ 131 | static setupTranslations() { 132 | const localeDir = Me.dir.get_child('locale').get_path(); 133 | Gettext.bindtextdomain('gmail_notify', localeDir); 134 | } 135 | }; 136 | -------------------------------------------------------------------------------- /EmailAccount.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | "use strict"; 20 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 21 | const Console = Me.imports.console.Console; 22 | const Gettext = imports.gettext.domain('gmail_notify'); 23 | const _ = Gettext.gettext; 24 | const InboxScanner = Me.imports.InboxScanner.InboxScanner; 25 | const Notifier = Me.imports.Notifier.Notifier; 26 | 27 | /** 28 | * Controls a single Gnome Online Account 29 | */ 30 | var EmailAccount = class { 31 | /** 32 | * Creates a new EmailAccount with a Gnome Online Account 33 | * @param {Conf} config 34 | * @param account - the Gnome Online Account 35 | */ 36 | constructor(config, account) { 37 | this.config = config; 38 | this.mailbox = account.get_account().presentation_identity; 39 | if (this.mailbox === undefined) this.mailbox = ''; 40 | this._scanner = new InboxScanner(account, this.config); 41 | this._notifier = new Notifier(this); 42 | this._console = new Console(); 43 | } 44 | 45 | /** 46 | * Creates a notification for an error and logs it to the console 47 | * @param {Error} error - the error to display 48 | */ 49 | _showError(error) { 50 | this._console.error(error); 51 | this._notifier.showError(error); 52 | } 53 | 54 | /** 55 | * Scans the current account for emails 56 | */ 57 | scanInbox() { 58 | try { 59 | this._notifier.removeErrors(); 60 | this._scanner.scanInbox(this._processData.bind(this)); 61 | } catch (err) { 62 | this._showError(err); 63 | } 64 | } 65 | 66 | /** 67 | * Displays error or emails to message tray. 68 | * @param {Error} err - the error to display 69 | * @param folders - a list of folders which contain unread emails 70 | * @private 71 | */ 72 | _processData(err, folders) { 73 | if (err) { 74 | this._showError(err); 75 | } else { 76 | try { 77 | const content = folders[0].list; 78 | this.updateContent(content); 79 | } catch (err) { 80 | this._showError(err); 81 | } 82 | } 83 | } 84 | 85 | /** 86 | * Displays notifications for unread emails 87 | * @param content - a list of unread emails 88 | */ 89 | updateContent(content) { 90 | if (content !== undefined) { 91 | content.reverse(); 92 | this._notifier.displayUnreadMessages(content); 93 | } 94 | } 95 | 96 | /** 97 | * Destroys all sources for the email account 98 | */ 99 | destroySources() { 100 | this._notifier.destroySources(); 101 | } 102 | }; 103 | 104 | -------------------------------------------------------------------------------- /GmailScanner.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | "use strict"; 20 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 21 | const XML = Me.imports.rexml; 22 | 23 | /** 24 | * Scans Gmail atom api for unread emails. 25 | */ 26 | var GmailScanner = class { 27 | /** 28 | * Creates a scanner with the given config 29 | * @param {string} mailbox - email account in the form "email@gmail.com" 30 | * @param {Conf} config - the extension configuration 31 | */ 32 | constructor(mailbox, config) { 33 | this._mailbox = mailbox; 34 | this._config = config; 35 | } 36 | 37 | /** 38 | * Parses an html response containing unread emails 39 | * @param {string} body - html response 40 | * @returns {Array} - list of parsed folders 41 | */ 42 | parseResponse(body) { 43 | const folders = []; 44 | const messages = []; 45 | const xmltx = body.substr(body.indexOf('>') + 1).replace('xmlns="http://purl.org/atom/ns#"', ''); 46 | const root = new XML.REXML(xmltx).rootElement; 47 | for (let i = 0; typeof (root.childElements[i]) !== 'undefined'; i++) { 48 | const entry = root.childElements[i]; 49 | if (entry.name === 'entry') { 50 | messages.push({ 51 | from: GmailScanner._decodeFrom(entry.childElement('author')), 52 | subject: entry.childElement('title').text, 53 | date: entry.childElement('modified').text, 54 | link: this._processLinkElement(entry.childElement('link')), 55 | id: entry.childElement('id').text 56 | }); 57 | } 58 | } 59 | folders.push({ 60 | name: 'inbox', 61 | list: messages 62 | }); 63 | return folders; 64 | } 65 | 66 | /** 67 | * Returns the URL for Google's Gmail API 68 | * @returns {string} - the URL 69 | */ 70 | getApiURL() { 71 | const gmail_system_label = this._config.getGmailSystemLabel(); 72 | const apiurl = "https://mail.google.com/mail/feed/atom/" + encodeURIComponent(gmail_system_label); 73 | return apiurl; 74 | } 75 | 76 | /** 77 | * Extracts the link used to navigate to the email. 78 | * @param {XML} linkElement - the link element to process 79 | * @returns {string} the URL pointing the the unread email 80 | * @private 81 | */ 82 | _processLinkElement(linkElement) { 83 | const url = linkElement.attribute('href').replace(/&/g, '&'); 84 | return url + "&authuser=" + this._mailbox; 85 | } 86 | 87 | /** 88 | * Converts the author element to a readable string 89 | * @param {XML} authorElement - the element containing "from" information 90 | * @returns {string} - the string 91 | * @private 92 | */ 93 | static _decodeFrom(authorElement) { 94 | return authorElement.childElement('name').text + " <" + authorElement.childElement('email').text + ">"; 95 | } 96 | }; 97 | -------------------------------------------------------------------------------- /InboxScanner.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | "use strict"; 20 | const Main = imports.ui.main; 21 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 22 | const Console = Me.imports.console.Console; 23 | const GLib = imports.gi.GLib; 24 | const Soup = imports.gi.Soup; 25 | const OutlookScanner = Me.imports.OutlookScanner.OutlookScanner; 26 | const GmailScanner = Me.imports.GmailScanner.GmailScanner; 27 | const Gettext = imports.gettext.domain('gmail_notify'); 28 | const _ = Gettext.gettext; 29 | 30 | /** 31 | * Scans an email account of any supported type using online APIs 32 | */ 33 | var InboxScanner = class { 34 | /** 35 | * Creates a new scanner using a Gnome Online Account 36 | * @param account - Gnome Online Account 37 | * @param {Conf} config - the extension configuration 38 | * @param {number} [timeout=1] - the request timeout in seconds (optional, default is 1 second) 39 | */ 40 | constructor(account, config, timeout = 1) { 41 | this._config = config; 42 | 43 | this._account = account; 44 | this._mailbox = account.get_account().presentation_identity; 45 | this._provider = this._account.get_account().provider_type; 46 | this._scanner = this._createScanner(); 47 | this._sess = new Soup.Session(); 48 | this._console = new Console(); 49 | this._sess.set_timeout(timeout); 50 | } 51 | 52 | /** 53 | * A callback to execute after the GET request is complete 54 | * @callback requestCallback 55 | * @param {Error} err - any error that occurred 56 | * @param {Array} [folders] - a list of folders containing unread emails 57 | * @param [account] - the Gnome Online Account of the request 58 | */ 59 | /** 60 | * Scans the inbox and returns a callback 61 | * @param {requestCallback} callback 62 | */ 63 | scanInbox(callback) { 64 | const msg = Soup.Message.new("GET", this._scanner.getApiURL()); 65 | this._getCurrentToken(token => { 66 | msg.request_headers.append('Authorization', 'Bearer ' + token); 67 | this._sess.send_and_read_async(msg, GLib.PRIORITY_DEFAULT, null, (sess, result) => { 68 | if (msg.get_status() === 200) { 69 | const bytes = sess.send_and_read_finish(result); 70 | const decoder = new TextDecoder('utf-8'); 71 | const body = decoder.decode(bytes.get_data()); 72 | const folders = this._scanner.parseResponse(body, callback); 73 | callback(null, folders, this._account); 74 | } else if (msg.get_status() !== 2 && msg.get_status() !== 3) { 75 | const err = new Error('Status ' + msg.get_status() + ': ' + msg.get_reason_phrase()); 76 | callback(err); 77 | } 78 | }); 79 | }); 80 | } 81 | 82 | /** 83 | * Create a new scanner chosen by the current provider 84 | * @returns {GmailScanner|OutlookScanner} the scanner created 85 | * @private 86 | */ 87 | _createScanner() { 88 | switch (this._provider) { 89 | case 'google': 90 | return new GmailScanner(this._mailbox, this._config); 91 | case 'windows_live': 92 | return new OutlookScanner(); 93 | default: 94 | throw new Error("Provider type not found"); 95 | } 96 | } 97 | 98 | /** 99 | * Returns the most recent auth token for the current Gnome Online Account 100 | * @param callback - a callback that is called with the token as a parameter 101 | * @returns {string} the auth token 102 | * @private 103 | */ 104 | _getCurrentToken(callback) { 105 | this._account.get_oauth2_based().call_get_access_token(null, (proxy, asyncResult) => { 106 | try { 107 | const [, token] = this._account.get_oauth2_based().call_get_access_token_finish(asyncResult); 108 | callback(token); 109 | } catch (err) { 110 | if (!err.message.includes("Goa.Error.Failed")) { 111 | const message = _("Failed to get Authorization for {0}"); 112 | Main.notifyError(message.replace("{0}", this._mailbox)); 113 | } 114 | this._console.error(err); 115 | } 116 | }); 117 | } 118 | }; 119 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /Notification.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | * Authors: 19 | * Adam Jabłoński 20 | * Shuming Chan 21 | * 22 | */ 23 | "use strict"; 24 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 25 | const Console = Me.imports.console.Console; 26 | const MessageTray = imports.ui.messageTray; 27 | const {Gio, GLib, GObject} = imports.gi; 28 | 29 | const escaped_one_to_xml_special_map = { 30 | '&': '&', 31 | ''': "'", 32 | '"': '"', 33 | '<': '<', 34 | '>': '>' 35 | }; 36 | const unescape_regex = /("|'|<|>|&)/g; 37 | 38 | /** 39 | * A single notification in the message tray. 40 | * @class Notification 41 | */ 42 | var Notification = GObject.registerClass( 43 | class extends MessageTray.Notification { 44 | /** 45 | * Creates a notification in the specified source 46 | * @param {Source} source - the source to create the notification in 47 | * @param content - information to display in notification 48 | * @param iconName - the name of the icon to display in the notification 49 | */ 50 | _init(source, content, iconName) { 51 | try { 52 | const date = new Date(content.date); 53 | const title = Notification._unescapeXML(content.subject); 54 | const gicon = new Gio.ThemedIcon({name: iconName}); 55 | let banner = Notification._unescapeXML(content.from); 56 | const params = { 57 | gicon: gicon 58 | }; 59 | 60 | Notification._addDateTimeToParams(date, params); 61 | 62 | super._init(source, title, banner, params); 63 | } catch (err) { 64 | const console = new Console(); 65 | console.error(err); 66 | } 67 | } 68 | 69 | /** 70 | * Unescapes special characters found in XML 71 | * @param {?string} xmlString - the string to unescape 72 | * @returns {string} - the unescaped string 73 | * @private 74 | */ 75 | static _unescapeXML(xmlString) { 76 | if (xmlString === null) return ""; 77 | return xmlString.replace(unescape_regex, 78 | (str, item) => escaped_one_to_xml_special_map[item]); 79 | } 80 | 81 | /** 82 | * Adds date and time to the params object as unix local time 83 | * @param {Date} date - the date to add 84 | * @param params - parameters for creating a {@link MessageTray.Notification} 85 | * @private 86 | */ 87 | static _addDateTimeToParams(date, params) { 88 | const unix_local = date.getTime() / 1000; 89 | params.datetime = GLib.DateTime.new_from_unix_local(unix_local); 90 | } 91 | 92 | }); 93 | -------------------------------------------------------------------------------- /NotificationFactory.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | "use strict"; 20 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 21 | const Main = imports.ui.main; 22 | const Source = imports.ui.messageTray.Source; 23 | const Console = Me.imports.console.Console; 24 | const Gettext = imports.gettext.domain('gmail_notify'); 25 | const _ = Gettext.gettext; 26 | const Notification = Me.imports.Notification.Notification; 27 | 28 | /** 29 | * Creates and displays notifications. 30 | */ 31 | var NotificationFactory = class { 32 | 33 | /** 34 | * Creates new notifier for an email account. 35 | * @param {EmailAccount} emailAccount 36 | */ 37 | constructor(emailAccount) { 38 | this._mailbox = emailAccount.mailbox; 39 | this.sources = new Set(); 40 | this._errorSource = this._newErrorSource(); 41 | this._console = new Console(); 42 | } 43 | 44 | /** 45 | * Creates a notification for a single unread email 46 | * @param msg - the information about the email 47 | * @param {function} cb - callback that runs when notification is clicked 48 | */ 49 | createEmailNotification(msg, cb) { 50 | this._createNotification(msg, 'mail-unread', true, false, cb); 51 | } 52 | 53 | /** 54 | * Creates a notification for an error 55 | * @param content - the information about the error 56 | * @param {function} cb - callback that runs when notification is clicked 57 | */ 58 | createErrorNotification(content, cb) { 59 | this._createNotificationWithSource(this._errorSource, content, 'dialog-error', false, false, cb); 60 | } 61 | 62 | /** 63 | * Destroys all sources for the email account 64 | */ 65 | destroySources() { 66 | for (let source of this.sources) { 67 | source.destroy(); 68 | } 69 | } 70 | 71 | /** 72 | * Removes all errors currently displaying for this email account 73 | */ 74 | removeErrors() { 75 | this._errorSource = this._newErrorSource(); 76 | } 77 | 78 | /** 79 | * Creates a new source with an error icon 80 | * @returns {Source} - the error source 81 | * @private 82 | */ 83 | _newErrorSource() { 84 | if (this._errorSource !== undefined) { 85 | this.sources.delete(this._errorSource); 86 | this._errorSource.destroy(); 87 | } 88 | const source = new Source(this._mailbox, 'dialog-error'); 89 | this.sources.add(source); 90 | return source; 91 | } 92 | 93 | /** 94 | * Creates a new notification with it's own source 95 | * @param content - an object containing all information about the email 96 | * @param {string} iconName - the name of the icon that will display 97 | * @param {boolean} popUp - true if notification should display outside the message tray 98 | * @param {boolean} permanent - true if notification should not go away if you click on it 99 | * @param {function} cb - callback that runs when notification is clicked 100 | * @returns {Notification} - the notification created 101 | */ 102 | _createNotification(content, iconName, popUp, permanent, cb) { 103 | const source = new Source(this._mailbox, 'mail-read'); 104 | return this._createNotificationWithSource(source, content, iconName, popUp, permanent, cb); 105 | } 106 | 107 | /** 108 | * Creates a notification with the given source 109 | * @param {Source} source - the source used to create the notification 110 | * @param content - an object containing all information about the email 111 | * @param {string} iconName - the name of the icon that will display 112 | * @param {boolean} popUp - true if notification should display outside the message tray 113 | * @param {boolean} permanent - true if notification should not go away if you click on it 114 | * @param {function} cb - callback that runs when notification is clicked 115 | * @returns {Notification} - the notification created 116 | * @private 117 | */ 118 | _createNotificationWithSource(source, content, iconName, popUp, permanent, cb) { 119 | Main.messageTray.add(source); 120 | const notification = new Notification(source, content, iconName); 121 | notification.connect('activated', () => { 122 | try { 123 | cb(); 124 | } catch (err) { 125 | this._console.error(err); 126 | } 127 | }); 128 | notification.connect('destroy', (destroyed_source) => { 129 | this.sources.delete(destroyed_source.source); 130 | }); 131 | 132 | if (permanent) { 133 | notification.setResident(true); 134 | } 135 | if (popUp) { 136 | source.showNotification(notification); 137 | } else { 138 | notification.acknowledged = true; 139 | source.pushNotification(notification); 140 | } 141 | 142 | this.sources.add(source); 143 | return notification; 144 | } 145 | }; 146 | -------------------------------------------------------------------------------- /Notifier.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | "use strict"; 20 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 21 | const Source = imports.ui.messageTray.Source; 22 | const Gettext = imports.gettext.domain('gmail_notify'); 23 | const _ = Gettext.gettext; 24 | const Gio = imports.gi.Gio; 25 | const Main = imports.ui.main; 26 | const Util = imports.misc.util; 27 | const NotificationFactory = Me.imports.NotificationFactory.NotificationFactory; 28 | 29 | /** 30 | * Controls notifications in message tray. 31 | */ 32 | var Notifier = class { 33 | /** 34 | * Creates new notifier for an email account. 35 | * @param {EmailAccount} emailAccount 36 | */ 37 | constructor(emailAccount) { 38 | this._config = emailAccount.config; 39 | this._mailbox = emailAccount.mailbox; 40 | this._notificationFactory = new NotificationFactory(emailAccount); 41 | } 42 | 43 | /** 44 | * Destroys all sources for the email account 45 | */ 46 | destroySources() { 47 | this._notificationFactory.destroySources(); 48 | } 49 | 50 | /** 51 | * Creates a notification for each unread email 52 | * @param content - a list of unread emails 53 | */ 54 | displayUnreadMessages(content) { 55 | const messagesShown = new Set(this._config.getMessagesShown()); 56 | for (let msg of content) { 57 | if (!messagesShown.has(msg.id)) { 58 | messagesShown.add(msg.id); 59 | const _msg = msg; // need this because variables aren't scoped properly in Gnome Shell 3.24 60 | const callback = () => { 61 | this._openEmail(_msg.link); 62 | }; 63 | this._notificationFactory.createEmailNotification(msg, callback); 64 | } 65 | } 66 | this._config.setMessagesShown([...messagesShown]); 67 | } 68 | 69 | /** 70 | * Creates a notification for an error 71 | * @param {Error} error - the error to display 72 | */ 73 | showError(error) { 74 | const content = { 75 | from: error.message, 76 | date: new Date(), 77 | subject: this._mailbox 78 | }; 79 | const cb = () => { 80 | this._openBrowser(Me.metadata["url"]); 81 | }; 82 | this._notificationFactory.createErrorNotification(content, cb); 83 | } 84 | 85 | /** 86 | * Removes all errors currently displaying for this email account 87 | */ 88 | removeErrors() { 89 | this._notificationFactory.removeErrors(); 90 | } 91 | 92 | /** 93 | * Opens the default browser with the given link 94 | * @param {undefined | string} link - the URL to open 95 | * @private 96 | */ 97 | _openBrowser(link) { 98 | if (link === '' || link === undefined) { 99 | link = 'https://' + this._mailbox.match(/@(.*)/)[1]; 100 | } 101 | const defaultBrowser = Gio.app_info_get_default_for_uri_scheme("http").get_executable(); 102 | Util.trySpawnCommandLine(defaultBrowser + " " + link); 103 | } 104 | 105 | /** 106 | * Opens email using either browser or email client 107 | * @param {undefined | string} link - the link to open 108 | * @private 109 | */ 110 | _openEmail(link) { 111 | if (this._config.getReader() === 0) { 112 | this._openBrowser(link); 113 | } else { 114 | const mailto = Gio.app_info_get_default_for_uri_scheme("mailto"); 115 | if (mailto === null) { 116 | const error = _("No default email client found"); 117 | Main.notifyError(error); 118 | throw new Error(error); 119 | } 120 | const defaultMailClient = mailto.get_executable(); 121 | Util.trySpawnCommandLine(defaultMailClient); 122 | } 123 | } 124 | }; 125 | -------------------------------------------------------------------------------- /OutlookScanner.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | "use strict"; 20 | 21 | /** 22 | * Scans Outlook json api for unread emails. 23 | */ 24 | var OutlookScanner = class { 25 | constructor() { 26 | } 27 | 28 | /** 29 | * Parses a JSON response for unread emails 30 | * @param {string} body - JSON containing emails 31 | * @returns {Array} - a list of folders containing unread emails 32 | */ 33 | parseResponse(body) { 34 | const folders = []; 35 | const messages = []; 36 | const parsedBody = JSON.parse(body); 37 | const value = parsedBody.value; 38 | for (let entry of value) { 39 | messages.push({ 40 | from: OutlookScanner._decodeFrom(entry.From), 41 | subject: entry.Subject, 42 | date: entry.ReceivedDateTime, 43 | link: entry.WebLink, 44 | id: entry.Id 45 | }); 46 | } 47 | folders.push({ 48 | name: 'inbox', 49 | list: messages 50 | }); 51 | return folders; 52 | } 53 | 54 | /** 55 | * Returns the Outlook API URL 56 | * @returns {string} - the URL 57 | */ 58 | getApiURL() { 59 | return "https://outlook.office.com/api/v2.0/me/MailFolders/Inbox/messages?$select=From,Subject,ReceivedDateTime,WebLink"; 60 | } 61 | 62 | /** 63 | * Converts the 'from' object into a readable string 64 | * @param from - an object containing 'from' information 65 | * @returns {string} - the readable string 66 | * @private 67 | */ 68 | static _decodeFrom(from) { 69 | if (from === undefined) return ""; 70 | const email = from.EmailAddress; 71 | return email.Name + " <" + email.Address + ">"; 72 | } 73 | }; 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Gnome Email Notifications 2 | 3 | Utilizes Gnome Online Accounts to login to Gmail/Outlook and check your incoming email 4 | 5 | ## Installation 6 | 7 | 1. Install gnome-shell version 3.22 or later. 8 | 9 | 2. Sign in with your Google and/or Microsoft account in Gnome Online Accounts settings. 10 | 11 | 3. Either install from https://extensions.gnome.org/extension/1230/gmail-message-tray/ 12 | OR 13 | run `git clone --depth 1 https://github.com/shumingch/gnome-email-notifications ~/.local/share/gnome-shell/extensions/GmailMessageTray@shuming0207.gmail.com` 14 | 15 | ## Screenshot 16 | 17 | ![Gnome Email Notifications](screenshot.png "Gnome Email Notifications") 18 | 19 | ## Troubleshooting 20 | 21 | 1. For any errors, try rebooting or signing back in to your Gnome Online Accounts. 22 | 2. To see logs, enter `journalctl | grep "Gnome Email Notification"` into terminal. 23 | 24 | -------------------------------------------------------------------------------- /console.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Gnome Email Notifications contributors 3 | * 4 | * Gnome Email Notifications Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gnome Email Notifications Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | "use strict"; 19 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 20 | function Console() { 21 | this.extensionString = "[" + Me.metadata['name'] + "] "; 22 | } 23 | Console.prototype.log = function (...args) { 24 | log(this.extensionString + args.join()); 25 | }; 26 | Console.prototype.error = function (err) { 27 | this.log(err.message, err.stack); 28 | }; 29 | Console.prototype.json = function (obj) { 30 | this.log(JSON.stringify(obj)); 31 | }; -------------------------------------------------------------------------------- /contributors.txt: -------------------------------------------------------------------------------- 1 | Shuming Chan 2 | Stuart Langridge 3 | Adam Jablonski 4 | -------------------------------------------------------------------------------- /extension.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gmail Message Tray contributors 3 | * 4 | * Gmail Message Tray Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gmail Message Tray Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | * Authors: 19 | * Adam Jabłoński 20 | * Shuming Chan 21 | * 22 | */ 23 | "use strict"; 24 | /** @external imports*/ 25 | const GLib = imports.gi.GLib; 26 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 27 | const Mainloop = imports.mainloop; 28 | const Main = imports.ui.main; 29 | const Console = Me.imports.console.Console; 30 | const Conf = Me.imports.Conf.Conf; 31 | const EmailAccount = Me.imports.EmailAccount.EmailAccount; 32 | 33 | const _version = Me.metadata['version']; 34 | 35 | let extension; 36 | let Goa; 37 | try { 38 | Goa = imports.gi.Goa; 39 | } catch (err) { 40 | log("[" + Me.metadata['name'] + "] " + err.message + ", " + err.stack); 41 | } 42 | 43 | /** 44 | * Initializes translations for the extension 45 | */ 46 | function init() { 47 | log("[" + Me.metadata['name'] + "] Init version " + _version); 48 | Conf.setupTranslations(); 49 | } 50 | 51 | const supportedProviders = new Set(["google", "windows_live"]); 52 | 53 | /** 54 | * An instance of this gnome extension 55 | */ 56 | var Extension = class { 57 | constructor() { 58 | this._console = new Console(); 59 | this._console.log('Enabling ' + _version); 60 | /** @type Conf */ 61 | this.config = new Conf(this); 62 | this.checkMailTimeout = null; 63 | Extension._libCheck(); 64 | this._getEmailAccounts(emailAccounts => { 65 | this.goaAccounts = emailAccounts; 66 | this.startTimeout(); 67 | this.initialCheckMail = GLib.timeout_add_seconds(0, 5, () => { 68 | this._checkMail(); 69 | this.initialCheckMail = null; 70 | return false; 71 | }); 72 | }); 73 | } 74 | 75 | /** 76 | * Checks the mail for each account available 77 | * @private 78 | */ 79 | _checkMail() { 80 | this._console.log("Checking mail"); 81 | for (let account of this.goaAccounts) { 82 | account.scanInbox(); 83 | } 84 | } 85 | 86 | /** 87 | * Returns a list of all Gnome Online Accounts 88 | * @param callback - callback that is called with {EmailAccount[]} as parameter 89 | * @private 90 | */ 91 | _getEmailAccounts(callback) { 92 | const emailAccounts = []; 93 | Goa.Client.new(null, (proxy, asyncResult) => { 94 | const aClient = Goa.Client.new_finish(asyncResult); 95 | const accounts = aClient.get_accounts(); 96 | 97 | for (let account of accounts) { 98 | const provider = account.get_account().provider_type; 99 | if (supportedProviders.has(provider)) { 100 | emailAccounts.push(new EmailAccount(this.config, account)); 101 | } 102 | } 103 | if (emailAccounts.length === 0) { 104 | Main.notifyError(_("No email accounts found")); 105 | throw new Error("No email accounts found"); 106 | } 107 | callback(emailAccounts); 108 | } 109 | ); 110 | } 111 | 112 | /** 113 | * Checks if required libraries are installed 114 | * @private 115 | */ 116 | static _libCheck() { 117 | if (Goa === undefined) { 118 | Main.notifyError(_("Install gir1.2-goa")); 119 | throw new Error("No Goa found"); 120 | } 121 | } 122 | 123 | /** 124 | * Checks mail using timeout from config 125 | */ 126 | startTimeout() { 127 | this.checkMailTimeout = GLib.timeout_add_seconds(0, this.config.getTimeout(), () => { 128 | this._checkMail(); 129 | return true; 130 | }); 131 | } 132 | 133 | /** 134 | * Stops checking mail 135 | */ 136 | stopTimeout() { 137 | Mainloop.source_remove(this.checkMailTimeout); 138 | if (this.initialCheckMail !== null) Mainloop.source_remove(this.initialCheckMail); 139 | } 140 | 141 | /** 142 | * Stops and cleans up extension 143 | */ 144 | destroy() { 145 | this.stopTimeout(); 146 | for (let account of this.goaAccounts) { 147 | account.destroySources(); 148 | } 149 | } 150 | }; 151 | 152 | /** 153 | * Sets up the extension 154 | */ 155 | function enable() { 156 | try { 157 | extension = new Extension(); 158 | } catch (err) { 159 | log("[" + Me.metadata['name'] + "] " + err); 160 | } 161 | } 162 | 163 | /** 164 | * Stops and cleans up extension 165 | */ 166 | function disable() { 167 | try { 168 | extension.destroy(); 169 | extension = null; 170 | } catch (err) { 171 | log("[" + Me.metadata['name'] + "] " + err); 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /locale/ar/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/ar/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/ar/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-04 19:59+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: English\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "استخدام عميل البريد الإلكتروني الافتراضي بدلا من المتصفح" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "تحقق كل {0} ثانية : " 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "استخدام عميل البريد الإلكتروني الافتراضي بدلا من المتصفح" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | 49 | -------------------------------------------------------------------------------- /locale/ca/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/ca/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/ca/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-27 22:44+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "" 32 | "Utilitzar el client de correu electrònic per defecte en comptes del navegador" 33 | 34 | #: prefs.js:47 35 | msgid "Check every {0} sec: " 36 | msgstr "Comprobar cada {0} segons:" 37 | 38 | #: prefs.js:50 39 | msgid "Use default email client instead of browser" 40 | msgstr "" 41 | "Utilitzar el client de correu electrònic per defecte en comptes del navegador" 42 | 43 | #: prefs.js:63 44 | msgid "Gmail account number" 45 | msgstr "" 46 | 47 | #: prefs.js:63 48 | msgid "Selects the correct Gmail account if more than one is present" 49 | msgstr "" 50 | 51 | -------------------------------------------------------------------------------- /locale/cs/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/cs/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/cs/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | # 2 | # Adam Jabłoński , 2012. 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: gmail_notify\n" 7 | "Report-Msgid-Bugs-To: \n" 8 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 9 | "PO-Revision-Date: 2012-01-17 19:08+0100\n" 10 | "Last-Translator: Adam Jabłoński \n" 11 | "Language-Team: \n" 12 | "Language: \n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 17 | "X-Poedit-Basepath: .\n" 18 | "X-Poedit-Language: Italian\n" 19 | "X-Poedit-SourceCharset: utf-8\n" 20 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 21 | "gmail_notify@jablona123.pl\n" 22 | 23 | #: extension.js:108 24 | msgid "No email accounts found" 25 | msgstr "" 26 | 27 | #: extension.js:119 28 | msgid "Install gir1.2-goa" 29 | msgstr "" 30 | 31 | #: MailClientFocuser.js:46 32 | #, fuzzy 33 | msgid "No default email client found" 34 | msgstr "Použít poštovního klienta místo prohlížeče" 35 | 36 | #: prefs.js:47 37 | msgid "Check every {0} sec: " 38 | msgstr "Kontrolovat každých {0} sec:" 39 | 40 | #: prefs.js:50 41 | msgid "Use default email client instead of browser" 42 | msgstr "Použít poštovního klienta místo prohlížeče" 43 | 44 | #: prefs.js:63 45 | msgid "Gmail account number" 46 | msgstr "" 47 | 48 | #: prefs.js:63 49 | msgid "Selects the correct Gmail account if more than one is present" 50 | msgstr "" 51 | 52 | -------------------------------------------------------------------------------- /locale/da/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/da/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/da/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-22 14:29+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: English\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Brug standard mailklient i stedet for browser" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Opdater hver {0} sek:" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Brug standard mailklient i stedet for browser" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/de/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/de/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/de/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-15 20:11+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: German\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Benutze E-Mail Programm statt Internet-Browser" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Überprüfung alle {0} Sek.:" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Benutze E-Mail Programm statt Internet-Browser" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/el/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/el/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/el/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-25 22:58+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "" 32 | "Χρήση προεπιλεγμένου προγράμματος ανάγνωσης e-mail αντί για τον browser" 33 | 34 | #: prefs.js:47 35 | msgid "Check every {0} sec: " 36 | msgstr "Έλεγχος κάθε {0} δευτερόλεπτα: " 37 | 38 | #: prefs.js:50 39 | msgid "Use default email client instead of browser" 40 | msgstr "" 41 | "Χρήση προεπιλεγμένου προγράμματος ανάγνωσης e-mail αντί για τον browser" 42 | 43 | #: prefs.js:63 44 | msgid "Gmail account number" 45 | msgstr "" 46 | 47 | #: prefs.js:63 48 | msgid "Selects the correct Gmail account if more than one is present" 49 | msgstr "" 50 | -------------------------------------------------------------------------------- /locale/es/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/es/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/es/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-15 18:31+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Usar el cliente de e-mail predeterminado en vez del navegador web" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Revisar cada {0} segundos:" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Usar el cliente de e-mail predeterminado en vez del navegador web" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/eu/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/eu/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/eu/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-11-12 18:41+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: Basque\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Nabigatzailea barik, mezuetarako aplikazio lehenetsia erabili" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "{0} segundutan behin berrikusi:" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Nabigatzailea barik, mezuetarako aplikazio lehenetsia erabili" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/fr/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/fr/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/fr/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-13 18:18+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: French\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Utiliser le client email par défaut au lieu du navigateur" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Vérifiez tous les {0} sec: " 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Utiliser le client email par défaut au lieu du navigateur" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/gl/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/gl/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/gl/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-13 18:06+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: Galego\n" 9 | "Language: gl\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Galego\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Usar cliente de correo por defecto no lugar do navegador" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Comprobar cada {0} seg: " 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Usar cliente de correo por defecto no lugar do navegador" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/hi/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/hi/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/hi/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-04 17:57+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: Benjamin \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: Hindi\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "वेब ब्राउज़र के बजाय ईमेल पाठक का उपयोग करना" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "हर {0} सेकंड जाँचना: " 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "वेब ब्राउज़र के बजाय ईमेल पाठक का उपयोग करना" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/hu/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/hu/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/hu/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-13 20:33+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Használja az alapértelmezett email klienst a böngésző helyett" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Ellenőrzés {0} másodpercenként" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Használja az alapértelmezett email klienst a böngésző helyett" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/it/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/it/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/it/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-07 20:42+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Usa il client e-mail preferito al posto del browser" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Controlla ogni {0} secondi: " 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Usa il client e-mail preferito al posto del browser" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/ja/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/ja/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/ja/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-29 17:42+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: Japanese\n" 9 | "Language: Japanese\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: English\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "ブラウザーではなくデフォルトメールクライアントを使用する" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "{0} 秒ごとにチェックする" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "ブラウザーではなくデフォルトメールクライアントを使用する" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/nl/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/nl/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/nl/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2021-07-26 21:00+0200\n" 7 | "Last-Translator: Heimen Stoffels \n" 8 | "Language-Team: Dutch \n" 9 | "Language: nl\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: UTF-8\n" 16 | "X-Generator: Poedit 3.0\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "Er zijn geen e-mailaccounts ingesteld" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "Installeer gir1.2-goa" 27 | 28 | #: MailClientFocuser.js:46 29 | msgid "No default email client found" 30 | msgstr "Er is geen standaard e-mailtoepassing aangetroffen" 31 | 32 | #: prefs.js:47 33 | msgid "Check every {0} sec: " 34 | msgstr "Elke {0} sec. controleren: " 35 | 36 | #: prefs.js:50 37 | msgid "Use default email client instead of browser" 38 | msgstr "Standaard e-mailtoepassing gebruiken in plaats van webbrowser" 39 | 40 | #: prefs.js:63 41 | msgid "Gmail account number" 42 | msgstr "Gmail-accountnummer" 43 | 44 | #: prefs.js:63 45 | msgid "Selects the correct Gmail account if more than one is present" 46 | msgstr "Kies het juiste Gmail-account (indien meer dan één)" 47 | -------------------------------------------------------------------------------- /locale/pl/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/pl/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/pl/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-17 19:07+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: Polish\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Użyj klienta poczty zamiast przeglądarki" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Sprawdzaj co {0} sek.:" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Użyj klienta poczty zamiast przeglądarki" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/pt/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/pt/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/pt/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2015-06-11 11:02+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: pt\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: UTF-8\n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 17 | "X-Generator: Poedit 1.8.1\n" 18 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 19 | "gmail_notify@jablona123.pl\n" 20 | 21 | #: extension.js:108 22 | msgid "No email accounts found" 23 | msgstr "" 24 | 25 | #: extension.js:119 26 | msgid "Install gir1.2-goa" 27 | msgstr "" 28 | 29 | #: MailClientFocuser.js:46 30 | #, fuzzy 31 | msgid "No default email client found" 32 | msgstr "Usar o cliente de email padrão ao invés do navegador" 33 | 34 | #: prefs.js:47 35 | msgid "Check every {0} sec: " 36 | msgstr "Checar a cada {0} segundos:" 37 | 38 | #: prefs.js:50 39 | msgid "Use default email client instead of browser" 40 | msgstr "Usar o cliente de email padrão ao invés do navegador" 41 | 42 | #: prefs.js:63 43 | msgid "Gmail account number" 44 | msgstr "" 45 | 46 | #: prefs.js:63 47 | msgid "Selects the correct Gmail account if more than one is present" 48 | msgstr "" 49 | -------------------------------------------------------------------------------- /locale/pt_BR/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/pt_BR/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/pt_BR/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-22 14:31+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: English\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Usar o cliente de email padrão ao invés do navegador" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Checar a cada {0} segundos:" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Usar o cliente de email padrão ao invés do navegador" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/ru/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/ru/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/ru/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-04 20:01+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Использовать почтовый клиент вместо браузера" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Проверять каждые {0} секунд " 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Использовать почтовый клиент вместо браузера" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/se/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/se/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/se/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-01-16 17:54+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-Language: Italian\n" 16 | "X-Poedit-SourceCharset: utf-8\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Använd standard email-klient i stället för browser" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Hämta varje {0} sek: " 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Använd standard email-klient i stället för browser" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /locale/sk/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/sk/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/sk/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | # Dušan Kazik , 2015. 2 | # 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: gmail_notify\n" 6 | "Report-Msgid-Bugs-To: \n" 7 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 8 | "PO-Revision-Date: 2015-06-10 11:38+0100\n" 9 | "Last-Translator: Adam Jabłoński \n" 10 | "Language-Team: \n" 11 | "Language: sk\n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 16 | "X-Poedit-Basepath: .\n" 17 | "X-Poedit-SourceCharset: UTF-8\n" 18 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" 19 | "X-Generator: Poedit 1.8.1\n" 20 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 21 | "gmail_notify@jablona123.pl\n" 22 | 23 | #: extension.js:108 24 | msgid "No email accounts found" 25 | msgstr "" 26 | 27 | #: extension.js:119 28 | msgid "Install gir1.2-goa" 29 | msgstr "" 30 | 31 | #: MailClientFocuser.js:46 32 | #, fuzzy 33 | msgid "No default email client found" 34 | msgstr "Použiť predvoleného poštového klienta namiesto prehliadača" 35 | 36 | #: prefs.js:47 37 | msgid "Check every {0} sec: " 38 | msgstr "Skontrolovať každých {0} sekúnd: " 39 | 40 | #: prefs.js:50 41 | msgid "Use default email client instead of browser" 42 | msgstr "Použiť predvoleného poštového klienta namiesto prehliadača" 43 | 44 | #: prefs.js:63 45 | msgid "Gmail account number" 46 | msgstr "" 47 | 48 | #: prefs.js:63 49 | msgid "Selects the correct Gmail account if more than one is present" 50 | msgstr "" 51 | -------------------------------------------------------------------------------- /locale/tr/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/tr/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/tr/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-04 17:58+0100\n" 7 | "Last-Translator: Mahmut Elmas \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: Türkçe\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "Hiçbir Eposta hesabı bulunamadı" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "Yükle gir1.2-goa" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "Tarayıcı yerine varsayılan istemciyi kullanın" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "Her {0} saniyede kontrol et" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "Tarayıcı yerine varsayılan istemciyi kullanın" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "Gmail hesap numarası" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "Birden fazla gmail hesabı varsa kullanılmakta olanı seç" 48 | -------------------------------------------------------------------------------- /locale/uk/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/uk/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/uk/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2017-11-02 22:26+0200\n" 7 | "Last-Translator: Vitalii Paslavskyi \n" 8 | "Language-Team: Vitalii Paslavskyi\n" 9 | "Language: uk\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: UTF-8\n" 16 | "X-Generator: Poedit 2.0.4\n" 17 | 18 | #: extension.js:108 19 | msgid "No email accounts found" 20 | msgstr "Не знайдено жодної поштової обліковики" 21 | 22 | #: extension.js:119 23 | msgid "Install gir1.2-goa" 24 | msgstr "Встановити gir1.2-goa" 25 | 26 | #: MailClientFocuser.js:46 27 | #, fuzzy 28 | msgid "No default email client found" 29 | msgstr "Не знайдено типової поштової програми" 30 | 31 | #: prefs.js:47 32 | msgid "Check every {0} sec: " 33 | msgstr "Перевіряти кожні сек.: {0}" 34 | 35 | #: prefs.js:50 36 | msgid "Use default email client instead of browser" 37 | msgstr "Використати типову поштову програму замість оглядача" 38 | 39 | #: prefs.js:63 40 | msgid "Gmail account number" 41 | msgstr "Номер обліковки Gmail" 42 | 43 | #: prefs.js:63 44 | msgid "Selects the correct Gmail account if more than one is present" 45 | msgstr "Обирає необхідну обліковку Gmail, якщо присутні більш ніж одна" 46 | -------------------------------------------------------------------------------- /locale/ur/LC_MESSAGES/gmail_notify.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/locale/ur/LC_MESSAGES/gmail_notify.mo -------------------------------------------------------------------------------- /locale/ur/LC_MESSAGES/gmail_notify.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: gmail_notify\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-11-02 20:32-0400\n" 6 | "PO-Revision-Date: 2012-02-04 17:56+0100\n" 7 | "Last-Translator: Adam Jabłoński \n" 8 | "Language-Team: \n" 9 | "Language: \n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: utf-8\n" 16 | "X-Poedit-Language: English\n" 17 | "X-Poedit-SearchPath-0: /home/adam/.local/share/gnome-shell/extensions/" 18 | "gmail_notify@jablona123.pl\n" 19 | 20 | #: extension.js:108 21 | msgid "No email accounts found" 22 | msgstr "" 23 | 24 | #: extension.js:119 25 | msgid "Install gir1.2-goa" 26 | msgstr "" 27 | 28 | #: MailClientFocuser.js:46 29 | #, fuzzy 30 | msgid "No default email client found" 31 | msgstr "ویب براوَزر کے بجاۓ ای میل پاٹھک کا استعمال کرنا" 32 | 33 | #: prefs.js:47 34 | msgid "Check every {0} sec: " 35 | msgstr "ہر {0} سیکنڈ جائزہ لینا:" 36 | 37 | #: prefs.js:50 38 | msgid "Use default email client instead of browser" 39 | msgstr "ویب براوَزر کے بجاۓ ای میل پاٹھک کا استعمال کرنا" 40 | 41 | #: prefs.js:63 42 | msgid "Gmail account number" 43 | msgstr "" 44 | 45 | #: prefs.js:63 46 | msgid "Selects the correct Gmail account if more than one is present" 47 | msgstr "" 48 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Gnome Email Notifications", 3 | "description": "Shows Gmail and Outlook notifications in Gnome Message Tray using Gnome Online Accounts\n", 4 | "shell-version": [ 5 | "43", 6 | "44" 7 | ], 8 | "url": "https://github.com/shumingch/gnome-email-notifications", 9 | "uuid": "GmailMessageTray@shuming0207.gmail.com", 10 | "version": 28 11 | } 12 | -------------------------------------------------------------------------------- /prefs.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 Gmail Message Tray contributors 3 | * 4 | * Gmail Message Tray Extension is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. 8 | * 9 | * Gmail Message Tray Extension is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along 15 | * with Gnome Documents; if not, write to the Free Software Foundation, 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | * Authors: 19 | * Adam Jabłoński 20 | * Shuming Chan 21 | * 22 | */ 23 | "use strict"; 24 | const { GObject, Gtk } = imports.gi; 25 | 26 | const Gettext = imports.gettext; 27 | const _ = Gettext.domain('gmail_notify').gettext; 28 | 29 | const Me = imports.misc.extensionUtils.getCurrentExtension(); 30 | const Conf = Me.imports.Conf.Conf; 31 | 32 | /* 33 | Gmail system label definitions taken from 34 | https://developers.google.com/gmail/android/com/google/android/gm/contentprovider/GmailContract.Labels.LabelCanonicalNames 35 | Linked to by https://stackoverflow.com/questions/24959370/list-of-gmail-atom-available-labels 36 | Only those marked as "include" are available to choose from, but the 37 | whole list is documented here anyway. 38 | */ 39 | const GMAIL_SYSTEM_LABELS = { 40 | CANONICAL_NAME_ALL_MAIL: { 41 | display: "All Mail label", 42 | value: "^all", 43 | include: false, 44 | order: 0 45 | }, 46 | CANONICAL_NAME_DRAFTS: { 47 | display: "Drafts label", 48 | value: "^r", 49 | include: false, 50 | order: 0 51 | }, 52 | CANONICAL_NAME_INBOX: { 53 | display: "Whole inbox (the 'inbox' label)", 54 | value: "^i", 55 | include: true, 56 | order: 1 57 | }, 58 | CANONICAL_NAME_INBOX_CATEGORY_FORUMS: { 59 | display: "Forums inbox category", 60 | value: "^sq_ig_i_group", 61 | include: false, 62 | order: 0 63 | }, 64 | CANONICAL_NAME_INBOX_CATEGORY_PRIMARY: { 65 | display: "Priority Inbox: Primary category only", 66 | value: "^sq_ig_i_personal", 67 | include: true, 68 | order: 3 69 | }, 70 | CANONICAL_NAME_INBOX_CATEGORY_PROMOTIONS: { 71 | display: "Promotions inbox category", 72 | value: "^sq_ig_i_promo", 73 | include: false, 74 | order: 0 75 | }, 76 | CANONICAL_NAME_INBOX_CATEGORY_SOCIAL: { 77 | display: "Social inbox category", 78 | value: "^sq_ig_i_social", 79 | include: false, 80 | order: 0 81 | }, 82 | CANONICAL_NAME_INBOX_CATEGORY_UPDATES: { 83 | display: "Updates inbox category", 84 | value: "^sq_ig_i_notification", 85 | include: false, 86 | order: 0 87 | }, 88 | CANONICAL_NAME_PRIORITY_INBOX: { 89 | display: "Priority Inbox", 90 | value: "^iim", 91 | include: true, 92 | order: 2 93 | }, 94 | CANONICAL_NAME_SENT: { 95 | display: "Sent label", 96 | value: "^f", 97 | include: false, 98 | order: 0 99 | }, 100 | CANONICAL_NAME_SPAM: { 101 | display: "Spam label", 102 | value: "^s", 103 | include: false, 104 | order: 0 105 | }, 106 | CANONICAL_NAME_STARRED: { 107 | display: "Starred label", 108 | value: "^t", 109 | include: false, 110 | order: 0 111 | }, 112 | CANONICAL_NAME_TRASH: { 113 | display: "Trash label", 114 | value: "^k", 115 | include: false, 116 | order: 0 117 | } 118 | } 119 | 120 | /** 121 | * Initializes settings 122 | */ 123 | function init() { 124 | Conf.setupTranslations(); 125 | } 126 | 127 | /** 128 | * Creates the setting GUI 129 | */ 130 | function buildPrefsWidget() { 131 | const prefs = new Prefs(); 132 | return prefs; 133 | } 134 | 135 | /** 136 | * Creates a preference widget for extension settings 137 | * @private 138 | */ 139 | var Prefs = GObject.registerClass(class extends Gtk.Box { 140 | _init(params) { 141 | super._init(params); 142 | this.margin_start = 24; 143 | this.margin_end = 24; 144 | this.margin_top = 16; 145 | this.margin_bottom = 16; 146 | this.orientation = Gtk.Orientation.VERTICAL; 147 | this._conf = new Conf(); 148 | const useMailLabel = _("Use default email client instead of browser"); 149 | const timeoutLabel = _("Check every {0} sec: "); 150 | const gmailSystemLabelLabel = _("Select mailbox (for Gmail accounts only)"); 151 | this._addSwitchSetting(useMailLabel, useMailLabel); 152 | this._addSliderSetting(timeoutLabel, timeoutLabel); 153 | const gmailSystemLabelToggleDefinitions = []; 154 | for (let key in GMAIL_SYSTEM_LABELS) { 155 | if (GMAIL_SYSTEM_LABELS[key].include) { 156 | gmailSystemLabelToggleDefinitions.push(Object.assign({}, GMAIL_SYSTEM_LABELS[key])) 157 | } 158 | } 159 | gmailSystemLabelToggleDefinitions.sort((a, b) => a.order - b.order) 160 | this._addToggleSetting( 161 | gmailSystemLabelLabel, 162 | gmailSystemLabelLabel, 163 | gmailSystemLabelToggleDefinitions 164 | ); 165 | } 166 | 167 | /** 168 | * Creates a set of radio buttons 169 | * @param {string} label - label for setting 170 | * @param {string} help - help information for setting 171 | * @param {array of objects} definitions - Each radio button, with "display" and "value" entries 172 | * @private 173 | */ 174 | _addToggleSetting(label, help, definitions) { 175 | const vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL }); 176 | const setting_label = new Gtk.Label({ 177 | label: label, 178 | xalign: 0, 179 | margin_top: 2, 180 | margin_bottom: 2, 181 | use_markup: true 182 | }); 183 | setting_label.set_tooltip_text(help); 184 | vbox.append(setting_label); 185 | 186 | let previous_radio_button = null; 187 | definitions.forEach(d => { 188 | const setting_radio_button = new Gtk.ToggleButton({ 189 | group: previous_radio_button, 190 | label: d.display, 191 | margin_top: 2, 192 | margin_bottom: 2, 193 | margin_start: 20, 194 | margin_end: 20, 195 | active: this._conf.getGmailSystemLabel() === d.value 196 | }) 197 | previous_radio_button = setting_radio_button 198 | setting_radio_button.connect('toggled', button => { 199 | if (button.active) { 200 | this._conf.setGmailSystemLabel(d.value) 201 | } 202 | }) 203 | vbox.append(setting_radio_button) 204 | }) 205 | this.append(vbox); 206 | } 207 | 208 | /** 209 | * Creates a single switch setting 210 | * @param {string} label - label for setting 211 | * @param {string} help - help information for setting 212 | * @private 213 | */ 214 | _addSwitchSetting(label, help) { 215 | const hbox = this._createHBox(); 216 | const setting_switch = new Gtk.CheckButton({ 217 | margin_start: 2, 218 | active: this._conf.getReader() === 1 219 | }); 220 | setting_switch.connect('toggled', button => { 221 | this._conf.setReader(button.active ? 1 : 0); 222 | }); 223 | this._addLabel(hbox, label, help); 224 | hbox.append(setting_switch); 225 | this.append(hbox); 226 | } 227 | 228 | /** 229 | * Creates a horizontal Box 230 | * @returns {Gtk.Box} 231 | * @private 232 | */ 233 | _createHBox() { 234 | return new Gtk.Box({ 235 | orientation: Gtk.Orientation.HORIZONTAL, 236 | margin_top: 2, 237 | margin_bottom: 2 238 | }); 239 | } 240 | 241 | /** 242 | * Creates a single slider setting 243 | * @param {string} label - label for setting 244 | * @param {string} help - help information for setting 245 | * @private 246 | */ 247 | _addSliderSetting(label, help) { 248 | const hbox = this._createHBox(); 249 | const new_label = label.replace('{0}', this._conf.getTimeout()); 250 | const setting_label = this._addLabel(hbox, new_label, help); 251 | 252 | const adjustment = new Gtk.Adjustment({ 253 | lower: 60, 254 | upper: 1800, 255 | step_increment: 1 256 | }); 257 | const setting_slider = new Gtk.Scale({ 258 | hexpand: true, 259 | digits: 0, 260 | adjustment: adjustment, 261 | value_pos: Gtk.PositionType.RIGHT 262 | }); 263 | setting_slider.set_value(this._conf.getTimeout()); 264 | setting_slider.connect('value-changed', button => { 265 | let i = Math.round(button.get_value()); 266 | setting_label.label = label.replace('{0}', i.toString()); 267 | this._conf.setTimeout(i); 268 | }); 269 | hbox.append(setting_slider); 270 | this.append(hbox); 271 | } 272 | 273 | /** 274 | * Creates a label for an hbox 275 | * @param {Gtk.Box} hbox - the GUI element to add the label to 276 | * @param {string} label - label for setting 277 | * @param {string} help - help information for setting 278 | * @returns {Gtk.Label} 279 | * @private 280 | */ 281 | _addLabel(hbox, label, help) { 282 | const setting_label = new Gtk.Label({ 283 | label: label, 284 | xalign: 0, 285 | use_markup: true 286 | }); 287 | setting_label.set_tooltip_text(help); 288 | hbox.prepend(setting_label); 289 | return setting_label; 290 | } 291 | }); 292 | 293 | 294 | -------------------------------------------------------------------------------- /rexml.js: -------------------------------------------------------------------------------- 1 | ////// JSXML XML Tools - REXML ///////////// 2 | ////// Regular Expression-based XML parser ///////////// 3 | ////// Ver 1.2 Jun 18 2001 ///////////// 4 | ////// Copyright 2000 Peter Tracey ///////////// 5 | ////// http://jsxml.homestead.com/ ///////////// 6 | 7 | function REXML(XML) { 8 | this.XML = XML; 9 | 10 | this.rootElement = null; 11 | 12 | this.parse = REXML_parse; 13 | if (this.XML && this.XML !== "") this.parse(); 14 | } 15 | 16 | function REXML_parse() { 17 | const reTag = new RegExp("<([^>/ ]*)([^>]*)>", "g"); // matches that tag name $1 and attribute string $2 18 | const reTagText = new RegExp("<([^>/ ]*)([^>]*)>([^<]*)", "g"); // matches tag name $1, attribute string $2, and text $3 19 | let strType = ""; 20 | let strTag = ""; 21 | let strText = ""; 22 | let strAttributes = ""; 23 | let strOpen = ""; 24 | let strClose = ""; 25 | let iElements = 0; 26 | let xmleLastElement = null; 27 | if (this.XML.length === 0) return; 28 | const arrElementsUnparsed = this.XML.match(reTag); 29 | const arrElementsUnparsedText = this.XML.match(reTagText); 30 | let i = 0; 31 | if (arrElementsUnparsed[0].replace(reTag, "$1") === "?xml") i++; 32 | 33 | for (; i < arrElementsUnparsed.length; i++) { 34 | strTag = arrElementsUnparsed[i].replace(reTag, "$1"); 35 | strAttributes = arrElementsUnparsed[i].replace(reTag, "$2"); 36 | strText = arrElementsUnparsedText[i].replace(reTagText, "$3").replace(/[\r\n\t ]+/g, " "); // remove white space 37 | strClose = ""; 38 | if (strTag.indexOf("![CDATA[") === 0) { 39 | strOpen = ""; 41 | strType = "cdata"; 42 | } else if (strTag.indexOf("!--") === 0) { 43 | strOpen = ""; 45 | strType = "comment"; 46 | } else if (strTag.indexOf("?") === 0) { 47 | strOpen = ""; 49 | strType = "pi"; 50 | } else strType = "element"; 51 | if (strClose !== "") { 52 | strText = ""; 53 | if (arrElementsUnparsedText[i].indexOf(strClose) > -1) strText = arrElementsUnparsedText[i]; 54 | else { 55 | for (; i < arrElementsUnparsed.length && arrElementsUnparsedText[i].indexOf(strClose) === -1; i++) { 56 | strText += arrElementsUnparsedText[i]; 57 | } 58 | strText += arrElementsUnparsedText[i]; 59 | } 60 | if (strText.substring(strOpen.length, strText.indexOf(strClose)) !== "") { 61 | xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement(strType, "", "", xmleLastElement, strText.substring(strOpen.length, strText.indexOf(strClose))); 62 | if (strType === "cdata") xmleLastElement.text += strText.substring(strOpen.length, strText.indexOf(strClose)); 63 | } 64 | if (strText.indexOf(strClose) + strClose.length < strText.length) { 65 | xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement("text", "", "", xmleLastElement, strText.substring(strText.indexOf(strClose) + strClose.length, strText.length)); 66 | if (strType === "cdata") xmleLastElement.text += strText.substring(strText.indexOf(strClose) + strClose.length, strText.length); 67 | } 68 | continue; 69 | } 70 | if (strText.replace(/ */, "") === "") strText = ""; 71 | if (arrElementsUnparsed[i].substring(1, 2) !== "/") { 72 | if (iElements === 0) { 73 | xmleLastElement = this.rootElement = new REXML_XMLElement(strType, strTag, strAttributes, null, strText); 74 | iElements++; 75 | if (strText !== "") xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement("text", "", "", xmleLastElement, strText); 76 | } else if (arrElementsUnparsed[i].substring(arrElementsUnparsed[i].length - 2, arrElementsUnparsed[i].length - 1) !== "/") { 77 | xmleLastElement = xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement(strType, strTag, strAttributes, xmleLastElement, strText); 78 | iElements++; 79 | if (strText !== "") xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement("text", "", "", xmleLastElement, strText); 80 | } else { 81 | xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement(strType, strTag, strAttributes, xmleLastElement, strText); 82 | if (strText !== "") xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement("text", "", "", xmleLastElement, strText); 83 | } 84 | } else { 85 | xmleLastElement = xmleLastElement.parentElement; 86 | iElements--; 87 | if (xmleLastElement && "" !== strText) { 88 | xmleLastElement.text += strText; 89 | xmleLastElement.childElements[xmleLastElement.childElements.length] = new REXML_XMLElement("text", "", "", xmleLastElement, strText); 90 | } 91 | } 92 | } 93 | } 94 | 95 | function REXML_XMLElement(strType, strName, strAttributes, xmlParent, strText) { 96 | this.type = strType; 97 | this.name = strName; 98 | this.attributeString = strAttributes; 99 | this.attributes = null; 100 | this.childElements = []; 101 | this.parentElement = xmlParent; 102 | this.text = strText; // text of element 103 | 104 | this.getText = REXML_XMLElement_getText; // text of element and child elements 105 | this.childElement = REXML_XMLElement_childElement; 106 | this.attribute = REXML_XMLElement_attribute; 107 | } 108 | 109 | /** 110 | * @return {string} 111 | */ 112 | function REXML_XMLElement_getText() { 113 | if (this.type === "text" || this.type === "cdata") { 114 | return this.text; 115 | } else if (this.childElements.length) { 116 | let L = ""; 117 | for (let i = 0; i < this.childElements.length; i++) { 118 | L += this.childElements[i].getText(); 119 | } 120 | return L; 121 | } else return ""; 122 | } 123 | 124 | /** 125 | * @return {*} 126 | */ 127 | function REXML_XMLElement_childElement(strElementName) { 128 | for (let i = 0; i < this.childElements.length; i++) if (this.childElements[i].name === strElementName) return this.childElements[i]; 129 | return null; 130 | } 131 | 132 | /** 133 | * @return {string} 134 | */ 135 | function REXML_XMLElement_attribute(strAttributeName) { 136 | if (!this.attributes) { 137 | let reAttributes = new RegExp(" ([^= ]*)=", "g"); // matches attributes 138 | if (this.attributeString.match(reAttributes) && this.attributeString.match(reAttributes).length) { 139 | let arrAttributes = this.attributeString.match(reAttributes); 140 | if (!arrAttributes.length) arrAttributes = null; 141 | else for (let j = 0; j < arrAttributes.length; j++) { 142 | arrAttributes[j] = [(arrAttributes[j] + "").replace(/[= ]/g, ""), 143 | ParseAttribute(this.attributeString, (arrAttributes[j] + "").replace(/[= ]/g, ""))]; 144 | } 145 | this.attributes = arrAttributes; 146 | } 147 | } 148 | if (this.attributes) for (let i = 0; i < this.attributes.length; i++) if (this.attributes[i][0] === strAttributeName) return this.attributes[i][1]; 149 | return ""; 150 | } 151 | 152 | /** 153 | * @return {string} 154 | */ 155 | function ParseAttribute(str_input, Attribute) { 156 | const str = str_input + ">"; 157 | let Attr; 158 | if (str.indexOf(Attribute + "='") > -1) Attr = new RegExp(".*" + Attribute + "='([^']*)'.*>"); 159 | else if (str.indexOf(Attribute + '="') > -1) Attr = new RegExp(".*" + Attribute + '="([^"]*)".*>'); 160 | return str.replace(Attr, "$1"); 161 | } 162 | 163 | -------------------------------------------------------------------------------- /schemas/gschemas.compiled: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/schemas/gschemas.compiled -------------------------------------------------------------------------------- /schemas/org.gnome.shell.extensions.gmailmessagetray.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 6 | Use default email client instead of browser 7 | Use default email client instead of browser. 8 | 9 | 10 | 60 11 | Check mail every (sec): 12 | Check mail every (sec): 13 | 14 | 15 | [] 16 | Stores ids of all messages shown 17 | Stores ids of all messages shown so they don't get shown again 18 | 19 | 20 | "^i" 21 | Gmail mailbox system label 22 | Internal Gmail system label for preferred mailbox 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shumingch/gnome-email-notifications/69e207c5c477791e26a74b77db5a934303e0c30f/screenshot.png --------------------------------------------------------------------------------