Selaa lähdekoodia

wallet: fine-tune log targets to exclude spammiest logs

darkfi 1 vuosi sitten
vanhempi
sitoutus
f36cef6bbc

+ 13 - 3
bin/darkwallet/src/logger.rs

@@ -7,7 +7,7 @@ use simplelog::{
 use std::{path::PathBuf, thread::sleep, time::Duration};
 use std::{path::PathBuf, thread::sleep, time::Duration};
 
 
 #[cfg(target_os = "android")]
 #[cfg(target_os = "android")]
-const LOGS_ENABLED: bool = false;
+const LOGS_ENABLED: bool = true;
 
 
 #[cfg(not(target_os = "android"))]
 #[cfg(not(target_os = "android"))]
 const LOGS_ENABLED: bool = true;
 const LOGS_ENABLED: bool = true;
@@ -50,8 +50,12 @@ mod android {
             let target = metadata.target();
             let target = metadata.target();
             if target.starts_with("sled") ||
             if target.starts_with("sled") ||
                 target.starts_with("rustls") ||
                 target.starts_with("rustls") ||
-                target.starts_with("net::") ||
-                target.starts_with("event_graph")
+                target.starts_with("net::channel") ||
+                target.starts_with("net::message_publisher") ||
+                target.starts_with("net::hosts") ||
+                target.starts_with("net::protocol") ||
+                target.starts_with("net::session") ||
+                target.starts_with("event_graph::dag_sync")
             {
             {
                 return false
                 return false
             }
             }
@@ -92,6 +96,12 @@ pub fn setup_logging() {
     let mut cfg = ConfigBuilder::new();
     let mut cfg = ConfigBuilder::new();
     cfg.add_filter_ignore_str("sled");
     cfg.add_filter_ignore_str("sled");
     cfg.add_filter_ignore_str("rustls");
     cfg.add_filter_ignore_str("rustls");
+    cfg.add_filter_ignore_str("net::channel");
+    cfg.add_filter_ignore_str("net::message_publisher");
+    cfg.add_filter_ignore_str("net::hosts");
+    cfg.add_filter_ignore_str("net::protocol");
+    cfg.add_filter_ignore_str("net::session");
+    cfg.add_filter_ignore_str("event_graph::dag_sync");
     let cfg = cfg.build();
     let cfg = cfg.build();
 
 
     if LOGS_ENABLED {
     if LOGS_ENABLED {

+ 4 - 0
bin/darkwallet/src/text/core.rs

@@ -218,6 +218,10 @@ fn face_shape(face: &mut FreetypeFace, text: &str, off: usize, face_idx: usize)
     glyphs
     glyphs
 }
 }
 
 
+/// Shape text using fallback fonts. We shape it using the primary font, then go down through
+/// the list of fallbacks. For every zero we encounter, take the remaining text on that line
+/// and try to shape it. Then replace that glyph + any others in the cluster with the new one.
+/// [More info](https://zachbayl.in/blog/font_fallback_revery/)
 pub(super) fn shape(faces: &mut Vec<FreetypeFace>, text: &str) -> Vec<GlyphInfo> {
 pub(super) fn shape(faces: &mut Vec<FreetypeFace>, text: &str) -> Vec<GlyphInfo> {
     let glyphs = face_shape(&mut faces[0], text, 0, 0);
     let glyphs = face_shape(&mut faces[0], text, 0, 0);
     let mut shaped = ShapedGlyphs::new(glyphs);
     let mut shaped = ShapedGlyphs::new(glyphs);

+ 3 - 0
bin/darkwallet/src/ui/chatedit.rs

@@ -1961,6 +1961,9 @@ impl UIObject for ChatEdit {
             return false
             return false
         }
         }
 
 
+        // Must be updated before checking the mods. You can press ctrl+a, then release ctrl
+        // before a is released. Then the repeater never gets reset, and uses any old value
+        // it has from before for a.
         let actions = {
         let actions = {
             let mut repeater = self.key_repeat.lock();
             let mut repeater = self.key_repeat.lock();
             repeater.key_down(PressedKey::Char(key), repeat)
             repeater.key_down(PressedKey::Char(key), repeat)

+ 3 - 1
bin/darkwallet/src/ui/editbox/repeat.rs

@@ -47,7 +47,9 @@ impl PressedKeysSmoothRepeat {
     pub fn key_down(&mut self, key: PressedKey, repeat: bool) -> u32 {
     pub fn key_down(&mut self, key: PressedKey, repeat: bool) -> u32 {
         //debug!(target: "PressedKeysSmoothRepeat", "key_down({:?}, {})", key, repeat);
         //debug!(target: "PressedKeysSmoothRepeat", "key_down({:?}, {})", key, repeat);
 
 
-        if !repeat {
+        let is_initial_keypress = !repeat;
+        if is_initial_keypress {
+            //debug!(target: "PressedKeysSmoothRepeat", "remove key {:?}", key);
             self.pressed_keys.remove(&key);
             self.pressed_keys.remove(&key);
             return 1;
             return 1;
         }
         }