myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [2900] The control GUI application is moved to misc/.


From: Giuseppe Scrivano
Subject: [myserver-commit] [2900] The control GUI application is moved to misc/.
Date: Thu, 23 Oct 2008 20:50:15 +0000

Revision: 2900
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2900
Author:   gscrivano
Date:     2008-10-23 20:50:14 +0000 (Thu, 23 Oct 2008)

Log Message:
-----------
The control GUI application is moved to misc/.

Modified Paths:
--------------
    trunk/myserver/Makefile.am
    trunk/myserver/binaries/NSIS installer script.nsi
    trunk/myserver/binaries/clean_copy.sh
    trunk/myserver/configure.in

Added Paths:
-----------
    trunk/misc/control/
    trunk/misc/control/control/
    trunk/misc/control/fltk.m4
    trunk/misc/control/myserver-configure.cpp

Removed Paths:
-------------
    trunk/misc/control/myserver-configure.cpp
    trunk/myserver/control/
    trunk/myserver/m4/fltk.m4

Copied: trunk/misc/control (from rev 2887, trunk/myserver/control)


Property changes on: trunk/misc/control
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/misc/control/control (from rev 2899, trunk/myserver/control)


Property changes on: trunk/misc/control/control
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/misc/control/fltk.m4 (from rev 2887, trunk/myserver/m4/fltk.m4)
===================================================================
--- trunk/misc/control/fltk.m4                          (rev 0)
+++ trunk/misc/control/fltk.m4  2008-10-23 20:50:14 UTC (rev 2900)
@@ -0,0 +1,53 @@
+# Config paths for fltk
+# Writen for MyServer
+# based on glib.m4
+
+dnl AM_PATH_FLTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+
+AC_DEFUN([AM_PATH_FLTK],
+[
+AC_ARG_WITH(fltk-prefix,[  --with-fltk-prefix=PFX   Prefix where FLTK is 
installed (optional)],
+            fltk_config_prefix="$withval", fltk_config_prefix="")
+AC_ARG_WITH(fltk-exec-prefix,[  --with-fltk-exec-prefix=PFX Exec prefix where 
FLTK is installed (optional)], fltk_config_exec_prefix="$withval", 
fltk_config_exec_prefix="")
+
+  if test x$fltk_config_exec_prefix != x ; then
+     fltk_config_args="$fltk_config_args"
+     if test x${FLTK_CONFIG+set} != xset ; then
+        FLTK_CONFIG=$fltk_config_exec_prefix/bin/fltk-config
+     fi
+  fi
+  if test x$fltk_config_prefix != x ; then
+     fltk_config_args="$fltk_config_args"
+     if test x${FLTK_CONFIG+set} != xset ; then
+        FLTK_CONFIG=$fltk_config_prefix/bin/fltk-config
+     fi
+  fi
+
+  AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
+  min_fltk_version=ifelse([$1], ,1.1.0,$1)
+  AC_MSG_CHECKING(for FLTK - version >= $min_fltk_version)
+  no_fltk=""
+  if test "$FLTK_CONFIG" = "no" ; then
+    no_fltk=yes
+    FLTK_VERSION=""
+  else
+    FLTK_CFLAGS=`$FLTK_CONFIG $fltk_config_args --cflags`
+    FLTK_LIBS=`$FLTK_CONFIG $fltk_config_args --ldflags`
+    FLTK_VERSION=`$FLTK_CONFIG $fltk_config_args --version`
+  fi
+  if test "x$no_fltk" = x ; then
+     AC_MSG_RESULT(yes (version $FLTK_VERSION))
+     ifelse([$2], , :, [$2])
+  else
+     if test "x$FLTK_VERSION" = x; then
+        AC_MSG_RESULT(no)
+     else
+        AC_MSG_RESULT(no (version $FLTK_VERSION))
+     fi        
+     FLTK_CFLAGS=""
+     FLTK_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(FLTK_CFLAGS)
+  AC_SUBST(FLTK_LIBS)
+])  


Property changes on: trunk/misc/control/fltk.m4
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Deleted: trunk/misc/control/myserver-configure.cpp
===================================================================
--- trunk/myserver/control/myserver-configure.cpp       2008-10-18 12:30:19 UTC 
(rev 2887)
+++ trunk/misc/control/myserver-configure.cpp   2008-10-23 20:50:14 UTC (rev 
2900)
@@ -1,400 +0,0 @@
-/*
-MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef WIN32
-# include <windows.h>
-# include <io.h>
-#endif
-
-#include <Fl/Fl.H>
-#include <Fl/fl_ask.H>
-
-#include "language.h"
-#include <include/base/string/stringutils.h>
-#include <include/base/xml/xml_parser.h>
-#include <include/base/file/file.h>
-#include <include/base/file/files_utility.h>
-#include "vector.h"
-#include "fltkconfig.h"
-#include "language.h"
-
-#include <include/base/find_data/find_data.h>
-
-extern "C"
-{
-#include <stdio.h>
-#ifdef WIN32
-# include <direct.h>
-#elif HAVE_DL
-# include <dlfcn.h>
-# define HMODULE void *
-#else
-# define HMODULE void *
-#endif
-}
-
-#ifndef intptr_t
-# define intptr_t int
-#endif
-
-typedef char* (*registerNamePROC)(char*,int);
-
-static void GetDynamicProtocols(const char *, Vector &);
-
-///
-/// Main function.
-/// Intilize all supporting libraries and windows.
-/// Gets the list of dynamic protocols and language files.
-/// Loads the first avaible configuration.
-/// Displays the main dialog.
-/// Waits for FLTK to quit and dose clean up.
-///
-int main(int argc, char * argv[])
-{
-   char languages_path[MAX_PATH];
-   char main_configuration_file[MAX_PATH];
-   int conf_location = 0;
-   XmlParser xmlFile;
-   FindData fd;
-   int fd_ret;
-   bool langFound = true;
-   bool confFound = true;
-   int ret;
-
-  LanguageXMLinit();
-   /*! Initialize the SSL library. */
-#ifndef DO_NOT_USE_SSL
-   SSL_library_init();
-   SSL_load_error_strings();
-#endif
-
-#ifdef WIN32   
-       /*!
-   *Under windows we need to initialize the socket library before use it.
-   */
-       WSADATA wsaData;
-       WSAStartup(MAKEWORD( 1, 1), &wsaData);
-
-   // Find the language files:
-   strncpy(languages_path, "languages/", MAX_PATH);
-   fd_ret=fd.findfirst("languages/");
-#else
-   if(FilesUtility::fileExists("languages"))
-     {
-       strncpy(languages_path, "languages/", MAX_PATH);
-     }
-   else
-     {
-# ifdef PREFIX
-       snprintf(languages_path, MAX_PATH, "%s/share/myserver/languages/", 
PREFIX);
-# else
-       strncpy(languages_path, "/usr/share/myserver/languages/", MAX_PATH);
-# endif
-     }
-   if(!(FilesUtility::fileExists(languages_path)))
-     {
-       fl_alert("Languages directory not found.");
-       langFound = false;
-     }
-   if(langFound)
-     fd_ret=fd.findfirst(languages_path);
-#endif
-
-   // Search for myserver.xml
-   /* Under an *nix environment look for .xml files in the following order.
-    * 1) myserver executable working directory
-    * 2) ~/.myserver/
-    * 3) /etc/myserver/
-    * 4) default files will be copied in myserver executable working
-    */
-#ifndef WIN32
-   // just a little hack
-   snprintf(main_configuration_file, MAX_PATH, "%s/.myserver/myserver.xml", 
getenv("HOME"));
-#endif
-   if(FilesUtility::fileExists("myserver.xml"))
-     {
-       conf_location = 1;
-       strncpy(main_configuration_file,"myserver.xml", MAX_PATH);
-     }
-#ifndef WIN32
-   else if(FilesUtility::fileExists(main_configuration_file))
-     {
-       conf_location = 2;
-     }
-   else if(FilesUtility::fileExists("/etc/myserver/myserver.xml"))
-     {
-       conf_location = 3;
-       strncpy(main_configuration_file,"/etc/myserver/myserver.xml", MAX_PATH);
-     }
-#endif
-     /*
-      * If the myserver.xml files doesn't exist copy it from the default one.
-      */
-   else
-     {
-       conf_location = 1;
-       strncpy(main_configuration_file,"myserver.xml", MAX_PATH);
-       File inputF;
-       File outputF;
-       if(!FilesUtility::fileExists("myserver.xml.default"))
-         {  // no configuration files found
-            fl_alert("Default configuration files not found.  Loading empty 
values.");
-            confFound = false;
-            conf_location = 0;
-         }
-       else
-         {  // Copy the default files
-            char buffer[512];
-            u_long nbr, nbw;
-            fl_alert("Configuration files not found.  Loading default files.");
-            inputF.openFile("myserver.xml.default", 
File::MYSERVER_OPEN_READ|File::MYSERVER_OPEN_IFEXISTS);
-            outputF.openFile("myserver.xml", 
File::MYSERVER_OPEN_WRITE|File::MYSERVER_OPEN_ALWAYS);
-            for(;;)
-              {
-                 inputF.readFromFile(buffer, 512, &nbr );
-                 if(nbr==0)
-                   break;
-                 outputF.writeToFile(buffer, nbr, &nbw);
-              }
-            inputF.close();
-            outputF.close();
-
-            if(FilesUtility::fileExists("MIMEtypes.xml.default"))
-              {
-                 char buffer[512];
-                 u_long nbr, nbw;
-                 inputF.openFile("MIMEtypes.xml.default", 
File::MYSERVER_OPEN_READ|File::MYSERVER_OPEN_IFEXISTS);
-                 outputF.openFile("MIMEtypes.xml", 
File::MYSERVER_OPEN_WRITE|File::MYSERVER_OPEN_ALWAYS);
-                 for(;;)
-                   {
-                      inputF.readFromFile(buffer, 512, &nbr );
-                      if(nbr==0)
-                        break;
-                      outputF.writeToFile(buffer, nbr, &nbw);
-                   }
-                 inputF.close();
-                 outputF.close();
-              }
-
-            if(FilesUtility::fileExists("virtualhosts.xml.default"))
-              {
-                 char buffer[512];
-                 u_long nbr, nbw;
-                 inputF.openFile("virtualhosts.xml.default", 
File::MYSERVER_OPEN_READ|
-                                                                               
        File::MYSERVER_OPEN_IFEXISTS);
-                 outputF.openFile("virtualhosts.xml", 
File::MYSERVER_OPEN_WRITE| 
-                                                                               
         File::MYSERVER_OPEN_ALWAYS);
-                 for(;;)
-                   {
-                      inputF.readFromFile(buffer, 512, &nbr );
-                      if(nbr==0)
-                        break;
-                      outputF.writeToFile(buffer, nbr, &nbw);
-                   }
-                 inputF.close();
-                 outputF.close();
-              }
-         }
-     }
-
-   // Initilize APIs
-   XmlParser::startXML();
-   // LanguageXMLinit handeled internaly
-
-   // Load the language file for configure
-   // Handeled internaly
-
-
-   // Initilize the Dialogs
-   MainDlg Configure;
-   Configure.make_window();
-   Configure.make_about();
-   Configure.make_type();
-   Configure.make_login();
-   Configure.make_status();
-   Configure.make_connections();
-   Configure.make_regask();
-   
-   // Show the main window
-   Configure.ConfDlg->show(argc, argv);
-
-   // Load the language file names
-   Configure.Language->clear();
-   if(langFound)
-     {
-       do
-         {
-            char dir[MAX_PATH];
-            char filename[MAX_PATH];
-            if(fd.name[0] == '.')
-              continue;
-            FilesUtility::splitPath(fd.name,dir,filename);
-            if(strcmpi(&(filename[strlen(filename) - 3]), "xml") == 0)
-              Configure.Language->add(filename, 0, 0, 0, 0);
-         }
-       while(!fd.findnext());
-       fd.findclose();
-     }
-   
-   // Load the dynamic protocol names
-   Vector list;
-   if(FilesUtility::fileExists("plugins/protocols"))
-     {
-       GetDynamicProtocols("plugins/protocols", list);
-     }
-#ifndef WIN32
-#ifdef PREFIX
-   else if(FilesUtility::fileExists(PREFIX "/lib/myserver/plugins/protocols"))
-     {
-       GetDynamicProtocols(PREFIX "/lib/myserver/plugins/protocols", list);
-     }
-#else
-   else if(FilesUtility::fileExists("/usr/lib/myserver/plugins/protocols"))
-     {
-       GetDynamicProtocols("/usr/lib/myserver/plugins/protocols", list);
-     }
-#endif
-#endif
-   Configure.setDynamic(list);
-   list.clear();
-
-   // Load, if found, fist avaible configuration
-   Configure.ConfType = conf_location;
-   switch(conf_location)
-     {
-      case 1 :
-       Configure.ConfTypeDlgLocal->setonly();
-       break;
-      case 2 :
-       Configure.ConfTypeDlgUser->setonly();
-       break;
-      case 3 :
-       Configure.ConfTypeDlgGlobal->setonly();
-       break;
-      default :
-       break;
-     }
-   Configure.load_config();
-
-   // Start the app
-   ret = Fl::run();
-
-   // Close the language xml file
-   LanguageXMLclose();
-
-   // Cleanup
-   LanguageXMLend();
-   XmlParser::cleanXML();
-
-   // Exit
-   return ret;
-}
-
-///
-/// Get the local dynamic protocols.
-/// Parts taken from protocols_manager.cpp
-/// 
-static void GetDynamicProtocols(const char * folder, Vector & list)
-{
-   list.clear();
-
-   HMODULE module;
-   registerNamePROC name;
-
-   FindData fd;
-   int fd_ret;   
-   int filenamelen = 0;
-   char *filename = 0;
-#ifdef WIN32
-   filenamelen=strlen(folder)+6;
-   filename=new char[filenamelen];
-   if(filename == 0)
-     return;
-   snprintf(filename,filenamelen,"%s/*.*",folder);
-#endif
-#ifdef NOT_WIN
-   filenamelen=strlen(folder)+2;
-   filename=new char[filenamelen];
-   if(filename == 0)
-     return;
-   strncpy(filename,folder, filenamelen);
-#endif
-
-   fd_ret=fd.findfirst(filename);
-   if(fd_ret==-1)
-       {
-         delete [] filename;
-         filename = 0;
-         return;
-       }
-   char *completeFileName = 0;
-   int completeFileNameLen = 0;
-   do
-     {
-       if(fd.name[0]=='.')
-         continue;
-       /*
-        *Do not consider file other than dynamic libraries.
-        */
-#ifdef WIN32
-       if(!strstr(fd.name,".dll"))
-#endif
-#ifdef NOT_WIN
-         if(!strstr(fd.name,".so"))
-#endif
-           continue;
-       completeFileNameLen = strlen(folder) + strlen(fd.name) + 2;
-       completeFileName = new char[completeFileNameLen];
-       if(completeFileName == 0)
-         {
-            delete [] filename;
-            filename = 0;
-            return;
-         }
-       snprintf(completeFileName,completeFileNameLen,"%s/%s",folder,fd.name);
-#ifdef WIN32
-       module = LoadLibrary(completeFileName);
-#endif
-#ifdef HAVE_DL
-       module = dlopen(completeFileName, RTLD_LAZY);
-#endif
-       if(module != NULL)
-         {
-#ifdef WIN32
-            name = (registerNamePROC)GetProcAddress((HMODULE)module, 
"registerName");
-#endif
-#ifdef HAVE_DL
-            name = (registerNamePROC)dlsym(module, "registerName");
-#endif
-            if(name != NULL)
-              {
-                 list.add(name(NULL, 0));
-              }
-         }
-#ifdef WIN32
-       FreeLibrary((HMODULE)module);
-#endif
-#ifdef HAVE_DL
-       dlclose(module);
-#endif
-       delete [] completeFileName;
-     }
-   while(!fd.findnext());
-   fd.findclose();
-   delete [] filename;
-   filename = 0;
-}

Copied: trunk/misc/control/myserver-configure.cpp (from rev 2894, 
trunk/myserver/control/myserver-configure.cpp)
===================================================================
--- trunk/misc/control/myserver-configure.cpp                           (rev 0)
+++ trunk/misc/control/myserver-configure.cpp   2008-10-23 20:50:14 UTC (rev 
2900)
@@ -0,0 +1,400 @@
+/*
+MyServer
+Copyright (C) 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifdef WIN32
+# include <windows.h>
+# include <io.h>
+#endif
+
+#include <Fl/Fl.H>
+#include <Fl/fl_ask.H>
+
+#include "language.h"
+#include <include/base/string/stringutils.h>
+#include <include/base/xml/xml_parser.h>
+#include <include/base/file/file.h>
+#include <include/base/file/files_utility.h>
+#include "vector.h"
+#include "fltkconfig.h"
+#include "language.h"
+
+#include <include/base/find_data/find_data.h>
+
+extern "C"
+{
+#include <stdio.h>
+#ifdef WIN32
+# include <direct.h>
+#elif HAVE_DL
+# include <dlfcn.h>
+# define HMODULE void *
+#else
+# define HMODULE void *
+#endif
+}
+
+#ifndef intptr_t
+# define intptr_t int
+#endif
+
+typedef char* (*registerNamePROC)(char*,int);
+
+static void GetDynamicProtocols(const char *, Vector &);
+
+///
+/// Main function.
+/// Intilize all supporting libraries and windows.
+/// Gets the list of dynamic protocols and language files.
+/// Loads the first avaible configuration.
+/// Displays the main dialog.
+/// Waits for FLTK to quit and dose clean up.
+///
+int main(int argc, char * argv[])
+{
+   char languages_path[MAX_PATH];
+   char main_configuration_file[MAX_PATH];
+   int conf_location = 0;
+   XmlParser xmlFile;
+   FindData fd;
+   int fd_ret;
+   bool langFound = true;
+   bool confFound = true;
+   int ret;
+
+  LanguageXMLinit();
+   /*! Initialize the SSL library. */
+#ifndef DO_NOT_USE_SSL
+   SSL_library_init();
+   SSL_load_error_strings();
+#endif
+
+#ifdef WIN32   
+       /*!
+   *Under windows we need to initialize the socket library before use it.
+   */
+       WSADATA wsaData;
+       WSAStartup(MAKEWORD( 1, 1), &wsaData);
+
+   // Find the language files:
+   strncpy(languages_path, "languages/", MAX_PATH);
+   fd_ret=fd.findfirst("languages/");
+#else
+   if(FilesUtility::fileExists("languages"))
+     {
+       strncpy(languages_path, "languages/", MAX_PATH);
+     }
+   else
+     {
+# ifdef PREFIX
+       snprintf(languages_path, MAX_PATH, "%s/share/myserver/languages/", 
PREFIX);
+# else
+       strncpy(languages_path, "/usr/share/myserver/languages/", MAX_PATH);
+# endif
+     }
+   if(!(FilesUtility::fileExists(languages_path)))
+     {
+       fl_alert("Languages directory not found.");
+       langFound = false;
+     }
+   if(langFound)
+     fd_ret=fd.findfirst(languages_path);
+#endif
+
+   // Search for myserver.xml
+   /* Under an *nix environment look for .xml files in the following order.
+    * 1) myserver executable working directory
+    * 2) ~/.myserver/
+    * 3) /etc/myserver/
+    * 4) default files will be copied in myserver executable working
+    */
+#ifndef WIN32
+   // just a little hack
+   snprintf(main_configuration_file, MAX_PATH, "%s/.myserver/myserver.xml", 
getenv("HOME"));
+#endif
+   if(FilesUtility::fileExists("myserver.xml"))
+     {
+       conf_location = 1;
+       strncpy(main_configuration_file,"myserver.xml", MAX_PATH);
+     }
+#ifndef WIN32
+   else if(FilesUtility::fileExists(main_configuration_file))
+     {
+       conf_location = 2;
+     }
+   else if(FilesUtility::fileExists("/etc/myserver/myserver.xml"))
+     {
+       conf_location = 3;
+       strncpy(main_configuration_file,"/etc/myserver/myserver.xml", MAX_PATH);
+     }
+#endif
+     /*
+      * If the myserver.xml files doesn't exist copy it from the default one.
+      */
+   else
+     {
+       conf_location = 1;
+       strncpy(main_configuration_file,"myserver.xml", MAX_PATH);
+       File inputF;
+       File outputF;
+       if(!FilesUtility::fileExists("myserver.xml.default"))
+         {  // no configuration files found
+            fl_alert("Default configuration files not found.  Loading empty 
values.");
+            confFound = false;
+            conf_location = 0;
+         }
+       else
+         {  // Copy the default files
+            char buffer[512];
+            u_long nbr, nbw;
+            fl_alert("Configuration files not found.  Loading default files.");
+            inputF.openFile("myserver.xml.default", 
File::MYSERVER_OPEN_READ|File::MYSERVER_OPEN_IFEXISTS);
+            outputF.openFile("myserver.xml", 
File::MYSERVER_OPEN_WRITE|File::MYSERVER_OPEN_ALWAYS);
+            for(;;)
+              {
+                 inputF.read(buffer, 512, &nbr );
+                 if(nbr==0)
+                   break;
+                 outputF.writeToFile(buffer, nbr, &nbw);
+              }
+            inputF.close();
+            outputF.close();
+
+            if(FilesUtility::fileExists("MIMEtypes.xml.default"))
+              {
+                 char buffer[512];
+                 u_long nbr, nbw;
+                 inputF.openFile("MIMEtypes.xml.default", 
File::MYSERVER_OPEN_READ|File::MYSERVER_OPEN_IFEXISTS);
+                 outputF.openFile("MIMEtypes.xml", 
File::MYSERVER_OPEN_WRITE|File::MYSERVER_OPEN_ALWAYS);
+                 for(;;)
+                   {
+                      inputF.read(buffer, 512, &nbr );
+                      if(nbr==0)
+                        break;
+                      outputF.writeToFile(buffer, nbr, &nbw);
+                   }
+                 inputF.close();
+                 outputF.close();
+              }
+
+            if(FilesUtility::fileExists("virtualhosts.xml.default"))
+              {
+                 char buffer[512];
+                 u_long nbr, nbw;
+                 inputF.openFile("virtualhosts.xml.default", 
File::MYSERVER_OPEN_READ|
+                                                                               
        File::MYSERVER_OPEN_IFEXISTS);
+                 outputF.openFile("virtualhosts.xml", 
File::MYSERVER_OPEN_WRITE| 
+                                                                               
         File::MYSERVER_OPEN_ALWAYS);
+                 for(;;)
+                   {
+                      inputF.read(buffer, 512, &nbr );
+                      if(nbr==0)
+                        break;
+                      outputF.writeToFile(buffer, nbr, &nbw);
+                   }
+                 inputF.close();
+                 outputF.close();
+              }
+         }
+     }
+
+   // Initilize APIs
+   XmlParser::startXML();
+   // LanguageXMLinit handeled internaly
+
+   // Load the language file for configure
+   // Handeled internaly
+
+
+   // Initilize the Dialogs
+   MainDlg Configure;
+   Configure.make_window();
+   Configure.make_about();
+   Configure.make_type();
+   Configure.make_login();
+   Configure.make_status();
+   Configure.make_connections();
+   Configure.make_regask();
+   
+   // Show the main window
+   Configure.ConfDlg->show(argc, argv);
+
+   // Load the language file names
+   Configure.Language->clear();
+   if(langFound)
+     {
+       do
+         {
+            char dir[MAX_PATH];
+            char filename[MAX_PATH];
+            if(fd.name[0] == '.')
+              continue;
+            FilesUtility::splitPath(fd.name,dir,filename);
+            if(strcmpi(&(filename[strlen(filename) - 3]), "xml") == 0)
+              Configure.Language->add(filename, 0, 0, 0, 0);
+         }
+       while(!fd.findnext());
+       fd.findclose();
+     }
+   
+   // Load the dynamic protocol names
+   Vector list;
+   if(FilesUtility::fileExists("plugins/protocols"))
+     {
+       GetDynamicProtocols("plugins/protocols", list);
+     }
+#ifndef WIN32
+#ifdef PREFIX
+   else if(FilesUtility::fileExists(PREFIX "/lib/myserver/plugins/protocols"))
+     {
+       GetDynamicProtocols(PREFIX "/lib/myserver/plugins/protocols", list);
+     }
+#else
+   else if(FilesUtility::fileExists("/usr/lib/myserver/plugins/protocols"))
+     {
+       GetDynamicProtocols("/usr/lib/myserver/plugins/protocols", list);
+     }
+#endif
+#endif
+   Configure.setDynamic(list);
+   list.clear();
+
+   // Load, if found, fist avaible configuration
+   Configure.ConfType = conf_location;
+   switch(conf_location)
+     {
+      case 1 :
+       Configure.ConfTypeDlgLocal->setonly();
+       break;
+      case 2 :
+       Configure.ConfTypeDlgUser->setonly();
+       break;
+      case 3 :
+       Configure.ConfTypeDlgGlobal->setonly();
+       break;
+      default :
+       break;
+     }
+   Configure.load_config();
+
+   // Start the app
+   ret = Fl::run();
+
+   // Close the language xml file
+   LanguageXMLclose();
+
+   // Cleanup
+   LanguageXMLend();
+   XmlParser::cleanXML();
+
+   // Exit
+   return ret;
+}
+
+///
+/// Get the local dynamic protocols.
+/// Parts taken from protocols_manager.cpp
+/// 
+static void GetDynamicProtocols(const char * folder, Vector & list)
+{
+   list.clear();
+
+   HMODULE module;
+   registerNamePROC name;
+
+   FindData fd;
+   int fd_ret;   
+   int filenamelen = 0;
+   char *filename = 0;
+#ifdef WIN32
+   filenamelen=strlen(folder)+6;
+   filename=new char[filenamelen];
+   if(filename == 0)
+     return;
+   snprintf(filename,filenamelen,"%s/*.*",folder);
+#endif
+#ifdef NOT_WIN
+   filenamelen=strlen(folder)+2;
+   filename=new char[filenamelen];
+   if(filename == 0)
+     return;
+   strncpy(filename,folder, filenamelen);
+#endif
+
+   fd_ret=fd.findfirst(filename);
+   if(fd_ret==-1)
+       {
+         delete [] filename;
+         filename = 0;
+         return;
+       }
+   char *completeFileName = 0;
+   int completeFileNameLen = 0;
+   do
+     {
+       if(fd.name[0]=='.')
+         continue;
+       /*
+        *Do not consider file other than dynamic libraries.
+        */
+#ifdef WIN32
+       if(!strstr(fd.name,".dll"))
+#endif
+#ifdef NOT_WIN
+         if(!strstr(fd.name,".so"))
+#endif
+           continue;
+       completeFileNameLen = strlen(folder) + strlen(fd.name) + 2;
+       completeFileName = new char[completeFileNameLen];
+       if(completeFileName == 0)
+         {
+            delete [] filename;
+            filename = 0;
+            return;
+         }
+       snprintf(completeFileName,completeFileNameLen,"%s/%s",folder,fd.name);
+#ifdef WIN32
+       module = LoadLibrary(completeFileName);
+#endif
+#ifdef HAVE_DL
+       module = dlopen(completeFileName, RTLD_LAZY);
+#endif
+       if(module != NULL)
+         {
+#ifdef WIN32
+            name = (registerNamePROC)GetProcAddress((HMODULE)module, 
"registerName");
+#endif
+#ifdef HAVE_DL
+            name = (registerNamePROC)dlsym(module, "registerName");
+#endif
+            if(name != NULL)
+              {
+                 list.add(name(NULL, 0));
+              }
+         }
+#ifdef WIN32
+       FreeLibrary((HMODULE)module);
+#endif
+#ifdef HAVE_DL
+       dlclose(module);
+#endif
+       delete [] completeFileName;
+     }
+   while(!fd.findnext());
+   fd.findclose();
+   delete [] filename;
+   filename = 0;
+}

Modified: trunk/myserver/Makefile.am
===================================================================
--- trunk/myserver/Makefile.am  2008-10-22 21:07:55 UTC (rev 2899)
+++ trunk/myserver/Makefile.am  2008-10-23 20:50:14 UTC (rev 2900)
@@ -1,10 +1,6 @@
-# Makefile : Builds myserver, control, math_sum, and post
+# Makefile : Builds myserver, math_sum, and post
 #
 
-if BUILD_CONTROL
-CONTROL = control
-endif
-
 if BUILD_TESTS
 TESTS = tests
 endif
@@ -14,7 +10,7 @@
 endif
 
 am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-pthread-check.m4 \
-        $(top_srcdir)/m4/fltk.m4 $(top_srcdir)/m4/libtool.m4 \
+        $(top_srcdir)/m4/libtool.m4 \
         $(top_srcdir)/m4/libxml.m4 $(top_srcdir)/m4/cppunit.m4 \
         $(top_srcdir)/configure.in
 

Modified: trunk/myserver/binaries/NSIS installer script.nsi
===================================================================
--- trunk/myserver/binaries/NSIS installer script.nsi   2008-10-22 21:07:55 UTC 
(rev 2899)
+++ trunk/myserver/binaries/NSIS installer script.nsi   2008-10-23 20:50:14 UTC 
(rev 2900)
@@ -258,14 +258,6 @@
   File "web\downloads\*.sh"
 SectionEnd
 
