[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.6.1-20100214-92-g960875c)
The branch, master has been updated
via 960875cc1d57986f2d626b1843330b3bcc2efafa (commit)
via 92302408ad3d0ba01f1e969b39d04dba3c91cf24 (commit)
from 833a0a181cbc012a7c68f02371524a51aa362a43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gschem/src/x_dialog.c | 43 +++++++++++++++++++------------------------
1 files changed, 19 insertions(+), 24 deletions(-)
=================
Commit Messages
=================
commit 960875cc1d57986f2d626b1843330b3bcc2efafa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Tidy up some coding style in text_edit_dialog
Don't initialise variables to NULL un-necessarily. Also, tidy up
some bits of the function which could usefully be grouped together.
:100644 100644 7bf0c1e... 62099cb... M gschem/src/x_dialog.c
commit 92302408ad3d0ba01f1e969b39d04dba3c91cf24
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Fix object type for align_menu in text_edit_dialog
The type is GtkListStore *, not GtkWidget *. I've renamed the variable
from align_menu to align_menu_model to reflect its contents more clearly.
As a cleanup, don't bother casting align_menu_model to G_OBJECT when
calling g_object_unref(). g_object_unref() takes a gpointer argument so
it isn't necessary.
:100644 100644 7e8c891... 7bf0c1e... M gschem/src/x_dialog.c
=========
Changes
=========
commit 960875cc1d57986f2d626b1843330b3bcc2efafa
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Tidy up some coding style in text_edit_dialog
Don't initialise variables to NULL un-necessarily. Also, tidy up
some bits of the function which could usefully be grouped together.
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 7bf0c1e..62099cb 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -414,21 +414,21 @@ void text_edit_dialog_response(GtkWidget * widget, gint response, GSCHEM_TOPLEVE
void text_edit_dialog (GSCHEM_TOPLEVEL *w_current, const char *string, int text_size,
int text_alignment)
{
- GtkWidget *label = NULL;
+ GtkWidget *label;
GtkWidget *table;
GtkWidget *vbox;
- GtkWidget *optionmenu = NULL;
- GtkWidget *combobox = NULL;
+ GtkWidget *optionmenu;
+ GtkWidget *combobox;
GtkListStore *align_menu_model;
- GtkCellRenderer *cell = NULL;
- GtkWidget *viewport1 = NULL;
- GtkWidget *textentry = NULL;
- GtkWidget *sizeentry = NULL;
+ GtkCellRenderer *cell;
+ GtkWidget *viewport1;
+ GtkWidget *textentry;
+ GtkWidget *sizeentry;
GtkWidget *alignment;
- GtkWidget *scrolled_window = NULL;
+ GtkWidget *scrolled_window;
GtkTextBuffer *textbuffer;
char *text_size_string;
- int num_selected=0;
+ int num_selected;
/* Lookup table for quickly translating between alignment values and the
combo box list indices, index is alignment value, value is list index */
static int alignment_lookup[] = {6, 3, 0, 7, 4, 1, 8, 5, 2};
@@ -489,8 +489,12 @@ void text_edit_dialog (GSCHEM_TOPLEVEL *w_current, const char *string, int text_
gtk_container_add( GTK_CONTAINER(alignment), viewport1);
textentry = gtk_text_view_new();
- gtk_text_view_set_editable(GTK_TEXT_VIEW(textentry), TRUE);
- select_all_text_in_textview(GTK_TEXT_VIEW(textentry));
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (textentry), TRUE);
+ if (string != NULL) {
+ textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textentry));
+ gtk_text_buffer_set_text (GTK_TEXT_BUFFER (textbuffer), string, -1);
+ select_all_text_in_textview (GTK_TEXT_VIEW (textentry));
+ }
/*! \bug FIXME: Set tab's width in the textview widget. */
/* See first the code in text_input_dialog and get it working before adding it here. */
@@ -558,15 +562,6 @@ void text_edit_dialog (GSCHEM_TOPLEVEL *w_current, const char *string, int text_
gtk_window_present(GTK_WINDOW(w_current->tewindow));
}
- if (string != NULL) {
- if (num_selected == 1) { /* only if one thing is selected */
- textentry = g_object_get_data (G_OBJECT (w_current->tewindow), "textentry");
- textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textentry));
- gtk_text_buffer_set_text(GTK_TEXT_BUFFER(textbuffer), string, -1);
- select_all_text_in_textview(GTK_TEXT_VIEW(textentry));
- }
- }
-
text_size_string = g_strdup_printf("%d", text_size);
sizeentry = g_object_get_data (G_OBJECT (w_current->tewindow), "sizeentry");
gtk_entry_set_text(GTK_ENTRY(sizeentry),
commit 92302408ad3d0ba01f1e969b39d04dba3c91cf24
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
gschem: Fix object type for align_menu in text_edit_dialog
The type is GtkListStore *, not GtkWidget *. I've renamed the variable
from align_menu to align_menu_model to reflect its contents more clearly.
As a cleanup, don't bother casting align_menu_model to G_OBJECT when
calling g_object_unref(). g_object_unref() takes a gpointer argument so
it isn't necessary.
diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 7e8c891..7bf0c1e 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -419,7 +419,7 @@ void text_edit_dialog (GSCHEM_TOPLEVEL *w_current, const char *string, int text_
GtkWidget *vbox;
GtkWidget *optionmenu = NULL;
GtkWidget *combobox = NULL;
- GtkWidget *align_menu = NULL;
+ GtkListStore *align_menu_model;
GtkCellRenderer *cell = NULL;
GtkWidget *viewport1 = NULL;
GtkWidget *textentry = NULL;
@@ -535,8 +535,8 @@ void text_edit_dialog (GSCHEM_TOPLEVEL *w_current, const char *string, int text_
gtk_misc_set_alignment(GTK_MISC(label),0,0);
gtk_table_attach(GTK_TABLE(table), label, 0,1,2,3, GTK_FILL,0,0,0);
- align_menu = create_menu_alignment(w_current);
- combobox = gtk_combo_box_new_with_model(GTK_TREE_MODEL(align_menu));
+ align_menu_model = create_menu_alignment(w_current);
+ combobox = gtk_combo_box_new_with_model(GTK_TREE_MODEL(align_menu_model));
gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(combobox), 3);
cell = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combobox), cell, TRUE);
@@ -545,7 +545,7 @@ void text_edit_dialog (GSCHEM_TOPLEVEL *w_current, const char *string, int text_
gtk_combo_box_set_active(GTK_COMBO_BOX(combobox),
alignment_lookup[text_alignment]);
w_current->text_alignment = text_alignment;
- g_object_unref(G_OBJECT(align_menu));
+ g_object_unref (align_menu_model);
gtk_table_attach_defaults(GTK_TABLE(table), combobox, 1,2,2,3);
g_signal_connect(G_OBJECT(combobox), "changed",
G_CALLBACK(change_alignment), w_current);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs