cadMousePro-gui/src/cadMouseProGUI.cpp
branchv_0
changeset 15 00783e323e66
parent 14 759edaff1755
child 16 2705911938b4
equal deleted inserted replaced
14:759edaff1755 15:00783e323e66
    15  * You should have received a copy of the GNU General Public License
    15  * You should have received a copy of the GNU General Public License
    16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    17  */
    17  */
    18 #include <iostream>
    18 #include <iostream>
    19 
    19 
    20 #include <QCoreApplication>
    20 #include <QApplication>
    21 #include <QtDBus/QDBusConnection>
    21 #include <QtDBus/QDBusConnection>
    22 
    22 
    23 #include "generated-sources/Proxy.h"
    23 #include "generated-sources/Proxy.h"
       
    24 #include "MouseMainWindow.h"
    24 
    25 
    25 int main(int argc, char** argv) {
    26 int main(int argc, char** argv) {
    26 
    27 
    27 	std::wcout << L"cadMousePro GUI" << std::endl;
    28 	std::wcout << L"cadMousePro GUI" << std::endl;
    28 
    29 
    29 
    30 
    30 	QCoreApplication qtApplication(argc, argv);
    31 	QApplication qtApplication(argc, argv);
       
    32 	
       
    33 	MouseMainWindow window;
       
    34 	window.show();
       
    35 	
    31 
    36 
    32 	QDBusConnection connection = QDBusConnection::systemBus();
    37 	QDBusConnection connection = QDBusConnection::systemBus();
    33 	
    38 	
    34 	InfoGlobalcodeMouseCadMouseProInterface* proxy = new InfoGlobalcodeMouseCadMouseProInterface("info.globalcode.mouse.cadMousePro", "/info/globalcode/mouse/cadMousePro", connection, &qtApplication);
    39 	InfoGlobalcodeMouseCadMouseProInterface* proxy = new InfoGlobalcodeMouseCadMouseProInterface("info.globalcode.mouse.cadMousePro", "/info/globalcode/mouse/cadMousePro", connection, &qtApplication);
    35 	
    40 
    36 	std::wcout << (proxy->isValid() ? L"connected" : L"disconnected") << std::endl;
    41 	std::wcout << (proxy->isValid() ? L"connected" : L"disconnected") << std::endl;
    37 	std::wcout << (proxy->devicePresent() ? L"mouse found" : L"mouse not found") << std::endl;
    42 	std::wcout << (proxy->devicePresent() ? L"mouse found" : L"mouse not found") << std::endl;
    38 	std::wcout << L"mouse name: " << proxy->deviceName().toStdWString() << std::endl;
    43 	std::wcout << L"mouse name: " << proxy->deviceName().toStdWString() << std::endl;
    39 	std::wcout << connection.lastError().message().toStdWString() << std::endl;
    44 	std::wcout << connection.lastError().message().toStdWString() << std::endl;
    40 
    45