[gtranslator/gtk4: 16/52] Worked on comments in merge request review
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator/gtk4: 16/52] Worked on comments in merge request review
- Date: Mon, 5 Sep 2022 15:17:49 +0000 (UTC)
commit 519a57ff7028e4ca79275f9e7c3162a48a7582eb
Author: afshan ahmed khan <afshanahmeda2k gmail com>
Date: Sat Jun 11 11:21:33 2022 +0530
Worked on comments in merge request review
src/codeview/gtr-codeview.c | 3 ++-
src/gtr-actions-file.c | 3 +++
src/gtr-filter-selection.c | 14 +++++++-------
src/gtr-header-dialog.c | 11 +++++------
src/gtr-lang-button.c | 2 +-
src/gtr-languages-fetcher.c | 2 +-
src/gtr-preferences-dialog.c | 6 +++---
src/gtr-profile-dialog.c | 2 +-
src/gtr-settings.c | 1 +
src/gtr-window.c | 2 +-
src/translation-memory/gtr-translation-memory-dialog.c | 6 ++++--
11 files changed, 29 insertions(+), 23 deletions(-)
---
diff --git a/src/codeview/gtr-codeview.c b/src/codeview/gtr-codeview.c
index 2fb210df..d4de483a 100644
--- a/src/codeview/gtr-codeview.c
+++ b/src/codeview/gtr-codeview.c
@@ -587,7 +587,8 @@ gtr_code_view_new (GtrWindow *window)
/*hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM);*/
- //g_signal_connect (notebook, "page-added", G_CALLBACK (page_added_cb), self);
+ // CLEANUP: Replace or remove this commented code
+ //g_signal_connect (notebook, "page-added", G_CALLBACK (page_added_cb), self);
/*
* If we already have tabs opened we have to add them
diff --git a/src/gtr-actions-file.c b/src/gtr-actions-file.c
index f398d425..fbca2e50 100644
--- a/src/gtr-actions-file.c
+++ b/src/gtr-actions-file.c
@@ -777,7 +777,10 @@ save_and_close_all_documents (GList * unsaved_documents, GtrWindow * window)
_gtr_window_close_tab (window, tab);
}*/
+ if(unsaved_documents == NULL)
+ return;
gtr_po_save_file(unsaved_documents->data,&error);
+
if(error)
{
GtkWidget *dialog;
diff --git a/src/gtr-filter-selection.c b/src/gtr-filter-selection.c
index a8f204c8..4a42976b 100644
--- a/src/gtr-filter-selection.c
+++ b/src/gtr-filter-selection.c
@@ -88,18 +88,18 @@ filter_option (GtkEditable *entry,
GtkWidget *row;
int i = 0 ;
- //g_printf("%d and %d\n",i,g_slist_length(priv->options) );
+ //g_debug("%d and %d\n",i,g_slist_length(priv->options) );
while (row = gtk_list_box_get_row_at_index (GTK_LIST_BOX(priv->option_list),i))
{
gtk_list_box_remove(GTK_LIST_BOX(priv->option_list), row);
i++;
}
- //g_printf("%d and %d\n",i,g_slist_length(priv->options) );
+ //g_debug("%d and %d\n",i,g_slist_length(priv->options) );
if(row == NULL)
- //g_printf("all removed\n");
+ //g_debug("all removed\n");
gtk_widget_show(priv->option_list);
- //g_printf("UPTEXT - %s\n",uptext);
+ //g_debug("UPTEXT - %s\n",uptext);
for (o = priv->options; o != NULL; o = g_slist_next (o))
{
GtkWidget *child;
@@ -109,13 +109,13 @@ filter_option (GtkEditable *entry,
if (g_strrstr (upopt, uptext) == NULL)
continue;
- //g_printf("%s\n",opt->desc);
+ //g_debug("%s\n",opt->desc);
child = gtk_label_new (opt->desc);
gtk_label_set_xalign (GTK_LABEL (child), 0.0);
//gtk_list_box_append (GTK_LIST_BOX (priv->option_list), child);
}
- //g_printf("\n\n\n");
+ //g_debug("\n\n\n");
gtk_widget_show (priv->option_list);
}
@@ -125,7 +125,7 @@ gtr_filter_selection_finalize (GObject *object)
GtrFilterSelectionPrivate *priv = gtr_filter_selection_get_instance_private (GTR_FILTER_SELECTION
(object));
if (priv->options)
g_slist_free_full (priv->options, (GDestroyNotify)gtr_filter_option_free);
- //g_printf("finalized\n");
+ //g_debug("finalized\n");
G_OBJECT_CLASS (gtr_filter_selection_parent_class)->finalize (object);
}
diff --git a/src/gtr-header-dialog.c b/src/gtr-header-dialog.c
index 21a13a3b..bca2757b 100644
--- a/src/gtr-header-dialog.c
+++ b/src/gtr-header-dialog.c
@@ -201,14 +201,13 @@ language_changed (GtkWidget * widget, GtrHeaderDialog * dlg)
GtrHeaderDialogPrivate *priv = gtr_header_dialog_get_instance_private (dlg);
// language = gtk_entry_get_text (GTK_ENTRY (priv->language));
- GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
- language = gtk_entry_buffer_get_text (buffer);
+ language = gtk_entry_buffer_get_text (gtk_entry_get_buffer (GTK_ENTRY (priv->language)));
+
// lg_email = gtk_entry_get_text (GTK_ENTRY (priv->lg_email));
- buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
- lg_email = gtk_entry_buffer_get_text (buffer);
+ lg_email = gtk_entry_buffer_get_text (gtk_entry_get_buffer (GTK_ENTRY (priv->lg_email)));
+
// lang_code = gtk_entry_get_text (GTK_ENTRY (priv->lang_code));
- buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
- lang_code = gtk_entry_buffer_get_text (buffer);
+ lang_code = gtk_entry_buffer_get_text (gtk_entry_get_buffer (GTK_ENTRY (priv->lang_code)));
if (language && lg_email)
{
diff --git a/src/gtr-lang-button.c b/src/gtr-lang-button.c
index c25b9aa8..d2fefa37 100644
--- a/src/gtr-lang-button.c
+++ b/src/gtr-lang-button.c
@@ -66,7 +66,7 @@ gtr_lang_button_init (GtrLangButton *self)
if (langs)
g_slist_free_full (langs, g_free);
- g_printf("ran init of lang button\n");
+ g_debug("ran init of lang button\n");
}
GtrLangButton*
diff --git a/src/gtr-languages-fetcher.c b/src/gtr-languages-fetcher.c
index 7f697eb4..4eb6c468 100644
--- a/src/gtr-languages-fetcher.c
+++ b/src/gtr-languages-fetcher.c
@@ -365,7 +365,7 @@ gtr_languages_fetcher_init (GtrLanguagesFetcher *fetcher)
root_objects, &error);
if (error)
{
- g_printf("%s \n", error->message);
+ g_debug("%s \n", error->message);
}
content = GTK_WIDGET (gtk_builder_get_object (builder, "main_box"));
diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c
index 4adb395b..8dd8122f 100644
--- a/src/gtr-preferences-dialog.c
+++ b/src/gtr-preferences-dialog.c
@@ -681,7 +681,7 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
root_objects, &error);
if (error)
{
- g_printf("%s \n",error->message);
+ g_debug("%s \n",error->message);
}
priv->notebook = GTK_WIDGET (gtk_builder_get_object (builder, "notebook"));
g_object_ref (priv->notebook);
@@ -717,7 +717,7 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
//context = gtk_widget_get_style_context (GTK_WIDGET(profiles_toolbar));
//gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP); not in gtk4
- g_printf("init ran but after mapping\n");
+ g_debug("init ran but after mapping\n");
setup_files_pages (dlg);
setup_editor_pages (dlg);
setup_profile_pages (dlg);
@@ -752,7 +752,7 @@ gtr_preferences_dialog_class_init (GtrPreferencesDialogClass * klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gtr_preferences_dialog_dispose;
- g_printf("class_init ran\n");
+ g_debug("class_init ran\n");
}
static void gtr_destroy_preferences_dialog (GtkWidget *dlg , GtkWidget **dlg_ptr)
diff --git a/src/gtr-profile-dialog.c b/src/gtr-profile-dialog.c
index 37b5128c..71a0374a 100644
--- a/src/gtr-profile-dialog.c
+++ b/src/gtr-profile-dialog.c
@@ -90,7 +90,7 @@ gtr_profile_dialog_init (GtrProfileDialog *dlg)
root_objects, &error);
if (error)
{
- g_printf("%s \n", error->message);
+ g_debug("%s \n", error->message);
}
priv->main_box = GTK_WIDGET (gtk_builder_get_object (builder, "main_box"));
g_object_ref (priv->main_box);
diff --git a/src/gtr-settings.c b/src/gtr-settings.c
index 139f1ed0..d47f818e 100644
--- a/src/gtr-settings.c
+++ b/src/gtr-settings.c
@@ -160,6 +160,7 @@ on_visible_whitespace_changed (GSettings * settings,
g_list_free (views);
}
+// TODO: enable/disable the spellcheck when we've a replacement for gspell
static void
on_spellcheck_changed (GSettings * settings,
const gchar * key, GtrSettings * gs)
diff --git a/src/gtr-window.c b/src/gtr-window.c
index ea799dd2..610c1bb7 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -191,7 +191,7 @@ set_window_title (GtrWindow * window, gboolean with_path)
GtrPoState state;
GtrTab *active_tab;
GFile *file;
- gchar *title;
+ g_autofree gchar *title;
GtrWindowPrivate *priv = gtr_window_get_instance_private(window);
GtkHeaderBar *header;
diff --git a/src/translation-memory/gtr-translation-memory-dialog.c
b/src/translation-memory/gtr-translation-memory-dialog.c
index fdffc3f7..ab6ac8e5 100644
--- a/src/translation-memory/gtr-translation-memory-dialog.c
+++ b/src/translation-memory/gtr-translation-memory-dialog.c
@@ -52,14 +52,16 @@ native_response_cb (GtkNativeDialog *dialog, guint response, gpointer user_data)
if (response == GTK_RESPONSE_ACCEPT)
{
g_autofree char *filename = NULL;
+ GtkEntryBuffer *entry_buffer;
+ g_autoptr (GFile) file ;
GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog);
//filename = gtk_file_chooser_get_filename (chooser);
- GFile * file = gtk_file_chooser_get_file (chooser);
+ file = gtk_file_chooser_get_file (chooser);
filename = g_file_get_path(file);
//gtk_entry_set_text (GTK_ENTRY (priv->directory_entry),
// filename);
- GtkEntryBuffer *entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->directory_entry));
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->directory_entry));
gtk_entry_buffer_set_text (entry_buffer, filename, -1);
g_settings_set_string (priv->tm_settings,
"po-directory",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]