Move main lgconfig layout code into separate ui file
[vlp.git] / src / lgconfig / lgconfig.cpp
index 7c7fcb2ef49ebf1a7fc6253e091a3086bd1c7fc6..91baba33ff75ec40f21a4d0526f59e1f49caffd1 100644 (file)
 
 #include <libconfig.h>
 
-class VLPEntry {
-public:
-       int ID;
-       char addr[255];
-       /** 0 - explicit */
-       int type;
-       char progdir[255];
-       char homedir[255];
-       char item[255];
-};
-
-class QInstall: public QMainWindow {
-       Q_OBJECT
-public:
-       QMenuBar *bar;
-       Q3ListBox *nodelist;
-       QPushButton *infob;
-       QList<VLPEntry*> Nodes;
-
-       QInstall();
-       bool check_id(int);
-       bool check_addr(char*);
-
-public slots:
-       void SetOptions();
-       void AddNode();
-       void DelNode();
-       void Info();
-};
-
+#include "lgconfig.h"
 
 QApplication *app;
 
 QInstall::QInstall()
 {
-       QFont f("Helvetica", 12, QFont::Bold);
-       QPixmap mp;
-
-//     infob = new QPushButton(this);
-
-       setWindowTitle("VLP Configuration Tool");
-
-       QMenu * programMenu = NULL;
-       programMenu = menuBar()->addMenu("&Program");
-       programMenu->addAction("Configure", this, SLOT(SetOptions()));
-       programMenu->addAction("Quit", app, SLOT(quit()));
-
-//     bar = new QMenuBar(this);
-//     bar->insertItem("Configure", this, SLOT(SetOptions()));
-//     bar->insertItem("Quit", app, SLOT(quit()));
-//     bar->setFont(f);
-//     infob->setGeometry(0, bar->height(), 200, 30);
-       if (mp.load("logo.bmp")) {
-//             infob->setPixmap(mp);
-//             infob->resize(mp.width(), mp.height());
-       }
-//     resize(infob->width(), infob->height() + bar->height());
+       setupUi(this);
+
        Nodes.clear();
 }
 
@@ -109,13 +60,6 @@ bool QInstall::check_addr(char *addr)
        return TRUE;
 }
 
-/**
- * @attention Currently not in use
- */
-void QInstall::Info()
-{
-}
-
 void QInstall::AddNode()
 {
        QDialog dlg(this);
@@ -229,7 +173,7 @@ void QInstall::DelNode()
        }
 }
 
-void QInstall::SetOptions()
+void QInstall::on_actionConfigure_triggered()
 {
        QDialog dlg(this);
        QLabel *tmpQLabel;
@@ -329,7 +273,12 @@ void QInstall::SetOptions()
        }
 }
 
-#include "lgconfig.moc"
+
+void QInstall::on_actionQuit_triggered()
+{
+       QApplication::instance()->quit();
+}
+
 
 int main(int argc, char **argv)
 {