1 |
ssuominen 10/02/19 08:59:46 |
2 |
|
3 |
Added: mousepad-0.2.16-fix-first-replace.patch |
4 |
mousepad-0.2.16-resensitize-find-button.patch |
5 |
Log: |
6 |
Apply Debian 00_resensitize-find-button.patch and 01_fix-first-replace.patch wrt #302020 to restore Find and Replace functionality. |
7 |
(Portage version: 2.2_rc62/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-editors/mousepad/files/mousepad-0.2.16-fix-first-replace.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/mousepad/files/mousepad-0.2.16-fix-first-replace.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/mousepad/files/mousepad-0.2.16-fix-first-replace.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: mousepad-0.2.16-fix-first-replace.patch |
16 |
=================================================================== |
17 |
--- src/search.c |
18 |
+++ src/search.c |
19 |
@@ -78,7 +78,7 @@ |
20 |
static gint document_replace_real(StructData *sd) |
21 |
{ |
22 |
GtkTextIter iter, match_start, match_end; |
23 |
- GtkTextMark *mark_init = NULL; |
24 |
+ GtkTextMark *mark_init = NULL, *mark_start, *mark_end; |
25 |
gboolean res; |
26 |
gint num = 0; |
27 |
GtkWidget *q_dialog = NULL; |
28 |
@@ -113,6 +113,11 @@ |
29 |
if (num == 0 && q_dialog == NULL) |
30 |
q_dialog = create_dialog_message_question( |
31 |
gtk_widget_get_toplevel(sd->mainwin->textview), _("Replace?")); |
32 |
+ |
33 |
+ gtk_text_buffer_get_selection_bounds(textbuffer, &match_start, &match_end); |
34 |
+ mark_start = gtk_text_buffer_create_mark(textbuffer, NULL, &match_start, FALSE); |
35 |
+ mark_end = gtk_text_buffer_create_mark(textbuffer, NULL, &match_end, FALSE); |
36 |
+ |
37 |
switch (gtk_dialog_run(GTK_DIALOG(q_dialog))) { |
38 |
case GTK_RESPONSE_CANCEL: |
39 |
res = 0; |
40 |
@@ -122,6 +127,11 @@ |
41 |
case GTK_RESPONSE_NO: |
42 |
continue; |
43 |
} |
44 |
+ |
45 |
+ gtk_text_buffer_get_iter_at_mark(textbuffer, &match_start, mark_start); |
46 |
+ gtk_text_buffer_get_iter_at_mark(textbuffer, &match_end, mark_end); |
47 |
+ gtk_text_buffer_move_mark_by_name(textbuffer, "selection_bound", &match_start); |
48 |
+ gtk_text_buffer_move_mark_by_name(textbuffer, "insert", &match_end); |
49 |
} |
50 |
gtk_text_buffer_delete_selection(textbuffer, TRUE, TRUE); |
51 |
undo_set_sequency(TRUE); |
52 |
|
53 |
|
54 |
|
55 |
1.1 app-editors/mousepad/files/mousepad-0.2.16-resensitize-find-button.patch |
56 |
|
57 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/mousepad/files/mousepad-0.2.16-resensitize-find-button.patch?rev=1.1&view=markup |
58 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/mousepad/files/mousepad-0.2.16-resensitize-find-button.patch?rev=1.1&content-type=text/plain |
59 |
|
60 |
Index: mousepad-0.2.16-resensitize-find-button.patch |
61 |
=================================================================== |
62 |
--- src/search.c |
63 |
+++ src/search.c |
64 |
@@ -210,8 +210,11 @@ |
65 |
G_CALLBACK(toggle_sensitivity), NULL); |
66 |
g_signal_connect(G_OBJECT(entry_find), "delete-text", |
67 |
G_CALLBACK(toggle_sensitivity), NULL); |
68 |
- if (sd->search.string_find) |
69 |
+ if (sd->search.string_find) { |
70 |
gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find); |
71 |
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), |
72 |
+ GTK_RESPONSE_OK, TRUE); |
73 |
+ } |
74 |
|
75 |
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); |
76 |
gtk_entry_set_activates_default(GTK_ENTRY(entry_find), TRUE); |
77 |
@@ -275,8 +278,11 @@ |
78 |
G_CALLBACK(toggle_sensitivity), NULL); |
79 |
g_signal_connect(G_OBJECT(entry_find), "delete-text", |
80 |
G_CALLBACK(toggle_sensitivity), NULL); |
81 |
- if (sd->search.string_find) |
82 |
+ if (sd->search.string_find) { |
83 |
gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find); |
84 |
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), |
85 |
+ GTK_RESPONSE_OK, TRUE); |
86 |
+ } |
87 |
label_replace = gtk_label_new_with_mnemonic(_("Re_place with: ")); |
88 |
gtk_misc_set_alignment(GTK_MISC(label_replace), 0, 0.5); |
89 |
gtk_table_attach_defaults(GTK_TABLE(table), label_replace, 0, 1, 1, 2); |