Restore compilation of loggraph, extract code layout of kernel's message dialog into...
[vlp.git] / src / kernel / kernel.h
index 13494ea14501afe438e37af3b90e8d9f7ecc54e7..aaef05d22609964027ed47122f8b7263984d17b1 100644 (file)
 #include <QtGui/QListWidget>
 #include <QtGui/QTextEdit>
 #include <QtCore/QSocketNotifier>
+#include <QtCore/QDir>
 
 #include "comm.h"
 
-#include "kernelwindow.h"
+#include "ui/KernelWindow.h"
 
 #define GPATH "loggr"
 #define IPATH "logi"
@@ -54,6 +55,9 @@
 #define NORM_COL       2
 
 
+namespace loglan {
+namespace vlp {
+
 /**
  * Interpreter slot
  */
@@ -82,10 +86,14 @@ public:
 class ConnectEntry {
 public:
        char addr[256];
-       
+
        ConnectEntry(char *s) {
                strcpy(addr, s);
        };
+
+       ConnectEntry(const char *s) {
+               strcpy(addr, s);
+       };
 };
 
 
@@ -100,15 +108,11 @@ public:
        int NodeNumber;
        int ConType;
 
-       QKernel();
+       QKernel(int argc, char **argv);
 
-       void WriteMessage(char* msg);
-       void InitMessage();
+       void WriteMessage(const char * msg);
 
 public slots:
-       void n_impl();
-       void AddAddress();
-       void DelAddress();
        void NetMessage();
        void IntMessage(int);
 
@@ -118,7 +122,6 @@ protected:
 private:
        QList<InterpEntry*> Interpreters;
        QList<ConnectEntry*> ConnectList;
-       QListWidget *connections;
        
        /**
         * number of working interpreters
@@ -141,10 +144,13 @@ private:
        int net_sock;
        int freeINTid;
        QSocketNotifier *Net_Notify;
-       char HomeDir[255];
+       QDir homeDir;
+       char myargs[5][255];
        bool info_messages;
 
-       void LoadConfig(char *);
+       void loadConfig(const QString &fname);
+       void loadConfig(const char *);
+
        void RunGraphModule(char*);
        void RunNetModule();
        InterpEntry *findINTbySocket(int);
@@ -159,6 +165,13 @@ private:
         */
        void setLocked(bool locked);
 
+       QString getConfigFilePath();
+       const char * getHomeDir();
+       const char * getRemoteDir();
+
+       const char * getNetModuleSocket();
+       const char * getGraphModuleSocket();
+
 private slots:
        void on_actionExecute_triggered();
        void on_actionKill_triggered();
@@ -177,4 +190,7 @@ private slots:
        void on_actionUnlock_console_triggered();
 };
 
+}
+}
+
 #endif /* VLP_KERNEL_H */