Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ build
builddir
.flatpak-builder
*~
.flatpak
.vscode
10 changes: 9 additions & 1 deletion com.github.elfenware.obliviate.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
app-id: com.github.elfenware.obliviate

runtime: io.elementary.Platform
runtime-version: '7'
runtime-version: '8.2'
sdk: io.elementary.Sdk

command: com.github.elfenware.obliviate

finish-args:
- '--share=ipc'
- '--device=dri'
- '--socket=fallback-x11'
- '--socket=wayland'

Expand All @@ -18,6 +19,13 @@ modules:
- type: archive
url: https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.8.tar.bz2
sha256: 895de2bb981dd127f0821d1ce13fadf7d760f9fa7737648b15f2c1fe13cc5af5
modules:
- name: libgpg-error
buildsystem: autotools
sources:
- type: archive
url: https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.55.tar.gz
sha256: bda09f51d7ed64565e41069d782bfcc4984aed908ae68bee01fb692b64ea96e2
- name: obliviate
buildsystem: meson
sources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
<p>Bonus: If you need your passwords on another device, you can get them on the web from obliviate.app.</p>
</description>
<releases>
<release version="3.0.0" date="2022-06-05">
<description>
<ul>
<li>Move to modern tech</li>
</ul>
</description>
</release>
<release version="2.4.0" date="2022-06-05">
<description>
<ul>
Expand Down
8 changes: 4 additions & 4 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ endforeach
i18n.merge_file (
input: meson.project_name () + '.desktop.in',
output: meson.project_name () + '.desktop',
po_dir: join_paths (meson.source_root (), 'po', 'extra'),
po_dir: join_paths (meson.project_source_root (), 'po', 'extra'),
type: 'desktop',
install: true,
install_dir: join_paths (get_option ('datadir'), 'applications')
)

# Translate and install our .appdata.xml file so AppCenter will see it
i18n.merge_file (
input: meson.project_name () + '.appdata.xml.in',
output: meson.project_name () + '.appdata.xml',
po_dir: join_paths (meson.source_root (), 'po', 'extra'),
input: meson.project_name () + '.metainfo.xml.in',
output: meson.project_name () + '.metainfo.xml',
po_dir: join_paths (meson.project_source_root (), 'po', 'extra'),
install: true,
install_dir: join_paths (get_option ('datadir'), 'metainfo')
)
Expand Down
12 changes: 8 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
project (
'com.github.elfenware.obliviate',
'vala', 'c',
version: '2.4.0'
version: '3.0.0'
)

