Skip to content

Commit 18e332c

Browse files
committed
Rename 'ExampleApplication' to 'CredentialsUi'
1 parent f88eb0c commit 18e332c

File tree

4 files changed

+43
-43
lines changed

4 files changed

+43
-43
lines changed

credentialsd-ui/data/resources/ui/window.ui

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</item>
1717
</section>
1818
</menu>
19-
<template class="ExampleApplicationWindow" parent="GtkApplicationWindow">
19+
<template class="CredentialsUiWindow" parent="GtkApplicationWindow">
2020
<child type="titlebar">
2121
<object class="GtkHeaderBar" id="headerbar">
2222
<child type="end">
@@ -37,7 +37,7 @@
3737
<binding name="label">
3838
<lookup name="title">
3939
<lookup name="view-model">
40-
ExampleApplicationWindow
40+
CredentialsUiWindow
4141
</lookup>
4242
</lookup>
4343
</binding>
@@ -67,7 +67,7 @@
6767
<binding name="child">
6868
<lookup name="devices">
6969
<lookup name="view-model">
70-
ExampleApplicationWindow
70+
CredentialsUiWindow
7171
</lookup>
7272
</lookup>
7373
</binding>
@@ -95,7 +95,7 @@
9595
<binding name="label">
9696
<lookup name="prompt">
9797
<lookup name="view-model">
98-
ExampleApplicationWindow
98+
CredentialsUiWindow
9999
</lookup>
100100
</lookup>
101101
</binding>
@@ -107,7 +107,7 @@
107107
<binding name="visible">
108108
<lookup name="usb_pin_entry_visible">
109109
<lookup name="view-model">
110-
ExampleApplicationWindow
110+
CredentialsUiWindow
111111
</lookup>
112112
</lookup>
113113
</binding>
@@ -131,7 +131,7 @@
131131
<binding name="visible">
132132
<lookup name="qr_spinner_visible">
133133
<lookup name="view-model">
134-
ExampleApplicationWindow
134+
CredentialsUiWindow
135135
</lookup>
136136
</lookup>
137137
</binding>
@@ -142,7 +142,7 @@
142142
<binding name="visible">
143143
<lookup name="qr_code_visible">
144144
<lookup name="view-model">
145-
ExampleApplicationWindow
145+
CredentialsUiWindow
146146
</lookup>
147147
</lookup>
148148
</binding>
@@ -153,7 +153,7 @@
153153
<binding name="label">
154154
<lookup name="prompt">
155155
<lookup name="view-model">
156-
ExampleApplicationWindow
156+
CredentialsUiWindow
157157
</lookup>
158158
</lookup>
159159
</binding>
@@ -182,7 +182,7 @@
182182
<binding name="child">
183183
<lookup name="credentials">
184184
<lookup name="view-model">
185-
ExampleApplicationWindow
185+
CredentialsUiWindow
186186
</lookup>
187187
</lookup>
188188
</binding>
@@ -222,7 +222,7 @@
222222
<binding name="label">
223223
<lookup name="prompt">
224224
<lookup name="view-model">
225-
ExampleApplicationWindow
225+
CredentialsUiWindow
226226
</lookup>
227227
</lookup>
228228
</binding>

credentialsd-ui/src/gui/view_model/gtk/application.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use gtk::prelude::*;
66
use gtk::subclass::prelude::*;
77
use gtk::{gdk, gio, glib};
88

9-
use super::{ViewModel, window::ExampleApplicationWindow};
9+
use super::{ViewModel, window::CredentialsUiWindow};
1010
use crate::config::{APP_ID, PKGDATADIR, PROFILE, VERSION};
1111
use crate::gui::view_model::{ViewEvent, ViewUpdate};
1212

@@ -21,25 +21,25 @@ mod imp {
2121
};
2222

