Skip to content

Commit

Permalink
github issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLauinger77 committed Nov 12, 2022
1 parent 53fc559 commit f9dad61
Show file tree
Hide file tree
Showing 23 changed files with 454 additions and 253 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
**/locale/*/
[email protected]*
[email protected]
[email protected]
gschemas.compiled
messagingmenu\@lauinger-clan.de/.prettierrc


.prettierrc
*.mo
*.po~
.editorconfig
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#=============================================================================
UUID=messagingmenu@screenfreeze.net
UUID=messagingmenu@lauinger-clan.de
# GitHub doesn't accept @ in filesnames:
GHID=messagingmenu.screenfreeze.net
GHID=messagingmenu.lauinger-clan.de
NAME=messagingmenu
FILES=metadata.json *.js stylesheet.css schemas icons locale/**/ LICENSE.txt
INSTALLDIR=$(HOME)/.local/share/gnome-shell/extensions
Expand All @@ -23,17 +23,14 @@ install: zip
uninstall:
rm -r $(INSTALLDIR)/$(UUID)

all: clean locales schemas
all: schemas pack

clean:
rm -f $(GHID).zip* $(UUID)/schemas/gschemas.compiled $(UUID)/LICENSE.txt
rm -rf $(UUID)/locale/**/

locales: $(MSGOBJS)

$(UUID)/locale/%/LC_MESSAGES/$(NAME).mo: po/%.po
mkdir -p $(dir $@)
msgfmt -c -o $@ po/$*.po
locales:
sh update-translation-po-files.sh

schemas: $(UUID)/schemas/
glib-compile-schemas $(UUID)/schemas
Expand All @@ -43,3 +40,6 @@ $(UUID)/LICENSE.txt: LICENSE.txt

zip: all $(UUID)/LICENSE.txt
cd $(UUID); zip -rq ../$(GHID).zip $(FILES:%=./%)

pack: $(UUID)
cd $(UUID);gnome-extensions pack --podir=../po/ --out-dir=../ --extra-source=prefs.ui --extra-source=\icons;cd ..;mv [email protected] messagingmenu\@lauinger-clan.de.zip
10 changes: 10 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

glib-compile-schemas messagingmenu\@lauinger-clan.de/schemas/

cd messagingmenu\@lauinger-clan.de
gnome-extensions pack --podir=../po/ --out-dir=../ --extra-source=prefs.ui --extra-source=\icons
cd ..
mv [email protected] [email protected]
gnome-extensions install messagingmenu\@lauinger-clan.de.zip --force
gnome-extensions enable messagingmenu\@lauinger-clan.de
Binary file modified menu_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,15 @@ const MessageMenu = GObject.registerClass(
let newLauncher = new MessageMenuItem(mb_app);
this.menu.addMenuItem(newLauncher);
}

// Add an entry-point for settings
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
const settingsItem = this.menu.addAction(_("Settings"), () =>
ExtensionUtils.openPrefs()
);
// Ensure the settings are unavailable when the screen is locked
settingsItem.visible = Main.sessionMode.allowSettings;
this.menu._settingsActions[Me.uuid] = settingsItem;
}

_getAppsEMAIL(appsys) {
Expand Down
2 changes: 1 addition & 1 deletion [email protected]/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"gettext-domain": "messagingmenu",
"description": "A Messaging Menu for the Gnome Shell. All Email and Chat Applications in one Place.",
"url": "https://github.com/ChrisLauinger77/messagingmenu",
"version": 27,
"version": 28,
"settings-schema": "org.gnome.shell.extensions.messagingmenu"
}
41 changes: 36 additions & 5 deletions [email protected]/prefs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
const ExtensionUtils = imports.misc.extensionUtils;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;

const Gettext = imports.gettext.domain("gnome-shell-extensions");
const _ = Gettext.gettext;

const { Gtk } = imports.gi;
const Me = ExtensionUtils.getCurrentExtension();
const Gettext = imports.gettext.domain("messagingmenu");
const _ = Gettext.gettext;

let settings;

Expand Down Expand Up @@ -112,6 +110,7 @@ function createNotificationSettingsWidget() {
return vbox;
}