-Section "MyServer center" SecControl
-  DetailPrint "Control Center Application"
-  SetOutPath $INSTDIR
-  File "myserver-configure.exe"
-  File "myserver.ico"
-  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Control Center.lnk" 
"$INSTDIR\Myserver Configure.exe"
-SectionEnd
-
 Section "Documentation" SecDocumentation
   SetOutPath "$INSTDIR\web\documentation"
   File "..\documentation\myserver\*.html"
@@ -297,7 +289,6 @@
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
   !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "Install the MyServer core 
application(this element is required)"
   !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} "Install the MyServer 
documentation"
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecControl} "Install the Control Center 
application(the installation of this element is highly recommended)"
   !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} "Copy all the languages 
files(by default only the english language is copied)"
   !insertmacro MUI_DESCRIPTION_TEXT ${SecWebEx} "Install some web examples"
   !insertmacro MUI_DESCRIPTION_TEXT ${SecService} "Install MyServer like a 
service (loaded automatically on startup)"

Modified: trunk/myserver/binaries/clean_copy.sh
===================================================================
--- trunk/myserver/binaries/clean_copy.sh       2008-10-22 21:07:55 UTC (rev 
2899)
+++ trunk/myserver/binaries/clean_copy.sh       2008-10-23 20:50:14 UTC (rev 
2900)
@@ -8,7 +8,6 @@
 
 mkdir $1
 cp myserver $1
-cp myserver-configure $1
 cp myserver-daemon $1
 cp *.default $1
 cp readme.txt $1

Modified: trunk/myserver/configure.in
===================================================================
--- trunk/myserver/configure.in 2008-10-22 21:07:55 UTC (rev 2899)
+++ trunk/myserver/configure.in 2008-10-23 20:50:14 UTC (rev 2900)
@@ -61,8 +61,6 @@
 
 AC_ARG_WITH([root-prefix], [  --with-root-prefix=PREFIX override prefix 
variable for files to be placed in the root], root_prefix=$withval, 
root_prefix="\$(DESTDIR)")
 
-AC_ARG_ENABLE([control-gui], [ --disable-control-gui disable the 
myserver-configure GUI program], enable_control="no", enable_control="yes")
-
 AC_ARG_ENABLE([ipv6], [  --enable-ipv6 Build with IPv6 support], 
enable_ipv6="yes", enable_ipv6="")
 
 AC_ARG_ENABLE([mingw32], [ --enable-mingw32 Enable mingw32], 
enable_mingw32="yes", enable_mingw32="")
@@ -282,22 +280,7 @@
 
 AC_SUBST(ZLIB_LIB)
 
-if test x$enable_control == xyes; then
-     AC_CHECK_LIB(fltk, main, have_fltk=yes)
-    dnl Looking for FLTK
-    AM_PATH_FLTK(1.1.0, have_fltk=yes)
-    if test x$have_fltk != xyes; then
-        AC_MSG_WARN([
-*** Cannot find FLTK (www.fltk.org)
-*** control program will not be built
-])
-        MAKE_CONTROL=no
-    else
-        MAKE_CONTROL=yes
-    fi
-fi
 
