Commit 85dca59c authored by Falk Alexander Seidl's avatar Falk Alexander Seidl

Change app id to org.gnome.PasswordSafe

parent b26121d0
Pipeline #25385 failed with stage
in 13 seconds
# Password Safe
Password Safe is a password manager which makes use of the Keepass v.4 format.
GNOME Password Safe is a password manager which makes use of the Keepass v.4 format.
It integrates perfectly with the GNOME desktop and provides an easy and uncluttered interface for the management of password databases.
###### Screenshot
......@@ -21,7 +21,7 @@ Features:
* Gtk 3.22
### Building / Compiling
We are using Meson as our build system. There are some easy steps to follow in order to build KeepassGtk with Meson:
We are using Meson as our build system. There are some easy steps to follow in order to build GNOME Password Safe with Meson:
```
git clone git@gitlab.gnome.org:fseidl/KeepassGtk.git
......
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>run.terminal.KeepassGtk</id>
<launchable type="desktop-id">run.terminal.KeepassGtk.desktop</launchable>
<id>org.gnome.PasswordSafe</id>
<launchable type="desktop-id">org.gnome.PasswordSafe.desktop</launchable>
<licence>GPL3</licence>
<name>KeepassGtk</name>
<name>Password Safe</name>
<summary>Keepass Client</summary>
<description>
<p>An eye candy password manager for Linux (Keepass v.4)</p>
<p>GNOME Password Safe is a password manager which makes use of the Keepass v.4 format. It integrates perfectly with the GNOME desktop and provides an easy and uncluttered interface for the management of password databases.</p>
</description>
<releases>
<release version="0.0.1" date="2018-05-27">
......@@ -23,7 +23,6 @@
<screenshots>
<screenshot type="default">https://terminal.run/stuff/keepassgtk_screenshot.png</screenshot>
</screenshots>
<url type="homepage">https://github.com/TerminalDotRun/KeepassGtk</url>
<url type="homepage">https://gitlab.gnome.org/fseidl/KeepassGtk</url>
<updatecontact>fa@terminal.run</updatecontact>
<updatecontact>uta@terminal.run</updatecontact>
</component>
[Desktop Entry]
Name=Password Safe
Comment=An eye candy password manager for GNOME
Comment=A password manager for GNOME
Icon=dialog-password
Exec=keepassgtk %U
Exec=passwordsafe %U
Terminal=false
Type=Application
Categories=Utility;GTK;GNOME;
......
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<enum id="run.terminal.KeepassGtk.Sorting">
<enum id="org.gnome.PasswordSafe.Sorting">
<value nick="a-z" value="0" />
<value nick="z-a" value="1" />
<value nick="last_added" value="2" />
</enum>
<enum id="run.terminal.KeepassGtk.UnlockMethod">
<enum id="org.gnome.PasswordSafe.UnlockMethod">
<value nick="password" value="0" />
<value nick="keyfile" value="1" />
<value nick="composite" value="2" />
</enum>
<schema path="/run/terminal/KeepassGtk/" id="run.terminal.KeepassGtk" gettext-domain="keepassgtk">
<schema path="/org/gnome/PasswordSafe/" id="org.gnome.PasswordSafe" gettext-domain="passwordsafe">
<key type="b" name="dark-theme">
<default>false</default>
<summary>Use dark Gtk theme</summary>
......@@ -71,12 +71,12 @@
<summary>Remember unlock method</summary>
<description>Remember last used unlock method for future database unlocking.</description>
</key>
<key enum="run.terminal.KeepassGtk.Sorting" name="sort-order">
<key enum="org.gnome.PasswordSafe.Sorting" name="sort-order">
<default>"last_added"</default>
<summary>Sorting order of groups and entries</summary>
<description>Order of the rows in the groups and entries view.</description>
</key>
<key enum="run.terminal.KeepassGtk.UnlockMethod" name="unlock-method">
<key enum="org.gnome.PasswordSafe.UnlockMethod" name="unlock-method">
<default>"password"</default>
<summary>Last used unlock method</summary>
<description>Used to store the last used unlock method and to enable a faster unlock process.</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/run/terminal/KeepassGtk">
<gresource prefix="/org/gnome/PasswordSafe">
<file compressed="true">database.kdbx</file>
<file compressed="true">keepassgtk.css</file>
<file compressed="true">passwordsafe.css</file>
<file compressed="true" preprocess="xml-stripblanks">about_dialog.ui</file>
<file compressed="true" preprocess="xml-stripblanks">create_database.ui</file>
<file compressed="true" preprocess="xml-stripblanks">created_database.ui</file>
......
{
"app-id" : "run.terminal.KeepassGtk",
"app-id" : "org.gnome.PasswordSafe",
"runtime" : "org.gnome.Platform",
"runtime-version" : "3.28",
"branch" : "stable",
"sdk" : "org.gnome.Sdk",
"command" : "keepassgtk",
"command" : "passwordsafe",
"finish-args" : [
"--filesystem=/usr/share/icons:ro",
"--filesystem=xdg-run/dconf",
......@@ -20,7 +20,7 @@
"modules" : [
"python3-pykeepass.json",
{
"name" : "keepassgtk",
"name" : "passwordsafe",
"buildsystem" : "meson",
"builddir" : true,
"sources" : [
......
project('keepassgtk', 'c',
project('passwordsafe', 'c',
version: '0.0.1',
meson_version: '>= 0.40.0',
)
i18n = import('i18n')
python = import('python3')
project_id = 'run.terminal.KeepassGtk'
project_id = 'org.gnome.PasswordSafe'
message('Looking for dependencies')
python_bin = python.find_python()
......@@ -26,7 +26,7 @@ DATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), meson.project
bindir = join_paths(get_option('prefix'), get_option('bindir'))
conf = configuration_data()
conf.set('PACKAGE_URL', 'https://github.com/TerminalDotRun/KeepassGtk')
conf.set('PACKAGE_URL', 'https://gitlab.gnome.org/fseidl/KeepassGtk')
conf.set('DATA_DIR', DATA_DIR)
conf.set('EXTENSION_DIR', EXTENSION_DIR)
conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
......@@ -39,14 +39,14 @@ conf.set('VERSION', meson.project_version())
subdir('data')
install_subdir(
'keepassgtk',
'passwordsafe',
install_dir: python_dir
)
message('Preparing init file')
configure_file(
input: 'keepassgtk.in',
output: 'keepassgtk',
input: 'passwordsafe.in',
output: 'passwordsafe',
configuration: conf,
install_dir: bindir
)
......
......@@ -13,7 +13,7 @@ localedir = '@LOCALE_DIR@'
pkgdatadir = '@DATA_DIR@'
extensiondir = '@EXTENSION_DIR@'
from keepassgtk.application import Application
from passwordsafe.application import Application
def install_excepthook():
""" Make sure we exit when an unhandled exception occurs. """
......@@ -30,7 +30,7 @@ def install_excepthook():
if __name__ == "__main__":
install_excepthook()
resource = Gio.resource_load(os.path.join(pkgdatadir, 'keepassgtk.gresource'))
resource = Gio.resource_load(os.path.join(pkgdatadir, 'passwordsafe.gresource'))
Gio.Resource._register(resource)
app = Application()
......
......@@ -4,8 +4,8 @@ gi.require_version('Gtk', '3.0')
gi.require_version('Notify', '0.7')
from gi.repository import GLib, Gio, Gtk
from gi.repository import Notify
from keepassgtk.main_window import MainWindow
from keepassgtk.settings_dialog import SettingsDialog
from passwordsafe.main_window import MainWindow
from passwordsafe.settings_dialog import SettingsDialog
class Application(Gtk.Application):
......@@ -14,7 +14,7 @@ class Application(Gtk.Application):
def __init__(self, *args, **kwargs):
super().__init__(
*args, application_id="run.terminal.KeepassGtk", flags=Gio.ApplicationFlags.HANDLES_OPEN)
*args, application_id="org.gnome.PasswordSafe", flags=Gio.ApplicationFlags.HANDLES_OPEN)
self.window = None
def do_startup(self):
......@@ -68,7 +68,7 @@ class Application(Gtk.Application):
def on_about_menu_clicked(self, action, param):
builder = Gtk.Builder()
builder.add_from_resource("/run/terminal/KeepassGtk/about_dialog.ui")
builder.add_from_resource("/org/gnome/PasswordSafe/about_dialog.ui")
about_dialog = builder.get_object("about_dialog")
about_dialog.set_modal(True)
if self.window is not NotImplemented:
......@@ -80,7 +80,7 @@ class Application(Gtk.Application):
def on_shortcuts_menu_clicked(self, action, param):
builder = Gtk.Builder()
builder.add_from_resource("/run/terminal/KeepassGtk/shortcuts_overview.ui")
builder.add_from_resource("/org/gnome/PasswordSafe/shortcuts_overview.ui")
shortcuts_overview = builder.get_object("shortcuts_overview")
if self.window is not NotImplemented:
shortcuts_overview.set_transient_for(self.window)
......
......@@ -2,7 +2,7 @@ import os
from os.path import exists, join
from gi.repository import GLib, Gio
setting = Gio.Settings.new("run.terminal.KeepassGtk")
setting = Gio.Settings.new("org.gnome.PasswordSafe")
clear_clipboard = "clear-clipboard"
dark_theme = "dark-theme"
......
from gi.repository import Gtk
from keepassgtk.created_database import CreatedDatabase
from passwordsafe.created_database import CreatedDatabase
import gi
gi.require_version('Gtk', '3.0')
......@@ -24,7 +24,7 @@ class CreateDatabase:
def password_creation(self):
self.builder = Gtk.Builder()
self.builder.add_from_resource(
"/run/terminal/KeepassGtk/create_database.ui")
"/org/gnome/PasswordSafe/create_database.ui")
self.set_headerbar()
......
from gi.repository import Gtk
from keepassgtk.unlock_database import UnlockDatabase
from passwordsafe.unlock_database import UnlockDatabase
import gi
gi.require_version('Gtk', '3.0')
......@@ -24,7 +24,7 @@ class CreatedDatabase:
def success_page(self):
self.builder = Gtk.Builder()
self.builder.add_from_resource(
"/run/terminal/KeepassGtk/created_database.ui")
"/org/gnome/PasswordSafe/created_database.ui")
self.stack = self.builder.get_object("database_creation_success_stack")
self.stack.set_visible_child(self.stack.get_child_by_name("page0"))
......
from pykeepass import PyKeePass
from keepassgtk.logging_manager import LoggingManager
import keepassgtk.config_manager
from passwordsafe.logging_manager import LoggingManager
import passwordsafe.config_manager
import re
import hashlib
......@@ -283,7 +283,7 @@ class DatabaseManager:
group = self.db.add_group(parent_group, name, icon=icon, notes=notes)
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
return group
......@@ -292,7 +292,7 @@ class DatabaseManager:
def delete_group_from_database(self, group):
self.db.delete_group(group)
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
......@@ -305,7 +305,7 @@ class DatabaseManager:
expiry_time=None, tags=None, icon=icon, force_creation=False)
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
return entry
......@@ -314,7 +314,7 @@ class DatabaseManager:
def delete_entry_from_database(self, entry):
self.db.delete_entry(entry)
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
# Write all changes to database
......@@ -340,42 +340,42 @@ class DatabaseManager:
entry = self.db.find_entries(uuid=uuid, first=True)
entry.title = name
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_entry_username(self, uuid, username):
entry = self.db.find_entries(uuid=uuid, first=True)
entry.username = username
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_entry_password(self, uuid, password):
entry = self.db.find_entries(uuid=uuid, first=True)
entry.password = password
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_entry_url(self, uuid, url):
entry = self.db.find_entries(uuid=uuid, first=True)
entry.url = url
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_entry_notes(self, uuid, notes):
entry = self.db.find_entries(uuid=uuid, first=True)
entry.notes = notes
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_entry_icon(self, uuid, icon):
entry = self.db.find_entries(uuid=uuid, first=True)
entry.icon = icon
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_entry_expiry_date(self, uuid, date):
......@@ -384,14 +384,14 @@ class DatabaseManager:
entry.expires
print(entry.expires)
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_entry_color(self, uuid, color):
entry = self.db.find_entries(uuid=uuid, first=True)
entry.set_custom_property("color", color)
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
# Move an entry to another group
......@@ -407,7 +407,7 @@ class DatabaseManager:
group = self.db.find_groups(uuid=uuid, first=True)
group.name = name
self.changes = True
if keepassgtk.config_manager.get_save_automatically() is True:
if passwordsafe.config_manager.get_save_automatically() is True:
self.save_database()
def set_group_notes(self, uuid, notes):
......
from gi.repository import Gtk
from threading import Timer
import keepassgtk.config_manager
import passwordsafe.config_manager
import gi
......@@ -13,7 +13,7 @@ class DatabaseSettingsDialog():
self.unlocked_database = unlocked_database
self.database_manager = unlocked_database.database_manager
self.builder = Gtk.Builder()
self.builder.add_from_resource("/run/terminal/KeepassGtk/database_settings_dialog.ui")
self.builder.add_from_resource("/org/gnome/PasswordSafe/database_settings_dialog.ui")
self.open_dialog()
......
from gi.repository import Gtk, Gdk
import gi
import keepassgtk.icon
import passwordsafe.icon
gi.require_version('Gtk', '3.0')
......@@ -36,7 +36,7 @@ class EntryRow(Gtk.ListBoxRow):
def assemble_entry_row(self):
builder = Gtk.Builder()
builder.add_from_resource(
"/run/terminal/KeepassGtk/unlocked_database.ui")
"/org/gnome/PasswordSafe/unlocked_database.ui")
entry_event_box = builder.get_object("entry_event_box")
entry_event_box.connect("button-press-event", self.unlocked_database.on_entry_row_button_pressed)
......@@ -53,7 +53,7 @@ class EntryRow(Gtk.ListBoxRow):
entry_checkbox_box.add(self.selection_checkbox)
# Icon
entry_icon.set_from_icon_name(keepassgtk.icon.get_icon(self.icon), 20)
entry_icon.set_from_icon_name(passwordsafe.icon.get_icon(self.icon), 20)
# Title/Name
if self.database_manager.has_entry_name(self.entry_uuid) is True and self.label is not "":
......
......@@ -24,7 +24,7 @@ class GroupRow(Gtk.ListBoxRow):
def assemble_group_row(self):
builder = Gtk.Builder()
builder.add_from_resource(
"/run/terminal/KeepassGtk/unlocked_database.ui")
"/org/gnome/PasswordSafe/unlocked_database.ui")
group_event_box = builder.get_object("group_event_box")
group_event_box.connect("button-press-event", self.unlocked_database.on_group_row_button_pressed)
......
from gi.repository import Gio, GLib, Gdk, Gtk
from gi.repository.GdkPixbuf import Pixbuf
from keepassgtk.logging_manager import LoggingManager
from keepassgtk.database_manager import DatabaseManager
from keepassgtk.create_database import CreateDatabase
from keepassgtk.container_page import ContainerPage
from keepassgtk.unlock_database import UnlockDatabase
import keepassgtk.config_manager
from passwordsafe.logging_manager import LoggingManager
from passwordsafe.database_manager import DatabaseManager
from passwordsafe.create_database import CreateDatabase
from passwordsafe.container_page import ContainerPage
from passwordsafe.unlock_database import UnlockDatabase
import passwordsafe.config_manager
import os
import ntpath
import gi
......@@ -32,7 +32,7 @@ class MainWindow(Gtk.ApplicationWindow):
self.assemble_window()
def assemble_window(self):
window_size = keepassgtk.config_manager.get_window_size()
window_size = passwordsafe.config_manager.get_window_size()
self.set_default_size(window_size[0], window_size[1])
self.create_headerbar()
......@@ -49,7 +49,7 @@ class MainWindow(Gtk.ApplicationWindow):
def create_headerbar(self):
builder = Gtk.Builder()
builder.add_from_resource("/run/terminal/KeepassGtk/main_window.ui")
builder.add_from_resource("/org/gnome/PasswordSafe/main_window.ui")
accelerators = Gtk.AccelGroup()
self.add_accel_group(accelerators)
......@@ -89,7 +89,7 @@ class MainWindow(Gtk.ApplicationWindow):
css_provider = Gtk.CssProvider()
css_provider_resource = Gio.File.new_for_uri(
"resource:///run/terminal/KeepassGtk/keepassgtk.css")
"resource:///org/gnome/PasswordSafe/passwordsafe.css")
css_provider.load_from_file(css_provider_resource)
context = Gtk.StyleContext()
......@@ -99,7 +99,7 @@ class MainWindow(Gtk.ApplicationWindow):
def apply_theme(self):
gtk_settings = Gtk.Settings.get_default()
if keepassgtk.config_manager.get_dark_theme() is True:
if passwordsafe.config_manager.get_dark_theme() is True:
gtk_settings.set_property("gtk-application-prefer-dark-theme", True)
else:
gtk_settings.set_property("gtk-application-prefer-dark-theme", False)
......@@ -109,12 +109,12 @@ class MainWindow(Gtk.ApplicationWindow):
#
def first_start_screen(self):
filepath = keepassgtk.config_manager.get_last_opened_database()
filepath = passwordsafe.config_manager.get_last_opened_database()
if len(self.get_application().file_list) is not 0:
for g_file in self.get_application().file_list:
self.start_database_opening_routine(g_file.get_basename(), g_file.get_path())
elif keepassgtk.config_manager.get_first_start_screen() is True and filepath is not "" and Gio.File.query_exists(Gio.File.new_for_path(filepath)) is True:
elif passwordsafe.config_manager.get_first_start_screen() is True and filepath is not "" and Gio.File.query_exists(Gio.File.new_for_path(filepath)) is True:
self.logging_manager.log_debug("Found last opened database (" + filepath + ")")
tab_title = ntpath.basename(filepath)
self.start_database_opening_routine(tab_title, filepath)
......@@ -126,11 +126,11 @@ class MainWindow(Gtk.ApplicationWindow):
def assemble_first_start_screen(self):
builder = Gtk.Builder()
builder.add_from_resource(
"/run/terminal/KeepassGtk/main_window.ui")
"/org/gnome/PasswordSafe/main_window.ui")
pix = Pixbuf.new_from_resource_at_scale("/run/terminal/KeepassGtk/images/welcome.png", 256, 256, True)
pix = Pixbuf.new_from_resource_at_scale("/org/gnome/PasswordSafe/images/welcome.png", 256, 256, True)
if len(keepassgtk.config_manager.get_last_opened_list()) is not 0:
if len(passwordsafe.config_manager.get_last_opened_list()) is not 0:
last_opened_list_box = builder.get_object("last_opened_list_box")
last_opened_list_box.connect("row-activated", self.on_last_opened_list_box_activated)
......@@ -138,11 +138,11 @@ class MainWindow(Gtk.ApplicationWindow):
entries = 0
invalid = 0
for path in keepassgtk.config_manager.get_last_opened_list():
for path in passwordsafe.config_manager.get_last_opened_list():
entries = entries + 1
if Gio.File.query_exists(Gio.File.new_for_path(path)):
pbuilder = Gtk.Builder()
pbuilder.add_from_resource("/run/terminal/KeepassGtk/main_window.ui")
pbuilder.add_from_resource("/org/gnome/PasswordSafe/main_window.ui")
last_opened_row = pbuilder.get_object("last_opened_row")
filename_label = pbuilder.get_object("filename_label")
......@@ -238,7 +238,7 @@ class MainWindow(Gtk.ApplicationWindow):
def start_database_opening_routine(self, tab_title, filepath):
builder = Gtk.Builder()
builder.add_from_resource(
"/run/terminal/KeepassGtk/create_database.ui")
"/org/gnome/PasswordSafe/create_database.ui")
headerbar = builder.get_object("headerbar")
UnlockDatabase(self, self.create_tab(tab_title, headerbar), filepath)
......@@ -271,7 +271,7 @@ class MainWindow(Gtk.ApplicationWindow):
def copy_database_file(self):
stock_database = Gio.File.new_for_uri(
"resource:///run/terminal/KeepassGtk/database.kdbx")
"resource:///org/gnome/PasswordSafe/database.kdbx")
new_database = Gio.File.new_for_path(
self.filechooser_creation_dialog.get_filename())
......@@ -284,7 +284,7 @@ class MainWindow(Gtk.ApplicationWindow):
"liufhre86ewoiwejmrcu8owe")
builder = Gtk.Builder()
builder.add_from_resource(
"/run/terminal/KeepassGtk/create_database.ui")
"/org/gnome/PasswordSafe/create_database.ui")
headerbar = builder.get_object("headerbar")
CreateDatabase(
self, self.create_tab(tab_title, headerbar),
......@@ -333,9 +333,9 @@ class MainWindow(Gtk.ApplicationWindow):
builder = Gtk.Builder()
builder.add_from_resource(
"/run/terminal/KeepassGtk/main_window.ui")
"/org/gnome/PasswordSafe/main_window.ui")
pix = Pixbuf.new_from_resource_at_scale("/run/terminal/KeepassGtk/images/welcome.png", 256, 256, True)
pix = Pixbuf.new_from_resource_at_scale("/org/gnome/PasswordSafe/images/welcome.png", 256, 256, True)
self.assemble_first_start_screen()
else:
......@@ -422,7 +422,7 @@ class MainWindow(Gtk.ApplicationWindow):
def save_window_size(self):
window_size = [self.get_size().width, self.get_size().height]
keepassgtk.config_manager.set_window_size(window_size)
passwordsafe.config_manager.set_window_size(window_size)
def on_application_quit(self, window, event):
unsaved_databases_list = []
......@@ -433,7 +433,7 @@ class MainWindow(Gtk.ApplicationWindow):
if unsaved_databases_list.__len__() > 0:
builder = Gtk.Builder()
builder.add_from_resource(
"/run/terminal/KeepassGtk/quit_dialog.ui")
"/org/gnome/PasswordSafe/quit_dialog.ui")
self.quit_dialog = builder.get_object("quit_dialog")
self.quit_dialog.set_destroy_with_parent(True)
......
from gi.repository import Gtk
from keepassgtk.pathbar_button import PathbarButton
from keepassgtk.logging_manager import LoggingManager
from passwordsafe.pathbar_button import PathbarButton
from passwordsafe.logging_manager import LoggingManager
import gi
gi.require_version('Gtk', '3.0')
......@@ -23,7 +23,7 @@ class Pathbar(Gtk.HBox):
self.builder = Gtk.Builder()
self.builder.add_from_resource(
"/run/terminal/KeepassGtk/unlocked_database.ui")
"/org/gnome/PasswordSafe/unlocked_database.ui")
self.assemble_pathbar()
......
from gi.repository import Gtk
from gi.repository.GdkPixbuf import Pixbuf
import keepassgtk.config_manager
import passwordsafe.config_manager
import gi
......@@ -11,7 +11,7 @@ class SettingsDialog():
def __init__(self, window):
self.window = window
self.builder = Gtk.Builder()
self.builder.add_from_resource("/run/terminal/KeepassGtk/settings_dialog.ui")
self.builder.add_from_resource("/org/gnome/PasswordSafe/settings_dialog.ui")
def on_settings_menu_clicked(self, action, param):
settings_dialog = self.builder.get_object("settings_dialog")
......@@ -25,50 +25,50 @@ class SettingsDialog():
def set_config_values(self):
settings_theme_switch = self.builder.get_object("settings_theme_switch")
settings_theme_switch.connect("notify::active", self.on_settings_theme_switch_switched)
settings_theme_switch_value = keepassgtk.config_manager.get_dark_theme()
settings_theme_switch_value = passwordsafe.config_manager.get_dark_theme()
settings_theme_switch.set_active(settings_theme_switch_value)
settings_fstart_switch = self.builder.get_object("settings_fstart_switch")
settings_fstart_switch.connect("notify::active", self.on_settings_fstart_switch_switched)
settings_fstart_switch_value = keepassgtk.config_manager.get_first_start_screen()
settings_fstart_switch_value = passwordsafe.config_manager.get_first_start_screen()
settings_fstart_switch.set_active(settings_fstart_switch_value)
settings_save_switch = self.builder.get_object("settings_save_switch")
settings_save_switch.connect("notify::active", self.on_settings_save_switch_switched)
settings_save_switch_value = keepassgtk.config_manager.get_save_automatically()
settings_save_switch_value = passwordsafe.config_manager.get_save_automatically()
settings_save_switch.set_active(settings_save_switch_value)
settings_lockdb_spin_button = self.builder.get_object("settings_lockdb_spin_button")
settings_lockdb_spin_button.connect("value-changed", self.on_settings_lockdb_spin_button_changed)
settings_lockdb_spin_button_value = keepassgtk.config_manager.get_database_lock_timeout()
settings_lockdb_spin_button_value = passwordsafe.config_manager.get_database_lock_timeout()
lockdb_adjustment = Gtk.Adjustment(settings_lockdb_spin_button_value, 0, 60, 1, 5)
settings_lockdb_spin_button.set_adjustment(lockdb_adjustment)
settings_clearcb_spin_button = self.builder.get_object("settings_clearcb_spin_button")
settings_clearcb_spin_button.connect("value-changed", self.on_settings_clearcb_spin_button_changed)
settings_clearcb_spin_button_value = keepassgtk.config_manager.get_clear_clipboard()
settings_clearcb_spin_button_value = passwordsafe.config_manager.get_clear_clipboard()
clearcb_adjustment = Gtk.Adjustment(settings_clearcb_spin_button_value, 0, 300, 1, 5)
settings_clearcb_spin_button.set_adjustment(clearcb_adjustment)
settings_showpw_switch = self.builder.get_object("settings_showpw_switch")
settings_showpw_switch.connect("notify::active", self.on_settings_showpw_switch_switched)
settings_showpw_switch_value = keepassgtk.config_manager.get_show_password_fields()
settings_showpw_switch_value = passwordsafe.config_manager.get_show_password_fields()
settings_showpw_switch.set_active(settings_showpw_switch_value)
settings_clear_button = self.builder.get_object("settings_clear_button")
settings_clear_button.connect("clicked", self.on_settings_clear_recents_clicked)
if len(keepassgtk.config_manager.get_last_opened_list()) is 0:
if len(passwordsafe.config_manager.get_last_opened_list()) is 0:
settings_clear_button.set_sensitive(False)
settings_remember_switch = self.builder.get_object("settings_remember_switch")
settings_remember_switch.connect("notify::active", self.on_settings_remember_switch_switched)
settings_remember_switch_value = keepassgtk.config_manager.get_remember_composite_key()
settings_remember_switch_value = passwordsafe.config_manager.get_remember_composite_key()
settings_remember_switch.set_active(settings_remember_switch_value)
settings_remember_method_switch = self.builder.get_object("settings_remember_method_switch")
settings_remember_method_switch.connect("notify::active", self.on_settings_remember_method_switch_switched)
settings_remember_method_switch_value = keepassgtk.config_manager.get_remember_unlock_method()
settings_remember_method_switch_value = passwordsafe.config_manager.get_remember_unlock_method()
settings_remember_method_switch.set_active(settings_remember_method_switch_value)
......@@ -76,47 +76,47 @@ class SettingsDialog():
gtk_settings = Gtk.Settings.get_default()
if switch_button.get_active():
keepassgtk.config_manager.set_dark_theme(True)
passwordsafe.config_manager.set_dark_theme(True)
gtk_settings.set_property("gtk-application-prefer-dark-theme", True)
else:
keepassgtk.config_manager.set_dark_theme(False)
passwordsafe.config_manager.set_dark_theme(False)
gtk_settings.set_property("gtk-application-prefer-dark-theme", False)
def on_settings_fstart_switch_switched(self, switch_button, gparam):
if switch_button.get_active():
keepassgtk.config_manager.set_first_start_screen(True)
passwordsafe.config_manager.set_first_start_screen(True)
else:
keepassgtk.config_manager.set_first_start_screen(False)
passwordsafe.config_manager.set_first_start_screen(False)
def on_settings_save_switch_switched(self, switch_button, gparam):
if switch_button.get_active():
keepassgtk.config_manager.set_save_automatically(True)
passwordsafe.config_manager.set_save_automatically(True)
else:
keepassgtk.config_manager.set_save_automatically(False)
passwordsafe.config_manager.set_save_automatically(False)
def on_settings_lockdb_spin_button_changed(self, spin_button):
keepassgtk.config_manager.set_database_lock_timeout(spin_button.get_value())
passwordsafe.config_manager.set_database_lock_timeout(spin_button.get_value())
def on_settings_clearcb_spin_button_changed(self, spin_button):
keepassgtk.config_manager.set_clear_clipboard(spin_button.get_value())
passwordsafe.config_manager.set_clear_clipboard(spin_button.get_value())
def on_settings_showpw_switch_switched(self, switch_button, gparam):
if switch_button.get_active():