Add a preview parameter to ag_chart_new_from_db_save()
This commit is contained in:
parent
00dfdd79ce
commit
c89f701e04
@ -1223,7 +1223,9 @@ AgChart *ag_chart_load_from_placidus_file(GFile *file,
|
||||
}
|
||||
|
||||
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;
|
||||
gchar *house_system_enum_name;
|
||||
@ -1250,13 +1252,23 @@ ag_chart_new_from_db_save(AgDbChartSave *save_data, GError **err)
|
||||
save_data->timezone
|
||||
);
|
||||
|
||||
chart = ag_chart_new_full(
|
||||
timestamp,
|
||||
save_data->longitude,
|
||||
save_data->latitude,
|
||||
save_data->altitude,
|
||||
house_system
|
||||
);
|
||||
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(
|
||||
timestamp,
|
||||
save_data->longitude,
|
||||
save_data->latitude,
|
||||
save_data->altitude,
|
||||
house_system
|
||||
);
|
||||
}
|
||||
|
||||
ag_chart_set_name(chart, save_data->name);
|
||||
ag_chart_set_country(chart, save_data->country);
|
||||
|
@ -91,7 +91,9 @@ AgChart *ag_chart_load_from_agc(GFile *file,
|
||||
AgChart *ag_chart_load_from_placidus_file(GFile *file,
|
||||
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,
|
||||
GFile *file,
|
||||
|
@ -1967,6 +1967,7 @@ ag_window_list_item_activated_cb(AgIconView *icon_view,
|
||||
|
||||
if ((priv->chart = ag_chart_new_from_db_save(
|
||||
priv->saved_data,
|
||||
FALSE,
|
||||
&err
|
||||
)) == NULL) {
|
||||
ag_app_message_dialog(
|
||||
|
Loading…
Reference in New Issue
Block a user