n7tae / mvoice

A prototype M17 voice application for ham radio
GNU General Public License v2.0
55 stars 13 forks source link

use Gtk resource and config location #13

Closed maitbot closed 2 years ago

maitbot commented 2 years ago

Hello! Some tidying up making use of Gtk features.

Using Glib::get_user_config_dir() to put the mvoice config files in the right place on the platform. Use Gtk resource for a default glade configuration if MVoice.glade is not available.

Add a CMake build for modern C++ cross-platform building.

I hope you find these changes useful. -Maitland

n7tae commented 2 years ago

Regarding the relocation of config info, it seems like a lot of changes that could have been done with a single change to the Makefile. I don't like making classes that have nothing to do with the gui dependent on gtkmm.h.

Regarding your cmake stuff, did you test this? Will your additions allow mvoice to be built on windows or macos?

maitbot commented 2 years ago

The config changes leverage Gtk's following of freedesktop.org's standard paths, and so follows the XDG_CONFIG_HOME environment variable if set. So it's settable at run time, and picks the right place for the user running the application, not just the user building the application via the Makefile.

I agree that having gtkmm.h all over the place is not good. Hopefully there's a better way to simply share a path (a string) within the application. There should only be one place that calls Glib::get_user_config_dir() - early in main() and then passes it along.

ALSA makes this application only for platforms supporting ALSA. So maybe just Linux. The use of pkg-config for finding gtkmm and curl make this less than a pure CMake build. So just unixy platforms that have pkg-config.

n7tae commented 2 years ago

I am moving in a direction that, if successful, will obsolete this PR, so I have pulled it into a separate branch.

Thanks.

maitbot commented 2 years ago

Hmm I missed the close - but have updated my aa4hs/resource-config branch anyways. Perhaps it moved in the same direction as you?