rpms/emelfm2/devel e2-0.3.2-07-02-01.patch, NONE, 1.1 emelfm2.spec, 1.16, 1.17

Christoph Wickert (cwickert) fedora-extras-commits at redhat.com
Sat Feb 24 20:39:04 UTC 2007


Author: cwickert

Update of /cvs/extras/rpms/emelfm2/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25384

Modified Files:
	emelfm2.spec 
Added Files:
	e2-0.3.2-07-02-01.patch 
Log Message:
apply upstream's e2-0.3.2-07-02-01.patch

e2-0.3.2-07-02-01.patch:

--- NEW FILE e2-0.3.2-07-02-01.patch ---
--- plugins/e2p_find.c	2006-12-02 02:57:48.000000000 -0500
+++ plugins/e2p_find.c	2007-01-30 13:06:34.000000000 -0500
@@ -116,4 +116,5 @@
 	{
 		//empty or space-only strings don't get saved
+		if (i != NAME_ENTRY)
 		g_strstrip (entries[i]);
 		if (*entries[i] == '\0')
--- src/command/e2_command.c	2007-01-11 21:33:37.000000000 -0500
+++ src/command/e2_command.c	2007-01-30 13:06:34.000000000 -0500
@@ -112,5 +112,6 @@
 		//normally, the child's data is provided in signal data
 		endpid = info->si_pid;
-		exitstatus = info->si_status;
+//		exitstatus = info->si_status;
+		waitpid (endpid, &exitstatus, waitflags);	//must reap
 	}
 	else
@@ -2463,5 +2477,5 @@
 	if ((command == NULL) || (*command == '\0'))
 		return 1;
-	g_strstrip (command);
+	g_strchug (command);	//command arg may be a path with intended trailing whitespace
 	if (*command == '\0')
 		return 1;
--- src/dialogs/e2_dialog.c	2006-11-30 00:28:53.000000000 -0500
+++ src/dialogs/e2_dialog.c	2007-02-02 08:30:21.000000000 -0500
@@ -629,14 +629,16 @@
  * @param window_title window title string
  * @param prompt prompt string
+ * @param suggestion string to show in combobox entry, or NULL
  * @param extras button-related flags
  * @param history_list the history list for a combo entry
- * @param input pointer to store for the inputted password string
+ * @param input pointer to store for the entered string
  * @return button code returned by the dialog
  **/
 DialogButtons e2_dialog_combo_input (gchar* window_title,
-	gchar *prompt, OW_ButtonFlags extras, GList **history_list, gchar **input)
+	gchar *prompt, gchar *suggestion, OW_ButtonFlags extras,
+	GList **history_list, gchar **input)
 {
-	return _e2_dialog_line_input (window_title, prompt, NULL,
-		FALSE, // tag PASSWORDINPUT FALSE,
+	return _e2_dialog_line_input (window_title, prompt, suggestion,
+		TRUE, // tag PASSWORDINPUT FALSE,
 		input, extras, TRUE, history_list);
 }
@@ -685,4 +687,10 @@
 			E2_COMBOBOX_HAS_ENTRY | E2_COMBOBOX_FOCUS_ON_CHANGE);
 		dialogentry = GTK_BIN (dialogcombo)->child;
+		if (suggestion != NULL)
+		{
+			gtk_entry_set_text (GTK_ENTRY (dialogentry), suggestion);
+			//select_text is TRUE
+			gtk_editable_select_region (GTK_EDITABLE (dialogentry), 0, -1);
+		}
 	}
 	else
--- src/dialogs/e2_dialog.h	2006-10-31 23:36:04.000000000 -0500
+++ src/dialogs/e2_dialog.h	2007-02-02 08:30:21.000000000 -0500
@@ -101,5 +101,5 @@
 	gchar **input);
 DialogButtons e2_dialog_combo_input (gchar* window_title, gchar *prompt,
-	OW_ButtonFlags extras, GList **history_list, gchar **input);
+	gchar *suggestion, OW_ButtonFlags extras, GList **history_list, gchar **input);
 //overwrite check dialog
 DialogButtons e2_dialog_ow_check (gchar *slocal, gchar *dlocal, OW_ButtonFlags extras);
--- src/dialogs/e2_edit_dialog.c	2007-01-16 20:42:25.000000000 -0500
+++ src/dialogs/e2_edit_dialog.c	2007-02-02 08:29:37.000000000 -0500
@@ -43,9 +43,11 @@
 extern gboolean search_wrap;
 extern GList *find_history;
-gboolean replace_all;
-gboolean confirm_before;
-gboolean do_next;
+static gboolean replace_all;
+static gboolean confirm_before;
+static gboolean do_next;
 static GList *replace_history = NULL;
