Compare commits
No commits in common. "236e4094d7fbce07c310f4f949aca2d8acbffeea" and "f4735dd16b7bcd570c48b05e8a0a1830e1158ff6" have entirely different histories.
236e4094d7
...
f4735dd16b
|
@ -894,24 +894,6 @@ dependencies = [
|
||||||
"system-deps",
|
"system-deps",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gm-control-panel"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"config",
|
|
||||||
"config-derive",
|
|
||||||
"futures",
|
|
||||||
"gdk4",
|
|
||||||
"gio",
|
|
||||||
"glib",
|
|
||||||
"glib-build-tools",
|
|
||||||
"gtk4",
|
|
||||||
"libadwaita",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gobject-sys"
|
name = "gobject-sys"
|
||||||
version = "0.17.10"
|
version = "0.17.10"
|
||||||
|
|
|
@ -11,7 +11,6 @@ members = [
|
||||||
"fluent-ergonomics",
|
"fluent-ergonomics",
|
||||||
"kifu/core",
|
"kifu/core",
|
||||||
"geo-types",
|
"geo-types",
|
||||||
"gm-control-panel",
|
|
||||||
"hex-grid",
|
"hex-grid",
|
||||||
"ifc",
|
"ifc",
|
||||||
"memorycache",
|
"memorycache",
|
||||||
|
|
2
build.sh
2
build.sh
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
set -x
|
||||||
|
|
||||||
RUST_ALL_TARGETS=(
|
RUST_ALL_TARGETS=(
|
||||||
"changeset"
|
"changeset"
|
||||||
|
@ -13,7 +14,6 @@ RUST_ALL_TARGETS=(
|
||||||
"flow"
|
"flow"
|
||||||
"fluent-ergonomics"
|
"fluent-ergonomics"
|
||||||
"geo-types"
|
"geo-types"
|
||||||
"gm-control-panel"
|
|
||||||
"hex-grid"
|
"hex-grid"
|
||||||
"ifc"
|
"ifc"
|
||||||
"memorycache"
|
"memorycache"
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "gm-control-panel"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
adw = { version = "0.4", package = "libadwaita", features = [ "v1_2" ] }
|
|
||||||
config = { path = "../config" }
|
|
||||||
config-derive = { path = "../config-derive" }
|
|
||||||
futures = { version = "0.3" }
|
|
||||||
gio = { version = "0.17" }
|
|
||||||
glib = { version = "0.17" }
|
|
||||||
gdk = { version = "0.6", package = "gdk4" }
|
|
||||||
gtk = { version = "0.6", package = "gtk4" }
|
|
||||||
serde = { version = "1" }
|
|
||||||
serde_json = { version = "*" }
|
|
||||||
tokio = { version = "1", features = ["full"] }
|
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
glib-build-tools = "0.16"
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
fn main() {
|
|
||||||
glib_build_tools::compile_resources(
|
|
||||||
"resources",
|
|
||||||
"resources/gresources.xml",
|
|
||||||
"com.luminescent-dreams.dashboard.gresource",
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<gresources>
|
|
||||||
</gresources>
|
|
|
@ -1,12 +0,0 @@
|
||||||
#[derive(Clone)]
|
|
||||||
pub struct ApplicationWindow {
|
|
||||||
pub window: adw::ApplicationWindow,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ApplicationWindow {
|
|
||||||
pub fn new(app: &adw::Application) -> Self {
|
|
||||||
let window = adw::ApplicationWindow::new(app);
|
|
||||||
|
|
||||||
Self { window }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
use config::define_config;
|
|
||||||
use config_derive::ConfigOption;
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
define_config! {
|
|
||||||
Language(Language),
|
|
||||||
MusicPath(MusicPath),
|
|
||||||
PlaylistDatabasePath(PlaylistDatabasePath),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ConfigOption)]
|
|
||||||
pub struct Language(String);
|
|
||||||
|
|
||||||
impl std::ops::Deref for Language {
|
|
||||||
type Target = String;
|
|
||||||
fn deref(&self) -> &Self::Target {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ConfigOption)]
|
|
||||||
pub struct MusicPath(PathBuf);
|
|
||||||
|
|
||||||
impl std::ops::Deref for MusicPath {
|
|
||||||
type Target = PathBuf;
|
|
||||||
fn deref(&self) -> &Self::Target {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ConfigOption)]
|
|
||||||
pub struct PlaylistDatabasePath(PathBuf);
|
|
||||||
|
|
||||||
impl std::ops::Deref for PlaylistDatabasePath {
|
|
||||||
type Target = PathBuf;
|
|
||||||
fn deref(&self) -> &Self::Target {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
use glib::{Continue, Sender};
|
|
||||||
use gtk::prelude::*;
|
|
||||||
use std::{
|
|
||||||
env,
|
|
||||||
sync::{Arc, RwLock},
|
|
||||||
};
|
|
||||||
|
|
||||||
mod app_window;
|
|
||||||
use app_window::ApplicationWindow;
|
|
||||||
|
|
||||||
mod config;
|
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
|
||||||
pub enum Message {}
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
|
||||||
pub struct Core {
|
|
||||||
tx: Arc<RwLock<Option<Sender<Message>>>>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let app = adw::Application::builder()
|
|
||||||
.application_id("com.luminescent-dreams.gm-control-panel")
|
|
||||||
.build();
|
|
||||||
|
|
||||||
let runtime = tokio::runtime::Builder::new_multi_thread()
|
|
||||||
.enable_all()
|
|
||||||
.build()
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let core = Core {
|
|
||||||
tx: Arc::new(RwLock::new(None)),
|
|
||||||
};
|
|
||||||
|
|
||||||
app.connect_activate(move |app| {
|
|
||||||
let (gtk_tx, gtk_rx) =
|
|
||||||
gtk::glib::MainContext::channel::<Message>(gtk::glib::PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
*core.tx.write().unwrap() = Some(gtk_tx);
|
|
||||||
|
|
||||||
let window = ApplicationWindow::new(app);
|
|
||||||
window.window.present();
|
|
||||||
|
|
||||||
gtk_rx.attach(None, move |_msg| Continue(true));
|
|
||||||
});
|
|
||||||
|
|
||||||
let args: Vec<String> = env::args().collect();
|
|
||||||
ApplicationExtManual::run_with_args(&app, &args);
|
|
||||||
runtime.shutdown_background();
|
|
||||||
}
|
|
Loading…
Reference in New Issue