// used until GNOME 42 (41 and before)
function buildPrefsWidget() {
let frame = new Gtk.Box({
orientation: Gtk.Orientation.VERTICAL,
Expand All @@ -131,6 +130,38 @@ function buildPrefsWidget() {
return frame;
}

// used starting with GNOME 42
function fillPreferencesWindow(window) {
let builder = Gtk.Builder.new();
builder.add_from_file(Me.path + "/prefs.ui");
let page = builder.get_object("messagingmenu_page");
window.add(page);

let email_setting_switch = builder.get_object("email_setting_switch");
email_setting_switch.set_active(settings.get_boolean("notify-email"));
email_setting_switch.connect("notify::active", function (button1) {
settings.set_boolean("notify-email", button1.active);
});
let chat_setting_switch = builder.get_object("chat_setting_switch");
chat_setting_switch.set_active(settings.get_boolean("notify-chat"));
chat_setting_switch.connect("notify::active", function (button2) {
settings.set_boolean("notify-chat", button2.active);
});
let mblogging_setting_switch = builder.get_object("mblogging_setting_switch");
mblogging_setting_switch.set_active(settings.get_boolean("notify-mblogging"));
mblogging_setting_switch.connect("notify::active", function (button3) {
settings.set_boolean("notify-mblogging", button3.active);
});
let color_setting_string = builder.get_object("color_setting_string");
color_setting_string.set_text(settings.get_string("color"));
color_setting_string.connect("notify::text", function (entry) {
// only save correct color hexcode
if (entry.text.length == 7 && entry.text.charAt(0) == "#") {
settings.set_string("color", entry.text);
}
});
}

function init() {
ExtensionUtils.initTranslations("messagingmenu");
settings = ExtensionUtils.getSettings(
Expand Down
57 changes: 57 additions & 0 deletions [email protected]/prefs.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="messagingmenu">
<object class="AdwPreferencesPage" id="messagingmenu_page">
<property name="name">messagingmenu_page</property>
<property name="title" translatable="yes">Settings</property>
<property name="icon-name">folder-symbolic</property>
<child>
<object class="AdwPreferencesGroup" id="messagingmenu_group">
<property name="title" translatable="yes">Settings</property>
<child>
<object class="AdwActionRow" id="messagingmenu_row1">
<property name="title" translatable="yes">Email Notification:</property>
<property name="activatable-widget">email_setting_switch</property>
<child>
<object class="GtkSwitch" id="email_setting_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="messagingmenu_row2">
<property name="title" translatable="yes">Chat Notification:</property>
<property name="activatable-widget">chat_setting_switch</property>
<child>
<object class="GtkSwitch" id="chat_setting_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="messagingmenu_row3">
<property name="title" translatable="yes">Micro Blogging Notification:</property>
<property name="activatable-widget">mblogging_setting_switch</property>
<child>
<object class="GtkSwitch" id="mblogging_setting_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="messagingmenu_row4">
<property name="title" translatable="yes">Notification Color (Hex):</property>
<property name="activatable-widget">color_setting_string</property>
<child>
<object class="GtkEntry" id="color_setting_string">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
Original file line number Diff line number Diff line change
@@ -1,40 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="gnome-shell-extensions">
<schema path="/org/gnome/shell/extensions/messagingmenu/" id="org.gnome.shell.extensions.messagingmenu">
<schemalist>
<schema id="org.gnome.shell.extensions.messagingmenu"
path="/org/gnome/shell/extensions/messagingmenu/">
<key name="notify-email" type="b">
<default>true</default>
<default>true</default>
<summary>Alert on new Email</summary>
<description>
Icon blinks on new Email
</description>
<description>Icon blinks on new Email</description>
</key>
<key name="notify-chat" type="b">
<default>true</default>
<default>true</default>
<summary>Alert on new Chat</summary>
<description>
Icon blinks on new Chat
</description>
<description>Icon blinks on new Chat</description>
</key>
<key name="notify-mblogging" type="b">
<default>false</default>
<default>false</default>
<summary>Alert on new News</summary>
<description>
Icon blinks on new Blogposts
</description>
<description>Icon blinks on new Blogposts</description>
</key>
<key name="notify-other" type="b">
<default>false</default>
<default>false</default>
<summary>Alert on new Messages from other Apps</summary>
<description>
Icon blinks on new Messages
</description>
<description>Icon blinks on new Messages</description>
</key>
<key name="color" type="s">
<default>'#ff0000'</default>
<summary>Notification Color</summary>
<description>
The color used to paint the Icon
</description>
<description>The color used to paint the Icon</description>
</key>
</schema>
</schemalist>
48 changes: 27 additions & 21 deletions po/af.po
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
# Afrikaans translations for PACKAGE package.
# Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Andreas Wilhelm <[email protected]>, 2012.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Messaging Menu Version 4\n"
"Report-Msgid-Bugs-To: https://github.com/screenfreeze/messagingmenu/issues\n"
"POT-Creation-Date: 2013-02-11 23:13+0000\n"
"PO-Revision-Date: 2013-05-18 15:20+0200\n"
"Last-Translator: Siôn Le Roux <[email protected]>\n"
"Language-Team: Afrikaans\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-11 14:44+0100\n"
"PO-Revision-Date: 2022-11-11 14:46+0100\n"
"Last-Translator: Christian Lauinger <[email protected]>\n"
"Language-Team: \n"
"Language: af\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ASCII\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.2\n"

#: prefs.js:17
#: [email protected]/extension.js:147
msgid "Compose New Message"
msgstr "Skryf Nuwe Boodskap"

#: [email protected]/extension.js:148
msgid "Contacts"
msgstr "Kontakte"

#: [email protected]/extension.js:298
msgid "Settings"
msgstr "Instellings"

#: [email protected]/prefs.js:18
msgid "Notification Color (Hex):"
msgstr "Kennisgewing Kleur (Hex):"

#: prefs.js:40
#: [email protected]/prefs.js:51
msgid "Email Notification:"
msgstr "E-pos Kennisgewing:"

#: prefs.js:55
#: [email protected]/prefs.js:73
msgid "Chat Notification:"
msgstr "Chat Kennisgewing:"

#: prefs.js:70
#: [email protected]/prefs.js:95
msgid "Micro Blogging Notification:"
msgstr "Mikro Blog Kennisgewing:"

#: extension.js:63
msgid "Compose New Message"
msgstr "Skryf Nuwe Boodskap"

#: extension.js:64
msgid "Contacts"
msgstr "Kontakte"
44 changes: 25 additions & 19 deletions po/cz.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,43 @@
msgid ""
msgstr ""
"Project-Id-Version: Messaging Menu Version 4\n"
"Report-Msgid-Bugs-To: https://github.com/screenfreeze/messagingmenu/issues\n"
"POT-Creation-Date: 2013-02-02 17:36+0100\n"
"PO-Revision-Date: 2013-02-02 17:38+0100\n"
"Last-Translator: Karel Mácha <[email protected]>\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-11 14:49+0100\n"
"PO-Revision-Date: 2022-11-11 15:26+0100\n"
"Last-Translator: Christian Lauinger <[email protected]>\n"
"Language-Team: Czech\n"
"Language: cz\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Poedit 3.2\n"

#: prefs.js:17
#: [email protected]/extension.js:147
msgid "Compose New Message"
msgstr "Vytvořit novou zprávu"

#: [email protected]/extension.js:148
msgid "Contacts"
msgstr "Kontakty"

#: [email protected]/extension.js:298
msgid "Settings"
msgstr "Nastavení"

#: [email protected]/prefs.js:18
msgid "Notification Color (Hex):"
msgstr "Barva upozornění (Hex)"

#: prefs.js:40
#: [email protected]/prefs.js:51
msgid "Email Notification:"
msgstr "Upozornění na email"
msgstr "Upozornění na email:"

#: prefs.js:55
#: [email protected]/prefs.js:73
msgid "Chat Notification:"
msgstr "Upozornění na zprávu v chatu"
msgstr "Upozornění na zprávu v chatu:"

#: prefs.js:70
#: [email protected]/prefs.js:95
msgid "Micro Blogging Notification:"
msgstr "Upozornění na příspěvek na micro-blogu"
msgstr "Upozornění na příspěvek na micro-blogu:"

#: extension.js:63
msgid "Compose New Message"
msgstr "Vytvořit novou zprávu"

#: extension.js:64
msgid "Contacts"
msgstr "Kontakty"
Loading

0 comments on commit f9dad61

Please sign in to comment.