Skip to content

Commit

Permalink
Merge pull request #20 from thilomaurer/gtk4
Browse files Browse the repository at this point in the history
Support GNOME40
  • Loading branch information
thilomaurer authored Jul 22, 2021
2 parents e6f1753 + 2a0cf77 commit 64509c8
Show file tree
Hide file tree
Showing 8 changed files with 588 additions and 705 deletions.
2 changes: 2 additions & 0 deletions base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,5 @@ base64.encode = function(s) {
}
return x.join('');
}

//module.exports={base64};
11 changes: 6 additions & 5 deletions extension.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const version = "1.1.5";
const version = "1.1.6";

const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
Expand Down Expand Up @@ -181,6 +181,7 @@ class PasswordCalculator extends PanelMenu.Button {
let pwd = calc(sec, url, len);
this.pwdText.set_text(this.obfuscate(pwd));
if (e && e.get_key_symbol() == Gdk.KEY_Return) {
global.log("pwcalc: this.copyAndSendNotification");
this.copyAndSendNotification(pwd);
this.addRecentURL(url);
this.menu.actor.hide();
Expand Down Expand Up @@ -209,11 +210,11 @@ class PasswordCalculator extends PanelMenu.Button {
copyAndSendNotification(pwd) {
if (this.CopyToClipboard) {
clipboard.set_text(CLIPBOARD_TYPE,pwd);
if (this.ShowCopyNotification) showMessage("Password Calculator: Password copied to clipboard.");
if (this.ShowCopyNotification) showMessage("Password copied to clipboard.");
}
if (this.CopyToPrimarySelection) {
clipboard.set_text(PRIMARY_TYPE,pwd);
if (this.ShowCopyNotification) showMessage("Password Calculator: Password copied to primary selection.");
if (this.ShowCopyNotification) showMessage("Password copied to primary selection.");
}
}
clear() {
Expand Down Expand Up @@ -348,9 +349,9 @@ function removeDuplicates(a) {
function showMessage(text) {
let source = new MessageTray.SystemNotificationSource();
Main.messageTray.add(source);
let notification = new MessageTray.Notification(source, text, null);
let notification = new MessageTray.Notification(source, "Password Calculator", text, {gicon: new Gio.ThemedIcon({name: 'dialog-password-symbolic'})});
notification.setTransient(true);
source.notify(notification);
source.showNotification(notification);
}

function hex2string(hex) {
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.36"],
"shell-version": ["40"],
"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
4 changes: 4 additions & 0 deletions prefs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.dialog {
padding:12px;
/*background-color: green;*/
}
Loading

0 comments on commit 64509c8

Please sign in to comment.