Compare commits
	
		
			No commits in common. "bf4dbc5ba779a52df87d06022a3f0ab1601aa7fd" and "f5e2be9651388cb062487cd8c9508d6bb1e6e030" have entirely different histories.
		
	
	
		
			bf4dbc5ba7
			...
			f5e2be9651
		
	
		
| @ -20,7 +20,7 @@ pki-types = { package = "rustls-pki-types", version = "1.0", features = [ | |||||||
|     "alloc", |     "alloc", | ||||||
| ] } | ] } | ||||||
| tokio-rustls = { version = "0.25" } | tokio-rustls = { version = "0.25" } | ||||||
| env_logger = "0.11" | env_logger = "0.10.1" | ||||||
| log = "0.4.20" | log = "0.4.20" | ||||||
| tokio = { version = "1.34.0", features = ["full", "tracing"] } | tokio = { version = "1.34.0", features = ["full", "tracing"] } | ||||||
| webpki-roots = "0.26.0" | webpki-roots = "0.26.0" | ||||||
| @ -28,10 +28,7 @@ nom = "7.1.3" | |||||||
| managesieve = { path = "../managesieve" } | managesieve = { path = "../managesieve" } | ||||||
| anyhow = "1.0" | anyhow = "1.0" | ||||||
| thiserror = "1.0" | thiserror = "1.0" | ||||||
| gtk = { version = "0.7", package = "gtk4", features = [ | gtk4 = { version = "0.7", features = ["gnome_45", "blueprint"] } | ||||||
|     "gnome_45", |  | ||||||
|     "blueprint", |  | ||||||
| ] } |  | ||||||
| serde = { version = "1.0.193", features = ["derive"] } | serde = { version = "1.0.193", features = ["derive"] } | ||||||
| libadwaita = { version = "0.5.3", features = ["gtk_v4_10", "v1_4"] } | libadwaita = { version = "0.5.3", features = ["gtk_v4_10", "v1_4"] } | ||||||
| gtk-blueprint = "0.2" | gtk-blueprint = "0.2" | ||||||
|  | |||||||
| @ -13,20 +13,11 @@ Adw.ApplicationWindow window { | |||||||
|                 title: "Sieverman"; |                 title: "Sieverman"; | ||||||
|             }; |             }; | ||||||
| 
 | 
 | ||||||
|       [start] |             Gtk.Button { label: "Neu";} | ||||||
|       Gtk.Button { |  | ||||||
|         label: "Neu"; |  | ||||||
|         } |         } | ||||||
| 
 |  | ||||||
|       [end] |  | ||||||
|       Gtk.ToggleButton settings_button { |  | ||||||
|         icon-name: "open-menu-symbolic"; |  | ||||||
|         active: true; |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|         Gtk.Box { |         Gtk.Box { | ||||||
|             orientation: horizontal; |             orientation: horizontal; | ||||||
|  |              | ||||||
|             vexpand: true; |             vexpand: true; | ||||||
|             halign: fill; |             halign: fill; | ||||||
| 
 | 
 | ||||||
| @ -34,14 +25,8 @@ Adw.ApplicationWindow window { | |||||||
|                 label: "Log information"; |                 label: "Log information"; | ||||||
|                 hexpand: true; |                 hexpand: true; | ||||||
|             } |             } | ||||||
| 
 |  | ||||||
|       Gtk.Revealer settings_pane { |  | ||||||
|         reveal-child: bind settings_button.active bidirectional; |  | ||||||
|         transition-type: slide_left; |  | ||||||
| 
 |  | ||||||
|             Gtk.ScrolledWindow server_info { |             Gtk.ScrolledWindow server_info { | ||||||
|                 width-request: 100; |                 width-request: 100; | ||||||
| 
 |  | ||||||
|                 Adw.PreferencesPage { |                 Adw.PreferencesPage { | ||||||
|             Adw.PreferencesGroup server_settings{ |             Adw.PreferencesGroup server_settings{ | ||||||
|                 vexpand: true; |                 vexpand: true; | ||||||
| @ -49,30 +34,21 @@ Adw.ApplicationWindow window { | |||||||
|                 title: "Server Information"; |                 title: "Server Information"; | ||||||
|                 description: "The information the server published on connection"; |                 description: "The information the server published on connection"; | ||||||
|         } |         } | ||||||
| 
 |  | ||||||
|         Adw.PreferencesGroup credentials { |         Adw.PreferencesGroup credentials { | ||||||
|                 vexpand: true; |                 vexpand: true; | ||||||
|                 valign: center; |                 valign: center; | ||||||
|                 title: "Login Information"; |                 title: "Login Information"; | ||||||
|                 description: "The credentials that will be used to log in."; |                 description: "The credentials that will be used to log in."; | ||||||
|  |                 Adw.EntryRow{title: "Username:";} | ||||||
|  |         Adw.PasswordEntryRow{title: "Password:";} | ||||||
| 
 | 
 | ||||||
|               Adw.EntryRow { |         }} | ||||||
|                 title: "Username:"; |  | ||||||
|               } |  | ||||||
|                  |                  | ||||||
|               Adw.PasswordEntryRow { |  | ||||||
|                 title: "Password:"; |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|           } |         Gtk.Statusbar{Gtk.Label{ | ||||||
|         } |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     Gtk.Statusbar { |  | ||||||
|       Gtk.Label { |  | ||||||
|                 label: "Status"; |                 label: "Status"; | ||||||
|       } |             }} | ||||||
|     } | 
 | ||||||
|     }; |     }; | ||||||
| } | } | ||||||
| @ -1,7 +1,8 @@ | |||||||
| use std::{cell::RefCell, rc::Rc}; | use std::{cell::RefCell, rc::Rc}; | ||||||
| 
 | 
 | ||||||
| use crate::__COMPILED_BLUEPRINT_MAP__; | use crate::__COMPILED_BLUEPRINT_MAP__; | ||||||
| use gtk::{ | use gtk4::{ | ||||||
|  |     glib, | ||||||
|     prelude::{ApplicationExt, GtkWindowExt}, |     prelude::{ApplicationExt, GtkWindowExt}, | ||||||
|     Application, |     Application, | ||||||
| }; | }; | ||||||
| @ -24,17 +25,16 @@ pub(crate) fn get_app( | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| fn build_ui( | fn build_ui( | ||||||
|     app: >k::Application, |     app: >k4::Application, | ||||||
|     from_backend_rx: Rc<RefCell<Option<tokio::sync::mpsc::Receiver<BackToFront>>>>, |     from_backend_rx: Rc<RefCell<Option<tokio::sync::mpsc::Receiver<BackToFront>>>>, | ||||||
| ) { | ) { | ||||||
|     let builder = gtk::Builder::new(); |     let builder = gtk4::Builder::new(); | ||||||
|     builder |     builder | ||||||
|         .add_from_string(get_blp!("gui/main_window.blp")) |         .add_from_string(get_blp!("gui/main_window.blp")) | ||||||
|         .expect("Failed to parse blueprint"); |         .expect("Failed to parse blueprint"); | ||||||
|     let main_window = builder |     let main_window = builder | ||||||
|         .object::<libadwaita::ApplicationWindow>("window") |         .object::<libadwaita::ApplicationWindow>("window") | ||||||
|         .unwrap(); |         .unwrap(); | ||||||
| 
 |  | ||||||
|     let prefrences_group = builder |     let prefrences_group = builder | ||||||
|         .object::<libadwaita::PreferencesGroup>("server_settings") |         .object::<libadwaita::PreferencesGroup>("server_settings") | ||||||
|         .unwrap(); |         .unwrap(); | ||||||
| @ -58,14 +58,14 @@ fn build_ui( | |||||||
|         } |         } | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     let c = gtk::glib::MainContext::default(); |     let c = glib::MainContext::default(); | ||||||
|     c.spawn_local(future); |     c.spawn_local(future); | ||||||
|     main_window.present(); |     main_window.present(); | ||||||
|     trace!("Window is visible"); |     trace!("Window is visible"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| fn row_in_settings(name: &str, value: &str) -> libadwaita::ActionRow { | fn row_in_settings(name: &str, value: &str) -> libadwaita::ActionRow { | ||||||
|     let builder = gtk::Builder::new(); |     let builder = gtk4::Builder::new(); | ||||||
|     builder |     builder | ||||||
|         .add_from_string(get_blp!("gui/server_info_row.blp")) |         .add_from_string(get_blp!("gui/server_info_row.blp")) | ||||||
|         .expect("Failed to parse blueprint"); |         .expect("Failed to parse blueprint"); | ||||||
| @ -75,7 +75,7 @@ fn row_in_settings(name: &str, value: &str) -> libadwaita::ActionRow { | |||||||
|         .unwrap(); |         .unwrap(); | ||||||
|     row.set_title(name); |     row.set_title(name); | ||||||
|     let label = builder |     let label = builder | ||||||
|         .object::<gtk::Label>("server_info_row_value") |         .object::<gtk4::Label>("server_info_row_value") | ||||||
|         .unwrap(); |         .unwrap(); | ||||||
|     label.set_label(value); |     label.set_label(value); | ||||||
|     row |     row | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ mod gui; | |||||||
| pub mod protocol; | pub mod protocol; | ||||||
| use std::{cell::RefCell, rc::Rc, thread, time::Duration}; | use std::{cell::RefCell, rc::Rc, thread, time::Duration}; | ||||||
| 
 | 
 | ||||||
| use gtk::{glib, prelude::ApplicationExtManual as _}; | use gtk4::{glib, prelude::ApplicationExtManual as _}; | ||||||
| use tracing::{info, trace}; | use tracing::{info, trace}; | ||||||
| 
 | 
 | ||||||
| gtk_blueprint::gen_blp_map!("gui"); | gtk_blueprint::gen_blp_map!("gui"); | ||||||
| @ -16,7 +16,7 @@ fn main() -> glib::ExitCode { | |||||||
|         .server_addr(([127, 0, 0, 1], 6669)) |         .server_addr(([127, 0, 0, 1], 6669)) | ||||||
|         .init(); |         .init(); | ||||||
| 
 | 
 | ||||||
|     gtk::init().expect("Failed to initialize GTK"); |     gtk4::init().expect("Failed to initialize GTK"); | ||||||
|     libadwaita::init().expect("Adwaita initialization failed"); |     libadwaita::init().expect("Adwaita initialization failed"); | ||||||
| 
 | 
 | ||||||
|     let (to_frontent_tx, from_backend_rx) = tokio::sync::mpsc::channel(5); |     let (to_frontent_tx, from_backend_rx) = tokio::sync::mpsc::channel(5); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user