wip: allow multiple instances of each applet

This commit is contained in:
Ashley Wulber 2022-07-27 15:41:33 -04:00
parent e87d101217
commit f6e5e04382
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
5 changed files with 10 additions and 8 deletions

View file

@ -56,7 +56,7 @@ fn main() {
localize();
gio::resources_register_include!("compiled.gresource").unwrap();
let app = gtk4::Application::new(Some(ID), ApplicationFlags::default());
let app = gtk4::Application::new(None, ApplicationFlags::default());
app.connect_activate(|app| {
load_css();

View file

@ -37,7 +37,7 @@ static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build t
fn main() {
let application = Application::new(
Some("com.system76.cosmic.applets.audio"),
None,
ApplicationFlags::default(),
);
application.connect_activate(app);

View file

@ -2,14 +2,13 @@
// TODO: handle dbus service start/stop?
use futures::prelude::*;
use gtk4::{glib, prelude::*};
use relm4::{ComponentParts, ComponentSender, RelmApp, SimpleComponent, WidgetPlus};
use gtk4::{glib, prelude::*, gio::ApplicationFlags, Application};
use relm4::{ComponentParts, ComponentSender, RelmApp, SimpleComponent};
use std::{process::Command, time::Duration};
mod backlight;
use backlight::{backlight, Backlight, LogindSessionProxy};
mod power_daemon;
use power_daemon::PowerDaemonProxy;
mod upower;
use upower::UPowerProxy;
mod upower_device;
@ -358,6 +357,9 @@ impl SimpleComponent for AppModel {
}
fn main() {
let app = RelmApp::new("com.system76.CosmicAppletBattery");
let app = RelmApp::with_app(Application::new(
None,
ApplicationFlags::default(),
));
app.run::<AppModel>(());
}

View file

@ -15,7 +15,7 @@ static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build t
fn main() {
let application = gtk4::Application::new(
Some("com.system76.cosmic.applets.power"),
None,
ApplicationFlags::default(),
);
application.connect_activate(build_ui);

View file

@ -55,7 +55,7 @@ fn main() {
localize();
gio::resources_register_include!("compiled.gresource").unwrap();
let app = gtk4::Application::new(Some(ID), ApplicationFlags::default());
let app = gtk4::Application::new(None, ApplicationFlags::default());
app.connect_activate(|app| {
load_css();