Changed AgWindow's moment to an AgChart for later saving functionality.
This commit is contained in:
parent
58ac3786b1
commit
26162ca818
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "ag-app.h"
|
#include "ag-app.h"
|
||||||
#include "ag-window.h"
|
#include "ag-window.h"
|
||||||
|
#include "ag-chart.h"
|
||||||
|
|
||||||
struct _AgWindowPrivate {
|
struct _AgWindowPrivate {
|
||||||
GtkWidget *grid;
|
GtkWidget *grid;
|
||||||
@ -34,7 +35,7 @@ struct _AgWindowPrivate {
|
|||||||
GtkWidget *current_tab;
|
GtkWidget *current_tab;
|
||||||
|
|
||||||
GsweTimestamp *timestamp;
|
GsweTimestamp *timestamp;
|
||||||
GsweMoment *moment;
|
AgChart *chart;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE(AgWindow, ag_window, GTK_TYPE_APPLICATION_WINDOW);
|
G_DEFINE_TYPE(AgWindow, ag_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||||
@ -62,9 +63,9 @@ close_cb(GSimpleAction *action, GVariant *parameter, gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
moment_changed(GsweMoment *moment, gpointer user_data)
|
chart_changed(AgChart *chart, gpointer user_data)
|
||||||
{
|
{
|
||||||
g_warning("Moment changed!");
|
g_warning("Chart changed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -97,11 +98,11 @@ recalculate_chart(AgWindow *window)
|
|||||||
gswe_timestamp_set_gregorian_full(priv->timestamp, year, month, day, hour, minute, second, 0, 1.0, NULL);
|
gswe_timestamp_set_gregorian_full(priv->timestamp, year, month, day, hour, minute, second, 0, 1.0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->moment == NULL) {
|
if (priv->chart == NULL) {
|
||||||
// TODO: moke house system configurable
|
// TODO: moke house system configurable
|
||||||
priv->moment = gswe_moment_new_full(priv->timestamp, longitude, latitude, 380.0, GSWE_HOUSE_SYSTEM_PLACIDUS);
|
priv->chart = ag_chart_new_full(priv->timestamp, longitude, latitude, 380.0, GSWE_HOUSE_SYSTEM_PLACIDUS);
|
||||||
g_signal_connect(priv->moment, "changed", G_CALLBACK(moment_changed), NULL);
|
g_signal_connect(priv->chart, "changed", G_CALLBACK(chart_changed), NULL);
|
||||||
moment_changed(priv->moment, NULL);
|
chart_changed(priv->chart, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +141,7 @@ ag_window_init(AgWindow *window)
|
|||||||
window->priv = priv = GET_PRIVATE(window);
|
window->priv = priv = GET_PRIVATE(window);
|
||||||
|
|
||||||
priv->timestamp = NULL;
|
priv->timestamp = NULL;
|
||||||
priv->moment = NULL;
|
priv->chart = NULL;
|
||||||
|
|
||||||
gtk_window_set_hide_titlebar_when_maximized(GTK_WINDOW(window), TRUE);
|
gtk_window_set_hide_titlebar_when_maximized(GTK_WINDOW(window), TRUE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user