Re: gEDA-user: pcb: Some code-cleanup-patches

2010-10-16 Thread Felix Ruoff



Am 10.10.2010 10:03, schrieb Felix Ruoff:

 Am 10.10.2010 02:55, schrieb Peter Clifton:

On Sat, 2010-10-09 at 23:29 +0200, Felix Ruoff wrote:

(...)
The first one (0002...) removes some unused functions from the 
gtk-gui-code.

How is removing APIs required by the HID interface and replacing them
with NULL pointers removing unused functions?
I am sure, you are right, but I found no situation in the code, where 
this functions are called. For this reason, I removed them and had no 
problems with compiling. I also discovered no problems with using pcb, 
but sure, I have not tested ALL functions.


Can you give me a hint, where my faults are?
I just discovered the error myself. Sorry for sending such a 
'destructive' patch!

Felix


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: pcb: Some code-cleanup-patches

2010-10-10 Thread Felix Ruoff

 Am 10.10.2010 02:55, schrieb Peter Clifton:

On Sat, 2010-10-09 at 23:29 +0200, Felix Ruoff wrote:

Hello,

today I am trying to make patches from my recent days work. I am new to
git, so it takes much more time than I expected...
But, here are two more patches.

The first one (0002...) removes some unused functions from the gtk-gui-code.

How is removing APIs required by the HID interface and replacing them
with NULL pointers removing unused functions?
I am sure, you are right, but I found no situation in the code, where 
this functions are called. For this reason, I removed them and had no 
problems with compiling. I also discovered no problems with using pcb, 
but sure, I have not tested ALL functions.


Can you give me a hint, where my faults are?

Thank you,
Felix


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: pcb: Some code-cleanup-patches

2010-10-10 Thread Ineiev

Hello,

Felix Ruoff wrote:
The second one (0004...) introduces the gtk-default-dialog for 
'overwrite-existing-file - confirmation'.


gtk_file_chooser_get_do_overwrite_confirmation() was introduced in gtk-2.8;
PCB current requirement is 2.4.0.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


gEDA-user: pcb: Some code-cleanup-patches

2010-10-09 Thread Felix Ruoff

 Hello,

today I am trying to make patches from my recent days work. I am new to 
git, so it takes much more time than I expected...

But, here are two more patches.

The first one (0002...) removes some unused functions from the gtk-gui-code.
The second one (0004...) introduces the gtk-default-dialog for 
'overwrite-existing-file - confirmation'. For this reason, the 
pcb-dialog 'ghid_dialog_confirm()' is not needed any more and will be 
removed by this patch, too. This patch also does some other 
modifications to the file open/save dialogs:

- replace OK-button by OPEN/SAVE
- remove 'gtk_dialog_set_default_response()', because the OK/OPEN/SAVE - 
Button will be the default button even without this declaration



It is needed, that you apply patch 0002... before 0004.

Perhaps, someone of you can check this patches before they are sent to 
the patch-tracker.


Thanks and good bye,
Felix
From b66809056891c138ceec8a5a4963b7e5263a7dfd Mon Sep 17 00:00:00 2001
From: Felix Ruoff fe...@posaunenmission.de
Date: Sat, 9 Oct 2010 23:09:25 +0200
Subject: [PATCH] gtk-gui code-cleanup

Removes some unused functions
---
 src/hid/gtk/gtkhid-main.c |   27 +
 src/hid/gtk/gui-dialog.c  |  268 -
 src/hid/gtk/gui.h |4 -
 3 files changed, 2 insertions(+), 297 deletions(-)

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index 7d59672..6b7c6ab 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -866,29 +866,6 @@ ghid_report_dialog (char *title, char *msg)
   ghid_dialog_report (title, msg);
 }
 
