[gtranslator/gtk4: 31/79] starting libhandy to libadwaita porting from here on
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator/gtk4: 31/79] starting libhandy to libadwaita porting from here on
- Date: Mon, 10 Oct 2022 16:31:19 +0000 (UTC)
commit ba08db8639f9babf2217821c75277b0443848b6a
Author: afshan ahmed khan <afshanahmeda2k gmail com>
Date: Sat Jun 4 01:02:12 2022 +0530
starting libhandy to libadwaita porting from here on
meson.build | 5 +-
src/codeview/gtr-codeview.c | 26 ++---
src/codeview/gtr-viewer.c | 11 +-
src/gtr-actions-file.c | 14 +--
src/gtr-actions-search.c | 2 +-
src/gtr-application.c | 4 +-
src/gtr-close-button.c | 5 +-
src/gtr-close-confirmation-dialog.c | 29 +++---
src/gtr-context.c | 31 +++---
src/gtr-header-dialog.c | 112 +++++++++++++++------
src/gtr-history-entry.c | 4 +-
src/gtr-history-entry.h | 2 +-
src/gtr-io-error-info-bar.c | 3 +-
src/gtr-jump-dialog.c | 6 +-
src/gtr-preferences-dialog.c | 15 +--
src/gtr-search-bar.c | 61 +++++++----
src/gtr-tab.c | 6 +-
src/gtr-utils.c | 7 +-
src/gtr-view.c | 20 ++--
src/meson.build | 2 +-
.../gtr-translation-memory-dialog.c | 14 ++-
src/translation-memory/gtr-translation-memory-ui.c | 36 +++----
22 files changed, 251 insertions(+), 164 deletions(-)
---
diff --git a/meson.build b/meson.build
index d6517782..9124f5f7 100644
--- a/meson.build
+++ b/meson.build
@@ -104,7 +104,7 @@ src_dir = join_paths(meson.source_root(), 'src')
################
glib_dep = dependency('glib-2.0', version: '>= 2.71.3')
-gtk_dep = dependency('gtk+-3.0', version: '>= 3.22.20')
+gtk_dep = dependency('gtk4', version: '>= 4.6.0')
libhandy_dep = dependency('libhandy-1', version: '>= 1.5.0')
gtr_deps = [
@@ -112,10 +112,11 @@ gtr_deps = [
gtk_dep,
libhandy_dep,
dependency('libgda-6.0'),
+ dependency('atk'),
dependency('gio-2.0', version: '>= 2.36.0'),
dependency('gsettings-desktop-schemas'),
dependency('gthread-2.0', version: '>= 2.13.0'),
- dependency('gtksourceview-4', version: '>= 4.0.2'),
+ dependency('gtksourceview-5', version: '>= 5.4.0'),
dependency('libxml-2.0', version: '>= 2.4.12'),
dependency('libsoup-3.0'),
dependency('json-glib-1.0', version: '>= 1.2.0'),
diff --git a/src/codeview/gtr-codeview.c b/src/codeview/gtr-codeview.c
index a0ea1126..2fb210df 100644
--- a/src/codeview/gtr-codeview.c
+++ b/src/codeview/gtr-codeview.c
@@ -228,7 +228,7 @@ follow_if_link (GtrCodeView *codeview, GtkWidget *text_view, GtkTextIter *iter)
g_slist_free (tags);
}
-static gboolean
+/*static gboolean
event_after (GtkWidget *text_view, GdkEvent *ev, GtrCodeView *codeview)
{
GtkTextIter start, end, iter;
@@ -246,7 +246,7 @@ event_after (GtkWidget *text_view, GdkEvent *ev, GtrCodeView *codeview)
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
- /* we shouldn't follow a link if the user has selected something */
+ // we shouldn't follow a link if the user has selected something //
gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end))
return FALSE;
@@ -260,7 +260,7 @@ event_after (GtkWidget *text_view, GdkEvent *ev, GtrCodeView *codeview)
follow_if_link (codeview, text_view, &iter);
return FALSE;
-}
+}*/
static gboolean hovering_over_link = FALSE;
static GdkCursor *hand_cursor = NULL;
@@ -270,7 +270,7 @@ static GdkCursor *regular_cursor = NULL;
* and if one of them is a link, change the cursor to the "hands" cursor
* typically used by web browsers.
*/
-static void
+/*static void
set_cursor_if_appropriate (GtkTextView *text_view, gint x, gint y)
{
GSList *tags = NULL, *tagp = NULL;
@@ -308,12 +308,12 @@ set_cursor_if_appropriate (GtkTextView *text_view, gint x, gint y)
if (tags)
g_slist_free (tags);
-}
+}*/
/*
* Update the cursor image if the pointer moved.
*/
-static gboolean
+/*static gboolean
motion_notify_event (GtkWidget *text_view, GdkEventMotion *event)
{
gint x, y;
@@ -325,12 +325,12 @@ motion_notify_event (GtkWidget *text_view, GdkEventMotion *event)
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y);
return FALSE;
-}
+}*/
/* Also update the cursor image if the window becomes visible
* (e.g. when a window covering it got iconified).
*/
-static gboolean
+/*static gboolean
visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event)
{
GdkDevice *pointer;
@@ -349,7 +349,7 @@ visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event)
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), bx, by);
return FALSE;
-}
+}*/
static void
showed_message_cb (GtrTab *tab, GtrMsg *msg, GtrCodeView *codeview)
@@ -481,11 +481,11 @@ page_added_cb (GtkWidget *tab,
g_signal_connect (tab, "message-edition-finished",
G_CALLBACK (message_edition_finished_cb), codeview);
- g_signal_connect (view, "event-after", G_CALLBACK (event_after), codeview);
+ /*g_signal_connect (view, "event-after", G_CALLBACK (event_after), codeview);
g_signal_connect (view, "motion-notify-event",
G_CALLBACK (motion_notify_event), NULL);
g_signal_connect (view, "visibility-notify-event",
- G_CALLBACK (visibility_notify_event), NULL);
+ G_CALLBACK (visibility_notify_event), NULL);*/
g_signal_connect (panel, "reloaded",
G_CALLBACK (on_context_panel_reloaded), codeview);
}
@@ -584,8 +584,8 @@ gtr_code_view_new (GtrWindow *window)
/*
* Cursors
*/
- hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
- regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
+ /*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);
diff --git a/src/codeview/gtr-viewer.c b/src/codeview/gtr-viewer.c
index 0382e74b..5980fa0d 100644
--- a/src/codeview/gtr-viewer.c
+++ b/src/codeview/gtr-viewer.c
@@ -53,7 +53,7 @@ dialog_response_handler (GtkDialog *dlg, gint res_id)
switch (res_id)
{
default:
- gtk_widget_destroy (GTK_WIDGET (dlg));
+ gtk_window_destroy (GTK_WIDGET (dlg));
}
}
@@ -151,7 +151,7 @@ error_dialog (GtkWindow *parent, const gchar *msg, ...)
GTK_BUTTONS_OK, "%s", tmp);
g_free (tmp);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
}
@@ -177,9 +177,9 @@ gtk_source_buffer_load_file (GtkSourceBuffer *source_buffer,
return FALSE;
}
- gtk_source_buffer_begin_not_undoable_action (source_buffer);
+ gtk_source_buffer_begin_irreversible_action (source_buffer);
gtk_text_buffer_set_text (GTK_TEXT_BUFFER (source_buffer), buffer, -1);
- gtk_source_buffer_end_not_undoable_action (source_buffer);
+ gtk_source_buffer_end_irreversible_action (source_buffer);
gtk_text_buffer_set_modified (GTK_TEXT_BUFFER (source_buffer), FALSE);
/* move cursor to the beginning */
@@ -432,7 +432,8 @@ gtr_show_viewer (GtrWindow *window, const gchar *path, gint line)
g_free (label);
g_signal_connect (dlg,
- "destroy", G_CALLBACK (gtk_widget_destroyed), &dlg);
+ "destroy", G_CALLBACK (gtk_window_destroy), NULL);
+ g_free(dlg);
gtk_widget_show (GTK_WIDGET (dlg));
}
diff --git a/src/gtr-actions-file.c b/src/gtr-actions-file.c
index a6f31abc..cff749c9 100644
--- a/src/gtr-actions-file.c
+++ b/src/gtr-actions-file.c
@@ -310,7 +310,7 @@ save_dialog_response_cb (GtkNativeDialog * dialog,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
"%s", error->message);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_clear_error (&error);
return;
@@ -398,7 +398,7 @@ _upload_file_callback (GObject *object,
gtr_tab_enable_upload (active_tab, FALSE);
end:
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
gtk_widget_destroy (upload_dialog);
g_free (ud);
@@ -531,7 +531,7 @@ gtr_upload_file_dialog (GtrWindow * window)
G_CALLBACK (gtr_upload_file),
window);
- gtk_widget_show_all (GTK_WIDGET (dialog));
+ gtk_widget_show (GTK_WIDGET (dialog));
}
/*
@@ -575,7 +575,7 @@ gtr_save_current_file_dialog (GtkWidget * widget, GtrWindow * window)
flags,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK, "%s", error->message);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_clear_error (&error);
return;
@@ -670,7 +670,7 @@ load_file_list (GtrWindow * window, const GSList * locations)
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", error->message);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_error_free (error);
}
@@ -762,7 +762,7 @@ save_and_close_all_documents (GList * unsaved_documents, GtrWindow * window)
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
"%s", error->message);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_clear_error (&error);
return;
@@ -991,7 +991,7 @@ _gtr_actions_file_save_all (GtrWindow * window)
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
"%s", error->message);
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_clear_error (&error);
diff --git a/src/gtr-actions-search.c b/src/gtr-actions-search.c
index e65f7d9f..f8b76616 100644
--- a/src/gtr-actions-search.c
+++ b/src/gtr-actions-search.c
@@ -471,6 +471,6 @@ search_bar_response_cb (GtrSearchBar *dialog,
do_replace_all (dialog, window);
break;
default:
- gtk_widget_destroy (GTK_WIDGET (dialog));
+ gtk_window_destroy (GTK_WINDOW (dialog));
}
}
diff --git a/src/gtr-application.c b/src/gtr-application.c
index a20b06b3..becb3b3c 100644
--- a/src/gtr-application.c
+++ b/src/gtr-application.c
@@ -24,7 +24,7 @@
#include <config.h>
#endif
-#include "gtr-assistant.h"
+//#include "gtr-assistant.h"
#include "gtr-actions.h"
#include "gtr-actions-app.h"
#include "gtr-application.h"
@@ -766,7 +766,7 @@ gtr_application_setup_window (GApplication *application,
* run, then we show the First run Assistant
*/
if (priv->first_run)
- gtr_show_assistant (window);
+ //gtr_show_assistant (window);
if (file_list != NULL)
{
diff --git a/src/gtr-close-button.c b/src/gtr-close-button.c
index 1477cfea..b54b388e 100644
--- a/src/gtr-close-button.c
+++ b/src/gtr-close-button.c
@@ -41,7 +41,7 @@ gtr_close_button_class_init (GtrCloseButtonClass *klass)
klass->priv = G_TYPE_CLASS_GET_PRIVATE (klass, GTR_TYPE_CLOSE_BUTTON, GtrCloseButtonClassPrivate);
klass->priv->css = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (klass->priv->css, button_style, -1, NULL);
+ gtk_css_provider_load_from_data (klass->priv->css, button_style, -1);
}
static void
@@ -52,7 +52,7 @@ gtr_close_button_init (GtrCloseButton *button)
GIcon *icon;
icon = g_themed_icon_new_with_default_fallbacks ("window-close-symbolic");
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_gicon (icon);
gtk_widget_show (image);
g_object_unref (icon);
@@ -69,7 +69,6 @@ GtkWidget *
gtr_close_button_new ()
{
return GTK_WIDGET (g_object_new (GTR_TYPE_CLOSE_BUTTON,
- "relief", GTK_RELIEF_NONE,
"focus-on-click", FALSE,
NULL));
}
diff --git a/src/gtr-close-confirmation-dialog.c b/src/gtr-close-confirmation-dialog.c
index f86ddcf4..d5ad518e 100644
--- a/src/gtr-close-confirmation-dialog.c
+++ b/src/gtr-close-confirmation-dialog.c
@@ -31,6 +31,7 @@
#include "gtr-utils.h"
#include "gtr-window.h"
#include "gtr-po.h"
+#include <atk/atk.h>
/* Properties */
@@ -349,14 +350,15 @@ build_single_doc_dialog (GtrCloseConfirmationDialog * dlg)
doc = GTR_PO (priv->unsaved_documents->data);
/* Image */
- image = gtk_image_new_from_icon_name ("dialog-warning-symbolic",
- GTK_ICON_SIZE_DIALOG);
+ image = gtk_image_new_from_icon_name ("dialog-warning-symbolic");
+ gtk_image_set_icon_size(image, GTK_ICON_SIZE_NORMAL);
+
gtk_widget_set_halign (image, 0.5);
gtk_widget_set_valign (image, 0.0);
/* Primary label */
primary_label = gtk_label_new (NULL);
- gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
+ gtk_label_set_wrap (GTK_LABEL (primary_label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_xalign (GTK_LABEL (primary_label) , 0.0);
gtk_label_set_yalign (GTK_LABEL (primary_label) , 0.5);
@@ -397,7 +399,7 @@ build_single_doc_dialog (GtrCloseConfirmationDialog * dlg)
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
hbox);
- gtk_widget_show_all (hbox);
+ gtk_widget_show (hbox);
}
static void
@@ -519,8 +521,9 @@ build_multiple_docs_dialog (GtrCloseConfirmationDialog * dlg)
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), hbox);
/* Image */
- image = gtk_image_new_from_icon_name ("dialog-warning-symbolic",
- GTK_ICON_SIZE_DIALOG);
+ image = gtk_image_new_from_icon_name ("dialog-warning-symbolic");
+ //GTK_ICON_SIZE_DIALOG);
+ gtk_image_set_icon_size (image, GTK_ICON_SIZE_NORMAL);
gtk_widget_set_halign (image, 0.5);
gtk_widget_set_valign (image, 0.0);
gtk_box_append (GTK_BOX (hbox), image);
@@ -531,7 +534,7 @@ build_multiple_docs_dialog (GtrCloseConfirmationDialog * dlg)
/* Primary label */
primary_label = gtk_label_new (NULL);
- gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
+ gtk_label_set_wrap (GTK_LABEL (primary_label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
gtk_label_set_xalign (GTK_LABEL (primary_label), 0.0);
gtk_label_set_yalign (GTK_LABEL (primary_label), 0.5);
@@ -575,15 +578,15 @@ build_multiple_docs_dialog (GtrCloseConfirmationDialog * dlg)
("S_elect the documents you want to save:"));
gtk_box_append (GTK_BOX (vbox2), select_label);
- gtk_label_set_line_wrap (GTK_LABEL (select_label), TRUE);
+ gtk_label_set_wrap (GTK_LABEL (select_label), TRUE);
gtk_label_set_xalign (GTK_LABEL (select_label), 0.0);
gtk_label_set_yalign (GTK_LABEL (select_label), 0.5);
- scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
+ scrolledwindow = gtk_scrolled_window_new ();
gtk_widget_set_vexpand (vbox2, TRUE);
gtk_box_append (GTK_BOX (vbox2), scrolledwindow);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow),
- GTK_SHADOW_IN);
+ /*gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow),
+ GTK_SHADOW_IN);*/
treeview = create_treeview (priv);
gtk_container_add (GTK_CONTAINER (scrolledwindow), treeview);
@@ -598,14 +601,14 @@ build_multiple_docs_dialog (GtrCloseConfirmationDialog * dlg)
"all your changes will be permanently lost."));
gtk_box_append (GTK_BOX (vbox2), secondary_label);
- gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+ gtk_label_set_wrap (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_xalign (GTK_LABEL (secondary_label), 0.0);
gtk_label_set_yalign (GTK_LABEL (secondary_label), 0.5);
gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (select_label), treeview);
- gtk_widget_show_all (hbox);
+ gtk_widget_show (hbox);
}
static void
diff --git a/src/gtr-context.c b/src/gtr-context.c
index 4bc7a36b..fda4123d 100644
--- a/src/gtr-context.c
+++ b/src/gtr-context.c
@@ -80,7 +80,7 @@ dialog_response_cb (GtkDialog *dialog, guint response, gpointer user_data)
if (response == GTK_RESPONSE_ACCEPT)
buffer_end_user_action (dd->text_buffer, dd->panel);
- gtk_widget_destroy (GTK_WIDGET (dialog));
+ gtk_window_destroy (GTK_WIDGET (dialog));
reload_values (dd->panel);
g_free (dd);
}
@@ -117,7 +117,7 @@ setup_notes_edition (GtrContextPanel *panel)
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_CHAR);
gtk_text_view_set_pixels_inside_wrap (GTK_TEXT_VIEW (text_view),0);
- scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ scrolled_window = gtk_scrolled_window_new ();
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@@ -169,7 +169,7 @@ follow_if_link (GtrContextPanel *panel, GtkWidget *text_view, GtkTextIter *iter)
g_slist_free (tags);
}
-static gboolean
+/*static gboolean
event_after (GtkWidget *text_view,
GdkEvent *ev, GtrContextPanel *panel)
{
@@ -186,10 +186,10 @@ event_after (GtkWidget *text_view,
if (event->button != 1)
return FALSE;
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));*/
/* we shouldn't follow a link if the user has selected something */
- gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
+ /* gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end))
return FALSE;
@@ -202,13 +202,13 @@ event_after (GtkWidget *text_view,
follow_if_link (panel, text_view, &iter);
return FALSE;
-}
+}*/
/* Looks at all tags covering the position (x, y) in the text view,
* and if one of them is a link, change the cursor to the "hands" cursor
* typically used by web browsers.
*/
-static void
+/*static void
set_cursor_if_appropriate (GtkTextView * text_view, gint x, gint y,
GtrContextPanel *panel)
{
@@ -250,9 +250,9 @@ set_cursor_if_appropriate (GtkTextView * text_view, gint x, gint y,
if (tags)
g_slist_free (tags);
-}
+}*/
-/* Update the cursor image if the pointer moved. */
+/* Update the cursor image if the pointer moved.
static gboolean
motion_notify_event (GtkWidget *text_view, GdkEventMotion *event,
GtrContextPanel *panel)
@@ -266,11 +266,11 @@ motion_notify_event (GtkWidget *text_view, GdkEventMotion *event,
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y, panel);
return FALSE;
-}
+}*/
/* Also update the cursor image if the window becomes visible
* (e.g. when a window covering it got iconified). */
-static gboolean
+/* static gboolean
visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event,
GtrContextPanel *panel)
{
@@ -288,7 +288,7 @@ visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event,
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), bx, by, panel);
return FALSE;
-}
+} */
static void
add_notes (GtkTextBuffer *buffer, GtkTextIter *pos, GtkTextTag *header_tag,
@@ -424,15 +424,16 @@ gtr_context_panel_init (GtrContextPanel *panel)
priv->hovering_over_link = FALSE;
- priv->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
- priv->regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
+ // priv->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
+ // priv->regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
+ /* Don't know what does this do
g_signal_connect (priv->context, "event-after",
G_CALLBACK (event_after), panel);
g_signal_connect (priv->context, "motion-notify-event",
G_CALLBACK (motion_notify_event), panel);
g_signal_connect (priv->context, "visibility-notify-event",
- G_CALLBACK (visibility_notify_event), panel);
+ G_CALLBACK (visibility_notify_event), panel);*/
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->context));
g_signal_connect (buffer, "end-user-action",
diff --git a/src/gtr-header-dialog.c b/src/gtr-header-dialog.c
index 2139a4bd..21a13a3b 100644
--- a/src/gtr-header-dialog.c
+++ b/src/gtr-header-dialog.c
@@ -148,7 +148,9 @@ prj_id_version_changed (GtkWidget * widget, GtrHeaderDialog * dlg)
const gchar *text;
GtrHeaderDialogPrivate *priv = gtr_header_dialog_get_instance_private (dlg);
- text = gtk_entry_get_text (GTK_ENTRY (widget));
+ //text = gtk_entry_get_text (GTK_ENTRY (widget));
+ GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ text = gtk_entry_buffer_get_text (buffer);
if (text)
{
@@ -163,7 +165,9 @@ rmbt_changed (GtkWidget * widget, GtrHeaderDialog * dlg)
const gchar *text;
GtrHeaderDialogPrivate *priv = gtr_header_dialog_get_instance_private (dlg);
- text = gtk_entry_get_text (GTK_ENTRY (widget));
+ //text = gtk_entry_get_text (GTK_ENTRY (widget));
+ GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ text = gtk_entry_buffer_get_text (buffer);
if (text)
{
@@ -178,8 +182,10 @@ translator_changed (GtkWidget * widget, GtrHeaderDialog * dlg)
const gchar *name, *email;
GtrHeaderDialogPrivate *priv = gtr_header_dialog_get_instance_private (dlg);
- name = gtk_entry_get_text (GTK_ENTRY (priv->translator));
- email = gtk_entry_get_text (GTK_ENTRY (priv->tr_email));
+ GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ name = gtk_entry_buffer_get_text (buffer);
+ buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ email = gtk_entry_buffer_get_text (buffer);
if (name && email)
{
@@ -194,9 +200,15 @@ language_changed (GtkWidget * widget, GtrHeaderDialog * dlg)
const gchar *language, *lg_email, *lang_code;
GtrHeaderDialogPrivate *priv = gtr_header_dialog_get_instance_private (dlg);
- language = gtk_entry_get_text (GTK_ENTRY (priv->language));
- lg_email = gtk_entry_get_text (GTK_ENTRY (priv->lg_email));
- lang_code = gtk_entry_get_text (GTK_ENTRY (priv->lang_code));
+ // 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);
+ // 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);
+ // 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);
if (language && lg_email)
{
@@ -213,10 +225,18 @@ dl_changed (GtkWidget * widget, GtrHeaderDialog * dlg)
const gchar *team, *module, *branch, *domain;
GtrHeaderDialogPrivate *priv = gtr_header_dialog_get_instance_private (dlg);
- team = gtk_entry_get_text (GTK_ENTRY (priv->team));
- module = gtk_entry_get_text (GTK_ENTRY (priv->module));
- branch = gtk_entry_get_text (GTK_ENTRY (priv->branch));
- domain = gtk_entry_get_text (GTK_ENTRY (priv->domain));
+ //team = gtk_entry_get_text (GTK_ENTRY (priv->team));
+ GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ team = gtk_entry_buffer_get_text (buffer);
+ //module = gtk_entry_get_text (GTK_ENTRY (priv->module));
+ buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ module = gtk_entry_buffer_get_text (buffer);
+ //branch = gtk_entry_get_text (GTK_ENTRY (priv->branch));
+ buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ branch = gtk_entry_buffer_get_text (buffer);
+ //domain = gtk_entry_get_text (GTK_ENTRY (priv->domain));
+ buffer = gtk_entry_get_buffer (GTK_ENTRY(widget));
+ domain = gtk_entry_buffer_get_text (buffer);
gtr_header_set_dl_info (gtr_po_get_header (priv->po),
team, module, branch,
@@ -240,69 +260,101 @@ gtr_header_dialog_fill_from_header (GtrHeaderDialog * dlg)
gtk_text_buffer_set_text (buffer, gtr_header_get_comments (header), -1);
text = gtr_header_get_prj_id_version (header);
- gtk_entry_set_text (GTK_ENTRY (priv->prj_id_version), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->prj_id_version), text);
+ GtkEntryBuffer *entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->prj_id_version));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_pot_date (header);
- gtk_entry_set_text (GTK_ENTRY (priv->pot_date), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->pot_date), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->pot_date));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_po_date (header);
- gtk_entry_set_text (GTK_ENTRY (priv->po_date), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->po_date), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->po_date));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_rmbt (header);
- gtk_entry_set_text (GTK_ENTRY (priv->rmbt), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->rmbt), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->rmbt));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
/* Translator and Language Information */
text = gtr_header_get_translator (header);
- gtk_entry_set_text (GTK_ENTRY (priv->translator), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->translator), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->translator));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_tr_email (header);
- gtk_entry_set_text (GTK_ENTRY (priv->tr_email), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->tr_email), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->tr_email));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_language (header);
- gtk_entry_set_text (GTK_ENTRY (priv->language), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->language), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->language));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_language_code (header);
- gtk_entry_set_text (GTK_ENTRY (priv->lang_code), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->lang_code), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->lang_code));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_lg_email (header);
- gtk_entry_set_text (GTK_ENTRY (priv->lg_email), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->lg_email), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->lg_email));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_charset (header);
- gtk_entry_set_text (GTK_ENTRY (priv->charset), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->charset), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->charset));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_encoding (header);
- gtk_entry_set_text (GTK_ENTRY (priv->encoding), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->encoding), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->encoding));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
/* Damned Lies Information */
text = gtr_header_get_dl_team (header);
- gtk_entry_set_text (GTK_ENTRY (priv->team), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->team), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->team));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_dl_module (header);
- gtk_entry_set_text (GTK_ENTRY (priv->module), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->module), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->module));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_dl_branch (header);
- gtk_entry_set_text (GTK_ENTRY (priv->branch), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->branch), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->branch));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_dl_domain (header);
- gtk_entry_set_text (GTK_ENTRY (priv->domain), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->domain), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->domain));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
text = gtr_header_get_dl_state (header);
- gtk_entry_set_text (GTK_ENTRY (priv->state), text);
+ //gtk_entry_set_text (GTK_ENTRY (priv->state), text);
+ entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->state));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
g_free (text);
}
@@ -334,7 +386,7 @@ gtr_header_dialog_init (GtrHeaderDialog * dlg)
gtk_widget_set_margin_bottom (GTK_WIDGET (dlg), 6);
gtk_box_set_spacing (content_area, 6);
- g_signal_connect (dlg, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dlg, "response", G_CALLBACK (gtk_window_destroy), NULL);
builder = gtk_builder_new ();
gtk_builder_add_objects_from_resource (builder, "/org/gnome/translator/gtr-header-dialog.ui",
@@ -474,7 +526,7 @@ gtr_show_header_dialog (GtrWindow * window)
"use-header-bar", TRUE, NULL));
g_signal_connect (dlg,
- "destroy", G_CALLBACK (gtk_widget_destroyed), &dlg);
+ "destroy", G_CALLBACK (gtk_window_destroy), NULL);
set_default_values (GTR_HEADER_DIALOG (dlg), window);
@@ -482,7 +534,7 @@ gtr_show_header_dialog (GtrWindow * window)
}
gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (window));
- gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_DIALOG);
+ //gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
gtk_window_present (GTK_WINDOW (dlg));
diff --git a/src/gtr-history-entry.c b/src/gtr-history-entry.c
index f5cd39f9..129f00df 100644
--- a/src/gtr-history-entry.c
+++ b/src/gtr-history-entry.c
@@ -61,10 +61,10 @@ typedef struct
struct _GtrHistoryEntry
{
- GtkComboBoxText parent_instance;
+ GtkComboBox parent_instance;
};
-G_DEFINE_TYPE_WITH_PRIVATE (GtrHistoryEntry, gtr_history_entry, GTK_TYPE_COMBO_BOX_TEXT)
+G_DEFINE_TYPE_WITH_PRIVATE (GtrHistoryEntry, gtr_history_entry, GTK_TYPE_COMBO_BOX)
static void
gtr_history_entry_set_property (GObject * object,
diff --git a/src/gtr-history-entry.h b/src/gtr-history-entry.h
index 6888705e..694996c1 100644
--- a/src/gtr-history-entry.h
+++ b/src/gtr-history-entry.h
@@ -44,7 +44,7 @@ typedef struct _GtrHistoryEntryClass GtrHistoryEntryClass;
struct _GtrHistoryEntryClass
{
- GtkComboBoxTextClass parent_class;
+ GtkComboBoxClass parent_class;
};
GType
diff --git a/src/gtr-io-error-info-bar.c b/src/gtr-io-error-info-bar.c
index 8ca366b4..adedc3ed 100644
--- a/src/gtr-io-error-info-bar.c
+++ b/src/gtr-io-error-info-bar.c
@@ -65,7 +65,8 @@ set_info_bar_text_and_icon (GtkInfoBar * infobar,
hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
gtk_widget_show (hbox_content);
- image = gtk_image_new_from_icon_name (icon_stock_id, GTK_ICON_SIZE_DIALOG);
+ image = gtk_image_new_from_icon_name (icon_stock_id);
+ gtk_image_set_icon_size (image, GTK_ICON_SIZE_NORMAL);
gtk_widget_show (image);
gtk_box_append (GTK_BOX (hbox_content), image);
gtk_widget_set_halign (image, 0.5);
diff --git a/src/gtr-jump-dialog.c b/src/gtr-jump-dialog.c
index 4aa36630..2a9a2a5d 100644
--- a/src/gtr-jump-dialog.c
+++ b/src/gtr-jump-dialog.c
@@ -64,11 +64,11 @@ dialog_response_handler (GtkDialog * dlg, gint res_id)
(priv->jump));
tab = gtr_window_get_active_tab (priv->window);
gtr_tab_go_to_number (tab, number - 1);
- gtk_widget_destroy (GTK_WIDGET (dlg));
+ gtk_window_destroy (GTK_WIDGET (dlg));
break;
default:
- gtk_widget_destroy (GTK_WIDGET (dlg));
+ gtk_window_destroy (GTK_WIDGET (dlg));
}
}
@@ -155,7 +155,7 @@ gtr_show_jump_dialog (GtrWindow * window)
dlg = g_object_new (GTR_TYPE_JUMP_DIALOG, NULL);
g_signal_connect (dlg,
- "destroy", G_CALLBACK (gtk_widget_destroyed), &dlg);
+ "destroy", G_CALLBACK (gtk_window_destroy), &dlg);
priv->window = window;
diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c
index 3c206e70..950d069f 100644
--- a/src/gtr-preferences-dialog.c
+++ b/src/gtr-preferences-dialog.c
@@ -297,7 +297,7 @@ on_profile_dialog_response_cb (GtrProfileDialog *profile_dialog,
}
g_object_unref (prof_manager);
- gtk_widget_destroy (GTK_WIDGET (profile_dialog));
+ gtk_window_destroy (GTK_WIDGET (profile_dialog));
}
static void
@@ -441,7 +441,7 @@ delete_button_clicked (GtkWidget *button, GtrPreferencesDialog *dlg)
(dialog),
_("Another profile should be selected as active
before"));
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
}
else
@@ -711,10 +711,10 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
gtk_widget_set_margin_bottom (priv->notebook, 6);
context = gtk_widget_get_style_context (profiles_scrolled_window);
- gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
+ //gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
context = gtk_widget_get_style_context (profiles_toolbar);
- gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
+ //gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
setup_files_pages (dlg);
setup_editor_pages (dlg);
@@ -762,12 +762,13 @@ gtr_show_preferences_dialog (GtrWindow * window)
dlg = GTK_WIDGET (g_object_new (GTR_TYPE_PREFERENCES_DIALOG,
"use-header-bar", TRUE, NULL));
g_signal_connect (dlg,
- "destroy", G_CALLBACK (gtk_widget_destroyed), &dlg);
- gtk_widget_show_all (dlg);
+ "destroy", G_CALLBACK (gtk_window_destroy), NULL);
+ g_free(dlg);
+ gtk_widget_show (dlg);
}
gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (window));
- gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_DIALOG);
+ //gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
gtk_window_present (GTK_WINDOW (dlg));
diff --git a/src/gtr-search-bar.c b/src/gtr-search-bar.c
index 6d024f47..c6b73f31 100644
--- a/src/gtr-search-bar.c
+++ b/src/gtr-search-bar.c
@@ -88,7 +88,9 @@ gtr_search_bar_set_search_text (GtrSearchBar *dialog,
g_return_if_fail (GTR_IS_SEARCH_BAR (dialog));
g_return_if_fail (text != NULL);
- gtk_entry_set_text (GTK_ENTRY (dialog->search_entry), text);
+ //gtk_entry_set_text (GTK_ENTRY (dialog->search_entry), text);
+ GtkEntryBuffer *entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(dialog->search_entry));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
}
/*
@@ -100,7 +102,11 @@ gtr_search_bar_get_search_text (GtrSearchBar *dialog)
//g_assert (GTR_IS_SEARCH_BAR (dialog));
g_return_val_if_fail (GTR_IS_SEARCH_BAR (dialog), NULL);
- return gtk_entry_get_text (GTK_ENTRY (dialog->search_entry));
+ //return gtk_entry_get_text (GTK_ENTRY (dialog->search_entry));
+ const gchar *text;
+ GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(dialog->search_entry));
+ text = gtk_entry_buffer_get_text (buffer);
+ return text;
}
void
@@ -111,7 +117,9 @@ gtr_search_bar_set_replace_text (GtrSearchBar *dialog,
g_return_if_fail (GTR_IS_SEARCH_BAR (dialog));
g_return_if_fail (text != NULL);
- gtk_entry_set_text (GTK_ENTRY (dialog->replace_entry), text);
+ //gtk_entry_set_text (GTK_ENTRY (dialog->replace_entry), text);
+ GtkEntryBuffer *entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(dialog->replace_entry));
+ gtk_entry_buffer_set_text (entry_buffer, text, -1);
}
const gchar *
@@ -119,7 +127,11 @@ gtr_search_bar_get_replace_text (GtrSearchBar *dialog)
{
g_return_val_if_fail (GTR_IS_SEARCH_BAR (dialog), NULL);
- return gtk_entry_get_text (GTK_ENTRY (dialog->replace_entry));
+ //return gtk_entry_get_text (GTK_ENTRY (dialog->replace_entry));
+ gchar *text;
+ GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(dialog->replace_entry));
+ text = gtk_entry_buffer_get_text (buffer);
+ return text;
}
void
@@ -239,7 +251,8 @@ gtr_search_bar_get_wrap_around (GtrSearchBar *self)
void
gtr_hide_bar (GtrSearchBar *self)
{
- GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ //GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ GtkWindow *window = GTK_WINDOW(gtk_widget_get_root (GTK_WIDGET (self)));
GtrTab *active_tab = gtr_window_get_active_tab (GTR_WINDOW (window));
@@ -249,28 +262,32 @@ gtr_hide_bar (GtrSearchBar *self)
void
gtr_search_bar_find_next (GtrSearchBar *self)
{
- GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ //GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ GtkWindow *window = GTK_WINDOW(gtk_widget_get_root (GTK_WIDGET (self)));
do_find (self, GTR_WINDOW (window), FALSE);
}
void
gtr_search_bar_find_prev (GtrSearchBar *self)
{
- GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ //GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ GtkWindow *window = GTK_WINDOW(gtk_widget_get_root (GTK_WIDGET (self)));
do_find (self, GTR_WINDOW (window), TRUE);
}
void
gtr_do_replace (GtrSearchBar *self)
{
- GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ //GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ GtkWindow *window = GTK_WINDOW(gtk_widget_get_root (GTK_WIDGET (self)));
do_replace (self, GTR_WINDOW (window));
}
void
gtr_do_replace_all (GtrSearchBar *self)
{
- GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ //GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+ GtkWindow *window = GTK_WINDOW(gtk_widget_get_root (GTK_WIDGET (self)));
do_replace_all (self, GTR_WINDOW (window));
}
@@ -411,34 +428,34 @@ search_entry_populate_popup (GtrSearchBar *self,
GtkWidget *sep;
guint pos = 0;
- item = gtk_check_menu_item_new_with_label (_("Case sensitive"));
+ item = gtk_check_button_new_with_label (_("Case sensitive"));
gtk_actionable_set_action_name (GTK_ACTIONABLE (item), "search-settings.case-sensitive");
gtk_menu_shell_insert (GTK_MENU_SHELL (widget), item, pos++);
gtk_widget_show (item);
- item = gtk_check_menu_item_new_with_label (_("Match whole word only"));
+ item = gtk_check_button_new_with_label (_("Match whole word only"));
gtk_actionable_set_action_name (GTK_ACTIONABLE (item), "search-settings.at-word-boundaries");
gtk_menu_shell_insert (GTK_MENU_SHELL (widget), item, pos++);
gtk_widget_show (item);
- item = gtk_check_menu_item_new_with_label (_("Wrap around"));
+ item = gtk_check_button_new_with_label (_("Wrap around"));
gtk_actionable_set_action_name (GTK_ACTIONABLE (item), "search-settings.wrap-around");
gtk_menu_shell_insert (GTK_MENU_SHELL (widget), item, pos++);
gtk_widget_show (item);
- item = gtk_check_menu_item_new_with_label (_("Original text"));
+ item = gtk_check_button_new_with_label (_("Original text"));
gtk_actionable_set_action_name (GTK_ACTIONABLE (item), "search-settings.at-original-text");
gtk_menu_shell_insert (GTK_MENU_SHELL (widget), item, pos++);
gtk_widget_show (item);
- item = gtk_check_menu_item_new_with_label (_("Translated text"));
+ item = gtk_check_button_new_with_label (_("Translated text"));
gtk_actionable_set_action_name (GTK_ACTIONABLE (item), "search-settings.at-translated-text");
gtk_menu_shell_insert (GTK_MENU_SHELL (widget), item, pos++);
gtk_widget_show (item);
- sep = gtk_separator_menu_item_new ();
+ /*sep = gtk_separator_menu_item_new ();
gtk_menu_shell_insert (GTK_MENU_SHELL (widget), sep, pos++);
- gtk_widget_show (sep);
+ gtk_widget_show (sep);*/
}
}
@@ -450,7 +467,7 @@ gtr_search_bar_destroy (GtkWidget *widget)
g_clear_object (&self->search_bindings);
g_clear_object (&self->search_entry_tag);
- GTK_WIDGET_CLASS (gtr_search_bar_parent_class)->destroy (widget);
+ //GTK_WIDGET_CLASS (gtr_search_bar_parent_class)->destroy (widget);
}
gboolean
@@ -597,12 +614,12 @@ gtr_search_bar_class_init (GtrSearchBarClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GtkBindingSet *binding_set;
+ //GtkBindingSet *binding_set;
object_class->get_property = gtr_search_bar_get_property;
object_class->set_property = gtr_search_bar_set_property;
- widget_class->destroy = gtr_search_bar_destroy;
+ //widget_class->destroy = gtr_search_bar_destroy;
widget_class->grab_focus = gtr_search_bar_grab_focus;
properties [PROP_REPLACE_MODE] =
@@ -659,9 +676,11 @@ gtr_search_bar_class_init (GtrSearchBarClass *klass)
/* Also add gtk_widget_class_add_binding for next-match and previous-match as
* in gtksearchentry.c, which are already in the app as app.find-next and
* app.find-prev */
- binding_set = gtk_binding_set_by_class (klass);
+ /*binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0,
- "stop-search", 0);
+ "stop-search", 0);*/
+ gtk_widget_class_add_binding_signal (klass, GDK_KEY_Escape, 0,
+ "stop-search", NULL);
}
static void
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 93de8bc6..c7a937db 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -536,7 +536,7 @@ gtr_tab_append_msgstr_page (const gchar * tab_label,
label = gtk_label_new (tab_label);
- scroll = gtk_scrolled_window_new (NULL, NULL);
+ scroll = gtk_scrolled_window_new ();
gtk_widget_show (scroll);
view = gtr_view_new ();
@@ -544,8 +544,8 @@ gtr_tab_append_msgstr_page (const gchar * tab_label,
gtk_container_add (GTK_CONTAINER (scroll), view);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
- GTK_SHADOW_IN);
+ /*gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll),
+ GTK_SHADOW_IN);*/
gtk_notebook_append_page (GTK_NOTEBOOK (box), scroll, label);
diff --git a/src/gtr-utils.c b/src/gtr-utils.c
index bd84b0f0..98563765 100644
--- a/src/gtr-utils.c
+++ b/src/gtr-utils.c
@@ -75,10 +75,13 @@ gtr_gtk_button_new_with_icon_name (const gchar * label,
{
GtkWidget *button;
- button = gtk_button_new_with_mnemonic (label);
+ /*button = gtk_button_new_with_mnemonic (label);
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name (icon_name,
- GTK_ICON_SIZE_BUTTON));
+ GTK_ICON_SIZE_BUTTON));*/
+ button = gtk_button_new_from_icon_name (icon_name);
+ gtk_button_set_label (button, label);
+ gtk_button_set_use_underline (button, true);
return button;
}
diff --git a/src/gtr-view.c b/src/gtr-view.c
index 5949b53d..c9d4466e 100644
--- a/src/gtr-view.c
+++ b/src/gtr-view.c
@@ -289,15 +289,15 @@ void
gtr_view_cut_clipboard (GtrView * view)
{
GtkTextBuffer *buffer;
- GtkClipboard *clipboard;
+ GdkClipboard *clipboard;
g_return_if_fail (GTR_IS_VIEW (view));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
g_return_if_fail (buffer != NULL);
- clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view),
- GDK_SELECTION_CLIPBOARD);
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view));
+ //GDK_SELECTION_CLIPBOARD);
/* FIXME: what is default editability of a buffer? */
gtk_text_buffer_cut_clipboard (buffer,
@@ -320,15 +320,15 @@ void
gtr_view_copy_clipboard (GtrView * view)
{
GtkTextBuffer *buffer;
- GtkClipboard *clipboard;
+ GdkClipboard *clipboard;
g_return_if_fail (GTR_IS_VIEW (view));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
g_return_if_fail (buffer != NULL);
- clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view),
- GDK_SELECTION_CLIPBOARD);
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view));
+ //GDK_SELECTION_CLIPBOARD);
gtk_text_buffer_copy_clipboard (buffer, clipboard);
@@ -346,15 +346,15 @@ void
gtr_view_paste_clipboard (GtrView * view)
{
GtkTextBuffer *buffer;
- GtkClipboard *clipboard;
+ GdkClipboard *clipboard;
g_return_if_fail (GTR_IS_VIEW (view));
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
g_return_if_fail (buffer != NULL);
- clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view),
- GDK_SELECTION_CLIPBOARD);
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view));
+ //GDK_SELECTION_CLIPBOARD);
/* FIXME: what is default editability of a buffer? */
gtk_text_buffer_paste_clipboard (buffer,
@@ -814,7 +814,7 @@ gtr_view_set_font (GtrView *view, char *font)
str = pango_font_description_to_css (font_desc);
css = g_strdup_printf ("textview %s", str ?: "");
- gtk_css_provider_load_from_data (priv->provider, css, -1, NULL);
+ gtk_css_provider_load_from_data (priv->provider, css, -1);
pango_font_description_free (font_desc);
}
diff --git a/src/meson.build b/src/meson.build
index 60675775..5cf6a74d 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -37,7 +37,7 @@ sources = files(
'gtr-actions-search.c',
'gtr-actions-view.c',
'gtr-application.c',
- 'gtr-assistant.c',
+ # 'gtr-assistant.c',
'gtr-close-button.c',
'gtr-close-confirmation-dialog.c',
'gtr-context.c',
diff --git a/src/translation-memory/gtr-translation-memory-dialog.c
b/src/translation-memory/gtr-translation-memory-dialog.c
index d4bb0062..fdffc3f7 100644
--- a/src/translation-memory/gtr-translation-memory-dialog.c
+++ b/src/translation-memory/gtr-translation-memory-dialog.c
@@ -54,9 +54,13 @@ native_response_cb (GtkNativeDialog *dialog, guint response, gpointer user_data)
g_autofree char *filename = NULL;
GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog);
- filename = gtk_file_chooser_get_filename (chooser);
- gtk_entry_set_text (GTK_ENTRY (priv->directory_entry),
- filename);
+ //filename = gtk_file_chooser_get_filename (chooser);
+ GFile * 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));
+ gtk_entry_buffer_set_text (entry_buffer, filename, -1);
g_settings_set_string (priv->tm_settings,
"po-directory",
filename);
@@ -336,7 +340,9 @@ gtr_translation_memory_dialog_init (GtrTranslationMemoryDialog *dlg)
language_code = gtr_profile_get_language_code (profile);
filename = g_strconcat (language_code, ".po", NULL);
- gtk_entry_set_text (GTK_ENTRY (priv->tm_lang_entry), filename);
+ //gtk_entry_set_text (GTK_ENTRY (priv->tm_lang_entry), filename);
+ GtkEntryBuffer *entry_buffer = gtk_entry_get_buffer (GTK_ENTRY(priv->tm_lang_entry));
+ gtk_entry_buffer_set_text (entry_buffer, filename, -1);
}
g_object_unref (prof_manager);
diff --git a/src/translation-memory/gtr-translation-memory-ui.c
b/src/translation-memory/gtr-translation-memory-ui.c
index f87717ae..97119ea8 100644
--- a/src/translation-memory/gtr-translation-memory-ui.c
+++ b/src/translation-memory/gtr-translation-memory-ui.c
@@ -190,7 +190,7 @@ tree_view_row_activated (GtkTreeView *tree_view,
g_free (translation);
}
-static void
+/*static void
popup_menu_translation_activate (GtkMenuItem *menuitem,
GtrTranslationMemoryUi *tm_ui)
{
@@ -211,9 +211,9 @@ popup_menu_translation_activate (GtkMenuItem *menuitem,
choose_translation (tm_ui, translation);
g_free (translation);
-}
+}*/
-static void
+/*static void
popup_menu_remove_from_memory (GtkMenuItem *menuitem,
GtrTranslationMemoryUi *tm_ui)
{
@@ -240,9 +240,9 @@ popup_menu_remove_from_memory (GtkMenuItem *menuitem,
g_free (translation);
- /* update list */
+ // update list //
showed_message_cb (priv->tab, priv->msg, tm_ui);
-}
+}*/
static GtkWidget *
create_tree_popup_menu (GtrTranslationMemoryUi *self)
@@ -253,13 +253,13 @@ create_tree_popup_menu (GtrTranslationMemoryUi *self)
menu = gtk_menu_new ();
item = gtk_menu_item_new_with_mnemonic (_("_Use this translation"));
- g_signal_connect (item, "activate",
- G_CALLBACK (popup_menu_translation_activate), self);
+ /*g_signal_connect (item, "activate",
+ G_CALLBACK (popup_menu_translation_activate), self);*/
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
item = gtk_menu_item_new_with_mnemonic (_("_Remove"));
- g_signal_connect (item, "activate",
- G_CALLBACK (popup_menu_remove_from_memory), self);
+ /*g_signal_connect (item, "activate",
+ G_CALLBACK (popup_menu_remove_from_memory), self);*/
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_set_sensitive (item, TRUE);
@@ -268,14 +268,14 @@ create_tree_popup_menu (GtrTranslationMemoryUi *self)
return menu;
}
-static void
+/*static void
tree_popup_menu_detach (GtrTranslationMemoryUi *self, GtkMenu * menu)
{
GtrTranslationMemoryUiPrivate *priv = gtr_translation_memory_ui_get_instance_private (self);
priv->popup_menu = NULL;
-}
+}*/
-static void
+/*static void
gtr_translation_memory_ui_show_menu (GtrTranslationMemoryUi *self,
GdkEventButton * event)
{
@@ -296,7 +296,7 @@ gtr_translation_memory_ui_show_menu (GtrTranslationMemoryUi *self,
GdkEvent *ev = gtk_get_current_event ();
gtk_menu_popup_at_pointer (GTK_MENU (priv->popup_menu), ev);
}
-}
+}*/
static void
tree_view_size_cb (GtkWidget * widget,
@@ -320,7 +320,7 @@ tree_view_size_cb (GtkWidget * widget,
g_list_free (renderers_list);
}
-static gboolean
+/*static gboolean
tree_view_button_press_event (GtkTreeView *tree,
GdkEventButton *event,
GtrTranslationMemoryUi *tm_ui)
@@ -337,9 +337,9 @@ tree_view_button_press_event (GtkTreeView *tree,
gtk_widget_grab_focus (GTK_WIDGET (tree));
gtk_tree_view_set_cursor (tree, path, NULL, FALSE);
- gtr_translation_memory_ui_show_menu (tm_ui, event);
+ //gtr_translation_memory_ui_show_menu (tm_ui, event);
return TRUE;
-}
+}*/
static gboolean
tree_view_popup_menu (GtkTreeView *tree, GtrTranslationMemoryUi *tm_ui)
@@ -401,8 +401,8 @@ gtr_translation_memory_ui_init (GtrTranslationMemoryUi * tm_ui)
gtk_tree_view_append_column (GTK_TREE_VIEW (priv->tree_view), string);
- g_signal_connect (priv->tree_view, "button-press-event",
- G_CALLBACK (tree_view_button_press_event), tm_ui);
+ /*g_signal_connect (priv->tree_view, "button-press-event",
+ G_CALLBACK (tree_view_button_press_event), tm_ui);*/
g_signal_connect (priv->tree_view, "popup-menu",
G_CALLBACK (tree_view_popup_menu), tm_ui);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]