summaryrefslogtreecommitdiff
path: root/src/math-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math-window.c')
-rw-r--r--src/math-window.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/math-window.c b/src/math-window.c
index f627c65..320f83b 100644
--- a/src/math-window.c
+++ b/src/math-window.c
@@ -9,6 +9,10 @@
* license.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
@@ -82,7 +86,6 @@ math_window_get_equation(MathWindow *window)
return window->priv->equation;
}
-
MathDisplay *
math_window_get_display(MathWindow *window)
{
@@ -90,7 +93,6 @@ math_window_get_display(MathWindow *window)
return window->priv->display;
}
-
MathButtons *
math_window_get_buttons(MathWindow *window)
{
@@ -372,7 +374,7 @@ static void about_cb(GtkWidget* widget, MathWindow* window)
"documenters", documenters,
"translator_credits", _("translator-credits"),
"wrap-license", TRUE,
- "website", "http://mate-desktop.org",
+ "website", PACKAGE_URL,
"icon-name", "accessories-calculator",
"logo-icon-name", "accessories-calculator",
NULL);
@@ -389,7 +391,6 @@ scroll_changed_cb(GtkAdjustment *adjustment, MathWindow *window)
gtk_adjustment_set_value(adjustment, gtk_adjustment_get_upper(adjustment) - gtk_adjustment_get_page_size(adjustment));
}
-
static void
scroll_value_changed_cb(GtkAdjustment *adjustment, MathWindow *window)
{
@@ -440,10 +441,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)
@@ -595,6 +603,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);
@@ -617,7 +627,6 @@ create_gui(MathWindow *window)
gtk_widget_show(GTK_WIDGET(window->priv->buttons));
}
-
static void
math_window_set_property(GObject *object,
guint prop_id,
@@ -642,7 +651,6 @@ math_window_set_property(GObject *object,
}
}
-
static void
math_window_get_property(GObject *object,
guint prop_id,
@@ -666,7 +674,6 @@ math_window_get_property(GObject *object,
}
}
-
static void
math_window_class_init(MathWindowClass *klass)
{
@@ -700,7 +707,6 @@ math_window_class_init(MathWindowClass *klass)
G_TYPE_NONE, 0);
}
-
static void
math_window_init(MathWindow *window)
{