# Translation module
Expand Down Expand Up @@ -38,8 +38,8 @@ asresources = gnome.compile_resources (
# Listing dependencies
dependencies = [
dependency ('glib-2.0'),
dependency ('granite'),
dependency ('gtk+-3.0'),
dependency ('granite-7'),
dependency ('gtk4'),
dependency ('libhandy-1'),
declare_dependency (dependencies: [
meson.get_compiler ('c').find_library ('libgcrypt'),
Expand All @@ -62,4 +62,8 @@ executable (
subdir('data')
subdir('po')

meson.add_install_script ('meson/post_install.py')
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true
)
17 changes: 0 additions & 17 deletions meson/post_install.py

This file was deleted.

2 changes: 1 addition & 1 deletion po/extra/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Install metadata translations
i18n.gettext ('extra',
args: [
'--directory=' + meson.source_root (),
'--directory=' + meson.project_source_root (),
'--from-code=UTF-8'
],
install: false
Expand Down
2 changes: 1 addition & 1 deletion po/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Install main translations
i18n.gettext (meson.project_name (),
args: [
'--directory=' + meson.source_root (),
'--directory=' + meson.project_source_root (),
'--from-code=UTF-8',
'-cTRANSLATORS'
],
Expand Down
2 changes: 1 addition & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
*/

public class Obliviate.Application : Granite.Application {
public class Obliviate.Application : Gtk.Application {
private Obliviate.MainWindow window;

public Application () {
Expand Down
21 changes: 10 additions & 11 deletions src/MainView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class Obliviate.MainView : Gtk.Overlay {
private Gtk.Grid grid;
private Granite.Widgets.Toast toast;
private Granite.Toast toast;

private Gtk.Entry site;
private Gtk.Entry cipher_key;
Expand All @@ -43,9 +43,9 @@ public class Obliviate.MainView : Gtk.Overlay {
halign = Gtk.Align.CENTER
};

toast = new Granite.Widgets.Toast (_ ("Copied to clipboard"));
var toast = new Granite.Toast (_ ("Copied to clipboard"));

add (grid);
set_child (grid);
add_overlay (toast);

var site_label = new Gtk.Label (_ ("Site:")) {
Expand Down Expand Up @@ -87,28 +87,28 @@ public class Obliviate.MainView : Gtk.Overlay {
show_cipher_key.add (new Gtk.Image.from_icon_name ("image-red-eye-symbolic", Gtk.IconSize.BUTTON));
show_cipher_key.bind_property ("active", cipher_key, "visibility", BindingFlags.INVERT_BOOLEAN);

generated_pass = new Gtk.Entry () {
this.generated_pass = new Gtk.Entry () {
visibility = false,
editable = false,
sensitive = false
};

generated_pass.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
this.generated_pass.add_css_class (Gtk.STYLE_CLASS_FLAT);

show_generated_pass = new Gtk.ToggleButton () {
active = true,
tooltip_text = _ ("Show or hide the password"),
sensitive = false
};

show_generated_pass.add (new Gtk.Image.from_icon_name ("image-red-eye-symbolic", Gtk.IconSize.BUTTON));
show_generated_pass.set_icon_name ("image-red-eye-symbolic");
show_generated_pass.bind_property ("active", generated_pass, "visibility", BindingFlags.INVERT_BOOLEAN);

copy_btn = new Gtk.Button.with_label (_ ("Copy")) {
sensitive = false
};

copy_btn.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
copy_btn.add_css_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);

copy_btn.clicked.connect (() => {
handle_copy ();
Expand Down Expand Up @@ -140,7 +140,7 @@ public class Obliviate.MainView : Gtk.Overlay {
fraction = 1
};

clearing_progress.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
clearing_progress.add_css_class (Gtk.STYLE_CLASS_FLAT);

var plus_label = new Gtk.Label ("+");
plus_label.get_style_context ().add_class ("sign");
Expand Down Expand Up @@ -242,10 +242,9 @@ public class Obliviate.MainView : Gtk.Overlay {
}

private void animate_password () {
var password_style = generated_pass.get_style_context ();
password_style.add_class ("regenerating");
generated_pass.add_css_class ("regenerating");
Timeout.add (100, () => {
password_style.remove_class ("regenerating");
generated_pass.remove_css_class ("regenerating");
return false;
});
}
Expand Down
34 changes: 10 additions & 24 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,32 @@
*
*/

public class Obliviate.MainWindow : Hdy.ApplicationWindow {
public class Obliviate.MainWindow : Gtk.Window {
private GLib.Settings settings;

public MainWindow (Gtk.Application app) {
Object (application: app);
}

construct {
Hdy.init ();
var header = get_header ();

var main = new MainView ();

var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
box.add (header);
box.add (main);
add (box);
set_child (box);

set_geometry_hints (null, Gdk.Geometry () {
min_width = 440,
min_height = 280
}, Gdk.WindowHints.MIN_SIZE);
set_size_request (440, 280);

settings = new GLib.Settings ("com.github.elfenware.obliviate.state");

int default_x = settings.get_int ("window-x");
int default_y = settings.get_int ("window-y");
set_default_size (settings.get_int ("window-width"), settings.get_int ("window-height"));

if (default_x != -1 && default_y != -1) {
move (default_x, default_y);
}
show ();

resize (settings.get_int ("window-width"), settings.get_int ("window-height"));

show_all ();

delete_event.connect (e => {
this.close_request.connect (e => {
return before_destroy ();
});
}
Expand All @@ -66,8 +55,8 @@ public class Obliviate.MainWindow : Hdy.ApplicationWindow {
show_close_button = true
};

header.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
header.get_style_context ().add_class ("headerbar");
header.add_css_class (Gtk.STYLE_CLASS_FLAT);
header.add_css_class ("headerbar");

var help_btn = new Gtk.Button.from_icon_name ("help-contents") {
tooltip_text = _("Help and FAQ")
Expand All @@ -87,13 +76,10 @@ public class Obliviate.MainWindow : Hdy.ApplicationWindow {
}

private bool before_destroy () {
int x, y, width, height;
int width, height;

get_position (out x, out y);
get_size (out width, out height);
get_default_size (out width, out height);

settings.set_int ("window-x", x);
settings.set_int ("window-y", y);
settings.set_int ("window-width", width);
settings.set_int ("window-height", height);

Expand Down
13 changes: 11 additions & 2 deletions src/Service.vala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ public class Obliviate.Service : GLib.Object {
}

public static string remove_symbols (string str) {
var regex = new Regex ("[^a-zA-Z0-9]");
return regex.replace (str, str.length, 0, "");
Regex regex;

try {
regex = new Regex ("[^a-zA-Z0-9]");
return regex.replace (str, str.length, 0, "");

} catch (Error e) {
debug("no");
}


}
}
10 changes: 10 additions & 0 deletions vapi/config.vapi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Build {
public const string DATADIR;
public const string PKGDATADIR;
public const string GETTEXT_PACKAGE;
public const string RELEASE_NAME;
public const string VERSION;
public const string VERSION_INFO;
public const string PLUGINDIR;
}