2323
#[derive(Debug, Default)]
24-
pub struct ExampleApplication {
25-
pub window: OnceCell<WeakRef<ExampleApplicationWindow>>,
24+
pub struct CredentialsUi {
25+
pub window: OnceCell<WeakRef<CredentialsUiWindow>>,
2626

2727
pub(super) tx: RefCell<Option<Sender<ViewEvent>>>,
2828
pub(super) rx: RefCell<Option<Receiver<ViewUpdate>>>,
2929
}
3030

3131
#[glib::object_subclass]
32-
impl ObjectSubclass for ExampleApplication {
33-
const NAME: &'static str = "ExampleApplication";
34-
type Type = super::ExampleApplication;
32+
impl ObjectSubclass for CredentialsUi {
33+
const NAME: &'static str = "CredentialsUi";
34+
type Type = super::CredentialsUi;
3535
type ParentType = gtk::Application;
3636
}
3737

38-
impl ObjectImpl for ExampleApplication {}
38+
impl ObjectImpl for CredentialsUi {}
3939

40-
impl ApplicationImpl for ExampleApplication {
40+
impl ApplicationImpl for CredentialsUi {
4141
fn activate(&self) {
42-
debug!("GtkApplication<ExampleApplication>::activate");
42+
debug!("GtkApplication<CredentialsUi>::activate");
4343
self.parent_activate();
4444
let app = self.obj();
4545

@@ -53,7 +53,7 @@ mod imp {
5353
let rx = self.rx.take().expect("receiver to be initiated");
5454
let view_model = ViewModel::new(tx, rx);
5555
let vm2 = view_model.clone();
56-
let window = ExampleApplicationWindow::new(&app, view_model);
56+
let window = CredentialsUiWindow::new(&app, view_model);
5757
let window2 = window.clone();
5858
vm2.clone().connect_completed_notify(move |vm| {
5959
if vm.completed() {
@@ -91,7 +91,7 @@ mod imp {
9191
}
9292

9393
fn startup(&self) {
94-
debug!("GtkApplication<ExampleApplication>::startup");
94+
debug!("GtkApplication<CredentialsUi>::startup");
9595
self.parent_startup();
9696
let app = self.obj();
9797

@@ -104,17 +104,17 @@ mod imp {
104104
}
105105
}
106106

107-
impl GtkApplicationImpl for ExampleApplication {}
107+
impl GtkApplicationImpl for CredentialsUi {}
108108
}
109109

110110
glib::wrapper! {
111-
pub struct ExampleApplication(ObjectSubclass<imp::ExampleApplication>)
111+
pub struct CredentialsUi(ObjectSubclass<imp::CredentialsUi>)
112112
@extends gio::Application, gtk::Application,
113113
@implements gio::ActionMap, gio::ActionGroup;
114114
}
115115

116-
impl ExampleApplication {
117-
fn main_window(&self) -> ExampleApplicationWindow {
116+
impl CredentialsUi {
117+
fn main_window(&self) -> CredentialsUiWindow {
118118
self.imp().window.get().unwrap().upgrade().unwrap()
119119
}
120120

credentialsd-ui/src/gui/view_model/gtk/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use qrcode::QrCode;
1616
use tracing::debug;
1717

1818
use crate::config::{GETTEXT_PACKAGE, LOCALEDIR, RESOURCES_FILE};
19-
use application::ExampleApplication;
19+
use application::CredentialsUi;
2020

2121
use super::Transport;
2222
use super::{Credential, Device};
@@ -365,7 +365,7 @@ pub fn start_gtk_app(
365365
let res = gio::Resource::load(RESOURCES_FILE).expect("Could not load gresource file");
366366
gio::resources_register(&res);
367367

368-
let app = ExampleApplication::new(tx_event, rx_update);
368+
let app = CredentialsUi::new(tx_event, rx_update);
369369
app.run();
370370
}
371371

credentialsd-ui/src/gui/view_model/gtk/window.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use gtk::{
99
glib::{self, clone},
1010
};
1111

12-
use super::application::ExampleApplication;
12+
use super::application::CredentialsUi;
1313
use super::{ViewModel, device::DeviceObject};
1414
use crate::config::{APP_ID, PROFILE};
1515
use crate::gui::view_model::Transport;
@@ -22,9 +22,9 @@ mod imp {
2222
use super::*;
2323

2424
#[derive(Debug, Properties, gtk::CompositeTemplate)]
25-
#[properties(wrapper_type = super::ExampleApplicationWindow)]
25+
#[properties(wrapper_type = super::CredentialsUiWindow)]
2626
#[template(resource = "/xyz/iinuwa/credentialsd/CredentialsUi/ui/window.ui")]
27-
pub struct ExampleApplicationWindow {
27+
pub struct CredentialsUiWindow {
2828
#[template_child]
2929
pub headerbar: TemplateChild<gtk::HeaderBar>,
3030
pub settings: gio::Settings,
@@ -42,7 +42,7 @@ mod imp {
4242
}
4343

4444
#[gtk::template_callbacks]
45-
impl ExampleApplicationWindow {
45+
impl CredentialsUiWindow {
4646
#[template_callback]
4747
fn handle_usb_pin_entered(&self, entry: &gtk::PasswordEntry) {
4848
let view_model = &self.view_model.borrow();
@@ -58,7 +58,7 @@ mod imp {
5858
}
5959
}
6060

61-
impl Default for ExampleApplicationWindow {
61+
impl Default for CredentialsUiWindow {
6262
fn default() -> Self {
6363
Self {
6464
headerbar: TemplateChild::default(),
@@ -72,9 +72,9 @@ mod imp {
7272
}
7373

7474
#[glib::object_subclass]
75-
impl ObjectSubclass for ExampleApplicationWindow {
76-
const NAME: &'static str = "ExampleApplicationWindow";
77-
type Type = super::ExampleApplicationWindow;
75+
impl ObjectSubclass for CredentialsUiWindow {
76+
const NAME: &'static str = "CredentialsUiWindow";
77+
type Type = super::CredentialsUiWindow;
7878
type ParentType = gtk::ApplicationWindow;
7979

8080
fn class_init(klass: &mut Self::Class) {
@@ -89,7 +89,7 @@ mod imp {
8989
}
9090

9191
#[glib::derived_properties]
92-
impl ObjectImpl for ExampleApplicationWindow {
92+
impl ObjectImpl for CredentialsUiWindow {
9393
fn constructed(&self) {
9494
self.parent_constructed();
9595
let obj = self.obj();
@@ -104,8 +104,8 @@ mod imp {
104104
}
105105
}
106106

107-
impl WidgetImpl for ExampleApplicationWindow {}
108-
impl WindowImpl for ExampleApplicationWindow {
107+
impl WidgetImpl for CredentialsUiWindow {}
108+
impl WindowImpl for CredentialsUiWindow {
109109
// Save window state on delete event
110110
fn close_request(&self) -> glib::Propagation {
111111
if let Some(vm) = self.view_model.borrow().as_ref() {
@@ -128,19 +128,19 @@ mod imp {
128128
}
129129
}
130130

131-
impl ApplicationWindowImpl for ExampleApplicationWindow {}
131+
impl ApplicationWindowImpl for CredentialsUiWindow {}
132132
}
133133

134134
glib::wrapper! {
135-
pub struct ExampleApplicationWindow(ObjectSubclass<imp::ExampleApplicationWindow>)
135+
pub struct CredentialsUiWindow(ObjectSubclass<imp::CredentialsUiWindow>)
136136
@extends gtk::Widget, gtk::Window, gtk::ApplicationWindow,
137137
@implements gio::ActionMap, gio::ActionGroup, gtk::Root;
138138

139139
}
140140

141-
impl ExampleApplicationWindow {
142-
pub fn new(app: &ExampleApplication, view_model: ViewModel) -> Self {
143-
let window: ExampleApplicationWindow = glib::Object::builder()
141+
impl CredentialsUiWindow {
142+
pub fn new(app: &CredentialsUi, view_model: ViewModel) -> Self {
143+
let window: CredentialsUiWindow = glib::Object::builder()
144144
.property("application", app)
145145
.property("view-model", view_model)
146146
.build();

0 commit comments

Comments
 (0)