Exemple #1
0
/** We might just have change the diagrams modified status.
 * This doesn't set the status, but merely updates the display.
 */
void
diagram_modified(Diagram *dia)
{
  GSList *displays;
  gchar *dia_name = diagram_get_name(dia);
  gchar *extra = g_path_get_dirname (dia->filename); 
  gchar *title = g_strdup_printf ("%s%s (%s)", diagram_is_modified(dia) ? "*" : "", dia_name, extra ? extra : " ");

  g_free (dia_name);
  g_free (extra);
  displays = dia->displays;
  while (displays!=NULL) {
    DDisplay *ddisp = (DDisplay *) displays->data;

    ddisplay_set_title(ddisp, title);
    
    displays = g_slist_next(displays);
  }
  if (diagram_is_modified(dia)) {
    dia->autosaved = FALSE;
    dia->is_default = FALSE;
  }
  /*  diagram_set_modified(dia, TRUE);*/
  g_free (title);
}
Exemple #2
0
/** Update the various areas that require updating when changing filename
 * This will ensure that all places that use the filename are updated:
 * Window titles, layer dialog, recent files, diagram tree.
 * @param dia The diagram whose filename has changed.
 */
static void
diagram_update_for_filename(Diagram *dia)
{
  GSList *l;
  DDisplay *ddisp;
  char *title;

  title = diagram_get_name(dia);

  l = dia->displays;
  while (l!=NULL) {
    ddisp = (DDisplay *) l->data;

    ddisplay_set_title(ddisp, title);
    
    l = g_slist_next(l);
  }

  g_free(title);

  layer_dialog_update_diagram_list();

  /* signal about the change */
  dia_diagram_change (dia, DIAGRAM_CHANGE_NAME, NULL);
}
Exemple #3
0
static PyObject *
PyDiaDisplay_SetTitle(PyDiaDisplay *self, PyObject *args)
{
    gchar *title;

    if (!PyArg_ParseTuple(args, "s:Display.set_title", &title))
	return NULL;
    ddisplay_set_title(self->disp, title);
    Py_INCREF(Py_None);
    return Py_None;
}