summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index bdc3682..fd4b51c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,13 +29,13 @@ pub mod components {
     pub use preferences::Preferences;
 }
 
-use components::{post_editor::Post, PostEditorInput};
+use components::{post_editor::{Post, PostConversionSettings}, PostEditorInput};
 use soup::prelude::SessionExt;
 
 pub mod secrets;
 pub mod micropub;
 pub mod util;
-pub const APPLICATION_ID: &str = "xyz.vikanezrimaya.kittybox.Bowl";
+pub const APPLICATION_ID: &str = env!("APP_ID");
 pub const CLIENT_ID_STR: &str = "https://kittybox.fireburn.ru/bowl/";
 
 #[derive(Debug)]
@@ -43,6 +43,7 @@ pub struct App {
     secret_schema: libsecret::Schema,
     http: soup::Session,
     submit_busy_guard: Option<gtk::gio::ApplicationBusyGuard>,
+    settings: gio::Settings,
 
     // TODO: make this support multiple users
     micropub: Option<micropub::Client>,
@@ -415,10 +416,10 @@ impl AsyncComponent for App {
                         set_popover = &gtk::PopoverMenu::from_model(Some(&main_menu)) {},
                         #[watch]
                         set_visible: model.micropub.is_some(),
-                        set_icon_name: "menu",
+                        set_icon_name: "menu-symbolic",
                     },
                     pack_end = &gtk::Button {
-                        set_icon_name: "document-send-symbolic",
+                        set_icon_name: "paper-plane",
                         set_tooltip: &gettext("Publish"),
                         #[watch]
                         set_visible: model.micropub.is_some(),
@@ -473,6 +474,7 @@ impl AsyncComponent for App {
             http: http.clone(),
             micropub: state,
             secret_schema,
+            settings: gio::Settings::new(crate::APPLICATION_ID),
 
             post_editor: {
                 #[cfg(feature = "smart-summary")]
@@ -561,7 +563,9 @@ impl AsyncComponent for App {
             }
             Input::PostEditor(Some(post)) => {
                 if let Some(micropub) = self.micropub.as_ref() {
-                    let mf2 = post.into();
+                    let mf2 = post.into_mf2(PostConversionSettings {
+                        send_html_directly: self.settings.get("send-html-directly")
+                    });
                     log::debug!("Submitting post: {:#}", serde_json::to_string(&mf2).unwrap());
                     match micropub.send_post(mf2).await {
                         Ok(uri) => {