gnc-main-window.cpp (gnucash-5.0.tar.bz2) | : | gnc-main-window.cpp (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 1794 | skipping to change at line 1794 | |||
GMenuItem *item; | GMenuItem *item; | |||
gint pos; | gint pos; | |||
ENTER("window %p, action %s, label %s, index %d, visible %d", window, | ENTER("window %p, action %s, label %s, index %d, visible %d", window, | |||
data->action_name, data->label, data->index, data->visible); | data->action_name, data->label, data->index, data->visible); | |||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | |||
gsm->search_action_label = nullptr; | gsm->search_action_label = nullptr; | |||
gsm->search_action_name = "WindowsPlaceholder1"; // placeholder | gsm->search_action_name = "WindowsPlaceholder1"; // placeholder | |||
gsm->search_action_target = nullptr; | ||||
if (!gnc_menubar_model_find_item (priv->menubar_model, gsm)) | if (!gnc_menubar_model_find_item (priv->menubar_model, gsm)) | |||
{ | { | |||
LEAVE("Could not find placeholder 'WindowsPlaceholder1' for windows entr ies"); | LEAVE("Could not find placeholder 'WindowsPlaceholder1' for windows entr ies"); | |||
g_free (gsm); | g_free (gsm); | |||
return; | return; | |||
} | } | |||
pos = gsm->index + data->index + 1; | pos = gsm->index + data->index + 1; | |||
skipping to change at line 3411 | skipping to change at line 3412 | |||
g_error_free (error); | g_error_free (error); | |||
return; | return; | |||
} | } | |||
for (gint i = 0; ui_updates[i]; i++) | for (gint i = 0; ui_updates[i]; i++) | |||
{ | { | |||
menu_model_part = (GMenuModel *)gtk_builder_get_object (builder, ui_upda tes[i]); | menu_model_part = (GMenuModel *)gtk_builder_get_object (builder, ui_upda tes[i]); | |||
gsm->search_action_label = nullptr; | gsm->search_action_label = nullptr; | |||
gsm->search_action_name = ui_updates[i]; | gsm->search_action_name = ui_updates[i]; | |||
gsm->search_action_target = nullptr; | ||||
if (gnc_menubar_model_find_item (priv->menubar_model, gsm)) | if (gnc_menubar_model_find_item (priv->menubar_model, gsm)) | |||
g_menu_insert_section (G_MENU(gsm->model), gsm->index, NULL, G_MENU_ MODEL(menu_model_part)); | g_menu_insert_section (G_MENU(gsm->model), gsm->index, NULL, G_MENU_ MODEL(menu_model_part)); | |||
else | else | |||
PERR("Could not find '%s' in menu model", ui_updates[i]); | PERR("Could not find '%s' in menu model", ui_updates[i]); | |||
} | } | |||
g_free (gsm); | g_free (gsm); | |||
g_object_unref (builder); | g_object_unref (builder); | |||
} | } | |||
skipping to change at line 3588 | skipping to change at line 3590 | |||
GncMainWindowPrivate *priv; | GncMainWindowPrivate *priv; | |||
gboolean found = false; | gboolean found = false; | |||
g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), false); | g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), false); | |||
g_return_val_if_fail (action_name != nullptr, false); | g_return_val_if_fail (action_name != nullptr, false); | |||
g_return_val_if_fail (label != nullptr, false); | g_return_val_if_fail (label != nullptr, false); | |||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | |||
found = gnc_menubar_model_update_item (priv->menubar_model, action_name, | found = gnc_menubar_model_update_item (priv->menubar_model, action_name, | |||
_(label), nullptr, _(tooltip)); | nullptr, _(label), nullptr, _(toolti p)); | |||
// add tooltip redirect call backs | // add tooltip redirect call backs | |||
gnc_plugin_add_menu_tooltip_callbacks (priv->menubar, | gnc_plugin_add_menu_tooltip_callbacks (priv->menubar, | |||
priv->menubar_model, | priv->menubar_model, | |||
priv->statusbar); | priv->statusbar); | |||
return found; | return found; | |||
} | } | |||
void | void | |||
skipping to change at line 3766 | skipping to change at line 3768 | |||
else | else | |||
menu_name = g_strdup (ui_updates[i]); | menu_name = g_strdup (ui_updates[i]); | |||
menu_model_part = (GMenuModel *)gtk_builder_get_object (builder, menu_na me); | menu_model_part = (GMenuModel *)gtk_builder_get_object (builder, menu_na me); | |||
if (!menu_model_part) | if (!menu_model_part) | |||
menu_model_part = (GMenuModel *)gtk_builder_get_object (builder, ui_ updates[i]); | menu_model_part = (GMenuModel *)gtk_builder_get_object (builder, ui_ updates[i]); | |||
gsm->search_action_label = nullptr; | gsm->search_action_label = nullptr; | |||
gsm->search_action_name = ui_updates[i]; | gsm->search_action_name = ui_updates[i]; | |||
gsm->search_action_target = nullptr; | ||||
if (gnc_menubar_model_find_item (priv->menubar_model, gsm)) | if (gnc_menubar_model_find_item (priv->menubar_model, gsm)) | |||
g_menu_insert_section (G_MENU(gsm->model), gsm->index, | g_menu_insert_section (G_MENU(gsm->model), gsm->index, | |||
nullptr, G_MENU_MODEL(menu_model_part)); | nullptr, G_MENU_MODEL(menu_model_part)); | |||
else | else | |||
PERR("Could not find '%s' in menu model", ui_updates[i]); | PERR("Could not find '%s' in menu model", ui_updates[i]); | |||
g_free (menu_name); | g_free (menu_name); | |||
} | } | |||
skipping to change at line 5104 | skipping to change at line 5107 | |||
url_signal_cb (GtkAboutDialog *dialog, gchar *uri, gpointer data) | url_signal_cb (GtkAboutDialog *dialog, gchar *uri, gpointer data) | |||
{ | { | |||
gnc_launch_doclink (GTK_WINDOW(dialog), uri); | gnc_launch_doclink (GTK_WINDOW(dialog), uri); | |||
return TRUE; | return TRUE; | |||
} | } | |||
static gboolean | static gboolean | |||
link_button_cb (GtkLinkButton *button, gpointer user_data) | link_button_cb (GtkLinkButton *button, gpointer user_data) | |||
{ | { | |||
const gchar *uri = gtk_link_button_get_uri (button); | const gchar *uri = gtk_link_button_get_uri (button); | |||
gnc_launch_doclink (GTK_WINDOW(user_data), uri); | gchar *escaped_uri = g_uri_escape_string (uri, ":/.\\", true); | |||
gnc_launch_doclink (GTK_WINDOW(user_data), escaped_uri); | ||||
g_free (escaped_uri); | ||||
return TRUE; | return TRUE; | |||
} | } | |||
static void | static void | |||
add_about_paths (GtkDialog *dialog) | add_about_paths (GtkDialog *dialog) | |||
{ | { | |||
GtkWidget *page_vbox = gnc_get_dialog_widget_from_id (dialog, "page_vbox"); | GtkWidget *page_vbox = gnc_get_dialog_widget_from_id (dialog, "page_vbox"); | |||
GtkWidget *grid; | GtkWidget *grid; | |||
GList *paths; | GList *paths; | |||
gint i = 0; | gint i = 0; | |||
skipping to change at line 5373 | skipping to change at line 5378 | |||
{ | { | |||
GncMainWindowPrivate *priv; | GncMainWindowPrivate *priv; | |||
g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr); | g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr); | |||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | |||
return priv->toolbar; | return priv->toolbar; | |||
} | } | |||
/** Retrieve the display hash table associated with a main window object. | /** Retrieve the menubar model associated with a main window object. | |||
* This function is called via a vector off a generic window | * This function is called via a vector off a generic window | |||
* interface. | * interface. | |||
* | * | |||
* @param window_in A pointer to a generic window. */ | * @param window_in A pointer to a generic window. */ | |||
static GMenuModel * | static GMenuModel * | |||
gnc_main_window_get_menubar_model (GncWindow *window) | gnc_main_window_get_menubar_model (GncWindow *window) | |||
{ | { | |||
GncMainWindowPrivate *priv; | GncMainWindowPrivate *priv; | |||
g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr); | g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr); | |||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | |||
return priv->menubar_model; | return priv->menubar_model; | |||
} | } | |||
/** Retrieve the accelerator group associated with a main window object. | ||||
* This function is called via a vector off a generic window | ||||
* interface. | ||||
* | ||||
* @param window_in A pointer to a generic window. */ | ||||
static GtkAccelGroup * | ||||
gnc_main_window_get_accel_group (GncWindow *window) | ||||
{ | ||||
GncMainWindowPrivate *priv; | ||||
g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr); | ||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); | ||||
return priv->accel_group; | ||||
} | ||||
/** Initialize the generic window interface for a main window. | /** Initialize the generic window interface for a main window. | |||
* | * | |||
* @param iface A pointer to the interface data structure to | * @param iface A pointer to the interface data structure to | |||
* populate. */ | * populate. */ | |||
static void | static void | |||
gnc_window_main_window_init (GncWindowIface *iface) | gnc_window_main_window_init (GncWindowIface *iface) | |||
{ | { | |||
iface->get_gtk_window = gnc_main_window_get_gtk_window; | iface->get_gtk_window = gnc_main_window_get_gtk_window; | |||
iface->get_statusbar = gnc_main_window_get_statusbar; | iface->get_statusbar = gnc_main_window_get_statusbar; | |||
iface->get_progressbar = gnc_main_window_get_progressbar; | iface->get_progressbar = gnc_main_window_get_progressbar; | |||
iface->get_menubar = gnc_main_window_get_menubar; | iface->get_menubar = gnc_main_window_get_menubar; | |||
iface->get_toolbar = gnc_main_window_get_toolbar; | iface->get_toolbar = gnc_main_window_get_toolbar; | |||
iface->get_menubar_model = gnc_main_window_get_menubar_model; | iface->get_menubar_model = gnc_main_window_get_menubar_model; | |||
iface->get_accel_group = gnc_main_window_get_accel_group; | ||||
} | } | |||
/* Set the window where all progressbar updates should occur. This | /* Set the window where all progressbar updates should occur. This | |||
* is a wrapper around the gnc_window_set_progressbar_window() | * is a wrapper around the gnc_window_set_progressbar_window() | |||
* function. | * function. | |||
*/ | */ | |||
void | void | |||
gnc_main_window_set_progressbar_window (GncMainWindow *window) | gnc_main_window_set_progressbar_window (GncMainWindow *window) | |||
{ | { | |||
GncWindow *gncwin; | GncWindow *gncwin; | |||
End of changes. 8 change blocks. | ||||
3 lines changed or deleted | 26 lines changed or added |