-
+#ifdef E2_SPELLCHECK
+static GList *lang_history = NULL;
+#endif
 gint blinkmsec;	//blink-cycle duration (msec)
 //keycodes corresponding to mnemonics for translated labels
@@ -53,8 +55,9 @@
 extern guint find_keycode;
 extern guint hide_keycode;
-guint save_keycode;
 guint replace_keycode;
-guint undo_keycode;
-guint redo_keycode;
+
+static guint save_keycode;
+static guint undo_keycode;
+static guint redo_keycode;
 
 static void _e2_edit_dialog_dirty_change_cb (GtkTextBuffer *textbuffer,
@@ -79,5 +82,4 @@
 	gtkspell_detach (rt->spelldata);	//this destroys the GtkSpell
 	rt->spelldata = NULL;
-	gtk_widget_hide (rt->unspellbtn);
 }
 #endif
@@ -401,5 +403,5 @@
 #endif
 #ifdef E2_SPELLCHECK
-static void _e2_edit_dialog_hide_cb (GtkWidget *menuitem, E2_ViewDialogRuntime *rt);
+static GList *lang_history;
 /**
  * @brief recheck all buffer spelling
@@ -413,7 +415,8 @@
 	E2_ViewDialogRuntime *rt)
 {
+	gchar *lang = (lang_history == NULL) ? NULL : 	//start speller with default language
+					(gchar *) lang_history->data;  //or with last-chosen language
 	GError *error = NULL;
-	//start speller with default language
-	rt->spelldata = gtkspell_new_attach (GTK_TEXT_VIEW (rt->textview), NULL, &error);
+	rt->spelldata = gtkspell_new_attach (GTK_TEXT_VIEW (rt->textview), lang, &error);
 	if (rt->spelldata == NULL)
 	{
@@ -425,6 +428,7 @@
 	else
 	{
-		_e2_edit_dialog_hide_cb (NULL, rt);
-		gtk_widget_show (rt->unspellbtn);
+		//disable all gtkspell signal-callbacks
+		g_signal_handlers_block_matched (G_OBJECT (rt->textview),
+			G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rt->spelldata);
 	}
 }
@@ -437,5 +441,5 @@
  * @return
  **/
-/*static void _e2_edit_dialog_unspellall_cb (GtkWidget *menuitem,
+static void _e2_edit_dialog_unspellall_cb (GtkWidget *menuitem,
 	E2_ViewDialogRuntime *rt)
 {
@@ -443,6 +447,4 @@
 	rt->spelldata = NULL;
 }
-*/
-//static GList *lang_history = NULL;	//session-static, but not cached
 /**
  * @brief set spell-checker language
@@ -453,12 +455,21 @@
  * @return
  **/
