Skip to content

Commit

Permalink
Merge pull request #18 from thilomaurer/3_36
Browse files Browse the repository at this point in the history
Upgrade to GNOME 3.36
  • Loading branch information
thilomaurer authored Jul 29, 2020
2 parents ee77fca + 044e9ee commit e6f1753
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
46 changes: 26 additions & 20 deletions extension.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const version = "1.1.4";
const version = "1.1.5";

const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
Expand Down Expand Up @@ -32,30 +32,36 @@ const DEFAULT_PASSWORD_LENGTH_KEY = 'default-password-length';
const PASSWORD_METHOD_KEY = 'password-method';
const LAST_VERSION_KEY = 'last-version';

const MyPopupMenuItem = class extends PopupMenu.PopupBaseMenuItem {
constructor (text, params) {
super(params);
let RecentAliasMenuItem = GObject.registerClass({
Signals: {
'select': {}
}
}, class RecentAliasMenuItem extends PopupMenu.PopupBaseMenuItem {
_init(text, params) {
super._init(params);
this.label = new St.Label({ text: text });
this.actor.add_child(this.label);
this.actor.label_actor = this.label;
this.add(this.label);
}
activate(event) {
this._parent.close(true);
this.emit('selected');
this.emit('select');
}
};
});

const MyPopupMenuItem2 = class extends PopupMenu.PopupBaseMenuItem {
constructor (text, params) {
super(params);
let SuggestionMenuItem = GObject.registerClass({
Signals: {
'select': {}
}
}, class SuggestionMenuItem extends PopupMenu.PopupBaseMenuItem {
_init(text, params) {
super._init(params);
this.label = new St.Label({ text: text });
this.actor.add_child(this.label);
this.actor.label_actor = this.label;
this.add(this.label);
}
activate(event) {
this.emit('selected');
this.emit('select');
}
};
});

let PasswordCalculator = GObject.registerClass(
class PasswordCalculator extends PanelMenu.Button {
Expand All @@ -74,7 +80,7 @@ class PasswordCalculator extends PanelMenu.Button {
setupUI() {

this.iconActor = new St.Icon({ icon_name: 'dialog-password-symbolic', style_class: 'system-status-icon' });
this.actor.add_actor(this.iconActor);
this.add_child(this.iconActor);

let topSection = new PopupMenu.PopupMenuSection();
let bottomSection = new PopupMenu.PopupMenuSection();
Expand Down Expand Up @@ -224,10 +230,10 @@ class PasswordCalculator extends PanelMenu.Button {
let N=list.length;
if (N>8) N=8;
for (let i=0;i<N;i++) {
let item = new MyPopupMenuItem2(list[i]);
let item = new SuggestionMenuItem(list[i]);
item.actor.add_style_class_name("pwCalcSuggestion");
this.menu.addMenuItem(item,i+1);
item.connect('selected', Lang.bind(this, this.urlSelected, list[i]));
item.connect('select', Lang.bind(this, this.urlSelected, list[i]));
this.suggestionsItems.push(item);
}
}
Expand All @@ -237,9 +243,9 @@ class PasswordCalculator extends PanelMenu.Button {
list = removeDuplicates(list);
this.urlCombo.menu.removeAll();
for (let i=0;i<list.length;i++) {
let item = new MyPopupMenuItem(list[i]);
let item = new RecentAliasMenuItem(list[i]);
this.urlCombo.menu.addMenuItem(item, i);
item.connect('selected', Lang.bind(this, this.urlSelected, list[i]));
item.connect('select', Lang.bind(this, this.urlSelected, list[i]));
}
let labeltext;
if (list.length==0) labeltext=_("No Recent Aliases");
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"shell-version": ["3.32"],
"shell-version": ["3.36"],
"uuid": "[email protected]",
"name": "Password Calculator",
"description": "This extension calculates strong passwords for each alias from your single secret. No need to remember dozens of passwords any longer. No need for a password manager any longer. Full freedom in choosing aliases and secret, e.g. alias: \"[email protected]#2014\", secret: \"saFe⚿in漢字\". Recent aliases are kept in a easily accessible drop-down. You may choose between HMAC_SHA1 and SHA1. The formula is as simple as \"[secret][alias]\" → SHA1 → BASE64 ",
Expand Down

0 comments on commit e6f1753

Please sign in to comment.