summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/remote/mainview.cpp5
-rw-r--r--noncore/tools/remote/mainview.h1
-rw-r--r--noncore/tools/remote/remote.cpp10
3 files changed, 16 insertions, 0 deletions
diff --git a/noncore/tools/remote/mainview.cpp b/noncore/tools/remote/mainview.cpp
index 8c87785..a00a75a 100644
--- a/noncore/tools/remote/mainview.cpp
+++ b/noncore/tools/remote/mainview.cpp
@@ -31,24 +31,29 @@ MainView::MainView(QWidget *parent, const char *name) : QWidget(parent, name)
31 remote = new RemoteTab(tabs); 31 remote = new RemoteTab(tabs);
32 learn = new LearnTab(tabs); 32 learn = new LearnTab(tabs);
33 config = new ConfigTab(tabs); 33 config = new ConfigTab(tabs);
34 help = new HelpTab(tabs); 34 help = new HelpTab(tabs);
35 connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) ); 35 connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) );
36 36
37 tabs->addTab(remote, tr("Remote") ); 37 tabs->addTab(remote, tr("Remote") );
38 tabs->addTab(learn,tr("Learn") ); 38 tabs->addTab(learn,tr("Learn") );
39 tabs->addTab(config,tr("Config") ); 39 tabs->addTab(config,tr("Config") );
40 tabs->addTab(help, tr("Help") ); 40 tabs->addTab(help, tr("Help") );
41 41
42 printf("1\n"); 42 printf("1\n");
43 cfg = new Config("Remote"); 43 cfg = new Config("Remote");
44 printf("2\n"); 44 printf("2\n");
45 45
46 remote->setConfig(cfg); 46 remote->setConfig(cfg);
47 config->setConfig(cfg); 47 config->setConfig(cfg);
48} 48}
49 49
50void MainView::updateRemotesList() 50void MainView::updateRemotesList()
51{ 51{
52 remote->updateRemotesList(); 52 remote->updateRemotesList();
53 printf("MainView: got remotes changed signal\n"); 53 printf("MainView: got remotes changed signal\n");
54} 54}
55
56void MainView::updateLearnTab()
57{
58 learn->updateRemotesList();
59}
diff --git a/noncore/tools/remote/mainview.h b/noncore/tools/remote/mainview.h
index b1ddde4..26b8086 100644
--- a/noncore/tools/remote/mainview.h
+++ b/noncore/tools/remote/mainview.h
@@ -22,31 +22,32 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22#include <qmessagebox.h> 22#include <qmessagebox.h>
23#include <qpaintdevice.h> 23#include <qpaintdevice.h>
24#include <qobject.h> 24#include <qobject.h>
25#include <sys/socket.h> 25#include <sys/socket.h>
26#include <sys/types.h> 26#include <sys/types.h>
27#include <sys/un.h> 27#include <sys/un.h>
28#include <unistd.h> 28#include <unistd.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <signal.h> 30#include <signal.h>
31 31
32#include "remotetab.h" 32#include "remotetab.h"
33#include "learntab.h" 33#include "learntab.h"
34#include "configtab.h" 34#include "configtab.h"
35#include "helptab.h" 35#include "helptab.h"
36 36
37#define BUFFERSIZE 256 37#define BUFFERSIZE 256
38 38
39class MainView : public QWidget 39class MainView : public QWidget
40{ 40{
41 Q_OBJECT 41 Q_OBJECT
42public: 42public:
43 MainView(QWidget *parent=0, const char *name=0); 43 MainView(QWidget *parent=0, const char *name=0);
44public slots: 44public slots:
45 void updateRemotesList(); 45 void updateRemotesList();
46 void updateLearnTab();
46private: 47private:
47 RemoteTab *remote; 48 RemoteTab *remote;
48 ConfigTab *config; 49 ConfigTab *config;
49 LearnTab *learn; 50 LearnTab *learn;
50 HelpTab *help; 51 HelpTab *help;
51 Config *cfg; 52 Config *cfg;
52}; 53};
diff --git a/noncore/tools/remote/remote.cpp b/noncore/tools/remote/remote.cpp
index 5b756cb..03d70c4 100644
--- a/noncore/tools/remote/remote.cpp
+++ b/noncore/tools/remote/remote.cpp
@@ -21,44 +21,54 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21#include <qpe/config.h> 21#include <qpe/config.h>
22 22
23/* QT */ 23/* QT */
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qtabwidget.h> 25#include <qtabwidget.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qpaintdevice.h> 28#include <qpaintdevice.h>
29#include <qobject.h> 29#include <qobject.h>
30 30
31/* STD */ 31/* STD */
32#include <sys/socket.h> 32#include <sys/socket.h>
33#include <sys/types.h> 33#include <sys/types.h>
34#include <sys/un.h> 34#include <sys/un.h>
35#include <unistd.h> 35#include <unistd.h>
36#include <stdio.h> 36#include <stdio.h>
37#include <signal.h> 37#include <signal.h>
38 38
39 39
40int main( int argc, char **argv ) 40int main( int argc, char **argv )
41{ 41{
42 QPEApplication a( argc, argv ); 42 QPEApplication a( argc, argv );
43 43
44 LircHandler lh; 44 LircHandler lh;
45 bool disablelirc = false;
45 46
46 lh.disableIrDA(); 47 lh.disableIrDA();
47 lh.setupModules(); 48 lh.setupModules();
48 lh.startLircd(); 49 lh.startLircd();
50
51 if(lh.checkLircdConfValid(false)) {
49 if(!lh.isLircdRunning()) { 52 if(!lh.isLircdRunning()) {
50 QMessageBox::critical(NULL, QObject::tr("Error"), 53 QMessageBox::critical(NULL, QObject::tr("Error"),
51 QObject::tr("Unable to start lircd"), 54 QObject::tr("Unable to start lircd"),
52 QMessageBox::Ok, QMessageBox::NoButton); 55 QMessageBox::Ok, QMessageBox::NoButton);
56 disablelirc = true;
57 }
58 }
59 else {
60 disablelirc = true;
53 } 61 }
54 62
55 MainView w; 63 MainView w;
64 if(!disablelirc)
65 w.updateLearnTab();
56 a.setMainWidget( &w ); 66 a.setMainWidget( &w );
57 QPEApplication::showWidget( &w ); 67 QPEApplication::showWidget( &w );
58 int result = a.exec(); 68 int result = a.exec();
59 69
60 lh.stopLircd(); 70 lh.stopLircd();
61 lh.cleanupModules(); 71 lh.cleanupModules();
62 72
63 return result; 73 return result;
64} 74}