Merge Controller and View structs into one Application struct.

The `View` sturct was mostly a layer of indirection, and the controller benefitted by absorbing the gtk::Application
subclass parts, so now those two are merged into a new gtk::Application subclass.
This commit is contained in:
Tom A. Wagner
2021-05-08 17:12:04 +02:00
parent 2cc684d57c
commit be240231c0
7 changed files with 276 additions and 348 deletions

View File

@@ -1,8 +1,8 @@
mod controller;
mod application;
mod pipewire_connection;
mod view;
use controller::MediaType;
use application::MediaType;
use gtk::{
glib::{self, PRIORITY_DEFAULT},
prelude::*,
@@ -56,10 +56,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let pw_thread =
std::thread::spawn(move || pipewire_connection::thread_main(gtk_sender, pw_receiver));
let view = view::View::new();
let _controller = controller::Controller::new(view.clone(), gtk_receiver);
let app = application::Application::new(gtk_receiver);
view.run(&std::env::args().collect::<Vec<_>>());
app.run(&std::env::args().collect::<Vec<_>>());
pw_sender
.send(GtkMessage::Terminate)