home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / XAP / XFILEMAN / XFILEMAN.TAR / xfilemanager / action_newdir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-22  |  2.7 KB  |  112 lines

  1. /*
  2.  * Copyright 1993 by Ove Kalkan, Cremlingen, Germany
  3.  *
  4.  * Permission to use, copy, modify, distribute and sell this software and it's
  5.  * documentation for any purpose is hereby granted without fee, rpovided that
  6.  * the above copyright notice and this permission appear in supporting
  7.  * documentation, and that the name of Ove Kalkan not to be used in
  8.  * advertising or publicity pertaining to distributiopn of the software without
  9.  * specific, written prior permission. Ove Kalkan makes no representations
  10.  * about the suitability of this software for any purpose. It is provided
  11.  * as is without express or implied warranty.
  12.  *
  13.  * OVE KALKAN DISPLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  14.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABLILITY AND FITNESS, IN NO
  15.  * EVENT SHALL OVE KALKAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  16.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  17.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18.  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19.  * PERFORMANCE OF THIS SOFTWARE.
  20.  *
  21.  * $Header: filename,v 1.0 yyyy/mm/dd hh:mm:ss loginname Exp $
  22.  */
  23.  
  24.  
  25. #include "global.h"
  26.  
  27. /*
  28.  * Global variables
  29.  */
  30.  
  31.  
  32. /*********************************************************
  33.  * name:    init_newdir
  34.  * description:    erzeugt ein Fenster mit 1 text zum Erstellen
  35.  *        neuer Directories
  36.  * input:    char *file
  37.  * output:    none
  38.  * date:    10.5.93
  39.  *********************************************************/
  40. void    init_newdir (char *file)
  41. {
  42.     Widget    but;
  43.  
  44.     /*
  45.      * Das Dialogfenster erzeugen
  46.      */
  47.     but = makeDialog(1,"Name :","",file,NULL,"Creating new Directories",TRUE,FALSE,Icon_Newdir_PM);
  48.  
  49.     XtAddCallback(but,XtNcallback,(XtCallbackProc) exec_newdir,NULL);
  50.  
  51.     /*
  52.      * Zum Schluss die Dialogshell managen
  53.      */
  54.     XtManageChild (dialog);
  55.  
  56.     /*
  57.      * Max und Minsize setzen
  58.      */
  59.     setSize();
  60. }
  61.  
  62. /*********************************************************
  63.  * name:    exec_newdir
  64.  * description:    neues Directory erzeugen
  65.  * input:    none
  66.  * output:    none
  67.  * date:    14.6.93
  68.  *********************************************************/
  69. void    exec_newdir (void)
  70. {
  71.     char    *from;
  72.     Arg    args[1];
  73.     char    buf[1024];
  74.  
  75.     /*
  76.      * Die Texte der beiden Textfelder holen
  77.      */
  78.     XtSetArg(args[0],XtNstring,&from);
  79.     XtGetValues(text_1,args,1);
  80.  
  81.     /*
  82.      * Ueberpruefen ob in beiden ein Text steht, sonst
  83.      * Warnung ausgeben
  84.      */
  85.     if (!strlen(from)) {
  86.         WARNING ("Insuffisant Arguments.\nOperation aborted.");
  87.         return;
  88.     }
  89.  
  90.     /*
  91.      * Befehl generieren und ausfuehren
  92.      */
  93.     sprintf(buf,"%s %s",MKDIR_CMD,from);
  94.     system(buf);
  95.     {
  96.         /*
  97.          * Dialogfenster loeschen
  98.          */
  99.         XtDestroyWidget(dialog);
  100.         dialog = NULL;
  101.  
  102.         /*
  103.          * Hier muss ein Update der veranderten Felder kommen
  104.          * Bisher unvollstaendig
  105.          */
  106. #ifdef    HAS_QUOTA
  107.         showQuota(quota_label);
  108. #endif
  109.     }
  110. }
  111.  
  112.