Exemplo n.º 1
0
/*-------------------------------------------------------------------------*/
void qmonQueuePopup(Widget w, XtPointer cld, XtPointer cad)
{
   lList *alp = NULL;
   
   DENTER(GUI_LAYER, "qmonQueuePopup");

   /* set busy cursor */
   XmtDisplayBusyCursor(w);

   qmonMirrorMultiAnswer(CQUEUE_T | EXECHOST_T | CENTRY_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      /* set busy cursor */
      XmtDisplayDefaultCursor(w);
      DEXIT;
      return;
   }

   if (!qmon_queue) {

      qmonCreateQueueControl(AppShell);

      /*
      ** create queue customize dialog
      */
/*       qmonCreateQCU(qmon_queue, NULL); */

      /* 
      ** set the close button callback 
      ** set the icon and icon name
      */
      XmtCreatePixmapIcon(qmon_queue, qmonGetIcon("toolbar_queue"), None); 
      XtVaSetValues(qmon_queue, XtNiconName, "qmon:Queue Control", NULL);
      XmtAddDeleteCallback(qmon_queue, XmDO_NOTHING, qmonQueuePopdown,  NULL);
      XtAddEventHandler(qmon_queue, StructureNotifyMask, False, 
                        SetMinShellSize, NULL);
      XtAddEventHandler(qmon_queue, StructureNotifyMask, False, 
                        SetMaxShellSize, (XtPointer) SHELL_WIDTH);
      
   }

   xmui_manage(qmon_queue);
/*    ForceUpdate(qmon_queue); */

   updateQueueList();

#if 0
   /*
   ** workaround for display problem of DrawingArea under some WMs
   */
   XtUnmapWidget(queue_da);
   XtMapWidget(queue_da);
#endif   

   /* set busy cursor */
   XmtDisplayDefaultCursor(w);

   DEXIT;
}
Exemplo n.º 2
0
/*-------------------------------------------------------------------------*/
static void qmonLoadNamesSC(
Widget w,
XtPointer cld,
XtPointer cad  
) {
   lList *cl = NULL;
   lList *ehl = NULL;
   lList *entries = NULL;
   lListElem *hep = NULL;
   static lCondition *where = NULL;
   lList *alp = NULL;

   DENTER(GUI_LAYER, "qmonLoadNamesSC");

   qmonMirrorMultiAnswer(CENTRY_T | EXECHOST_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      DEXIT;
      return;
   }
   cl = qmonMirrorList(SGE_CE_LIST);
   ehl = qmonMirrorList(SGE_EH_LIST);

   for_each (hep, ehl) {
      lList *temp_entries = NULL;
      host_complexes2scheduler(&temp_entries, hep, ehl, cl);  
      if (entries == NULL) {
         entries = temp_entries;
      }
      else {
         lAddList(entries, &temp_entries);
      }
   }
Exemplo n.º 3
0
/*-------------------------------------------------------------------------*/
static void qmonSchedOk(Widget w, XtPointer cld, XtPointer cad)
{
   lList *scl = NULL;
   lListElem *sep = NULL;
   lEnumeration *what = NULL;
   lList *alp = NULL;
   Boolean status = False;

   DENTER(GUI_LAYER, "qmonSchedOk");

   /*
   ** get the contents of the dialog fields here,
   ** build the cull list and send gdi request
   */
   qmonMirrorMultiAnswer(SC_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      DEXIT;
      return;
   }


   scl = qmonMirrorList(SGE_SC_LIST);
   sep = lFirst(scl); 


   if (qmonSchedGet(sep)) {

      if (rmon_mlgetl(&RMON_DEBUG_ON, GUI_LAYER) & INFOPRINT) {
         printf("___SCHEDULER_CONF________________________\n");
         lWriteListTo(scl, stdout);
         printf("_______________________________________\n");
      }
      /*
      ** gdi call 
      */
      what = lWhat("%T(ALL)", SC_Type);

      alp = qmonModList(SGE_SC_LIST, qmonMirrorListRef(SGE_SC_LIST),
                           0, &scl, NULL, what);

      
      if (lFirst(alp) && lGetUlong(lFirst(alp), AN_status) == STATUS_OK)
         status = True;

      qmonMessageBox(qmon_sconf, alp, 0);

      lFreeWhat(&what);
      lFreeList(&alp);
   }

   if (status)
      XtUnmanageChild(qmon_sconf);

   DEXIT;
}
Exemplo n.º 4
0
/*-------------------------------------------------------------------------*/
void qmonPopupManopConfig(Widget w, XtPointer cld, XtPointer cad)
{
   Widget shell;
   lList *alp = NULL;
   
   DENTER(GUI_LAYER, "qmonPopupManopConfig");

   /* set busy cursor */
   XmtDisplayBusyCursor(w);

   /*
   ** create the dialog, if it doesn't exist
   */
   if (!qmon_manop) {
      shell = XmtGetTopLevelShell(w);
      qmon_manop = qmonCreateManopConfig(shell);
      XmtAddDeleteCallback(shell, XmDO_NOTHING, 
                              qmonPopdownManopConfig, NULL);
      XtAddEventHandler(XtParent(qmon_manop), StructureNotifyMask, False, 
                        SetMinShellSize, NULL);
      XtAddEventHandler(XtParent(qmon_manop), StructureNotifyMask, False, 
                        SetMaxShellSize, NULL);
   } 
   
   qmonMirrorMultiAnswer(MANAGER_T | OPERATOR_T | USERSET_T | USER_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      /* set default cursor */
      XmtDisplayDefaultCursor(w);
      DEXIT;
      return;
   }
   qmonTimerAddUpdateProc(USERSET_T, "updateUsersetList", updateUsersetList);
   qmonStartTimer(MANAGER_T | OPERATOR_T | USERSET_T | USER_T);
   qmonManopFillList();

   xmui_manage(qmon_manop);

   /*
   ** switch to userset
   */
   if (cld) {
      XmTabSetTabWidget(manop_folder, userset_layout, True);
   }

   /* set default cursor */
   XmtDisplayDefaultCursor(w);

   DEXIT;
}
Exemplo n.º 5
0
/*-------------------------------------------------------------------------*/
void qmonRQSPopup(Widget w, XtPointer cld, XtPointer cad) 
{
   Widget shell, rqs_okay, rqs_cancel;
   lList *alp = NULL;
   lList *rqs_list = NULL;

   DENTER(GUI_LAYER, "qmonRQSPopup");

   /* set busy cursor */
   XmtDisplayBusyCursor(w);

   if (!qmon_rqs) {
      shell = XmtGetTopLevelShell(w);
      qmon_rqs = XmtBuildQueryDialog(shell, "rqs_shell", 
                              NULL, 0,
                              "rqs_text", &rqs_text,
                              "rqs_okay", &rqs_okay,
                              "rqs_cancel", &rqs_cancel,
                              NULL);
      XtAddCallback(rqs_okay, XmNactivateCallback,
                     qmonRQSOkay, NULL); 
      XtAddCallback(rqs_cancel, XmNactivateCallback, 
                     qmonRQSCancel, NULL);
   }


   qmonMirrorMultiAnswer(RQS_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      /* set normal cursor */
      XmtDisplayDefaultCursor(w);
      DEXIT;
      return;
   }

   rqs_list = qmonMirrorList(SGE_RQS_LIST);

   xmui_manage(qmon_rqs);

   qmonRQSSetText(rqs_text, rqs_list, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
   }

   /* set default cursor */
   XmtDisplayDefaultCursor(w);

   DEXIT;
}
Exemplo n.º 6
0
/*-------------------------------------------------------------------------*/
void updateQueueListCB(Widget w, XtPointer cld, XtPointer cad)
{

   lList *alp = NULL;

   if (qmon_queue) {
      qmonMirrorMultiAnswer(CQUEUE_T | EXECHOST_T | CENTRY_T, &alp);
      if (alp) {
         qmonMessageBox(w, alp, 0);
         lFreeList(&alp);
         return;
      }
      updateQueueList();
   }
}
Exemplo n.º 7
0
/*-------------------------------------------------------------------------*/
void qmonPopupCkptConfig(Widget w, XtPointer cld, XtPointer cad)
{
    Widget shell;
    lList *alp = NULL;

    DENTER(GUI_LAYER, "qmonPopupCkptConfig");

    /* set busy cursor */
    XmtDisplayBusyCursor(w);

    if (!qmon_ckpt) {
        shell = XmtGetTopLevelShell(w);
        qmon_ckpt = qmonCreateCkptConfig(shell);
        XmtAddDeleteCallback(shell, XmDO_NOTHING,
                             qmonPopdownCkptConfig, NULL);
        /*
        ** create ask layout
        */
        ckpt_ask_layout = qmonCreateCkptAsk(qmon_ckpt);

    }
    XSync(XtDisplay(qmon_ckpt), 0);
    XmUpdateDisplay(qmon_ckpt);

    qmonMirrorMultiAnswer(CKPT_T, &alp);
    if (alp) {
        qmonMessageBox(w, alp, 0);
        lFreeList(&alp);
        /* set default cursor */
        XmtDisplayDefaultCursor(w);
        DEXIT;
        return;
    }


    qmonTimerAddUpdateProc(CKPT_T, "updateCkptList", updateCkptList);
    qmonStartTimer(CKPT_T);
    updateCkptList();
    XmListSelectPos(ckpt_names, 1, True);

    XtManageChild(qmon_ckpt);
    XRaiseWindow(XtDisplay(XtParent(qmon_ckpt)), XtWindow(XtParent(qmon_ckpt)));

    /* set default cursor */
    XmtDisplayDefaultCursor(w);

    DEXIT;
}
Exemplo n.º 8
0
/*-------------------------------------------------------------------------*/
void qmonPopupSchedConfig(Widget w, XtPointer cld, XtPointer cad)
{
   Widget shell;
   lList *scl = NULL;
   lListElem *sep = NULL;
   lList *alp = NULL;

   DENTER(TOP_LAYER, "qmonPopupSchedConfig");

   /* set busy cursor */
   XmtDisplayBusyCursor(w);

   if (!qmon_sconf) {
      shell = XmtGetTopLevelShell(w);
      qmon_sconf = qmonCreateSchedConfig(shell);
      XmtAddDeleteCallback(shell, XmDO_NOTHING, 
                              qmonSchedCancel, NULL);
   } 
   qmonMirrorMultiAnswer(SC_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      /* set default cursor */
      XmtDisplayDefaultCursor(w);
      DEXIT;
      return;
   }

   scl = qmonMirrorList(SGE_SC_LIST);
   sep = lFirst(scl);
   qmonSchedSet(sep);
   XSync(XtDisplay(qmon_sconf), 0);
   XmUpdateDisplay(qmon_sconf);

   XtManageChild(qmon_sconf);
   XRaiseWindow(XtDisplay(XtParent(qmon_sconf)), 
                  XtWindow(XtParent(qmon_sconf)));

   /* set default cursor */
   XmtDisplayDefaultCursor(w);

   DEXIT;
}
Exemplo n.º 9
0
/*-------------------------------------------------------------------------*/
static void qmonManopFolderChange(Widget w, XtPointer cld, XtPointer cad)
{
   lList *alp = NULL;
   XmTabCallbackStruct *cbs = (XmTabCallbackStruct *) cad;

   DENTER(GUI_LAYER, "qmonManopFolderChange");
   
   DPRINTF(("%s\n", XtName(cbs->tab_child)));

   if (!strcmp(XtName(cbs->tab_child), "manager_layout"))
      dialog_mode = SGE_UM_LIST;

   if (!strcmp(XtName(cbs->tab_child), "operator_layout"))
      dialog_mode = SGE_UO_LIST;

   if (!strcmp(XtName(cbs->tab_child), "user_layout"))
      dialog_mode = SGE_UU_LIST;

   if (!strcmp(XtName(cbs->tab_child), "userset_layout"))
      dialog_mode = SGE_US_LIST;

   /*
   ** fetch changed lists and update dialogues
   */
   qmonMirrorMultiAnswer(MANAGER_T | OPERATOR_T | USERSET_T | USER_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      DEXIT;
      return;
   }
   updateManopList();

   /*
   ** set Modify button sensitivity
   */
   if (dialog_mode==SGE_US_LIST) {
      XtSetSensitive(manop_modify, True);
   } else {
      XtSetSensitive(manop_modify, False);
   }   
   DEXIT;
}
Exemplo n.º 10
0
/*-------------------------------------------------------------------------*/
static void qmonUserAskForProject(Widget w, XtPointer cld, XtPointer cad)
{
   XbaeMatrixLabelActivateCallbackStruct *cbs = 
                            (XbaeMatrixLabelActivateCallbackStruct *) cad;
   Boolean status = False;
   lList *pl = NULL;
   lListElem *cep = NULL;
   int n, i;
   StringConst *strs = NULL;
   static char buf[BUFSIZ];
   lList *lp = NULL;
   lList *alp = NULL;
   lListElem *ep;
   static lEnumeration *what = NULL;
   
   DENTER(GUI_LAYER, "qmonUserAskForProject");

   if (!what) {
      what = lWhat("%T(%I %I)", UU_Type, UU_name, UU_default_project);
   }

   if (cbs->column != 1) {
        DEXIT;
        return;
   }
   
   qmonMirrorMultiAnswer(PROJECT_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      DEXIT;
      return;
   }
   pl = qmonMirrorList(SGE_PR_LIST);
   lPSortList(pl, "%I+", PR_name);
   n = lGetNumberOfElem(pl);
   if (n>0) {
      strs = (StringConst*)XtMalloc(sizeof(String)*(n+1)); 
      strs[0] = "NONE";
      for (cep=lFirst(pl), i=0; i<n; cep=lNext(cep), i++) {
        /*
        ** we get only references don't free, the strings
        */
        strs[i+1] = lGetString(cep, PR_name);
      }
    
      strcpy(buf, "");
      /* FIX_CONST_GUI */
      status = XmtAskForItem(w, NULL, "@{Select a project}",
                        "@{Available projects}", (String*)strs, n+1,
                        False, buf, BUFSIZ, NULL); 
      
      if (status) {
         int rows, i;
         rows = XbaeMatrixNumRows(user_matrix);
         for (i=0; i<rows; i++) {
            String s = XbaeMatrixGetCell(user_matrix, i, 0);
            if (XbaeMatrixIsRowSelected(user_matrix, i) && s &&
                    strcmp(s, "")) {
               ep = lAddElemStr(&lp, UU_name, s, UU_Type); 
               lSetString(ep, UU_default_project, buf);
            }
         } 
         XbaeMatrixDeselectAll(user_matrix);

         /*
         ** send to master as modify request
         */
         for_each (ep, lp) {
            if (ep && lGetString(ep, UU_default_project) && 
                !strcasecmp(lGetString(ep, UU_default_project), "NONE")) 
               lSetString(ep, UU_default_project, NULL);
         }
         if (lp) {
             alp = qmonModList(SGE_UU_LIST, 
                               qmonMirrorListRef(SGE_UU_LIST),
                               UU_name, &lp, NULL, what);
             qmonMessageBox(w, alp, 0);
             updateManopList();

             lFreeList(&alp);
             lFreeList(&lp);
         }
      }
      /*
      ** don't free referenced strings, they are in the pl list
      */
      XtFree((char*)strs);
   }
Exemplo n.º 11
0
/*-------------------------------------------------------------------------*/
void qmonRequestPopup(Widget w, XtPointer cld, XtPointer cad)
{
   Widget request_hardsoft, parent, request_clear, request_okay,
         request_cancel; 
   lList *hrl = NULL;
   lList *srl = NULL;
   lList *rll = NULL;
   lListElem *ep = NULL;
   lListElem *rp = NULL;
   lList *alp = NULL;
   
   DENTER(GUI_LAYER, "qmonRequestPopup");

   parent = XmtGetShell(w);
   DPRINTF(("parent = %s\n", XtName(parent) ));
   
   if (!request_dialog) {
      request_dialog = XmtBuildQueryDialog(parent, "request_shell", 
                              NULL, 0,
                              "request_rtype", &request_rtype,
                              "request_rr", &request_rr,
                              "request_hr", &request_hr,
                              "request_sr", &request_sr,
                              "request_hardsoft", &request_hardsoft,
                              "request_clear", &request_clear,
                              "request_okay", &request_okay,
                              "request_cancel", &request_cancel,
                              NULL);
      XtAddCallback(request_rr, XmNactivateCallback,
                     qmonRequestEditResource, (XtPointer)0); 
      XtAddCallback(request_hr, XmNactivateCallback, 
                     qmonRequestEditResource, (XtPointer)1);
      XtAddCallback(request_hr, XmNremoveCallback, 
                     qmonRequestRemoveResource, NULL);
      XtAddCallback(request_sr, XmNactivateCallback, 
                     qmonRequestEditResource, (XtPointer)1);
      XtAddCallback(request_sr, XmNremoveCallback, 
                     qmonRequestRemoveResource, NULL);

      XtAddCallback(request_hardsoft, XmtNvalueChangedCallback,
                     qmonToggleHardSoft2, NULL);
      XtAddCallback(request_clear, XmNactivateCallback, 
                     qmonRequestClear, NULL);
      XtAddCallback(request_okay, XmNactivateCallback, 
                     qmonRequestOkay, NULL);
      XtAddCallback(request_cancel, XmNactivateCallback, 
                     qmonRequestCancel, NULL);

      XtAddEventHandler(XtParent(request_dialog), StructureNotifyMask, False, 
                        SetMinShellSize, NULL);
      
   }

   /*
   ** set the type labelString
   */
   XtVaSetValues(request_rtype, XmtNlabel, qmonSubmitRequestType(), NULL);

   qmonMirrorMultiAnswer(CENTRY_T, &alp);
   if (alp) {
      qmonMessageBox(w, alp, 0);
      lFreeList(&alp);
      /* set normal cursor */
      XmtDisplayDefaultCursor(w);
      DEXIT;
      return;
   }
   rll = qmonGetResources(qmonMirrorList(SGE_CE_LIST), 
                                       REQUESTABLE_RESOURCES);

   hrl = qmonSubmitHR();
   lFreeList(&hard_requests);
   if (hrl) {
      hard_requests = lCopyList("hr", hrl);
      for_each(ep, hard_requests) {
         rp = lGetElemStr(rll, CE_name, lGetString(ep, CE_name));
         if (!rp)
            rp = lGetElemStr(rll, CE_shortcut, lGetString(ep, CE_name));
         if (rp) {
            lSetString(ep, CE_name, lGetString(rp, CE_name));
            lSetString(ep, CE_default, NULL);
            lSetUlong(ep, CE_valtype, lGetUlong(rp, CE_valtype)); 
         }
      }
   }