Blame SOURCES/0003-gnome-calculator-Update-refresh-interval-when-change.patch

69ba56
From 21b2235fc53e72eea0aab035de5b19a74fd165c3 Mon Sep 17 00:00:00 2001
69ba56
From: Ray Strode <rstrode@redhat.com>
69ba56
Date: Thu, 13 May 2021 14:08:27 -0400
69ba56
Subject: [PATCH 3/5] gnome-calculator: Update refresh interval when changed in
69ba56
 gsettings
69ba56
69ba56
Right now the refresh interval is read at start up.
69ba56
69ba56
This commit makes sure it gets reread any time it's changed too.
69ba56
---
69ba56
 src/gnome-calculator.vala | 4 ++++
69ba56
 1 file changed, 4 insertions(+)
69ba56
69ba56
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
69ba56
index 5b3f9b8d..89a83450 100644
69ba56
--- a/src/gnome-calculator.vala
69ba56
+++ b/src/gnome-calculator.vala
69ba56
@@ -101,60 +101,64 @@ public class Calculator : Gtk.Application
69ba56
         catch (Error e)
69ba56
         {
69ba56
             error ("Error loading menu UI: %s", e.message);
69ba56
         }
69ba56
 
69ba56
         var menu = builder.get_object ("appmenu") as MenuModel;
69ba56
         set_app_menu (menu);
69ba56
 
69ba56
         set_accels_for_action ("win.mode::basic", {"<alt>B"});
69ba56
         set_accels_for_action ("win.mode::advanced", {"<alt>A"});
69ba56
         set_accels_for_action ("win.mode::financial", {"<alt>F"});
69ba56
         set_accels_for_action ("win.mode::programming", {"<alt>P"});
69ba56
         set_accels_for_action ("win.mode::keyboard", {"<alt>K"});
69ba56
         set_accels_for_action ("win.copy", {"<control>C"});
69ba56
         set_accels_for_action ("win.paste", {"<control>V"});
69ba56
         set_accels_for_action ("win.undo", {"<control>Z"});
69ba56
         set_accels_for_action ("win.close", {"<control>W"});
69ba56
         set_accels_for_action ("win.redo", {"<control><shift>Z"});
69ba56
         return current_window;
69ba56
     }
69ba56
 
69ba56
     protected override void startup ()
69ba56
     {
69ba56
         base.startup ();
69ba56
 
69ba56
         settings = new Settings ("org.gnome.calculator");
69ba56
         last_opened_window = create_new_window (settings);
69ba56
         // restore the first window position from the settings
69ba56
         load_window_position (last_opened_window);
69ba56
         CurrencyManager.get_default ().refresh_interval = settings.get_int ("refresh-interval");
69ba56
+
69ba56
+        settings.changed["refresh-interval"].connect(() => {
69ba56
+            CurrencyManager.get_default ().refresh_interval = settings.get_int ("refresh-interval");
69ba56
+        });
69ba56
     }
69ba56
 
69ba56
     private MathWindow get_active_math_window ()
69ba56
     {
69ba56
         return (MathWindow) get_active_window ();
69ba56
     }
69ba56
 
69ba56
     protected override void activate ()
69ba56
     {
69ba56
         base.activate ();
69ba56
 
69ba56
         last_opened_window.present ();
69ba56
         if (equation_string != "" && equation_string != null)
69ba56
         {
69ba56
             var equations = (equation_string.compress ()).split ("\n",0);
69ba56
             for (var i = 0; i < equations.length; i++)
69ba56
             {
69ba56
                 if ((equations [i].strip ()).length > 0)
69ba56
                     last_opened_window.equation.set (equations [i]);
69ba56
                 else
69ba56
                     last_opened_window.equation.solve ();
69ba56
             }
69ba56
         }
69ba56
         if (mode_string != "" && mode_string != null)
69ba56
         {
69ba56
             var mode = ButtonMode.BASIC;
69ba56
 
69ba56
             switch (mode_string)
69ba56
             {
69ba56
             case "basic":
69ba56
-- 
69ba56
2.31.1
69ba56