static void gw_settingswindow_finalize (GObject *object) { GwSettingsWindow *window; GwApplication *application; window = GW_SETTINGSWINDOW (object); application = gw_window_get_application (GW_WINDOW (window)); if (g_main_current_source () != NULL) gw_application_unblock_searches (application); G_OBJECT_CLASS (gw_settingswindow_parent_class)->finalize (object); }
//! //! @brief Sets up a print preview for the results //! G_MODULE_EXPORT void gw_print_preview_cb (GtkWidget *widget, gpointer data) { GwSearchWindow *window; GwApplication *application; window = GW_SEARCHWINDOW (gtk_widget_get_ancestor (GTK_WIDGET (data), GW_TYPE_SEARCHWINDOW)); if (window == NULL) return; application = gw_window_get_application (GW_WINDOW (window)); gw_application_block_searches (application); gw_print (GTK_PRINT_OPERATION_ACTION_PREVIEW, window); gw_application_unblock_searches (application); }
//! //! @brief Sets up a print operation for the current results //! //! The function checks the results of the results text buffer, and then attempts //! to set up a print operation. If a section of the search results are highlighted //! only those results are printed. //! G_MODULE_EXPORT void gw_print_cb (GSimpleAction *action, GVariant *parameter, gpointer data) { GwSearchWindow *window; GwApplication *application; window = GW_SEARCHWINDOW (gtk_widget_get_ancestor (GTK_WIDGET (data), GW_TYPE_SEARCHWINDOW)); if (window == NULL) return; application = gw_window_get_application (GW_WINDOW (window)); gw_application_block_searches (application); gw_print (GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, window); gw_application_unblock_searches (application); }
//! //! @brief Resets the states of all the buttons as if the dialog was just freshly opened //! //! @param widget Currently unused GtkWidget pointer //! @param data Currently unused gpointer //! G_MODULE_EXPORT void gw_radicalswindow_clear_cb (GtkWidget *widget, gpointer data) { //Declaratins GwApplication *application; GwRadicalsWindow *window; GwRadicalsWindowPrivate *priv; //Initializations window = GW_RADICALSWINDOW (gtk_widget_get_ancestor (GTK_WIDGET (data), GW_TYPE_RADICALSWINDOW)); if (window == NULL) return; priv = window->priv; application = gw_window_get_application (GW_WINDOW (window)); gw_application_block_searches (application); gw_radicalswindow_deselect_all_radicals (window); gtk_toggle_button_set_active (priv->strokes_checkbutton, FALSE); gw_application_unblock_searches (application); }
void gw_application_quit (GwApplication *application) { gw_application_block_searches (application); GList *link; GtkListStore *liststore; gboolean has_changes; gboolean should_close; liststore = gw_application_get_vocabularyliststore (application); has_changes = gw_vocabularyliststore_has_changes (GW_VOCABULARYLISTSTORE (liststore)); should_close = TRUE; if (has_changes) { link = gtk_application_get_windows (GTK_APPLICATION (application)); while (link != NULL && GW_IS_VOCABULARYWINDOW (link->data) == FALSE) link = link->next; if (link != NULL) { should_close = gw_vocabularywindow_show_save_dialog (GW_VOCABULARYWINDOW (link->data)); } } if (should_close) { link = gtk_application_get_windows (GTK_APPLICATION (application)); while (link != NULL) { gtk_widget_destroy (GTK_WIDGET (link->data)); link = gtk_application_get_windows (GTK_APPLICATION (application)); } } gw_application_unblock_searches (application); }