-char *
-ghid_prompt_for (char *msg, char *default_string)
-{
-  char *rv;
-
-  rv = ghid_dialog_input (msg, default_string);
-  return rv;
-}
-
-/* FIXME -- implement a proper file select dialog */
-#ifdef FIXME
-char *
-ghid_fileselect (const char *title, const char *descr,
-		 char *default_file, char *default_ext,
-		 const char *history_tag, int flags)
-{
-  char *rv;
-
-  rv = ghid_dialog_input (title, default_file);
-  return rv;
-}
-#endif
-
 void
 ghid_show_item (void *item)
 {
@@ -1187,8 +1164,8 @@ HID ghid_hid = {
   ghid_confirm_dialog,
   ghid_close_confirm_dialog,
   ghid_report_dialog,
-  ghid_prompt_for,
-  ghid_fileselect,
+  0,
+  0,
   ghid_attribute_dialog,
   ghid_show_item,
   ghid_beep,
diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c
index ec91233..f4a2674 100644
--- a/src/hid/gtk/gui-dialog.c
+++ b/src/hid/gtk/gui-dialog.c
@@ -45,50 +45,6 @@
 RCSID ($Id$);
 
 /* -- */
-gchar *
-ghid_dialog_input (gchar * prompt, gchar * initial)
-{
-  GtkWidget *dialog, *vbox, *label, *entry;
-  gchar *string;
-  gboolean response;
-  GHidPort *out = ghid_port;
-
-  dialog = gtk_dialog_new_with_buttons (PCB User Input,
-	GTK_WINDOW (out-top_window),
-	GTK_DIALOG_MODAL,
-	GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-	GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
-
-  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
-  vbox = gtk_vbox_new (FALSE, 4);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
-  label = gtk_label_new ();
-  gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
-
-  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
-  gtk_label_set_markup (GTK_LABEL (label),
-			prompt ? prompt : Enter something);
-
-  entry = gtk_entry_new ();
-  if (initial)
-gtk_entry_set_text (GTK_ENTRY (entry), initial);
-
-  gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
-  gtk_box_pack_start_defaults (GTK_BOX (vbox), entry);
-  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)-vbox), vbox);
-  gtk_widget_show_all (dialog);
-
-  response = gtk_dialog_run (GTK_DIALOG (dialog));
-  if (response != GTK_RESPONSE_OK)
-string = g_strdup (initial ? initial : );
-  else
-string = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
-
-  gtk_widget_destroy (dialog);
-  return string;
-}
-
-/* -- */
 void
 ghid_dialog_about (void)
 {
@@ -106,35 +62,6 @@ ghid_dialog_about (void)
 }
 
 /* -- */
-gint
-ghid_dialog_confirm_all (gchar * all_message)
-{
-  GtkWidget *dialog, *label, *vbox;
-  gint response;
-  GHidPort *out = ghid_port;
-
-  dialog = gtk_dialog_new_with_buttons (Confirm,
-	GTK_WINDOW (out-top_window),
-	GTK_DIALOG_MODAL |
-	GTK_DIALOG_DESTROY_WITH_PARENT,
-	GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-	GTK_STOCK_OK, GTK_RESPONSE_OK,
-	Sequence OK,
-	GUI_DIALOG_RESPONSE_ALL, NULL);
-
-  vbox = ghid_framed_vbox (GTK_DIALOG (dialog)-vbox, NULL, 6, FALSE, 4, 6);
-
-  label = gtk_label_new (all_message);
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 3);
-  gtk_widget_show_all (dialog);
-
-  response = gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy (dialog);
-
-  return response;
-}
-
-/* -- */
 void
 ghid_dialog_message (gchar * 

Re: gEDA-user: pcb: Some code-cleanup-patches

2010-10-09 Thread Peter Clifton
On Sat, 2010-10-09 at 23:29 +0200, Felix Ruoff wrote:
 Hello,
 
 today I am trying to make patches from my recent days work. I am new to 
 git, so it takes much more time than I expected...
 But, here are two more patches.
 
 The first one (0002...) removes some unused functions from the gtk-gui-code.

How is removing APIs required by the HID interface and replacing them
with NULL pointers removing unused functions?

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user