chore: debuging settings

This commit is contained in:
Tine Jozelj 2023-12-20 22:50:13 +01:00
parent 50dd8f5e18
commit a6dca9434d
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
12 changed files with 54 additions and 66 deletions

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="mod-manager">
<schema id="dev.mnts.ModManager" path="/dev/mnts/ModManager/">
</schema>
</schemalist>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema id="@APP_ID@" gettext-domain="@GETTEXT_PACKAGE@" path="/dev/mnts/ModManager/">
<key name="games" type="{ss}">
<default>{}</default>
<summary>Dictionary of games being managed. First string is game name second is path to mods folder.</summary>
</key>
</schema>
</schemalist>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>dev.mnts.ModManager.desktop</id>
<id>@APP_ID@</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>

View file

@ -1,5 +1,3 @@
application_id = 'dev.mnts.ModManager'
scalable_dir = 'hicolor' / 'scalable' / 'apps'
install_data(
scalable_dir / ('@0@.svg').format(application_id),

View file

@ -1,5 +1,9 @@
configuration = configuration_data()
configuration.set('APP_ID', application_id)
configuration.set('GETTEXT_PACKAGE', gettext_package)
desktop_file = i18n.merge_file(
input: 'dev.mnts.ModManager.desktop.in',
input: configure_file(input: 'dev.mnts.ModManager.metainfo.xml.in', output: '@BASENAME@.in', configuration: configuration),
output: 'dev.mnts.ModManager.desktop',
type: 'desktop',
po_dir: '../po',
@ -13,7 +17,7 @@ if desktop_utils.found()
endif
appstream_file = i18n.merge_file(
input: 'dev.mnts.ModManager.metainfo.xml.in',
input: configure_file(input: 'dev.mnts.ModManager.metainfo.xml.in', output: '@BASENAME@.in', configuration: configuration),
output: 'dev.mnts.ModManager.metainfo.xml',
po_dir: '../po',
install: true,
@ -24,7 +28,12 @@ appstreamcli = find_program('appstreamcli', required: false, disabler: true)
test('Validate appstream file', appstreamcli,
args: ['validate', '--no-net', '--explain', appstream_file])
install_data('dev.mnts.ModManager.gschema.xml',
gschema = configure_file(
input: '@0@.gschema.xml.in'.format(base_id),
output: '@0@.gschema.xml'.format(application_id),
configuration: configuration,
install: true,
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas'
)

View file

@ -51,7 +51,7 @@
"sources": [
{
"type": "git",
"url": "file:///home/tine/projects"
"url": "."
}
]
}

View file

@ -7,7 +7,6 @@ project('mod-manager', 'rust',
i18n = import('i18n')
gnome = import('gnome')
base_id = 'dev.mnts.ModManager'
gettext_package = meson.project_name()

View file

@ -22,11 +22,11 @@ use adw::subclass::prelude::*;
use gtk::prelude::*;
use gtk::{gio, glib};
use crate::config::APP_ID;
use crate::config::VERSION;
use crate::config::APP_ID;
use crate::windows::main::Welcome;
use crate::windows::main::ModManagerWindowMain;
use crate::settings::ModManagerSettings;
use crate::windows::main::ModManagerWindowMain;
use crate::windows::main::Welcome;
mod imp {
@ -89,7 +89,7 @@ glib::wrapper! {
}
impl ModManagerApplication {
pub fn new( flags: &gio::ApplicationFlags) -> Self {
pub fn new(flags: &gio::ApplicationFlags) -> Self {
glib::Object::builder()
.property("application-id", APP_ID)
.property("flags", flags)
@ -121,4 +121,3 @@ impl ModManagerApplication {
about.present();
}
}

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<schemalist>
<schema id="@APP_ID@" gettext-domain="@GETTEXT_PACKAGE@" path="/dev/mnts/ModManager/">
<key name="games" type="{ss}">
<default>{}</default>
<summary>Dictionary of games being managed. First string is game name second is path to mods folder.</summary>
</key>
</schema>
</schemalist>

View file

@ -1,33 +1,33 @@
/*
Copyright (c) 2023 Tine Jozelj
Copyright (c) 2023 Tine Jozelj
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod application;
mod config;
mod windows;
mod components;
mod api;
mod application;
mod components;
mod config;
mod settings;
mod windows;
use self::application::ModManagerApplication;
use config::{GETTEXT_PACKAGE, LOCALEDIR, PKGDATADIR};
use gettextrs::{bind_textdomain_codeset, bindtextdomain, textdomain};
use gtk::{gio, glib};
use gtk::prelude::*;
use gtk::{gio, glib};
fn main() -> glib::ExitCode {
// Set up gettext translations
@ -44,7 +44,7 @@ fn main() -> glib::ExitCode {
// Create a new GtkApplication. The application manages our main loop,
// application windows, integration with the window manager/compositor, and
// desktop features such as file opening and single-instance applications.
let app = ModManagerApplication::new( &gio::ApplicationFlags::empty());
let app = ModManagerApplication::new(&gio::ApplicationFlags::empty());
// Run the application. This function will block until the application
// exits. Upon return, we have our exit code to return to the shell. (This

View file

@ -1,7 +1,7 @@
datadir = get_option('prefix') / get_option('datadir')
pkgdatadir = datadir / meson.project_name()
pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name()
gnome = import('gnome')
# GResources
blueprints = custom_target('blueprints',
input: files(
'windows/main/main.blp',
@ -13,7 +13,6 @@ blueprints = custom_target('blueprints',
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)
gnome.compile_resources('mod-manager',
'mod-manager.gresource.xml',
dependencies: blueprints,
@ -22,19 +21,6 @@ gnome.compile_resources('mod-manager',
install_dir: pkgdatadir,
)
# GSchema
gschema_conf = configuration_data()
gschema_conf.set('APP_ID', application_id)
gschema_conf.set('GETTEXT_PACKAGE', gettext_package)
gschema = configure_file(
input: '@0@.gschema.xml.in'.format(base_id),
output: '@0@.gschema.xml'.format(application_id),
configuration: gschema_conf,
install: true,
install_dir: pkgdatadir / 'glib-2.0' / 'schemas'
)
gnome.compile_schemas(depend_files: gschema)
# Configuration
conf = configuration_data()
conf.set_quoted('APP_ID', application_id)

View file

@ -1,18 +1,20 @@
use gio::glib;
use gsettings_macro::gen_settings;
use gtk::gio;
use gio::glib;
use std::collections::HashMap;
use crate::config::APP_ID;
#[gen_settings(
file = "./src/dev.mnts.ModManager.gschema.xml.in",
#[gen_settings(file = "./data/dev.mnts.ModManager.gschema.xml.in")]
#[gen_settings_define(
key_name = "games",
arg_type = "HashMap<String, String>",
ret_type = "HashMap<String, String>"
)]
#[gen_settings_define(key_name = "games", arg_type = "HashMap<String, String>", ret_type = "HashMap<String, String>")]
pub struct ModManagerSettings;
impl Default for ModManagerSettings {
fn default() -> Self {
Self::new(APP_ID)
}
}
}