-
 if test x$enable_ipv6 = xyes; then
     dnl Check for IPv6
     AC_MSG_CHECKING([for IPv6])
@@ -359,7 +342,6 @@
 AM_CONDITIONAL(BUILD_TESTS, test "$MAKE_TESTS" = "yes")
 
 AM_CONDITIONAL(BUILD_MSCGI, test "$MAKE_MSCGI" = "yes")
-AM_CONDITIONAL(BUILD_CONTROL, test "$MAKE_CONTROL" = "yes")
 AM_CONDITIONAL(BUILD_DOC, test "$MAKE_DOC" = "yes")
 
 dnl AC_CONFIG_SUBDIRS()
@@ -382,7 +364,6 @@
     binaries/system/errors/Makefile
     binaries/system/icons/Makefile
     binaries/system/icons/codes/Makefile
-    control/Makefile
     documentation/Makefile
     include/Makefile
     include/connection/Makefile

Deleted: trunk/myserver/m4/fltk.m4
===================================================================
--- trunk/myserver/m4/fltk.m4   2008-10-22 21:07:55 UTC (rev 2899)
+++ trunk/myserver/m4/fltk.m4   2008-10-23 20:50:14 UTC (rev 2900)
@@ -1,53 +0,0 @@
-# Config paths for fltk
-# Writen for MyServer
-# based on glib.m4
-
-dnl AM_PATH_FLTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-
-AC_DEFUN([AM_PATH_FLTK],
-[
-AC_ARG_WITH(fltk-prefix,[  --with-fltk-prefix=PFX   Prefix where FLTK is 
installed (optional)],
-            fltk_config_prefix="$withval", fltk_config_prefix="")
-AC_ARG_WITH(fltk-exec-prefix,[  --with-fltk-exec-prefix=PFX Exec prefix where 
FLTK is installed (optional)], fltk_config_exec_prefix="$withval", 
fltk_config_exec_prefix="")
-
-  if test x$fltk_config_exec_prefix != x ; then
-     fltk_config_args="$fltk_config_args"
-     if test x${FLTK_CONFIG+set} != xset ; then
-        FLTK_CONFIG=$fltk_config_exec_prefix/bin/fltk-config
-     fi
-  fi
-  if test x$fltk_config_prefix != x ; then
-     fltk_config_args="$fltk_config_args"
-     if test x${FLTK_CONFIG+set} != xset ; then
-        FLTK_CONFIG=$fltk_config_prefix/bin/fltk-config
-     fi
-  fi
-
-  AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
-  min_fltk_version=ifelse([$1], ,1.1.0,$1)
-  AC_MSG_CHECKING(for FLTK - version >= $min_fltk_version)
-  no_fltk=""
-  if test "$FLTK_CONFIG" = "no" ; then
-    no_fltk=yes
-    FLTK_VERSION=""
-  else
-    FLTK_CFLAGS=`$FLTK_CONFIG $fltk_config_args --cflags`
-    FLTK_LIBS=`$FLTK_CONFIG $fltk_config_args --ldflags`
-    FLTK_VERSION=`$FLTK_CONFIG $fltk_config_args --version`
-  fi
-  if test "x$no_fltk" = x ; then
-     AC_MSG_RESULT(yes (version $FLTK_VERSION))
-     ifelse([$2], , :, [$2])
-  else
-     if test "x$FLTK_VERSION" = x; then
-        AC_MSG_RESULT(no)
-     else
-        AC_MSG_RESULT(no (version $FLTK_VERSION))
-     fi        
-     FLTK_CFLAGS=""
-     FLTK_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  AC_SUBST(FLTK_CFLAGS)
-  AC_SUBST(FLTK_LIBS)
-])  






reply via email to

[Prev in Thread] Current Thread [Next in Thread]