Skip to content

Commit 4f5205f

Browse files
committed
consolidate main into application, add about dialog, add Build namespace, cleanup build files
1 parent 8a7081f commit 4f5205f

16 files changed

+212
-124
lines changed

blueprints/main_window.blp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ template $AppWindow : Window {
7979
strings [
8080
_("All"),
8181
_("SSB"),
82-
_("FM"),
83-
_("AM"),
8482
_("CW"),
8583
_("FT8"),
8684
_("FT4"),
87-
_("Data"),
88-
_("Phone")
85+
_("FM"),
86+
_("AM"),
87+
_("RTTY"),
88+
_("JT65"),
8989
]
9090
};
9191
}
@@ -157,7 +157,6 @@ template $AppWindow : Window {
157157

158158
ProgressBar refresh_progress {
159159
show-text: false;
160-
height-request: 1;
161160
fraction: 0.5;
162161
styles ["osd"]
163162
}
@@ -173,11 +172,23 @@ template $AppWindow : Window {
173172

174173
menu menu_app {
175174
section {
175+
item {
176+
label: _("Add Spot");
177+
action: "app.add-spot";
178+
}
179+
180+
item {
181+
label: _("Refresh");
182+
action: "app.refresh";
183+
}
184+
176185
item {
177186
label: _("Map");
178187
action: "app.open-map";
179188
}
189+
}
180190

191+
section {
181192
item {
182193
label: _("Preferences");
183194
action: "app.preferences";

blueprints/preferences.blp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@ using Gtk 4.0;
22
using Adw 1;
33

44
/* Simple models for the combo rows */
5-
Gtk.StringList bands_model {
6-
strings: ["160m","80m","60m","40m","30m","20m","17m","15m","12m","10m","6m","2m","70cm"];
5+
StringList bands_model {
6+
strings ["All", "160m","80m","60m","40m","30m","20m","17m","15m","12m","10m","6m","2m","70cm"]
77
}
8-
Gtk.StringList modes_model {
9-
strings: ["SSB","CW","FT8","FM","AM","RTTY","JT65"];
8+
9+
StringList modes_model {
10+
strings [
11+
_("All"),
12+
_("SSB"),
13+
_("CW"),
14+
_("FT8"),
15+
_("FT4"),
16+
_("FM"),
17+
_("AM"),
18+
_("RTTY"),
19+
_("JT65"),
20+
]
1021
}
1122

1223
/* Radio connection models */
@@ -64,12 +75,12 @@ Adw.PreferencesDialog prefs_dialog {
6475

6576
Adw.ComboRow row_default_band {
6677
title: _("Default Band");
67-
model: bands_model; // expression set in C
78+
model: bands_model;
6879
}
6980

7081
Adw.ComboRow row_default_mode {
7182
title: _("Default Mode");
72-
model: modes_model; // expression set in C
83+
model: modes_model;
7384
}
7485
}
7586

com.k0vcz.artemis.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@
7070
"name" : "artemis",
7171
"builddir" : true,
7272
"buildsystem" : "meson",
73-
"sources" :
73+
"config-opts":[
74+
"-Dbuildtype=release"
75+
],
76+
"sources" : [
7477
{
7578
"type" : "dir",
7679
"path" : "."

data/artemis-vala.gresource.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<file preprocess="xml-stripblanks">ui/park_log_dialog.ui</file>
1313

1414
<file compressed="true" alias="style.css">../data/css/style.css</file>
15+
16+
<file preprocess="xml-stripblanks" alias="metainfo.xml">../data/com.k0vcz.artemis.metainfo.xml.in</file>
1517
</gresource>
1618
</gresources>
1719

data/com.k0vcz.artemis.gschema.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<schemalist>
3-
<schema id="com.k0vcz.artemis" path="/com/k0vcz/artemis/">
3+
<schema id="com.k0vcz.Artemis" path="/com/k0vcz/Artemis/" gettext-domain="com.k0vcz.Artemis">
44
<key name="callsign" type="s">
55
<default>""</default>
66
<summary>User callsign</summary>
@@ -13,8 +13,6 @@
1313
<description>Your station location or QTH.</description>
1414
</key>
1515

16-
17-
1816
<key name="spot-message" type="s">
1917
<default>""</default>
2018
<summary>Spot message</summary>
@@ -29,7 +27,7 @@
2927
</key>
3028

3129
<key name="default-band" type="s">
32-
<default>"20m"</default>
30+
<default>"All"</default>
3331
<summary>Default band</summary>
3432
<description>The default frequency band (in meters).</description>
3533
<choices>
@@ -51,14 +49,15 @@
5149
</key>
5250

5351
<key name="default-mode" type="s">
54-
<default>"SSB"</default>
52+
<default>"All"</default>
5553
<summary>Default mode</summary>
5654
<description>The default operating mode.</description>
5755
<choices>
5856
<choice value="All"/>
5957
<choice value="SSB"/>
6058
<choice value="CW"/>
6159
<choice value="FT8"/>
60+
<choice value="FT4"/>
6261
<choice value="FM"/>
6362
<choice value="AM"/>
6463
<choice value="RTTY"/>

data/com.k0vcz.artemis.metainfo.xml.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<component type="desktop-application">
3-
<id>com.k0vcz.artemis</id>
3+
<id>com.k0vcz.Artemis</id>
44
<metadata_license>CC0-1.0</metadata_license>
55
<project_license>GPL-3.0-or-later</project_license>
66

7-
<name>Artemis-vala</name>
8-
<summary>Keep the summary shorter, between 10 and 35 characters</summary>
7+
<name>Artemis</name>
8+
<summary>A Parks on the Air Spotting Tool</summary>
99
<description>
1010
<p>No description</p>
1111
</description>
1212

1313
<developer id="tld.vendor">
14-
<name>Developer name</name>
14+
<name>Jay Baird (K0VCZ)</name>
1515
</developer>
1616

1717
<!-- Required: Should be a link to the upstream homepage for the component -->

meson.build

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
project('artemis', ['c', 'vala'],
2-
version: '0.1.0',
3-
meson_version: '>= 1.0.0',
4-
default_options: ['werror=false', ],
1+
project(
2+
'com.k0vcz.Artemis',
3+
['c', 'vala'],
4+
version: '0.1.0',
5+
meson_version: '>= 1.0.0',
6+
default_options: [
7+
'warning_level=2',
8+
'werror=false',
9+
],
510
)
611

712
i18n = import('i18n')
@@ -12,14 +17,39 @@ prefix = get_option('prefix')
1217
data_dir = prefix / get_option('datadir')
1318
srcdir = meson.project_source_root() / 'src'
1419

15-
config_h = configuration_data()
16-
config_h.set_quoted('PACKAGE_VERSION', meson.project_version ())
17-
config_h.set_quoted('GETTEXT_PACKAGE', 'artemis')
18-
config_h.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
19-
configure_file(output: 'config.h', configuration: config_h)
20+
# https://gitlab.gnome.org/GNOME/vala/-/issues/1413#note_1707480
21+
if meson.get_compiler ('c').get_id () == 'clang'
22+
add_project_arguments('-Wno-incompatible-function-pointer-types', language: 'c')
23+
endif
24+
25+
devel = get_option('debug')
26+
27+
# Setup configuration file
28+
config = configuration_data()
29+
config.set('EXEC_NAME', meson.project_name())
30+
config.set('GETTEXT_PACKAGE', meson.project_name())
31+
config.set('BINDIR', join_paths(get_option('prefix'), get_option('bindir')))
32+
config.set('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
33+
config.set('DOMAIN', meson.project_name ())
34+
config.set('G_LOG_DOMAIN', 'Artemis')
35+
config.set('RESOURCES', '/' + '/'.join(meson.project_name().split('.')) + '/')
36+
config.set('VERSION', meson.project_version())
37+
config.set('PREFIX', get_option('prefix'))
38+
config.set('NAME', 'Artemis')
39+
config.set('WEBSITE', '')
40+
config.set('DONATE_WEBSITE', '')
41+
config.set('TRANSLATE_WEBSITE', '')
42+
config.set('PROFILE', devel ? 'development' : 'release')
2043

21-
config_dep = valac.find_library ('config', dirs: srcdir)
22-
config_inc = include_directories('.')
44+
if devel
45+
git = find_program('git')
46+
if git.found()
47+
branch = run_command('git', 'branch', '--show-current', check: true).stdout().strip()
48+
revision = run_command('git', 'rev-parse', '--short', 'HEAD', check: true).stdout().strip()
49+
version = '@0@-@1@'.format(branch, revision)
50+
config.set('VERSION', version)
51+
endif
52+
endif
2353

2454
add_project_arguments('-DGETTEXT_PACKAGE="' + meson.project_name() + '"', language: 'c')
2555

@@ -31,7 +61,6 @@ subdir('po')
3161

3262
executable('artemis', artemis_vala_sources,
3363
dependencies: artemis_vala_deps,
34-
include_directories: config_inc,
3564
vala_args: ['-g', '--save-temps', '--pkg=RadioControl', '--vapidir='+srcdir],
3665
link_with: [libradiocontrol],
3766
install: true,
@@ -42,17 +71,3 @@ gnome.post_install(
4271
gtk_update_icon_cache: true,
4372
update_desktop_database: true,
4473
)
45-
46-
# Code formatting targets
47-
uncrustify = find_program('uncrustify', required: false)
48-
if uncrustify.found()
49-
run_target('format',
50-
command: [find_program('bash'), files('format.sh')],
51-
depends: []
52-
)
53-
54-
run_target('check-format',
55-
command: [find_program('bash'), files('check-format.sh')],
56-
depends: []
57-
)
58-
endif

0 commit comments

Comments
 (0)