default: GUI_Alert("Unknown event");break;
default: printf("Event:%d\n",event); GUI_Alert("Unknown event");break;
uint8_t  DIA_job(uint32_t nb, char **name){GtkListStore *store;GtkTreeViewColumn *column,*column2;GtkCellRenderer *renderer;        int ret=0;                GtkWidget *dialog;        dialog=create_dialog1();        gtk_register_dialog(dialog);                store=gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);                // initialize our job structure        jobs.dialog=dialog;        jobs.nb=nb;        jobs.name=name;        jobs.status=new JOB_STATUS[nb];        jobs.store=store;        memset(jobs.status,0,jobs.nb*sizeof(JOB_STATUS));        gtk_tree_view_set_model(GTK_TREE_VIEW(WID(treeview1)),GTK_TREE_MODEL (store));        gtk_tree_view_columns_autosize(GTK_TREE_VIEW(WID(treeview1)));        // Add columns        renderer = gtk_cell_renderer_text_new ();        column = gtk_tree_view_column_new_with_attributes ("Name", renderer,                                                      "markup", (GdkModifierType) 0,                                                      NULL);        gtk_tree_view_append_column (GTK_TREE_VIEW (WID(treeview1)), column);#if 0        column2 = gtk_tree_view_column_new_with_attributes ("Status", renderer,                                                      "markup", (GdkModifierType) 1,                                                      NULL);        gtk_tree_view_append_column (GTK_TREE_VIEW (WID(treeview1)), column2);#endif        //        #define ASSOCIATE(x,y)   gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(x),y)            ASSOCIATE(buttonDelete,COMMAND_DELETE);            ASSOCIATE(buttonDeleteAll,COMMAND_DELETE_ALL);            ASSOCIATE(buttonRunAll,COMMAND_RUN_ALL);            ASSOCIATE(buttonRun,COMMAND_RUN);        //                 int running=1;        while(running)        {                int sel=0;                updateStatus();                switch(gtk_dialog_run(GTK_DIALOG(dialog)))                {                        case GTK_RESPONSE_OK : running=0;break;                        case GTK_RESPONSE_APPLY : running=0;break;                        case GTK_RESPONSE_CANCEL : running=0;break;                        case COMMAND_DELETE_ALL:                                        if(GUI_Confirmation_HIG("Sure!","Delete ALL jobs","Are you sure you want to delete all jobs ?"))                                        {                                                for(int i=0;i<jobs.nb;i++) jobs.status[i]=STATUS_DELETED;                                        }                                        break;                        case COMMAND_RUN:                                         sel=getSelection(jobs.dialog);                                        if(sel>=jobs.nb) break;                                        jobs.status[sel]=STATUS_RUNNING;                                        updateStatus();                                        GUI_Quiet();                                          if(parseECMAScript(jobs.name[sel])) jobs.status[sel]=STATUS_SUCCEED;                                                        else jobs.status[sel]=STATUS_FAILED;                                        GUI_Verbose();                                        break;                        case COMMAND_RUN_ALL:                                         GUI_Quiet();                                        for(int i=0;i<jobs.nb;i++)                                        {                                                if(jobs.status[i]==STATUS_DELETED) continue;                                                if(jobs.status[i]==STATUS_SUCCEED) continue;                                                jobs.status[i]=STATUS_RUNNING;                                                updateStatus();                                                if(parseECMAScript(jobs.name[i])) jobs.status[i]=STATUS_SUCCEED;                                                        else jobs.status[i]=STATUS_FAILED;                                        }                                        GUI_Verbose();                                        break;                        case COMMAND_DELETE:                                         sel=getSelection(jobs.dialog);                                        if(sel>=jobs.nb) break;                                        if(GUI_Confirmation_HIG("Sure!","Delete job","Are you sure you want to delete %s job ?",GetFileName(jobs.name[sel])))                                        {                                                jobs.status[sel]=STATUS_DELETED;                                        }                                        break;                                                default: GUI_Alert("Unknown event");break;                }                        }        gtk_unregister_dialog(dialog);        gtk_widget_destroy(dialog);        // Now delete the "deleted" jobs        for(int i=0;i<jobs.nb;i++)        {                if(jobs.status[i]==STATUS_DELETED)                {                        unlink(jobs.name[i]);                }        }        delete [] jobs.status;        return ret;}