if ((ele = isExist(&head, This->type))) { if (ele->pinst && ele->pinst->dialogBox) { GtkWidget *top_window = gtk_widget_get_toplevel(ele->pinst->dialogBox); if (top_window && GTK_WIDGET_VISIBLE(top_window)) {    gdk_window_show(top_window->window); } } return; }
if (This->exists == TRUE) return;
makeWidget(PluginInstance *This){    GtkWidget *dialogWindow;    GtkWidget *dialogMessage;    GtkWidget *okButton;    GtkWidget *cancelButton;    char message[1024];    MimeTypeElement *ele;    if (!This) return;    /* need to check whether we already pop up a dialog box for previous       minetype in the same web page. It's require otherwise there will       be 2 dialog boxes pop if there are 2 plugin in the same web page    */    if ((ele = isExist(&head, This->type)))    {        if (ele->pinst && ele->pinst->dialogBox)        {            GtkWidget *top_window = gtk_widget_get_toplevel(ele->pinst->dialogBox);            if (top_window && GTK_WIDGET_VISIBLE(top_window))            {   /* this will raise the toplevel window */                gdk_window_show(top_window->window);            }        }        return;    }    dialogWindow = gtk_dialog_new();    This->dialogBox = dialogWindow;    This->exists = TRUE;    This->dialogBox = dialogWindow;    addToList(&head, This);    gtk_window_set_title(GTK_WINDOW(dialogWindow), PLUGIN_NAME);    gtk_window_set_position(GTK_WINDOW(dialogWindow), GTK_WIN_POS_CENTER);    gtk_window_set_modal(GTK_WINDOW(dialogWindow), FALSE);    gtk_container_set_border_width(GTK_CONTAINER(dialogWindow), 20);    gtk_window_set_policy(GTK_WINDOW(dialogWindow), FALSE, FALSE, TRUE);    PR_snprintf(message, sizeof(message) - 1, MESSAGE, This->type);    dialogMessage = AddWidget(gtk_label_new (message),                    GTK_DIALOG(dialogWindow)->vbox);    okButton= AddWidget(gtk_button_new_with_label (OK_BUTTON),                    GTK_DIALOG(dialogWindow)->action_area);    gtk_object_set_data(GTK_OBJECT(okButton), DIALOGID, dialogWindow);    cancelButton= AddWidget(gtk_button_new_with_label (CANCEL_BUTTON),                    GTK_DIALOG(dialogWindow)->action_area);    gtk_signal_connect (GTK_OBJECT(okButton),  "clicked",                        GTK_SIGNAL_FUNC(DialogOKClicked), This);    gtk_signal_connect (GTK_OBJECT(cancelButton),  "clicked",                        GTK_SIGNAL_FUNC(DialogCancelClicked), This);    /* hookup to when the dialog is destroyed */    gtk_signal_connect(GTK_OBJECT(dialogWindow), "destroy",                        GTK_SIGNAL_FUNC(onDestroyWidget), This);    gtk_widget_show_all(dialogWindow);}