- fixed console input mode restore
[enigma2.git] / main / enigma.cpp
index df28bcd..b055619 100644 (file)
@@ -21,6 +21,8 @@
 #include <lib/python/python.h>
 #include <lib/python/connections.h>
 
+#include <lib/gui/elistboxcontent.h>
+
 #include <lib/driver/rc.h>
 
 #ifdef OBJECT_DEBUG
@@ -51,17 +53,6 @@ void dumpRegion(const gRegion &region)
        }
 }
 
-
-class eMain: public eApplication, public Object
-{
-       eInit init;
-public:
-       eMain()
-       {
-               init.setRunlevel(eAutoInitNumbers::main);
-       }
-};
-
 eWidgetDesktop *wdsk;
 
 // typedef struct _object PyObject;
@@ -84,6 +75,47 @@ void keyEvent(const eRCKey &key)
                keyPressed(key.code);
 }
 
+/************************************************/
+#include <unistd.h>
+#include <lib/components/scan.h>
+#include <lib/dvb/idvb.h>
+#include <lib/dvb/dvb.h>
+#include <lib/dvb/db.h>
+
+class eMain: public eApplication, public Object
+{
+       eInit init;
+       
+       ePtr<eDVBResourceManager> m_mgr;
+       ePtr<eDVBDB> m_dvbdb;
+
+       ePtr<eComponentScan> m_scan;
+       
+public:
+       eMain()
+       {
+               init.setRunlevel(eAutoInitNumbers::main);
+
+                               /* TODO: put into init */
+               m_dvbdb = new eDVBDB();
+               m_mgr = new eDVBResourceManager();
+               
+               m_mgr->setChannelList(m_dvbdb);
+               
+//             m_scan = new eComponentScan();
+//             m_scan->start();
+
+       }
+       
+       ~eMain()
+       {
+               m_scan = 0;
+       }
+};
+
+/************************************************/
+
+
 int main(int argc, char **argv)
 {
 #ifdef OBJECT_DEBUG
@@ -91,9 +123,10 @@ int main(int argc, char **argv)
 #endif
 
 
-#if 1
+       ePython python;
        eMain main;
 
+#if 1
        ePtr<gFBDC> my_dc;
        gFBDC::getInstance(my_dc);
 
@@ -129,11 +162,11 @@ int main(int argc, char **argv)
        
        eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
        
-       ePython python;
-       
        printf("executing main\n");
        python.execute("mytest", "__main__");
 
+//     eApp->exec();
+
        return 0;
 }
 
@@ -146,3 +179,8 @@ void runMainloop()
 {
        eApp->exec();
 }
+
+void quitMainloop()
+{
+       eApp->quit(0);
+}