#include "main.h"
#include "preferences.h"
-#include "bar-exif.h"
#include "bar-keywords.h"
#include "cache.h"
-#include "cache-maint.h"
-#include "dnd.h"
+//~ #include "authors.h"
+//~ #include "authors.c"
+//~ #include "translators.h"
+//~ #include "translators.c"
#include "editors.h"
-#include "exif.h"
#include "filedata.h"
#include "filefilter.h"
#include "fullscreen.h"
#include "image-overlay.h"
#include "color-man.h"
#include "img-view.h"
-#include "layout-config.h"
#include "layout-util.h"
#include "metadata.h"
#include "misc.h"
#include "ui-misc.h"
#include "ui-spinner.h"
#include "ui-tabcomp.h"
-#include "ui-utildlg.h"
#include "window.h"
#include "zonedetect.h"
FILETYPES_COLUMN_COUNT
};
-gchar *format_class_list[] = {
+const gchar *format_class_list[] = {
N_("Unknown"),
N_("Image"),
N_("RAW Image"),
options->image.enable_read_ahead = c_options->image.enable_read_ahead;
+ options->appimage_notifications = c_options->appimage_notifications;
+
if (options->image.use_custom_border_color != c_options->image.use_custom_border_color
|| options->image.use_custom_border_color_in_fullscreen != c_options->image.use_custom_border_color_in_fullscreen
static void config_window_help_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- GtkWidget *notebook = data;
+ GtkWidget *notebook = static_cast<GtkWidget *>(data);
gint i;
- static gchar *html_section[] =
+ static const gchar *html_section[] =
{
"GuideOptionsGeneral.html",
"GuideOptionsImage.html",
static void config_window_ok_cb(GtkWidget *widget, gpointer data)
{
LayoutWindow *lw;
- GtkNotebook *notebook = data;
+ GtkNotebook *notebook = static_cast<GtkNotebook *>(data);
GdkWindow *window;
gint x;
gint y;
gint h;
gint page_number;
- lw = layout_window_list->data;
+ lw = static_cast<LayoutWindow *>(layout_window_list->data);
window = gtk_widget_get_window(widget);
gdk_window_get_root_origin(window, &x, &y);
static void quality_menu_cb(GtkWidget *combo, gpointer data)
{
- gint *option = data;
+ gint *option = static_cast<gint *>(data);
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
{
static void dnd_default_action_selection_menu_cb(GtkWidget *combo, gpointer data)
{
- gint *option = data;
+ gint *option = static_cast<gint *>(data);
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
{
}
static void clipboard_selection_menu_cb(GtkWidget *combo, gpointer data)
{
- gint *option = data;
+ gint *option = static_cast<gint *>(data);
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
{
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(quality_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(dnd_default_action_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(clipboard_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
static void zoom_style_selection_menu_cb(GtkWidget *combo, gpointer data)
{
- gint *option = data;
+ gint *option = static_cast<gint *>(data);
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
{
g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(zoom_style_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
typedef struct _UseableMouseItems UseableMouseItems;
struct _UseableMouseItems
{
- gchar *name; /* GtkActionEntry terminology */
- gchar *label;
- gchar *stock_id;
+ const gchar *name; /* GtkActionEntry terminology */
+ const gchar *label;
+ const gchar *stock_id;
};
static const UseableMouseItems useable_mouse_items[] = {
static void mouse_buttons_selection_menu_cb(GtkWidget *combo, gpointer data)
{
- gchar **option = data;
+ gchar **option = static_cast<gchar **>(data);
gchar *label;
label = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(combo));
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(mouse_buttons_selection_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(thumb_size_menu_cb), NULL);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
static void stereo_mode_menu_cb(GtkWidget *combo, gpointer data)
{
- gint *option = data;
+ gint *option = static_cast<gint *>(data);
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
{
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(stereo_mode_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
static void video_menu_cb(GtkWidget *combo, gpointer data)
{
- gchar **option = data;
+ gchar **option = static_cast<gchar **>(data);
- EditorDescription *ed = g_list_nth_data(editor_list_get(), gtk_combo_box_get_active(GTK_COMBO_BOX(combo)));
+ EditorDescription *ed = static_cast<EditorDescription *>(g_list_nth_data(editor_list_get(), gtk_combo_box_get_active(GTK_COMBO_BOX(combo))));
*option = ed->key;
}
static void video_menu_populate(gpointer data, gpointer user_data)
{
- GtkWidget *combo = user_data;
- EditorDescription *ed = data;
+ GtkWidget *combo = static_cast<GtkWidget *>(user_data);
+ EditorDescription *ed = static_cast<EditorDescription *>(data);
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), ed->name);
}
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(video_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
FilterEntry *fe;
GtkTreeIter iter;
- fe = work->data;
+ fe = static_cast<FilterEntry *>(work->data);
work = work->next;
gtk_list_store_append(filter_store, &iter);
static void filter_store_ext_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *path_str,
gchar *new_text, gpointer data)
{
- GtkWidget *model = data;
- FilterEntry *fe = data;
+ GtkWidget *model = static_cast<GtkWidget *>(data);
+ FilterEntry *fe = static_cast<FilterEntry *>(data);
GtkTreePath *tpath;
GtkTreeIter iter;
static void filter_store_class_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *path_str,
gchar *new_text, gpointer data)
{
- GtkWidget *model = data;
- FilterEntry *fe = data;
+ GtkWidget *model = static_cast<GtkWidget *>(data);
+ FilterEntry *fe = static_cast<FilterEntry *>(data);
GtkTreePath *tpath;
GtkTreeIter iter;
gint i;
{
if (strcmp(new_text, _(format_class_list[i])) == 0)
{
- fe->file_class = i;
+ fe->file_class = static_cast<FileFormatClass>(i);
break;
}
}
static void filter_store_desc_edit_cb(GtkCellRendererText *UNUSED(cell), gchar *path_str,
gchar *new_text, gpointer data)
{
- GtkWidget *model = data;
+ GtkWidget *model = static_cast<GtkWidget *>(data);
FilterEntry *fe;
GtkTreePath *tpath;
GtkTreeIter iter;
static void filter_store_enable_cb(GtkCellRendererToggle *UNUSED(renderer),
gchar *path_str, gpointer data)
{
- GtkWidget *model = data;
+ GtkWidget *model = static_cast<GtkWidget *>(data);
FilterEntry *fe;
GtkTreePath *tpath;
GtkTreeIter iter;
static void filter_store_writable_cb(GtkCellRendererToggle *UNUSED(renderer),
gchar *path_str, gpointer data)
{
- GtkWidget *model = data;
+ GtkWidget *model = static_cast<GtkWidget *>(data);
FilterEntry *fe;
GtkTreePath *tpath;
GtkTreeIter iter;
static void filter_store_sidecar_cb(GtkCellRendererToggle *UNUSED(renderer),
gchar *path_str, gpointer data)
{
- GtkWidget *model = data;
+ GtkWidget *model = static_cast<GtkWidget *>(data);
FilterEntry *fe;
GtkTreePath *tpath;
GtkTreeIter iter;
column = gtk_tree_view_get_column(GTK_TREE_VIEW(data), 0);
list_cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column));
- cell = g_list_last(list_cells)->data;
+ cell = static_cast<GtkCellRenderer *>(g_list_last(list_cells)->data);
store = gtk_tree_view_get_model(GTK_TREE_VIEW(data));
valid = gtk_tree_model_get_iter_first(store, &iter);
gtk_tree_path_free(path);
g_list_free(list_cells);
- return(FALSE);
+ return(G_SOURCE_REMOVE);
}
static void filter_add_cb(GtkWidget *UNUSED(widget), gpointer data)
static void filter_remove_cb(GtkWidget *UNUSED(widget), gpointer data)
{
- GtkWidget *filter_view = data;
+ GtkWidget *filter_view = static_cast<GtkWidget *>(data);
GtkTreeSelection *selection;
GtkTreeIter iter;
FilterEntry *fe;
gtk_tree_path_free(path);
- return(FALSE);
+ return(G_SOURCE_REMOVE);
}
static void filter_default_ok_cb(GenericDialog *gd, gpointer UNUSED(data))
static void filter_disable_cb(GtkWidget *widget, gpointer data)
{
- GtkWidget *frame = data;
+ GtkWidget *frame = static_cast<GtkWidget *>(data);
gtk_widget_set_sensitive(frame,
!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
static void image_overlay_default_template_ok_cb(GenericDialog *UNUSED(gd), gpointer data)
{
- GtkTextView *text_view = data;
+ GtkTextView *text_view = static_cast<GtkTextView *>(data);
GtkTextBuffer *buffer;
set_default_image_overlay_template_string(&options->image_overlay.template_string);
if (!accel_store || !layout_window_list || !layout_window_list->data) return;
gtk_tree_store_clear(accel_store);
- lw = layout_window_list->data; /* get the actions from the first window, it should not matter, they should be the same in all windows */
+ lw = static_cast<LayoutWindow *>(layout_window_list->data); /* get the actions from the first window, it should not matter, they should be the same in all windows */
g_assert(lw && lw->ui_manager);
groups = gtk_ui_manager_get_action_groups(lw->ui_manager);
static gboolean accel_remove_key_cb(GtkTreeModel *model, GtkTreePath *UNUSED(path), GtkTreeIter *iter, gpointer data)
{
- gchar *accel1 = data;
+ gchar *accel1 = static_cast<gchar *>(data);
gchar *accel2;
GtkAccelKey key1;
GtkAccelKey key2;
gtk_tree_path_free(path);
- return(FALSE);
+ return(G_SOURCE_REMOVE);
}
static void accel_default_cb(GtkWidget *UNUSED(widget), gpointer data)
g_idle_add((GSourceFunc)accel_default_scroll, data);
}
-void accel_remove_selection(GtkTreeModel *UNUSED(model), GtkTreePath *UNUSED(path), GtkTreeIter *iter, gpointer UNUSED(data))
+void accel_clear_selection(GtkTreeModel *UNUSED(model), GtkTreePath *UNUSED(path), GtkTreeIter *iter, gpointer UNUSED(data))
{
gtk_tree_store_set(accel_store, iter, AE_KEY, "", -1);
}
g_free(accel);
}
+static void accel_clear_cb(GtkWidget *UNUSED(widget), gpointer data)
+{
+ GtkTreeSelection *selection;
+
+ if (!accel_store) return;
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data));
+ gtk_tree_selection_selected_foreach(selection, &accel_clear_selection, NULL);
+}
+
static void accel_reset_cb(GtkWidget *UNUSED(widget), gpointer data)
{
GtkTreeSelection *selection;
static guint star_rating_symbol_test(GtkWidget *UNUSED(widget), gpointer data)
{
- GtkContainer *hbox = data;
+ GtkContainer *hbox = static_cast<GtkContainer *>(data);
GString *str = g_string_new(NULL);
GtkEntry *hex_code_entry;
gchar *hex_code_full;
list = gtk_container_get_children(hbox);
- hex_code_entry = g_list_nth_data(list, 2);
+ hex_code_entry = static_cast<GtkEntry *>(g_list_nth_data(list, 2));
hex_code_full = g_strdup(gtk_entry_get_text(hex_code_entry));
hex_code = g_strsplit(hex_code_full, "+", 2);
hex_value = 0x003F; // Unicode 'Question Mark'
}
str = g_string_append_unichar(str, (gunichar)hex_value);
- gtk_label_set_text(g_list_nth_data(list, 1), str->str);
+ gtk_label_set_text(static_cast<GtkLabel *>(g_list_nth_data(list, 1)), str->str);
g_strfreev(hex_code);
g_string_free(str, TRUE);
pref_spacer(group, PREF_PAD_GROUP);
+ if (g_getenv("APPDIR") && strstr(g_getenv("APPDIR"), "/tmp/.mount_Geeqie"))
+ {
+ group = pref_group_new(vbox, FALSE, _("AppImage updates notifications"), GTK_ORIENTATION_VERTICAL);
+ hbox = pref_box_new(group, TRUE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
+ pref_checkbox_new_int(group, _("Enable"), options->appimage_notifications, &c_options->appimage_notifications);
+ gtk_widget_set_tooltip_text(group, _("Show a notification on start-up if the server has a newer version than the current. Requires an Internet connection"));
+
+ pref_spacer(group, PREF_PAD_GROUP);
+ }
+
+
net_mon = g_network_monitor_get_default();
tz_org = g_network_address_parse_uri(TIMEZONE_DATABASE_WEB, 80, NULL);
if (tz_org)
static gboolean popover_cb(gpointer data)
{
- GtkPopover *popover = data;
+ GtkPopover *popover = static_cast<GtkPopover *>(data);
gtk_popover_popdown(popover);
options->file_filter.show_parent_directory, &c_options->file_filter.show_parent_directory);
pref_checkbox_new_int(group, _("Case sensitive sort"),
options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive);
- pref_checkbox_new_int(group, _("Natural sort order"),
+ pref_checkbox_new_int(group, _("Natural sort order - Requires restart"),
options->file_sort.natural, &c_options->file_sort.natural);
pref_checkbox_new_int(group, _("Disable file extension checks"),
options->file_filter.disable_file_extension_checks, &c_options->file_filter.disable_file_extension_checks);
static void keywords_find_close_cb(GenericDialog *UNUSED(fd), gpointer data)
{
- KeywordFindData *kfd = data;
+ KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
if (!gtk_widget_get_sensitive(kfd->button_close)) return;
static void keywords_find_stop_cb(GenericDialog *UNUSED(fd), gpointer data)
{
- KeywordFindData *kfd = data;
+ KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
g_idle_remove_by_data(kfd);
static gboolean keywords_find_file(gpointer data)
{
- KeywordFindData *kfd = data;
+ KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
GtkTextIter iter;
GtkTextBuffer *buffer;
gchar *tmp;
{
FileData *fd;
- fd = kfd->list->data;
+ fd = static_cast<FileData *>(kfd->list->data);
kfd->list = g_list_remove(kfd->list, fd);
keywords = metadata_read_list(fd, KEYWORD_KEY, METADATA_PLAIN);
while (keywords)
{
gtk_text_buffer_get_end_iter(buffer, &iter);
- tmp = g_strconcat(keywords->data, "\n", NULL);
+ tmp = g_strconcat(static_cast<const gchar *>(keywords->data), "\n", NULL);
gtk_text_buffer_insert(buffer, &iter, tmp, -1);
g_free(tmp);
keywords = keywords->next;
file_data_unref(fd);
string_list_free(keywords);
- return (TRUE);
+ return (G_SOURCE_CONTINUE);
}
else if (kfd->list_dir)
{
FileData *fd;
- fd = kfd->list_dir->data;
+ fd = static_cast<FileData *>(kfd->list_dir->data);
kfd->list_dir = g_list_remove(kfd->list_dir, fd);
keywords_find_folder(kfd, fd);
file_data_unref(fd);
- return TRUE;
+ return G_SOURCE_CONTINUE;
}
keywords_find_finish(kfd);
- return FALSE;
+ return G_SOURCE_REMOVE;
}
static void keywords_find_start_cb(GenericDialog *UNUSED(fd), gpointer data)
{
- KeywordFindData *kfd = data;
+ KeywordFindData *kfd = static_cast<KeywordFindData *>(data);
gchar *path;
if (kfd->list || !gtk_widget_get_sensitive(kfd->button_start)) return;
found = FALSE;
while (work)
{
- if (g_strcmp0(work->data, kw_split) == 0)
+ if (g_strcmp0(static_cast<const gchar *>(work->data), kw_split) == 0)
{
found = TRUE;
break;
while (kwl)
{
gtk_text_buffer_get_end_iter (buffer, &iter);
- tmp = g_strconcat(kwl->data, "\n", NULL);
+ tmp = g_strconcat(static_cast<const gchar *>(kwl->data), "\n", NULL);
gtk_text_buffer_insert(buffer, &iter, tmp, -1);
kwl = kwl->next;
g_free(tmp);
#ifdef HAVE_LCMS
static void intent_menu_cb(GtkWidget *combo, gpointer data)
{
- gint *option = data;
+ gint *option = static_cast<gint *>(data);
switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
{
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(intent_menu_cb), option_c);
- gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, 0, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), combo, column + 1, column + 2, row, row + 1, GTK_SHRINK, static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(combo);
}
#endif
gtk_entry_set_text(GTK_ENTRY(entry), options->color_profile.input_name[i]);
}
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, i + 1, i + 2,
- GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(entry);
color_profile_input_name_entry[i] = entry;
tab_completion_add_select_button(entry, _("Select color profile"), FALSE);
gtk_widget_set_size_request(entry, 160, -1);
gtk_table_attach(GTK_TABLE(table), tabcomp, 2, 3, i + 1, i + 2,
- GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(tabcomp);
color_profile_input_file_entry[i] = entry;
}
#endif
gtk_table_attach(GTK_TABLE(table), tabcomp, 1, 2,
0, 1,
- GTK_FILL | GTK_EXPAND, 0, 0, 0);
+ static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
gtk_widget_show(tabcomp);
}
button = pref_button_new(NULL, NULL, _("Reset selected"), FALSE,
G_CALLBACK(accel_reset_cb), accel_view);
+ gtk_widget_set_tooltip_text(button, _("Will only reset changes made before the settings are saved"));
+ gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+ gtk_widget_show(button);
+
+ button = pref_button_new(NULL, NULL, _("Clear selected"), FALSE,
+ G_CALLBACK(accel_clear_cb), accel_view);
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
}
GtkWidget *toolbardata;
LayoutWindow *lw;
- lw = layout_window_list->data;
+ lw = static_cast<LayoutWindow *>(layout_window_list->data);
vbox = scrolled_notebook_page(notebook, _("Toolbar Main"));
GtkWidget *toolbardata;
LayoutWindow *lw;
- lw = layout_window_list->data;
+ lw = static_cast<LayoutWindow *>(layout_window_list->data);
vbox = scrolled_notebook_page(notebook, _("Toolbar Status"));
while (formats_list)
{
- fm = formats_list->data;
+ fm = static_cast<GdkPixbufFormat *>(formats_list->data);
extensions = gdk_pixbuf_format_get_extensions(fm);
i = 0;
{
if (types_string->len == 0)
{
- types_string = g_string_append(types_string, extensions_list->data);
+ types_string = g_string_append(types_string, static_cast<const gchar *>(extensions_list->data));
}
else
{
types_string = g_string_append(types_string, ", ");
- types_string = g_string_append(types_string, extensions_list->data);
+ types_string = g_string_append(types_string, static_cast<const gchar *>(extensions_list->data));
}
extensions_list = extensions_list->next;
void show_about_window(LayoutWindow *lw)
{
- GdkPixbuf *pixbuf_logo;
+ GDataInputStream *data_stream;
+ GInputStream *in_stream_authors;
+ GInputStream *in_stream_translators;
+ GString *copyright;
GdkPixbuf *pixbuf_icon;
+ GdkPixbuf *pixbuf_logo;
+ ZoneDetect *cd;
+ gchar *artists[2];
+ gchar *author_line;
gchar *authors[1000];
+ gchar *authors_path;
gchar *comment;
- gint i_authors = 0;
- gchar *path;
- GString *copyright;
gchar *timezone_path;
- ZoneDetect *cd;
- FILE *fp = NULL;
-#define LINE_LENGTH 1000
- gchar line[LINE_LENGTH];
+ gchar *translators;
+ gchar *translators_path;
+ gint i_authors = 0;
+ gint n = 0;
+ gsize bytes_read;
+ gsize length;
+ gsize size;
+ guint32 flags;
copyright = g_string_new(NULL);
copyright = g_string_append(copyright, "This program comes with absolutely no warranty.\nGNU General Public License, version 2 or later.\nSee https://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n\n");
}
g_free(timezone_path);
+ authors_path = g_build_filename(GQ_RESOURCE_PATH_CREDITS, "authors", NULL);
+
+ in_stream_authors = g_resources_open_stream(authors_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
+
+ data_stream = g_data_input_stream_new(in_stream_authors);
+
authors[0] = NULL;
- path = g_build_filename(gq_helpdir, "AUTHORS", NULL);
- fp = fopen(path, "r");
- if (fp)
+ while ((author_line = g_data_input_stream_read_line(G_DATA_INPUT_STREAM(data_stream), &length, NULL, NULL)))
{
- while(fgets(line, LINE_LENGTH, fp))
- {
- /* get rid of ending \n from fgets */
- line[strlen(line) - 1] = '\0';
- authors[i_authors] = g_strdup(line);
- i_authors++;
- }
- authors[i_authors] = NULL;
- fclose(fp);
+ authors[i_authors] = g_strdup(author_line);
+ i_authors++;
+ g_free(author_line);
}
- g_free(path);
+ authors[i_authors] = NULL;
+
+ g_input_stream_close(in_stream_authors, NULL, NULL);
+
+ translators_path = g_build_filename(GQ_RESOURCE_PATH_CREDITS, "translators", NULL);
- comment = g_strconcat("Development and bug reports:\n", GQ_EMAIL_ADDRESS,
- "\nhttps://github.com/BestImageViewer/geeqie/issues",NULL);
+ g_resources_get_info(translators_path, G_RESOURCE_LOOKUP_FLAGS_NONE, &size, &flags, NULL);
+
+ in_stream_translators = g_resources_open_stream(translators_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
+ translators = static_cast<gchar *>(g_malloc0(size));
+ g_input_stream_read_all(in_stream_translators, translators, size, &bytes_read, NULL, NULL);
+ g_input_stream_close(in_stream_translators, NULL, NULL);
+
+ comment = g_strconcat("Project created by John Ellis\nGQview 1998\nGeeqie 2007\n\n\nDevelopment and bug reports:\n", GQ_EMAIL_ADDRESS, "\nhttps://github.com/BestImageViewer/geeqie/issues",NULL);
+
+ artists[0] = g_strdup("Néstor Díaz Valencia <nestor@estudionexos.com>");
+ artists[1] = NULL;
pixbuf_logo = pixbuf_inline(PIXBUF_INLINE_LOGO);
pixbuf_icon = pixbuf_inline(PIXBUF_INLINE_ICON);
"website", GQ_WEBSITE,
"website-label", "Website",
"comments", comment,
+ "artists", artists,
"authors", authors,
- "translator-credits", _("translator-credits"),
+ "translator-credits", translators,
"wrap-license", TRUE,
"license", copyright->str,
NULL);
g_string_free(copyright, TRUE);
- gint n = 0;
while(n < i_authors)
{
g_free(authors[n]);
n++;
}
+
+ g_free(artists[0]);
+ g_free(authors_path);
g_free(comment);
+ g_free(translators);
+ g_free(translators_path);
+ g_object_unref(data_stream);
+ g_object_unref(in_stream_authors);
+ g_object_unref(in_stream_translators);
return;
}
static void timezone_async_ready_cb(GObject *source_object, GAsyncResult *res, gpointer data)
{
GError *error = NULL;
- TZData *tz = data;
+ TZData *tz = static_cast<TZData *>(data);
gchar *tmp_filename;
gchar *timezone_bin;
gchar *tmp_dir = NULL;
static void timezone_progress_cb(goffset current_num_bytes, goffset total_num_bytes, gpointer data)
{
- TZData *tz = data;
+ TZData *tz = static_cast<TZData *>(data);
if (!g_cancellable_is_cancelled(tz->cancellable))
{
static void timezone_cancel_button_cb(GenericDialog *UNUSED(gd), gpointer data)
{
- TZData *tz = data;
+ TZData *tz = static_cast<TZData *>(data);
g_cancellable_cancel(tz->cancellable);
}
static void timezone_database_install_cb(GtkWidget *widget, gpointer data)
{
- TZData *tz = data;
+ TZData *tz = static_cast<TZData *>(data);
GError *error = NULL;
GFileIOStream *io_stream;