Commit d8a7e074 authored by Falk Alexander Seidl's avatar Falk Alexander Seidl

Add development profile app id

parent 2d2f6535
Pipeline #33354 passed with stage
in 8 minutes and 30 seconds
......@@ -43,7 +43,7 @@
"buildsystem" : "meson",
"builddir" : true,
"config-opts":[
"-Ddevelopment=true"
"-Dprofile=development"
],
"sources" : [
{
......
project('passwordsafe', 'c',
version: '3.31.1',
meson_version: '>= 0.40.0',
default_options: ['development=false']
meson_version: '>= 0.40.0'
)
i18n = import('i18n')
python = import('python3')
......@@ -39,6 +38,16 @@ if run_command('[', '-d', construct_dir, ']').returncode() != 0
error('Missing dependency python-construct >= 2.9.45')
endif
# Profiles
if get_option('profile') == 'development'
profile = 'Devel'
name_suffix = ' (Development)'
else
profile = ''
name_suffix = ''
endif
conf = configuration_data()
conf.set('PACKAGE_URL', 'https://gitlab.gnome.org/World/PasswordSafe')
conf.set('DATA_DIR', DATA_DIR)
......@@ -48,9 +57,13 @@ conf.set('PYTHON_DIR', python_dir)
conf.set('PYTHON_EXEC_DIR', join_paths(get_option('prefix'), python.sysconfig_path('stdlib')))
conf.set('PYTHON', python_bin.path())
conf.set('libexecdir', LIBEXEC_DIR)
conf.set('VERSION', meson.project_version())
if get_option('profile') == 'development'
conf.set('VERSION', run_command(['git', 'describe', '--long', '--tags']).stdout())
else
conf.set('VERSION', meson.project_version())
endif
conf.set('CONTRIBUTORS', contributors)
conf.set('DEVELOPMENT', get_option('development'))
conf.set_quoted('PROFILE', profile)
subdir('data')
subdir('po')
......
option('development', type : 'boolean', value : false, description : 'Enable debug and backup mode')
option(
'profile',
type: 'combo',
choices: [
'default',
'development'
],
value: 'default'
)
......@@ -40,7 +40,12 @@ if __name__ == "__main__":
Gio.Resource._register(resource)
app = Application()
Application.development_mode = "@DEVELOPMENT@" == 'True'
if @PROFILE@ == 'Devel':
Application.development_mode = True
Application.application_id = 'org.gnome.PasswordSafeDevel'
else:
Application.development_mode = False
exit_status = app.run(sys.argv)
sys.exit(exit_status)
......@@ -16,11 +16,12 @@ from passwordsafe.settings_dialog import SettingsDialog
class Application(Gtk.Application):
window = NotImplemented
file_list = []
development_mode = False
development_mode = None
application_id = "org.gnome.PasswordSafe"
def __init__(self, *args, **kwargs):
super().__init__(
*args, application_id="org.gnome.PasswordSafe", flags=Gio.ApplicationFlags.HANDLES_OPEN)
*args, application_id=self.application_id, flags=Gio.ApplicationFlags.HANDLES_OPEN)
self.window = None
def do_startup(self):
......@@ -34,6 +35,8 @@ class Application(Gtk.Application):
self.connect("open", self.file_open_handler)
self.assemble_application_menu()
print(self.development_mode)
print(self.application_id)
def do_activate(self):
if not self.window:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment