meson: allow dual installation of the application

meson: set the schema path correctly

window: fix single quotes

python habits

meson: fix various issues with dual installation

Flatpak: don't enforce the branch for gitg

It causes issues with Gitlab CI as we can't test the build on other branches anymore.

remove .gitignore
This commit is contained in:
Bilal Elmoussaoui 2019-01-13 17:31:50 +01:00 committed by Alberto Fanjul
parent 19154a1bf0
commit cc62927f4a
31 changed files with 113 additions and 79 deletions

View File

@ -12,11 +12,11 @@ flatpak:
variables: variables:
# Replace with your manifest path # Replace with your manifest path
MANIFEST_PATH: "org.gnome.gitg.json" MANIFEST_PATH: "org.gnome.gitgDevel.json"
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo" RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
FLATPAK_MODULE: "gitg" FLATPAK_MODULE: "gitg"
MESON_ARGS: "-Ddeprecations=true --buildtype=debugoptimized" MESON_ARGS: "-Ddeprecations=true --buildtype=debugoptimized"
DBUS_ID: "org.gnome.gitg" DBUS_ID: "org.gnome.gitgDevel"
script: script:
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH} - flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}

View File

@ -10,13 +10,13 @@ icon_sizes = [
foreach icon_size: icon_sizes foreach icon_size: icon_sizes
install_data( install_data(
'_'.join(['hicolor', 'apps', icon_size, 'gitg.png']), '_'.join(['hicolor', 'apps', icon_size, 'gitg.png']),
rename: 'org.gnome.gitg.png', rename: '@0@.png'.format(application_id),
install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', icon_size, 'apps'), install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', icon_size, 'apps'),
) )
endforeach endforeach
install_data( install_data(
'_'.join(['hicolor', 'apps', 'scalable', 'gitg-symbolic.svg']), '_'.join(['hicolor', 'apps', 'scalable', 'gitg-symbolic.svg']),
rename: 'org.gnome.gitg-symbolic.svg', rename: '@0@-symbolic.svg'.format(application_id),
install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', 'scalable', 'apps'), install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', 'scalable', 'apps'),
) )

View File

@ -2,11 +2,18 @@ subdir('icons')
desktop = 'org.gnome.gitg.desktop' desktop = 'org.gnome.gitg.desktop'
desktop_config = configuration_data()
desktop_config.set('icon', application_id)
desktop_config.set('binary', gitg_name)
i18n.merge_file( i18n.merge_file(
desktop, desktop,
type: 'desktop', type: 'desktop',
input: desktop + '.in', input: configure_file(
output: desktop, input: desktop + '.in.in',
output: desktop + '.in',
configuration: desktop_config
),
output: '@0@.desktop'.format(application_id),
po_dir: po_dir, po_dir: po_dir,
install: true, install: true,
install_dir: join_paths(gitg_datadir, 'applications'), install_dir: join_paths(gitg_datadir, 'applications'),
@ -14,24 +21,35 @@ i18n.merge_file(
schema_conf = configuration_data() schema_conf = configuration_data()
schema_conf.set('GETTEXT_PACKAGE', gitg_gettext) schema_conf.set('GETTEXT_PACKAGE', gitg_gettext)
schema_conf.set('APPLICATION_ID', application_id)
schema_path = '/org/gnome/gitg'
if get_option('profile') == 'development'
schema_path = '/org/gnome/gitgDevel'
endif
schema_conf.set('SCHEMA_PATH', schema_path)
schema = 'org.gnome.gitg.gschema.xml' schema = 'org.gnome.gitg.gschema.xml'
configure_file( configure_file(
input: schema + '.in', input: schema + '.in',
output: schema, output: '@0@.gschema.xml'.format(application_id),
configuration: schema_conf, configuration: schema_conf,
install: true, install: true,
install_dir: join_paths(gitg_datadir, 'glib-2.0', 'schemas'), install_dir: join_paths(gitg_datadir, 'glib-2.0', 'schemas'),
) )
appdata = 'org.gnome.gitg.appdata.xml' appdata = 'org.gnome.gitg.appdata.xml'
appdata_config = configuration_data()
appdata_config.set('app-id', application_id)
appdata_config.set('gettext', gitg_name)
i18n.merge_file( i18n.merge_file(
appdata, appdata,
type: 'xml', type: 'xml',
input: appdata + '.in', input: configure_file(
output: appdata, input: appdata + '.in.in',
output: appdata + '.in',
configuration: appdata_config
),
output: '@0@.appdata.xml'.format(application_id),
po_dir: po_dir, po_dir: po_dir,
install: true, install: true,
install_dir: join_paths(gitg_datadir, 'metainfo'), install_dir: join_paths(gitg_datadir, 'metainfo'),

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<component type="desktop"> <component type="desktop">
<id>org.gnome.gitg</id> <id>@app-id@</id>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license> <project_license>GPL-2.0+</project_license>
<project_group>GNOME</project_group> <project_group>GNOME</project_group>
@ -45,9 +45,9 @@
<provides> <provides>
<binary>gitg</binary> <binary>gitg</binary>
</provides> </provides>
<launchable type="desktop-id">org.gnome.gitg.desktop</launchable> <launchable type="desktop-id">@app-id@.desktop</launchable>
<update_contact>albfan@gnome.org</update_contact> <update_contact>albfan@gnome.org</update_contact>
<translation type="gettext">gitg</translation> <translation type="gettext">@gettext@</translation>
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
<developer_name>The GNOME Project</developer_name> <developer_name>The GNOME Project</developer_name>
<url type="homepage">https://wiki.gnome.org/Apps/Gitg</url> <url type="homepage">https://wiki.gnome.org/Apps/Gitg</url>

View File

@ -1,12 +1,12 @@
[Desktop Entry] [Desktop Entry]
Name=gitg Name=gitg
Comment=Git repository browser Comment=Git repository browser
Exec=gitg --no-wd %U Exec=@binary@ --no-wd %U
TryExec=gitg TryExec=gitg
Terminal=false Terminal=false
Type=Application Type=Application
# Translators: Do NOT translate or transliterate this text (this is an icon file name)! # Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.gitg Icon=@icon@
Categories=GNOME;GTK;Development; Categories=GNOME;GTK;Development;
MimeType=x-scheme-handler/gitg; MimeType=x-scheme-handler/gitg;
#X-GNOME-DocPath=gitg/gitg.xml #X-GNOME-DocPath=gitg/gitg.xml

View File

@ -1,27 +1,27 @@
<schemalist> <schemalist>
<enum id="org.gnome.gitg.Layout"> <enum id="@APPLICATION_ID@.Layout">
<value nick="horizontal" value="0"/> <value nick="horizontal" value="0"/>
<value nick="vertical" value="1"/> <value nick="vertical" value="1"/>
</enum> </enum>
<enum id="org.gnome.gitg.history.DefaultSelection"> <enum id="@APPLICATION_ID@.history.DefaultSelection">
<value nick="current-branch" value="0"/> <value nick="current-branch" value="0"/>
<value nick="all-branches" value="1"/> <value nick="all-branches" value="1"/>
<value nick="all-commits" value="2"/> <value nick="all-commits" value="2"/>
</enum> </enum>
<enum id="org.gnome.gitg.history.RefSortOrder"> <enum id="@APPLICATION_ID@.history.RefSortOrder">
<value nick="last-activity" value="0"/> <value nick="last-activity" value="0"/>
<value nick="name" value="1"/> <value nick="name" value="1"/>
</enum> </enum>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences" path="/org/gnome/gitg/preferences/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences" path="@SCHEMA_PATH@/preferences/">
<child name="main" schema="org.gnome.gitg.preferences.main" /> <child name="main" schema="@APPLICATION_ID@.preferences.main" />
<child name="history" schema="org.gnome.gitg.preferences.history" /> <child name="history" schema="@APPLICATION_ID@.preferences.history" />
<child name="commit" schema="org.gnome.gitg.preferences.commit" /> <child name="commit" schema="@APPLICATION_ID@.preferences.commit" />
<child name="diff" schema="org.gnome.gitg.preferences.diff" /> <child name="diff" schema="@APPLICATION_ID@.preferences.diff" />
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.main" path="/org/gnome/gitg/preferences/main/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.main" path="@SCHEMA_PATH@/preferences/main/">
<key name="clone-directory" type="s"> <key name="clone-directory" type="s">
<default>""</default> <default>""</default>
<summary>Default Clone Directory</summary> <summary>Default Clone Directory</summary>
@ -31,8 +31,8 @@
</description> </description>
</key> </key>
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.interface" path="/org/gnome/gitg/preferences/interface/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.interface" path="@SCHEMA_PATH@/preferences/interface/">
<key name="orientation" enum="org.gnome.gitg.Layout"> <key name="orientation" enum="@APPLICATION_ID@.Layout">
<default>'vertical'</default> <default>'vertical'</default>
<summary>Orientation of the main interface (vertical or horizontal)</summary> <summary>Orientation of the main interface (vertical or horizontal)</summary>
<description> <description>
@ -74,7 +74,7 @@
<description>Used by GtkSourceView to determine colors for syntax highlighting</description> <description>Used by GtkSourceView to determine colors for syntax highlighting</description>
</key> </key>
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.history" path="/org/gnome/gitg/preferences/history/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.history" path="@SCHEMA_PATH@/preferences/history/">
<key name="collapse-inactive-lanes" type="i"> <key name="collapse-inactive-lanes" type="i">
<default>2</default> <default>2</default>
<summary>When to Collapse Inactive Lanes</summary> <summary>When to Collapse Inactive Lanes</summary>
@ -131,14 +131,14 @@
history for the current HEAD. history for the current HEAD.
</description> </description>
</key> </key>
<key name="default-selection" enum="org.gnome.gitg.history.DefaultSelection"> <key name="default-selection" enum="@APPLICATION_ID@.history.DefaultSelection">
<default>'current-branch'</default> <default>'current-branch'</default>
<summary>Default selection of the history activity</summary> <summary>Default selection of the history activity</summary>
<description> <description>
Setting that determines the default selection on startup of the history activity. Setting that determines the default selection on startup of the history activity.
</description> </description>
</key> </key>
<key name="reference-sort-order" enum="org.gnome.gitg.history.RefSortOrder"> <key name="reference-sort-order" enum="@APPLICATION_ID@.history.RefSortOrder">
<default>'last-activity'</default> <default>'last-activity'</default>
<summary>Reference Sort Order</summary> <summary>Reference Sort Order</summary>
<description> <description>
@ -154,11 +154,11 @@
</description> </description>
</key> </key>
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.commit" path="/org/gnome/gitg/preferences/commit/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.commit" path="@SCHEMA_PATH@/preferences/commit/">
<child name="message" schema="org.gnome.gitg.preferences.commit.message" /> <child name="message" schema="@APPLICATION_ID@.preferences.commit.message" />
<child name="diff" schema="org.gnome.gitg.preferences.commit.diff" /> <child name="diff" schema="@APPLICATION_ID@.preferences.commit.diff" />
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.commit.message" path="/org/gnome/gitg/preferences/commit/message/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.commit.message" path="@SCHEMA_PATH@/preferences/commit/message/">
<key name="show-markup" type="b"> <key name="show-markup" type="b">
<default>true</default> <default>true</default>
</key> </key>
@ -212,7 +212,7 @@
</description> </description>
</key> </key>
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.diff" path="/org/gnome/gitg/preferences/diff/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.diff" path="@SCHEMA_PATH@/preferences/diff/">
<key name="patience" type="b"> <key name="patience" type="b">
<default>false</default> <default>false</default>
<summary>Use patience algorithm to show diffs</summary> <summary>Use patience algorithm to show diffs</summary>
@ -260,7 +260,7 @@
</description> </description>
</key> </key>
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.commit.diff" path="/org/gnome/gitg/preferences/commit/diff/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.commit.diff" path="@SCHEMA_PATH@/preferences/commit/diff/">
<key name="context-lines" type="i"> <key name="context-lines" type="i">
<default>3</default> <default>3</default>
<summary>Number of Before/After Context Lines</summary> <summary>Number of Before/After Context Lines</summary>
@ -279,12 +279,12 @@
</description> </description>
</key> </key>
</schema> </schema>
<schema id="org.gnome.gitg.state" path="/org/gnome/gitg/state/"> <schema id="@APPLICATION_ID@.state" path="@SCHEMA_PATH@/state/">
<child name="window" schema="org.gnome.gitg.state.window"/> <child name="window" schema="@APPLICATION_ID@.state.window"/>
<child name="history" schema="org.gnome.gitg.state.history"/> <child name="history" schema="@APPLICATION_ID@.state.history"/>
<child name="commit" schema="org.gnome.gitg.state.commit"/> <child name="commit" schema="@APPLICATION_ID@.state.commit"/>
</schema> </schema>
<schema id="org.gnome.gitg.state.window" path="/org/gnome/gitg/state/window/"> <schema id="@APPLICATION_ID@.state.window" path="@SCHEMA_PATH@/state/window/">
<key name="state" type="i"> <key name="state" type="i">
<default>0</default> <default>0</default>
</key> </key>
@ -304,7 +304,7 @@
<default>200</default> <default>200</default>
</key> </key>
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.state.history" path="/org/gnome/gitg/state/history/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.state.history" path="@SCHEMA_PATH@/state/history/">
<key name="paned-sidebar-position" type="i"> <key name="paned-sidebar-position" type="i">
<default>200</default> <default>200</default>
</key> </key>
@ -312,7 +312,7 @@
<default>450</default> <default>450</default>
</key> </key>
</schema> </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.state.commit" path="/org/gnome/gitg/state/commit/"> <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.state.commit" path="@SCHEMA_PATH@/state/commit/">
<key name="paned-sidebar-position" type="i"> <key name="paned-sidebar-position" type="i">
<default>200</default> <default>200</default>
</key> </key>

View File

@ -434,7 +434,7 @@ class Dialog : Gtk.Dialog
BindingFlags.BIDIRECTIONAL | BindingFlags.BIDIRECTIONAL |
BindingFlags.SYNC_CREATE); BindingFlags.SYNC_CREATE);
d_commit_settings = new Settings("org.gnome.gitg.state.commit"); d_commit_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.commit");
d_commit_settings.bind("sign-off", d_commit_settings.bind("sign-off",
this, this,
@ -442,7 +442,7 @@ class Dialog : Gtk.Dialog
SettingsBindFlags.GET | SettingsBindFlags.GET |
SettingsBindFlags.SET); SettingsBindFlags.SET);
d_message_settings = new Settings("org.gnome.gitg.preferences.commit.message"); d_message_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.commit.message");
d_message_settings.bind("show-markup", d_message_settings.bind("show-markup",
this, this,
@ -479,7 +479,7 @@ class Dialog : Gtk.Dialog
"spell-checking-language", "spell-checking-language",
SettingsBindFlags.GET | SettingsBindFlags.SET); SettingsBindFlags.GET | SettingsBindFlags.SET);
var interface_settings = new Settings("org.gnome.gitg.preferences.interface"); var interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
interface_settings.bind("use-gravatar", interface_settings.bind("use-gravatar",
this, this,
"use-gravatar", "use-gravatar",

View File

@ -89,7 +89,7 @@ class Paned : Gtk.Paned
construct construct
{ {
var state_settings = new Settings("org.gnome.gitg.state.commit"); var state_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.commit");
state_settings.bind("paned-sidebar-position", state_settings.bind("paned-sidebar-position",
this, this,

View File

@ -37,7 +37,7 @@ class SubmoduleDiffView : Gtk.Box
construct construct
{ {
var interface_settings = new Settings("org.gnome.gitg.preferences.interface"); var interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
interface_settings.bind("orientation", interface_settings.bind("orientation",
d_box_diffs, d_box_diffs,

View File

@ -1934,7 +1934,7 @@ namespace GitgCommit
d_stage_unstage_submodule_commit_callback(model.commit_from_path(path)); d_stage_unstage_submodule_commit_callback(model.commit_from_path(path));
}); });
var settings = new Settings("org.gnome.gitg.preferences.commit.diff"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.commit.diff");
settings.bind("context-lines", settings.bind("context-lines",
d_main.diff_view, d_main.diff_view,
@ -1946,7 +1946,7 @@ namespace GitgCommit
"tab-width", "tab-width",
SettingsBindFlags.GET | SettingsBindFlags.SET); SettingsBindFlags.GET | SettingsBindFlags.SET);
settings = new Settings("org.gnome.gitg.preferences.interface"); settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
settings.bind("use-gravatar", settings.bind("use-gravatar",
d_main.diff_view, d_main.diff_view,

View File

@ -60,7 +60,7 @@ public class Application : Gtk.Application
public Application() public Application()
{ {
Object(application_id: "org.gnome.gitg", Object(application_id: Gitg.Config.APPLICATION_ID,
flags: ApplicationFlags.HANDLES_OPEN | flags: ApplicationFlags.HANDLES_OPEN |
ApplicationFlags.HANDLES_COMMAND_LINE | ApplicationFlags.HANDLES_COMMAND_LINE |
ApplicationFlags.SEND_ENVIRONMENT); ApplicationFlags.SEND_ENVIRONMENT);
@ -236,7 +236,7 @@ public class Application : Gtk.Application
"version", Config.VERSION, "version", Config.VERSION,
"website", Config.PACKAGE_URL, "website", Config.PACKAGE_URL,
"website-label", _("gitg homepage"), "website-label", _("gitg homepage"),
"logo-icon-name", "org.gnome.gitg", "logo-icon-name", Gitg.Config.APPLICATION_ID,
"license-type", Gtk.License.GPL_2_0); "license-type", Gtk.License.GPL_2_0);
} }
@ -375,7 +375,7 @@ public class Application : Gtk.Application
} }
// Handle the state setting in the application // Handle the state setting in the application
d_state_settings = new Settings("org.gnome.gitg.state.window"); d_state_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.window");
d_state_settings.delay(); d_state_settings.delay();
// Application menu entries // Application menu entries

View File

@ -62,7 +62,7 @@ public class CloneDialog : Gtk.Dialog
construct construct
{ {
var main_settings = new Settings("org.gnome.gitg.preferences.main"); var main_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.main");
set_default_response(Gtk.ResponseType.OK); set_default_response(Gtk.ResponseType.OK);

View File

@ -93,7 +93,7 @@ class CommitActionCreatePatch : GitgExt.UIElement, GitgExt.Action, GitgExt.Commi
private Ggit.Diff create_diff_from_commit() throws Error private Ggit.Diff create_diff_from_commit() throws Error
{ {
var settings = new Settings("org.gnome.gitg.preferences.diff"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.diff");
var opts = new Ggit.DiffOptions(); var opts = new Ggit.DiffOptions();

View File

@ -302,7 +302,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
} }
}); });
d_interface_settings = new Settings("org.gnome.gitg.preferences.interface"); d_interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
d_dash_model = Builder.load_object<MenuModel>("ui/gitg-menus.ui", "win-menu-dash"); d_dash_model = Builder.load_object<MenuModel>("ui/gitg-menus.ui", "win-menu-dash");
@ -919,6 +919,10 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
d_state_settings.get("size", "(ii)", out width, out height); d_state_settings.get("size", "(ii)", out width, out height);
resize(width, height); resize(width, height);
if(Gitg.Config.PROFILE == "development")
{
this.get_style_context().add_class("devel");
}
return true; return true;
} }

View File

@ -131,7 +131,7 @@ class Paned : Gitg.AnimatedPaned
construct construct
{ {
var state_settings = new Settings("org.gnome.gitg.state.history"); var state_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.history");
position = state_settings.get_int("paned-sidebar-position"); position = state_settings.get_int("paned-sidebar-position");
d_paned_panels.position = state_settings.get_int("paned-panels-position"); d_paned_panels.position = state_settings.get_int("paned-panels-position");
@ -144,7 +144,7 @@ class Paned : Gitg.AnimatedPaned
store_paned_position(d_paned_panels, state_settings, "paned-panels-position"); store_paned_position(d_paned_panels, state_settings, "paned-panels-position");
}); });
var interface_settings = new Settings("org.gnome.gitg.preferences.interface"); var interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
interface_settings.bind("orientation", interface_settings.bind("orientation",
this, this,

View File

@ -584,7 +584,7 @@ public class RefsList : Gtk.ListBox
set_sort_func(sort_rows); set_sort_func(sort_rows);
set_filter_func(filter_func); set_filter_func(filter_func);
var settings = new Settings("org.gnome.gitg.preferences.history"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
settings.bind("reference-sort-order", settings.bind("reference-sort-order",
this, this,
@ -1219,7 +1219,7 @@ public class RefsList : Gtk.ListBox
if (sel == null) if (sel == null)
{ {
var settings = new Settings("org.gnome.gitg.preferences.history"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
var default_selection = (DefaultSelection)settings.get_enum("default-selection"); var default_selection = (DefaultSelection)settings.get_enum("default-selection");
Gtk.ListBoxRow? srow = null; Gtk.ListBoxRow? srow = null;

View File

@ -126,7 +126,7 @@ namespace GitgHistory
construct construct
{ {
d_settings = new Settings("org.gnome.gitg.preferences.history"); d_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
d_settings.changed["topological-order"].connect((s, k) => { d_settings.changed["topological-order"].connect((s, k) => {
update_sort_mode(); update_sort_mode();

View File

@ -53,7 +53,7 @@ public class PreferencesCommit : Gtk.Grid, GitgExt.Preferences
construct construct
{ {
var settings = new Settings("org.gnome.gitg.preferences.commit.message"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.commit.message");
settings.bind("show-markup", settings.bind("show-markup",
d_check_button_show_markup, d_check_button_show_markup,

View File

@ -68,7 +68,7 @@ public class PreferencesHistory : Gtk.Grid, GitgExt.Preferences
construct construct
{ {
var settings = new Settings("org.gnome.gitg.preferences.history"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
settings.bind("collapse-inactive-lanes-enabled", settings.bind("collapse-inactive-lanes-enabled",
d_collapse_inactive_lanes_enabled, d_collapse_inactive_lanes_enabled,

View File

@ -51,7 +51,7 @@ public class PreferencesInterface : Gtk.Grid, GitgExt.Preferences
construct construct
{ {
d_settings = new Settings("org.gnome.gitg.preferences.interface"); d_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
d_horizontal_layout_enabled.active = d_settings.get_enum("orientation") == 0; d_horizontal_layout_enabled.active = d_settings.get_enum("orientation") == 0;

View File

@ -39,7 +39,7 @@ public class CredentialsManager
static construct static construct
{ {
s_secret_schema = new Secret.Schema("org.gnome.Gitg.Credentials", s_secret_schema = new Secret.Schema(Gitg.Config.APPLICATION_ID + ".Credentials",
Secret.SchemaFlags.NONE, Secret.SchemaFlags.NONE,
"scheme", Secret.SchemaAttributeType.STRING, "scheme", Secret.SchemaAttributeType.STRING,
"host", Secret.SchemaAttributeType.STRING, "host", Secret.SchemaAttributeType.STRING,

View File

@ -396,7 +396,7 @@ class Gitg.DiffViewFileRendererText : Gtk.SourceView, DiffSelectable, DiffViewFi
buffer.language = language; buffer.language = language;
buffer.highlight_syntax = true; buffer.highlight_syntax = true;
d_stylesettings = try_settings("org.gnome.gitg.preferences.interface"); d_stylesettings = try_settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
if (d_stylesettings != null) if (d_stylesettings != null)
{ {
d_stylesettings.changed["style-scheme"].connect((s, k) => { d_stylesettings.changed["style-scheme"].connect((s, k) => {

View File

@ -114,7 +114,7 @@ public class Lanes : Object
d_collapsed = new HashTable<Ggit.OId, CollapsedLane>(Ggit.OId.hash, d_collapsed = new HashTable<Ggit.OId, CollapsedLane>(Ggit.OId.hash,
Ggit.OId.equal); Ggit.OId.equal);
var settings = new Settings("org.gnome.gitg.preferences.history"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
settings.bind("collapse-inactive-lanes-enabled", settings.bind("collapse-inactive-lanes-enabled",
this, this,

View File

@ -91,6 +91,7 @@ sources += gnome.compile_resources(
) )
deps = common_deps + [ deps = common_deps + [
config_dep,
gitg_platform_support_dep, gitg_platform_support_dep,
gsettings_desktop_schemas_dep, gsettings_desktop_schemas_dep,
gtksourceview_dep, gtksourceview_dep,

View File

@ -5,9 +5,14 @@ project(
default_options: 'buildtype=debugoptimized', default_options: 'buildtype=debugoptimized',
meson_version: '>= 0.48.0', meson_version: '>= 0.48.0',
) )
application_id = 'org.gnome.gitg'
gitg_name = meson.project_name() gitg_name = meson.project_name()
if get_option('profile') == 'development'
application_id = 'org.gnome.gitgDevel'
gitg_name = meson.project_name() + 'Devel'
endif
gitg_version = meson.project_version() gitg_version = meson.project_version()
version_array = gitg_version.split('.') version_array = gitg_version.split('.')
gitg_major_version = version_array[0].to_int() gitg_major_version = version_array[0].to_int()
@ -64,6 +69,8 @@ set_defines = [
['PACKAGE_NAME', gitg_name], ['PACKAGE_NAME', gitg_name],
['PACKAGE_URL', 'https://wiki.gnome.org/Apps/Gitg'], ['PACKAGE_URL', 'https://wiki.gnome.org/Apps/Gitg'],
['VERSION', gitg_version], ['VERSION', gitg_version],
['APPLICATION_ID', application_id],
['PROFILE', get_option('profile')],
# i18n # i18n
['GETTEXT_PACKAGE', gitg_gettext], ['GETTEXT_PACKAGE', gitg_gettext],
# gitg # gitg
@ -207,4 +214,5 @@ output += ' Compiler: ' + cc.get_id() + '\n'
output += ' Glade catalog: ' + enable_glade_catalog.to_string() + '\n' output += ' Glade catalog: ' + enable_glade_catalog.to_string() + '\n'
output += ' Debug enabled: ' + gitg_debug.to_string() + '\n' output += ' Debug enabled: ' + gitg_debug.to_string() + '\n'
output += ' Python support: ' + enable_python.to_string() + '\n' output += ' Python support: ' + enable_python.to_string() + '\n'
output += ' Profile: ' + get_option('profile') + '\n'
message(output) message(output)

View File

@ -2,3 +2,4 @@ option('glade_catalog', type: 'boolean', value: true, description: 'Install a gl
option('python', type: 'boolean', value: true, description: 'Build with python support') option('python', type: 'boolean', value: true, description: 'Build with python support')
option('deprecations', type: 'boolean', value: false, description: 'warn about deprecated usages') option('deprecations', type: 'boolean', value: false, description: 'warn about deprecated usages')
option('docs', type: 'boolean', value: false, description: 'enable generating documentation') option('docs', type: 'boolean', value: false, description: 'enable generating documentation')
option('profile', type: 'combo', choices: ['default', 'development'], value: 'default')

View File

@ -1,10 +1,10 @@
{ {
"app-id" : "org.gnome.gitg", "app-id" : "org.gnome.gitgDevel",
"runtime" : "org.gnome.Platform", "runtime" : "org.gnome.Platform",
"runtime-version" : "master", "runtime-version" : "master",
"branch" : "master", "branch" : "master",
"sdk" : "org.gnome.Sdk", "sdk" : "org.gnome.Sdk",
"command" : "gitg", "command" : "gitgDevel",
"tags" : [ "tags" : [
"nightly" "nightly"
], ],
@ -149,13 +149,13 @@
"builddir" : true, "builddir" : true,
"config-opts" : [ "config-opts" : [
"--buildtype=debugoptimized", "--buildtype=debugoptimized",
"-Ddeprecations=true" "-Ddeprecations=true",
"-Dprofile=development"
], ],
"sources" : [ "sources" : [
{ {
"type" : "git", "type" : "git",
"url" : "https://gitlab.gnome.org/GNOME/gitg.git", "url" : "https://gitlab.gnome.org/GNOME/gitg.git"
"branch" : "master"
} }
] ]
} }

View File

@ -44,7 +44,7 @@ namespace GitgDiff
d_diff.show(); d_diff.show();
var settings = new Settings("org.gnome.gitg.preferences.diff"); var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.diff");
settings.bind("ignore-whitespace", settings.bind("ignore-whitespace",
d_diff, d_diff,
@ -71,7 +71,7 @@ namespace GitgDiff
"wrap-lines", "wrap-lines",
SettingsBindFlags.GET | SettingsBindFlags.SET); SettingsBindFlags.GET | SettingsBindFlags.SET);
settings = new Settings("org.gnome.gitg.preferences.interface"); settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
settings.bind("use-gravatar", settings.bind("use-gravatar",
d_diff, d_diff,

View File

@ -155,7 +155,7 @@ namespace GitgFiles
update_font(); update_font();
} }
d_stylesettings = try_settings("org.gnome.gitg.preferences.interface"); d_stylesettings = try_settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
if (d_stylesettings != null) if (d_stylesettings != null)
{ {
d_stylesettings.changed["style-scheme"].connect((s, k) => { d_stylesettings.changed["style-scheme"].connect((s, k) => {

View File

@ -1,8 +1,8 @@
# List of source files containing translatable strings. # List of source files containing translatable strings.
# This list has been automatically generated by update-potfiles. # This list has been automatically generated by update-potfiles.
contrib/xml/xml-reader.c contrib/xml/xml-reader.c
data/org.gnome.gitg.appdata.xml.in data/org.gnome.gitg.appdata.xml.in.in
data/org.gnome.gitg.desktop.in data/org.gnome.gitg.desktop.in.in
data/org.gnome.gitg.gschema.xml.in data/org.gnome.gitg.gschema.xml.in
gitg/commit/gitg-commit-dialog.vala gitg/commit/gitg-commit-dialog.vala
gitg/commit/gitg-commit.vala gitg/commit/gitg-commit.vala

View File

@ -1,6 +1,8 @@
[CCode(cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")] [CCode(cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Gitg.Config namespace Gitg.Config
{ {
public const string APPLICATION_ID;
public const string PROFILE;
public const string GETTEXT_PACKAGE; public const string GETTEXT_PACKAGE;
public const string PACKAGE_NAME; public const string PACKAGE_NAME;
public const string PACKAGE_VERSION; public const string PACKAGE_VERSION;