wip: allow multiple instances of each applet
This commit is contained in:
parent
e87d101217
commit
f6e5e04382
5 changed files with 10 additions and 8 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>(());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue