[gnome-contacts] Make visible when using a development build



commit 1357b04f2da33e8e4d4aa43ba3419651bcc229f5
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Jan 5 15:05:03 2020 +0100

    Make visible when using a development build

 meson.build                    | 1 +
 meson_options.txt              | 1 +
 src/contacts-setup-window.vala | 4 ++++
 src/contacts-window.vala       | 3 +++
 vapi/config.vapi               | 3 +++
 5 files changed, 12 insertions(+)
---
diff --git a/meson.build b/meson.build
index db23d4e..c6a92a7 100644
--- a/meson.build
+++ b/meson.build
@@ -88,6 +88,7 @@ conf.set_quoted('PACKAGE_NAME', meson.project_name())
 conf.set_quoted('PACKAGE_STRING', meson.project_name())
 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
 conf.set_quoted('VERSION', meson.project_version())
+conf.set_quoted('PROFILE', get_option('profile'))
 conf.set('GOA_API_IS_SUBJECT_TO_CHANGE', true)
 configure_file(output: 'config.h', configuration: conf)
 
diff --git a/meson_options.txt b/meson_options.txt
index 2d967a6..b83a1c7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
+option('profile', type: 'combo', choices: [ 'default', 'development' ], value: 'default', description: 
'Indicate whether this is a nightly build (used for CI purposes)')
 option('cheese', type: 'boolean', value: true, description: 'Enable cheese webcam support.')
 option('telepathy', type: 'boolean', value: false, description: 'Enable Telepathy call/chat support.')
 option('manpage', type: 'boolean', value: true, description: 'Enable building man pages.')
diff --git a/src/contacts-setup-window.vala b/src/contacts-setup-window.vala
index ea23e5b..596fb2a 100644
--- a/src/contacts-setup-window.vala
+++ b/src/contacts-setup-window.vala
@@ -59,6 +59,10 @@ public class Contacts.SetupWindow : Gtk.ApplicationWindow {
         var selected_store = this.setup_accounts_list.selected_store as Edsf.PersonaStore;
         setup_done (selected_store);
       });
+
+    // Make visible when we're using a nightly build
+    if (Config.PROFILE == "development")
+        get_style_context ().add_class ("devel");
   }
 
   private void fill_accounts_list (Store store) {
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index 2b648f0..8c156a5 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -108,6 +108,9 @@ public class Contacts.Window : Gtk.ApplicationWindow {
     create_contact_pane ();
     connect_button_signals ();
     restore_window_size_and_position_from_settings ();
+
+    if (Config.PROFILE == "development")
+        get_style_context ().add_class ("devel");
   }
 
   private void on_sort_changed () {
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 6ba9bbb..45fb07e 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -2,6 +2,9 @@
 namespace Config {
 public const string APP_ID;
 
+/* Indicates a nightly build */
+public const string PROFILE;
+
 /* Package information */
 public const string PACKAGE_NAME;
 public const string PACKAGE_STRING;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]