From a8a6882cdab6e8f13c256bdc0d1339c13ee862d0 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Sun, 14 Feb 2021 02:04:07 +0100 Subject: [PATCH] application: use FrctlApplication as name --- src/application.rs | 24 ++++++++++++------------ src/main.rs | 4 ++-- src/widgets/window.rs | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/application.rs b/src/application.rs index 996a14bb..03cd95e9 100644 --- a/src/application.rs +++ b/src/application.rs @@ -16,13 +16,13 @@ mod imp { use glib::subclass; #[derive(Debug)] - pub struct ExampleApplication { + pub struct FrctlApplication { pub window: OnceCell>, } - impl ObjectSubclass for ExampleApplication { - const NAME: &'static str = "ExampleApplication"; - type Type = super::ExampleApplication; + impl ObjectSubclass for FrctlApplication { + const NAME: &'static str = "FrctlApplication"; + type Type = super::FrctlApplication; type ParentType = gtk::Application; type Interfaces = (); type Instance = subclass::simple::InstanceStruct; @@ -37,11 +37,11 @@ mod imp { } } - impl ObjectImpl for ExampleApplication {} + impl ObjectImpl for FrctlApplication {} - impl gio::subclass::prelude::ApplicationImpl for ExampleApplication { + impl gio::subclass::prelude::ApplicationImpl for FrctlApplication { fn activate(&self, app: &Self::Type) { - debug!("GtkApplication::activate"); + debug!("GtkApplication::activate"); if let Some(window) = self.window.get() { let window = window.upgrade().unwrap(); @@ -65,20 +65,20 @@ mod imp { } fn startup(&self, app: &Self::Type) { - debug!("GtkApplication::startup"); + debug!("GtkApplication::startup"); self.parent_startup(app); } } - impl GtkApplicationImpl for ExampleApplication {} + impl GtkApplicationImpl for FrctlApplication {} } glib::wrapper! { - pub struct ExampleApplication(ObjectSubclass) + pub struct FrctlApplication(ObjectSubclass) @extends gio::Application, gtk::Application, @implements gio::ActionMap, gio::ActionGroup; } -impl ExampleApplication { +impl FrctlApplication { pub fn new() -> Self { glib::Object::new(&[ ("application-id", &Some(config::APP_ID)), @@ -88,7 +88,7 @@ impl ExampleApplication { } fn get_main_window(&self) -> FrctlWindow { - imp::ExampleApplication::from_instance(self) + imp::FrctlApplication::from_instance(self) .window .get() .unwrap() diff --git a/src/main.rs b/src/main.rs index 7a2ec43b..e7903f45 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ mod config; mod widgets; use adw; -use application::ExampleApplication; +use application::FrctlApplication; use config::{GETTEXT_PACKAGE, LOCALEDIR, RESOURCES_FILE}; use gettextrs::*; use gtk::gdk::Display; @@ -33,6 +33,6 @@ fn main() { .unwrap() .add_resource_path("/org/gnome/FractalNext/icons"); - let app = ExampleApplication::new(); + let app = FrctlApplication::new(); app.run(); } diff --git a/src/widgets/window.rs b/src/widgets/window.rs index 379ed6af..7f6d8287 100644 --- a/src/widgets/window.rs +++ b/src/widgets/window.rs @@ -1,4 +1,4 @@ -use crate::application::ExampleApplication; +use crate::application::FrctlApplication; use crate::config::{APP_ID, PROFILE}; use crate::widgets::FrctlLogin; use crate::widgets::FrctlSession;