[gcalctool] Rename PreferencesDialog to MathPreferencesDialog
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Rename PreferencesDialog to MathPreferencesDialog
- Date: Mon, 12 Apr 2010 08:26:06 +0000 (UTC)
commit b3e103a3a36ddb892989783f2afb2103c0a69b2f
Author: Robert Ancell <robert ancell gmail com>
Date: Mon Apr 12 09:40:12 2010 +1000
Rename PreferencesDialog to MathPreferencesDialog
src/Makefile.am | 4 +-
src/{ui-preferences.c => math-preferences.c} | 64 +++++++++++++-------------
src/{ui-preferences.h => math-preferences.h} | 20 ++++----
src/ui.c | 6 +-
4 files changed, 47 insertions(+), 47 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 7e063ac..baf7dd0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,6 +19,8 @@ gcalctool_SOURCES = \
math-display.h \
math-equation.c \
math-equation.h \
+ math-preferences.c \
+ math-preferences.h \
mp.c \
mp.h \
mp-binary.c \
@@ -38,8 +40,6 @@ gcalctool_SOURCES = \
register.h \
ui.c \
ui.h \
- ui-preferences.c \
- ui-preferences.h \
unittest.c \
unittest.h
diff --git a/src/ui-preferences.c b/src/math-preferences.c
similarity index 87%
rename from src/ui-preferences.c
rename to src/math-preferences.c
index 424a930..37964f5 100644
--- a/src/ui-preferences.c
+++ b/src/math-preferences.c
@@ -19,16 +19,16 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include "ui-preferences.h"
+#include "math-preferences.h"
-G_DEFINE_TYPE (PreferencesDialog, ui_preferences, GTK_TYPE_DIALOG);
+G_DEFINE_TYPE (MathPreferencesDialog, math_preferences, GTK_TYPE_DIALOG);
enum {
PROP_0,
PROP_EQUATION
};
-struct PreferencesDialogPrivate
+struct MathPreferencesDialogPrivate
{
MathEquation *equation;
GtkBuilder *ui;
@@ -39,10 +39,10 @@ struct PreferencesDialogPrivate
GTK_WIDGET(gtk_builder_get_object(ui, name))
-PreferencesDialog *
-ui_preferences_dialog_new(MathEquation *equation)
+MathPreferencesDialog *
+math_preferences_dialog_new(MathEquation *equation)
{
- return g_object_new (ui_preferences_get_type(), "equation", equation, NULL);
+ return g_object_new (math_preferences_get_type(), "equation", equation, NULL);
}
@@ -63,7 +63,7 @@ preferences_dialog_delete_cb(GtkWidget *widget, GdkEvent *event)
G_MODULE_EXPORT
void
-angle_unit_combobox_changed_cb(GtkWidget *combo, PreferencesDialog *dialog)
+angle_unit_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog)
{
MPAngleUnit value;
GtkTreeModel *model;
@@ -78,7 +78,7 @@ angle_unit_combobox_changed_cb(GtkWidget *combo, PreferencesDialog *dialog)
G_MODULE_EXPORT
void
-display_format_combobox_changed_cb(GtkWidget *combo, PreferencesDialog *dialog)
+display_format_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog)
{
DisplayFormat value;
GtkTreeModel *model;
@@ -93,7 +93,7 @@ display_format_combobox_changed_cb(GtkWidget *combo, PreferencesDialog *dialog)
G_MODULE_EXPORT
void
-word_size_combobox_changed_cb(GtkWidget *combo, PreferencesDialog *dialog)
+word_size_combobox_changed_cb(GtkWidget *combo, MathPreferencesDialog *dialog)
{
gint value;
GtkTreeModel *model;
@@ -108,7 +108,7 @@ word_size_combobox_changed_cb(GtkWidget *combo, PreferencesDialog *dialog)
G_MODULE_EXPORT
void
-decimal_places_spin_change_value_cb(GtkWidget *spin, PreferencesDialog *dialog)
+decimal_places_spin_change_value_cb(GtkWidget *spin, MathPreferencesDialog *dialog)
{
gint value = 0;
@@ -119,7 +119,7 @@ decimal_places_spin_change_value_cb(GtkWidget *spin, PreferencesDialog *dialog)
G_MODULE_EXPORT
void
-thousands_separator_check_toggled_cb(GtkWidget *check, PreferencesDialog *dialog)
+thousands_separator_check_toggled_cb(GtkWidget *check, MathPreferencesDialog *dialog)
{
gboolean value;
@@ -130,7 +130,7 @@ thousands_separator_check_toggled_cb(GtkWidget *check, PreferencesDialog *dialog
G_MODULE_EXPORT
void
-trailing_zeroes_check_toggled_cb(GtkWidget *check, PreferencesDialog *dialog)
+trailing_zeroes_check_toggled_cb(GtkWidget *check, MathPreferencesDialog *dialog)
{
gboolean value;
@@ -166,7 +166,7 @@ set_combo_box_from_int(GtkWidget *combo, int value)
static void
-accuracy_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
+accuracy_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)
{
gtk_spin_button_set_value(GTK_SPIN_BUTTON(gtk_builder_get_object(dialog->priv->ui, "decimal_places_spin")),
math_equation_get_accuracy(equation));
@@ -174,7 +174,7 @@ accuracy_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
static void
-show_thousands_separators_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
+show_thousands_separators_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(dialog->priv->ui, "thousands_separator_check")),
math_equation_get_show_thousands_separators(equation));
@@ -182,7 +182,7 @@ show_thousands_separators_cb(MathEquation *equation, GParamSpec *spec, Preferenc
static void
-show_trailing_zeroes_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
+show_trailing_zeroes_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(dialog->priv->ui, "trailing_zeroes_check")),
math_equation_get_show_trailing_zeroes(equation));
@@ -190,35 +190,35 @@ show_trailing_zeroes_cb(MathEquation *equation, GParamSpec *spec, PreferencesDia
static void
-display_format_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
+display_format_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)
{
set_combo_box_from_int(GET_WIDGET(dialog->priv->ui, "display_format_combobox"), math_equation_get_display_format(equation));
}
static void
-word_size_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
+word_size_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)
{
set_combo_box_from_int(GET_WIDGET(dialog->priv->ui, "word_size_combobox"), math_equation_get_word_size(equation));
}
static void
-angle_unit_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
+angle_unit_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)
{
set_combo_box_from_int(GET_WIDGET(dialog->priv->ui, "angle_unit_combobox"), math_equation_get_angle_units(equation));
}
static void
-base_cb(MathEquation *equation, GParamSpec *spec, PreferencesDialog *dialog)
+base_cb(MathEquation *equation, GParamSpec *spec, MathPreferencesDialog *dialog)
{
set_combo_box_from_int(GET_WIDGET(dialog->priv->ui, "number_base_combobox"), math_equation_get_base(equation));
}
static void
-create_gui(PreferencesDialog *dialog)
+create_gui(MathPreferencesDialog *dialog)
{
GtkWidget *widget;
GtkTreeModel *model;
@@ -352,14 +352,14 @@ create_gui(PreferencesDialog *dialog)
static void
-ui_preferences_set_property(GObject *object,
+math_preferences_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- PreferencesDialog *self;
+ MathPreferencesDialog *self;
- self = UI_PREFERENCES (object);
+ self = MATH_PREFERENCES (object);
switch (prop_id) {
case PROP_EQUATION:
@@ -374,14 +374,14 @@ ui_preferences_set_property(GObject *object,
static void
-ui_preferences_get_property(GObject *object,
+math_preferences_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- PreferencesDialog *self;
+ MathPreferencesDialog *self;
- self = UI_PREFERENCES (object);
+ self = MATH_PREFERENCES (object);
switch (prop_id) {
case PROP_EQUATION:
@@ -395,14 +395,14 @@ ui_preferences_get_property(GObject *object,
static void
-ui_preferences_class_init (PreferencesDialogClass *klass)
+math_preferences_class_init (MathPreferencesDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = ui_preferences_get_property;
- object_class->set_property = ui_preferences_set_property;
+ object_class->get_property = math_preferences_get_property;
+ object_class->set_property = math_preferences_set_property;
- g_type_class_add_private (klass, sizeof (PreferencesDialogPrivate));
+ g_type_class_add_private (klass, sizeof (MathPreferencesDialogPrivate));
g_object_class_install_property(object_class,
PROP_EQUATION,
@@ -415,7 +415,7 @@ ui_preferences_class_init (PreferencesDialogClass *klass)
static void
-ui_preferences_init(PreferencesDialog *dialog)
+math_preferences_init(MathPreferencesDialog *dialog)
{
- dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, ui_preferences_get_type(), PreferencesDialogPrivate);
+ dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, math_preferences_get_type(), MathPreferencesDialogPrivate);
}
diff --git a/src/ui-preferences.h b/src/math-preferences.h
similarity index 66%
rename from src/ui-preferences.h
rename to src/math-preferences.h
index f6b62fc..e4cd5d4 100644
--- a/src/ui-preferences.h
+++ b/src/math-preferences.h
@@ -16,8 +16,8 @@
* 02111-1307, USA.
*/
-#ifndef UI_PREFERENCES_H
-#define UI_PREFERENCES_H
+#ifndef MATH_PREFERENCES_H
+#define MATH_PREFERENCES_H
#include <glib-object.h>
#include <gtk/gtk.h>
@@ -25,23 +25,23 @@
G_BEGIN_DECLS
-#define UI_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ui_preferences_get_type(), PreferencesDialog))
+#define MATH_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), math_preferences_get_type(), MathPreferencesDialog))
-typedef struct PreferencesDialogPrivate PreferencesDialogPrivate;
+typedef struct MathPreferencesDialogPrivate MathPreferencesDialogPrivate;
typedef struct
{
GtkDialog parent_instance;
- PreferencesDialogPrivate *priv;
-} PreferencesDialog;
+ MathPreferencesDialogPrivate *priv;
+} MathPreferencesDialog;
typedef struct
{
GtkDialogClass parent_class;
-} PreferencesDialogClass;
+} MathPreferencesDialogClass;
-GType ui_preferences_get_type();
+GType math_preferences_get_type();
-PreferencesDialog *ui_preferences_dialog_new(MathEquation *equation);
+MathPreferencesDialog *math_preferences_dialog_new(MathEquation *equation);
-#endif /* UI_PREFERENCES_H */
+#endif /* MATH_PREFERENCES_H */
diff --git a/src/ui.c b/src/ui.c
index 49bb325..ce5da60 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -22,7 +22,7 @@
#include <gdk/gdkkeysyms.h>
#include "ui.h"
-#include "ui-preferences.h"
+#include "math-preferences.h"
#include "config.h"
#include "get.h"
@@ -33,7 +33,7 @@ struct GCalctoolUIPrivate
MathEquation *equation;
MathDisplay *display;
MathButtons *buttons;
- PreferencesDialog *preferences_dialog;
+ MathPreferencesDialog *preferences_dialog;
gboolean right_aligned;
};
@@ -193,7 +193,7 @@ void
show_preferences_cb(GtkMenuItem *menu, GCalctoolUI *ui)
{
if (!ui->priv->preferences_dialog) {
- ui->priv->preferences_dialog = ui_preferences_dialog_new(ui->priv->equation);
+ ui->priv->preferences_dialog = math_preferences_dialog_new(ui->priv->equation);
gtk_window_set_transient_for(GTK_WINDOW(ui->priv->preferences_dialog), GTK_WINDOW(ui->priv->main_window));
}
gtk_window_present(GTK_WINDOW(ui->priv->preferences_dialog));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]