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

« back to all changes in this revision

Viewing changes to tools/browser/auth-dialog.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:
168
168
                        
169
169
                        g_strfreev (array);
170
170
                }
 
171
                gdaui_basic_form_entry_grab_focus (GDAUI_BASIC_FORM (ad->auth_widget), NULL);
171
172
        }
172
173
}
173
174
 
316
317
        return cnc;
317
318
#else
318
319
        sleep (5);
319
 
        g_set_error (error, 0, 0, "Oooo");
 
320
        g_set_error (error, 0, 0, "%s", "Oooo");
320
321
        return NULL;
321
322
#endif
322
323
}
382
383
        gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
383
384
}
384
385
 
 
386
static void
 
387
auth_contents_changed_cb (GdauiBasicForm *form, GdaHolder *h, gboolean is_user_modif, AuthDialog *dialog)
 
388
{
 
389
        GSList *list;
 
390
        for (list = dialog->priv->auth_list; list; list = list->next) {
 
391
                AuthData *ad = (AuthData*) list->data;
 
392
                if (! gdaui_basic_form_is_valid (GDAUI_BASIC_FORM (ad->auth_widget)))
 
393
                        break;
 
394
        }
 
395
 
 
396
        gboolean is_valid;
 
397
        is_valid = list ? FALSE : TRUE;
 
398
        gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, is_valid);
 
399
        if (is_valid)
 
400
                gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
 
401
}
 
402
 
385
403
/**
386
404
 * auth_dialog_add_cnc_string
387
405
 */
434
452
        AuthData *ad;
435
453
        ad = g_new0 (AuthData, 1);
436
454
        ad->wrapper = gda_thread_wrapper_new ();
437
 
        /*g_print ("Login dialog: new thread wrapper %p\n", ad->wrapper);*/
 
455
        /*g_print ("Auth dialog: new thread wrapper %p\n", ad->wrapper);*/
438
456
        ad->ext.cnc_string = g_strdup (cnc_string);
439
457
        ad->auth_string = NULL;
440
458
        info = gda_config_get_dsn_info (real_cnc);
504
522
                ad->auth_widget = gdaui_basic_form_new (set);
505
523
                g_signal_connect (G_OBJECT (ad->auth_widget), "activated",
506
524
                                  G_CALLBACK (auth_form_activated_cb), dialog);
 
525
                g_signal_connect (G_OBJECT (ad->auth_widget), "holder-changed",
 
526
                                  G_CALLBACK (auth_contents_changed_cb), dialog);
507
527
                g_object_unref (set);
508
528
 
509
529
                /* add widget */
706
726
        }
707
727
 
708
728
 out:
709
 
        gtk_widget_hide (GTK_WIDGET (dialog));
710
729
        return allopened;
711
730
}
712
731