-/* seems like pspell no longer available, aspell uses other approach to dictionary selection
 static void _e2_edit_dialog_spell_language_cb (GtkWidget *menuitem,
 	E2_ViewDialogRuntime *rt)
 {
 	gchar *lang;
+	if (lang_history == NULL)
+	{
+		lang = (gchar *)g_getenv ("LANG");	//ok if NULL
+		if (lang != NULL && g_str_equal (lang, "C"))
+			lang = NULL;
+		//CHECKME default used by speller backends
+	}
+	else
+		lang = (gchar *)lang_history->data;
+
 	DialogButtons choice = e2_dialog_combo_input (_("choose language"),
-		_("Enter the spell-checker language, in a form that 'pspell' understands:"),
-		0, &lang_history, &lang);
+		_("Enter the spell-checker language (like en_CA):"), lang,
+		0, &lang_history, &lang);	//re-use for entered value
 
 	if (choice == OK)
@@ -469,5 +480,5 @@
 		{
 			gchar *msg = g_strdup_printf (
-				_("Cannot set speller language to %s: %s"), lang, error->msg);
+				_("Cannot set speller language to %s (%s)"), lang, error->message);
 			e2_output_print_error (msg, TRUE);
 			g_error_free (error);
@@ -476,5 +487,4 @@
 	}
 }
-*/
 #endif
 /**
@@ -667,7 +677,49 @@
 {
 	gchar *item_name;
+	GtkWidget *item;
 	GtkWidget *menu = gtk_menu_new ();
-
-	GtkWidget *item =
+#ifdef E2_SPELLCHECK
+	if (rt->spelldata != NULL)
+	{	//decide if we need a spellfix item in the menu
+		GtkTextIter iter;
+		gboolean atcursor = (event_button == 0); //TRUE if processing a menu-button press
+		if (!atcursor)
+		{
+			GdkEvent *event = gtk_get_current_event ();
+			if (event != NULL) //should never happen
+			{
+				if (event->type == GDK_BUTTON_PRESS)
+				{
+					gint buf_x, buf_y, x, y;
+					x = ((GdkEventButton *) event)->x;
+					y = ((GdkEventButton *) event)->y;
+					gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (rt->textview),
+						GTK_TEXT_WINDOW_TEXT, x, y, &buf_x, &buf_y);
+					gtk_text_view_get_iter_at_location (GTK_TEXT_VIEW (rt->textview),
+						&iter, buf_x, buf_y);
+				}
+				else
+					atcursor = TRUE;	//revert to using cursor position
+				gdk_event_free (event);
+			}
+			else
+				atcursor = TRUE;
+		}
+		if (atcursor)
+		{ //menu button was pressed, or error happened
+			GtkTextMark *mark = gtk_text_buffer_get_insert (rt->textbuffer);
+			gtk_text_buffer_get_iter_at_mark (rt->textbuffer, &iter, mark);
+		}
+		//use function from patched gtk-spell to get fixes menu, if any
+		GtkWidget *submenu = gtkspell_get_suggestions_menu (rt->spelldata, &iter);
+		if (submenu != NULL)
+		{	//word is mis-spelt
+			item = e2_menu_add (menu, _("Spelling suggestions"), NULL, NULL, NULL, NULL);
+			gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu);
+			e2_menu_add_separator (menu);
+		}
+	}
+#endif
+	item =
 	e2_menu_add (menu, _("_Save"), GTK_STOCK_SAVE,
 		_("Save the file"), _e2_edit_dialog_save_cb, rt);
@@ -706,12 +758,12 @@
 #endif
 #ifdef E2_SPELLCHECK
-	item = (rt->spelldata == NULL) ?
+	if (rt->spelldata == NULL)
 		e2_menu_add (menu, _("_Check spelling"), GTK_STOCK_SPELL_CHECK,
-			_("Flag mis-spelt words"), _e2_edit_dialog_spellall_cb, rt):
-//		e2_menu_add (menu, _("_Clear spellcheck"), GTK_STOCK_SPELL_CHECK,
-//			_("Remove all spell-check flags"), _e2_edit_dialog_unspellall_cb, rt);
+			_("Flag mis-spelt words"), _e2_edit_dialog_spellall_cb, rt);
+	else
+		e2_menu_add (menu, _("_Clear spellcheck"), GTK_STOCK_SPELL_CHECK,
+			_("Remove all spell-check flags"), _e2_edit_dialog_unspellall_cb, rt);
 #endif
 	e2_menu_add_separator (menu);
-/*aspell uses automatic dictionary-selection when first run ?
 #ifdef E2_SPELLCHECK
 	item =
@@ -720,5 +772,4 @@
 	gtk_widget_set_sensitive (item, (rt->spelldata != NULL));
 #endif
-*/
 	item =
 	e2_menu_add_check (menu, _("_Wrap"), rt->textwrap,
@@ -1075,9 +1126,5 @@
 {
 	_e2_edit_dialog_blink_stop (rt);
-	if (event->button == 3
-#ifdef E2_SPELLCHECK
-		&& rt->spelldata == NULL	//when spelling enabled, defer to speller's context menu
-#endif
-		)
+	if (event->button == 3)
 	{
 		_e2_edit_dialog_show_context_menu (textview, event->button, event->time, rt);
@@ -1336,11 +1383,4 @@
 	gtk_widget_hide (rt->findbtn);
 	find_keycode = e2_utils_get_mnemonic_keycode (labeltext);
-#ifdef E2_SPELLCHECK
-	labeltext = _("_Clear");
-	rt->unspellbtn =
-	e2_dialog_add_undefined_button (rt->dialog, GTK_STOCK_SPELL_CHECK, labeltext, E2_RESPONSE_USER3);
-	e2_widget_set_tooltip (NULL, rt->unspellbtn, _("Cancel spell-checking"));
-	gtk_widget_hide (rt->unspellbtn);
-#endif
 	labeltext = _("_Save");
 	rt->savebtn =
@@ -1481,4 +1521,9 @@
 void e2_edit_dialog_actions_register (void)
 {
+#ifdef E2_SPELLCHECK
+	//HACK while we're at it, init some session parameters
+	e2_cache_list_register ("language-history", &lang_history);
+#endif
+
 	gchar *action_name = g_strconcat(_A(5),".",_A(40),NULL);
 	e2_action_register_simple (action_name, E2_ACTION_TYPE_ITEM,
--- src/dialogs/e2_view_dialog.h	2007-01-16 19:54:14.000000000 -0500
+++ src/dialogs/e2_view_dialog.h	2007-01-30 08:05:35.000000000 -0500
@@ -23,4 +23,6 @@
 
 #ifdef E2_SPELLCHECK
+//NOTE to access internals for the dialog's context-menu-creation, we must
+//use a patched gtk-spell
 #include <gtkspell.h>
 #endif
@@ -108,5 +110,4 @@
 #ifdef E2_SPELLCHECK
 	GtkSpell *spelldata;
-	GtkWidget *unspellbtn;
 #endif
 } E2_ViewDialogRuntime;
--- src/e2_pane.c	2006-11-30 01:48:38.000000000 -0500
+++ src/e2_pane.c	2007-01-30 13:06:34.000000000 -0500
@@ -272,5 +272,5 @@
 	path = g_strdup (path);
 #endif
-	g_strstrip (path);
+	g_strchug (path);	//trailing whitespace may be deliberate
 
 	if (*path == '\0')
--- src/e2_task.c	2007-01-12 19:44:29.000000000 -0500
+++ src/e2_task.c	2007-02-02 08:30:21.000000000 -0500
@@ -2648,5 +2704,5 @@
 	*qed->status = E2_TASK_PAUSED;
 	DialogButtons result = e2_dialog_combo_input (_("open with"),
-		_("Enter command:"), 0, &open_history, &command);
+		_("Enter command:"), NULL, 0, &open_history, &command);
 	*qed->status = E2_TASK_RUNNING;
 	gdk_threads_leave ();
--- src/filesystem/e2_fs.c	2007-01-12 19:44:29.000000000 -0500
+++ src/filesystem/e2_fs.c	2007-01-30 13:06:34.000000000 -0500
@@ -522,5 +522,5 @@
 	//what about incomplete mount of fuse-dir
 #endif
-	g_strstrip (local);
+	g_strchug (local);
 	if (*local != '\0')
 	{
--- src/utils/e2_utils.c	2007-01-12 17:56:07.000000000 -0500
+++ src/utils/e2_utils.c	2007-02-02 08:30:21.000000000 -0500
@@ -225,5 +225,5 @@
 gchar *e2_utils_str_shorten (gchar *string, gint limit, E2_DotMode position)
 {
-	g_strstrip (string);	//just in case
+	g_strchug (string);	//just in case string is a path with trailing space
 	glong len = g_utf8_strlen (string, -1);
 	if (len > limit)
@@ -1057,5 +1057,5 @@
 					{
 						e2_cache_list_register (command_copy, &thishistory);
-						result = e2_dialog_combo_input (NULL, cleaned, 0,
+						result = e2_dialog_combo_input (NULL, cleaned, NULL, 0,
 							&thishistory, &user_input);
 						e2_cache_unregister (command_copy);	//backup the history list
@@ -1349,6 +1349,5 @@
 {
 	gchar *freeme = path;
-	//remove leading and trailing whitespace
-	path = g_strstrip (path);
+	path = g_strchug (path);	//allow (maybe deliberate) trailing whitespace
 
 	if (!g_str_equal (path, G_DIR_SEPARATOR_S))


Index: emelfm2.spec
===================================================================
RCS file: /cvs/extras/rpms/emelfm2/devel/emelfm2.spec,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- emelfm2.spec	19 Jan 2007 11:47:51 -0000	1.16
+++ emelfm2.spec	24 Feb 2007 20:38:32 -0000	1.17
@@ -1,6 +1,6 @@
 Name:           emelfm2
 Version:        0.3.2
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A file manager that implements the popular two-pane design
 
 Group:          Applications/File
@@ -8,6 +8,7 @@
 URL:            http://emelfm2.net/
 Source0:        http://emelfm2.net/rel/emelfm2-0.3.2.tar.gz
 Patch0:         emelfm2-makefile.config.patch
+Patch1:         e2-0.3.2-07-02-01.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gtk2-devel >= 2.6.0, gettext, desktop-file-utils
@@ -23,6 +24,7 @@
 %prep
 %setup -q
 %patch0 -p0 -b .orig
+%patch1 -p0 -b .07-02-01
 
 # fix for x86_64 libs
 sed -i 's!$(PREFIX)/lib/$(TARGET)/$(LIBS)/!$(PREFIX)/%{_lib}/$(TARGET)/$(LIBS)/!' Makefile
@@ -72,6 +74,9 @@
 
 	
 %changelog
+* Sat Feb 24 2007 Christoph Wickert <fedora christoph-wickert de> - 0.3.2-2
+- Include upstream's e2-0.3.2-07-02-01.patch fixing some bugs.
+
 * Fri Jan 19 2007 Christoph Wickert <fedora christoph-wickert de> - 0.3.2-1
 - Update 0.3.2.
 - Remove Category "Application" from emelfm2.desktop.




More information about the fedora-extras-commits mailing list