Add a preview parameter to ag_chart_new_from_db_save()

This commit is contained in:
Gergely Polonkai 2014-09-28 00:35:17 +02:00
parent 00dfdd79ce
commit c89f701e04
3 changed files with 24 additions and 9 deletions

View File

@ -1223,7 +1223,9 @@ AgChart *ag_chart_load_from_placidus_file(GFile *file,
} }
AgChart * AgChart *
ag_chart_new_from_db_save(AgDbChartSave *save_data, GError **err) ag_chart_new_from_db_save(AgDbChartSave *save_data,
gboolean preview,
GError **err)
{ {
GsweTimestamp *timestamp; GsweTimestamp *timestamp;
gchar *house_system_enum_name; gchar *house_system_enum_name;
@ -1250,6 +1252,15 @@ ag_chart_new_from_db_save(AgDbChartSave *save_data, GError **err)
save_data->timezone save_data->timezone
); );
if (preview) {
chart = ag_chart_new_preview(
timestamp,
save_data->longitude,
save_data->latitude,
save_data->altitude,
house_system
);
} else {
chart = ag_chart_new_full( chart = ag_chart_new_full(
timestamp, timestamp,
save_data->longitude, save_data->longitude,
@ -1257,6 +1268,7 @@ ag_chart_new_from_db_save(AgDbChartSave *save_data, GError **err)
save_data->altitude, save_data->altitude,
house_system house_system
); );
}
ag_chart_set_name(chart, save_data->name); ag_chart_set_name(chart, save_data->name);
ag_chart_set_country(chart, save_data->country); ag_chart_set_country(chart, save_data->country);

View File

@ -91,7 +91,9 @@ AgChart *ag_chart_load_from_agc(GFile *file,
AgChart *ag_chart_load_from_placidus_file(GFile *file, AgChart *ag_chart_load_from_placidus_file(GFile *file,
GError **err); GError **err);
AgChart *ag_chart_new_from_db_save(AgDbChartSave *save_data, GError **err); AgChart *ag_chart_new_from_db_save(AgDbChartSave *save_data,
gboolean preview,
GError **err);
void ag_chart_save_to_file(AgChart *chart, void ag_chart_save_to_file(AgChart *chart,
GFile *file, GFile *file,

View File

@ -1967,6 +1967,7 @@ ag_window_list_item_activated_cb(AgIconView *icon_view,
if ((priv->chart = ag_chart_new_from_db_save( if ((priv->chart = ag_chart_new_from_db_save(
priv->saved_data, priv->saved_data,
FALSE,
&err &err
)) == NULL) { )) == NULL) {
ag_app_message_dialog( ag_app_message_dialog(