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();
|
localize();
|
||||||
|
|
||||||
gio::resources_register_include!("compiled.gresource").unwrap();
|
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| {
|
app.connect_activate(|app| {
|
||||||
load_css();
|
load_css();
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build t
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let application = Application::new(
|
let application = Application::new(
|
||||||
Some("com.system76.cosmic.applets.audio"),
|
None,
|
||||||
ApplicationFlags::default(),
|
ApplicationFlags::default(),
|
||||||
);
|
);
|
||||||
application.connect_activate(app);
|
application.connect_activate(app);
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,13 @@
|
||||||
// TODO: handle dbus service start/stop?
|
// TODO: handle dbus service start/stop?
|
||||||
|
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use gtk4::{glib, prelude::*};
|
use gtk4::{glib, prelude::*, gio::ApplicationFlags, Application};
|
||||||
use relm4::{ComponentParts, ComponentSender, RelmApp, SimpleComponent, WidgetPlus};
|
use relm4::{ComponentParts, ComponentSender, RelmApp, SimpleComponent};
|
||||||
use std::{process::Command, time::Duration};
|
use std::{process::Command, time::Duration};
|
||||||
|
|
||||||
mod backlight;
|
mod backlight;
|
||||||
use backlight::{backlight, Backlight, LogindSessionProxy};
|
use backlight::{backlight, Backlight, LogindSessionProxy};
|
||||||
mod power_daemon;
|
mod power_daemon;
|
||||||
use power_daemon::PowerDaemonProxy;
|
|
||||||
mod upower;
|
mod upower;
|
||||||
use upower::UPowerProxy;
|
use upower::UPowerProxy;
|
||||||
mod upower_device;
|
mod upower_device;
|
||||||
|
|
@ -358,6 +357,9 @@ impl SimpleComponent for AppModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let app = RelmApp::new("com.system76.CosmicAppletBattery");
|
let app = RelmApp::with_app(Application::new(
|
||||||
|
None,
|
||||||
|
ApplicationFlags::default(),
|
||||||
|
));
|
||||||
app.run::<AppModel>(());
|
app.run::<AppModel>(());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build t
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let application = gtk4::Application::new(
|
let application = gtk4::Application::new(
|
||||||
Some("com.system76.cosmic.applets.power"),
|
None,
|
||||||
ApplicationFlags::default(),
|
ApplicationFlags::default(),
|
||||||
);
|
);
|
||||||
application.connect_activate(build_ui);
|
application.connect_activate(build_ui);
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ fn main() {
|
||||||
localize();
|
localize();
|
||||||
gio::resources_register_include!("compiled.gresource").unwrap();
|
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| {
|
app.connect_activate(|app| {
|
||||||
load_css();
|
load_css();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue