[devhelp/ebassi/devel-profile] Add profile for development builds




commit 11d9e1af980f7aaea48b036dda71c210318d99e2
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Apr 13 15:38:49 2021 +0100

    Add profile for development builds
    
    During the GNOME development cycle we want to visually distinguish the
    development builds of Devhelp from the stable, system one. Additionally,
    we want to be able to run the two builds at the same time.

 data/icons/meson.build                             | 14 ++--
 data/icons/scalable/org.gnome.Devhelp.Devel.svg    | 82 ++++++++++++++++++
 .../symbolic/org.gnome.Devhelp.Devel-symbolic.svg  | 97 ++++++++++++++++++++++
 data/meson.build                                   | 31 +++++--
 ....xml.in => org.gnome.Devhelp.appdata.xml.in.in} |  2 +-
 ....desktop.in => org.gnome.Devhelp.desktop.in.in} |  2 +-
 data/org.gnome.Devhelp.service.in                  |  2 +-
 meson.build                                        | 13 +++
 meson_options.txt                                  |  8 ++
 src/dh-app.c                                       | 10 ++-
 src/dh-util-app.c                                  | 12 +++
 src/dh-util-app.h                                  | 10 ++-
 src/dh-window.c                                    |  8 +-
 13 files changed, 265 insertions(+), 26 deletions(-)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
index 34be13af..8f784373 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1,9 +1,11 @@
-install_data(
-  'scalable/org.gnome.Devhelp.svg',
-  install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps'
+install_data([
+    'scalable/@0@.svg'.format(APPLICATION_ID),
+  ],
+  install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps',
 )
 
-install_data(
-  'symbolic/org.gnome.Devhelp-symbolic.svg',
-  install_dir: get_option('datadir') / 'icons/hicolor/symbolic/apps'
+install_data([
+    'symbolic/@0 -symbolic svg'.format(APPLICATION_ID),
+  ],
+  install_dir: get_option('datadir') / 'icons/hicolor/symbolic/apps',
 )
diff --git a/data/icons/scalable/org.gnome.Devhelp.Devel.svg b/data/icons/scalable/org.gnome.Devhelp.Devel.svg
new file mode 100644
index 00000000..4cf384ae
--- /dev/null
+++ b/data/icons/scalable/org.gnome.Devhelp.Devel.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink";>
+    <defs>
+        <linearGradient id="a" gradientUnits="userSpaceOnUse" x1="96" x2="104" y1="83" y2="83">
+            <stop offset="0" stop-color="#e8e7e4"/>
+            <stop offset="0.5" stop-color="#ffffff"/>
+            <stop offset="1" stop-color="#c9c6c1"/>
+        </linearGradient>
+        <filter id="b" height="100%" width="100%" x="0%" y="0%">
+            <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 
0"/>
+        </filter>
+        <mask id="c">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.223" height="128" width="128"/>
+            </g>
+        </mask>
+        <mask id="d">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.223" height="128" width="128"/>
+            </g>
+        </mask>
+        <clipPath id="e">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <g id="f" clip-path="url(#e)">
+            <path d="m 26 8 h 2 v 94 h -2 z m 0 0" fill="#ffffff"/>
+        </g>
+        <clipPath id="g">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <clipPath id="h">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <mask id="i">
+            <g clip-path="url(#h)" filter="url(#b)">
+                <g clip-path="url(#g)">
+                    <path d="m 24 28 v 92 h 72 c 4.433594 0 8 -3.566406 8 -8 v -76 c 0 -4.433594 -3.566406 
-8 -8 -8 z m 0 0" fill="#a51d2d"/>
+                    <path d="m 24 102 h 8 v 18 h -8 z m 0 0" fill="#191622"/>
+                    <path d="m 26 48 v 70 h 70 c 4.433594 0 8 -3.566406 8 -8 v -54 c 0 -4.433594 -3.566406 
-8 -8 -8 z m 0 0" fill="url(#a)"/>
+                    <path d="m 24 28 v 76 h 72 c 4.433594 0 8 -3.566406 8 -8 v -60 c 0 -4.433594 -3.566406 
-8 -8 -8 z m 0 0" fill="#ac1d2e"/>
+                    <path d="m 24 8 v 94 h 72 c 4.433594 0 8 -3.566406 8 -8 v -78 c 0 -4.433594 -3.566406 -8 
-8 -8 z m 0 0" fill="#ed333b"/>
+                    <path d="m 24 8 h 8 v 94 h -8 z m 0 0" fill="#424048"/>
+                    <use mask="url(#d)" xlink:href="#f"/>
+                    <path d="m 58 34.019531 v 5.980469 h -0.75 c -2.1875 0 -3.257812 1.207031 -3.257812 
3.304688 v 6.617187 c 0 3.082031 -0.941407 4.378906 -2.992188 5.003906 c 2.050781 0.625 2.992188 1.917969 
2.992188 5 v 6.769531 c 0 2.097657 1.070312 3.304688 3.257812 3.304688 h 0.75 v 5.828125 h -1.566406 c 
-5.582032 0 -8.441406 -2.859375 -8.441406 -7.996094 v -7.730469 c 0 -1.429687 -0.761719 -2.105468 -1.964844 
-2.101562 h -2.027344 v -5.957031 h 2.027344 c 1.203125 0 1.964844 -0.667969 1.964844 -2.097657 v -7.929687 c 
0 -5.136719 2.859374 -7.996094 8.441406 -7.996094 z m 0 0" fill="#ffffff"/>
+                    <path d="m 74 34.019531 v 5.980469 h 0.75 c 2.1875 0 3.257812 1.207031 3.257812 3.304688 
v 6.617187 c 0 3.082031 0.941407 4.378906 2.992188 5.003906 c -2.050781 0.625 -2.992188 1.917969 -2.992188 5 
v 6.769531 c 0 2.097657 -1.070312 3.304688 -3.257812 3.304688 h -0.75 v 5.828125 h 1.566406 c 5.582032 0 
8.441406 -2.859375 8.441406 -7.996094 v -7.730469 c 0 -1.429687 0.761719 -2.105468 1.964844 -2.101562 h 
2.027344 v -5.957031 h -2.027344 c -1.203125 0 -1.964844 -0.667969 -1.964844 -2.097657 v -7.929687 c 0 
-5.136719 -2.859374 -7.996094 -8.441406 -7.996094 z m 0 0" fill="#ffffff"/>
+                    <path d="m 24 102 h 8 v 2 h -8 z m 0 0" fill="#191622"/>
+                </g>
+            </g>
+        </mask>
+        <mask id="j">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.8" height="128" width="128"/>
+            </g>
+        </mask>
+        <linearGradient id="k" gradientTransform="matrix(0 0.37 -0.98462 0 295.38501 -30.360001)" 
gradientUnits="userSpaceOnUse" x1="300" x2="428" y1="235" y2="235">
+            <stop offset="0" stop-color="#f9f06b"/>
+            <stop offset="1" stop-color="#f5c211"/>
+        </linearGradient>
+        <clipPath id="l">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <clipPath id="m">
+            <rect height="128" width="128"/>
+        </clipPath>
+    </defs>
+    <path d="m 24 28 v 92 h 72 c 4.433594 0 8 -3.566406 8 -8 v -76 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="#a51d2d"/>
+    <path d="m 24 102 h 8 v 18 h -8 z m 0 0" fill="#191622"/>
+    <path d="m 26 48 v 70 h 70 c 4.433594 0 8 -3.566406 8 -8 v -54 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="url(#a)"/>
+    <path d="m 24 28 v 76 h 72 c 4.433594 0 8 -3.566406 8 -8 v -60 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="#ac1d2e"/>
+    <path d="m 24 8 v 94 h 72 c 4.433594 0 8 -3.566406 8 -8 v -78 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="#ed333b"/>
+    <path d="m 24 8 h 8 v 94 h -8 z m 0 0" fill="#424048"/>
+    <use mask="url(#c)" xlink:href="#f"/>
+    <path d="m 58 34.019531 v 5.980469 h -0.75 c -2.1875 0 -3.257812 1.207031 -3.257812 3.304688 v 6.617187 
c 0 3.082031 -0.941407 4.378906 -2.992188 5.003906 c 2.050781 0.625 2.992188 1.917969 2.992188 5 v 6.769531 c 
0 2.097657 1.070312 3.304688 3.257812 3.304688 h 0.75 v 5.828125 h -1.566406 c -5.582032 0 -8.441406 
-2.859375 -8.441406 -7.996094 v -7.730469 c 0 -1.429687 -0.761719 -2.105468 -1.964844 -2.101562 h -2.027344 v 
-5.957031 h 2.027344 c 1.203125 0 1.964844 -0.667969 1.964844 -2.097657 v -7.929687 c 0 -5.136719 2.859374 
-7.996094 8.441406 -7.996094 z m 0 0" fill="#ffffff"/>
+    <path d="m 74 34.019531 v 5.980469 h 0.75 c 2.1875 0 3.257812 1.207031 3.257812 3.304688 v 6.617187 c 0 
3.082031 0.941407 4.378906 2.992188 5.003906 c -2.050781 0.625 -2.992188 1.917969 -2.992188 5 v 6.769531 c 0 
2.097657 -1.070312 3.304688 -3.257812 3.304688 h -0.75 v 5.828125 h 1.566406 c 5.582032 0 8.441406 -2.859375 
8.441406 -7.996094 v -7.730469 c 0 -1.429687 0.761719 -2.105468 1.964844 -2.101562 h 2.027344 v -5.957031 h 
-2.027344 c -1.203125 0 -1.964844 -0.667969 -1.964844 -2.097657 v -7.929687 c 0 -5.136719 -2.859374 -7.996094 
-8.441406 -7.996094 z m 0 0" fill="#ffffff"/>
+    <path d="m 24 102 h 8 v 2 h -8 z m 0 0" fill="#191622"/>
+    <g clip-path="url(#m)" mask="url(#i)">
+        <g clip-path="url(#l)" mask="url(#j)">
+            <path d="m 128 80.640625 v 47.359375 h -128 v -47.359375 z m 0 0" fill="url(#k)"/>
+            <path d="m 13.308594 80.640625 l 47.355468 47.359375 h 21.214844 l -47.359375 -47.359375 z m 
42.421875 0 l 47.363281 47.359375 h 21.214844 l -47.363282 -47.359375 z m 42.429687 0 l 29.839844 29.839844 v 
-21.210938 l -8.628906 -8.628906 z m -98.160156 7.90625 v 21.214844 l 18.238281 18.238281 h 21.214844 z m 0 
0"/>
+        </g>
+    </g>
+</svg>
diff --git a/data/icons/symbolic/org.gnome.Devhelp.Devel-symbolic.svg 
b/data/icons/symbolic/org.gnome.Devhelp.Devel-symbolic.svg
new file mode 100644
index 00000000..c579e8fc
--- /dev/null
+++ b/data/icons/symbolic/org.gnome.Devhelp.Devel-symbolic.svg
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   sodipodi:docname="org.gnome.Devhelp-symbolic.svg"
+   height="16"
+   id="svg7384"
+   inkscape:version="0.92.2 2405546, 2018-03-11"
+   version="1.1"
+   width="16">
+  <metadata
+     id="metadata90">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title>Gnome Symbolic Icon Theme</dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     inkscape:bbox-paths="true"
+     bordercolor="#666666"
+     borderopacity="1"
+     inkscape:current-layer="layer9"
+     inkscape:cx="1.6382002"
+     inkscape:cy="13.524864"
+     gridtolerance="10"
+     inkscape:guide-bbox="true"
+     guidetolerance="10"
+     id="namedview88"
+     inkscape:object-nodes="false"
+     inkscape:object-paths="false"
+     objecttolerance="10"
+     pagecolor="#555753"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     showborder="true"
+     showgrid="false"
+     showguides="true"
+     inkscape:snap-bbox="false"
+     inkscape:snap-bbox-midpoints="false"
+     inkscape:snap-global="true"
+     inkscape:snap-grids="true"
+     inkscape:snap-nodes="true"
+     inkscape:snap-others="false"
+     inkscape:snap-to-guides="true"
+     inkscape:window-height="1381"
+     inkscape:window-maximized="1"
+     inkscape:window-width="2560"
+     inkscape:window-x="1600"
+     inkscape:window-y="27"
+     inkscape:zoom="1"
+     borderlayer="true"
+     inkscape:showpageshadow="false">
+    <inkscape:grid
+       empspacing="2"
+       enabled="true"
+       id="grid4866"
+       snapvisiblegridlinesonly="true"
+       spacingx="1"
+       spacingy="1"
+       type="xygrid"
+       visible="true"
+       originx="0"
+       originy="0" />
+  </sodipodi:namedview>
+  <title
+     id="title9167">Gnome Symbolic Icon Theme</title>
+  <defs
+     id="defs7386" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer9"
+     inkscape:label="apps"
+     style="display:inline"
+     transform="translate(-83.0002,-175)">
+    <g
+       id="text3998"
+       
style="font-size:40px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Cantarell;-inkscape-font-specification:Cantarell
 Bold"
+       transform="matrix(0.28893613,0,0,0.28893613,130.49178,195.94283)" />
+    <path
+       inkscape:connector-curvature="0"
+       
style="display:inline;opacity:1;vector-effect:none;fill:#3d3846;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal;enable-background:new"
+       d="m 85.007457,175.98169 v 14 h 11 c 0.51254,0 1,-0.53386 1,-1 h -11 v -2 h 10 c 0.57495,0 1,-0.60225 
1,-1 v -9 c 0,-0.48814 -0.44713,-1 -1,-1 z m 4.44922,2 h 0.26562 v 1.01172 h -0.12695 c -0.36996,0 
-0.55078,0.20372 -0.55078,0.55859 v 1.11719 c 0,0.52098 -0.15854,0.74 -0.50586,0.8457 0.34732,0.10571 
0.50586,0.32472 0.50586,0.84571 v 1.14453 c 0,0.35486 0.18082,0.55859 0.55078,0.55859 h 0.12695 v 0.98438 h 
-0.26562 c -0.94381,0 -1.42774,-0.48327 -1.42774,-1.35157 v -1.30664 c 0,-0.24162 -0.12817,-0.35427 
-0.33203,-0.35351 l -0.34179,-0.002 v -1.00587 h 0.34179 c 0.20386,1.6e-4 0.33203,-0.11385 0.33203,-0.35546 v 
-1.33985 c 0,-0.86831 0.48393,-1.35156 1.42774,-1.35156 z m 2.85937,0 h 0.26563 c 0.94381,0 1.42773,0.48325 
1.42773,1.35156 v 1.33985 c 0,0.24161 0.12817,0.35562 0.33203,0.35546 h 0.3418 v 1.00586 l -0.3418,0.002 c 
-0.20386,-7.6e-4 -0.33203,0.1119 -0.33203,0.35352 v 1.30664 c 0,0.8683 -0.48392,1.35156 -1.42773,1.35156 h 
-0.26563 v -0.98437 h 0.12696 c 0.36996,0 0.550
 78,-0.20373 0.55078,-0.55859 v -1.14453 c 0,-0.52099 0.15854,-0.74 0.50586,-0.84571 -0.34732,-0.1057 
-0.50586,-0.32472 -0.50586,-0.8457 v -1.11719 c 0,-0.35487 -0.18082,-0.55859 -0.55078,-0.55859 h -0.12696 z"
+       id="path1700" />
+  </g>
+</svg>
diff --git a/data/meson.build b/data/meson.build
index 640fab46..1ead5603 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -15,21 +15,33 @@ configure_file(
   install_dir: get_option('datadir') / 'glib-2.0/schemas'
 )
 
-appdata = 'org.gnome.Devhelp.appdata.xml'
+appdata_conf = configuration_data()
+appdata_conf.set('application_id', APPLICATION_ID)
+appdata = APPLICATION_ID + '.appdata.xml'
 I18N.merge_file(
   appdata,
-  input: appdata + '.in',
+  input: configure_file(
+    input: 'org.gnome.Devhelp.appdata.xml.in.in',
+    output: APPLICATION_ID + '.appdata.xml.in',
+    configuration: appdata_conf,
+  ),
   output: appdata,
   po_dir: '../po/',
   install: true,
   install_dir: get_option('datadir') / 'metainfo'
 )
 
-desktop_file = 'org.gnome.Devhelp.desktop'
+desktop_conf = configuration_data()
+desktop_conf.set('application_id', APPLICATION_ID)
+desktop_file = APPLICATION_ID + '.desktop'
 I18N.merge_file(
   desktop_file,
   type: 'desktop',
-  input: desktop_file + '.in',
+  input: configure_file(
+    input: 'org.gnome.Devhelp.desktop.in.in',
+    output: APPLICATION_ID + '.desktop.in',
+    configuration: desktop_conf,
+  ),
   output: desktop_file,
   po_dir: '../po/',
   install: true,
@@ -45,19 +57,22 @@ if desktop_file_validate.found()
   )
 endif
 
-service_file = 'org.gnome.Devhelp.service'
+service_file = APPLICATION_ID + '.service'
 service_conf = configuration_data()
+service_conf.set('application_id', APPLICATION_ID)
 service_conf.set('bindir', get_option('prefix') / get_option('bindir'))
 configure_file(
-  input: service_file + '.in',
+  input: 'org.gnome.Devhelp.service.in',
   output: service_file,
   configuration: service_conf,
   install: true,
   install_dir: get_option('datadir') / 'dbus-1/services'
 )
 
-install_data(
-  ['assistant.css', 'assistant.js'],
+install_data([
+    'assistant.css',
+    'assistant.js',
+  ],
   install_dir: get_option('datadir') / 'devhelp/assistant'
 )
 
diff --git a/data/org.gnome.Devhelp.appdata.xml.in b/data/org.gnome.Devhelp.appdata.xml.in.in
similarity index 98%
rename from data/org.gnome.Devhelp.appdata.xml.in
rename to data/org.gnome.Devhelp.appdata.xml.in.in
index c3388bc9..44133256 100644
--- a/data/org.gnome.Devhelp.appdata.xml.in
+++ b/data/org.gnome.Devhelp.appdata.xml.in.in
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <component type="desktop">
-  <id>org.gnome.Devhelp.desktop</id>
+  <id>@application_id@.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-3.0+</project_license>
   <name>Devhelp</name>
diff --git a/data/org.gnome.Devhelp.desktop.in b/data/org.gnome.Devhelp.desktop.in.in
similarity index 95%
rename from data/org.gnome.Devhelp.desktop.in
rename to data/org.gnome.Devhelp.desktop.in.in
index 806865f5..fdd7bc07 100644
--- a/data/org.gnome.Devhelp.desktop.in
+++ b/data/org.gnome.Devhelp.desktop.in.in
@@ -8,7 +8,7 @@ Exec=devhelp
 Terminal=false
 Type=Application
 # Translators: Do NOT translate or transliterate this text (this is an icon file name)!
-Icon=org.gnome.Devhelp
+Icon=@application_id@
 Categories=GNOME;GTK;Development;
 StartupNotify=true
 DBusActivatable=true
diff --git a/data/org.gnome.Devhelp.service.in b/data/org.gnome.Devhelp.service.in
index 3555cfdb..5d2d7abd 100644
--- a/data/org.gnome.Devhelp.service.in
+++ b/data/org.gnome.Devhelp.service.in
@@ -1,3 +1,3 @@
 [D-BUS Service]
-Name=org.gnome.Devhelp
+Name=@application_id@
 Exec=@bindir@/devhelp --gapplication-service
diff --git a/meson.build b/meson.build
index 1fdd2d8f..42cfba02 100644
--- a/meson.build
+++ b/meson.build
@@ -65,6 +65,16 @@ DEVHELP_APP_DEPS = [
   dependency('gsettings-desktop-schemas'),
 ]
 
+devhelp_version = meson.project_version().split('.')
+devhelp_is_devel = devhelp_version[1] in ['alpha', 'beta', 'rc']
+devel_build = get_option('profile') == 'devel' or devhelp_is_devel
+
+if devel_build
+  APPLICATION_ID = 'org.gnome.Devhelp.Devel'
+else
+  APPLICATION_ID = 'org.gnome.Devhelp'
+endif
+
 # config.h
 
 config_data = configuration_data()
@@ -74,6 +84,8 @@ config_data.set_quoted('DATADIR', get_option('prefix') / get_option('datadir'))
 config_data.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
 config_data.set_quoted('PACKAGE_VERSION', meson.project_version())
 config_data.set_quoted('LIBDEVHELP_API_VERSION', LIBDEVHELP_API_VERSION)
+config_data.set_quoted('APPLICATION_ID', APPLICATION_ID)
+config_data.set10('DEVEL_BUILD', devel_build)
 config_data.set10('FLATPAK_BUILD', get_option('flatpak_build'))
 
 configure_file(
@@ -171,6 +183,7 @@ summary('Debug', get_option('debug'), section: 'Build')
 summary('Optimization', get_option('optimization'), section: 'Build')
 summary('API documentation', get_option('gtk_doc'), section: 'Build')
 summary('Flatpak build mode', get_option('flatpak_build'), section: 'Build')
+summary('Development build', devel_build, section: 'Build')
 
 summary('Plugin for Emacs', get_option('plugin_emacs'), section: 'Plugins')
 summary('Plugin for gedit', get_option('plugin_gedit'), section: 'Plugins')
diff --git a/meson_options.txt b/meson_options.txt
index cf35f960..17dc85f5 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -27,3 +27,11 @@ option(
   type: 'boolean', value: false,
   description: 'Install the Vim plugin'
 )
+
+option(
+  'profile',
+  type: 'combo',
+  choices: ['stable', 'devel'],
+  value: 'stable',
+  description: 'The build profile',
+)
diff --git a/src/dh-app.c b/src/dh-app.c
index da97158c..eb93cb47 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -136,14 +136,16 @@ about_cb (GSimpleAction *action,
                                /* Translators: please don't translate "Devhelp" (it's marked as
                                 * translatable for transliteration only).
                                 */
-                               "name", _("Devhelp"),
+                               "program-name", dh_util_is_devel_build ()
+                                        ? _("Devhelp (development build)")
+                                        : _("Devhelp"),
                                "version", PACKAGE_VERSION,
                                "comments", _("A developer tool for browsing and searching API 
documentation"),
                                "authors", authors,
                                "translator-credits", _("translator-credits"),
                                "website", "https://wiki.gnome.org/Apps/Devhelp";,
                                "website-label", _("Devhelp Website"),
-                               "logo-icon-name", "org.gnome.Devhelp",
+                               "logo-icon-name", APPLICATION_ID,
                                "license-type", GTK_LICENSE_GPL_3_0,
                                "copyright", "Copyright 2001-2021 – the Devhelp team",
                                NULL);
@@ -482,7 +484,7 @@ dh_app_init (DhApp *app)
          * translatable for transliteration only).
          */
         g_set_application_name (_("Devhelp"));
-        gtk_window_set_default_icon_name ("org.gnome.Devhelp");
+        gtk_window_set_default_icon_name (APPLICATION_ID);
 
         g_application_add_main_option_entries (G_APPLICATION (app), options);
 }
@@ -491,7 +493,7 @@ DhApp *
 dh_app_new (void)
 {
         return g_object_new (DH_TYPE_APP,
-                             "application-id", "org.gnome.Devhelp",
+                             "application-id", APPLICATION_ID,
                              "flags", G_APPLICATION_HANDLES_COMMAND_LINE,
                              NULL);
 }
diff --git a/src/dh-util-app.c b/src/dh-util-app.c
index 6ce1696e..17dcdebf 100644
--- a/src/dh-util-app.c
+++ b/src/dh-util-app.c
@@ -5,6 +5,8 @@
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
+#include "config.h"
+
 #include "dh-util-app.h"
 
 static void
@@ -110,3 +112,13 @@ dh_util_window_settings_restore (GtkWindow *gtk_window,
         if (has_maximized_key && g_settings_get_boolean (settings, "maximized"))
                 gtk_window_maximize (gtk_window);
 }
+
+gboolean
+dh_util_is_devel_build (void)
+{
+#if DEVEL_BUILD
+        return TRUE;
+#else
+        return FALSE;
+#endif
+}
diff --git a/src/dh-util-app.h b/src/dh-util-app.h
index 3b3b63ed..fd694930 100644
--- a/src/dh-util-app.h
+++ b/src/dh-util-app.h
@@ -12,11 +12,13 @@
 
 G_BEGIN_DECLS
 
-void    dh_util_window_settings_save            (GtkWindow *window,
-                                                 GSettings *settings);
+void            dh_util_window_settings_save            (GtkWindow *window,
+                                                         GSettings *settings);
 
-void    dh_util_window_settings_restore         (GtkWindow *gtk_window,
-                                                 GSettings *settings);
+void            dh_util_window_settings_restore         (GtkWindow *gtk_window,
+                                                         GSettings *settings);
+
+gboolean        dh_util_is_devel_build                  (void);
 
 G_END_DECLS
 
diff --git a/src/dh-window.c b/src/dh-window.c
index 5ade1fff..e5a3fe0f 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -494,10 +494,16 @@ static void
 dh_window_init (DhWindow *window)
 {
         DhWindowPrivate *priv = dh_window_get_instance_private (window);
+        GtkWidget *widget = GTK_WIDGET (window);
         DhSettingsApp *settings;
         GSettings *paned_settings;
 
-        gtk_widget_init_template (GTK_WIDGET (window));
+        gtk_widget_init_template (widget);
+
+        if (dh_util_is_devel_build ()) {
+                GtkStyleContext *context = gtk_widget_get_style_context (widget);
+                gtk_style_context_add_class (context, "devel");
+        }
 
         add_actions (window);
 


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