hi here attached is the diff for gpr 0.11deb.etch1 ; note that the changelog is much more detailed; here it is with further comments (and answers to some Steve's questions) > * avoid storing twice the configuration (this was explained in original email) > * do not use uninitialized GError stuff (this was explained in another email) > * do not block dialog sizes > (by calling deprecated gtk_window_set_policy()) new GTK2.0 code should never use gtk_window_set_policy() ; I had some leftovers from the GNOME1 days; the effect was that the "configure printer" subwindow was blocked at very small size (and hence quite difficult to use!) > * enable button in dialogs it was not possible to close warnings > * "gpr: [INTL:fr] French program translation update", thanks to > Jean-Luc Coulon (f5ibh) (Closes: #379918). (self explaining) OK, I admit that this is more than the absolute minimum required to fix the nastiest bug.... but all changes have good effect on the usability of gpr (...try setting widgets in a 300x300 window... :-); I also built this version on two different archs, and tested it, and it works; so can I upload this pleeeease? :-) a.
diff -ur gpr-0.11deb/debian/changelog gpr-0.11deb.etch/debian/changelog
--- gpr-0.11deb/debian/changelog 2006-07-06 18:15:02.000000000 +0200
+++ gpr-0.11deb.etch/debian/changelog 2007-01-13 15:10:53.000000000 +0100
@@ -1,3 +1,15 @@
+gpr (0.11deb.etch1) testing-proposed-update; urgency=low
+
+ * avoid storing twice the configuration
+ * do not use uninitialized GError stuff
+ * do not block dialog sizes
+ (by calling deprecated gtk_window_set_policy())
+ * enable button in dialogs
+ * "gpr: [INTL:fr] French program translation update", thanks to
+ Jean-Luc Coulon (f5ibh) (Closes: #379918).
+
+ -- A Mennucc1 <mennucc1@debian.org> Sat, 13 Jan 2007 15:10:50 +0100
+
gpr (0.11deb) unstable; urgency=low
* do not send non UTF8 strings to GTK2
diff -ur gpr-0.11deb/po/fr.po gpr-0.11deb.etch/po/fr.po
--- gpr-0.11deb/po/fr.po 2006-04-24 16:36:30.000000000 +0200
+++ gpr-0.11deb.etch/po/fr.po 2007-01-13 14:50:19.000000000 +0100
@@ -7,7 +7,7 @@
"Project-Id-Version: gpr\n"
"Report-Msgid-Bugs-To: mennucc1@debian.org\n"
"POT-Creation-Date: 2006-04-24 16:36+0200\n"
-"PO-Revision-Date: 2005-11-14 17:12+0100\n"
+"PO-Revision-Date: 2006-07-26 12:44+0200\n"
"Last-Translator: Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>\n"
"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
"MIME-Version: 1.0\n"
@@ -48,7 +48,7 @@
#: src/main.c:159
msgid "error initializing GTK"
-msgstr ""
+msgstr "erreur d'initialisation de GTK"
#: src/interface.c:221
msgid "gpr"
@@ -64,7 +64,7 @@
#: src/interface.c:273
msgid "Choose a file"
-msgstr ""
+msgstr "Choisir un fichier"
#: src/interface.c:357
msgid "Select Printer"
@@ -75,9 +75,8 @@
msgstr "Fichier PPD"
#: src/interface.c:410 src/interface.c:413
-#, fuzzy
msgid "Select a PPD File"
-msgstr "Imprimante"
+msgstr "Choisir un fichier PPD"
#: src/interface.c:526
msgid "Printer Configuration"
@@ -173,7 +172,7 @@
#: src/interface.c:1272
msgid "Common Options"
-msgstr "Options communes"
+msgstr "Options courantes"
#: src/interface.c:1306
msgid "Printer"
@@ -315,40 +314,3 @@
#: src/support.c:111
msgid "Couldn't create pixmap from data."
msgstr "Impossible de créer l'image à partir des données."
-
-#~ msgid "Couldn't create replacement pixmap."
-#~ msgstr "Impossible de créer l'image de remplacement."
-
-#~ msgid "Couldn't find pixmap file: %s"
-#~ msgstr "Impossible de trouver le fichier image : %s"
-
-#~ msgid "Couldn't create pixmap from file: %s"
-#~ msgstr "Impossible de créer l'image à partir du fichier : %s"
-
-#~ msgid "title = %s\n"
-#~ msgstr "titre = %s\n"
-
-#~ msgid "pattern = %s\n"
-#~ msgstr "motif = %s\n"
-
-#~ msgid "regexp = %d\n"
-#~ msgstr "expression rationnelle = %d\n"
-
-#~ msgid "string = %s\n"
-#~ msgstr "chaîne = %s\n"
-
-#~ msgid "out of memory\n"
-#~ msgstr "mémoire insuffisante\n"
-
-#~ msgid "empty document\n"
-#~ msgstr "document vide\n"
-
-#~ msgid "Document of the wrong type\n"
-#~ msgstr "Type de document incorrect\n"
-
-#~ msgid "document of the wrong type, Tabs expected, found (%s)\n"
-#~ msgstr ""
-#~ "type de document incorrect, des tabulations sont attendues, trouvé (%s)\n"
-
-#~ msgid "[%s] matches [%s]\n"
-#~ msgstr "[%s] correspond à [%s]\n"
diff -ur gpr-0.11deb/src/callbacks.c gpr-0.11deb.etch/src/callbacks.c
--- gpr-0.11deb/src/callbacks.c 2006-07-06 14:12:11.000000000 +0200
+++ gpr-0.11deb.etch/src/callbacks.c 2007-01-13 15:04:59.000000000 +0100
@@ -64,12 +64,29 @@
#define MAX_TABS 25
#define NUM_STANDARD_TABS 3
+/* puts data exactly in position
+ (basilarly, the original authors should have used an array) */
+static GSList* my_g_slist_replace(GSList *list,
+ gpointer data,
+ gint position)
+{
+ GSList* obj=g_slist_nth(list,position);
+ g_assert( position <= g_slist_length(list) );
+ if(obj) {
+ if(obj->data) g_free(obj->data);
+ obj->data=data;
+ } else
+ list=g_slist_insert(list,data,position);
+ return list;
+}
+
+
void revalidate_utf8(gchar *str)
{
extern int debug_on;
gchar *end_valid;
if ( ! g_utf8_validate (str, -1, &end_valid ) ) {
- gsize bytes_read, bytes_written; GError *error;
+ gsize bytes_read, bytes_written; GError *error=NULL;
if (debug_on) printf(" Non UTF8 string '%s' at char '%c' ",str, *end_valid );
gchar * new = g_locale_to_utf8(str, -1, &bytes_read, &bytes_written, &error );
*end_valid=0;
@@ -1320,10 +1337,7 @@
* spot in the linked list
*/
local_ppd->choice_list =
- g_slist_remove(local_ppd->choice_list,
- g_slist_nth_data(local_ppd->choice_list, index));
- local_ppd->choice_list =
- g_slist_insert(local_ppd->choice_list, combined_string, index);
+ my_g_slist_replace(local_ppd->choice_list, combined_string, index);
/*
* To check for conflicts, we will build a hash table of conflicts
@@ -1403,11 +1417,7 @@
* spot in the linked list
*/
local_ppd->inst_opt_list =
- g_slist_remove(local_ppd->inst_opt_list,
- g_slist_nth_data(local_ppd->inst_opt_list, index));
- local_ppd->inst_opt_list =
- g_slist_insert(local_ppd->inst_opt_list, combined_string, index);
-
+ my_g_slist_replace(local_ppd->inst_opt_list, combined_string, index);
/*
* To check for conflicts, we will build a hash table(?) of conflicts
@@ -1469,12 +1479,11 @@
temp_string =
g_strjoin(":", option->keyword->str, choice->choice->str, NULL);
if (inst_opt)
- local_ppd->inst_opt_list =
- g_slist_insert(local_ppd->inst_opt_list, temp_string, count);
- else {
- local_ppd->choice_list =
- g_slist_insert(local_ppd->choice_list, temp_string, count);
- }
+ local_ppd->inst_opt_list=
+ my_g_slist_replace(local_ppd->inst_opt_list,temp_string,count);
+ else
+ local_ppd->choice_list=
+ my_g_slist_replace(local_ppd->choice_list,temp_string,count);
}
return;
diff -ur gpr-0.11deb/src/interface.c gpr-0.11deb.etch/src/interface.c
--- gpr-0.11deb/src/interface.c 2006-07-06 18:31:19.000000000 +0200
+++ gpr-0.11deb.etch/src/interface.c 2007-01-13 15:07:35.000000000 +0100
@@ -219,8 +219,6 @@
contents */
// this is a bad idea gtk_widget_set_usize(gpr_main_window, 500, 0);
gtk_window_set_title(GTK_WINDOW(gpr_main_window), _("gpr"));
- /* MLP: changed the following to allow window resizing. */
- gtk_window_set_policy(GTK_WINDOW(gpr_main_window), TRUE, TRUE, FALSE);
/* add a vbox to the window containing a notebook and a button
box */
@@ -1429,8 +1427,6 @@
//this is a bad idea gtk_widget_set_usize(gpr_inst_options_window, 500, 295);
gtk_window_set_title(GTK_WINDOW(gpr_inst_options_window),
_("Installable Options"));
- gtk_window_set_policy(GTK_WINDOW(gpr_inst_options_window), FALSE, FALSE,
- FALSE);
/* a container */
main_vbox = gtk_vbox_new(FALSE, 0);
@@ -1558,6 +1554,11 @@
GTK_MESSAGE_WARNING,//GtkMessageType type,
GTK_BUTTONS_OK,//GtkButtonsType buttons,
message);//const gchar *message_format,...);
+ gtk_signal_connect(GTK_OBJECT(constraint_messagebox), "response",
+ GTK_SIGNAL_FUNC(unref_constraint_messagebox), NULL);
+
+ g_signal_connect_swapped(GTK_OBJECT(constraint_messagebox),"response",
+ G_CALLBACK (gtk_widget_destroy),constraint_messagebox);
#endif
/*A.Mennucc*/
messages_refcount++;
@@ -1566,8 +1567,6 @@
// gtk_object_set_data(GTK_OBJECT(constraint_messagebox),
// "constraint_messagebox", constraint_messagebox);
- gtk_window_set_policy(GTK_WINDOW(constraint_messagebox), FALSE, FALSE,
- FALSE);
return constraint_messagebox;
Attachment:
signature.asc
Description: OpenPGP digital signature