1 #ifndef __MAINWINDOW_H__
2 #define __MAINWINDOW_H__
5 #include <connection.hpp>
7 class MainWindow : public QPushButton
14 ConnectionChecker *cc = ConnectionChecker::instance ();
16 connect (cc, SIGNAL (connected (bool)), SLOT (connected (bool)));
18 setText (cc->isConnected () ? "Connected" : "Not connected");
19 connect (this, SIGNAL (clicked ()), SLOT (checkConnection ()));
23 void connected (bool active)
26 printf ("Device connected\n");
28 printf ("Device not connected\n");
29 setText (ConnectionChecker::instance ()->isConnected () ? "Connected" : "Not connected");
32 void checkConnection ()
34 ConnectionChecker::instance ()->requestState ();
38 #endif // __MAINWINDOW_H__