On 6/29/07, Lars Clausen <[EMAIL PROTECTED]> wrote:
On Mon, 2007-06-25 at 23:07 -0500, Patrick Hallinan wrote:
>
>
> On 6/20/07, Lars Clausen <[EMAIL PROTECTED]> wrote:
> The no-show is consistent for me, no matter which way the
> diagram is
> created. Looks like a signal either is not fired or not
> received (maybe
> the receiver is not set when the signal is fired?).
>
> I have GTK 2.8.20 and GLib 2.10.3 on an Ubuntu Dapper Drake
> x86 box.
>
> I think I saw the same problem with Debian Etch. GTK 2.8.20 and GLib
> 2.12.4. The attached patch fixes the problem on Etch. I don't really
> know why. I played around with the order of things.
Yep, the diagram now turns up nicely. There's still the switch to the
last diagram when resizing, but that's probably another matter.
Off the top of my head: whenever diagram_set_active() is called the
diagram will be shown in the notebook. I wonder if resize results in
this call. I'll take a look.
I've attached a small change to put an asterisk in the notebook tab
text to indicate a modified diagram. I'm not sure about one part of
the patch:
I pull the filename from the filepath by searching for
G_DIR_SEPARATOR_S. If I find the separator I increment the pointer by
1 to point to the beginning of the filename. I just wonder if this is
portable with character encodings like UTF8 and such.
Pat.
Index: app/display.c
===================================================================
--- app/display.c (revision 3710)
+++ app/display.c (working copy)
@@ -96,6 +96,12 @@
GtkStatusbar *statusbar;
guint context_id;
+ if (is_integrated_ui ())
+ {
+ integrated_ui_show_diagram_modified_status (ddisp);
+ return;
+ }
+
if (diagram_is_modified(ddisp->diagram))
{
statusbar = GTK_STATUSBAR (ddisp->modified_status);
Index: app/interface.c
===================================================================
--- app/interface.c (revision 3710)
+++ app/interface.c (working copy)
@@ -438,6 +438,41 @@
}
/**
+ * Change diagram notebook label to show that the diagram has
+ * been modified (or that it hasn't been modified).
+ *
+ * @param ddisp The display which needs the label updated.
+ */
+void integrated_ui_show_diagram_modified_status (DDisplay *ddisp)
+{
+ GtkLabel * label = g_object_get_data (G_OBJECT (ddisp->container), "tab-label");
+ const gchar * name;
+ const gchar * sep;
+
+ sep = g_strrstr (ddisp->diagram->filename,G_DIR_SEPARATOR_S);
+
+ if (sep)
+ {
+ name = sep + 1; /* IS THIS PORTABLE??? */
+ }
+ else
+ {
+ name = ddisp->diagram->filename;
+ }
+
+ if (diagram_is_modified (ddisp->diagram))
+ {
+ const gchar * text = g_strdup_printf ("*%s",name);
+ gtk_label_set_text (label, text);
+ g_free (text);
+ }
+ else
+ {
+ gtk_label_set_text (label,name);
+ }
+}
+
+/**
* @param ddisp The diagram display object that a window is created for
* @param title
*/
Index: app/interface.h
===================================================================
--- app/interface.h (revision 3710)
+++ app/interface.h (working copy)
@@ -53,12 +53,10 @@
void integrated_ui_main_statusbar_show (void);
void integrated_ui_main_statusbar_hide (void);
-/*
-void synchronize_ui_to_active_display (DDisplay *ddisp);
-*/
-
int is_integrated_ui (void);
+void integrated_ui_show_diagram_modified_status (DDisplay *ddisp);
+
void create_display_shell(DDisplay *ddisp,
int width, int height,
char *title, int use_mbar, int top_level_window);
_______________________________________________
Dia-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia