Small layout change
[vlp.git] / src / kernel / kernel.h
index 168777c1631efb92c7b7132affc23f2c8151936b..aaef05d22609964027ed47122f8b7263984d17b1 100644 (file)
 #include <QtGui/QListWidget>
 #include <QtGui/QTextEdit>
 #include <QtCore/QSocketNotifier>
+#include <QtCore/QDir>
 
 #include "comm.h"
 
+#include "ui/KernelWindow.h"
+
 #define GPATH "loggr"
 #define IPATH "logi"
 #define NPATH "logn"
@@ -52,6 +55,9 @@
 #define NORM_COL       2
 
 
+namespace loglan {
+namespace vlp {
+
 /**
  * Interpreter slot
  */
@@ -80,54 +86,35 @@ public:
 class ConnectEntry {
 public:
        char addr[256];
-       
+
        ConnectEntry(char *s) {
                strcpy(addr, s);
        };
+
+       ConnectEntry(const char *s) {
+               strcpy(addr, s);
+       };
 };
 
 
 /**
  * Kernel class
  */
-class QKernel : public QMainWindow {
+class QKernel : public QMainWindow, private Ui::KernelWindow {
        Q_OBJECT
 public:
-       QTextEdit *desktop;
-       QMenuBar *bar;
-       QMenu *programMenu;
-       QMenu *machineMenu;
        QMenu *toolsMenu;
        char progdir[256];
        int NodeNumber;
        int ConType;
 
-       QKernel();
+       QKernel(int argc, char **argv);
 
-       virtual void resizeEvent(QResizeEvent *ev);
-
-       void WriteMessage(char* msg);
-       void InitMessage();
+       void WriteMessage(const char * msg);
 
 public slots:
-       void n_impl();
-       void Run_Prog();
-       void Edit();
-       void Help();
-       void SetOptions();
-       void AddAddress();
-       void DelAddress();
-       void LockConsole();
-       void UnlockConsole();
-       void MessageToNode();
-       void QuitProc();
        void NetMessage();
        void IntMessage(int);
-       void KillInterpreter();
-       void Disconnect();
-       void SetMessages();
-       void Connect();
-       void Info();
 
 protected:
        virtual void closeEvent (QCloseEvent * e);
@@ -135,7 +122,6 @@ protected:
 private:
        QList<InterpEntry*> Interpreters;
        QList<ConnectEntry*> ConnectList;
-       QListWidget *connections;
        
        /**
         * number of working interpreters
@@ -154,26 +140,17 @@ private:
        bool synchro;
        bool wait_for_info;
        char LockPasswd[25];
-       QAction * toolsEditorAction;
-       QAction * toolsOptionsAction;
-       QAction * toolsInfoAction;
-       QAction * programExecuteAction;
-       QAction * programKillAction;
-       QAction * machineMessageAction;
-       QAction * machineConnectAction;
-       QAction * machineDisconnectAction;
-       QAction * machineInfoAction;
-       QAction * toolsLockAction;
-       QAction * toolsUnlockAction;
-       QAction * quitAction;
        
        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);
@@ -187,6 +164,33 @@ private:
         * @param locked status which will be set on the menu entries.
         */
        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();
+       void on_actionQuit_triggered();
+       
+       void on_actionMessage_triggered();
+       void on_actionConnect_triggered();
+       void on_actionDisconnect_triggered();
+       void on_actionInfo_triggered();
+
+       void on_actionEditor_triggered();
+       void on_actionHelp_triggered();
+       void on_actionOptions_triggered();
+       void on_actionInfo_messages_triggered();
+       void on_actionLock_console_triggered();
+       void on_actionUnlock_console_triggered();
 };
 
+}
+}
+
 #endif /* VLP_KERNEL_H */