commit d10b7efdc55748834007e342eae4e7365cd8bf08 Author: Melanie Date: Sat Nov 19 02:33:11 2016 +0000 Initial commit diff --git a/Consolas.ttf b/Consolas.ttf new file mode 100644 index 0000000..2d07794 Binary files /dev/null and b/Consolas.ttf differ diff --git a/ConsoleClient.pro b/ConsoleClient.pro new file mode 100644 index 0000000..3e97557 --- /dev/null +++ b/ConsoleClient.pro @@ -0,0 +1,39 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2016-11-16T16:46:32 +# +#------------------------------------------------- + +QT += core gui network xml + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = ConsoleClient +TEMPLATE = app + + +SOURCES += main.cpp\ + mainwindow.cpp \ + connectionpane.cpp \ + connectiondata.cpp \ + addconndialog.cpp \ + groupdata.cpp \ + addgroupdialog.cpp \ + preferencesdialog.cpp + +HEADERS += mainwindow.h \ + connectionpane.h \ + connectiondata.h \ + addconndialog.h \ + groupdata.h \ + addgroupdialog.h \ + preferencesdialog.h + +FORMS += mainwindow.ui \ + connectionpane.ui \ + addconndialog.ui \ + addgroupdialog.ui \ + preferencesdialog.ui + +RESOURCES += \ + Resources.qrc diff --git a/ConsoleClient.pro.user b/ConsoleClient.pro.user new file mode 100644 index 0000000..a6be5d1 --- /dev/null +++ b/ConsoleClient.pro.user @@ -0,0 +1,336 @@ + + + + + + EnvironmentId + {21a24881-731f-4679-9885-7d748f13cb82} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.7.0 clang 64bit + Desktop Qt 5.7.0 clang 64bit + qt.57.clang_64_kit + 0 + 0 + 0 + + /Users/melanie/yrgrid/build-ConsoleClient-Desktop_Qt_5_7_0_clang_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /Users/melanie/yrgrid/build-ConsoleClient-Desktop_Qt_5_7_0_clang_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /Users/melanie/yrgrid/build-ConsoleClient-Desktop_Qt_5_7_0_clang_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + ConsoleClient + + Qt4ProjectManager.Qt4RunConfiguration:/Users/melanie/yrgrid/ConsoleClient/ConsoleClient.pro + true + + ConsoleClient.pro + false + + /Users/melanie/yrgrid/build-ConsoleClient-Desktop_Qt_5_7_0_clang_64bit-Debug/ConsoleClient.app/Contents/MacOS + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d20cd46 --- /dev/null +++ b/Makefile @@ -0,0 +1,599 @@ +############################################################################# +# Makefile for building: ConsoleClient.app/Contents/MacOS/ConsoleClient +# Generated by qmake (3.0) (Qt 5.6.0) +# Project: ConsoleClient.pro +# Template: app +# Command: /Users/melanie/Qt5.6.0/5.6/clang_64/bin/qmake -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug -o Makefile ConsoleClient.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang +CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ +DEFINES = -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -pipe -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wall -W -fPIC $(DEFINES) +CXXFLAGS = -pipe -stdlib=libc++ -g -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wall -W -fPIC $(DEFINES) +INCPATH = -I. -I../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers -I../../Qt5.6.0/5.6/clang_64/lib/QtGui.framework/Headers -I../../Qt5.6.0/5.6/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../Qt5.6.0/5.6/clang_64/mkspecs/macx-clang -F/Users/melanie/Qt5.6.0/5.6/clang_64/lib +QMAKE = /Users/melanie/Qt5.6.0/5.6/clang_64/bin/qmake +DEL_FILE = rm -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +COPY = cp -f +COPY_FILE = cp -f +COPY_DIR = cp -f -R +INSTALL_FILE = install -m 644 -p +INSTALL_PROGRAM = install -m 755 -p +INSTALL_DIR = cp -f -R +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +TAR = tar -cf +COMPRESS = gzip -9f +DISTNAME = ConsoleClient1.0.0 +DISTDIR = /Users/melanie/yrgrid/ConsoleClient/.tmp/ConsoleClient1.0.0 +LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ +LFLAGS = -headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wl,-rpath,/Users/melanie/Qt5.6.0/5.6/clang_64/lib +LIBS = $(SUBLIBS) -F/Users/melanie/Qt5.6.0/5.6/clang_64/lib -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL +AR = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar cq +RANLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -s +SED = sed +STRIP = + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp \ + mainwindow.cpp moc_mainwindow.cpp +OBJECTS = main.o \ + mainwindow.o \ + moc_mainwindow.o +DIST = ../../Qt5.6.0/5.6/clang_64/mkspecs/features/spec_pre.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/qdevice.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/device_config.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/unix.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/mac.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/macx.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/sanitize.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/gcc-base.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/gcc-base-mac.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/clang.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/clang-mac.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/qconfig.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcollision.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcollision_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcore.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcore_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dinput.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dinput_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dlogic.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dlogic_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquick.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquick_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquickrender.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquickrender_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3drender.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3drender_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bluetooth.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_clucene_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_concurrent.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_core.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_core_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_dbus.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_dbus_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designer.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designer_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_enginio.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_enginio_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_gui.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_gui_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_help.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_help_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_labstemplates_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_location.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_location_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_macextras.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_macextras_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimedia.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_network.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_network_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_nfc.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_nfc_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_opengl.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_opengl_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_openglextensions.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_positioning.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_positioning_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_printsupport.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qml.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qml_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmltest.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quick.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quick_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_script.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_script_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_scripttools.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sensors.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sensors_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_serialport.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_serialport_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sql.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sql_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_svg.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_svg_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_testlib.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_testlib_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uiplugin.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uitools.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uitools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webchannel.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webchannel_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webengine.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webengine_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginecore.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginecore_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginewidgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginewidgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_websockets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_websockets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webview.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webview_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_widgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_widgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xml.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xml_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt_functions.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt_config.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/macx-clang/qmake.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/spec_post.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/exclusive_builds.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/default_pre.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/default_pre.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/resolve_config.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/default_post.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/sdk.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/default_post.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/objective_c.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qml_debug.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/warn_on.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/resources.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/moc.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/unix/opengl.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/uic.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/unix/thread.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/rez.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/testcase_targets.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/exceptions.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/yacc.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/lex.prf \ + ConsoleClient.pro mainwindow.h main.cpp \ + mainwindow.cpp +QMAKE_TARGET = ConsoleClient +DESTDIR = +TARGET = ConsoleClient.app/Contents/MacOS/ConsoleClient + + +first: all +####### Build rules + +$(TARGET): ui_mainwindow.h $(OBJECTS) + @test -d ConsoleClient.app/Contents/MacOS/ || mkdir -p ConsoleClient.app/Contents/MacOS/ + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: ConsoleClient.pro ../../Qt5.6.0/5.6/clang_64/mkspecs/macx-clang/qmake.conf ../../Qt5.6.0/5.6/clang_64/mkspecs/features/spec_pre.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/qdevice.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/device_config.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/unix.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/mac.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/macx.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/sanitize.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/gcc-base.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/gcc-base-mac.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/clang.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/common/clang-mac.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/qconfig.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcollision.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcollision_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcore.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcore_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dinput.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dinput_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dlogic.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dlogic_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquick.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquick_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquickrender.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquickrender_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3drender.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3drender_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bluetooth.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_clucene_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_concurrent.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_core.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_core_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_dbus.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_dbus_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designer.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designer_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_enginio.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_enginio_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_gui.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_gui_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_help.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_help_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_labstemplates_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_location.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_location_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_macextras.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_macextras_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimedia.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_network.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_network_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_nfc.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_nfc_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_opengl.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_opengl_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_openglextensions.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_positioning.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_positioning_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_printsupport.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qml.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qml_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmltest.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quick.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quick_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_script.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_script_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_scripttools.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sensors.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sensors_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_serialport.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_serialport_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sql.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sql_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_svg.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_svg_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_testlib.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_testlib_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uiplugin.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uitools.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uitools_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webchannel.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webchannel_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webengine.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webengine_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginecore.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginecore_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginewidgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginewidgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_websockets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_websockets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webview.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webview_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_widgets.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_widgets_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xml.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xml_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt_functions.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt_config.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/macx-clang/qmake.conf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/spec_post.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/exclusive_builds.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/default_pre.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/default_pre.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/resolve_config.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/default_post.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/sdk.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/default_post.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/objective_c.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qml_debug.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/warn_on.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/resources.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/moc.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/unix/opengl.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/uic.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/unix/thread.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/rez.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/testcase_targets.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/exceptions.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/yacc.prf \ + ../../Qt5.6.0/5.6/clang_64/mkspecs/features/lex.prf \ + ConsoleClient.pro \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/QtWidgets.prl \ + ../../Qt5.6.0/5.6/clang_64/lib/QtGui.framework/QtGui.prl \ + ../../Qt5.6.0/5.6/clang_64/lib/QtCore.framework/QtCore.prl + $(QMAKE) -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug -o Makefile ConsoleClient.pro +../../Qt5.6.0/5.6/clang_64/mkspecs/features/spec_pre.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/qdevice.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/device_config.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/unix.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/mac.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/macx.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/sanitize.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/gcc-base.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/gcc-base-mac.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/clang.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/common/clang-mac.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/qconfig.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcollision.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcollision_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcore.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dcore_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dinput.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dinput_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dlogic.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dlogic_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquick.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquick_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquickrender.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3dquickrender_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3drender.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_3drender_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bluetooth.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_clucene_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_concurrent.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_core.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_core_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_dbus.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_dbus_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designer.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designer_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_enginio.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_enginio_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_gui.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_gui_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_help.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_help_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_labstemplates_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_location.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_location_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_macextras.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_macextras_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimedia.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_network.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_network_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_nfc.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_nfc_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_opengl.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_opengl_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_openglextensions.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_positioning.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_positioning_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_printsupport.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qml.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qml_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmltest.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quick.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quick_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_script.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_script_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_scripttools.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sensors.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sensors_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_serialport.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_serialport_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sql.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_sql_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_svg.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_svg_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_testlib.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_testlib_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uiplugin.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uitools.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_uitools_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webchannel.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webchannel_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webengine.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webengine_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginecore.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginecore_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginewidgets.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webenginewidgets_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_websockets.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_websockets_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webview.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_webview_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_widgets.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_widgets_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xml.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xml_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt_functions.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt_config.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/macx-clang/qmake.conf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/spec_post.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/exclusive_builds.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/default_pre.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/default_pre.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/resolve_config.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/default_post.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/sdk.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/default_post.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/objective_c.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/qml_debug.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/warn_on.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/qt.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/resources.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/moc.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/unix/opengl.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/uic.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/unix/thread.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/mac/rez.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/testcase_targets.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/exceptions.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/yacc.prf: +../../Qt5.6.0/5.6/clang_64/mkspecs/features/lex.prf: +ConsoleClient.pro: +../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/QtWidgets.prl: +../../Qt5.6.0/5.6/clang_64/lib/QtGui.framework/QtGui.prl: +../../Qt5.6.0/5.6/clang_64/lib/QtCore.framework/QtCore.prl: +qmake: FORCE + @$(QMAKE) -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug -o Makefile ConsoleClient.pro + +qmake_all: FORCE + +ConsoleClient.app/Contents/PkgInfo: + @test -d ConsoleClient.app/Contents || mkdir -p ConsoleClient.app/Contents + @$(DEL_FILE) ConsoleClient.app/Contents/PkgInfo + @echo "APPL????" > ConsoleClient.app/Contents/PkgInfo +ConsoleClient.app/Contents/Resources/empty.lproj: + @test -d ConsoleClient.app/Contents/Resources || mkdir -p ConsoleClient.app/Contents/Resources + @touch ConsoleClient.app/Contents/Resources/empty.lproj + +ConsoleClient.app/Contents/Info.plist: + @test -d ConsoleClient.app/Contents || mkdir -p ConsoleClient.app/Contents + @$(DEL_FILE) ConsoleClient.app/Contents/Info.plist + @sed -e "s,@SHORT_VERSION@,1.0,g" -e "s,@FULL_VERSION@,1.0.0,g" -e "s,@TYPEINFO@,????,g" -e "s,@BUNDLEIDENTIFIER@,com.careminster.ConsoleClient,g" -e "s,@ICON@,,g" -e "s,@EXECUTABLE@,ConsoleClient,g" -e "s,@LIBRARY@,ConsoleClient,g" -e "s,@TYPEINFO@,????,g" ../../Qt5.6.0/5.6/clang_64/mkspecs/macx-clang/Info.plist.app >ConsoleClient.app/Contents/Info.plist + +all: Makefile \ + ConsoleClient.app/Contents/PkgInfo \ + ConsoleClient.app/Contents/Resources/empty.lproj \ + ConsoleClient.app/Contents/Info.plist $(TARGET) + +dist: distdir FORCE + (cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR) + +distdir: FORCE + @test -d $(DISTDIR) || mkdir -p $(DISTDIR) + $(COPY_FILE) --parents $(DIST) $(DISTDIR)/ + $(COPY_FILE) --parents mainwindow.h $(DISTDIR)/ + $(COPY_FILE) --parents main.cpp mainwindow.cpp $(DISTDIR)/ + $(COPY_FILE) --parents mainwindow.ui $(DISTDIR)/ + + +clean: compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) -r ConsoleClient.app + -$(DEL_FILE) .qmake.stash + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: moc_mainwindow.cpp +compiler_moc_header_clean: + -$(DEL_FILE) moc_mainwindow.cpp +moc_mainwindow.cpp: ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/QMainWindow \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h \ + mainwindow.h + /Users/melanie/Qt5.6.0/5.6/clang_64/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/Users/melanie/Qt5.6.0/5.6/clang_64/mkspecs/macx-clang -I/Users/melanie/yrgrid/ConsoleClient -I/Users/melanie/Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers -I/Users/melanie/Qt5.6.0/5.6/clang_64/lib/QtGui.framework/Headers -I/Users/melanie/Qt5.6.0/5.6/clang_64/lib/QtCore.framework/Headers -F/Users/melanie/Qt5.6.0/5.6/clang_64/lib mainwindow.h -o moc_mainwindow.cpp + +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_mainwindow.h +compiler_uic_clean: + -$(DEL_FILE) ui_mainwindow.h +ui_mainwindow.h: mainwindow.ui + /Users/melanie/Qt5.6.0/5.6/clang_64/bin/uic mainwindow.ui -o ui_mainwindow.h + +compiler_rez_source_make_all: +compiler_rez_source_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_uic_clean + +####### Compile + +main.o: main.cpp mainwindow.h \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/QMainWindow \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/QApplication \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/qapplication.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +mainwindow.o: mainwindow.cpp mainwindow.h \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/QMainWindow \ + ../../Qt5.6.0/5.6/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h \ + ui_mainwindow.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp + +moc_mainwindow.o: moc_mainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/Resources.qrc b/Resources.qrc new file mode 100644 index 0000000..ee62e82 --- /dev/null +++ b/Resources.qrc @@ -0,0 +1,22 @@ + + + view-refresh.png + computer.png + folder.png + document-properties.png + edit-delete.png + network-transmit-receive.png + network-offline.png + document-new.png + edit-clear.png + edit-copy.png + edit-cut.png + edit-paste.png + system-log-out.png + tab-new.png + systemPreferences.png + + + Consolas.ttf + + diff --git a/addconndialog.cpp b/addconndialog.cpp new file mode 100644 index 0000000..0717479 --- /dev/null +++ b/addconndialog.cpp @@ -0,0 +1,33 @@ +#include "addconndialog.h" +#include "ui_addconndialog.h" + +AddConnDialog::AddConnDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AddConnDialog) +{ + ui->setupUi(this); + + Name = ui->Name; + Host = ui->Host; + Port = ui->Port; + User = ui->User; + Pass = ui->Pass; + + connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(OnOK())); + connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(OnCancel())); +} + +AddConnDialog::~AddConnDialog() +{ + delete ui; +} + +void AddConnDialog::OnOK() +{ + done(0); +} + +void AddConnDialog::OnCancel() +{ + done(-1); +} diff --git a/addconndialog.h b/addconndialog.h new file mode 100644 index 0000000..a0e4209 --- /dev/null +++ b/addconndialog.h @@ -0,0 +1,35 @@ +#ifndef ADDCONNDIALOG_H +#define ADDCONNDIALOG_H + +#include + +class QLineEdit; +class QSpinBox; + +namespace Ui { +class AddConnDialog; +} + +class AddConnDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AddConnDialog(QWidget *parent = 0); + ~AddConnDialog(); + + QLineEdit *Name; + QLineEdit *Host; + QSpinBox *Port; + QLineEdit *User; + QLineEdit *Pass; + +public slots: + void OnCancel(); + void OnOK(); + +private: + Ui::AddConnDialog *ui; +}; + +#endif // ADDCONNDIALOG_H diff --git a/addconndialog.ui b/addconndialog.ui new file mode 100644 index 0000000..8fffb50 --- /dev/null +++ b/addconndialog.ui @@ -0,0 +1,179 @@ + + + AddConnDialog + + + + 0 + 0 + 430 + 270 + + + + Edit connection + + + + + 320 + 20 + 91 + 81 + + + + Qt::RightToLeft + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 161 + 20 + + + + Connection Name + + + + + + 10 + 30 + 291 + 28 + + + + New Connection + + + + + + 10 + 60 + 101 + 20 + + + + Host Name + + + + + + 10 + 80 + 291 + 28 + + + + localhost + + + + + + 10 + 110 + 77 + 20 + + + + Port + + + + + + 10 + 130 + 121 + 30 + + + + 1 + + + 65535 + + + 9000 + + + + + + 10 + 160 + 101 + 20 + + + + User Name + + + + + + 10 + 180 + 291 + 28 + + + + + + + 10 + 210 + 91 + 20 + + + + Password + + + + + + 10 + 230 + 291 + 28 + + + + QLineEdit::Password + + + + + Name + Host + Port + User + Pass + buttonBox + + + + diff --git a/addgroupdialog.cpp b/addgroupdialog.cpp new file mode 100644 index 0000000..9b9e7cb --- /dev/null +++ b/addgroupdialog.cpp @@ -0,0 +1,30 @@ +#include "addgroupdialog.h" +#include "ui_addgroupdialog.h" + +AddGroupDialog::AddGroupDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AddGroupDialog) +{ + ui->setupUi(this); + + Name = ui->Name; + Dns = ui->Dns; + + connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(OnOK())); + connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(OnCancel())); +} + +AddGroupDialog::~AddGroupDialog() +{ + delete ui; +} + +void AddGroupDialog::OnOK() +{ + done(0); +} + +void AddGroupDialog::OnCancel() +{ + done(-1); +} diff --git a/addgroupdialog.h b/addgroupdialog.h new file mode 100644 index 0000000..068820d --- /dev/null +++ b/addgroupdialog.h @@ -0,0 +1,30 @@ +#ifndef ADDGROUPDIALOG_H +#define ADDGROUPDIALOG_H + +#include + +class QLineEdit; + +namespace Ui { +class AddGroupDialog; +} + +class AddGroupDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AddGroupDialog(QWidget *parent = 0); + ~AddGroupDialog(); + + QLineEdit *Name; + QLineEdit *Dns; + +protected slots: + void OnOK(); + void OnCancel(); +private: + Ui::AddGroupDialog *ui; +}; + +#endif // ADDGROUPDIALOG_H diff --git a/addgroupdialog.ui b/addgroupdialog.ui new file mode 100644 index 0000000..d7787fa --- /dev/null +++ b/addgroupdialog.ui @@ -0,0 +1,114 @@ + + + AddGroupDialog + + + + 0 + 0 + 400 + 120 + + + + Edit group + + + + + 290 + 20 + 81 + 81 + + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 13 + 65 + 74 + 16 + + + + Nameserver + + + + + + 13 + 11 + 36 + 16 + + + + Name + + + + + + 10 + 26 + 269 + 21 + + + + + + + 10 + 80 + 269 + 21 + + + + + + + + buttonBox + accepted() + AddGroupDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AddGroupDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/computer.png b/computer.png new file mode 100644 index 0000000..d0b397b Binary files /dev/null and b/computer.png differ diff --git a/connectiondata.cpp b/connectiondata.cpp new file mode 100644 index 0000000..c2b73e7 --- /dev/null +++ b/connectiondata.cpp @@ -0,0 +1,6 @@ +#include "connectiondata.h" + +ConnectionData::ConnectionData() +{ + +} diff --git a/connectiondata.h b/connectiondata.h new file mode 100644 index 0000000..d6b3543 --- /dev/null +++ b/connectiondata.h @@ -0,0 +1,23 @@ +#ifndef CONNECTIONDATA_H +#define CONNECTIONDATA_H + +#include +#include + +class ConnectionData +{ +public: + ConnectionData(); + + QUuid Uuid; + QString Name; + + QUuid Group; + + QString Host; + int Port; + QString User; + QString Pass; +}; + +#endif // CONNECTIONDATA_H diff --git a/connectionpane.cpp b/connectionpane.cpp new file mode 100644 index 0000000..0d91e1c --- /dev/null +++ b/connectionpane.cpp @@ -0,0 +1,892 @@ +#include "connectionpane.h" +#include "ui_connectionpane.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "connectiondata.h" + +struct CommandData +{ +public: + QString Module; + QString HelpText; + QString LongHelp; + QString Description; + ConnectionPane *instance; + void (*fn)(QString module, ConnectionPane *instance, QStringList args); +}; + +Q_DECLARE_METATYPE (CommandData) + +ConnectionPane::ConnectionPane(ConnectionData *c, QHostAddress addr, QWidget *parent) : + QWidget(parent), + ui(new Ui::ConnectionPane) +{ + ui->setupUi(this); + + Name = c->Name; + Host = c->Host; + Port = c->Port; + User = c->User; + Pass = c->Pass; + + loggedIn = false; + + QDnsLookup lookup; + + if (!addr.isNull()) + { + lookup.setNameserver(addr); + + QHostAddress dest(Host); + if (dest.isNull()) + { + lookup.setName(Host); + lookup.setType(QDnsLookup::A); + + QEventLoop loop; + connect(&lookup, SIGNAL(finished()), &loop, SLOT(quit())); + + lookup.lookup(); + loop.exec(); + + if (lookup.error() == QDnsLookup::NoError) + Host = lookup.hostAddressRecords().first().value().toString(); + } + } + + // Construct the URLs + urlStart.setScheme(QString("http")); + urlStart.setHost(Host); + urlStart.setPort(Port); + + urlClose = urlStart; + urlCommand = urlStart; + urlPoll = urlStart; + + urlStart.setPath(QString("/StartSession/")); + urlClose.setPath(QString("/CloseSession/")); + urlCommand.setPath(QString("/SessionCommand/")); + + // Construct the manager + manager = new QNetworkAccessManager(this); + + pollReply = 0; + loginReply = 0; + cmdReply = 0; + + int id = QFontDatabase::addApplicationFont(":/fonts/Consolas.ttf"); + QString family = QFontDatabase::applicationFontFamilies(id).at(0); + + QSettings settings; + + QString styleSheet; + + if (!settings.value("system_font", false).toBool()) + styleSheet += "font-family: " + family + ";"; + if (settings.value("black_on_white", false).toBool()) + styleSheet += "background-color: black; color: white;"; + else + styleSheet += "background-color: #fcfcfc; color: black;"; + styleSheet += "font-size: 18pt;"; + + ui->mainPane->setStyleSheet(styleSheet); +} + +ConnectionPane::~ConnectionPane() +{ + QNetworkAccessManager *m = manager; + manager = 0; + delete m; + + delete ui; +} + +void ConnectionPane::CommandReply() +{ + QByteArray result = cmdReply->readAll(); + cmdReply->deleteLater(); + cmdReply = 0; + + ui->textEntry->setText(QString("")); + TextChanged(""); +} + +void ConnectionPane::LoginReply() +{ + QByteArray result = loginReply->readAll(); + loginReply->deleteLater(); + + if (result.size() == 0) + { + ui->mainPane->setHtml("Connecting ...
Error!"); + QMessageBox::critical(0, QString("Connection error"), QString("Connection to host failed")); + return; + } + + QDomDocument doc; + doc.setContent(result, false); + + QDomElement root = doc.documentElement(); + + // Get session ID + QDomNodeList sessionL = root.elementsByTagName(QString("SessionID")); + QDomNode sessionNode = sessionL.at(0); + sessionID = sessionNode.toElement().text(); + + urlPoll.setPath(QString("/ReadResponses/")+sessionID+QString("/")); + + QDomNodeList helpL = root.elementsByTagName(QString("HelpTree")); + QDomNode helpNode = helpL.at(0); + + ui->mainPane->setHtml(ui->mainPane->toHtml() + QString("Connected")); + tree.clear(); + + tree = ProcessTreeLevel(helpNode, tree); + + QMap nextLevel; + if (tree.contains("help")) + nextLevel = tree["help"].toMap(); + + CommandData cmd; + cmd.Module = "Local"; + cmd.HelpText = "help []"; + cmd.LongHelp = "Provide help for commands"; + cmd.Description = "Provide help for commands"; + cmd.instance = this; + cmd.fn = Help; + + QVariant v; + v.setValue(cmd); + nextLevel[""] = v; + + tree["help"] = nextLevel; + + nextLevel.clear(); + if (tree.contains("quit:")) + nextLevel = tree["quit"].toMap(); + + cmd.Module = "Local"; + cmd.HelpText = "quit"; + cmd.LongHelp = "Quit console session"; + cmd.Description = "Quit console session"; + cmd.instance = this; + cmd.fn = Quit; + + v.setValue(cmd); + nextLevel[""] = v; + + tree["quit"] = nextLevel; + + // Construct the poll request + QString data = ""; + QNetworkRequest request(urlPoll); + request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/x-www-form-urlencoded")); + + // Start poll + pollReply = manager->post(request, data.toLatin1()); + connect(pollReply, SIGNAL(finished()), this, SLOT(PollReply())); + + ui->textEntry->setFocus(); + TextChanged(QString("")); + + connect(ui->textEntry, SIGNAL(returnPressed()), this, SLOT(ReturnPressed())); + connect(ui->textEntry, SIGNAL(textChanged(QString)), this, SLOT(TextChanged(QString))); + + loggedIn = true; +} + +void ConnectionPane::PollReply() +{ + if (manager == 0) + return; + + QByteArray result = pollReply->readAll(); + + //qDebug() << QString(result); + pollReply->deleteLater(); + + QString fullText; + + if (result.size() != 0) + { + QDomDocument doc; + doc.setContent(result, false); + + QDomElement root = doc.documentElement(); + + QDomNodeList lineL = root.elementsByTagName(QString("Line")); + + for (int i = 0 ; i < lineL.count() ; i++) + { + QDomElement e = lineL.at(i).toElement(); + + QString level; + bool prompt = false; + bool command = false; + bool input = false; + + if (e.hasAttribute("Level")) + level = e.attributeNode("Level").value(); + + if (e.hasAttribute("Prompt")) + { + if (e.attributeNode("Prompt").value() == "true") + prompt = true; + } + + if (e.hasAttribute("Command")) + { + if (e.attributeNode("Command").value() == "true") + command = true; + } + + if (e.hasAttribute("Input")) + { + if (e.attributeNode("Input").value() == "true") + input = true; + } + + QString line = e.text(); + + if (!input) + fullText += QString("
"); + fullText += FormatLine(line.trimmed(), level).replace("\n", "
"); + if (fullText.endsWith("
")) + fullText = fullText.mid(fullText.length() - 4); + + if (prompt || command) + { + expectingInput = true; + if (command) + expectingCommand = true; + } + } + } + + textContent += fullText; + if (textContent.length() > 131400) + textContent = textContent.right(131400); + + ui->mainPane->setHtml(textContent); + + ui->mainPane->moveCursor(QTextCursor::End); + ui->mainPane->ensureCursorVisible(); + + if (!loggedIn) + return; + + TextChanged(ui->textEntry->text()); + + // Construct the poll request + QString data = ""; + QNetworkRequest request(urlPoll); + request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/x-www-form-urlencoded")); + + // Poll again + pollReply = manager->post(request, data.toLatin1()); + connect(pollReply, SIGNAL(finished()), this, SLOT(PollReply())); +} + +void ConnectionPane::TextChanged(QString text) +{ + if (!expectingInput) + ui->helpArea->hide(); + else if (!expectingCommand) + ui->helpArea->hide(); + else + ui->helpArea->show(); + + ui->mainPane->moveCursor(QTextCursor::End); + ui->mainPane->ensureCursorVisible(); + + QStringList words = Parse(text); + + bool trailingSpace = text.right(1) == " "; + + QStringList opts = FindNextOption(words, trailingSpace); + + if (opts.size() == 0) + { + ui->helpArea->setText(QString("")); + } + else + { + QString first = opts.at(0); + if (first.indexOf(QString("Command help:")) == 0) + ui->helpArea->setText(first); + else if (text != "") + { + QString output; + output.sprintf("Options: %s", opts.join(" ").toLocal8Bit().data()); + ui->helpArea->setText(output); + } + else + { + QString output; + output.sprintf("Commands: %s", opts.join(" ").toLocal8Bit().data()); + ui->helpArea->setText(output); + } + } +} + +void ConnectionPane::ReturnPressed() +{ + // Construct the command + QString cmd = ui->textEntry->text(); + + if ((!expectingCommand) && expectingInput) + { + if (SendCommand(cmd)) + { + ui->textEntry->setText(QString("")); + TextChanged(ui->textEntry->text()); + } + } + + QStringList resolved = Resolve(Parse(cmd)); + QString historyEntry = resolved.join(" "); +} + +void ConnectionPane::Login() +{ + QUrlQuery queryString; + + queryString.addQueryItem("USER", User); + queryString.addQueryItem("PASS", Pass); + + // Construct the login request + QString data = queryString.query(QUrl::FullyEncoded).toUtf8(); + + QNetworkRequest request(urlStart); + request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/x-www-form-urlencoded")); + + // Log in + + ui->mainPane->setHtml(ui->mainPane->toHtml() + QString("Connecting ...")); + loginReply = manager->post(request, data.toLatin1()); + connect(loginReply, SIGNAL(finished()), this, SLOT(LoginReply())); +} + +void ConnectionPane::CloseConnection() +{ + close(); +} + +void ConnectionPane::ClearScrollback() +{ + ui->mainPane->setHtml(QString("")); +} + +void ConnectionPane::Copy() +{ + ui->mainPane->copy(); +} + +void ConnectionPane::RestartServer() +{ + if (!loggedIn) + return; + + SendCommand("quit"); + + ui->mainPane->setHtml(ui->mainPane->toHtml() + QString("Disconnected")); + pollReply->abort(); + + loggedIn = false; + + QTimer::singleShot(5000, this, SLOT(Login())); +} + +bool ConnectionPane::IsLoggedIn() +{ + return loggedIn; +} + +QStringList ConnectionPane::CollectHelp(QStringList helpParts) +{ + QString originalHelpRequest = helpParts.join(" "); + + QStringList help; + + QMap dict = tree; + while (helpParts.size() > 0) + { + QString helpPart = helpParts.at(0); + + if (!dict.contains(helpPart)) + break; + + QVariant val = dict[helpPart]; + if (QString(val.typeName()) == QString("QVariantMap")) + { + dict = val.toMap(); + } + + helpParts.removeFirst(); + + } + + if (dict.contains(QString(""))) + { + QVariant v = dict[QString("")]; + CommandData ci = v.value(); + + help.append(ci.HelpText); + help.append(ci.LongHelp); + // help.append(ci.Description); + } + else + { + help.append(QString("No help is available for ") + originalHelpRequest); + } + + return help;} + +QStringList ConnectionPane::Parse(QString text) +{ + QStringList result; + int index = 0; + + QStringList unquoted = text.split("\""); + + for (index = 0 ; index < unquoted.size() ; index++) + { + if ((index % 2) == 0) + { + QStringList words = unquoted.at(index).split(" "); + + for (int i = 0 ; i < words.size() ; i++) + { + QString w = words.at(i); + if (w != QString("")) + result.append(w); + } + } + else + { + result.append(unquoted.at(index)); + } + } + + return result; +} + +QStringList ConnectionPane::Resolve(QStringList cmd) +{ + QStringList result(cmd); + int index = -1; + + QMap current = tree; + + for (int i = 0 ; i < cmd.size() ; i++) + { + QString s = cmd.at(i); + + index++; + + QStringList found; + + for (QMap::iterator it = current.begin() ; it != current.end() ; it++) + { + QString opt = it.key(); + + if (opt == s) + { + found.clear(); + found.append(opt); + break; + } + if (opt.indexOf(s) == 0) + { + found.append(opt); + } + } + + if (found.size() == 1) + { + result[index] = found.at(0); + current = current[found.at(0)].toMap(); + } + else if (found.size() > 0) + { + QStringList blank; + return blank; + } + else + { + break; + } + } + + if (current.contains(QString(""))) + { + QVariant v = current[QString("")]; + CommandData ci = v.value(); + + if (!ci.fn) + return QStringList(); + + (*ci.fn)(ci.Module, ci.instance, result); + + return result; + } + + return QStringList(); +} + +QStringList ConnectionPane::FindNextOption(QStringList cmd, bool term) +{ + QMap current = tree; + + int remaining = cmd.size(); + + for (int i = 0 ; i < cmd.size() ; i++) + { + QString s = cmd.at(i); + + remaining--; + + QStringList found; + + for (QMap::iterator it = current.begin() ; it != current.end() ; it++) + { + QString opt = it.key(); + + if (remaining > 0 && opt == s) + { + found.clear(); + found.append(opt); + break; + } + if (opt.indexOf(s) == 0) + { + found.append(opt); + } + } + + if (found.size() == 1 && ((remaining != 0) || term)) + { + current = current[found.at(0)].toMap(); + } + else if (found.size() > 0) + { + return found; + } + else + { + break; + } + } + + if (current.size() > 1) + { + QStringList choices; + + bool addcr = false; + for (QMap::iterator it = current.begin() ; it != current.end() ; it++) + { + QString s = it.key(); + + if (s == QString("")) + { + QVariant v = current[""]; + CommandData ci = v.value(); + if (ci.fn) + addcr = true; + + } + else + choices.append(s); + } + if (addcr) + choices.append(""); + + return choices; + } + + if (current.contains(QString(""))) + { + QVariant v = current[""]; + CommandData ci = v.value(); + + QStringList ch; + ch.append(QString("Command help: ") + ci.HelpText); + return ch; + } + + QList kl = current.keys(); + QStringList ksl(kl); + + return ksl; +} + +void ConnectionPane::Help(QString, ConnectionPane *instance, QStringList args) +{ + instance->ui->mainPane->setHtml(instance->ui->mainPane->toHtml()+instance->OutputLine(QString("# ") + args.join(" "), "command")); + + instance->ui->mainPane->moveCursor(QTextCursor::End); + instance->ui->mainPane->ensureCursorVisible(); + + QStringList help; + QStringList helpParts(args); + + helpParts.removeFirst(); + + instance->ui->textEntry->setText(QString("")); + instance->ui->helpArea->setText(QString("")); + + if (helpParts.size() == 0) + help = instance->CollectHelp(help, instance->tree); + else + help = help + instance->CollectHelp(helpParts); + + for (int i = 0 ; i < help.size() ; i++) + { + instance->ui->mainPane->setHtml(instance->ui->mainPane->toHtml()+instance->OutputLine(help.at(i), "normal")); + } + instance->ui->mainPane->moveCursor(QTextCursor::End); + instance->ui->mainPane->ensureCursorVisible(); +} + +void ConnectionPane::Quit(QString, ConnectionPane *instance, QStringList) +{ + instance->ui->mainPane->setHtml(instance->ui->mainPane->toHtml()+instance->OutputLine("# quit", "command")); + instance->ui->mainPane->setHtml(instance->ui->mainPane->toHtml()+instance->OutputLine("Use the toolbar button to close session", "error")); + instance->ui->mainPane->moveCursor(QTextCursor::End); + instance->ui->mainPane->ensureCursorVisible(); + + instance->ui->textEntry->setText(QString("")); + instance->ui->helpArea->setText(QString("")); +} + +QStringList ConnectionPane::CollectHelp(QStringList help, QMap level) +{ + for (QMap::iterator it = level.begin() ; it != level.end() ; it++) + { + QString key = it.key(); + QVariant val = it.value(); + + if (QString(val.typeName()) == QString("QVariantMap")) + { + QMap nextLevel = val.toMap(); + help = CollectHelp(help, nextLevel); + } + else + { + CommandData cmd = val.value(); + QString item = cmd.HelpText + QString(" - ") + cmd.LongHelp; + help.append(item); + } + } + + return help; +} + +void ConnectionPane::CommandHandler(QString, ConnectionPane *instance, QStringList args) +{ + QString cmd = args.join(" "); + if(instance->SendCommand(cmd)) + { + //instance->ui->mainPane->setHtml(instance->ui->mainPane->toHtml()+instance->OutputLine(QString("# ") + args.join(" "), "command")); + + //instance->ui->mainPane->moveCursor(QTextCursor::End); + //instance->ui->mainPane->ensureCursorVisible(); + + //instance->ui->textEntry->setText(QString("")); + //instance->ui->helpArea->setText(QString("")); + + } +} + +QString ConnectionPane::FormatLine(QString line, QString level) +{ + if (level == "") + return line; + + QRegExp re(QString("^(.*)\\[(.*)\\](.*)$")); + QString ret; + + if (re.exactMatch(line)) + { + QString color = GetColor(re.cap(2)); + ret = re.cap(1)+QString("[")+re.cap(2)+QString("]"); + + line = re.cap(3); + } + + if (level == QString("error")) + { + ret += QString("") + QString(line.toHtmlEscaped()) + QString(""); + } + else if (level == QString("warn")) + { + ret += QString("") + QString(line.toHtmlEscaped()) + QString(""); + } + else if (level == QString("command")) + { + ret += QString("") + QString(line.toHtmlEscaped()) + QString(""); + } + else + { + ret += QString(line.toHtmlEscaped()); + } + + return ret; +} + +QString ConnectionPane::OutputLine(QString line, QString level) +{ + QString ret; + + if (level == QString("error")) + { + ret += QString("") + QString(line.toHtmlEscaped()) + QString(""); + } + else if (level == QString("warn")) + { + ret += QString("") + QString(line.toHtmlEscaped()) + QString(""); + } + else if (level == QString("command")) + { + ret += QString("") + QString(line.toHtmlEscaped()) + QString(""); + } + else + { + ret += QString(line.toHtmlEscaped()); + } + + return ret; +} + +QString ConnectionPane::GetColor(QString text) +{ + QList colors; + + colors.append(QString("#7f7f7f")); + colors.append(QString("#0000ff")); + colors.append(QString("#00cf00")); + colors.append(QString("#00cfcf")); + colors.append(QString("#cf00cf")); + colors.append(QString("#cfcf00")); + + return colors.at(qHash(text.toUpper()) % colors.size()); +} + +/* +void ConnectionPane::DumpTree(QMap level) +{ + QMap::iterator it; + + for (it = level.begin() ; it != level.end() ; it++) + { + QVariant val = it.value(); + QString key = it.key(); + + if (QString(val.typeName()) == QString("QVariantMap")) + { + printf("Level: %s\n", key.toAscii().data()); + QMap nextLevel = val.toMap(); + DumpTree(nextLevel); + } + else + { + CommandData cmd = val.value(); + printf("%s\n", cmd.HelpText.toAscii().data()); + } + } +} +*/ + +bool ConnectionPane::SendCommand(QString cmd) +{ + if (cmdReply) + return false; + + QUrlQuery queryString; + + queryString.addQueryItem("ID", sessionID); + queryString.addQueryItem("COMMAND", cmd); + + QString data = queryString.query(QUrl::FullyEncoded).toUtf8(); + + QNetworkRequest request(urlCommand); + + // Send it + cmdReply = manager->post(request, data.toLatin1()); + connect(cmdReply, SIGNAL(finished()), this, SLOT(CommandReply())); + + return true; +} + +QMap ConnectionPane::ProcessTreeLevel(QDomNode node, QMap level) +{ + QDomNodeList levelL = node.childNodes(); + for (int i = 0 ; i < levelL.count() ; i++) + { + QDomNode n = levelL.at(i); + if (n.isElement()) + { + QDomElement e = n.toElement(); + if (e.tagName() == QString("Level")) + { + QDomNode a = e.attributeNode(QString("Name")); + QDomAttr att = a.toAttr(); + QString name = att.value(); + + QMap nextLevel; + level[name] = ProcessTreeLevel(n, nextLevel); + } + else if (e.tagName() == QString("Command")) + { + CommandData cmd; + + QDomNodeList cmdL = n.childNodes(); + for (int j = 0 ; j < cmdL.count() ; j++) + { + QDomNode cmdN = cmdL.at(j); + QDomElement cmdE = cmdN.toElement(); + + if (cmdE.tagName() == QString("Module")) + cmd.Module = cmdE.text(); + else if(cmdE.tagName() == QString("HelpText")) + cmd.HelpText = cmdE.text(); + else if(cmdE.tagName() == QString("LongHelp")) + cmd.LongHelp = cmdE.text(); + else if(cmdE.tagName() == QString("Description")) + cmd.Description = cmdE.text(); + } + cmd.fn = CommandHandler; + cmd.instance = this; + + level[QString("")].setValue(cmd); + } + } + } + + return level; +} diff --git a/connectionpane.h b/connectionpane.h new file mode 100644 index 0000000..ca90743 --- /dev/null +++ b/connectionpane.h @@ -0,0 +1,79 @@ +#ifndef CONNECTIONPANE_H +#define CONNECTIONPANE_H + +#include +#include +#include +#include +#include +#include + +class QNetworkAccessManager; +class QNetworkReply; +class ConnectionData; + +namespace Ui { +class ConnectionPane; +} + +class ConnectionPane : public QWidget +{ + Q_OBJECT + +public: + explicit ConnectionPane(ConnectionData *c, QHostAddress addr, QWidget *parent = 0); + ~ConnectionPane(); +public slots: + void CommandReply(); + void LoginReply(); + void PollReply(); + void TextChanged(QString text); + void ReturnPressed(); + void Login(); +public: + void CloseConnection(); + void ClearScrollback(); + void Copy(); + void RestartServer(); + bool IsLoggedIn(); + +protected: + QStringList CollectHelp(QStringList helpParts); + QStringList Parse(QString text); + QStringList Resolve(QStringList cmd); + QStringList FindNextOption(QStringList cmd, bool term); + static void Help(QString module, ConnectionPane *instance, QStringList args); + static void Quit(QString module, ConnectionPane *instance, QStringList args); + QStringList CollectHelp(QStringList help, QMap level); + static void CommandHandler(QString module, ConnectionPane *instance, QStringList args); + QString FormatLine(QString line, QString level); + QString OutputLine(QString line, QString level); + QString GetColor(QString text); + //void DumpTree(QMap level); + bool SendCommand(QString cmd); + QMap ProcessTreeLevel(QDomNode node, QMap level); + QString Name; + QString Host; + int Port; + QString User; + QString Pass; + QUrl urlStart; + QUrl urlClose; + QUrl urlCommand; + QUrl urlPoll; + QString sessionID; + QNetworkAccessManager *manager; + QMap tree; + QNetworkReply *loginReply; + QNetworkReply *pollReply; + QNetworkReply *cmdReply; + bool loggedIn; + QString textContent; + bool expectingInput; + bool expectingCommand; + +private: + Ui::ConnectionPane *ui; +}; + +#endif // CONNECTIONPANE_H diff --git a/connectionpane.ui b/connectionpane.ui new file mode 100644 index 0000000..f7b623b --- /dev/null +++ b/connectionpane.ui @@ -0,0 +1,65 @@ + + + ConnectionPane + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + 5 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + true + + + + + + + background-color: white; padding: 2px; + + + + + + true + + + + + + + + + + + diff --git a/document-new.png b/document-new.png new file mode 100644 index 0000000..e3808a1 Binary files /dev/null and b/document-new.png differ diff --git a/document-properties.png b/document-properties.png new file mode 100644 index 0000000..a5ad728 Binary files /dev/null and b/document-properties.png differ diff --git a/edit-clear.png b/edit-clear.png new file mode 100644 index 0000000..bbc77eb Binary files /dev/null and b/edit-clear.png differ diff --git a/edit-copy.png b/edit-copy.png new file mode 100644 index 0000000..345b2f1 Binary files /dev/null and b/edit-copy.png differ diff --git a/edit-cut.png b/edit-cut.png new file mode 100644 index 0000000..7017d1b Binary files /dev/null and b/edit-cut.png differ diff --git a/edit-delete.png b/edit-delete.png new file mode 100644 index 0000000..3811b64 Binary files /dev/null and b/edit-delete.png differ diff --git a/edit-paste.png b/edit-paste.png new file mode 100644 index 0000000..f6a625c Binary files /dev/null and b/edit-paste.png differ diff --git a/folder.png b/folder.png new file mode 100644 index 0000000..65bd0bb Binary files /dev/null and b/folder.png differ diff --git a/groupdata.cpp b/groupdata.cpp new file mode 100644 index 0000000..db9258b --- /dev/null +++ b/groupdata.cpp @@ -0,0 +1,6 @@ +#include "groupdata.h" + +GroupData::GroupData() +{ + +} diff --git a/groupdata.h b/groupdata.h new file mode 100644 index 0000000..1d4b3d6 --- /dev/null +++ b/groupdata.h @@ -0,0 +1,18 @@ +#ifndef GROUPDATA_H +#define GROUPDATA_H + +#include +#include +#include + +class GroupData +{ +public: + GroupData(); + + QUuid Uuid; + QString Name; + QHostAddress Dns; +}; + +#endif // GROUPDATA_H diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..9669280 --- /dev/null +++ b/main.cpp @@ -0,0 +1,12 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + + a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + return a.exec(); +} diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..e840d87 --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,767 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include "connectiondata.h" +#include "groupdata.h" +#include "connectionpane.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "addconndialog.h" +#include "addgroupdialog.h" +#include "preferencesdialog.h" +#include "ui_preferencesdialog.h" + +enum ItemType +{ + GroupItem = QTreeWidgetItem::UserType, + ConnectionItem = QTreeWidgetItem::UserType + 1 +}; + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); + + ui->connList->setColumnCount(1); + ui->connList->setHeaderLabel("Connections"); + ui->connList->setHeaderHidden(true); + ui->connList->sortByColumn(0, Qt::AscendingOrder); + ui->connList->setContextMenuPolicy(Qt::CustomContextMenu); + + connect (ui->consolePane, SIGNAL(tabCloseRequested(int)), this, SLOT(CloseTab(int))); + connect (ui->connList, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(ConnContext(const QPoint &))); + connect(ui->connList, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(ConnectionDoubleClicked(QTreeWidgetItem *, int))); + connect(ui->connList, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(treeWidgetItemChanged(QTreeWidgetItem*,int))); + + QCoreApplication::setOrganizationName("OpenSimulator"); + QCoreApplication::setApplicationName("OpenSim Console Client"); + + QSettings settings; + + ui->connList->blockSignals(true); + + restoreGeometry(settings.value("mainWindowGeometry").toByteArray()); + restoreState(settings.value("mainWindowState").toByteArray()); + + blackOnWhite = settings.value("black_on_white", QVariant(true)).toBool(); + systemFont = settings.value("system_font", QVariant(false)).toBool(); + + if (settings.value("split").isValid()) + ui->splitter->restoreState(settings.value("split").toByteArray()); + + int groupCount = settings.beginReadArray(QString("Groups")); + for (int i = 0 ; i < groupCount ; i++) + { + settings.setArrayIndex(i); + + GroupData *grp = new GroupData(); + + grp->Name = settings.value("Name").toString(); + grp->Uuid = settings.value("Uuid").toUuid(); + QVariant dnsAddress = settings.value("Dns"); + if (dnsAddress.isValid()) + grp->Dns = QHostAddress(dnsAddress.toString()); + + groups[grp->Uuid] = grp; + + insertGroup(grp); + + QTreeWidgetItem *grpItem = findItem(grp->Uuid); + + if (settings.value("Expanded").toBool()) + grpItem->setExpanded(true); + } + settings.endArray(); + + int connCount = settings.beginReadArray(QString("Connections")); + + for (int i = 0 ; i < connCount ; i++) + { + settings.setArrayIndex(i); + + ConnectionData *c = new ConnectionData; + + c->Name = settings.value("Name").toString(); + c->Host = settings.value("Host").toString(); + c->Port = settings.value("Port").toInt(); + c->User = settings.value("User").toString(); + c->Pass = settings.value("Pass").toString(); + c->Uuid = settings.value("Uuid").toUuid(); + + connections[c->Uuid] = c; + + QTreeWidgetItem *connItem; + + QUuid parent = settings.value("Parent").toUuid(); + if (!parent.isNull()) + { + QTreeWidgetItem *parentItem = findItem(parent); + if (parentItem == 0) + continue; + + connItem = new QTreeWidgetItem(parentItem, QStringList(QString(c->Name)), ConnectionItem); + } + else + { + connItem = new QTreeWidgetItem(ui->connList, QStringList(QString(c->Name)), ConnectionItem); + } + + connItem->setIcon(0, QIcon(":/Icons/computer.png")); + connItem->setData(0, Qt::UserRole, c->Uuid); + } + settings.endArray(); + + ui->connList->blockSignals(false); + + ui->connList->sortItems(0, Qt::AscendingOrder); +} + +MainWindow::~MainWindow() +{ + WriteSettings(); + + // No need to free anything as the OS does it for us + + delete ui; +} + +void MainWindow::on_action_Exit_triggered() +{ + close(); +} + +void MainWindow::on_action_Connect_triggered() +{ + QTreeWidgetItem *item = selectedItem(); + if (!item) + return; + + if (item->type() == GroupItem) // Group + { + QUuid groupUuid = item->data(0, Qt::UserRole).toUuid(); + + if (!groups.contains(groupUuid)) + return; + + for (int i = 0 ; i < item->childCount() ; i ++) + { + QTreeWidgetItem *it = item->child(i); + + QUuid uuid = it->data(0, Qt::UserRole).toUuid(); + + if (!connections.contains(uuid)) + continue; + + AddNewTab(groups[groupUuid], connections[uuid], groups[groupUuid]->Dns); + } + return; + } + + QUuid uuid = item->data(0, Qt::UserRole).toUuid(); + + if (!connections.contains(uuid)) + return; + + ConnectionData *c = connections[uuid]; + + QHostAddress dns; + + if (item->parent() != 0) + { + QTreeWidgetItem *parentItem = item->parent(); + QUuid parentUuid = parentItem->data(0, Qt::UserRole).toUuid(); + + if (groups.contains(parentUuid)) + dns = groups[parentUuid]->Dns; + } + AddNewTab(0, c, dns); +} + +void MainWindow::on_action_Disconnect_triggered() +{ + ConnectionPane *cw = GetCurrentTab(); + if (!cw) + return; + + cw->CloseConnection(); + + QTabWidget *p = (QTabWidget *)cw->parent()->parent(); + + QWidget *pp = (QWidget *)p->parent()->parent(); + + if (pp && pp->inherits("QTabWidget") && p->count() == 1) + { + delete cw; + delete p; + } + else + { + delete cw; + } +} + +void MainWindow::on_action_Edit_triggered() +{ + QTreeWidgetItem *item = selectedItem(); + if (item == 0) + return; + + QUuid uuid = item->data(0, Qt::UserRole).toUuid(); + + if (connections.contains(uuid)) + { + ConnectionData *c = connections[uuid]; + + AddConnDialog dlg(this); + + dlg.Name->setEnabled(false); + dlg.Name->setText(c->Name); + dlg.Host->setText(c->Host); + dlg.Port->setValue(c->Port); + dlg.User->setText(c->User); + dlg.Pass->setText(c->Pass); + + if (dlg.exec() < 0) + return; + + c->Host = dlg.Host->text(); + c->Port = dlg.Port->value(); + c->User = dlg.User->text(); + c->Pass = dlg.Pass->text(); + } + + if (groups.contains(uuid)) + { + GroupData *g = groups[uuid]; + + AddGroupDialog dlg(this); + + dlg.Name->setEnabled(false); + dlg.Name->setText(g->Name); + dlg.Dns->setText(g->Dns.toString()); + + if (dlg.exec() < 0) + return; + + if (dlg.Dns->text() != "") + g->Dns = QHostAddress(dlg.Dns->text()); + else + g->Dns = QHostAddress(); + } + + WriteSettings(); +} + +void MainWindow::on_action_Restart_triggered() +{ + ConnectionPane *c = GetCurrentTab(); + if (!c) + return; + + c->RestartServer(); +} + +void MainWindow::on_action_Clear_text_triggered() +{ + ConnectionPane *cw = GetCurrentTab(); + if (!cw) + return; + + cw->ClearScrollback(); +} + +// Recursively find a tab with a given UUID. This returns +// both sub-tab widgets and actual connection panes. +QWidget *MainWindow::findTab(QTabWidget *parent, QUuid uuid) +{ + int count = parent->count(); + + for (int i = 0 ; i < count ; i++) + { + QWidget *w = parent->widget(i); + + QVariant u = w->property("UUID"); + if (!u.isValid()) + continue; + + if (u.toUuid() == uuid) + { + return w; + } + + if (w->inherits("QTabWidget")) + { + w = findTab((QTabWidget *)w, uuid); + if (w != 0) + return w; + } + } + + return 0; +} + +void MainWindow::AddNewTab(GroupData *grp, ConnectionData *conn, QHostAddress addr) +{ + // Assume that it's a root pane + QTabWidget *parent = ui->consolePane; + + // See if there is a connection present and open. If there is one, + // just refuse to add another. If it's not connected, close the old + // pane and another will be created later. + QWidget *w = findTab(ui->consolePane, conn->Uuid); + if (w != 0 && w->inherits("ConnectionPane")) + { + ConnectionPane *c = (ConnectionPane *)w; + + if (c->IsLoggedIn()) + return; + + delete c; + } + + // If this is a group pane being opened, see if there is already + // a multipane for this group. If not, create it. + if (grp != 0) + { + w = findTab(ui->consolePane, grp->Uuid); + + if (w == 0 || (!w->inherits("QTabWidget"))) + { + parent = new QTabWidget(ui->consolePane); + parent->setTabPosition(QTabWidget::North); + parent->setTabShape(QTabWidget::Triangular); + parent->setProperty("UUID", QVariant(grp->Uuid)); + ui->consolePane->addTab(parent, grp->Name); + ui->consolePane->setCurrentWidget(parent); + } + else if (w->inherits("QTabWidget")) + { + parent = (QTabWidget *)w; + } + } + + ConnectionPane *tabContents = new ConnectionPane(conn, addr, parent); + tabContents->setVisible(true); + tabContents->setProperty("UUID", conn->Uuid); + + parent->addTab(tabContents, conn->Name); + parent->setCurrentWidget(tabContents); + + tabContents->Login(); +} + +void MainWindow::WriteSettings() +{ + QSettings settings; + + settings.clear(); + + settings.setValue("mainWindowGeometry", saveGeometry()); + settings.setValue("mainWindowState", saveState()); + settings.setValue("split", ui->splitter->saveState()); + + settings.setValue("black_on_white", blackOnWhite); + settings.setValue("system_font", systemFont); + + settings.beginWriteArray(QString("Groups"), groups.count()); + + int idx = 0; + for (QMap::iterator it = groups.begin() ; it != groups.end() ; it++, idx++) + { + QTreeWidgetItem *grpItem = findItem((*it)->Uuid); + + if (grpItem == 0) + continue; + + settings.setArrayIndex(idx); + settings.setValue("Uuid", QVariant((*it)->Uuid)); + settings.setValue("Name", QVariant((*it)->Name)); + if (!(*it)->Dns.isNull()) + settings.setValue("Dns", (*it)->Dns.toString()); + settings.setValue("Expanded", QVariant(grpItem->isExpanded())); + } + + settings.endArray(); + + settings.beginWriteArray(QString("Connections"), connections.count()); + + idx = 0; + for (QMap::iterator it = connections.begin() ; it != connections.end() ; it++, idx++) + { + QUuid parent; + + if (!(*it)->Uuid.isNull()) + { + QTreeWidgetItem *item = findItem((*it)->Uuid); + if (item == 0) + continue; + + if (item->parent() != 0) + parent = item->parent()->data(0, Qt::UserRole).toUuid(); + } + + settings.setArrayIndex(idx); + settings.setValue("Uuid", QVariant((*it)->Uuid)); + settings.setValue("Name", QVariant((*it)->Name)); + settings.setValue("Host", QVariant((*it)->Host)); + settings.setValue("Port", QVariant((*it)->Port)); + settings.setValue("User", QVariant((*it)->User)); + settings.setValue("Pass", QVariant((*it)->Pass)); + settings.setValue("Parent", (QVariant(parent))); + } + + settings.endArray(); +} + +void MainWindow::ConnectionDoubleClicked(QTreeWidgetItem *, int) +{ + ui->action_Connect->trigger(); +} + +ConnectionPane * MainWindow::GetCurrentTab() +{ + if (ui->consolePane->count() == 0) + return 0; + if (ui->consolePane->count() == 1 && ui->consolePane->tabText(0) == "Not connected") + return 0; + + QWidget *w = ui->consolePane->currentWidget(); + + if (w->inherits("QTabWidget")) // Sub tabs + { + if (((QTabWidget *)w)->count() == 0) + return 0; + + w = ((QTabWidget *)w)->currentWidget(); + } + ConnectionPane *cw = dynamic_cast(w); + return cw; +} + + +void MainWindow::ConnContext(const QPoint &pos) +{ + QTreeWidgetItem *item = ui->connList->itemAt(pos); + ui->connList->clearSelection(); + if (item) + item->setSelected(true); + + QMenu ctx("Connection actions", this); + if (item != 0) + { + if (item->type() == GroupItem) + { + if (item->childCount() > 0) + { + connect (ctx.addAction("Connect Group"), SIGNAL(triggered()), ui->action_Connect, SLOT(trigger())); + ctx.addSeparator(); + } + } + else + { + connect (ctx.addAction("Connect"), SIGNAL(triggered()), ui->action_Connect, SLOT(trigger())); + ctx.addSeparator(); + } + connect (ctx.addAction("Add ..."), SIGNAL(triggered()), ui->action_New, SLOT(trigger())); + } + else + { + connect (ctx.addAction("Add ..."), SIGNAL(triggered()), this, SLOT(addRootConnection())); + } + if (item != 0) + connect (ctx.addAction("Edit ..."), SIGNAL(triggered()), ui->action_Edit, SLOT(trigger())); + if (item != 0 && item->type() != GroupItem) + connect (ctx.addAction("Delete"), SIGNAL(triggered()), ui->actionDelete, SLOT(trigger())); + else if (item != 0 && item->childCount() == 0) + connect (ctx.addAction("Delete"), SIGNAL(triggered()), ui->actionDelete_group, SLOT(trigger())); + ctx.addSeparator(); + connect (ctx.addAction("Add Group..."), SIGNAL(triggered()), ui->actionNew_group, SLOT(trigger())); + + ctx.exec(ui->connList->mapToGlobal(pos)); +} + + +void MainWindow::CloseTab(int index) +{ + QWidget *w = ui->consolePane->widget(index); + + if (w->inherits("QTabWidget")) + { + QTabWidget *tabs = (QTabWidget *)w; + + while (tabs->count()) + { + ConnectionPane *c = (ConnectionPane *)tabs->widget(0); + + c->CloseConnection(); + + delete c; + } + + delete w; + } + else + { + if (w->inherits("ConnectionPane")) + { + ConnectionPane *c = (ConnectionPane *)w; + + c->CloseConnection(); + } + + delete w; + } +} + +void MainWindow::on_actionCopy_triggered() +{ + ConnectionPane *cw = GetCurrentTab(); + if (!cw) + return; + + cw->Copy(); +} + +// Helper to get the selected item from the list. +QTreeWidgetItem *MainWindow::selectedItem() +{ + QList items = ui->connList->selectedItems(); + if (items.count() != 1) + return 0; + + return items.at(0); +} + +// User requests a new group to be created. +void MainWindow::on_actionNew_group_triggered() +{ + GroupData *grp= createGroup(); + + QTreeWidgetItem *item = insertGroup(grp); + + ui->connList->editItem(item, 0); +} + +// Insert a group into the tree view +QTreeWidgetItem *MainWindow::insertGroup(GroupData *grp) +{ + QTreeWidgetItem *item = new QTreeWidgetItem(ui->connList, QStringList(grp->Name), GroupItem); + item->setFlags(item->flags() | Qt::ItemIsEditable); + item->setData(0, Qt::UserRole, grp->Uuid); + item->setIcon(0, QIcon(":/Icons/folder.png")); + + ui->connList->sortItems(0, Qt::AscendingOrder); + + return item; +} + +// Create a new group record and insert it into the groups list. +// Doesn't show or edit it. +GroupData *MainWindow::createGroup() +{ + GroupData *grp = new GroupData(); + + grp->Uuid = QUuid::createUuid(); + grp->Name = "New group"; + + groups[grp->Uuid] = grp; + + return grp; +} + +// Find any item in the list. Works for both groups and connections. +QTreeWidgetItem *MainWindow::findItem(QUuid uuid) +{ + QTreeWidgetItemIterator it(ui->connList); + + while (*it) + { + if ((*it)->data(0, Qt::UserRole).toUuid() == uuid) + return (*it); + it++; + } + + return 0; +} + +// Delete a group from the list +void MainWindow::on_actionDelete_group_triggered() +{ + QTreeWidgetItem *item = selectedItem(); + if (item == 0) + return; + + if (item->childCount() > 0 || item->type() != GroupItem) + return; + + if (QMessageBox::question(0, QString("Delete group"), + QString("Really delete this group?"), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes) != QMessageBox::Yes) + return; + + QUuid uuid = item->data(0, Qt::UserRole).toUuid(); + + if (groups.contains(uuid)) + { + GroupData *grp = groups[uuid]; + groups.remove(uuid); + delete grp; + } + + delete item; + + WriteSettings(); +} + +void MainWindow::on_action_New_triggered() +{ + QListitems = ui->connList->selectedItems(); + + if (items.count() == 0) + addRootConnection(); + else + addChildConnection(); + + WriteSettings(); +} + +ConnectionData *MainWindow::createConnection() +{ + AddConnDialog dlg(this); + if (dlg.exec() < 0) + return 0; + + ConnectionData *c = new ConnectionData; + c->Name = dlg.Name->text(); + c->Host = dlg.Host->text(); + c->Port = dlg.Port->value(); + c->User = dlg.User->text(); + c->Pass = dlg.Pass->text(); + c->Uuid = QUuid::createUuid(); + + connections[c->Uuid.toString()] = c; + + return c; +} + +void MainWindow::addRootConnection() +{ + ConnectionData *c = createConnection(); + + if (c == 0) + return; + + QTreeWidgetItem *item = addItem(ui->connList, c); + if (!item) + connections.remove(c->Uuid); +} + +void MainWindow::addChildConnection() +{ + QTreeWidgetItem *parent = selectedItem(); + + if (parent == 0) + return; + + ConnectionData *c = createConnection(); + + if (c == 0) + return; + + QTreeWidgetItem *item = addItem(parent, c); + if (!item) + connections.remove(c->Uuid); +} + +void MainWindow::setupItem(QTreeWidgetItem *item, ConnectionData *c) +{ + item->setFlags(item->flags() | Qt::ItemIsEditable); + item->setData(0, Qt::UserRole, c->Uuid); + item->setIcon(0, QIcon(":/Icons/computer.png")); + + ui->connList->clearSelection(); + item->setSelected(true); +} + +QTreeWidgetItem *MainWindow::addItem(QTreeWidget *v, ConnectionData *c) +{ + QTreeWidgetItem *item = new QTreeWidgetItem(v, QStringList(QString(c->Name)), ConnectionItem); + ui->connList->sortItems(0, Qt::AscendingOrder); + + setupItem(item, c); + + return item; +} + +QTreeWidgetItem *MainWindow::addItem(QTreeWidgetItem *i, ConnectionData *c) +{ + i->setExpanded(true); + QTreeWidgetItem *item = new QTreeWidgetItem(i, QStringList(QString(c->Name)), ConnectionItem); + ui->connList->sortItems(0, Qt::AscendingOrder); + + setupItem(item, c); + + return item; +} + +void MainWindow::on_actionDelete_triggered() +{ + QTreeWidgetItem *item = selectedItem(); + + if (item == 0 || item->type() != ConnectionItem) + return; + + QUuid id = item->data(0, Qt::UserRole).toUuid(); + if (QMessageBox::question(0, QString("Delete connection"), + QString("Really delete this connection?"), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes) != QMessageBox::Yes) + return; + + if (connections.contains(id)) + { + ConnectionData *c = connections[id]; + connections.remove(c->Uuid); + delete c; + } + delete item; + + WriteSettings(); +} + +void MainWindow::treeWidgetItemChanged(QTreeWidgetItem *item, int) +{ + QUuid uuid = item->data(0, Qt::UserRole).toUuid(); + + if (groups.contains(uuid)) + groups[uuid]->Name = item->text(0); + if (connections.contains(uuid)) + connections[uuid]->Name = item->text(0); + + WriteSettings(); +} + +void MainWindow::on_action_Preferences_triggered() +{ + PreferencesDialog dlg; + + dlg.ui->blackOnWhite->setChecked(blackOnWhite); + dlg.ui->useSystemFonts->setChecked(systemFont); + + if (dlg.exec() < 0) + return; + + blackOnWhite = dlg.ui->blackOnWhite->isChecked(); + systemFont = dlg.ui->useSystemFonts->isChecked(); + + WriteSettings(); +} diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..ebba006 --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,86 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include + +class ConnectionPane; +class QTreeWidget; +class QTreeWidgetItem; +class ConnectionData; +class GroupData; +class QSettings; + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); +protected: + ConnectionPane * GetCurrentTab(); + void WriteSettings(); + +private slots: + void on_action_Exit_triggered(); + + void on_action_Connect_triggered(); + + void on_action_New_triggered(); + + void on_actionDelete_group_triggered(); + + void on_action_Disconnect_triggered(); + + void on_action_Edit_triggered(); + + void on_actionDelete_triggered(); + + void on_action_Restart_triggered(); + + void on_action_Clear_text_triggered(); + + void CloseTab(int index); + void ConnContext(const QPoint &); + void ConnectionDoubleClicked(QTreeWidgetItem * item, int column = 0); + void on_actionCopy_triggered(); + + void on_actionNew_group_triggered(); + + void on_action_Preferences_triggered(); + +public: +protected: + QMap connections; + QMap groups; + ConnectionData *createConnection(); + QTreeWidgetItem *addItem(QTreeWidget *v, ConnectionData *c); + QTreeWidgetItem *addItem(QTreeWidgetItem *i, ConnectionData *c); + void setupItem(QTreeWidgetItem *item, ConnectionData *c); + GroupData *createGroup(); + QTreeWidgetItem *insertGroup(GroupData *grp); + QTreeWidgetItem *findItem(QUuid uuid); + QTreeWidgetItem *selectedItem(); + QWidget *findTab(QTabWidget *parent, QUuid uuid); + void AddNewTab(GroupData *grp, ConnectionData *conn, QHostAddress addr); + bool blackOnWhite; + bool systemFont; + +protected slots: + void addRootConnection(); + void addChildConnection(); + void treeWidgetItemChanged(QTreeWidgetItem *item, int column); +private: + QTreeWidgetItem *findOrAddGroup(QString groupName); + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..983c631 --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,270 @@ + + + MainWindow + + + + 0 + 0 + 1107 + 885 + + + + MainWindow + + + + + + + Qt::Horizontal + + + + + 1 + 0 + + + + -1 + + + true + + + true + + + true + + + + + + + + Connections + + + + + + + QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + QAbstractItemView::SelectItems + + + false + + + + 1 + + + + + + + + + + + + + + 0 + 0 + 1107 + 22 + + + + + &File + + + + + + &Connection + + + + + + + + + + + + + + + &Server + + + + + + + + &Edit + + + + + + &Tools + + + + + + + + + + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + + + :/Icons/system-log-out.png:/Icons/system-log-out.png + + + &Exit + + + + + + :/Icons/network-transmit-receive.png:/Icons/network-transmit-receive.png + + + &Connect + + + + + + :/Icons/network-offline.png:/Icons/network-offline.png + + + &Disconnect + + + + + + :/Icons/document-new.png:/Icons/document-new.png + + + &New... + + + + + + :/Icons/document-properties.png:/Icons/document-properties.png + + + &Edit... + + + + + + :/Icons/edit-delete.png:/Icons/edit-delete.png + + + Delete + + + + + + :/Icons/folder.png:/Icons/folder.png + + + Add &group ... + + + + + Delete group + + + + + + :/Icons/view-refresh.png:/Icons/view-refresh.png + + + &Restart + + + + + + :/Icons/edit-clear.png:/Icons/edit-clear.png + + + &Clear text + + + + + + :/Icons/edit-copy.png:/Icons/edit-copy.png + + + Copy + + + + + + :/Icons/document-new.png:/Icons/document-new.png + + + New in group... + + + + + + :/Icons/systemPreferences.png:/Icons/systemPreferences.png + + + &Preferences + + + + + + + + + diff --git a/network-offline.png b/network-offline.png new file mode 100644 index 0000000..72dd12c Binary files /dev/null and b/network-offline.png differ diff --git a/network-transmit-receive.png b/network-transmit-receive.png new file mode 100644 index 0000000..54d145f Binary files /dev/null and b/network-transmit-receive.png differ diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp new file mode 100644 index 0000000..6157d3d --- /dev/null +++ b/preferencesdialog.cpp @@ -0,0 +1,37 @@ +#include "preferencesdialog.h" +#include "ui_preferencesdialog.h" + +PreferencesDialog::PreferencesDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::PreferencesDialog) +{ + ui->setupUi(this); + + connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(OnOK())); + connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(OnCancel())); +} + +PreferencesDialog::~PreferencesDialog() +{ + delete ui; +} + +void PreferencesDialog::on_blackOnWhite_toggled(bool) +{ + emit changed(); +} + +void PreferencesDialog::on_useSystemFonts_toggled(bool) +{ + emit changed(); +} + +void PreferencesDialog::OnOK() +{ + done(0); +} + +void PreferencesDialog::OnCancel() +{ + done(-1); +} diff --git a/preferencesdialog.h b/preferencesdialog.h new file mode 100644 index 0000000..2323b56 --- /dev/null +++ b/preferencesdialog.h @@ -0,0 +1,33 @@ +#ifndef PREFERENCESDIALOG_H +#define PREFERENCESDIALOG_H + +#include + +namespace Ui { +class PreferencesDialog; +} + +class PreferencesDialog : public QDialog +{ + Q_OBJECT + +public: + explicit PreferencesDialog(QWidget *parent = 0); + ~PreferencesDialog(); + +private slots: + void on_blackOnWhite_toggled(bool checked); + + void on_useSystemFonts_toggled(bool checked); + +public: + Ui::PreferencesDialog *ui; + +signals: + void changed(); +protected slots: + void OnOK(); + void OnCancel(); +}; + +#endif // PREFERENCESDIALOG_H diff --git a/preferencesdialog.ui b/preferencesdialog.ui new file mode 100644 index 0000000..4153a23 --- /dev/null +++ b/preferencesdialog.ui @@ -0,0 +1,110 @@ + + + PreferencesDialog + + + + 0 + 0 + 380 + 245 + + + + Dialog + + + + + + + + Terminal + + + + -1 + + + + + Black on white + + + + + + + + + + Use system font + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + PreferencesDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + PreferencesDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/system-log-out.png b/system-log-out.png new file mode 100644 index 0000000..28ac66f Binary files /dev/null and b/system-log-out.png differ diff --git a/systemPreferences.png b/systemPreferences.png new file mode 100644 index 0000000..15ea995 Binary files /dev/null and b/systemPreferences.png differ diff --git a/tab-new.png b/tab-new.png new file mode 100644 index 0000000..c7c7cf2 Binary files /dev/null and b/tab-new.png differ diff --git a/view-refresh.png b/view-refresh.png new file mode 100644 index 0000000..cab4d02 Binary files /dev/null and b/view-refresh.png differ