~ubuntu-branches/ubuntu/utopic/libgda5/utopic

« back to all changes in this revision

Viewing changes to tools/browser/schema-browser/relations-diagram.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-02-10 13:43:47 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120210134347-pnhy092ghuopf2gm
Tags: 5.0.3-1
* New upstream release.
* Add symbols file for libgda-5.0-4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
        str = browser_canvas_serialize_items (BROWSER_CANVAS (diagram->priv->canvas));
219
219
 
220
220
        GError *lerror = NULL;
221
 
        BrowserFavorites *bfav;
222
 
        BrowserFavoritesAttributes fav;
 
221
        ToolsFavorites *bfav;
 
222
        ToolsFavoritesAttributes fav;
223
223
 
224
 
        memset (&fav, 0, sizeof (BrowserFavoritesAttributes));
 
224
        memset (&fav, 0, sizeof (ToolsFavoritesAttributes));
225
225
        fav.id = diagram->priv->fav_id;
226
 
        fav.type = BROWSER_FAVORITES_DIAGRAMS;
 
226
        fav.type = TOOLS_FAVORITES_DIAGRAMS;
227
227
        fav.name = gtk_editable_get_chars (GTK_EDITABLE (diagram->priv->name_entry), 0, -1);
228
228
        if (!*fav.name) {
229
229
                g_free (fav.name);
234
234
        gtk_widget_hide (diagram->priv->popup_container);
235
235
        
236
236
        bfav = browser_connection_get_favorites (diagram->priv->bcnc);
237
 
        if (! browser_favorites_add (bfav, 0, &fav, ORDER_KEY_SCHEMA, G_MAXINT, &lerror)) {
 
237
        if (! tools_favorites_add (bfav, 0, &fav, ORDER_KEY_SCHEMA, G_MAXINT, &lerror)) {
238
238
                browser_show_error ((GtkWindow*) gtk_widget_get_toplevel (button),
239
239
                                    "<b>%s:</b>\n%s",
240
240
                                    _("Could not save diagram"),
272
272
                gtk_box_pack_start (GTK_BOX (hbox), wid, FALSE, FALSE, 5);
273
273
                diagram->priv->name_entry = wid;
274
274
                if (diagram->priv->fav_id > 0) {
275
 
                        BrowserFavoritesAttributes fav;
276
 
                        if (browser_favorites_get (browser_connection_get_favorites (diagram->priv->bcnc),
 
275
                        ToolsFavoritesAttributes fav;
 
276
                        if (tools_favorites_get (browser_connection_get_favorites (diagram->priv->bcnc),
277
277
                                                   diagram->priv->fav_id, &fav, NULL)) {
278
278
                                gtk_entry_set_text (GTK_ENTRY (wid), fav.name);
279
 
                                browser_favorites_reset_attributes (&fav);
 
279
                                tools_favorites_reset_attributes (&fav);
280
280
                        }
281
281
                }
282
282
 
360
360
relations_diagram_new_with_fav_id (BrowserConnection *bcnc, gint fav_id, GError **error)
361
361
{
362
362
        RelationsDiagram *diagram = NULL;
363
 
        BrowserFavoritesAttributes fav;
 
363
        ToolsFavoritesAttributes fav;
364
364
        xmlDocPtr doc = NULL;
365
365
 
366
 
        if (! browser_favorites_get (browser_connection_get_favorites (bcnc),
 
366
        if (! tools_favorites_get (browser_connection_get_favorites (bcnc),
367
367
                                     fav_id, &fav, error))
368
368
                return FALSE;
369
369
 
371
371
        doc = xmlParseDoc (BAD_CAST fav.contents);
372
372
        if (!doc) {
373
373
                g_set_error (error, 0, 0,
374
 
                             _("Error parsing favorite's contents"));
 
374
                             "%s", _("Error parsing favorite's contents"));
375
375
                goto out;
376
376
        }
377
377
 
430
430
                                if (name)
431
431
                                        xmlFree (name);
432
432
                                g_set_error (error, 0, 0,
433
 
                                             _("Missing table attribute in favorite's contents"));
 
433
                                             "%s", _("Missing table attribute in favorite's contents"));
434
434
                                gtk_widget_destroy ((GtkWidget*) diagram);
435
435
                                diagram = NULL;
436
436
                                goto out;
439
439
        }
440
440
 
441
441
 out:
442
 
        browser_favorites_reset_attributes (&fav);
 
442
        tools_favorites_reset_attributes (&fav);
443
443
        if (doc)
444
444
                xmlFreeDoc (doc);
445
445
        return (GtkWidget*) diagram;
454
454
relations_diagram_set_fav_id (RelationsDiagram *diagram, gint fav_id, GError **error)
455
455
{
456
456
        g_return_if_fail (IS_RELATIONS_DIAGRAM (diagram));
457
 
        BrowserFavoritesAttributes fav;
 
457
        ToolsFavoritesAttributes fav;
458
458
 
459
459
        if ((fav_id >=0) &&
460
 
            browser_favorites_get (browser_connection_get_favorites (diagram->priv->bcnc),
 
460
            tools_favorites_get (browser_connection_get_favorites (diagram->priv->bcnc),
461
461
                                   fav_id, &fav, error)) {
462
462
                gchar *str, *tmp;
463
463
                tmp = g_markup_printf_escaped (_("'%s' diagram"), fav.name);
468
468
                
469
469
                diagram->priv->fav_id = fav.id;
470
470
                
471
 
                browser_favorites_reset_attributes (&fav);
 
471
                tools_favorites_reset_attributes (&fav);
472
472
        }
473
473
        else {
474
474
                gchar *str;
557
557
 
558
558
        diagram = RELATIONS_DIAGRAM (page);
559
559
        if (diagram->priv->fav_id > 0) {
560
 
                BrowserFavoritesAttributes fav;
561
 
                if (browser_favorites_get (browser_connection_get_favorites (diagram->priv->bcnc),
 
560
                ToolsFavoritesAttributes fav;
 
561
                if (tools_favorites_get (browser_connection_get_favorites (diagram->priv->bcnc),
562
562
                                           diagram->priv->fav_id, &fav, NULL)) {
563
563
                        tab_name = g_strdup (fav.name);
564
 
                        browser_favorites_reset_attributes (&fav);
 
564
                        tools_favorites_reset_attributes (&fav);
565
565
                }
566
566
        }
567
567
        if (!tab_name)