diff options
author | mbkma <[email protected]> | 2021-02-20 09:45:59 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-03-22 23:31:26 +0100 |
commit | e3ea3965890dcbccc9a7d2958472f0ed46b872fc (patch) | |
tree | 5870952f65e051b8b6e1846c16ed73ea608babf7 /src/math-window.c | |
parent | 2dd5cac39d37c8f15ddc3d702e79bba11d8ad8ad (diff) | |
download | mate-calc-e3ea3965890dcbccc9a7d2958472f0ed46b872fc.tar.bz2 mate-calc-e3ea3965890dcbccc9a7d2958472f0ed46b872fc.tar.xz |
history view follows preferences
Diffstat (limited to 'src/math-window.c')
-rw-r--r-- | src/math-window.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/math-window.c b/src/math-window.c index be4f02e..8d6f79d 100644 --- a/src/math-window.c +++ b/src/math-window.c @@ -444,10 +444,17 @@ static GtkWidget *add_menu(GtkWidget *menu_bar, const gchar *name) } static void -update_history_cb (MathEquation *equation, char *answer, MPNumber *number, int number_base, gpointer data) +update_history_cb (MathEquation *equation, char *equation_string, MPNumber *answer, MathWindow *window) { /* Recieves signal emitted by a MathEquation object for updating history */ - MathWindow *window = MATH_WINDOW(data); - math_history_insert_entry (window->priv->history, answer, number, number_base); /* Sends current equation and answer for updating History-View */ + math_history_insert_entry (window->priv->history, equation_string, answer); /* Sends current equation string and answer for updating History-View */ +} + +static void +history_set_serializer_cb(MathEquation *equation, MathWindow *window) +{ + MpSerializer *serializer = math_equation_get_serializer(equation); + + math_history_set_serializer(window->priv->history, serializer); } static void quit_cb(GtkWidget* widget, MathWindow* window) @@ -599,6 +606,8 @@ create_gui(MathWindow *window) g_signal_connect(window->priv->equation, "history", G_CALLBACK(update_history_cb), window); g_signal_connect(window, "notify::show-history", G_CALLBACK(show_history_cb), NULL); show_history_cb(window, NULL); + g_signal_connect(window->priv->equation, "display-changed", G_CALLBACK(history_set_serializer_cb), window); + history_set_serializer_cb(window->priv->equation, window); gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(window->priv->history), TRUE, TRUE, 0); scrolled_window = gtk_scrolled_window_new(NULL, NULL); |