diff --git a/src/BypassNatClient.pro b/src/BypassNatClient.pro index 7421834..3efc6d0 100644 --- a/src/BypassNatClient.pro +++ b/src/BypassNatClient.pro @@ -1,16 +1,11 @@ -QT += quick gui multimedia core +QT = core widgets network equals(QT_MAJOR_VERSION, 6){ message("qt6.1 v:" $$QT_MAJOR_VERSION) QT += core5compat } +CONFIG += c++17 cmdline -# You can make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - - -CONFIG += c++1z SOURCES += \ MyProtocol.cpp \ @@ -23,30 +18,6 @@ SOURCES += \ parsersocketdata.cpp \ settingsapp.cpp -RESOURCES += \ - image.qrc - -equals(QT_MAJOR_VERSION, 6){ - message("qt6.2 v:" $$QT_MAJOR_VERSION) - - RESOURCES += \ - qml6.qrc -} - -equals(QT_MAJOR_VERSION, 5){ - message("qt5 v:" $$QT_MAJOR_VERSION) - - - RESOURCES += \ - qml5.qrc - - HEADERS += \ - myfilter.h - - SOURCES += \ - myfilter.cpp -} - # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = @@ -55,8 +26,8 @@ QML_IMPORT_PATH = QML_DESIGNER_IMPORT_PATH = # Default rules for deployment. -qnx: target.path = \tmp/$${TARGET}/bin -else: unix:!android: target.path = \opt/$${TARGET}/bin +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target HEADERS += \ @@ -68,34 +39,17 @@ HEADERS += \ fileWrite.h \ newclient.h \ parsersocketdata.h \ - ping.h \ settingsapp.h unix:!macx:{ + LIBS += -L/usr/local/lib } -unix:!android:{ - - HEADERS += \ - KeyControler.h - - SOURCES += \ - KeyControler.cpp - - LIBS += -lXtst -lX11 -} - - win32{ - HEADERS += \ - KeyControler.h - - SOURCES += \ - KeyControler.cpp - LIBS += -luser32 } + diff --git a/src/KeyControler.cpp b/src/KeyControler.cpp deleted file mode 100644 index 203968c..0000000 --- a/src/KeyControler.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "KeyControler.h" - - -#ifdef Q_OS_WIN - -#include - -int KeyControler::fKeyWin(unsigned int _iKey) -{ - //qDebug() << "StaticData::fKeyWin 0: " << _iKey; - - for(int i = 0; i < sizeof(KeyTbl) / sizeof(KeyTbl[0]); i++) - { - //qDebug() << "StaticData::fKeyWin 3: " << QKeySequence(KeyTbl[i]).toString() << KeyTbl[i] ; - - if(KeyTbl[i] == _iKey ) - { - //qDebug() << "StaticData::fKeyWin 4: " << i ; - return i; - } - } - - return -1; -} - -bool KeyControler::fCtrlV( unsigned int _iVar, unsigned int _iKay) -{ - int a_iKeyWin = fKeyWin(_iKay); - - if( a_iKeyWin < 0 ) - { - //нажато Control + V - if( _iVar == 1 - && ( (GetKeyState(17) >> 8) & 0xFF ) == 0xff - && ((char)_iKay == 'V' || (char)_iKay == 'v') - ) - { - qDebug() << "KeyControler::fCtrlV 4.5: " << "Control + V"; - return true; - } - } - - return false; -} -#else -#ifdef Q_OS_LINUX - -//#include -//#include -//sudo apt-get install libxtst-dev -#include - -static bool fGetKeyState(KeySym keySym) -{ - Display *display; - - display = XOpenDisplay(0); - if(display == NULL) - { - return false; - } - - char szKey[32]; - int iKeyCodeToFind = XKeysymToKeycode(display, keySym); - - XQueryKeymap(display, szKey); - XCloseDisplay(display); - - return szKey[iKeyCodeToFind / 8] & (1 << (iKeyCodeToFind % 8)); - - return false; -} - - -int KeyControler::fKeyLinux(unsigned int _iKey) -{ - //qDebug() << "StaticData::fKeyLinux 0: " << _iKey; - - for(int i = 1; i < sizeof(KeyTblLinux) / sizeof(KeyTblLinux[0]); i+=2) - { - //qDebug() << "StaticData::fKeyLinux 3: " << QKeySequence(KeyTblLinux[i]).toString() << KeyLinux[i] ; - - if(KeyTblLinux[i] == _iKey ) - { - //qDebug() << "StaticData::fKeyLinux 4: " << i ; - return i; - } - } - - return -1; -} - -bool KeyControler::fCtrlV( unsigned int _iVar, unsigned int _iKay) -{ - //qDebug() << "KeyControler::fCtrlV 0: " << _iVar << _iKay; - - //нажато Control + V - if( _iVar == 1 - && (fGetKeyState(XK_Control_L) || fGetKeyState(XK_Control_R) ) - && ((char)_iKay == 'V' || (char)_iKay == 'v') - ) - { - qDebug() << "KeyControler::fCtrlV 4.5: " << "Control + V"; - return true; - } - - return false; -} - -#else - -#endif - -#endif diff --git a/src/KeyControler.h b/src/KeyControler.h deleted file mode 100644 index 533ef3b..0000000 --- a/src/KeyControler.h +++ /dev/null @@ -1,1098 +0,0 @@ -#ifndef KEYCONTROLERH_H -#define KEYCONTROLERH_H - -#include -#include -#include -#include -#include - - - -#ifdef Q_OS_ANDROID - -#else -#ifdef Q_OS_LINUX -#include -// the next lines are taken on 10/2009 from X.org (X11/XF86keysym.h), defining some special -// multimedia keys. They are included here as not every system has them. - -#define XF86XK_MonBrightnessUp 0x1008FF02 -#define XF86XK_MonBrightnessDown 0x1008FF03 -#define XF86XK_KbdLightOnOff 0x1008FF04 -#define XF86XK_KbdBrightnessUp 0x1008FF05 -#define XF86XK_KbdBrightnessDown 0x1008FF06 -#define XF86XK_Standby 0x1008FF10 -#define XF86XK_AudioLowerVolume 0x1008FF11 -#define XF86XK_AudioMute 0x1008FF12 -#define XF86XK_AudioRaiseVolume 0x1008FF13 -#define XF86XK_AudioPlay 0x1008FF14 -#define XF86XK_AudioStop 0x1008FF15 -#define XF86XK_AudioPrev 0x1008FF16 -#define XF86XK_AudioNext 0x1008FF17 -#define XF86XK_HomePage 0x1008FF18 -#define XF86XK_Mail 0x1008FF19 -#define XF86XK_Start 0x1008FF1A -#define XF86XK_Search 0x1008FF1B -#define XF86XK_AudioRecord 0x1008FF1C -#define XF86XK_Calculator 0x1008FF1D -#define XF86XK_Memo 0x1008FF1E -#define XF86XK_ToDoList 0x1008FF1F -#define XF86XK_Calendar 0x1008FF20 -#define XF86XK_PowerDown 0x1008FF21 -#define XF86XK_ContrastAdjust 0x1008FF22 -#define XF86XK_Back 0x1008FF26 -#define XF86XK_Forward 0x1008FF27 -#define XF86XK_Stop 0x1008FF28 -#define XF86XK_Refresh 0x1008FF29 -#define XF86XK_PowerOff 0x1008FF2A -#define XF86XK_WakeUp 0x1008FF2B -#define XF86XK_Eject 0x1008FF2C -#define XF86XK_ScreenSaver 0x1008FF2D -#define XF86XK_WWW 0x1008FF2E -#define XF86XK_Sleep 0x1008FF2F -#define XF86XK_Favorites 0x1008FF30 -#define XF86XK_AudioPause 0x1008FF31 -#define XF86XK_AudioMedia 0x1008FF32 -#define XF86XK_MyComputer 0x1008FF33 -#define XF86XK_LightBulb 0x1008FF35 -#define XF86XK_Shop 0x1008FF36 -#define XF86XK_History 0x1008FF37 -#define XF86XK_OpenURL 0x1008FF38 -#define XF86XK_AddFavorite 0x1008FF39 -#define XF86XK_HotLinks 0x1008FF3A -#define XF86XK_BrightnessAdjust 0x1008FF3B -#define XF86XK_Finance 0x1008FF3C -#define XF86XK_Community 0x1008FF3D -#define XF86XK_AudioRewind 0x1008FF3E -#define XF86XK_BackForward 0x1008FF3F -#define XF86XK_Launch0 0x1008FF40 -#define XF86XK_Launch1 0x1008FF41 -#define XF86XK_Launch2 0x1008FF42 -#define XF86XK_Launch3 0x1008FF43 -#define XF86XK_Launch4 0x1008FF44 -#define XF86XK_Launch5 0x1008FF45 -#define XF86XK_Launch6 0x1008FF46 -#define XF86XK_Launch7 0x1008FF47 -#define XF86XK_Launch8 0x1008FF48 -#define XF86XK_Launch9 0x1008FF49 -#define XF86XK_LaunchA 0x1008FF4A -#define XF86XK_LaunchB 0x1008FF4B -#define XF86XK_LaunchC 0x1008FF4C -#define XF86XK_LaunchD 0x1008FF4D -#define XF86XK_LaunchE 0x1008FF4E -#define XF86XK_LaunchF 0x1008FF4F -#define XF86XK_ApplicationLeft 0x1008FF50 -#define XF86XK_ApplicationRight 0x1008FF51 -#define XF86XK_Book 0x1008FF52 -#define XF86XK_CD 0x1008FF53 -#define XF86XK_Calculater 0x1008FF54 -#define XF86XK_Clear 0x1008FF55 -#define XF86XK_ClearGrab 0x1008FE21 -#define XF86XK_Close 0x1008FF56 -#define XF86XK_Copy 0x1008FF57 -#define XF86XK_Cut 0x1008FF58 -#define XF86XK_Display 0x1008FF59 -#define XF86XK_DOS 0x1008FF5A -#define XF86XK_Documents 0x1008FF5B -#define XF86XK_Excel 0x1008FF5C -#define XF86XK_Explorer 0x1008FF5D -#define XF86XK_Game 0x1008FF5E -#define XF86XK_Go 0x1008FF5F -#define XF86XK_iTouch 0x1008FF60 -#define XF86XK_LogOff 0x1008FF61 -#define XF86XK_Market 0x1008FF62 -#define XF86XK_Meeting 0x1008FF63 -#define XF86XK_MenuKB 0x1008FF65 -#define XF86XK_MenuPB 0x1008FF66 -#define XF86XK_MySites 0x1008FF67 -#define XF86XK_News 0x1008FF69 -#define XF86XK_OfficeHome 0x1008FF6A -#define XF86XK_Option 0x1008FF6C -#define XF86XK_Paste 0x1008FF6D -#define XF86XK_Phone 0x1008FF6E -#define XF86XK_Reply 0x1008FF72 -#define XF86XK_Reload 0x1008FF73 -#define XF86XK_RotateWindows 0x1008FF74 -#define XF86XK_RotationPB 0x1008FF75 -#define XF86XK_RotationKB 0x1008FF76 -#define XF86XK_Save 0x1008FF77 -#define XF86XK_Send 0x1008FF7B -#define XF86XK_Spell 0x1008FF7C -#define XF86XK_SplitScreen 0x1008FF7D -#define XF86XK_Support 0x1008FF7E -#define XF86XK_TaskPane 0x1008FF7F -#define XF86XK_Terminal 0x1008FF80 -#define XF86XK_Tools 0x1008FF81 -#define XF86XK_Travel 0x1008FF82 -#define XF86XK_Video 0x1008FF87 -#define XF86XK_Word 0x1008FF89 -#define XF86XK_Xfer 0x1008FF8A -#define XF86XK_ZoomIn 0x1008FF8B -#define XF86XK_ZoomOut 0x1008FF8C -#define XF86XK_Away 0x1008FF8D -#define XF86XK_Messenger 0x1008FF8E -#define XF86XK_WebCam 0x1008FF8F -#define XF86XK_MailForward 0x1008FF90 -#define XF86XK_Pictures 0x1008FF91 -#define XF86XK_Music 0x1008FF92 -#define XF86XK_Battery 0x1008FF93 -#define XF86XK_Bluetooth 0x1008FF94 -#define XF86XK_WLAN 0x1008FF95 -#define XF86XK_UWB 0x1008FF96 -#define XF86XK_AudioForward 0x1008FF97 -#define XF86XK_AudioRepeat 0x1008FF98 -#define XF86XK_AudioRandomPlay 0x1008FF99 -#define XF86XK_Subtitle 0x1008FF9A -#define XF86XK_AudioCycleTrack 0x1008FF9B -#define XF86XK_Time 0x1008FF9F -#define XF86XK_Select 0x1008FFA0 -#define XF86XK_View 0x1008FFA1 -#define XF86XK_TopMenu 0x1008FFA2 -#define XF86XK_Suspend 0x1008FFA7 -#define XF86XK_Hibernate 0x1008FFA8 - - -// end of XF86keysyms.h - -// Special keys used by Qtopia, mapped into the X11 private keypad range. -#define QTOPIAXK_Select 0x11000601 -#define QTOPIAXK_Yes 0x11000602 -#define QTOPIAXK_No 0x11000603 -#define QTOPIAXK_Cancel 0x11000604 -#define QTOPIAXK_Printer 0x11000605 -#define QTOPIAXK_Execute 0x11000606 -#define QTOPIAXK_Sleep 0x11000607 -#define QTOPIAXK_Play 0x11000608 -#define QTOPIAXK_Zoom 0x11000609 -#define QTOPIAXK_Context1 0x1100060A -#define QTOPIAXK_Context2 0x1100060B -#define QTOPIAXK_Context3 0x1100060C -#define QTOPIAXK_Context4 0x1100060D -#define QTOPIAXK_Call 0x1100060E -#define QTOPIAXK_Hangup 0x1100060F -#define QTOPIAXK_Flip 0x11000610 - - - -static const uint KeyLinux[] = { // Keyboard mapping table - - Qt::Key_unknown, 0, // - Qt::Key_unknown, 0, // 1 | Left mouse button - Qt::Key_unknown, 0, // 2 | Right mouse button - Qt::Key_Cancel, XK_Cancel, // 3 | Control-Break processing - Qt::Key_unknown, 0, // 4 | Middle mouse button - Qt::Key_unknown, 0, // 5 | X1 mouse button - Qt::Key_unknown, 0, // 6 | X2 mouse button - Qt::Key_unknown, 0, // 7 -- unassigned -- - Qt::Key_Backspace, XK_BackSpace, // 8 | BackSpace key - Qt::Key_Tab, XK_Tab, // 9 | Tab key - Qt::Key_unknown, 0, // 10 -- reserved -- - Qt::Key_unknown, 0, // 11 -- reserved -- - Qt::Key_Clear, XK_Clear, // 12 | Clear key - Qt::Key_Return, XK_Return, // 13 | Enter key - Qt::Key_unknown, 0, // 14 0x0E - Qt::Key_unknown, 0, // 15 0x0F -- unassigned -- - Qt::Key_Shift, XK_Shift_L, // 16 | Shift key - Qt::Key_Control, XK_Control_L, // 17 | Ctrl key - Qt::Key_unknown, 0, // Qt::Key_Alt, // 18 | Alt key - Qt::Key_Pause, XK_Pause, // 19 | Pause key - Qt::Key_CapsLock, XK_Caps_Lock, // 20 | Caps-Lock - Qt::Key_unknown, 0, // 21 | IME Kana or Hangul mode - Qt::Key_unknown, 0, // 22 -- unassigned -- - Qt::Key_unknown, 0, // 23 | IME Junja mode - Qt::Key_unknown, 0, // 24 | IME final mode - Qt::Key_unknown, 0, // 25 / VK_KANJI | IME Hanja or Kanji mode - Qt::Key_unknown, 0, // 26 -- unassigned -- - Qt::Key_Escape, XK_Escape, // 27 | Esc key - Qt::Key_unknown, 0, // 28 | IME convert - Qt::Key_unknown, 0, // 29 | IME non-convert - Qt::Key_unknown, 0, // 30 | IME accept - Qt::Key_Mode_switch, XK_Mode_switch, // 31 | IME mode change request - Qt::Key_Space, XK_space, // 32 | Spacebar - Qt::Key_PageUp, XK_Page_Up, // 33 | Page Up key - Qt::Key_PageDown, XK_Page_Down, // 34 | Page Down key - Qt::Key_End, XK_End, // 35 | End key - Qt::Key_Home, XK_Home, // 36 | Home key - Qt::Key_Left, XK_Left, // 37 | Left arrow key - Qt::Key_Up, XK_Up, // 38 | Up arrow key - Qt::Key_Right, XK_Right, // 39 | Right arrow key - Qt::Key_Down, XK_Down, // 40 | Down arrow key - Qt::Key_Select, XK_Select, // 41 | Select key - Qt::Key_Printer, 0, // 42 | Print key - Qt::Key_Execute, XK_Execute, // 43 | Execute key - Qt::Key_Print, XK_Print, // 44 | Print Screen key - Qt::Key_Insert, XK_Insert, // 45 | Ins key - Qt::Key_Delete, XK_Delete, // 46 | Del key //65439 - Qt::Key_Help, XK_Help, // 47 | Help key //65386 - 0, // 48 | 0 key - 0, // 49 | 1 key - 0, // 50 | 2 key - 0, // 51 | 3 key - 0, // 52 | 4 key - 0, // 53 | 5 key - 0, // 54 | 6 key - 0, // 55 | 7 key - 0, // 56 | 8 key - 0, // 57 | 9 key - Qt::Key_unknown, 0, // 58 -- unassigned -- - Qt::Key_unknown, 0, // 59 -- unassigned -- - Qt::Key_unknown, 0, // 60 -- unassigned -- - Qt::Key_unknown, 0, // 61 -- unassigned -- - Qt::Key_unknown, 0, // 62 -- unassigned -- - Qt::Key_unknown, 0, // 63 -- unassigned -- - Qt::Key_unknown, 0, // 64 -- unassigned -- - 0, 0, // 65 | A key - 0, 0, // 66 | B key - 0, 0, // 67 | C key - 0, 0, // 68 | D key - 0, 0, // 69 | E key - 0, 0, // 70 | F key - 0, 0, // 71 | G key - 0, 0, // 72 | H key - 0, 0, // 73 | I key - 0, 0, // 74 | J key - 0, 0, // 75 | K key - 0, 0, // 76 | L key - 0, 0, // 77 | M key - 0, 0, // 78 | N key - 0, 0, // 79 | O key - 0, 0, // 80 | P key - 0, 0, // 81 | Q key - 0, 0, // 82 | R key - 0, 0, // 83 | S key - 0, 0, // 84 | T key - 0, 0, // 85 | U key - 0, 0, // 86 | V key - 0, 0, // 87 | W key - 0, 0, // 88 | X key - 0, 0, // 89 | Y key - 0, 0, // 90 | Z key - Qt::Key_Meta, XK_Meta_L, // 91 | Left Windows - MS Natural kbd - Qt::Key_Meta, XK_Meta_R, // 92 | Right Windows - MS Natural kbd - Qt::Key_Menu, XK_Menu, // 93 | Application key-MS Natural kbd - Qt::Key_unknown, 0, // 94 -- reserved -- - Qt::Key_Sleep, 0, // 95 VK_SLEEP - Qt::Key_0, XK_0, // 96 | Numeric keypad 0 key - Qt::Key_1, XK_1, // 97 | Numeric keypad 1 key - Qt::Key_2, XK_2, // 98 | Numeric keypad 2 key - Qt::Key_3, XK_3, // 99 | Numeric keypad 3 key - Qt::Key_4, XK_4, // 100 | Numeric keypad 4 key - Qt::Key_5, XK_5, // 101 | Numeric keypad 5 key - Qt::Key_6, XK_6, // 102 | Numeric keypad 6 key - Qt::Key_7, XK_7, // 103 | Numeric keypad 7 key - Qt::Key_8, XK_8, // 104 | Numeric keypad 8 key - Qt::Key_9, XK_9, // 105 | Numeric keypad 9 key - Qt::Key_Asterisk, XK_asterisk, // 106 | Multiply key - Qt::Key_Plus, XK_plus, // 107 | Add key - Qt::Key_Comma, XK_comma, // 108 | Separator key - Qt::Key_Minus, XK_minus, // 109 | Subtract key - Qt::Key_Period, XK_period, // 110 | Decimal key - Qt::Key_Slash, XK_slash, // 111 | Divide key - Qt::Key_F1, XK_F1, // 112 | F1 key - Qt::Key_F2, XK_F2, // 113 | F2 key - Qt::Key_F3, XK_F3, // 114 | F3 key - Qt::Key_F4, XK_F4, // 115 | F4 key - Qt::Key_F5, XK_F5, // 116 | F5 key - Qt::Key_F6, XK_F6, // 117 | F6 key - Qt::Key_F7, XK_F7, // 118 | F7 key - Qt::Key_F8, XK_F8, // 119 | F8 key - Qt::Key_F9, XK_F9, // 120 | F9 key - Qt::Key_F10, XK_F10, // 121 | F10 key - Qt::Key_F11, XK_F11, // 122 | F11 key - Qt::Key_F12, XK_F12, // 123 | F12 key - Qt::Key_F13, XK_F13, // 124 | F13 key - Qt::Key_F14, XK_F14, // 125 | F14 key - Qt::Key_F15, XK_F15, // 126 | F15 key - Qt::Key_F16, XK_F16, // 127 | F16 key - Qt::Key_F17, XK_F17, // 128 | F17 key - Qt::Key_F18, XK_F18, // 129 | F18 key - Qt::Key_F19, XK_F19, // 130 | F19 key - Qt::Key_F20, XK_F20, // 131 | F20 key - Qt::Key_F21, XK_F21, // 132 | F21 key - Qt::Key_F22, XK_F22, // 133 | F22 key - Qt::Key_F23, XK_F23, // 134 | F23 key - Qt::Key_F24, XK_F24, // 135 | F24 key - Qt::Key_unknown, 0, // 136 -- unassigned -- - Qt::Key_unknown, 0, // 137 -- unassigned -- - Qt::Key_unknown, 0, // 138 -- unassigned -- - Qt::Key_unknown, 0, // 139 -- unassigned -- - Qt::Key_unknown, 0, // 140 -- unassigned -- - Qt::Key_unknown, 0, // 141 -- unassigned -- - Qt::Key_unknown, 0, // 142 -- unassigned -- - Qt::Key_unknown, 0, // 143 -- unassigned -- - Qt::Key_NumLock, 0, // 144 | Num Lock key - Qt::Key_ScrollLock, 0, // 145 | Scroll Lock key - // Fujitsu/OASYS kbd -------------------- - 0, 0, //Qt::Key_Jisho, // 146 | 'Dictionary' key / - // VK_OEM_NEC_EQUAL = key on numpad on NEC PC-9800 kbd - Qt::Key_Massyo, XK_Massyo, // 147 | 'Unregister word' key - Qt::Key_Touroku, XK_Touroku, // 148 | 'Register word' key - 0, 0, //Qt::Key_Oyayubi_Left,//149 | 'Left OYAYUBI' key - 0, 0, //Qt::Key_Oyayubi_Right,//150 | 'Right OYAYUBI' key - Qt::Key_unknown, 0, // 151 -- unassigned -- - Qt::Key_unknown, 0, // 152 -- unassigned -- - Qt::Key_unknown, 0, // 153 -- unassigned -- - Qt::Key_unknown, 0, // 154 -- unassigned -- - Qt::Key_unknown, 0, // 155 -- unassigned -- - Qt::Key_unknown, 0, // 156 -- unassigned -- - Qt::Key_unknown, 0, // 157 -- unassigned -- - Qt::Key_unknown, 0, // 158 -- unassigned -- - Qt::Key_unknown, 0, // 159 -- unassigned -- - Qt::Key_Shift, XK_Shift_L, // 160 | Left Shift key - Qt::Key_Shift, XK_Shift_R, // 161 | Right Shift key - Qt::Key_Control, XK_Control_L, // 162 | Left Ctrl key - Qt::Key_Control, XK_Control_R, // 163 | Right Ctrl key - Qt::Key_Alt, XK_Alt_L, // 164 | Left Menu key - Qt::Key_Alt, XK_Alt_R, // 165 | Right Menu key - Qt::Key_Back, 0, // 166 | Browser Back key - Qt::Key_Forward, 0, // 167 | Browser Forward key - Qt::Key_Refresh, 0, // 168 | Browser Refresh key - Qt::Key_Stop, 0, // 169 | Browser Stop key - Qt::Key_Search, XK_Find, // 170 | Browser Search key - Qt::Key_Favorites, 0, // 171 | Browser Favorites key - Qt::Key_HomePage, 0, // 172 | Browser Start and Home key - Qt::Key_VolumeMute, 0, // 173 | Volume Mute key - Qt::Key_VolumeDown, 0, // 174 | Volume Down key - Qt::Key_VolumeUp, 0, // 175 | Volume Up key - Qt::Key_MediaNext, 0, // 176 | Next Track key - Qt::Key_MediaPrevious, 0, //177 | Previous Track key - Qt::Key_MediaStop, 0, // 178 | Stop Media key - Qt::Key_MediaPlay, 0, // 179 | Play/Pause Media key - Qt::Key_LaunchMail, 0, // 180 | Start Mail key - Qt::Key_LaunchMedia, 0, // 181 Select Media key - Qt::Key_Launch0, 0, // 182 | Start Application 1 key - Qt::Key_Launch1, 0, // 183 | Start Application 2 key - Qt::Key_unknown, 0, // 184 -- reserved -- - Qt::Key_unknown, 0, // 185 -- reserved -- - 0, 0, // 186 | ';:' for US - 0, 0, // 187 | '+' any country - 0, 0, // 188 | ',' any country - 0, 0, // 189 | '-' any country - 0, 0, // 190 | '.' any country - 0, 0, // 191 | '/?' for US - 0, 0, // 192 | '`~' for US - Qt::Key_unknown, 0, // 193 -- reserved -- - Qt::Key_unknown, 0, // 194 -- reserved -- - Qt::Key_unknown, 0, // 195 -- reserved -- - Qt::Key_unknown, 0, // 196 -- reserved -- - Qt::Key_unknown, 0, // 197 -- reserved -- - Qt::Key_unknown, 0, // 198 -- reserved -- - Qt::Key_unknown, 0, // 199 -- reserved -- - Qt::Key_unknown, 0, // 200 -- reserved -- - Qt::Key_unknown, 0, // 201 -- reserved -- - Qt::Key_unknown, 0, // 202 -- reserved -- - Qt::Key_unknown, 0, // 203 -- reserved -- - Qt::Key_unknown, 0, // 204 -- reserved -- - Qt::Key_unknown, 0, // 205 -- reserved -- - Qt::Key_unknown, 0, // 206 -- reserved -- - Qt::Key_unknown, 0, // 207 -- reserved -- - Qt::Key_unknown, 0, // 208 -- reserved -- - Qt::Key_unknown, 0, // 209 -- reserved -- - Qt::Key_unknown, 0, // 210 -- reserved -- - Qt::Key_unknown, 0, // 211 -- reserved -- - Qt::Key_unknown, 0, // 212 -- reserved -- - Qt::Key_unknown, 0, // 213 -- reserved -- - Qt::Key_unknown, 0, // 214 -- reserved -- - Qt::Key_unknown, 0, // 215 -- reserved -- - Qt::Key_unknown, 0, // 216 -- unassigned -- - Qt::Key_unknown, 0, // 217 -- unassigned -- - Qt::Key_unknown, 0, // 218 -- unassigned -- - 0, 0, // 219 | '[{' for US - 0, 0, // 220 | '\|' for US - 0, 0, // 221 | ']}' for US - 0, 0, // 222 | ''"' for US - 0, 0, // 223 - Qt::Key_unknown, 0, // 224 -- reserved -- - Qt::Key_unknown, 0, // 225 | 'AX' key on Japanese AX kbd - Qt::Key_unknown, 0, // 226 | "<>" or "\|" on RT 102-key kbd - Qt::Key_unknown, 0, // 227 | Help key on ICO - Qt::Key_unknown, 0, // 228 | 00 key on ICO - Qt::Key_unknown, 0, // 229 | IME Process key - Qt::Key_unknown, 0, // 230 | - Qt::Key_unknown, 0, // 231 | Unicode char as keystrokes - Qt::Key_unknown, 0, // 232 -- unassigned -- - // Nokia/Ericsson definitions --------------- - Qt::Key_unknown, 0, // 233 VK_OEM_RESET - Qt::Key_unknown, 0, // 234 VK_OEM_JUMP - Qt::Key_unknown, 0, // 235 VK_OEM_PA1 - Qt::Key_unknown, 0, // 236 VK_OEM_PA2 - Qt::Key_unknown, 0, // 237 VK_OEM_PA3 - Qt::Key_unknown, 0, // 238 VK_OEM_WSCTRL - Qt::Key_unknown, 0, // 239 VK_OEM_CUSEL - Qt::Key_unknown, 0, // 240 VK_OEM_ATTN - Qt::Key_unknown, 0, // 241 VK_OEM_FINISH - Qt::Key_unknown, 0, // 242 VK_OEM_COPY - Qt::Key_unknown, 0, // 243 VK_OEM_AUTO - Qt::Key_unknown, 0, // 244 VK_OEM_ENLW - Qt::Key_unknown, 0, // 245 VK_OEM_BACKTAB - Qt::Key_unknown, 0, // 246 | Attn key - Qt::Key_unknown, 0, // 247 | CrSel key - Qt::Key_unknown, 0, // 248 | ExSel key - Qt::Key_unknown, 0, // 249 | Erase EOF key - Qt::Key_Play, 0, // 250 | Play key - Qt::Key_Zoom, 0, // 251 | Zoom key - Qt::Key_unknown, 0, // 252 | Reserved - Qt::Key_unknown, 0, // 253 | PA1 key - Qt::Key_Clear, XK_Clear, // 254 | Clear key - 0, 0 -}; - -// keyboard mapping table -static const unsigned int KeyTblLinux[] = { - - // misc keys - - XK_Escape, Qt::Key_Escape, //1 - XK_Tab, Qt::Key_Tab, //3 - XK_ISO_Left_Tab, Qt::Key_Backtab, //5 - XK_BackSpace, Qt::Key_Backspace, // 7 - XK_Return, Qt::Key_Return, //9 - XK_Insert, Qt::Key_Insert, - XK_Delete, Qt::Key_Delete, - XK_Clear, Qt::Key_Delete, - XK_Pause, Qt::Key_Pause, - XK_Print, Qt::Key_Print, - XK_space, Qt::Key_Space, - 0x1007ff00, Qt::Key_SysReq, // hardcoded X386 SysReq - - // cursor movement - - XK_Home, Qt::Key_Home, //25 - XK_End, Qt::Key_End, - XK_Left, Qt::Key_Left, - XK_Up, Qt::Key_Up, - XK_Right, Qt::Key_Right, - XK_Down, Qt::Key_Down, - XK_Prior, Qt::Key_PageUp, - XK_Next, Qt::Key_PageDown, - - // modifiers - - XK_Shift_L, Qt::Key_Shift, //41 - XK_Shift_R, Qt::Key_Shift, - XK_Shift_Lock, Qt::Key_Shift, - XK_Control_L, Qt::Key_Control, - XK_Control_R, Qt::Key_Control, - XK_Meta_L, Qt::Key_Meta, - XK_Meta_R, Qt::Key_Meta, - XK_Alt_L, Qt::Key_Alt, - XK_Alt_R, Qt::Key_Alt, - XK_Caps_Lock, Qt::Key_CapsLock, - XK_Num_Lock, Qt::Key_NumLock, - XK_Scroll_Lock, Qt::Key_ScrollLock, - XK_Super_L, Qt::Key_Super_L, - XK_Super_R, Qt::Key_Super_R, - XK_Menu, Qt::Key_Menu, - XK_Hyper_L, Qt::Key_Hyper_L, - XK_Hyper_R, Qt::Key_Hyper_R, - XK_Help, Qt::Key_Help, - 0x1000FF74, Qt::Key_Backtab, // hardcoded HP backtab - 0x1005FF10, Qt::Key_F11, // hardcoded Sun F36 (labeled F11) - 0x1005FF11, Qt::Key_F12, // hardcoded Sun F37 (labeled F12) - - // numeric and function keypad keys - - XK_KP_Space, Qt::Key_Space, //83 - XK_KP_Tab, Qt::Key_Tab, - XK_KP_Enter, Qt::Key_Enter, - XK_KP_Home, Qt::Key_Home, - XK_KP_Left, Qt::Key_Left, - XK_KP_Up, Qt::Key_Up, - XK_KP_Right, Qt::Key_Right, - XK_KP_Down, Qt::Key_Down, - XK_KP_Prior, Qt::Key_PageUp, - XK_KP_Next, Qt::Key_PageDown, - XK_KP_End, Qt::Key_End, - XK_KP_Begin, Qt::Key_Clear, - XK_KP_Insert, Qt::Key_Insert, - XK_KP_Delete, Qt::Key_Delete, - XK_KP_Equal, Qt::Key_Equal, - XK_KP_Multiply, Qt::Key_Asterisk, - XK_KP_Add, Qt::Key_Plus, - XK_KP_Separator, Qt::Key_Comma, - XK_KP_Subtract, Qt::Key_Minus, - XK_KP_Decimal, Qt::Key_Period, - XK_KP_Divide, Qt::Key_Slash, - - // International input method support keys - - // International & multi-key character composition - XK_ISO_Level3_Shift, Qt::Key_AltGr, //125 - XK_Multi_key, Qt::Key_Multi_key, - XK_Codeinput, Qt::Key_Codeinput, - XK_SingleCandidate, Qt::Key_SingleCandidate, - XK_MultipleCandidate, Qt::Key_MultipleCandidate, - XK_PreviousCandidate, Qt::Key_PreviousCandidate, - - // Misc Functions - XK_Mode_switch, Qt::Key_Mode_switch, //137 - XK_script_switch, Qt::Key_Mode_switch, //139 - - // Japanese keyboard support - XK_Kanji, Qt::Key_Kanji, //121 - XK_Muhenkan, Qt::Key_Muhenkan, - //XK_Henkan_Mode, Qt::Key_Henkan_Mode, - XK_Henkan_Mode, Qt::Key_Henkan, - XK_Henkan, Qt::Key_Henkan, - XK_Romaji, Qt::Key_Romaji, - XK_Hiragana, Qt::Key_Hiragana, - XK_Katakana, Qt::Key_Katakana, - XK_Hiragana_Katakana, Qt::Key_Hiragana_Katakana, - XK_Zenkaku, Qt::Key_Zenkaku, - XK_Hankaku, Qt::Key_Hankaku, - XK_Zenkaku_Hankaku, Qt::Key_Zenkaku_Hankaku, - XK_Touroku, Qt::Key_Touroku, - XK_Massyo, Qt::Key_Massyo, - XK_Kana_Lock, Qt::Key_Kana_Lock, - XK_Kana_Shift, Qt::Key_Kana_Shift, - XK_Eisu_Shift, Qt::Key_Eisu_Shift, - XK_Eisu_toggle, Qt::Key_Eisu_toggle, - //XK_Kanji_Bangou, Qt::Key_Kanji_Bangou, - //XK_Zen_Koho, Qt::Key_Zen_Koho, - //XK_Mae_Koho, Qt::Key_Mae_Koho, - XK_Kanji_Bangou, Qt::Key_Codeinput, - XK_Zen_Koho, Qt::Key_MultipleCandidate, - XK_Mae_Koho, Qt::Key_PreviousCandidate, - -#ifdef XK_KOREAN - // Korean keyboard support - XK_Hangul, Qt::Key_Hangul, //181 - XK_Hangul_Start, Qt::Key_Hangul_Start, - XK_Hangul_End, Qt::Key_Hangul_End, - XK_Hangul_Hanja, Qt::Key_Hangul_Hanja, - XK_Hangul_Jamo, Qt::Key_Hangul_Jamo, - XK_Hangul_Romaja, Qt::Key_Hangul_Romaja, - //XK_Hangul_Codeinput, Qt::Key_Hangul_Codeinput, - XK_Hangul_Codeinput, Qt::Key_Codeinput, - XK_Hangul_Jeonja, Qt::Key_Hangul_Jeonja, - XK_Hangul_Banja, Qt::Key_Hangul_Banja, - XK_Hangul_PreHanja, Qt::Key_Hangul_PreHanja, - XK_Hangul_PostHanja, Qt::Key_Hangul_PostHanja, - //XK_Hangul_SingleCandidate,Qt::Key_Hangul_SingleCandidate, - //XK_Hangul_MultipleCandidate,Qt::Key_Hangul_MultipleCandidate, - //XK_Hangul_PreviousCandidate,Qt::Key_Hangul_PreviousCandidate, - XK_Hangul_SingleCandidate, Qt::Key_SingleCandidate, //203 - XK_Hangul_MultipleCandidate,Qt::Key_MultipleCandidate, - XK_Hangul_PreviousCandidate,Qt::Key_PreviousCandidate, - XK_Hangul_Special, Qt::Key_Hangul_Special, - //XK_Hangul_switch, Qt::Key_Hangul_switch, - XK_Hangul_switch, Qt::Key_Mode_switch, -#endif // XK_KOREAN - - // dead keys - XK_dead_grave, Qt::Key_Dead_Grave, //215 - XK_dead_acute, Qt::Key_Dead_Acute, - XK_dead_circumflex, Qt::Key_Dead_Circumflex, - XK_dead_tilde, Qt::Key_Dead_Tilde, - XK_dead_macron, Qt::Key_Dead_Macron, - XK_dead_breve, Qt::Key_Dead_Breve, - XK_dead_abovedot, Qt::Key_Dead_Abovedot, - XK_dead_diaeresis, Qt::Key_Dead_Diaeresis, - XK_dead_abovering, Qt::Key_Dead_Abovering, - XK_dead_doubleacute, Qt::Key_Dead_Doubleacute, - XK_dead_caron, Qt::Key_Dead_Caron, - XK_dead_cedilla, Qt::Key_Dead_Cedilla, - XK_dead_ogonek, Qt::Key_Dead_Ogonek, - XK_dead_iota, Qt::Key_Dead_Iota, - XK_dead_voiced_sound, Qt::Key_Dead_Voiced_Sound, - XK_dead_semivoiced_sound, Qt::Key_Dead_Semivoiced_Sound, - XK_dead_belowdot, Qt::Key_Dead_Belowdot, - XK_dead_hook, Qt::Key_Dead_Hook, - XK_dead_horn, Qt::Key_Dead_Horn, - - // Special keys from X.org - This include multimedia keys, - // wireless/bluetooth/uwb keys, special launcher keys, etc. - XF86XK_Back, Qt::Key_Back, //258 - XF86XK_Forward, Qt::Key_Forward, - XF86XK_Stop, Qt::Key_Stop, - XF86XK_Refresh, Qt::Key_Refresh, - XF86XK_Favorites, Qt::Key_Favorites, - XF86XK_AudioMedia, Qt::Key_LaunchMedia, - XF86XK_OpenURL, Qt::Key_OpenUrl, - XF86XK_HomePage, Qt::Key_HomePage, - XF86XK_Search, Qt::Key_Search, - XF86XK_AudioLowerVolume, Qt::Key_VolumeDown, - XF86XK_AudioMute, Qt::Key_VolumeMute, - XF86XK_AudioRaiseVolume, Qt::Key_VolumeUp, - XF86XK_AudioPlay, Qt::Key_MediaPlay, - XF86XK_AudioStop, Qt::Key_MediaStop, - XF86XK_AudioPrev, Qt::Key_MediaPrevious, - XF86XK_AudioNext, Qt::Key_MediaNext, - XF86XK_AudioRecord, Qt::Key_MediaRecord, - XF86XK_Mail, Qt::Key_LaunchMail, - XF86XK_MyComputer, Qt::Key_Launch0, // ### Qt 5: remap properly - XF86XK_Calculator, Qt::Key_Launch1, - XF86XK_Memo, Qt::Key_Memo, - XF86XK_ToDoList, Qt::Key_ToDoList, - XF86XK_Calendar, Qt::Key_Calendar, - XF86XK_PowerDown, Qt::Key_PowerDown, - XF86XK_ContrastAdjust, Qt::Key_ContrastAdjust, - XF86XK_Standby, Qt::Key_Standby, - XF86XK_MonBrightnessUp, Qt::Key_MonBrightnessUp, - XF86XK_MonBrightnessDown, Qt::Key_MonBrightnessDown, - XF86XK_KbdLightOnOff, Qt::Key_KeyboardLightOnOff, - XF86XK_KbdBrightnessUp, Qt::Key_KeyboardBrightnessUp, - XF86XK_KbdBrightnessDown, Qt::Key_KeyboardBrightnessDown, - XF86XK_PowerOff, Qt::Key_PowerOff, - XF86XK_WakeUp, Qt::Key_WakeUp, - XF86XK_Eject, Qt::Key_Eject, - XF86XK_ScreenSaver, Qt::Key_ScreenSaver, - XF86XK_WWW, Qt::Key_WWW, - XF86XK_Sleep, Qt::Key_Sleep, - XF86XK_LightBulb, Qt::Key_LightBulb, - XF86XK_Shop, Qt::Key_Shop, - XF86XK_History, Qt::Key_History, - XF86XK_AddFavorite, Qt::Key_AddFavorite, - XF86XK_HotLinks, Qt::Key_HotLinks, - XF86XK_BrightnessAdjust, Qt::Key_BrightnessAdjust, - XF86XK_Finance, Qt::Key_Finance, - XF86XK_Community, Qt::Key_Community, - XF86XK_AudioRewind, Qt::Key_AudioRewind, - XF86XK_BackForward, Qt::Key_BackForward, - XF86XK_ApplicationLeft, Qt::Key_ApplicationLeft, - XF86XK_ApplicationRight, Qt::Key_ApplicationRight, - XF86XK_Book, Qt::Key_Book, - XF86XK_CD, Qt::Key_CD, - XF86XK_Calculater, Qt::Key_Calculator, - XF86XK_Clear, Qt::Key_Clear, - XF86XK_ClearGrab, Qt::Key_ClearGrab, - XF86XK_Close, Qt::Key_Close, - XF86XK_Copy, Qt::Key_Copy, - XF86XK_Cut, Qt::Key_Cut, //370 - XF86XK_Display, Qt::Key_Display, - XF86XK_DOS, Qt::Key_DOS, - XF86XK_Documents, Qt::Key_Documents, - XF86XK_Excel, Qt::Key_Excel, - XF86XK_Explorer, Qt::Key_Explorer, - XF86XK_Game, Qt::Key_Game, - XF86XK_Go, Qt::Key_Go, - XF86XK_iTouch, Qt::Key_iTouch, - XF86XK_LogOff, Qt::Key_LogOff, - XF86XK_Market, Qt::Key_Market, - XF86XK_Meeting, Qt::Key_Meeting, - XF86XK_MenuKB, Qt::Key_MenuKB, - XF86XK_MenuPB, Qt::Key_MenuPB, - XF86XK_MySites, Qt::Key_MySites, - XF86XK_News, Qt::Key_News, - XF86XK_OfficeHome, Qt::Key_OfficeHome, - XF86XK_Option, Qt::Key_Option, - XF86XK_Paste, Qt::Key_Paste, - XF86XK_Phone, Qt::Key_Phone, - XF86XK_Reply, Qt::Key_Reply, //410 - XF86XK_Reload, Qt::Key_Reload, - XF86XK_RotateWindows, Qt::Key_RotateWindows, - XF86XK_RotationPB, Qt::Key_RotationPB, - XF86XK_RotationKB, Qt::Key_RotationKB, - XF86XK_Save, Qt::Key_Save, - XF86XK_Send, Qt::Key_Send, - XF86XK_Spell, Qt::Key_Spell, - XF86XK_SplitScreen, Qt::Key_SplitScreen, - XF86XK_Support, Qt::Key_Support, - XF86XK_TaskPane, Qt::Key_TaskPane, - XF86XK_Terminal, Qt::Key_Terminal, - XF86XK_Tools, Qt::Key_Tools, - XF86XK_Travel, Qt::Key_Travel, - XF86XK_Video, Qt::Key_Video, - XF86XK_Word, Qt::Key_Word, - XF86XK_Xfer, Qt::Key_Xfer, - XF86XK_ZoomIn, Qt::Key_ZoomIn, - XF86XK_ZoomOut, Qt::Key_ZoomOut, - XF86XK_Away, Qt::Key_Away, - XF86XK_Messenger, Qt::Key_Messenger, - XF86XK_WebCam, Qt::Key_WebCam, - XF86XK_MailForward, Qt::Key_MailForward, - XF86XK_Pictures, Qt::Key_Pictures, - XF86XK_Music, Qt::Key_Music, - XF86XK_Battery, Qt::Key_Battery, - XF86XK_Bluetooth, Qt::Key_Bluetooth, - XF86XK_WLAN, Qt::Key_WLAN, - XF86XK_UWB, Qt::Key_UWB, - XF86XK_AudioForward, Qt::Key_AudioForward, - XF86XK_AudioRepeat, Qt::Key_AudioRepeat, - XF86XK_AudioRandomPlay, Qt::Key_AudioRandomPlay, - XF86XK_Subtitle, Qt::Key_Subtitle, - XF86XK_AudioCycleTrack, Qt::Key_AudioCycleTrack, - XF86XK_Time, Qt::Key_Time, - XF86XK_Select, Qt::Key_Select, - XF86XK_View, Qt::Key_View, - XF86XK_TopMenu, Qt::Key_TopMenu, - XF86XK_Bluetooth, Qt::Key_Bluetooth, - XF86XK_Suspend, Qt::Key_Suspend, - XF86XK_Hibernate, Qt::Key_Hibernate, - XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 5: remap properly - XF86XK_Launch1, Qt::Key_Launch3, - XF86XK_Launch2, Qt::Key_Launch4, - XF86XK_Launch3, Qt::Key_Launch5, - XF86XK_Launch4, Qt::Key_Launch6, - XF86XK_Launch5, Qt::Key_Launch7, - XF86XK_Launch6, Qt::Key_Launch8, - XF86XK_Launch7, Qt::Key_Launch9, - XF86XK_Launch8, Qt::Key_LaunchA, - XF86XK_Launch9, Qt::Key_LaunchB, //510 - XF86XK_LaunchA, Qt::Key_LaunchC, - XF86XK_LaunchB, Qt::Key_LaunchD, - XF86XK_LaunchC, Qt::Key_LaunchE, - XF86XK_LaunchD, Qt::Key_LaunchF, - XF86XK_LaunchE, Qt::Key_LaunchG, - XF86XK_LaunchF, Qt::Key_LaunchH, //522 - - // Qtopia keys - QTOPIAXK_Select, Qt::Key_Select, //524 - QTOPIAXK_Yes, Qt::Key_Yes, - QTOPIAXK_No, Qt::Key_No, - QTOPIAXK_Cancel, Qt::Key_Cancel, - QTOPIAXK_Printer, Qt::Key_Printer, - QTOPIAXK_Execute, Qt::Key_Execute, - QTOPIAXK_Sleep, Qt::Key_Sleep, - QTOPIAXK_Play, Qt::Key_Play, - QTOPIAXK_Zoom, Qt::Key_Zoom, - QTOPIAXK_Context1, Qt::Key_Context1, - QTOPIAXK_Context2, Qt::Key_Context2, - QTOPIAXK_Context3, Qt::Key_Context3, - QTOPIAXK_Context4, Qt::Key_Context4, - QTOPIAXK_Call, Qt::Key_Call, - QTOPIAXK_Hangup, Qt::Key_Hangup, - QTOPIAXK_Flip, Qt::Key_Flip, //554 - - //XK_KP_F1, Qt::Key_F1, - //XK_KP_F2, Qt::Key_F2, - //XK_KP_F3, Qt::Key_F3, - //XK_KP_F4, Qt::Key_F4, - - XK_F1, Qt::Key_F1, //556 - XK_F2, Qt::Key_F2, - XK_F3, Qt::Key_F3, - XK_F4, Qt::Key_F4, - XK_F5, Qt::Key_F5, - XK_F6, Qt::Key_F6, - XK_F7, Qt::Key_F7, - XK_F8, Qt::Key_F8, - XK_F9, Qt::Key_F9, - XK_F10, Qt::Key_F10, - XK_F11, Qt::Key_F11, - XK_F12, Qt::Key_F12, - XK_F13, Qt::Key_F13, - XK_F14, Qt::Key_F14, - XK_F15, Qt::Key_F15, - XK_F16, Qt::Key_F16, - XK_F17, Qt::Key_F17, - XK_F18, Qt::Key_F18, - XK_F19, Qt::Key_F19, - XK_F20, Qt::Key_F20, - XK_F21, Qt::Key_F21, - XK_F22, Qt::Key_F22, - XK_F23, Qt::Key_F23, - XK_F24, Qt::Key_F24, //602 - - XK_A, Qt::Key_A, //604 - XK_B, Qt::Key_B, - XK_C, Qt::Key_C, - XK_D, Qt::Key_D, //610 - XK_E, Qt::Key_E, - XK_F, Qt::Key_F, - XK_G, Qt::Key_G, - XK_H, Qt::Key_H, - XK_I, Qt::Key_I, - XK_J, Qt::Key_J, - XK_K, Qt::Key_K, - XK_L, Qt::Key_L, - XK_M, Qt::Key_M, - XK_N, Qt::Key_N, - XK_O, Qt::Key_O, - XK_P, Qt::Key_P, - XK_R, Qt::Key_R, - XK_S, Qt::Key_S, - XK_T, Qt::Key_T, - XK_U, Qt::Key_U, - XK_V, Qt::Key_V, - XK_W, Qt::Key_W, - XK_X, Qt::Key_X, - XK_Y, Qt::Key_Y, - XK_Z, Qt::Key_Z, //652 - - 0, 0 //654 -}; - -#endif -#endif - - -static const uint KeyTbl[] = { // Keyboard mapping table - - Qt::Key_unknown, // 0 0x00 - Qt::Key_unknown, // 1 0x01 VK_LBUTTON | Left mouse button - Qt::Key_unknown, // 2 0x02 VK_RBUTTON | Right mouse button - Qt::Key_Cancel, // 3 0x03 VK_CANCEL | Control-Break processing - Qt::Key_unknown, // 4 0x04 VK_MBUTTON | Middle mouse button - Qt::Key_unknown, // 5 0x05 VK_XBUTTON1 | X1 mouse button - Qt::Key_unknown, // 6 0x06 VK_XBUTTON2 | X2 mouse button - Qt::Key_unknown, // 7 0x07 -- unassigned -- - Qt::Key_Backspace, // 8 0x08 VK_BACK | BackSpace key - Qt::Key_Tab, // 9 0x09 VK_TAB | Tab key - Qt::Key_unknown, // 10 0x0A -- reserved -- - Qt::Key_unknown, // 11 0x0B -- reserved -- - Qt::Key_Clear, // 12 0x0C VK_CLEAR | Clear key - Qt::Key_Return, // 13 0x0D VK_RETURN | Enter key - Qt::Key_unknown, // 14 0x0E -- unassigned -- - Qt::Key_unknown, // 15 0x0F -- unassigned -- - Qt::Key_Shift, // 16 0x10 VK_SHIFT | Shift key - Qt::Key_Control, // 17 0x11 VK_CONTROL | Ctrl key - Qt::Key_unknown, // Qt::Key_Alt, // 18 0x12 VK_MENU | Alt key - Qt::Key_Pause, // 19 0x13 VK_PAUSE | Pause key - Qt::Key_CapsLock, // 20 0x14 VK_CAPITAL | Caps-Lock - Qt::Key_unknown, // 21 0x15 VK_KANA / VK_HANGUL | IME Kana or Hangul mode - Qt::Key_unknown, // 22 0x16 -- unassigned -- - Qt::Key_unknown, // 23 0x17 VK_JUNJA | IME Junja mode - Qt::Key_unknown, // 24 0x18 VK_FINAL | IME final mode - Qt::Key_unknown, // 25 0x19 VK_HANJA / VK_KANJI | IME Hanja or Kanji mode - Qt::Key_unknown, // 26 0x1A -- unassigned -- - Qt::Key_Escape, // 27 0x1B VK_ESCAPE | Esc key - Qt::Key_unknown, // 28 0x1C VK_CONVERT | IME convert - Qt::Key_unknown, // 29 0x1D VK_NONCONVERT | IME non-convert - Qt::Key_unknown, // 30 0x1E VK_ACCEPT | IME accept - Qt::Key_Mode_switch,// 31 0x1F VK_MODECHANGE | IME mode change request - Qt::Key_Space, // 32 0x20 VK_SPACE | Spacebar - Qt::Key_PageUp, // 33 0x21 VK_PRIOR | Page Up key - Qt::Key_PageDown, // 34 0x22 VK_NEXT | Page Down key - Qt::Key_End, // 35 0x23 VK_END | End key - Qt::Key_Home, // 36 0x24 VK_HOME | Home key - Qt::Key_Left, // 37 0x25 VK_LEFT | Left arrow key - Qt::Key_Up, // 38 0x26 VK_UP | Up arrow key - Qt::Key_Right, // 39 0x27 VK_RIGHT | Right arrow key - Qt::Key_Down, // 40 0x28 VK_DOWN | Down arrow key - Qt::Key_Select, // 41 0x29 VK_SELECT | Select key - Qt::Key_Printer, // 42 0x2A VK_PRINT | Print key - Qt::Key_Execute, // 43 0x2B VK_EXECUTE | Execute key - Qt::Key_Print, // 44 0x2C VK_SNAPSHOT | Print Screen key - Qt::Key_Insert, // 45 0x2D VK_INSERT | Ins key - Qt::Key_Delete, // 46 0x2E VK_DELETE | Del key //65439 - Qt::Key_Help, // 47 0x2F VK_HELP | Help key //65386 - 0, // 48 0x30 (VK_0) | 0 key - 0, // 49 0x31 (VK_1) | 1 key - 0, // 50 0x32 (VK_2) | 2 key - 0, // 51 0x33 (VK_3) | 3 key - 0, // 52 0x34 (VK_4) | 4 key - 0, // 53 0x35 (VK_5) | 5 key - 0, // 54 0x36 (VK_6) | 6 key - 0, // 55 0x37 (VK_7) | 7 key - 0, // 56 0x38 (VK_8) | 8 key - 0, // 57 0x39 (VK_9) | 9 key - Qt::Key_unknown, // 58 0x3A -- unassigned -- - Qt::Key_unknown, // 59 0x3B -- unassigned -- - Qt::Key_unknown, // 60 0x3C -- unassigned -- - Qt::Key_unknown, // 61 0x3D -- unassigned -- - Qt::Key_unknown, // 62 0x3E -- unassigned -- - Qt::Key_unknown, // 63 0x3F -- unassigned -- - Qt::Key_unknown, // 64 0x40 -- unassigned -- - Qt::Key_A, // 65 0x41 (VK_A) | A key - Qt::Key_B, // 66 0x42 (VK_B) | B key - Qt::Key_C, // 67 0x43 (VK_C) | C key - Qt::Key_D, // 68 0x44 (VK_D) | D key - Qt::Key_E, // 69 0x45 (VK_E) | E key - Qt::Key_F, // 70 0x46 (VK_F) | F key - Qt::Key_G, // 71 0x47 (VK_G) | G key - Qt::Key_H, // 72 0x48 (VK_H) | H key - Qt::Key_I, // 73 0x49 (VK_I) | I key - Qt::Key_J, // 74 0x4A (VK_J) | J key - Qt::Key_K, // 75 0x4B (VK_K) | K key - Qt::Key_L, // 76 0x4C (VK_L) | L key - Qt::Key_M, // 77 0x4D (VK_M) | M key - Qt::Key_N, // 78 0x4E (VK_N) | N key - Qt::Key_O, // 79 0x4F (VK_O) | O key - Qt::Key_P, // 80 0x50 (VK_P) | P key - Qt::Key_Q, // 81 0x51 (VK_Q) | Q key - Qt::Key_R, // 82 0x52 (VK_R) | R key - Qt::Key_S, // 83 0x53 (VK_S) | S key - Qt::Key_T, // 84 0x54 (VK_T) | T key - Qt::Key_U, // 85 0x55 (VK_U) | U key - Qt::Key_V, // 86 0x56 (VK_V) | V key - Qt::Key_W, // 87 0x57 (VK_W) | W key - Qt::Key_X, // 88 0x58 (VK_X) | X key - Qt::Key_Y, // 89 0x59 (VK_Y) | Y key - Qt::Key_Z, // 90 0x5A (VK_Z) | Z key - Qt::Key_Meta, // 91 0x5B VK_LWIN | Left Windows - MS Natural kbd - Qt::Key_Meta, // 92 0x5C VK_RWIN | Right Windows - MS Natural kbd - Qt::Key_Menu, // 93 0x5D VK_APPS | Application key-MS Natural kbd - Qt::Key_unknown, // 94 0x5E -- reserved -- - Qt::Key_Sleep, // 95 0x5F VK_SLEEP - Qt::Key_0, // 96 0x60 VK_NUMPAD0 | Numeric keypad 0 key - Qt::Key_1, // 97 0x61 VK_NUMPAD1 | Numeric keypad 1 key - Qt::Key_2, // 98 0x62 VK_NUMPAD2 | Numeric keypad 2 key - Qt::Key_3, // 99 0x63 VK_NUMPAD3 | Numeric keypad 3 key - Qt::Key_4, // 100 0x64 VK_NUMPAD4 | Numeric keypad 4 key - Qt::Key_5, // 101 0x65 VK_NUMPAD5 | Numeric keypad 5 key - Qt::Key_6, // 102 0x66 VK_NUMPAD6 | Numeric keypad 6 key - Qt::Key_7, // 103 0x67 VK_NUMPAD7 | Numeric keypad 7 key - Qt::Key_8, // 104 0x68 VK_NUMPAD8 | Numeric keypad 8 key - Qt::Key_9, // 105 0x69 VK_NUMPAD9 | Numeric keypad 9 key - Qt::Key_Asterisk, // 106 0x6A VK_MULTIPLY | Multiply key - Qt::Key_Plus, // 107 0x6B VK_ADD | Add key - Qt::Key_Comma, // 108 0x6C VK_SEPARATOR | Separator key - Qt::Key_Minus, // 109 0x6D VK_SUBTRACT | Subtract key - Qt::Key_Period, // 110 0x6E VK_DECIMAL | Decimal key - Qt::Key_Slash, // 111 0x6F VK_DIVIDE | Divide key - Qt::Key_F1, // 112 0x70 VK_F1 | F1 key - Qt::Key_F2, // 113 0x71 VK_F2 | F2 key - Qt::Key_F3, // 114 0x72 VK_F3 | F3 key - Qt::Key_F4, // 115 0x73 VK_F4 | F4 key - Qt::Key_F5, // 116 0x74 VK_F5 | F5 key - Qt::Key_F6, // 117 0x75 VK_F6 | F6 key - Qt::Key_F7, // 118 0x76 VK_F7 | F7 key - Qt::Key_F8, // 119 0x77 VK_F8 | F8 key - Qt::Key_F9, // 120 0x78 VK_F9 | F9 key - Qt::Key_F10, // 121 0x79 VK_F10 | F10 key - Qt::Key_F11, // 122 0x7A VK_F11 | F11 key - Qt::Key_F12, // 123 0x7B VK_F12 | F12 key - Qt::Key_F13, // 124 0x7C VK_F13 | F13 key - Qt::Key_F14, // 125 0x7D VK_F14 | F14 key - Qt::Key_F15, // 126 0x7E VK_F15 | F15 key - Qt::Key_F16, // 127 0x7F VK_F16 | F16 key - Qt::Key_F17, // 128 0x80 VK_F17 | F17 key - Qt::Key_F18, // 129 0x81 VK_F18 | F18 key - Qt::Key_F19, // 130 0x82 VK_F19 | F19 key - Qt::Key_F20, // 131 0x83 VK_F20 | F20 key - Qt::Key_F21, // 132 0x84 VK_F21 | F21 key - Qt::Key_F22, // 133 0x85 VK_F22 | F22 key - Qt::Key_F23, // 134 0x86 VK_F23 | F23 key - Qt::Key_F24, // 135 0x87 VK_F24 | F24 key - Qt::Key_unknown, // 136 0x88 -- unassigned -- - Qt::Key_unknown, // 137 0x89 -- unassigned -- - Qt::Key_unknown, // 138 0x8A -- unassigned -- - Qt::Key_unknown, // 139 0x8B -- unassigned -- - Qt::Key_unknown, // 140 0x8C -- unassigned -- - Qt::Key_unknown, // 141 0x8D -- unassigned -- - Qt::Key_unknown, // 142 0x8E -- unassigned -- - Qt::Key_unknown, // 143 0x8F -- unassigned -- - Qt::Key_NumLock, // 144 0x90 VK_NUMLOCK | Num Lock key - Qt::Key_ScrollLock, // 145 0x91 VK_SCROLL | Scroll Lock key - // Fujitsu/OASYS kbd -------------------- - 0, //Qt::Key_Jisho, // 146 0x92 VK_OEM_FJ_JISHO | 'Dictionary' key / - // VK_OEM_NEC_EQUAL = key on numpad on NEC PC-9800 kbd - Qt::Key_Massyo, // 147 0x93 VK_OEM_FJ_MASSHOU | 'Unregister word' key - Qt::Key_Touroku, // 148 0x94 VK_OEM_FJ_TOUROKU | 'Register word' key - 0, //Qt::Key_Oyayubi_Left,//149 0x95 VK_OEM_FJ_LOYA | 'Left OYAYUBI' key - 0, //Qt::Key_Oyayubi_Right,//150 0x96 VK_OEM_FJ_ROYA | 'Right OYAYUBI' key - Qt::Key_unknown, // 151 0x97 -- unassigned -- - Qt::Key_unknown, // 152 0x98 -- unassigned -- - Qt::Key_unknown, // 153 0x99 -- unassigned -- - Qt::Key_unknown, // 154 0x9A -- unassigned -- - Qt::Key_unknown, // 155 0x9B -- unassigned -- - Qt::Key_unknown, // 156 0x9C -- unassigned -- - Qt::Key_unknown, // 157 0x9D -- unassigned -- - Qt::Key_unknown, // 158 0x9E -- unassigned -- - Qt::Key_unknown, // 159 0x9F -- unassigned -- - Qt::Key_Shift, // 160 0xA0 VK_LSHIFT | Left Shift key - Qt::Key_Shift, // 161 0xA1 VK_RSHIFT | Right Shift key - Qt::Key_Control, // 162 0xA2 VK_LCONTROL | Left Ctrl key - Qt::Key_Control, // 163 0xA3 VK_RCONTROL | Right Ctrl key - Qt::Key_Alt, // 164 0xA4 VK_LMENU | Left Menu key - Qt::Key_Alt, // 165 0xA5 VK_RMENU | Right Menu key - Qt::Key_Back, // 166 0xA6 VK_BROWSER_BACK | Browser Back key - Qt::Key_Forward, // 167 0xA7 VK_BROWSER_FORWARD | Browser Forward key - Qt::Key_Refresh, // 168 0xA8 VK_BROWSER_REFRESH | Browser Refresh key - Qt::Key_Stop, // 169 0xA9 VK_BROWSER_STOP | Browser Stop key - Qt::Key_Search, // 170 0xAA VK_BROWSER_SEARCH | Browser Search key - Qt::Key_Favorites, // 171 0xAB VK_BROWSER_FAVORITES| Browser Favorites key - Qt::Key_HomePage, // 172 0xAC VK_BROWSER_HOME | Browser Start and Home key - Qt::Key_VolumeMute, // 173 0xAD VK_VOLUME_MUTE | Volume Mute key - Qt::Key_VolumeDown, // 174 0xAE VK_VOLUME_DOWN | Volume Down key - Qt::Key_VolumeUp, // 175 0xAF VK_VOLUME_UP | Volume Up key - Qt::Key_MediaNext, // 176 0xB0 VK_MEDIA_NEXT_TRACK | Next Track key - Qt::Key_MediaPrevious, //177 0xB1 VK_MEDIA_PREV_TRACK | Previous Track key - Qt::Key_MediaStop, // 178 0xB2 VK_MEDIA_STOP | Stop Media key - Qt::Key_MediaPlay, // 179 0xB3 VK_MEDIA_PLAY_PAUSE | Play/Pause Media key - Qt::Key_LaunchMail, // 180 0xB4 VK_LAUNCH_MAIL | Start Mail key - Qt::Key_LaunchMedia,// 181 0xB5 VK_LAUNCH_MEDIA_SELECT Select Media key - Qt::Key_Launch0, // 182 0xB6 VK_LAUNCH_APP1 | Start Application 1 key - Qt::Key_Launch1, // 183 0xB7 VK_LAUNCH_APP2 | Start Application 2 key - Qt::Key_unknown, // 184 0xB8 -- reserved -- - Qt::Key_unknown, // 185 0xB9 -- reserved -- - 0, // 186 0xBA VK_OEM_1 | ';:' for US - 0, // 187 0xBB VK_OEM_PLUS | '+' any country - 0, // 188 0xBC VK_OEM_COMMA | ',' any country - 0, // 189 0xBD VK_OEM_MINUS | '-' any country - 0, // 190 0xBE VK_OEM_PERIOD | '.' any country - 0, // 191 0xBF VK_OEM_2 | '/?' for US - 0, // 192 0xC0 VK_OEM_3 | '`~' for US - Qt::Key_unknown, // 193 0xC1 -- reserved -- - Qt::Key_unknown, // 194 0xC2 -- reserved -- - Qt::Key_unknown, // 195 0xC3 -- reserved -- - Qt::Key_unknown, // 196 0xC4 -- reserved -- - Qt::Key_unknown, // 197 0xC5 -- reserved -- - Qt::Key_unknown, // 198 0xC6 -- reserved -- - Qt::Key_unknown, // 199 0xC7 -- reserved -- - Qt::Key_unknown, // 200 0xC8 -- reserved -- - Qt::Key_unknown, // 201 0xC9 -- reserved -- - Qt::Key_unknown, // 202 0xCA -- reserved -- - Qt::Key_unknown, // 203 0xCB -- reserved -- - Qt::Key_unknown, // 204 0xCC -- reserved -- - Qt::Key_unknown, // 205 0xCD -- reserved -- - Qt::Key_unknown, // 206 0xCE -- reserved -- - Qt::Key_unknown, // 207 0xCF -- reserved -- - Qt::Key_unknown, // 208 0xD0 -- reserved -- - Qt::Key_unknown, // 209 0xD1 -- reserved -- - Qt::Key_unknown, // 210 0xD2 -- reserved -- - Qt::Key_unknown, // 211 0xD3 -- reserved -- - Qt::Key_unknown, // 212 0xD4 -- reserved -- - Qt::Key_unknown, // 213 0xD5 -- reserved -- - Qt::Key_unknown, // 214 0xD6 -- reserved -- - Qt::Key_unknown, // 215 0xD7 -- reserved -- - Qt::Key_unknown, // 216 0xD8 -- unassigned -- - Qt::Key_unknown, // 217 0xD9 -- unassigned -- - Qt::Key_unknown, // 218 0xDA -- unassigned -- - 0, // 219 0xDB VK_OEM_4 | '[{' for US - 0, // 220 0xDC VK_OEM_5 | '\|' for US - 0, // 221 0xDD VK_OEM_6 | ']}' for US - 0, // 222 0xDE VK_OEM_7 | ''"' for US - 0, // 223 0xDF VK_OEM_8 - Qt::Key_unknown, // 224 0xE0 -- reserved -- - Qt::Key_unknown, // 225 0xE1 VK_OEM_AX | 'AX' key on Japanese AX kbd - Qt::Key_unknown, // 226 0xE2 VK_OEM_102 | "<>" or "\|" on RT 102-key kbd - Qt::Key_unknown, // 227 0xE3 VK_ICO_HELP | Help key on ICO - Qt::Key_unknown, // 228 0xE4 VK_ICO_00 | 00 key on ICO - Qt::Key_unknown, // 229 0xE5 VK_PROCESSKEY | IME Process key - Qt::Key_unknown, // 230 0xE6 VK_ICO_CLEAR | - Qt::Key_unknown, // 231 0xE7 VK_PACKET | Unicode char as keystrokes - Qt::Key_unknown, // 232 0xE8 -- unassigned -- - // Nokia/Ericsson definitions --------------- - Qt::Key_unknown, // 233 0xE9 VK_OEM_RESET - Qt::Key_unknown, // 234 0xEA VK_OEM_JUMP - Qt::Key_unknown, // 235 0xEB VK_OEM_PA1 - Qt::Key_unknown, // 236 0xEC VK_OEM_PA2 - Qt::Key_unknown, // 237 0xED VK_OEM_PA3 - Qt::Key_unknown, // 238 0xEE VK_OEM_WSCTRL - Qt::Key_unknown, // 239 0xEF VK_OEM_CUSEL - Qt::Key_unknown, // 240 0xF0 VK_OEM_ATTN - Qt::Key_unknown, // 241 0xF1 VK_OEM_FINISH - Qt::Key_unknown, // 242 0xF2 VK_OEM_COPY - Qt::Key_unknown, // 243 0xF3 VK_OEM_AUTO - Qt::Key_unknown, // 244 0xF4 VK_OEM_ENLW - Qt::Key_unknown, // 245 0xF5 VK_OEM_BACKTAB - Qt::Key_unknown, // 246 0xF6 VK_ATTN | Attn key - Qt::Key_unknown, // 247 0xF7 VK_CRSEL | CrSel key - Qt::Key_unknown, // 248 0xF8 VK_EXSEL | ExSel key - Qt::Key_unknown, // 249 0xF9 VK_EREOF | Erase EOF key - Qt::Key_Play, // 250 0xFA VK_PLAY | Play key - Qt::Key_Zoom, // 251 0xFB VK_ZOOM | Zoom key - Qt::Key_unknown, // 252 0xFC VK_NONAME | Reserved - Qt::Key_unknown, // 253 0xFD VK_PA1 | PA1 key - Qt::Key_Clear, // 254 0xFE VK_OEM_CLEAR | Clear key - 0 -}; - - -static int m_iKeyPressed = 0; - -class KeyControler -{ - -public: - - static bool fCtrlV( unsigned int _iVar, unsigned int _iKay); - - static int fKeyWin(unsigned int _iKey); - static int fKeyLinux(unsigned int _iKey); -}; - -#endif // KEYCONTROLERH_H diff --git a/src/StaticData.h b/src/StaticData.h index 32ecafc..b2ce8cb 100644 --- a/src/StaticData.h +++ b/src/StaticData.h @@ -20,48 +20,33 @@ class StaticData static inline QString m_sSettingsFile = "setClient.ini"; static inline QString m_sProcessWorkingDirector = QDir::homePath(); static inline unsigned short m_sPortTCP = 1235; - static inline unsigned short m_sPortRTSP = 8554; - static inline unsigned short m_sPortRTMP = 1935; static inline QString m_sPathData = ""; - static inline QString m_sRtspDescriptor = ""; static inline QString m_sMyId = "0"; static inline QString m_sLogin = "user"; static inline QString m_sPassword = "user"; - static inline bool m_bTest = false; static inline QString m_sDeskLogin = ""; static inline QString m_sDeskPassword = ""; static inline QString m_sDeskId = ""; - static inline QString m_sWithoutStream = "WITHOUT_STREAM"; - static inline int m_iTimeForStream = 10; - static inline int _iSizeFr = 0; - static inline int _iFPS = 30; - static inline int _iEnvoderV = 0; - static inline int _iEncSpeed = 1; - static inline int _iBetrate = 25; - static inline int _iLatencyZ = 1; - static inline int _iStreamRTSP = 0; - static inline int _iSoundCapture = 0; - - static inline int _iCurSizeFr = 0; - static inline int _iCurFPS = 30; - static inline int _iCurEnvoderV = 0; - static inline int _iCurEncSpeed = 1; - static inline int _iCurBetrate = 25; - static inline int _iCurLatencyZ = 1; - static inline int _iCurStreamRTSP = 0; - static inline int _iCurSoundCapture = 0; - static inline int _iPlayerVar = 0; //0 - use QML-player; 1 - use gstFrame - - static inline QString m_sKeyDevServer = "rFex3x4ue35"; static inline bool m_bDevServer = false; + static inline QString m_sKeyDevServer = "rFex3x4ue35"; static inline QString m_sServerPassword = "1111"; + static inline QString m_sWithoutStream = "WITHOUT_STREAM"; + + static inline QString m_sSupport = "Support:" + "\r\n * GitHub - https://github.com/In-spectrum/BypassNAT?tab=readme-ov-file;" + "\r\n * BypassNAT - MIT license ( https://github.com/In-spectrum/BypassNAT/blob/main/LICENSE );" + "\r\nwas used:" + "\r\n * Qt - LGPL-v3 license ( https://www.gnu.org/licenses/lgpl-3.0.txt );" + "\r\n"; + + static int randInt(int low, int high) { // Random number between low and high @@ -126,113 +111,6 @@ class StaticData return true; } - - static bool fAvailableNvh264enc() - { - - QProcess pingProcess; - pingProcess.setProcessChannelMode(QProcess::MergedChannels); - pingProcess.setReadChannel(QProcess::StandardOutput); - - // connect(&pingProcess, &QProcess::errorOccurred, [=](QProcess::ProcessError error) - // { - // qDebug() << " Control::fAvailableNvh264enc 1: error enum val =" << error; - // }); - - #ifdef Q_OS_WIN - //pingProcess.start("gst-inspect-1.0.exe", QStringList() << "|" << "grep" << "nvenc"); - pingProcess.start("gst-inspect-1.0.exe", QStringList() << "nvh264enc"); - #else - #ifdef Q_OS_LINUX - //pingProcess.start("gst-inspect-1.0", QStringList() << "|" << "grep" << "nvenc"); - pingProcess.start("gst-inspect-1.0", QStringList() << "nvh264enc"); - #endif - #endif - - pingProcess.waitForFinished(); - - QString output(pingProcess.readAllStandardOutput()); - //qDebug() << "Control::fAvailableNvh264enc 3.0: " << output; - - if(output.toLower().indexOf("nvh264enc") >= 0 - && output.toLower().indexOf("width:") >= 0 - && output.toLower().indexOf("height:") >= 0 - ) - return true; - - return false; - } - - static QString fAvailableSoundMonitor() - { - - QProcess pingProcess; - pingProcess.setProcessChannelMode(QProcess::MergedChannels); - pingProcess.setReadChannel(QProcess::StandardOutput); - - pingProcess.start("pactl", QStringList() << "list" << "short" << "sources"); - - // if (pingProcess.waitForStarted(-1)) - // { - // while(pingProcess.waitForReadyRead(-1)) - // { - // while(pingProcess.canReadLine()) - // { - // QByteArray a_baT = pingProcess.readLine(); - - // qDebug() << "ComandLine::fAvailableSoundMonitor 4: " << QString::fromStdString(a_baT.toStdString()); - // } - - // } - // } - - pingProcess.waitForFinished(); - - QString output(pingProcess.readAllStandardOutput()); - //qDebug() << "Control::fAvailableSoundMonitor 3.0: " << output; - - QString s_aRet; - - QStringList a_slTemp = output.split(" "); - - //alsa_output.pci-0000_02_02.0.analog-stereo.monitor - - for(QString s : a_slTemp) - { - if(s.toLower().indexOf("output") >= 0 - && s.toLower().indexOf(".monitor") >= 0 ) - { - s_aRet = s; - //qDebug() << "Control::fAvailableSoundMonitor 5: " << s_aRet; - - break; - } - } - - //qDebug() << "Control::fAvailableSoundMonitor 6: " << s_aRet; - - if(s_aRet.indexOf("\t") >= 0) - { - a_slTemp = s_aRet.split("\t"); - - for(QString s : a_slTemp) - { - if(s.toLower().indexOf("output") >= 0 - && s.toLower().indexOf(".monitor") >= 0 ) - { - s_aRet = s; - //qDebug() << "Control::fAvailableSoundMonitor 7: " << s_aRet; - - break; - } - } - } - - qDebug() << "Control::fAvailableSoundMonitor 10: " << s_aRet; - - return s_aRet; - } - }; #endif // STATICDATA_H diff --git a/src/control.cpp b/src/control.cpp index f643f82..903cf74 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -1,8 +1,5 @@ #include "control.h" -#ifdef Q_OS_ANDROID - -#else #ifdef Q_OS_WIN #include #else @@ -12,33 +9,58 @@ #include #endif #endif -#endif -Control::Control(QQmlApplicationEngine *_pApp) +Control::Control(QStringList _sDataIn) { - m_pApp = _pApp; - m_obMain = m_obVideo = m_obMenu = nullptr; + //qDebug() << "Control::Control 0:" << _sDataIn; + + //fGenerateLogPass(); + fPropertySet( _sDataIn ); + + + if( SettingsApp::slDevServer() ) + slServerUpdateData( slServerIP() + , "0" + , "0" + , "0" + , SettingsApp::slKeyDevServer() + , slServerPassword() + ); + else + slServerUpdateData( slServerIP() + , QString::number( slPortTCP() ) + , "0" + , "0" + , SettingsApp::slKeyDevServer() + , slServerPassword() + ); - fKeyEventClear(); - fGenerateLogPass(); + QTimer *timer = new QTimer(this); + connect(timer, &QTimer::timeout, this, &Control::slotTimer); + timer->setInterval(1000); + timer->start(); } Control::~Control() { - qDebug() << "Control::~Control 0: "; + //qDebug() << "Control::~Control 0: "; + + slotDestruction(); + + //QThread::sleep(2); + + //qDebug() << "Control::~Control 10: "; } void Control::slotDestruction() { - m_obMain = nullptr; - m_obVideo = nullptr; - m_obMenu = nullptr; + qDebug() << "Control::slotDestruction 0: "; fClientDisconnect(); @@ -52,97 +74,20 @@ void Control::slotDestruction() a_iStop++; } - QThread::msleep(1000); + QThread::msleep(200); qDebug() << "Control::slotDestruction 200: " << a_iStop << m_iThClientSoc; } -void Control::slotFindCheldren() -{ - m_obMain = m_pApp->rootObjects().first(); - m_obVideo = m_obMain->findChild("obVideo"); - m_obMenu = m_obMain->findChild("obMenu"); - - slConnectToServer(StaticData::m_sLogin, StaticData::m_sPassword); -} - void Control::slotTimer() { emit sgTimer(); fConnectClientStatus(); - if(m_iTimeForBuffer < 10) - m_iTimeForBuffer++; - - if(m_obVideo) - { - QMetaObject::invokeMethod(m_obVideo, "fTimer"); - } - - fNewStream(); } -void Control::fStreamReaderDelete(QQmlEngine *_engineMain) -{ - //qDebug() << "fStreamReaderDelete 0: "; - - - StaticData::m_iTimeForStream = 10; - m_iNewStream = 5; - m_bErrStream = false; - - - //qDebug() << "fStreamReaderDelete 10: "; -} - -QString Control::fStreamReadGST() -{ - //gst-pipeline: rtmpsrc location='rtmp://localhost/111/ live=1' ! queue ! decodebin ! videoconvert ! qtvideosink - QString rtpCamStr; - - //if( slStreamRTSP() ) - { - rtpCamStr = ""; - rtpCamStr.append(QLatin1String("rtsp://")); - rtpCamStr.append( slServerIP() ); - rtpCamStr.append(QLatin1String(":")); - rtpCamStr.append( QString::number( slPortRTSP() ) ); - rtpCamStr.append(QLatin1String("/live/")); - rtpCamStr.append(m_sNewStreamUrl); - } - // else - // { - // #ifdef Q_OS_WIN - - // rtpCamStr = ""; - // rtpCamStr.append(QLatin1String("rtsp://")); - // rtpCamStr.append( slServerIP() ); - // rtpCamStr.append(QLatin1String(":")); - // rtpCamStr.append( QString::number( slPortRTSP() ) ); - // rtpCamStr.append(QLatin1String("/live/")); - // rtpCamStr.append(m_sNewStreamUrl); - // #else - // rtpCamStr = ""; - // rtpCamStr.append(QLatin1String("rtmp://")); - // rtpCamStr.append( slServerIP() ); - // rtpCamStr.append(QLatin1String(":")); - // rtpCamStr.append( QString::number( slPortRTMP() ) ); - // rtpCamStr.append(QLatin1String("/live/")); - // rtpCamStr.append(m_sNewStreamUrl); - // //rtpCamStr.append(QLatin1String("/")); - // //rtpCamStr.append(QLatin1String(" live=1")); - // #endif - // } - - rtpCamStr = rtpCamStr.replace("localhost", "127.0.0.1"); - - //qDebug() << "fStreamReadGST 10: " << rtpCamStr; - - return rtpCamStr; -} - void Control::fConnectToServer(QString _sIp, int _iPort, QString _sLogin, QString _sPassword) { emit sgClientStop(); @@ -159,8 +104,6 @@ void Control::fConnectToServer(QString _sIp, int _iPort, QString _sLogin, QStrin connect(a_thread, SIGNAL(finished()), this, SLOT(slThClientFin()), Qt::DirectConnection); connect(this, SIGNAL(sgClientStop()), a_thread, SLOT( slStop())); connect(this, &Control::sgSendMassang, a_thread, &NewClient::slAddDataWrite, Qt::QueuedConnection); - connect(this, &Control::sgSendMouseEvent, a_thread, &NewClient::slSendMouseEvent); - connect(this, &Control::sgSendKeyEvent, a_thread, &NewClient::slSendKeyEvent); connect(this, &Control::sgTimer, a_thread, &NewClient::slTimer); connect(this, &Control::sgControl, a_thread, &NewClient::slControl, Qt::QueuedConnection); @@ -174,8 +117,6 @@ void Control::fConnectToServer(QString _sIp, int _iPort, QString _sLogin, QStrin void Control::slConnectToServer(QString _sLogin, QString _sPassword) { - fStreamReadClear(); - if(_sLogin.length() == 0 || _sPassword.length() == 0) return; @@ -186,94 +127,7 @@ void Control::slConnectToServer(QString _sLogin, QString _sPassword) //fConnectToServer("192.168.1.189", StaticData::m_sPortTCP, StaticData::m_sLogin, StaticData::m_sPassword); //fConnectToServer("127.0.0.1", StaticData::m_sPortTCP, StaticData::m_sLogin, StaticData::m_sPassword); - fConnectToServer(slServerIP(), slPortTCP(), StaticData::m_sLogin, StaticData::m_sPassword); -} - -void Control::slDisConnectDesktop(int _bVar) -{ - - m_bDisconnect = _bVar > 0 ? true : false; - - if(_bVar == 1) - { - fStreamReadClear(); - - m_bStream = false; - - if(m_obVideo && !m_bStream) - { - QMetaObject::invokeMethod(m_obVideo, "fVideoStartStop" - , Q_ARG(QVariant, "") - , Q_ARG(QVariant, 0) ); - } - - emit sgSendMassang( MyProtocol::fConnectToDesktop("0", "0", StaticData::m_sDeskId, m_bStream) ); - - - - StaticData::m_sDeskLogin = ""; - StaticData::m_sDeskPassword = ""; - StaticData::m_sDeskId = ""; - - fConnectClientStatus(); - fStatusConnectToDesktop(false); - } - else - { - if(_bVar == 2) - { - fStreamReadClear(); - - m_bStream = false; - - if(m_obVideo && !m_bStream) - { - QMetaObject::invokeMethod(m_obVideo, "fVideoStartStop" - , Q_ARG(QVariant, "") - , Q_ARG(QVariant, 0) ); - } - - emit sgSendMassang( MyProtocol::fConnectToDesktop("0", "0", "0", m_bStream) ); - StaticData::m_sDeskId = ""; - - fConnectClientStatus(); - fStatusConnectToDesktop(false); - } - } - -} - -void Control::slConnectToDesktop(bool _bStream, QString _sLogin, QString _sPassword, QString _sId) -{ - //qDebug() << "Control::slConnectToDesktop 0: " << _bStream; - - m_bStream = _bStream; - - if(m_obVideo && !m_bStream) - { - QMetaObject::invokeMethod(m_obVideo, "fVideoStartStop" - , Q_ARG(QVariant, "") - , Q_ARG(QVariant, 0) ); - } - - fStreamReadClear(); - - - if(_sLogin.length() > 0 - && _sPassword.length() > 0 - && _sId.length() > 0 ) - { - - fStatusConnectToDesktop(false); - - StaticData::m_sDeskLogin = _sLogin; - StaticData::m_sDeskPassword = _sPassword; - StaticData::m_sDeskId = _sId; - - emit sgSendMassang( MyProtocol::fConnectToDesktop(StaticData::m_sDeskLogin, StaticData::m_sDeskPassword, StaticData::m_sDeskId, m_bStream) ); - } - - + fConnectToServer(slServerIP(), slPortTCP(), slLogin(), slPassword() ); } void Control::slClientControl(QString _sId, int _iVar, QString _sData) @@ -291,90 +145,20 @@ void Control::slClientControl(QString _sId, int _iVar, QString _sData) break; case 1: { - m_iTimeStreamWrite = 0; - - emit sgSendMassang( MyProtocol::fVideoQualityCurent( StaticData::m_sDeskId, StaticData::m_sMyId - , StaticData::_iCurSizeFr, StaticData::_iCurFPS, StaticData::_iCurEnvoderV - , StaticData::_iCurEncSpeed, StaticData::_iCurBetrate, StaticData::_iCurLatencyZ - , StaticData::_iCurStreamRTSP, StaticData::_iCurSoundCapture) - ); - - if(_sData != m_sCurrentWriteUrl) - { - //qDebug() << "Control::slClientControl 1.1: " << m_sCurrentWriteUrl << _sData; - - } - - m_sCurrentWriteUrl = _sData; - //qDebug() << "Control::slClientControl 1.2: " << _sId << _iVar << _sData; } break; case 2: { - if(m_sNewStreamUrl != _sData) - { - m_iNewStream = 0; - //qDebug() << "Control::slClientControl 2.1: " << m_sNewStreamUrl << _sData; - } - - m_sNewStreamUrl = _sData; - m_bErrStream = false; - - if(_sData == StaticData::m_sWithoutStream) - { - //qDebug() << "Control::slClientControl 2.2: " << _sId << _iVar << _sData; - - slDisConnectDesktop(2); - - - if(m_obMain) - { - - QObject *a_Ob = m_obMain->findChild("obMessageStatus"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fStatus" - , Q_ARG(QVariant, 102) - , Q_ARG(QVariant, "User '" + StaticData::m_sDeskLogin - + "' not support screen capture." - + "\nOnly command line use.") - ); - } - - } - } - - //qDebug() << "Control::slClientControl 2.3: " << m_sNewStreamUrl << _sData; + //qDebug() << "Control::slClientControl 2.2: " << m_sNewStreamUrl << _sData; } break; case 3: { - if(m_obMenu) - { - QMetaObject::invokeMethod(m_obMenu, "fConnectServer" - , Q_ARG(QVariant, _sData) - ); - - QObject *a_Ob = m_obMenu->findChild("obMenuLogin"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fConnect" - , Q_ARG(QVariant, _sData) - ); - } - a_Ob = m_obMenu->findChild("obMenuServer"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fConnect" - , Q_ARG(QVariant, _sData) - ); - } - } } break; @@ -384,25 +168,11 @@ void Control::slClientControl(QString _sId, int _iVar, QString _sData) m_iTimeConnectNotActive = 0; //qDebug() << "Control::slClientControl 4: " << _sId << _iVar << _sData; - - if(StaticData::m_sDeskId.length()) - fStatusConnectToDesktop(true); } break; case 5: { - if(m_obMenu) - { - QObject *a_Ob = m_obMenu->findChild("obMenuDesktop"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fAddDesktop" - , Q_ARG(QVariant, _sData) - , Q_ARG(QVariant, _sId) - ); - } - } } break; case 6: @@ -412,84 +182,29 @@ void Control::slClientControl(QString _sId, int _iVar, QString _sData) break; case 8: { - bool a_bOk; - fBufferWrite(_sId.toInt(&a_bOk, 16), _sData); + } break; case 9: { - fClipboardSend(true); + } break; case 10: { //qDebug() << "Control::slClientControl 10: " << _sId << _sData; - if(m_obMenu) - { - QObject *a_Ob = m_obMenu->findChild("obMenuFileCopy"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fFileWrited" - , Q_ARG(QVariant, _sId) - , Q_ARG(QVariant, _sData) - ); - } - } } break; case 11: { - if(m_obMenu) - { - QObject *a_Ob = m_obMenu->findChild("obComandLine"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fResponse" - , Q_ARG(QVariant, _sId) - , Q_ARG(QVariant, _sData) - ); - } - } } break; case 12: { - //qDebug() << "Control::slClientControl 12.0: " << _sId << _sId.toInt() << _sData; - - if(_sId.toInt() > 200) - { - //qDebug() << "Control::slClientControl 12.1: "; - m_bErrStream = true; - - if(_sId.toInt() == 200 + 2 - || _sId.toInt() == 200 + 5 - || _sId.toInt() == 200 + 7 - || _sId.toInt() == 200 + 9 - || _sId.toInt() == 200 + 10 - ) - { - slDisConnectDesktop(1); - - if(_sId.toInt() == 200 + 9) - { - //qDebug() << "Control::slClientControl 12.3.1: "; - - fClientDisconnect(); - - if(m_obMenu) - { - QMetaObject::invokeMethod(m_obMenu, "fConnectServer" - , Q_ARG(QVariant, "0") - ); - } - } - - //qDebug() << "Control::slClientControl 12.3.2: "; - } - } + qDebug() << "Control::slClientControl 12.0: " << _sId << _sId.toInt() << _sData; if(StaticData::m_sDeskId.length() != 0 || _sId.toInt() == 200 + 2 @@ -500,44 +215,49 @@ void Control::slClientControl(QString _sId, int _iVar, QString _sData) || _sId.toInt() == 200 + 8 || _sId.toInt() == 200 + 9 || _sId.toInt() == 200 + 10 - || _sId.toInt() == 200 + 11 ) { + //qDebug() << "Control::slClientControl 12.1: " << _sData; + } - if(m_obMain) - { + if(_sId.toInt() > 200) + { + //qDebug() << "Control::slClientControl 12.2.0: "; - QObject *a_Ob = m_obMain->findChild("obMessageStatus"); - if(a_Ob) + if(_sId.toInt() == 200 + 2 + || _sId.toInt() == 200 + 5 + || _sId.toInt() == 200 + 7 + || _sId.toInt() == 200 + 9 + || _sId.toInt() == 200 + 10 + || _sId.toInt() == 200 + 11 + ) + { + if(_sId.toInt() == 200 + 9) { - QMetaObject::invokeMethod(a_Ob, "fStatus" - , Q_ARG(QVariant, _sId.toInt()) - , Q_ARG(QVariant, _sData) - ); + QApplication::quit(); } - } + if(_sId.toInt() == 200 + 11) + emit sgControl( "", 24, "", ""); - if(_sId.toInt() == 200 + 11) - emit sgControl( "", 24, "", ""); + //qDebug() << "Control::slClientControl 12.2.2: " << _sId; + } } } break; case 13: { - m_iTimeStreamWrite = 0; + } break; case 14: { //qDebug() << "Control::slClientControl 14.0: " << _sId << _sId.toInt() << _sData; - fVideoQualitySet(_sData); } break; case 15: { //qDebug() << "Control::slClientControl 15.0: " << _sId << _sId.toInt() << _sData; - fVideoQualityCurent(_sData); } break; case 16: @@ -553,22 +273,6 @@ void Control::slClientControl(QString _sId, int _iVar, QString _sData) StaticData::m_bDevServer = true; - if(m_obMenu) - { - QObject *a_Ob = m_obMenu->findChild("obMenuServer"); - - if(a_Ob) - { - QObject *a_ObChkServDev = a_Ob->findChild("obChkServDev"); - - if(a_ObChkServDev - && !a_ObChkServDev->property("checked").toBool() ) - { - a_ObChkServDev->setProperty("checked", true); - } - } - } - if(StaticData::m_sMyId.indexOf("_uds") > 0) { if(StaticData::m_sMyId.indexOf("-") < 0) @@ -583,51 +287,21 @@ void Control::slClientControl(QString _sId, int _iVar, QString _sData) } } - slServerUpdateData(slServerIP(), "0", "0", "0", slKeyDevServer(), slServerPassword() ); + slServerUpdateData(slServerIP() + , "0" + , "0" + , "0" + , slKeyDevServer() + , slServerPassword() ); } else { - slServerUpdateData(slServerIP(), QString::number(slPortTCP()) - , QString::number(slPortRTSP()), QString::number(slPortRTMP()), slKeyDevServer(), slServerPassword() ); - } - } - break; - case 17: - { - //qDebug() << "Control::slClientControl 17.0: " << _sId << _sId.toInt() << _sData; - - if(_sId.toInt() > 300) - { - if( _sId.toInt() == 300 + 8 - ) - { - - if(m_obMain) - { - - QObject *a_Ob = m_obMain->findChild("obMessageStatus"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fStatus" - , Q_ARG(QVariant, _sId.toInt()) - , Q_ARG(QVariant, _sData) - ); - } - } - } - } - } - break; - case 18: - { - //qDebug() << "Control::slClientControl 18.0: " << _sId << _sId.toInt() << _sData; - - m_iNewStream = 0; - - if(!m_bDisconnect && m_bStream && StaticData::m_sDeskId.length() > 0) - { - m_iTimeStreamRestart = 0; - m_bStreamRestart = true; + slServerUpdateData(slServerIP() + , QString::number(slPortTCP()) + , "0" + , "0" + , slKeyDevServer() + , slServerPassword() ); } } @@ -639,43 +313,6 @@ void Control::slClientControl(QString _sId, int _iVar, QString _sData) } -void Control::slSendMouseEvent(int _iVar, bool _bBtLorR, bool _bPressRelease, int _iX, int _iY) -{ - //qDebug() << "slSendMouseEvent 0: " << _iVar << _bBtLorR << _bPressRelease << _iX << _iY; - - if(!m_bConnectClient || !m_bStream) - return; - - emit sgSendMouseEvent( _iVar, _bBtLorR, _bPressRelease, _iX, _iY ); - - m_iTimeForBuffer = 0; -} - -void Control::slSendKeyEvent(unsigned int _iVar, int _iKey, QString _sData) -{ - //qDebug() << "Control::slSendKeyEvent 0: "; - - if(!m_bConnectClient || !m_bStream) - return; - - QByteArray byteArray; - QDataStream stream(&byteArray, QIODevice::WriteOnly); - - stream << _iKey; - - unsigned int x = 0; - -#ifdef Q_OS_WIN - HKL currentLayout = GetKeyboardLayout(0); - x = (quintptr)currentLayout & 0x0000FFFF; - -//qDebug() << "slSendKeyEvent 3.1: " << byteArray.toHex(':') << _iKey << _sData << x; -#endif - - emit sgSendKeyEvent(_iVar, _iKey, x, _sData); - - m_iTimeForBuffer = 0; -} QString Control::slLogin() { @@ -689,33 +326,10 @@ QString Control::slPassword() void Control::fConnectClientStatus() { - bool a_bRecon = true; - - if(m_bStreamRestart && m_iTimeStreamRestart < 10) - m_iTimeStreamRestart++; - - if(m_bStreamRestart && m_iTimeStreamRestart > 1) - { - //qDebug() << "Control::fConnectClientStatus 2: " << "ReConnectToDesktop"; - - m_bStreamRestart = false; - m_iTimeConnectNotActive = 0; - m_iTimeReConnectToDesktop = 0; - a_bRecon = false; - - - m_bConnectClient = false; - if(!m_bDisconnect) - { - slReConnectToDesktop(); - } - } - - if(m_iTimeConnectNotActive < 10) m_iTimeConnectNotActive++; - if(a_bRecon && m_iTimeConnectNotActive > 7) + if(m_iTimeConnectNotActive > 7) { m_bConnectClient = false; @@ -726,9 +340,6 @@ void Control::fConnectClientStatus() m_iTimeReConnectToDesktop = 0; //qDebug() << "fConnectClientStatus 3: " << "ReConnectToDesktop"; - - if(!m_bDisconnect) - slReConnectToDesktop(); } @@ -739,16 +350,6 @@ void Control::fConnectClientStatus() m_bConnectClient = true; } - if(m_obMenu) - { - QMetaObject::invokeMethod(m_obMenu, "fConnectClient" - , Q_ARG(QVariant, m_bConnectClient) - ); - } - - if(!m_bConnectClient) - fStatusConnectToDesktop(m_bConnectClient); - if(m_iTimeConnectNotActive > 3 && m_iTimeConnectNotActive%2 == 0) { @@ -767,21 +368,10 @@ void Control::fConnectClientStatus() if(StaticData::m_iTimeForStream > 3) { - if(m_obMenu) - { - QMetaObject::invokeMethod(m_obMenu, "fStream" - , Q_ARG(QVariant, false) - ); - } + } else { - if(m_obMenu) - { - QMetaObject::invokeMethod(m_obMenu, "fStream" - , Q_ARG(QVariant, true) - ); - } if(StaticData::m_sDeskId.length() > 0) { @@ -799,226 +389,18 @@ void Control::fConnectClientStatus() } - //qDebug() << "fConnectClientStatus 10: " << m_bConnectClient; } -void Control::slSearchDesktop(QString _sUser) -{ - //qDebug() << "slSearchDesktop 5: " << _sUser; - - emit sgSendMassang( MyProtocol::fSearchDesktop(StaticData::m_sMyId, _sUser) ); -} - -void Control::fStatusConnectToDesktop(bool _bVar) -{ - if(m_obMenu) - { - QMetaObject::invokeMethod(m_obMenu, "fFileCopyVisible" - , Q_ARG(QVariant, _bVar) - ); - - if(StaticData::m_sDeskId.length() == 0) - _bVar = true; - - QObject *a_Ob = m_obMenu->findChild("obMenuDesktop"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fConnect" - , Q_ARG(QVariant, _bVar) - ); - } - } -} - -void Control::fStreamReadClear() -{ - //qDebug() << "fStreamReadClear 0: " << m_bConnectClient; - - fStreamReaderDelete(m_pApp); - m_iTimeConnectNotActive = 10; - m_sNewStreamUrl = ""; - -} - void Control::fGenerateLogPass() { //qDebug() << "fGenerateLogPass 0: "; - if(StaticData::m_bTest) - { - StaticData::m_sLogin = StaticData::m_sDeskLogin = "nico"; - StaticData::m_sPassword = StaticData::m_sDeskPassword = "1242"; - - return; - } - StaticData::m_sLogin = MyProtocol::fIdGenerator(MyProtocol::m_sPrefix, "", 8, 10); StaticData::m_sPassword = MyProtocol::fIdGenerator(MyProtocol::m_sPrefix, "", 6, 8); -} - -void Control::slDesktopRealSize(bool _bVar) -{ - if(m_obVideo) - { - QMetaObject::invokeMethod(m_obVideo, "fDescktopRealSize" - , Q_ARG(QVariant, _bVar) - ); - } -} - -void Control::slFullScreen(bool _bVar) -{ - if(m_obMain) - { - QMetaObject::invokeMethod(m_obMain, "fFullScreen" - , Q_ARG(QVariant, _bVar) - ); - } -} - -void Control::fClipboardSend(bool _bLock) -{ - //qDebug() << "Control::slClipboardSend 0: "; - - if(StaticData::m_sMyId == "0" || !m_bStream) - return; - - //qDebug() << "Control::slClipboardSend 1: "; - - if(_bLock) - { - //qDebug() << "Control::mitex 9: "; - m_mtxClipboard.lock(); - //qDebug() << "Control::mitex 8: "; - } - - - QClipboard *clipboard = QGuiApplication::clipboard(); - - - //qDebug() << "Control::fClipboardSend 1.0: " << m_sBufferPrev; - - const QMimeData *mimeData = clipboard->mimeData(); - - for(auto format : mimeData->formats()) - { - // qDebug() << "Control::fClipboardSend 2.1.0: " << format; - // qDebug() << "Control::fClipboardSend 2.1.1: " << QString::fromStdString(mimeData->data(format).toStdString()); - - if(format == "text/plain" - || format == "text/uri-list") - { - //qDebug() << "Control::fClipboardSend 2.2: " << mimeData->data(format).toHex(':'); - //qDebug() << "Control::fClipboardSend 2.3: " << QString::fromStdString(mimeData->data(format).toStdString()); - - emit sgSendMassang( MyProtocol::fSendClipboard(StaticData::m_sMyId, 0, "") ); - - int a_iSend = 0; - int a_iPos = 0; - int a_iPlas = 250; - QString a_sTemp = mimeData->text(); - int a_iSz = a_sTemp.length(); - - //qDebug() << "Control::fClipboardSend 2.4.0: " << a_sTemp; - //qDebug() << "Control::fClipboardSend 2.4.1: " << a_iSz; - - for(a_iPos = 0; a_iPos < a_iSz; a_iPos += a_iPlas ) - { - if(a_iPos + a_iPlas <= a_iSz) - { - if(a_iPos + a_iPlas < a_iSz) - { - //qDebug() << "Control::fClipboardSend 3.2: " << a_iPos; - - emit sgSendMassang( MyProtocol::fSendClipboard(StaticData::m_sMyId, 1 - , a_sTemp.mid(a_iPos, a_iPlas)) ); - - //qDebug() << "Control::fClipboardSend 3.2.1: " << a_sTemp.mid(a_iPos, a_iPlas); - - a_iSend += a_iPlas; - } - else - { - //qDebug() << "Control::fClipboardSend 3.3: " << a_iPos; - - emit sgSendMassang( MyProtocol::fSendClipboard(StaticData::m_sMyId, 2 - , a_sTemp.mid(a_iPos, a_iPlas)) ); - - //qDebug() << "Control::fClipboardSend 3.3.1: " << a_sTemp.mid(a_iPos, a_iPlas); - - a_iSend += a_iPlas; - } - } - } - - if(a_iSend + a_iPlas > a_iSz) - { - //qDebug() << "Control::fClipboardSend 3.4: " << a_iSz << a_iPos << a_iSend; - - emit sgSendMassang( MyProtocol::fSendClipboard(StaticData::m_sMyId, 2 - , a_sTemp.mid(a_iSend, a_iSz - a_iSend)) ); - - //qDebug() << "Control::fClipboardSend 3.4.1: " << a_sTemp.mid(a_iSend, a_iSz - a_iSend); - } - - //qDebug() << "Control::fClipboardSend 4: " << a_iSz << a_iPos << a_iSend; - } - } - - if(_bLock) - { - m_mtxClipboard.unlock(); - //qDebug() << "Control::mitex 7: "; - } - - //qDebug() << "Control::fClipboardSend 10: " << _bLock; - -} - -void Control::fBufferWrite(int _iVar, QString _sData) -{ - //qDebug() << "Control::fBufferWrite 0: " << _iVar << _sData; - - - if(_iVar == 0 || !m_bStream) - { - m_sBufferWrite = ""; - } - else - { - if(_iVar == 1) - { - m_sBufferWrite += _sData; - } - else - { - if(_iVar == 2) - { - m_sBufferWrite += _sData; - - //qDebug() << "Control::fBufferWrite 4: " << m_sBufferWrite; - - if(StaticData::m_sMyId != "0" - && m_iTimeForBuffer < 5 ) - { - //qDebug() << "Control::mitex 5: "; - m_mtxClipboard.lock(); - //qDebug() << "Control::mitex 5: "; - QClipboard *clipboard = QGuiApplication::clipboard(); - clipboard->clear(); - clipboard->setText(m_sBufferWrite); - m_mtxClipboard.unlock(); - //qDebug() << "Control::mitex 4: "; - - } - // else - // qDebug() << "Control::fBufferWrite 5: " << m_iTimeForBuffer; - } - } - } + //qDebug() << "Control::fGenerateLogPass 10: " << StaticData::m_sLogin << StaticData::m_sPassword; } void Control::slFileCopy(int _iVar, QString _sPath) @@ -1062,15 +444,6 @@ unsigned short Control::slPortTCP() return StaticData::m_sPortTCP; } -unsigned short Control::slPortRTSP() -{ - return StaticData::m_sPortRTSP; -} - -unsigned short Control::slPortRTMP() -{ - return StaticData::m_sPortRTMP; -} void Control::slServerUpdateData(QString _sIP, QString _sPortTCP, QString _sPortRTSP, QString _sPortRTMP, QString _sKeyDevServer, QString _sServerPas) { @@ -1085,7 +458,9 @@ void Control::slServerUpdateData(QString _sIP, QString _sPortTCP, QString _sPort { SettingsApp::fSaveServerData(_sIP, _sPortTCP, _sPortRTSP, _sPortRTMP, _sKeyDevServer, _sServerPas); - slConnectToServer(StaticData::m_sLogin, StaticData::m_sPassword); + slConnectToServer(slLogin(), slPassword() ); + + //qDebug() << "Control::slServerUpdateData 5: " << slServerIP() << slPortTCP() << slPortRTSP() << slPortRTMP() << SettingsApp::slDevServer() << SettingsApp::slKeyDevServer(); } } @@ -1101,9 +476,7 @@ bool Control::slIsIP(QString _lIn) void Control::slComandLine(QString _sData, int _iVar) { - if( _iVar == 1 - || _iVar == 2 - ) + if(_iVar == 1) { if(StaticData::m_sDeskId.length() > 0) emit sgSendMassang( MyProtocol::fComandLineRequest( StaticData::m_sDeskId @@ -1113,7 +486,7 @@ void Control::slComandLine(QString _sData, int _iVar) ); } - //$ping -n 20 12.3.213.214 + //$ping -n 20 158.101.219.244 } bool Control::slComandLineStatus() @@ -1138,309 +511,205 @@ QString Control::slDeskPassword() return StaticData::m_sDeskPassword; } -void Control::slVideoQualityStatus() -{ - - if(m_obMenu) - { - - QObject *a_Ob = m_obMain->findChild("obMenuVideoQuality"); - if(a_Ob) - { - QMetaObject::invokeMethod(a_Ob, "fSetStatus" - , Q_ARG(QVariant, StaticData::_iSizeFr) - , Q_ARG(QVariant, StaticData::_iFPS) - , Q_ARG(QVariant, StaticData::_iEnvoderV) - , Q_ARG(QVariant, StaticData::_iEncSpeed) - , Q_ARG(QVariant, StaticData::_iBetrate) - , Q_ARG(QVariant, StaticData::_iLatencyZ) - , Q_ARG(QVariant, StaticData::_iStreamRTSP) - , Q_ARG(QVariant, StaticData::_iSoundCapture) - ); - } - } -} -void Control::slVideoQualityGet(int _iSizeF, int _iFPS, int _iEnvoderV, int _iEncSpeed, int _iBetrate, int _iLatencyZ, bool _bRtsp, int _iSound) +QString Control::slAppName() { - if(m_bStream && StaticData::m_sDeskId.length() > 0) - { - if( StaticData::_iSizeFr == _iSizeF - && StaticData::_iFPS == _iFPS - && StaticData::_iEnvoderV == _iEnvoderV - && StaticData::_iEncSpeed == _iEncSpeed - && StaticData::_iBetrate == _iBetrate - && StaticData::_iLatencyZ == _iLatencyZ - && StaticData::_iStreamRTSP == _bRtsp - && StaticData::_iSoundCapture == _iSound - ) - return; - - - StaticData::_iSizeFr = _iSizeF; - StaticData::_iFPS = _iFPS; - StaticData::_iEnvoderV = _iEnvoderV; - StaticData::_iEncSpeed = _iEncSpeed; - StaticData::_iBetrate = _iBetrate; - StaticData::_iLatencyZ = _iLatencyZ; - StaticData::_iStreamRTSP = _bRtsp; - StaticData::_iSoundCapture = _iSound; - - emit sgSendMassang( MyProtocol::fVideoQualitySet( StaticData::m_sDeskId, StaticData::m_sMyId - ,_iSizeF, _iFPS, _iEnvoderV, _iEncSpeed, _iBetrate, _iLatencyZ - , _bRtsp, _iSound) - ); - } + return StaticData::m_sNameApp + " - " + StaticData::m_sVersion; } -void Control::fVideoQualitySet(QString _sData) +void Control::fTestSomeDataForUser() { - //qDebug() << "Control::fVideoQualitySet 0: " << _sData << _sData.length(); - - - if(_sData.length() != 8) - return; - - QByteArray a_baTemp(_sData.toUtf8()); - - //qDebug() << "Control::fVideoQualitySet 1: " << a_baTemp.toHex(':'); - - if( StaticData::_iCurSizeFr == static_cast( a_baTemp.at(0) ) - && StaticData::_iCurFPS == static_cast( a_baTemp.at(1) ) - && StaticData::_iCurEnvoderV == static_cast( a_baTemp.at(2) ) - && StaticData::_iCurEncSpeed == static_cast( a_baTemp.at(3) ) - && StaticData::_iCurBetrate == static_cast( a_baTemp.at(4) ) - && StaticData::_iCurLatencyZ == static_cast( a_baTemp.at(5) ) - && StaticData::_iCurStreamRTSP == static_cast( a_baTemp.at(6) ) - && StaticData::_iCurSoundCapture == static_cast( a_baTemp.at(7) ) - ) - return; - - StaticData::m_sRtspDescriptor = ""; - - StaticData::_iCurSizeFr = static_cast( a_baTemp.at(0) ); - StaticData::_iCurFPS = static_cast( a_baTemp.at(1) ); - - if( !StaticData::fAvailableNvh264enc() ) - StaticData::_iCurEnvoderV = 0; - else - StaticData::_iCurEnvoderV = static_cast( a_baTemp.at(2) ); - - StaticData::_iCurEncSpeed = static_cast( a_baTemp.at(3) ); - StaticData::_iCurBetrate = static_cast( a_baTemp.at(4) ); - StaticData::_iCurLatencyZ = static_cast( a_baTemp.at(5) ); - StaticData::_iCurStreamRTSP = static_cast( a_baTemp.at(6) ); - StaticData::_iCurSoundCapture = static_cast( a_baTemp.at(7) ); + QByteArray a_baRequest; + a_baRequest.append((char) 0x00); + a_baRequest.append(0x01); - if( !StaticData::fAvailableNvh264enc() ) - StaticData::_iCurEnvoderV = 0; + QString a_sHello = "Hello. It's data test."; + QByteArray a_baTemp(a_sHello.toUtf8()); + unsigned int a_iSz = a_baTemp.length(); + QByteArray a_baSz; + a_baSz.append((a_iSz >> 24) & 0xFF); + a_baSz.append((a_iSz >> 16) & 0xFF); + a_baSz.append((a_iSz >> 8) & 0xFF); + a_baSz.append((a_iSz >> 0) & 0xFF); + //qDebug() << "MyProtocol::fSomeDataForUser 3: " << a_baSz.length() << a_baSz.toHex(':'); - SettingsApp::fSaveEvcoderType(StaticData::_iCurEnvoderV); - SettingsApp::fSaveStreamRTSP((bool)StaticData::_iCurStreamRTSP); + a_baRequest.append(a_baSz.at(3)); + a_baRequest.append(a_baTemp); - //qDebug() << "Control::fVideoQualitySet 3: " << StaticData::_iCurEnvoderV; + emit sgSendMassang( MyProtocol::fSomeDataForUser(StaticData::m_sDeskId, StaticData::m_sMyId, a_baRequest) ); } -void Control::fVideoQualityCurent(QString _sData) +void Control::fPropertySet(QStringList _sDataIn) { - //qDebug() << "Control::fVideoQualityCurent 0: " << _sData << _sData.length(); + //qDebug() << "Control::fPropertySet 0:" << _sDataIn; + StaticData::m_bDevServer = false; + StaticData::m_sKeyDevServer = "xxxxxxxx"; - if(_sData.length() != 8) - return; + _sDataIn.removeFirst(); - QByteArray a_baTemp(_sData.toUtf8()); + _sDataIn = fCorrectDataIn(_sDataIn); - //qDebug() << "Control::fVideoQualityCurent 1: " << a_baTemp.toHex(':'); + //qDebug() << "Control::fPropertySet 1:" << _sDataIn; - if( StaticData::_iSizeFr == static_cast( a_baTemp.at(0) ) - && StaticData::_iFPS == static_cast( a_baTemp.at(1) ) - && StaticData::_iEnvoderV == static_cast( a_baTemp.at(2) ) - && StaticData::_iEncSpeed == static_cast( a_baTemp.at(3) ) - && StaticData::_iBetrate == static_cast( a_baTemp.at(4) ) - && StaticData::_iLatencyZ == static_cast( a_baTemp.at(5) ) - && StaticData::_iStreamRTSP == static_cast( a_baTemp.at(6) ) - && StaticData::_iSoundCapture == static_cast( a_baTemp.at(7) ) - ) - return; - - - StaticData::_iSizeFr = static_cast( a_baTemp.at(0) ); - StaticData::_iFPS = static_cast( a_baTemp.at(1) ); - StaticData::_iEnvoderV = static_cast( a_baTemp.at(2) ); - StaticData::_iEncSpeed = static_cast( a_baTemp.at(3) ); - StaticData::_iBetrate = static_cast( a_baTemp.at(4) ); - StaticData::_iLatencyZ = static_cast( a_baTemp.at(5) ); - StaticData::_iStreamRTSP = static_cast( a_baTemp.at(6) ); - StaticData::_iSoundCapture = static_cast( a_baTemp.at(7) ); - - SettingsApp::fSaveEvcoderType(StaticData::_iEnvoderV); - SettingsApp::fSaveStreamRTSP((bool)StaticData::_iStreamRTSP); + QString a_sLog; + QString a_sPas; - // qDebug() << "Control::fVideoQualityCurent 2: " << StaticData::_iSizeFr << StaticData::_iSizeFr - // << StaticData::_iEnvoderV << StaticData::_iEncSpeed - // << StaticData::_iBetrate << StaticData::_iLatencyZ - // << StaticData::_iStreamRTSP - // << StaticData::_iSoundCapture; - - - slVideoQualityStatus(); - - m_iNewStream = 0; -} + quint16 a_iSz = _sDataIn.length(); -void Control::fNewStream() -{ - if(m_iNewStream < 2) + if(a_iSz > 1) { - m_iNewStream++; - } + if(a_iSz%2 != 0) + { + //qDebug() << "Control::fPropertySet 2.0:" << "parmeters are incorrect. Sz: " << a_iSz; - if(m_iNewStream == 2) - { - m_iNewStream++; + _sDataIn.removeLast(); + a_iSz--; - //qDebug() << "Control::fNewStream 12.0: "; - if(m_bStream && !m_bErrStream) - { - //qDebug() << "Control::fNewStream 12.1: "; + //qDebug() << "Control::fPropertySet 2.1:" << _sDataIn; + } - if(slPlayerVar() == 0) + for(quint16 i = 0; i < a_iSz; i+=2) + { + if(_sDataIn.at(i) == "-spas") { - if(m_obVideo) + if(i + 1 < a_iSz) { - QMetaObject::invokeMethod(m_obVideo, "fVideoStartStop" - , Q_ARG(QVariant, fStreamReadGST()) - , Q_ARG(QVariant, 1) ); + if(_sDataIn.at(i+1).length() > 0) + StaticData::m_sServerPassword = _sDataIn.at(i+1); } } else + if(_sDataIn.at(i) == "-sip") { - fInitStreamReader(m_pApp); - - if(m_obVideo) + if(i + 1 < a_iSz) { - QMetaObject::invokeMethod(m_obVideo, "fVideoStartStop" - , Q_ARG(QVariant, "") - , Q_ARG(QVariant, 1) ); + if(StaticData::fIsIP( _sDataIn.at(i+1) )) + { + StaticData::m_sServerIP = _sDataIn.at(i+1); + } } } + else + if(_sDataIn.at(i) == "-ptcp") + { + if(i + 1 < a_iSz) + { + bool b; + quint16 a_iPort = _sDataIn.at(i+1).toUShort(&b); + + if(b && a_iPort > 1024) + { + StaticData::m_sPortTCP = a_iPort; + } + } + } + else + if(_sDataIn.at(i) == "-log") + { + if(i + 1 < a_iSz) + { + if( _sDataIn.at(i+1).length() > 3) + { + a_sLog = _sDataIn.at(i+1); + } + } + } + else + if(_sDataIn.at(i) == "-pas") + { + if(i + 1 < a_iSz) + { + if( _sDataIn.at(i+1).length() > 3) + { + a_sPas = _sDataIn.at(i+1); + } + } + } + else + if(_sDataIn.at(i) == "-ds") + { + if(i + 1 < a_iSz) + { + bool b; + quint8 a_iB = _sDataIn.at(i+1).toUShort(&b); + + if(b && a_iB > 0) + StaticData::m_bDevServer = true; + + } + } + else + if(_sDataIn.at(i) == "-kds") + { + if(i + 1 < a_iSz) + { + if( _sDataIn.at(i+1).length() > 7) + { + StaticData::m_sKeyDevServer = _sDataIn.at(i+1); + } + } + } } - //qDebug() << "Control::fNewStream 12.2: "; + if(a_sLog.length() > 0 && a_sPas.length() > 0) + { + StaticData::m_sLogin = a_sLog; + StaticData::m_sPassword = a_sPas; + } } -} - -void Control::slReConnectToDesktop() -{ - slConnectToDesktop(m_bStream, StaticData::m_sDeskLogin, StaticData::m_sDeskPassword, StaticData::m_sDeskId); -} - -void Control::fKeyEventClear() -{ -#ifdef Q_OS_WIN - keybd_event(VK_CONTROL , - 0, - KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, - 0); - - keybd_event(164, - 0, - KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, - 0); - - keybd_event(165, - 0, - KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, - 0); -#endif - - -} - -bool Control::slStreamRTSP() -{ - return StaticData::_iStreamRTSP; -} - -QString Control::slAppName() -{ - return StaticData::m_sNameApp + " - " + StaticData::m_sVersion; -} - -void Control::fTestSomeDataForUser() -{ - QByteArray a_baRequest; - a_baRequest.append((char) 0x00); - a_baRequest.append(0x01); - - QString a_sHello = "Hello. It's data test."; - - QByteArray a_baTemp(a_sHello.toUtf8()); - unsigned int a_iSz = a_baTemp.length(); - - QByteArray a_baSz; - a_baSz.append((a_iSz >> 24) & 0xFF); - a_baSz.append((a_iSz >> 16) & 0xFF); - a_baSz.append((a_iSz >> 8) & 0xFF); - a_baSz.append((a_iSz >> 0) & 0xFF); - //qDebug() << "MyProtocol::fSomeDataForUser 3: " << a_baSz.length() << a_baSz.toHex(':'); - - a_baRequest.append(a_baSz.at(3)); - a_baRequest.append(a_baTemp); + if(!StaticData::m_bDevServer) + { + SettingsApp::fUpdateServerData(); - emit sgSendMassang( MyProtocol::fSomeDataForUser(StaticData::m_sDeskId, StaticData::m_sMyId, a_baRequest) ); -} + //qDebug() << "Control::fPropertySet 5:" << StaticData::m_bDevServer; + } -int Control::slPlayerVar() -{ - return StaticData::_iPlayerVar; + qDebug() << "Control::fPropertySet 10: " + << StaticData::m_sServerPassword + << StaticData::m_sServerIP + << StaticData::m_sPortTCP + << StaticData::m_sLogin + << StaticData::m_sPassword + << StaticData::m_bDevServer; } -void Control::fInitStreamReader(QQmlEngine *_engineMain) +QStringList Control::fCorrectDataIn(QStringList _sDataIn) { + QString a_sTemp; + for(QString s : _sDataIn) { + if(a_sTemp.length() > 0) + a_sTemp += " "; -} - -void Control::slUpdateFrame(int _iFrame, int _iWf, int _iHf) -{ - //qDebug() << "Control::slUpdateFrame -> " << _iFrame; + while(s.indexOf(" ") >= 0) + { + s = s.replace(" ", ""); + } - StaticData::m_iTimeForStream = 0; + a_sTemp += s; + } - if(_iHf > 0 && m_obVideo) + while(a_sTemp.indexOf(" ") >= 0) { - QMetaObject::invokeMethod(m_obVideo, "updateFrame" - , Q_ARG(QVariant, _iFrame) - , Q_ARG(QVariant, _iWf) - , Q_ARG(QVariant, _iHf)); + a_sTemp = a_sTemp.replace(" ", " "); } + return a_sTemp.split(" "); } void Control::fClientDisconnect() { //qDebug() << "Control::fClientDisconnect 0: "; emit sgClientStop(); - //qDebug() << "Control::fClientDisconnect 1: "; - fStreamReaderDelete(m_pApp); - //qDebug() << "Control::fClientDisconnect 2: "; //qDebug() << "Control::fClientDisconnect 10: "; } -void Control::slSendStatIP(QString _sVar) -{ - qDebug() << "Control::slSendStatIP 0: " << _sVar; - - emit sgSendMassang( MyProtocol::fSendStatIP(_sVar) ); -} - void Control::slSleep(unsigned long _lmSec) { QThread::msleep(_lmSec); @@ -1455,13 +724,3 @@ void Control::slThClientFin() m_mtxThClientSoc.unlock(); //qDebug() << " Control::slThClientFin 200: " << "Client thread end. ----------------------"; } - -void Control::slLowActivityDiscTime(QString _sData) -{ - if(StaticData::fIsNumber( _sData) && _sData.toInt() >= 0) - { - //qDebug() << " Control::slLowActivityDiscTime 5: " << _sData; - - emit sgSendMassang( MyProtocol::fSendLowActivityTime( _sData ) ); - } -} diff --git a/src/control.h b/src/control.h index 8c9de5f..7fdcfce 100644 --- a/src/control.h +++ b/src/control.h @@ -1,17 +1,10 @@ #ifndef CONTROL_H #define CONTROL_H - - -#include -#include +#include #include -#include #include -#include - -#include "ping.h" #include "settingsapp.h" #include "newclient.h" @@ -22,111 +15,62 @@ class Control : public SettingsApp Q_OBJECT public: - Control(QQmlApplicationEngine *_pApp); + Control(QStringList _sDataIn); ~Control(); public slots: void slotDestruction(); - void slotFindCheldren(); void slotTimer(); void slConnectToServer(QString _sLogin, QString _sPassword); - void slConnectToDesktop(bool _bStream, QString _sLogin, QString _sPassword, QString _sId = "0"); - void slDisConnectDesktop(int); void slClientControl(QString _sId, int _iVar, QString _sData); - void slSendMouseEvent(int _iVar, bool _bBtLorR, bool _bPressRelease, int _iX, int _iY); - void slSendKeyEvent(unsigned int _iVar, int _iKey, QString _sData); - void slDesktopRealSize(bool _bVar); void slFileCopy(int _iVar, QString _sPath); QString slServerIP(); unsigned short slPortTCP(); - unsigned short slPortRTSP(); - unsigned short slPortRTMP(); void slServerUpdateData(QString _sIP, QString _sPortTCP, QString _sPortRTSP, QString _sPortRTMP, QString _sKeyDevServer, QString _sServerPas); bool slIsNumber(QString _lIn); bool slIsIP(QString _lIn); - int slPlayerVar(); - void slUpdateFrame(int, int _iWf, int _iHf); - void slSendStatIP(QString _sVar); - void slSleep(unsigned long _lmSec); - void slThClientFin(); - void slLowActivityDiscTime(QString _sData); - void slFullScreen(bool _bVar); QString slLogin(); QString slPassword(); - void slSearchDesktop(QString _sUser); void slComandLine(QString _sData, int _iVar); bool slComandLineStatus(); void slUseComandLine(bool); QString slDeskLogin(); QString slDeskPassword(); - void slVideoQualityStatus(); - void slVideoQualityGet(int _iSizeF, int _iFPS, int _iEnvoderV, int _iEncSpeed, int _iBetrate, int _iLatencyZ, bool _bRtsp, int _iSound); - void slReConnectToDesktop(); - bool slStreamRTSP(); QString slAppName(); + void slSleep(unsigned long _lmSec); + void slThClientFin(); private: - QQmlApplicationEngine *m_pApp; - QObject *m_obMain; - QObject *m_obVideo; - QObject *m_obMenu; int m_iTimeConnectNotActive = 10; int m_iTimeReConnectToDesktop = 0; - int m_iTimeForBuffer = 10; int m_iTimeForWatcher = 10; - int m_iTimeStreamWrite = 0; bool m_bConnectClient = false; - QString m_sCurrentWriteUrl = ""; - QString m_sBufferWrite = ""; - QString m_sBufferPrev = ""; - QString m_sKeyPrev = ""; - QString m_sBufferSaved = ""; QVariant m_varBufferPrev = ""; - bool m_bStream = true; + bool m_bStream = false; bool m_bComandLine = false; bool m_bDisconnect = true; - QString m_sNewStreamUrl = ""; - int m_iNewStream = 5; - bool m_bErrStream = false; - QMutex m_mtxClipboard; - int m_iTimeStreamRestart = 10; - bool m_bStreamRestart = false; QMutex m_mtxThClientSoc; int m_iThClientSoc = 0; - void fStreamReaderDelete(QQmlEngine *_engineMain); void fConnectToServer(QString _sIp, int _iPort, QString _sLogin, QString _sPassword); void fConnectClientStatus(); - void fStatusConnectToDesktop(bool _bVar); - void fStreamReadClear(); void fGenerateLogPass(); - void fBufferWrite(int _iVar, QString _sData); - void fClipboardSend(bool); - void fVideoQualitySet(QString _sData); - void fVideoQualityCurent(QString _sData); - void fNewStream(); - QString fStreamReadGST(); - void fKeyEventClear(); void fTestSomeDataForUser(); + void fPropertySet(QStringList); + QStringList fCorrectDataIn(QStringList _sDataIn); - void fInitStreamReader(QQmlEngine *_engineMain); void fClientDisconnect(); public: signals: - void sgStopStreamRead(); void sgClientStop(); void sgSendMassang(QByteArray); - void sgSendMouseEvent(int _iVar, bool _bBtLorR, bool _bPressRelease, int _iX, int _iY); - void sgSendKeyEvent(unsigned int _iVar, unsigned int _iKey, unsigned int _iKeyboardLayout, QString _sData); void sgTimer(); - void sgBufferDataParserStop(); void sgControl(QString _sId, int _iVar, QString _sData, QByteArray _baIn); void sgComanfLineControl(int _iVar, QByteArray _baIn); - void sgStopWriteGST(); diff --git a/src/fileRead.h b/src/fileRead.h index 89e526e..d4e8f13 100644 --- a/src/fileRead.h +++ b/src/fileRead.h @@ -1,39 +1,39 @@ -#ifndef FILEREAD_H -#define FILEREAD_H - -#include -#include -#include -#include - - -#include "MyProtocol.h" - -class FileRead: public QThread -{ - Q_OBJECT -public: - explicit FileRead(QString _sUserId, QObject *parent = 0); - void run(); - - -signals: - void sgControl(QString _sId, int _iVar, QString _sData, QByteArray _baIn); - -public slots: - void slControl(QString _sId, int _iVar, QByteArray _baIn); - void slTimer(); - - -private: - QString m_sUserId = ""; - - QFile *m_fRead; - unsigned int m_iFileSize = 0; - short m_iTimeFileRead = 10; - QMutex m_mutexFileRead; - - void fFileRead(QByteArray _baData); -}; - -#endif // FILEREAD_H +#ifndef FILEREAD_H +#define FILEREAD_H + +#include +#include +#include +#include + + +#include + +class FileRead: public QThread +{ + Q_OBJECT +public: + explicit FileRead(QString _sUserId, QObject *parent = 0); + void run(); + + +signals: + void sgControl(QString _sId, int _iVar, QString _sData, QByteArray _baIn); + +public slots: + void slControl(QString _sId, int _iVar, QByteArray _baIn); + void slTimer(); + + +private: + QString m_sUserId = ""; + + QFile *m_fRead; + unsigned int m_iFileSize = 0; + short m_iTimeFileRead = 10; + QMutex m_mutexFileRead; + + void fFileRead(QByteArray _baData); +}; + +#endif // FILEREAD_H diff --git a/src/fileWrite.h b/src/fileWrite.h index 9134043..534fc49 100644 --- a/src/fileWrite.h +++ b/src/fileWrite.h @@ -1,40 +1,40 @@ -#ifndef FILEWRITE_H -#define FILEWRITE_H - -#include -#include -#include -#include - - -#include "MyProtocol.h" -#include "StaticData.h" - -class FileWrite: public QThread -{ - Q_OBJECT -public: - explicit FileWrite(QString _sUserId, QObject *parent = 0); - void run(); - - -signals: - void sgControl(QString _sId, int _iVar, QString _sData, QByteArray _baIn); - -public slots: - void slControl(QString _sId, int _iVar, QByteArray _baIn); - void slTimer(); - - -private: - QString m_sUserId = ""; - - QFile *m_fWrite; - unsigned int m_iFileSize = 0; - short m_iTimeFileWrite = 10; - QMutex m_mutexFileWrite; - - void fFileWrite(QByteArray _baData); -}; - -#endif // FILEWRITE_H +#ifndef FILEWRITE_H +#define FILEWRITE_H + +#include +#include +#include +#include + + +#include +#include "StaticData.h" + +class FileWrite: public QThread +{ + Q_OBJECT +public: + explicit FileWrite(QString _sUserId, QObject *parent = 0); + void run(); + + +signals: + void sgControl(QString _sId, int _iVar, QString _sData, QByteArray _baIn); + +public slots: + void slControl(QString _sId, int _iVar, QByteArray _baIn); + void slTimer(); + + +private: + QString m_sUserId = ""; + + QFile *m_fWrite; + unsigned int m_iFileSize = 0; + short m_iTimeFileWrite = 10; + QMutex m_mutexFileWrite; + + void fFileWrite(QByteArray _baData); +}; + +#endif // FILEWRITE_H diff --git a/src/image.qrc b/src/image.qrc deleted file mode 100644 index 8082714..0000000 --- a/src/image.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - image/baner.png - image/icon.png - - diff --git a/src/image/baner.png b/src/image/baner.png deleted file mode 100644 index 5324060..0000000 Binary files a/src/image/baner.png and /dev/null differ diff --git a/src/image/icon.png b/src/image/icon.png deleted file mode 100644 index 2912b9a..0000000 Binary files a/src/image/icon.png and /dev/null differ diff --git a/src/main.cpp b/src/main.cpp index 5036069..46d54e3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,64 +1,66 @@ -#include -#include -#include -#include -//#include - +#include +#include #include "control.h" +#include + +static void sigHandler(int s) +{ + //qDebug() << "sigHandler 0: " << s; + std::signal(s, SIG_DFL); + qApp->quit(); +} + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); -#ifdef Q_OS_ANDROID + qDebug() << StaticData::m_sNameApp << StaticData::m_sVersion; + std::cout << StaticData::m_sSupport.toStdString() << std::endl; + std::signal(SIGINT, sigHandler); + std::signal(SIGTERM, sigHandler); -#else - #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - #include "myfilter.h" - #endif -#endif + QStringList a_Ar; + a_Ar.append( a.arguments() ); + // a_Ar.append("-ds"); + // a_Ar.append("1"); + + // a_Ar.append("-kds"); + // a_Ar.append("xxxxxxxx45"); + + // a_Ar.append("-spas"); + // a_Ar.append("22227"); + + // a_Ar.append("-sip"); + // a_Ar.append("156.34.212.11"); + + // a_Ar.append("-ptcp"); + // a_Ar.append("1237"); + + // a_Ar.append("-prtsp"); + // a_Ar.append("8504"); + + // a_Ar.append("-prtmp"); + // a_Ar.append("1935"); + + // a_Ar.append("-log"); + // a_Ar.append("nico"); + + // a_Ar.append("-pas"); + // a_Ar.append("1242"); + + Control m_pC( a_Ar ); + + // char a_cTemp; + + // while (true) + // { + // std::cin >> a_cTemp; + // std::cout << a_cTemp << endl; + // } -int main(int argc, char *argv[]) -{ -#ifdef Q_OS_ANDROID - -#else - #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - #endif - - #ifdef Q_OS_WIN - //qputenv("QT_QUICK_BACKEND","software"); - //QQuickWindow::setSceneGraphBackend("software"); - #endif -#endif - - QGuiApplication app(argc, argv); - QGuiApplication::setWindowIcon(QIcon(":/image/icon.png")); - -#ifdef Q_OS_ANDROID - const QUrl url(QStringLiteral("qrc:/qml6/main.qml")); -#else -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - qmlRegisterType("my.filter", 1, 0, "MyFilter"); - const QUrl url(QStringLiteral("qrc:/qml5/main.qml")); -#else - const QUrl url(QStringLiteral("qrc:/qml6/main.qml")); -#endif -#endif - - QQmlApplicationEngine engine; - QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, - &app, [url](QObject *obj, const QUrl &objUrl) { - if (!obj && url == objUrl) - QCoreApplication::exit(-1); - }, Qt::QueuedConnection); - - QQmlContext* context = engine.rootContext(); - Control *a_pCon = new Control(&engine); - context->setContextProperty("contextMain", a_pCon ); - - engine.load(url); - - return app.exec(); + return a.exec(); } diff --git a/src/newclient.cpp b/src/newclient.cpp index 7f96a83..888ee2d 100644 --- a/src/newclient.cpp +++ b/src/newclient.cpp @@ -138,14 +138,12 @@ void NewClient::run() if(!m_baDataWrite.isEmpty()) m_baDataWrite.clear(); - qDebug() << "NewClient::run 200:" << "ClientID:" << m_iTimeMs << "ThreadID:" << QThread::currentThreadId() << "Disconnected. Thread end. ----------------------"; + //qDebug() << "NewClient::run 200:" << "ClientID:" << m_iTimeMs << "ThreadID:" << QThread::currentThreadId() << "Disconnected. Thread end. ----------------------"; } void NewClient::fConnect() { - emit sgControl("", 0, ""); - emit sgControl("", 3, "0"); - StaticData::m_sRtspDescriptor = ""; + emit sgControl("", 0, "0"); if(socket) { @@ -163,7 +161,6 @@ void NewClient::fConnect() qDebug() << "NewClient::fConnect 1:" << "new connecting..."; - if(m_bLowActivity) { emit sgControl("", 3, "2"); @@ -359,7 +356,7 @@ void NewClient::disconnected() } void NewClient::slStop() -{ +{ if(m_bRun) { //qDebug() << "NewClient::slStop 1:" << "ClientID:" << m_iTimeMs << "ThreadID:" << QThread::currentThreadId(); @@ -535,11 +532,6 @@ void NewClient::slControl(QString _sId, int _iVar, QString _sData, QByteArray _b emit sgControl(_sId, 16, ""); } break; - case 23: - { - emit sgControl("", 18, ""); - } - break; case 24: { m_bLowActivity = true; @@ -559,38 +551,12 @@ void NewClient::slSendMouseEvent(int _iVar, bool _bBtLorR, bool _bPressRelease, if(m_pParserSocket->m_baDeskTopID.length() > 0 && StaticData::m_iTimeForStream < 2) - slAddDataWrite( MyProtocol::fSendMouseEvents( StaticData::m_sMyId.toUtf8() - , m_pParserSocket->m_baDeskTopID - , _iVar, _bBtLorR, _bPressRelease, _iX, _iY) ); + slAddDataWrite( MyProtocol::fSendMouseEvents( StaticData::m_sMyId.toUtf8() + , m_pParserSocket->m_baDeskTopID + , _iVar, _bBtLorR, _bPressRelease, _iX, _iY) ); } -void NewClient::slSendKeyEvent(unsigned int _iVar, unsigned int _iKey, unsigned int _iKeyboardLayout, QString _sData) -{ - //qDebug() << "NewClient::slSendKeyEvent 0: " << _iVar << _iKey << _iKeyboardLayout; - - if(m_pParserSocket->m_baDeskTopID.length() > 0 - && StaticData::m_iTimeForStream < 2) - { - //qDebug() << "NewClient::slSendKeyEvent 1: "; - - #ifdef Q_OS_WIN || Q_OS_LINUX - if(KeyControler::fCtrlV(_iVar, _iKey)) - { - //qDebug() << "NewClient::slSendKeyEvent 2: "; - emit sgControl("", 9, ""); - } - #endif - - - slAddDataWrite( MyProtocol::fSendKeyEvents( StaticData::m_sMyId.toUtf8() - , m_pParserSocket->m_baDeskTopID - , _iVar, _iKey, _iKeyboardLayout, _sData) ); - - - } -} - void NewClient::slTimer() { @@ -999,11 +965,10 @@ void NewClient::fComandLine(QByteArray _baIn) void NewClient::slThreadTask() { - //qDebug() << "NewClient::slThreadTask 0:" << "ClientID:" << m_iTimeMs << "ThreadID:" << QThread::currentThreadId(); + //qDebug() << "NewClient::slThreadTask 0:" << "ThreadID:" << QThread::currentThreadId(); if(m_iTaskVar == 0) { exit(0); } } - diff --git a/src/newclient.h b/src/newclient.h index 90c5d89..6fc438c 100644 --- a/src/newclient.h +++ b/src/newclient.h @@ -46,7 +46,6 @@ public slots: void slParser(); void slControl(QString _sId, int _iVar, QString _sData, QByteArray _baIn); void slSendMouseEvent(int _iVar, bool _bBtLorR, bool _bPressRelease, int _iX, int _iY); - void slSendKeyEvent(unsigned int _iVar, unsigned int _iKey, unsigned int _iKeyboardLayout, QString _sData); void slTimer(); void slThreadTask(); diff --git a/src/parsersocketdata.cpp b/src/parsersocketdata.cpp index 5bebc94..f44eb74 100644 --- a/src/parsersocketdata.cpp +++ b/src/parsersocketdata.cpp @@ -149,9 +149,6 @@ QByteArray ParserSocketData::fNextStep(QByteArray _baIn) case (char)0x14: a_iPos += fSomeData(a_baData); break; - case (char)0x15: - a_iPos += fMustStreamRestart(a_baData); - break; case (char)0x17: a_iPos += fKeyClienValid(a_baData); break; @@ -209,25 +206,16 @@ unsigned int ParserSocketData::fGetStreamData(QByteArray _baIn) //generator URL-descriptor - if(StaticData::m_sRtspDescriptor.length() < 16) - { - StaticData::m_sRtspDescriptor = MyProtocol::fIdGenerator(MyProtocol::m_sPrefix, StaticData::m_sMyId, 16, 32); - } - - //StaticData::m_sRtspDescriptor = "111"; + QString a_Url = StaticData::m_sWithoutStream; - StaticData::m_sRtspDescriptor = StaticData::m_sRtspDescriptor.replace("-", ""); - StaticData::m_sRtspDescriptor = StaticData::m_sRtspDescriptor.replace("_", ""); + //qDebug() << "ParserSocketData::fGetStreamData 6: " << a_Url; - //qDebug() << "ParserSocketData::fGetStreamData 6: " << StaticData::m_sRtspDescriptor; - StaticData::m_sRtspDescriptor = StaticData::m_sWithoutStream; - - emit sgControl(StaticData::m_sMyId, 1, StaticData::m_sRtspDescriptor, ""); + emit sgControl(StaticData::m_sMyId, 1, a_Url, ""); emit sgAddDataWrite( MyProtocol::fStreamDataForClient( StaticData::m_sMyId , QString::fromStdString(a_baClient.toStdString()) - , StaticData::m_sRtspDescriptor) ); + , a_Url) ); ////------------ a_iPlasPos++; @@ -1360,28 +1348,10 @@ unsigned int ParserSocketData::fVideoQualitySet(QByteArray _baIn) if(a_baData.length() == 8) { - QByteArray a_baTemp(a_baData); - - if( StaticData::_iCurSizeFr != static_cast( a_baTemp.at(0) ) - || StaticData::_iCurFPS != static_cast( a_baTemp.at(1) ) - || StaticData::_iCurEnvoderV != static_cast( a_baTemp.at(2) ) - || StaticData::_iCurEncSpeed != static_cast( a_baTemp.at(3) ) - || StaticData::_iCurBetrate != static_cast( a_baTemp.at(4) ) - || StaticData::_iCurLatencyZ != static_cast( a_baTemp.at(5) ) - || StaticData::_iCurStreamRTSP != static_cast( a_baTemp.at(6) ) - || StaticData::_iCurSoundCapture != static_cast( a_baTemp.at(7) ) - ) - { - //StaticData::m_sRtspDescriptor=""; - - - emit sgControl("" - , 20 - , "" - , a_baData); - } - - + emit sgControl("" + , 20 + , "" + , a_baData); } a_iPlasPos++; @@ -1567,52 +1537,6 @@ unsigned int ParserSocketData::fSomeData(QByteArray _baIn) return 3 + a_iData_1 + a_iData_2 + a_iData_3 + a_iPlasPos; } -unsigned int ParserSocketData::fMustStreamRestart(QByteArray _baIn) -{ - //qDebug() << "ParserSocketData::fMustStreamRestart 0: " << _baIn.length() << _baIn.toHex(':'); - - if(_baIn.length() < 4) - return 0; - - int a_iPlasPos = 0; - - int a_iData_1 = static_cast( _baIn.at(2) ); //SZ-1 - - //qDebug() << "ParserSocketData::fMustStreamRestart 2.0: " << a_iData_1; - - a_iPlasPos++; - if(_baIn.length() < 2 + a_iData_1 + a_iPlasPos + 1) - return 0; - - - //qDebug() << "ParserSocketData::fMustStreamRestart 2.3: " - // << MyProtocol::fCRC_isOk(_baIn.mid(1, 1 + a_iData_1 + a_iPlasPos), _baIn.at( 1 + a_iData_1 + a_iPlasPos + 1 )); - - - if( !MyProtocol::fCRC_isOk(_baIn.mid(1, 1 + a_iData_1 + a_iPlasPos), _baIn.at( 1 + a_iData_1 + a_iPlasPos + 1 )) ) - return 0; - - //qDebug() << "ParserSocketData::fMustStreamRestart 3: "; - - QByteArray a_baClientId; - a_iPlasPos = 0; - - for(int i = 3; i < 3 + a_iData_1 + a_iPlasPos; i++) - { - a_baClientId.append(_baIn[i]); - } - - //qDebug() << "ParserSocketData::fMustStreamRestart 10: " << QString::fromStdString(a_baClientId.toStdString()); - - emit sgControl("" - , 23 - , "" - , ""); - - a_iPlasPos++; - return 3 + a_iData_1 + a_iPlasPos; -} - unsigned int ParserSocketData::fKeyClienValid(QByteArray _baIn) { //qDebug() << "ParserSocketData::fKeyClienValid 0: " << _baIn.length() << _baIn.toHex(':'); diff --git a/src/parsersocketdata.h b/src/parsersocketdata.h index 0600a9a..1f16732 100644 --- a/src/parsersocketdata.h +++ b/src/parsersocketdata.h @@ -6,9 +6,8 @@ #include #include #include -#include "MyProtocol.h" +#include #include "StaticData.h" -#include "KeyControler.h" class ParserSocketData: public QObject @@ -39,7 +38,6 @@ class ParserSocketData: public QObject unsigned int fVideoQualitySet(QByteArray _baIn); unsigned int fVideoQualityCurent(QByteArray _baIn); unsigned int fSomeData(QByteArray _baIn); - unsigned int fMustStreamRestart(QByteArray _baIn); unsigned int fKeyClienValid(QByteArray _baIn); diff --git a/src/qml5.qrc b/src/qml5.qrc deleted file mode 100644 index 37d4620..0000000 --- a/src/qml5.qrc +++ /dev/null @@ -1,20 +0,0 @@ - - - qml5/menu.qml - qml5/menu_ComandLine.qml - qml5/menu_Desktop.qml - qml5/menu_FileCopy.qml - qml5/menu_Login.qml - qml5/menu_Server.qml - qml5/menu_Support.qml - qml5/menu_VideoQuality.qml - qml5/menu_ViewSize.qml - qml5/messageStatus.qml - qml5/MyCheckBox.qml - qml5/player.qml - qml5/playerNew.qml - qml5/playerRTSP.qml - qml5/userUI.qml - qml5/main.qml - - diff --git a/src/qml5/MyCheckBox.qml b/src/qml5/MyCheckBox.qml deleted file mode 100644 index 7243080..0000000 --- a/src/qml5/MyCheckBox.qml +++ /dev/null @@ -1,35 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - - -CheckBox { - id: id_cbCast - - indicator: Rectangle { - implicitWidth: 28 - implicitHeight: implicitWidth - x: id_cbCast.leftPadding - y: parent.height / 2 - height / 2 - radius: 3 - border.color: id_cbCast.down ? "#80000000" : "#000000" - - Rectangle { - width: parent.width - 10 - height: parent.height - 10 - anchors.centerIn: parent - radius: 2 - color: id_cbCast.down ? "#80000000" : "#000000" - visible: id_cbCast.checked - } - } - - contentItem: Text { - text: id_cbCast.text - font.bold: true - font.pixelSize: 16 - opacity: enabled ? 1.0 : 0.3 - color: id_cbCast.down ? "#80000000" : "#000000" - verticalAlignment: Text.AlignVCenter - leftPadding: id_cbCast.indicator.width + id_cbCast.spacing - } -} diff --git a/src/qml5/main.qml b/src/qml5/main.qml deleted file mode 100644 index 4261be4..0000000 --- a/src/qml5/main.qml +++ /dev/null @@ -1,84 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Window 2.15 - -Window { - x: 70 - y:30 - width: 900 - height: 700 - //visibility: Window.Maximized - visible: true - title: "" - - - Component.onCompleted: - { - id_tStart.start(); - - title = contextMain.slAppName() - } - - Component.onDestruction: - { - contextMain.slotDestruction(); - } - - function fFullScreen(_bVar) - { - if(visibility != Window.FullScreen) - visibility = Window.FullScreen - else - visibility = Window.Maximized - } - - - Loader { - id: id_loadUserUI - anchors.fill: parent - focus: true - - source:"userUI.qml"; - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadUserUI::slotData 0: " + _iId) - - - } - - } - - - Timer - { - id: id_tStart - interval: 1000; running: false; repeat: false - onTriggered: - { - contextMain.slotFindCheldren(); - } - } - - Timer - { - id: id_tCurrentTime - interval: 1000; running: true; repeat: true - onTriggered: - { - contextMain.slotTimer() - } - } - -} diff --git a/src/qml5/menu.qml b/src/qml5/menu.qml deleted file mode 100644 index 169d9a7..0000000 --- a/src/qml5/menu.qml +++ /dev/null @@ -1,845 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Item { - id: root - objectName: "obMenu" - anchors.fill: parent - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - onHeightChanged: - { - if(id_loadMenuItem.visible) - { - if(id_loadMenuItem.m_iPage == 6) - id_loadMenuItem.height = id_loadMenuItem.parent.height - id_loadMenuItem.y; - else - { - if(height - id_colMenu.children[0].height < id_loadMenuItem.item.m_iH ) - { - id_loadMenuItem.height = height - id_colMenu.children[0].height; - } - else - { - id_loadMenuItem.height = id_loadMenuItem.item.m_iH - } - } - } - } - - MouseArea - { - anchors.fill: id_colMenu - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - function fConnectClient(_bVar) - { - id_Stream.m_bConnectClient = _bVar; - } - - function fConnectServer(_iVar) - { - //print("fConnectServer 0: " + _iVar ) - - if(_iVar == 1) - { - id_Connect.color = "#0096FF"; - id_itLogin.enabled = true; - id_recConnecting.visible = false; - } - else - { - id_Connect.color = "#ccffffff"; - id_itLogin.enabled = false; - - if(_iVar == 2) - id_recConnecting.visible = true; - else - id_recConnecting.visible = false; - } - - } - - function fFileCopyVisible(_bVar) - { - id_itFileCopy.enabled = _bVar; - - if(!_bVar && id_loadMenuItem.m_iPage == 4) - id_loadMenuItem.m_iPage = 0; - - } - - function fStream(_bVar) - { - id_itComandLine.m_bAcvive = !_bVar; - //id_itVideoQuality.enabled = _bVar; - } - - Column - { - id: id_colMenu - anchors.horizontalCenter: parent.horizontalCenter - - Rectangle - { - id: id_recMenuTab - anchors.horizontalCenter: parent.horizontalCenter - width: children[1].width - height: id_TitleM.visible ? 50 : children[1].height + 3 - color: id_loadMenuItem.m_iPage == 0 ? - id_TitleM.visible ? "#808080" : "#99808080" - : "#000000" - - border.color: id_TitleM.visible ? "#000000" : "#00000000" - border.width: 1 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - if(id_loadMenuItem.m_iPage == 0) - { - if(id_Open.rotation == 0) - { - id_Open.rotation = 180; - } - else - { - id_Open.rotation = 0; - } - } - - id_loadMenuItem.m_iPage = 0; - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Row - { - anchors.verticalCenter: parent.verticalCenter - Row - { - anchors.verticalCenter: parent.verticalCenter - Item { - width: 3 - height: 1 - } - - Rectangle - { - id: id_Connect - anchors.verticalCenter: parent.verticalCenter - color: "#ccffffff" - width: 8 - height: width - border.color: "#90000000" - } - - Text { - id: id_Open - anchors.verticalCenter: parent.verticalCenter - text: qsTr(" ^ ") - font.bold: true - font.pixelSize: 14 - color: "#ccffffff" - rotation: 180 - - } - - Rectangle - { - id: id_Stream - anchors.verticalCenter: parent.verticalCenter - color: id_Stream.m_bConnectClient ? "#ff0000" : "#ccffffff" - width: id_Connect.width - height: width - border.color: id_Connect.border.color - - property bool m_bConnectClient: false - } - - Item { - width: 5 - height: 1 - } - - } - - Text { - id: id_TitleM - width: 110 - text: qsTr("Menu") - horizontalAlignment: Text.AlignHCenter - font.bold: true - font.pixelSize: 24 - color: "#ffffff" - visible: id_Open.rotation == 0 ? true : false - } - } - - Rectangle - { - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - //anchors.bottomMargin: 1 - width: parent.width - 2 - height: 2 - color: "#ffffff" - visible: id_TitleM.visible - } - - Rectangle - { - id: id_recConnecting - anchors.right: parent.left - anchors.rightMargin: 2 - anchors.verticalCenter: parent.verticalCenter - width: children[0].width + 10 - height: parent.children[1].height + 3 - color: "#90ff0000" - visible: false - - Text { - anchors.centerIn: parent - text: qsTr("connecting... ") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - } - - Rectangle - { - width: parent.width - height: id_colData.visible ? children[0].height + 2 : 0 - color: id_recMenuTab.color - visible: id_TitleM.visible - - border.color: "#000000" - border.width: 1 - - clip: true - - onVisibleChanged: - { - if(!visible) - id_loadMenuItem.m_iPage = 0; - } - - Flickable { - x: 0 - width: parent.width - 2 * x - height: id_colData.height + id_recMenuTab.height < root.height - 10 ? id_colData.height : root.height - id_recMenuTab.height - 10 - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 0) : parent.width - visible: !id_loadMenuItem.visible - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 3; - } - - onPositionChanged: - (mouse)=> - { - - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Server") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - id: id_itLogin - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 1; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Login") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - enabled: id_itLogin.enabled - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 2; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Desktop") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - Item { - id: id_itFileCopy - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - //visible: false - enabled: false - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 4; - - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("File copy") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - id: id_itComandLine - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - //enabled: id_itFileCopy.enabled && m_bAcvive ? true : false - enabled: id_itFileCopy.enabled ? true : false - - property bool m_bAcvive: false - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 6 - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Command line") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - id: id_itVideoQuality - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - //enabled: false; - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 7; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Video quality") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 5; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("View size") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 8; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Support") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - - Item { - width: 1 - height: 5 - } - - } - - } - } - - } - - - - Loader { - id: id_loadMenuItem - y: id_recMenuTab.height - 2 - width: id_loadMenuItem.m_iPage == 6 ? root.width - : 400 >= root.width ? root.width - 10 : 400 - anchors.horizontalCenter: parent.horizontalCenter - height: parent.height - id_colMenu.children[0].height - - - visible: m_iPage == 0 ? false : true - active: m_iPage == 0 ? false : true - source: m_iPage == 0 ? "" - : m_iPage == 1 ? "menu_Login.qml" - : m_iPage == 2 ? "menu_Desktop.qml" - : m_iPage == 3 ? "menu_Server.qml" - : m_iPage == 4 ? "menu_FileCopy.qml" - : m_iPage == 5 ? "menu_ViewSize.qml" - : m_iPage == 6 ? "menu_ComandLine.qml" - : m_iPage == 7 ? "menu_VideoQuality.qml" - : "menu_Support.qml" - - property int m_iPage: 0 - - onLoaded: - { - item.signalData.connect(slotData) - - if(id_loadMenuItem.m_iPage == 3) - item.fConnect(id_itLogin.enabled) - - if(id_loadMenuItem.m_iPage == 6) - id_loadMenuItem.height = parent.height - y; - else - { - if(parent.height - id_colMenu.children[0].height < id_loadMenuItem.item.m_iH ) - { - id_loadMenuItem.height = parent.height - id_colMenu.children[0].height; - } - else - { - id_loadMenuItem.height = id_loadMenuItem.item.m_iH - } - } - - - - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadMenuItem::slotData 0: " + _iId) - - switch(_iId) - { - case 0: - id_loadMenuItem.m_iPage = 0; - break; - } - - } - - } - - -} diff --git a/src/qml5/menu_ComandLine.qml b/src/qml5/menu_ComandLine.qml deleted file mode 100644 index 763eec6..0000000 --- a/src/qml5/menu_ComandLine.qml +++ /dev/null @@ -1,608 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 - -Rectangle { - id: root - objectName: "obComandLine" - anchors.fill: parent - color: "#808080" - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - parent.height = parent.parent.height; - - id_tiReguest.text = ""; - - if(!id_tiReguest.cursorVisible) - { - id_tiReguest.cursorPosition = id_tiReguest.text.length; - id_tiReguest.cursorVisible = true - id_tiReguest.forceActiveFocus(); - } - - - } - - Component.onDestruction: - { - - } - - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - function fResponse(_iVar, _sData) - { - id_tiResponse.text += _sData; - id_tiResponse.cursorPosition = id_tiResponse.text.length; - id_svResp.scrollToBottom(); - } - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Command line") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Column - { - id: id_colData - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - - Item { - width: 1 - height: 20 - } - - Column - { - width: parent.width - - Text { - text: qsTr("Input:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - font.underline: true - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiReguest.cursorVisible) - { - id_tiReguest.cursorPosition = id_tiReguest.text.length; - id_tiReguest.cursorVisible = true - id_tiReguest.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiReguest.selectAll(); - } - } - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: parent.width - height: root.height/8 - color: "#ffffff" - - - - ScrollView { - anchors.fill: parent - rightPadding: 7 - - - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AlwaysOn - - TextArea { - id: id_tiReguest - wrapMode: Text.Wrap - - text: "" - color: "#000000" - font.pixelSize: 16 - - selectByMouse: true - - clip: true - - onTextChanged: - { - - } - -// Keys.onPressed: -// (event)=> -// { -// if(event.key == ) -// contextMain.slSendKeyEvent(1, event.key, event.text); -// event.accepted = true; -// } - - Keys.onReturnPressed: { - id_recReguest.fPress(); - } - Keys.onEnterPressed: { - id_recReguest.fPress(); - } - - } - } - - - - } - } - - Item { - width: 1 - height: 10 - } - - Item - { - width: parent.width - height: 50 - - Rectangle - { - id: id_recReguest - width: parent.width/3 - height: 40 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recReguest.fPress(); - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - function fPress() - { - if(id_tiReguest.text.length < 2) - return; - - if(id_tiResponse.text.lastIndexOf("->") != id_tiResponse.text.length - 2) - { - id_tiResponse.text += "\n->"; - } - - id_tiResponse.text += id_tiReguest.text - id_tiResponse.text += "\r\n-BEGIN------------------------------------\r\n"; - id_tiResponse.cursorPosition = id_tiResponse.text.length; - id_svResp.scrollToBottom(); - - if(id_chkCyrillic.checked) - contextMain.slComandLine(id_tiReguest.text, 2); - else - contextMain.slComandLine(id_tiReguest.text, 1); - - // id_tiReguest.text = ""; - // id_tiReguest.cursorPosition = id_tiReguest.text.length; - - } - - Text { - anchors.centerIn: parent - text: qsTr("Request") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - - Rectangle - { - width: parent.width/3 - height: 40 - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - contextMain.slComandLine("stopRun", 1); - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Kill") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - height: 1 - color: "#000000" - } - } - - - Item { - width: 1 - height: 10 - } - - } - - Column - { - width: id_colData.width - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: id_recCancel.top - anchors.bottomMargin: 10 - visible: children[2].height > 0 ? true : false - - Item { - width: parent.width - height: children[0].height > children[1].height ? children[0].height : children[1].height - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Output:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - font.underline: true - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiResponse.cursorVisible) - { - id_tiResponse.cursorPosition = id_tiResponse.text.length; - id_tiResponse.cursorVisible = true - id_tiResponse.forceActiveFocus(); - } - } - - } - } - - MyCheckBox { - id: id_chkCyrillic - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - text: qsTr("use cyrillic") - //font.bold: true - font.pixelSize: 18 - } - - } - - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: parent.width - height: root.height - (id_colData.y + id_colData.height) - id_recCancel.height - - parent.children[0].height - parent.children[1].height - - parent.children[3].height - parent.children[4].height - 10 - color: "#ffffff" - - - - ScrollView { - id: id_svResp - anchors.fill: parent - rightPadding: 7 - - - contentWidth: children.implicitWidth - contentHeight: children.implicitHeight - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AlwaysOn - clip: true - - function scrollToBottom() { - ScrollBar.vertical.position = 1.0 - ScrollBar.vertical.size - } - - - TextArea { - id: id_tiResponse - wrapMode: Text.Wrap - - text: "" - color: "#000000" - font.pixelSize: 16 - selectByMouse: true - - clip: true - - onTextChanged: - { - - } - } - } - - - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: children[1].width + 40 - height: 40 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_tiResponse.text = ""; - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("C lear") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/menu_Desktop.qml b/src/qml5/menu_Desktop.qml deleted file mode 100644 index 23d35ba..0000000 --- a/src/qml5/menu_Desktop.qml +++ /dev/null @@ -1,890 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuDesktop" - width: 300 - color: "#808080" - height: parent.height - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - property bool m_bUserSelected: false - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - if(!id_tiLog.cursorVisible) - { - id_tiLog.cursorPosition = id_tiLog.text.length; - id_tiLog.cursorVisible = true - id_tiLog.forceActiveFocus(); - } - } - - Component.onDestruction: - { - id_tSearch.stop(); - - id_lmDesktopUser.clear(); - } - - function fChkComandLine(_bVar) - { - if(_bVar) - { - id_chkScreen.checked = false - id_chkComandLine.checked = true - } - else - { - - id_chkScreen.checked = true - id_chkComandLine.checked = false - } - } - - function fConnect(_bVar) - { - if(_bVar) - id_tConnect.stop() - else - id_tConnect.start() - } - - function fAddDesktop(_sUser, _sDesctopId) - { - //print("fAddDesktop 0: " + _sUser + " / " + _sDesctopId) - - if(_sUser == "0" && _sDesctopId == "0") - { - id_lvUser.m_bNewSelect = true; - var a_bSel = false; - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - if( id_lmDesktopUser.get(s).obOld ) - { - id_lmDesktopUser.remove(s); - } - else - { - if(id_lmDesktopUser.get(s).obId === id_lvUser.m_sIdD) - a_bSel = true; - } - } - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - id_lmDesktopUser.get(s).obOld = true; - } - - root.m_bUserSelected = a_bSel; - - return; - } - - id_lvUser.m_bNewSelect = false; - - id_tSearch.m_iSearch = 0; - - var a_bAdd = true; - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - //print("fAddDesktop 4.0: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - // if(id_lmDesktopUser.get(s).obTitle.indexOf( _sUser ) >= 0 ) - // { - // print("fAddDesktop 4.1: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - // id_lmDesktopUser.remove(s); - // } - // else - { - //print("fAddDesktop 4.2: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - if(id_lmDesktopUser.get(s).obId === _sDesctopId ) - { - //print("fAddDesktop 4.3: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - id_lmDesktopUser.get(s).obOld = false; - a_bAdd = false; - - break; - } - - } - } - - if(a_bAdd) - { - //print("fAddDesktop 6.0: " + _sDesctopId + " / " + _sUser) - - if(_sDesctopId == id_lvUser.m_sIdD && id_lvUser.m_sLoginD === _sUser) - { - //print("fAddDesktop 6.1: ") - - id_lmDesktopUser.append({ obId: _sDesctopId - , obTitle: _sUser - , obSelect: true - , obScrollW: 0 - , obOld: false - }) - - root.m_bUserSelected = true; - } - else - { - if(id_lvUser.m_sIdD.length == 0 - && id_tiLog.text === _sUser) - { - //print("fAddDesktop 6.2: ") - - id_lmDesktopUser.append({ obId: _sDesctopId - , obTitle: _sUser - , obSelect: true - , obScrollW: 0 - , obOld: false - }) - - id_lvUser.m_sIdD = _sDesctopId; - id_lvUser.m_sLoginD = _sUser; - root.m_bUserSelected = true; - } - else - { - //print("fAddDesktop 6.3: ") - - id_lmDesktopUser.append({ obId: _sDesctopId - , obTitle: _sUser - , obSelect: false - , obScrollW: 0 - , obOld: false - }) - } - } - } - - //print("fAddDesktop 10: " + "---------------------------------------------") - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Desktop") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 20 - } - - Column - { - width: parent.width - - Item - { - width: parent.width - height: children[0].height - - Text { - text: qsTr("Search login:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiLog.cursorVisible) - { - id_tiLog.cursorPosition = id_tiLog.text.length; - id_tiLog.cursorVisible = true - id_tiLog.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiLog.selectAll(); - } - } - } - - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - anchors.right: parent.right - //anchors.rightMargin: 5 - anchors.left: parent.children[0].right - anchors.leftMargin: 5 - - TextInput { - id: id_tiLog - width: parent.width - 4 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - Component.onCompleted: - { - text = contextMain.slDeskLogin(); - } - - - onTextChanged: - { - id_lvUser.m_bNewSelect = true; - fSearch(); - } - - onAccepted: - { - id_lvUser.m_bNewSelect = true; - fSearch(); - } - - function fSearch() - { - id_tSearch.m_iSearch = 0; - - if(id_lvUser.m_bNewSelect) - { - id_lvUser.m_bNewSelect = false; - id_lmDesktopUser.clear(); - } - - if(id_tiLog.text.length > 0) - { - root.fAddDesktop("0", "0"); - contextMain.slSearchDesktop(id_tiLog.text); - } - } - - } - } - - - } - - Timer - { - id: id_tSearch - interval: 500; running: true; repeat: true - property int m_iSearch: 0 - onTriggered: - { - m_iSearch++; - - if(m_iSearch > 4) - { - m_iSearch = 0; - id_tiLog.fSearch(); - } - } - } - - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: parent.width - height: 1 - color: "#90000000" - } - - ListView { - id: id_lvUser - width: parent.width; - height: 140 - clip: true - - property string m_sLoginD: "" - property string m_sIdD: "" - property bool m_bNewSelect: false - - ScrollBar.vertical: ScrollBar - { - policy: size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - //visible: size < 1 - - onSizeChanged: - { - for(var i = 0; i < id_lmDesktopUser.count; i++) - { - if(size < 1) - { - id_lmDesktopUser.get(i).obScrollW = this.width + 1; - } - else - { - id_lmDesktopUser.get(i).obScrollW = 0; - } - } - } - } - - ListModel { - id: id_lmDesktopUser - } - - - model: id_lmDesktopUser - delegate: id_comItem - - Component { - id: id_comItem - Item { - width: parent == null ? 1 : parent.width - obScrollW - height: 40 - - - Item - { - anchors.fill: parent - opacity: children[0].pressed ? 0.5 : 1.0 - - MouseArea { - anchors.fill: parent - - onPressed: - (mouse)=> - { - for(var i = 0, s = id_lmDesktopUser.count; i < s; i++) - { - id_lmDesktopUser.get(i).obSelect = false; - } - - obSelect = true; - root.m_bUserSelected = true; - - id_lvUser.m_sLoginD = obTitle - id_lvUser.m_sIdD = obId - - if(!id_tiPass.cursorVisible) - { - id_tiPass.cursorPosition = id_tiPass.text.length; - id_tiPass.cursorVisible = true - id_tiPass.forceActiveFocus(); - } - } - } - - Text { - x: 5 - width: parent.width - 2*x - anchors.verticalCenter: parent.verticalCenter - //font.bold: true - font.pointSize: 14 - text: obTitle // + "-" + obId + "-" + index - color: obSelect ? "#80000000" : "white" - clip: true - } - - // Rectangle - // { - // width: parent.width - // height: 1 - // anchors.bottom: parent.bottom - // color: "#cc000000" - // } - - } - } - } - - } - - Rectangle - { - width: parent.width - height: 1 - color: "#90000000" - } - - Item { - width: 1 - height: 15 - } - - - Item - { - width: parent.width - height: children[0].height - - Text { - text: qsTr("Password:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPass.cursorVisible) - { - id_tiPass.cursorPosition = id_tiPass.text.length; - id_tiPass.cursorVisible = true - id_tiPass.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPass.selectAll(); - id_tiLog.update() - } - } - } - - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - anchors.right: parent.right - //anchors.rightMargin: 5 - anchors.left: parent.children[0].right - anchors.leftMargin: 5 - - TextInput { - id: id_tiPass - width: parent.width - 4 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - Component.onCompleted: - { - text = contextMain.slDeskPassword(); - } - - } - } - - - } - - Item { - width: 1 - height: 20 - } - - Item { - width: parent.width - height: 50 - - - MyCheckBox { - id: id_chkScreen - checked: true - text: qsTr("Screen capture") - font.bold: true - font.pixelSize: 14 - - onPressed: - { - id_chkComandLine.checked = false - id_chkScreen.checked = false - - //id_recNewConnect.fConnect(true); - - } - - - } - - MyCheckBox { - id: id_chkComandLine - anchors.right: parent.right - text: qsTr("Command line") - font.bold: true - font.pixelSize: 14 - - Component.onCompleted: - { - if(!contextMain.slComandLineStatus()) - { - fChkComandLine(false); - } - else - { - fChkComandLine(true); - } - } - - - - - onPressed: - { - id_chkScreen.checked = false - id_chkComandLine.checked = false - - //id_recNewConnect.fConnect(false); - } - } - } - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - id: id_recNewConnect - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recNewConnect.fConnect(id_chkScreen.checked); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("New connection") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - - function fConnect(_bVar) - { - //print("fConnect 0: " + id_lvUser.m_sLoginD + " / " + id_tiPass.text + " / " + root.m_bUserSelected) - - if( (root.m_bUserSelected - && (id_lvUser.m_sLoginD.length > 0 && id_tiPass.text.length > 0) - //|| (contextMain.slDeskLogin().length > 0 && contextMain.slDeskPassword().length > 0) - ) - ) - { - var a_bSel = false; - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - if(id_lmDesktopUser.get(s).obSelect) - { - a_bSel = true - break; - } - } - - if(a_bSel) - { - contextMain.slDisConnectDesktop(0); - contextMain.slUseComandLine(!_bVar); - contextMain.slConnectToDesktop(_bVar, id_lvUser.m_sLoginD, id_tiPass.text, id_lvUser.m_sIdD); - } - else - { - contextMain.slClientControl("308", 17, "Select user..."); - } - } - else - { - if( id_lvUser.m_sLoginD.length == 0 ) - contextMain.slClientControl("308", 17, "Select user..."); - else - if( id_tiPass.text.length == 0 ) - contextMain.slClientControl("308", 17, "Password input..."); - - } - } - - } - - Rectangle - { - width: 20 - height: 2 - anchors.centerIn: parent - color: "#000000" - rotation: 0 - visible: id_tConnect.running && id_lvUser.m_sLoginD.length > 0 && id_tiPass.text.length ? true : false - - Timer - { - id: id_tConnect - interval: 10; running: false; repeat: true - onTriggered: - { - parent.rotation += 5; - if(parent.rotation > 360) - parent.rotation = 5; - - if(!root.m_bUserSelected) - id_recDisConnect.fDisConnect(); - } - } - } - - Rectangle - { - id: id_recDisConnect - width: id_recNewConnect.width - height: id_recNewConnect.height - anchors.right: parent.right - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recDisConnect.fDisConnect(); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Disconnect") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - - function fDisConnect() - { - contextMain.slDisConnectDesktop(1); - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/menu_FileCopy.qml b/src/qml5/menu_FileCopy.qml deleted file mode 100644 index bcaaf60..0000000 --- a/src/qml5/menu_FileCopy.qml +++ /dev/null @@ -1,499 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 - -Rectangle { - id: root - objectName: "obMenuFileCopy" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - if(!id_tiFilePath.cursorVisible) - { - id_tiFilePath.cursorPosition = id_tiFilePath.text.length; - id_tiFilePath.cursorVisible = true - id_tiFilePath.forceActiveFocus(); - } - } - - Component.onDestruction: - { - - } - - function fFileWrited(_iVar, _Data) - { - //print("fFileWrited: " + _iVar + " / " + _Data) - - if(_iVar == 4) - { - id_StatusCopy.text = _Data; - - return; - } - - id_FileWrited.value = _Data/100 - - id_ProcCopy.text = (_Data + " %") - - if(_iVar == 0) - { - id_StatusCopy.text = "Invalid file path." - } - else - if(_iVar == 1) - { - id_StatusCopy.text = "" - } - else - { - if(_iVar == 2) - { - id_StatusCopy.text = "Failed copy." - } - else - { - if(_iVar == 3) - { - id_StatusCopy.text = "Success copy." - } - else - { - - } - } - } - } - - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- File copy") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 20 - } - - Column - { - width: parent.width - - Text { - text: qsTr("File path:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiFilePath.cursorVisible) - { - id_tiFilePath.cursorPosition = id_tiFilePath.text.length; - id_tiFilePath.cursorVisible = true - id_tiFilePath.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiFilePath.selectAll(); - } - } - } - - Item { - width: 1 - height: 5 - } - - Rectangle - { - - width: parent.width - height: children[0].height + 10 - color: "#10000000" - - - TextInput { - id: id_tiFilePath - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 14 - - clip: true - - onTextChanged: - { - if(text.length == 0) - return; - - while(text.charAt(0) == ' ') - text = text.substring(1); - - if( text.indexOf("file:///") == 0) - { - text = text.substring( ("file:///").length ); - } - } - - onAccepted: - { - } - } - } - - - } - - Item { - width: 1 - height: 30 - } - - - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - width: parent.width/2 - 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - visible: id_FileWrited.value == 0 ? true : false - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_FileWrited.value = 0; - contextMain.slFileCopy(1, id_tiFilePath.text.trim()); - - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Get file") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: parent.width/2 - 20 - height: children[1].height + 20 - anchors.right: parent.right - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - visible: id_FileWrited.value == 0 ? true : false - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_FileWrited.value = 0; - contextMain.slFileCopy(2, id_tiFilePath.text.trim()); - - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Send file") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: parent.width - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - visible: id_FileWrited.value > 0 ? true : false - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - //id_FileWrited.value = 0; - contextMain.slFileCopy(0, ""); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Stop") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - } - - Item { - width: 1 - height: 30 - visible: id_FileWrited.value - } - - ProgressBar { - id: id_FileWrited - width: parent.width - value: 0.0 - visible: value == 0 ? false : true - } - - Text { - id: id_ProcCopy - anchors.right: id_FileWrited.right - text: qsTr("") - //font.bold: true - font.pixelSize: 16 - color: "#000000" - visible: id_FileWrited.value - - } - - Item { - width: 1 - height: 30 - visible: id_StatusCopy.visible - } - - Text { - id: id_StatusCopy - width: parent.width - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("") - wrapMode: Text.Wrap - //font.bold: true - font.pixelSize: 18 - color: "#000000" - visible: text.length == 0 ? false : true - } - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/menu_Login.qml b/src/qml5/menu_Login.qml deleted file mode 100644 index 073d6a8..0000000 --- a/src/qml5/menu_Login.qml +++ /dev/null @@ -1,413 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuLogin" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - property int m_iTitleW: 110 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - id_tiLog.text = contextMain.slLogin(); - id_tiPass.text = contextMain.slPassword(); - - } - - Component.onDestruction: - { - - } - - function fConnect(_bVar) - { - if(_bVar == 1) - id_tConnect.stop() - else - id_tConnect.start() - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Your login") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - id: id_flMain - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 20 - } - - Row - { - Text { - text: qsTr("Login:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiLog.cursorVisible) - { - id_tiLog.cursorPosition = id_tiLog.text.length; - id_tiLog.cursorVisible = true - id_tiLog.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiLog.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiLog - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - } - } - } - - Item { - width: 1 - height: 15 - } - - Row - { - - Text { - text: qsTr("Password:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPass.cursorVisible) - { - id_tiPass.cursorPosition = id_tiPass.text.length; - id_tiPass.cursorVisible = true - id_tiPass.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPass.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiPass - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - } - } - - } - - Item { - width: 1 - height: 25 - } - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slConnectToServer(id_tiLog.text, id_tiPass.text); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("New connection") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: 20 - height: 2 - anchors.right: parent.right - anchors.rightMargin: 5 - anchors.verticalCenter: parent.verticalCenter - color: "#000000" - rotation: 0 - visible: id_tConnect.running - - Timer - { - id: id_tConnect - interval: 10; running: false; repeat: true - onTriggered: - { - parent.rotation += 5; - if(parent.rotation > 360) - parent.rotation = 5; - } - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/menu_Server.qml b/src/qml5/menu_Server.qml deleted file mode 100644 index 1e76cc4..0000000 --- a/src/qml5/menu_Server.qml +++ /dev/null @@ -1,917 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuServer" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - property int m_iTitleW: 120 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - id_tiIP.text = contextMain.slServerIP(); - id_tiPortTCP.text = contextMain.slPortTCP(); - id_tiRtspPort.text = contextMain.slPortRTSP(); - id_tiRtmpPort.text = contextMain.slPortRTMP(); - } - - Component.onDestruction: - { - - } - - function fConnect(_bVar) - { - if(_bVar == 1) - id_tConnect.stop() - else - id_tConnect.start() - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Server") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - id: id_flMain - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - - Column - { - Item { - width: 1 - height: 20 - } - - MyCheckBox { - id: id_chkServDev - objectName: "obChkServDev" - text: qsTr("use the developer server") - //font.bold: true - font.pixelSize: 18 - - Component.onCompleted: - { - id_chkServDev.checked = contextMain.slDevServer(); - } - - onCheckedChanged: - { - if(!id_chkServDev.checked) - { - contextMain.fUpdateServerData(); - id_tiPortTCP.text = contextMain.slPortTCP(); - id_tiRtspPort.text = contextMain.slPortRTSP(); - id_tiRtmpPort.text = contextMain.slPortRTMP(); - } - } - - } - - Item { - anchors.right: id_chkServDev.right - anchors.rightMargin: 5 - width: children[0].width - height: children[0].height - - Text { - y: -7 - text: qsTr("(limited time)") - color: "#000000" - font.pixelSize: 16 - } - } - - - - Item { - width: 1 - height: 15 - visible: id_chkServDev.checked - } - - Row - { - visible: id_chkServDev.checked - - Text { - text: qsTr("key:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiKey.cursorVisible) - { - id_tiKey.cursorPosition = id_tiKey.text.length; - id_tiKey.cursorVisible = true - id_tiKey.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiKey.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiKey - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - Component.onCompleted: - { - id_tiKey.text = contextMain.slKeyDevServer(); - } - } - } - - } - } - - Item { - width: 1 - height: 40 - } - - Column{ - visible: !id_chkServDev.checked - - Row - { - Text { - text: qsTr("password:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPassword.cursorVisible) - { - id_tiPassword.cursorPosition = id_tiPassword.text.length; - id_tiPassword.cursorVisible = true - v.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPassword.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiPassword - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - Component.onCompleted: - { - id_tiPassword.text = contextMain.slServerPassword(); - } - - } - } - - } - - Item { - width: 1 - height: 15 - } - } - - - - Row - { - Text { - text: qsTr("ip:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiIP.cursorVisible) - { - id_tiIP.cursorPosition = id_tiIP.text.length; - id_tiIP.cursorVisible = true - id_tiIP.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiIP.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiIP - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - - - - } - - Column{ - visible: !id_chkServDev.checked - - - Item { - width: 1 - height: 15 - - } - - Row - { - - Text { - text: qsTr("port:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPortTCP.cursorVisible) - { - id_tiPortTCP.cursorPosition = id_tiPortTCP.text.length; - id_tiPortTCP.cursorVisible = true - id_tiPortTCP.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPortTCP.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiPortTCP - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - } - - Item { - width: 1 - height: 30 - //visible: false - } - - Row - { - //visible: false - - Text { - text: qsTr("rtsp-port:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiRtspPort.cursorVisible) - { - id_tiRtspPort.cursorPosition = id_tiRtspPort.text.length; - id_tiRtspPort.cursorVisible = true - id_tiRtspPort.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiRtspPort.selectAll(); - } - } - } - - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiRtspPort - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - - } - - Item { - width: 1 - height: 15 - //visible: false - } - - Row - { - //visible: false - - Text { - text: qsTr("rtmp-port:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiRtmpPort.cursorVisible) - { - id_tiRtmpPort.cursorPosition = id_tiRtmpPort.text.length; - id_tiRtmpPort.cursorVisible = true - id_tiRtmpPort.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiRtmpPort.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiRtmpPort - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - } - } - - } - - } - - Item { - width: 1 - height: 30 - } - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(id_chkServDev.checked) - { - if(contextMain.slIsIP(id_tiIP.text) - && id_tiKey.text.length > 7 - && id_tiPassword.text.length > 3 - ) - { - contextMain.slServerUpdateData(id_tiIP.text, "0", "0", "0", id_tiKey.text, id_tiPassword.text); - } - } - else - if(contextMain.slIsIP(id_tiIP.text) - && contextMain.slIsNumber(id_tiPortTCP.text) - && contextMain.slIsNumber(id_tiRtspPort.text) - && contextMain.slIsNumber(id_tiRtmpPort.text) - && id_tiPortTCP.text.indexOf('-') < 0 - && id_tiRtspPort.text.indexOf('-') < 0 - && id_tiRtmpPort.text.indexOf('-') < 0 - && id_tiPassword.text.length > 3 - ) - { - contextMain.slServerUpdateData(id_tiIP.text, id_tiPortTCP.text, id_tiRtspPort.text, id_tiRtmpPort.text, "xxxxxxxx", id_tiPassword.text); - } - } - } - - Text { - anchors.centerIn: parent - text: qsTr("New connection") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: 20 - height: 2 - anchors.right: parent.right - anchors.rightMargin: 5 - anchors.verticalCenter: parent.verticalCenter - color: "#000000" - rotation: 0 - visible: id_tConnect.running - - Timer - { - id: id_tConnect - interval: 100; running: false; repeat: true - onTriggered: - { - parent.rotation += 15; - if(parent.rotation > 360) - parent.rotation = 15; - } - } - } - - } - - - - - Column - { - width: parent.width - visible: !id_chkServDev.checked - - Item { - width: 1 - height: 30 - } - - Item - { - width: parent.width - height: children[1].height - - Text { - text: qsTr("low activity disconnect time:") - //width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - anchors.bottom: parent.children[1].bottom - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiTimeLA.cursorVisible) - { - id_tiTimeLA.cursorPosition = id_tiTimeLA.text.length; - id_tiTimeLA.cursorVisible = true - id_tiTimeLA.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiTimeLA.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.left: parent.children[0].right - anchors.right: parent.children[2].left - anchors.leftMargin: 10 - anchors.rightMargin: 3 - - - TextInput { - id: id_tiTimeLA - width: parent.width - 6 - anchors.centerIn: parent - - text: "0" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - } - } - - Text { - text: qsTr("sec.") - color: "#ffffff" - font.pixelSize: 20 - anchors.right: parent.right - anchors.rightMargin: 10 - anchors.bottom: parent.children[1].bottom - } - - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slLowActivityDiscTime(id_tiTimeLA.text); - } - } - - Text { - anchors.centerIn: parent - text: qsTr(" Apply ") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/menu_Support.qml b/src/qml5/menu_Support.qml deleted file mode 100644 index dd2fd71..0000000 --- a/src/qml5/menu_Support.qml +++ /dev/null @@ -1,587 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuSupport" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 10 - property int m_iTitleW: 110 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - //id_tiIP.text = contextMain.slServerIP(); - } - - Component.onDestruction: - { - - } - - onM_iHChanged: - { - signalData(1, "", "", "", "", "", "") - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Support") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - - Flickable { - id: id_flMain - x: 10 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - MouseArea - { - anchors.fill: parent - onReleased: - (mouse)=> - { - id_txtMail.focus = false - } - - } - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - - - Item { - width: 1 - height: 20 - } - - Image { - height: 100 - width: 3 * height - anchors.horizontalCenter: parent.horizontalCenter - source: "qrc:/image/baner.png" - - MouseArea { - anchors.fill: parent - - onReleased: - { - Qt.openUrlExternally(id_txtFTurl.a_link) - } - } - - } - - Item { - width: 1 - height: 5 - } - - Item { - width: parent.width - height: children[0].height - - Text { - id: id_txtFTurl - //color: "#ffffff" - font.bold: true - font.pixelSize: 20 - text: 'BypassNAT' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://in-spectrum.github.io/BypassNAT/" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.children[2].left - anchors.rightMargin: 20 - anchors.bottom: parent.children[0].bottom - text: ' GitHub ' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://github.com/In-spectrum/BypassNAT?tab=readme-ov-file" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[1].bottom - text: 'MIT license' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://github.com/In-spectrum/BypassNAT?tab=MIT-1-ov-file#" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - } - - Item { - width: 1 - height: 20 - } - - Item { - width: parent.width - height: children[0].height - - Text { - color: "#ffffff" - font.bold: true - font.pixelSize: 18 - text: "meil" - } - - TextEdit { - id: id_txtMail - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[0].bottom - text: "alexandr.deryk@gmail.com" - readOnly: true - persistentSelection: false - focus: true - } - } - - - - Column - { - width: parent.width - - Item { - width: 1 - height: 20 - } - - Text { - color: "#ffffff" - font.pixelSize: 20 - text: "was used:" - } - - Item { - width: 1 - height: 10 - } - - Item { - width: parent.width - height: children[0].height - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 20 - text: "Qt" - } - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[0].bottom - text: 'LGPL-v3 license' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://www.gnu.org/licenses/lgpl-3.0.txt" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - } - - Item { - width: 1 - height: 10 - visible: false - } - - Item { - width: parent.width - height: children[0].height - visible: false - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 20 - text: "GStreamer" - } - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[0].bottom - text: 'LGPL-v2.1 license' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://github.com/GStreamer/gstreamer/blob/main/LICENSE" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - } - - } - - - - - - Item { - width: 1 - height: 40 - visible: false - } - - Row - { - visible: false - Text { - text: qsTr("Server IP:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiIP.cursorVisible) - { - id_tiIP.cursorPosition = id_tiIP.text.length; - id_tiIP.cursorVisible = true - id_tiIP.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiIP.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiIP - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - - - - } - - - Item { - width: 1 - height: 30 - } - - Item { - visible: false - width: parent.width - height: children[0].height - - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(contextMain.slIsIP(id_tiIP.text) ) - { - contextMain.slSendStatIP(id_tiIP.text); - } - } - } - - Text { - anchors.centerIn: parent - text: qsTr(" Apply ") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: 20 - height: 2 - anchors.right: parent.right - anchors.rightMargin: 5 - anchors.verticalCenter: parent.verticalCenter - color: "#000000" - rotation: 0 - visible: id_tConnect.running - - Timer - { - id: id_tConnect - interval: 10; running: false; repeat: true - onTriggered: - { - parent.rotation += 5; - if(parent.rotation > 360) - parent.rotation = 5; - } - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/menu_VideoQuality.qml b/src/qml5/menu_VideoQuality.qml deleted file mode 100644 index 9abb5d4..0000000 --- a/src/qml5/menu_VideoQuality.qml +++ /dev/null @@ -1,749 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuVideoQuality" - width: parent.width - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - - } - - Component.onDestruction: - { - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - function fSetStatus(_iSizeF, _iFPS, _iEnvoderV, _iEncSpeed, _iBetrate, _iLatencyZ, _iStreamRTSP, _iSoundCapture) - { - switch(_iSizeF) - { - case 1: - id_rbFS2.checked = true; - break; - case 2: - id_rbFS3.checked = true; - break; - case 3: - id_rb480.checked = true; - break; - default: - id_rbFS1.checked = true; - break; - } - - id_slFPS.value = _iFPS; - - switch(_iEnvoderV) - { - case 1: - id_rbGPU.checked = true; - break; - default: - id_rbCPU.checked = true; - break; - } - - switch(_iEncSpeed) - { - case 1: - id_rbSpeedE2.checked = true; - break; - case 2: - id_rbSpeedE3.checked = true; - break; - case 3: - id_rbSpeedE4.checked = true; - break; - default: - id_rbSpeedE1.checked = true; - break; - } - - id_slBt.value = _iBetrate/10; - - id_cbLatZ.checked = _iLatencyZ; - - switch(_iStreamRTSP) - { - case 1: - id_rbRTSP.checked = true; - break; - default: - id_rbRTMP.checked = true; - break; - } - - id_cbSoundCapture.checked = _iSoundCapture; - - } - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Video quality") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Component.onCompleted: - { - contextMain.slVideoQualityStatus(); - } - - Item { - width: 1 - height: 20 - } - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Stream") - font.bold: true - font.pixelSize: 16 - - //visible: false - - Component.onCompleted: - { - if(contextMain.slStreamRTSP()) - { - id_rbRTSP.checked = true - id_rbRTMP.checked = false - } - else - { - id_rbRTSP.checked = false - id_rbRTMP.checked = true - } - } - - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - RadioButton { - id: id_rbRTMP - anchors.verticalCenter: parent.verticalCenter - text: qsTr("RTMP") - checked: true - } - - RadioButton { - id: id_rbRTSP - width: 120 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("RTSP") - font.pixelSize: 16 - } - } - } - - - Item { - width: 1 - height: 20 - } - - - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Frame size") - font.bold: true - font.pixelSize: 16 - - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - RadioButton { - id: id_rbFS1 - width: 120 - anchors.verticalCenter: parent.verticalCenter - checked: true - text: qsTr("Original") - font.pixelSize: 16 - - } - - RadioButton { - id: id_rbFS2 - width: 120 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Full HD") - font.pixelSize: 16 - - } - - RadioButton { - id: id_rbFS3 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("HD") - - - } - - RadioButton { - id: id_rb480 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("480h") - visible: false - - - } - } - } - - - Item { - width: 1 - height: 10 - } - - - GroupBox { - width: parent.width - height: 70 - title: qsTr("FPS") - font.bold: true - font.pixelSize: 16 - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - - - Slider { - id: id_slFPS - width: parent.parent.width - 85 - anchors.verticalCenter: parent.verticalCenter - from: 10 - value: 30 - to: 60 - stepSize: 5 - } - - Text { - width: 30 - anchors.verticalCenter: parent.verticalCenter - text: " " + (parent.children[0].value == 0 ? 1 : Math.round(parent.children[0].value) ) - font.bold: true - font.pixelSize: 16 - color: "#000000" - } - - - } - } - - - Item { - width: 1 - height: 10 - } - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Encoder h.264") - font.bold: true - font.pixelSize: 16 - - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - RadioButton { - id: id_rbCPU - width: 120 - anchors.verticalCenter: parent.verticalCenter - checked: true - text: qsTr("use CPU") - font.pixelSize: 16 - } - - RadioButton { - id: id_rbGPU - anchors.verticalCenter: parent.verticalCenter - text: qsTr("use GPU") - } - } - } - - - Item { - width: 1 - height: 10 - visible: !id_rbGPU.checked - } - - GroupBox { - width: parent.width - title: qsTr("Encoding speed") - font.bold: true - font.pixelSize: 16 - visible: !id_rbGPU.checked - - - Column - { - Row - { - RadioButton { - id: id_rbSpeedE1 - width: 120 - text: qsTr("ultrafast") - font.pixelSize: 16 - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[1].children[0].checked = false; - parent.parent.children[1].children[1].checked = false; - } - } - - } - - RadioButton { - id: id_rbSpeedE2 - checked: true - text: qsTr("veryfast") - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[1].children[0].checked = false; - parent.parent.children[1].children[1].checked = false; - } - } - - } - } - - Row - { - RadioButton { - id: id_rbSpeedE3 - width: 120 - text: qsTr("medium") - font.pixelSize: 16 - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[0].children[0].checked = false; - parent.parent.children[0].children[1].checked = false; - } - } - } - - RadioButton { - id: id_rbSpeedE4 - text: qsTr("slower") - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[0].children[0].checked = false; - parent.parent.children[0].children[1].checked = false; - } - } - } - } - } - } - - - Item { - width: 1 - height: 10 - } - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Bitrate") - font.bold: true - font.pixelSize: 16 - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - Slider { - id: id_slBt - width: id_slFPS.width - anchors.verticalCenter: parent.verticalCenter - from: 0.5 - value: 4 - to: 10 - stepSize: 0.5 - } - - Text { - width: 30 - anchors.verticalCenter: parent.verticalCenter - text: " " + parent.children[0].value.toFixed(1) + " Mbit." - font.bold: true - font.pixelSize: 16 - color: "#000000" - } - - } - } - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: children[0].height - - MyCheckBox { - id: id_cbLatZ - x: 5 - text: qsTr("Zero latency") - visible: !id_rbGPU.checked - - } - - MyCheckBox { - id: id_cbSoundCapture - anchors.right: parent.right - anchors.rightMargin: id_cbLatZ.x - text: qsTr("Sound capture") - } - - - } - - - - Item { - width: 1 - height: 20 - } - - Item { - width: parent.width - height: children[0].height - - Rectangle - { - width: parent.width/2 - 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - var a_iSizeF = 0; - if(id_rbFS2.checked) - a_iSizeF = 1; - else - if(id_rbFS3.checked) - a_iSizeF = 2; - else - if(id_rb480.checked) - a_iSizeF = 3; - - var a_iEnvoderV = 0; - if(id_rbGPU.checked) - a_iEnvoderV = 1; - - - var a_iEncSpeed = 0; - if(id_rbSpeedE2.checked) - a_iEncSpeed = 1; - else - if(id_rbSpeedE3.checked) - a_iEncSpeed = 2; - else - if(id_rbSpeedE4.checked) - a_iEncSpeed = 3; - - - var a_iLatencyZ = 0; - if(id_cbLatZ.checked) - a_iLatencyZ = 1; - - var a_iSound = 0; - if(id_cbSoundCapture.checked) - a_iSound = 1; - - contextMain.slVideoQualityGet(a_iSizeF, id_slFPS.value, a_iEnvoderV, a_iEncSpeed, 10*id_slBt.value, a_iLatencyZ, id_rbRTSP.checked, a_iSound); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Apply") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - - - - Item - { - width: children[1].width + 20 - height: children[1].height + 20 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - - opacity: children[0].pressed ? 0.6 : 1.0 - - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - - id_slFPS.value = 30; - id_rbFS1.checked = true; - id_rbCPU.checked = true; - id_rbSpeedE2.checked = true; - id_slBt.value = 2.5; - id_cbLatZ.checked = true; - id_cbSoundCapture.checked = false; - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Default propertys") - font.underline: true - font.bold: true - font.pixelSize: 16 - color: "#90000000" - } - } - - } - - - Item { - width: 1 - height: 10 - } - - } - - - } - - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/menu_ViewSize.qml b/src/qml5/menu_ViewSize.qml deleted file mode 100644 index 40862cd..0000000 --- a/src/qml5/menu_ViewSize.qml +++ /dev/null @@ -1,305 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuViewSize" - width: 300 - color: "#808080" - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 50 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - - } - - Component.onDestruction: - { - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- View size") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: 40 - - - Item - { - anchors.fill: parent - opacity: children[0].pressed ? 0.5 : 1.0 - - MouseArea { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slFullScreen(true); - } - } - - Text { - x: 5 - width: parent.width - 2*x - anchors.verticalCenter: parent.verticalCenter - //font.bold: true - font.pointSize: 16 - text: "Application full size" - color: "white" - clip: true - } - - Rectangle - { - width: parent.width - height: 1 - anchors.bottom: parent.bottom - color: "#cc000000" - } - - } - } - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: 40 - - - Item - { - anchors.fill: parent - opacity: children[0].pressed ? 0.5 : 1.0 - - MouseArea { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slDesktopRealSize(true); - } - } - - Text { - x: 5 - width: parent.width - 2*x - anchors.verticalCenter: parent.verticalCenter - //font.bold: true - font.pointSize: 16 - text: "Real desktop size" - color: "white" - clip: true - } - - Rectangle - { - width: parent.width - height: 1 - anchors.bottom: parent.bottom - color: "#cc000000" - } - - } - } - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml5/messageStatus.qml b/src/qml5/messageStatus.qml deleted file mode 100644 index 7dcf79a..0000000 --- a/src/qml5/messageStatus.qml +++ /dev/null @@ -1,307 +0,0 @@ -import QtQuick 2.12 - -Rectangle { - id: root - objectName: "obMessageStatus" - anchors.fill: parent - color: "#30000000" - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_recCancel.fCancel(); - } - - onPositionChanged: - (mouse)=> - { - - } - } - - - function fStatus(_iVar, _sData) - { - //print("fStatus 0: " + _iVar + " -> " + _sData) - - id_txtTitle.text = ""; - - - - if(_iVar > 300) - { - id_txtInfo.text = ""; - } - else - if(_iVar > 200) - { - - switch(_iVar%10) - { - case 1: - id_txtTitle.text = "- Error"; - break; - case 2: - id_txtTitle.text = "- Warning"; - break; - } - - id_txtInfo.text = "Server data:\n\n"; - - } - else - { - switch(_iVar%10) - { - case 1: - id_txtTitle.text = "- Error"; - break; - case 2: - id_txtTitle.text = "- Warning"; - break; - } - - id_txtInfo.text = "Client data:\n\n"; - } - - - id_txtInfo.text += _sData; - - root.parent.visible = true; - - } - - Rectangle { - id: id_recStatus - anchors.centerIn: parent - width: parent.width - 20 > 600 ? 600 : parent.width - 20 - color: "#808080" - height: parent.height - 20 > 400 ? 400 : parent.height - 20 - border.color: "#000000" - border.width: 1 - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - - } - - Component.onDestruction: - { - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#90ff0000" - - Item { - width: 2 * children[0].width - height: parent.height - visible: false - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - id: id_txtTitle - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - - - Item { - width: parent.width - 40 - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: id_recTitle.bottom - anchors.topMargin: 20 - anchors.bottom: id_recCancel.top - anchors.bottomMargin: 20 - - Text { - id: id_txtInfo - anchors.fill: parent - - text: qsTr("") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - wrapMode: Text.Wrap - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - - } - - - -} diff --git a/src/qml5/player.qml b/src/qml5/player.qml deleted file mode 100644 index d1b555e..0000000 --- a/src/qml5/player.qml +++ /dev/null @@ -1,486 +0,0 @@ -import QtQuick 2.12 - - -Item { - id: root - objectName: "obVideo" - anchors.fill: parent - focus: true - - property bool m_bFocus: parent.focus - property bool m_bFrameRealSize: true - property bool m_bPlay: false - property int m_iFrame: -1; - property int m_iFramePrew: -1; - property int m_iRestartNew: 0 - property int m_iPlayRestart: 0 - - property int m_iFPS: 0 - property int m_iDataFPS: 0 - property int m_iLowFPS: 0 - property int m_iShowFPS: 60 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - onM_bFocusChanged: - root.focus = m_bFocus; - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - Keys.onPressed: - (event)=> - { - contextMain.slSendKeyEvent(1, event.key, event.text); - event.accepted = true; - } - - Keys.onReleased: - (event)=> - { - contextMain.slSendKeyEvent(2, event.key, event.text); - event.accepted = true; - } - - - MouseArea - { - id: id_mouseMain - anchors.fill: parent - - property int a_iMousStartX : 0 - property int a_iMousStartY : 0 - property int a_iMove : 0 - property bool a_bDoubleClicked: false - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - } - - onPositionChanged: - { - if(id_tMouseMainLongPress.running) - { - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - } - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > Math.abs( mouseX - id_mouseMain.a_iMousStartX )) - { - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > 5) - { - id_mouseMain.a_iMousStartY = mouseY - } - } - else - { - id_mouseMain.a_iMove = mouseX - id_mouseMain.a_iMousStartX; - id_mouseMain.a_iMousStartX = mouseX; - - } - - - } - - onPressed: (mouse)=> - { - - root.parent.focus = true; - - id_mouseMain.a_iMousStartX = mouseX; - id_mouseMain.a_iMousStartY = mouseY; - - if(!id_tMouseMainDoubleClicked.running) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.start() - } - else - { - a_bDoubleClicked = true; - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.start(); - } - - onReleased: (mouse)=> - { - id_mouseMain.a_iMousStartX = 0; - id_mouseMain.a_iMousStartY = 0; - - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - else - { - if( id_mouseMain.a_iMove == 0 ) - { - - - } - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - - id_mouseMain.a_iMove = 0; - } - - Timer - { - id: id_tMouseMainDoubleClicked - interval: 200; - repeat: false - - onTriggered: - { - } - } - - Timer - { - id: id_tMouseMainLongPress - interval: 200; - repeat: true - - property int m_iLongPress: 0 - - onTriggered: - { - m_iLongPress++; - - if(m_iLongPress > 4) - { - m_iLongPress = 0; - stop(); - } - } - } - - } - - - function fTimer() - { - if(m_bPlay && id_itLoading.m_bLoading < 10) - id_itLoading.m_bLoading++; - - fVideoReload(); - } - - function fVideoStartStop(_sData, _iVar) - { - root.m_iRestartNew = root.m_iPlayRestart = 0; - - if(_iVar > 0) - { - m_bPlay = true; - } - else - { - m_bPlay = false; - - } - - id_itLoading.m_bLoading = 5; - root.m_iFrame = root.m_iFramePrew = -1; - - } - - function fVideoReload() - { - //print("fVideoReload 0: " + root.m_iRestartNew + " / " + m_iPlayRestart); - - if(!root.m_bPlay) - return; - - if(root.m_iFramePrew == root.m_iFrame) - { - if(root.m_iRestartNew < 6) - { - //print("fVideoReload 1: " + root.m_iRestartNew); - - root.m_iPlayRestart++; - - if(root.m_iPlayRestart > 10) - { - //print("fVideoReload 2: " + root.m_iPlayRestart); - - contextMain.slReConnectToDesktop(); - - root.m_iPlayRestart = 0; - - root.m_iRestartNew++; - } - } - else - { - contextMain.slDisConnectDesktop(1); - } - } - - root.m_iFramePrew = root.m_iFrame; - - } - - - - function fDescktopRealSize(_bVar) - { - root.m_bFrameRealSize = !root.m_bFrameRealSize; - } - - - - function updateFrame(_uFrameCounter, _iWf, _iHf) - { - id_itLoading.m_bLoading = 0; - - id_imVideo.source = "image://streamNum_" - + "1" - + "/stream_" - + _uFrameCounter; - - id_imVideo.m_iFrameW = _iWf; - id_imVideo.m_iFrameH = _iHf; - - root.m_iFrame = _uFrameCounter; - root.m_iRestartNew = root.m_iPlayRestart = 0; - } - - - - Image { - id:id_imVideo - anchors.centerIn: parent - -// height: m_iTempFrameH * m_dKWH > parent.width ? parent.width / m_dKWH : m_iTempFrameH -// width: m_iTempFrameH * m_dKWH > parent.width ? parent.width : m_iTempFrameH * m_dKWH - - height: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW / m_dKWH : m_iTempFrameH - width: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW : m_iTempFrameH * m_dKWH - - //source: "image/save.png" - - property int m_iFrameW: 0 - property int m_iFrameH: 0 - - property int m_iTempFrameH: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.height : m_iFrameH - property double m_dKWH : m_iFrameW / m_iFrameH - - property int m_iDrawFrameW: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.width : m_iFrameW - - MouseArea - { - id: id_mouseVideo - anchors.fill: parent - hoverEnabled: true - - property var a_bBtPress: [false, false] - property bool a_bBtLeftPressed: false - - - acceptedButtons: Qt.LeftButton | Qt.RightButton - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - - contextMain.slSendMouseEvent(4, wheel.angleDelta.y < 0 ? 0 : 1 - , 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - - onPressed: (mouse)=> - { - root.parent.focus = true; - - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = true; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtPress[0] = true; - - a_bBtLeftPressed = true; - } - - contextMain.slSendMouseEvent(1, a_bBtLeftPressed, 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onPressed 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onReleased: (mouse)=> - { - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = false; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtLeftPressed = true; - - a_bBtPress[0] = false; - } - - contextMain.slSendMouseEvent(2, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onReleased 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onPositionChanged: - { - //print("onPositionChanged 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - //print("onReleased 5: " + id_imVideo.width + " / " + mouseX + " / " + (100 * mouseX/id_imVideo.width) + " / " + 100 * (100 * mouseX/id_imVideo.width)); - - - contextMain.slSendMouseEvent(3, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - } - - - } - - Item { - id: id_itLoading - anchors.right: parent.right - anchors.rightMargin: y - y:2 - rotation: 0 - visible: m_bPlay && m_bLoading > 2 ? true : false - - property real m_bLoading: 3 - - property int size: 40 - property int lineWidth: 5 - property real value: 0 - - property color primaryColor: "#99ff0000" - property color secondaryColor: "#00e0e0e0" - - property int animationDuration: 1000 - - width: size - height: size - - onValueChanged: { - canvas.degree = value * 360; - } - - Canvas { - id: canvas - - property real degree: 250 - - anchors.fill: parent - antialiasing: true - - onDegreeChanged: { - requestPaint(); - } - - onPaint: { - var ctx = getContext("2d"); - - var x = id_itLoading.width/2; - var y = id_itLoading.height/2; - - var radius = id_itLoading.size/2 - id_itLoading.lineWidth - var startAngle = (Math.PI/180) * 270; - var fullAngle = (Math.PI/180) * (270 + 360); - var progressAngle = (Math.PI/180) * (270 + degree); - - ctx.reset() - - ctx.lineCap = 'round'; - ctx.lineWidth = id_itLoading.lineWidth; - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, fullAngle); - ctx.strokeStyle = id_itLoading.secondaryColor; - ctx.stroke(); - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, progressAngle); - ctx.strokeStyle = id_itLoading.primaryColor; - ctx.stroke(); - } - - // Behavior on degree { - // NumberAnimation { - // duration: root.animationDuration - // } - // } - } - - Timer - { - interval: 50; running: parent.visible; repeat: true - onTriggered: - { - parent.rotation += 30; - - if(parent.rotation > 360) - { - parent.rotation -= 360; - } - } - } - - } - -} diff --git a/src/qml5/playerNew.qml b/src/qml5/playerNew.qml deleted file mode 100644 index 75ecd41..0000000 --- a/src/qml5/playerNew.qml +++ /dev/null @@ -1,503 +0,0 @@ -import QtQuick 2.12 -import QtMultimedia 5.12 - -import my.filter 1.0 - - -Item { - id: root - objectName: "obVideo" - anchors.fill: parent - focus: true - - property bool m_bFocus: parent.focus - property bool m_bFrameRealSize: true - property string m_sURL: "" - property int m_iPlayRestart: 0 - property int m_iRestartNew: 0 - property bool m_bReConnect: false - property int m_iFPS: 0 - property int m_iDataFPS: 0 - property int m_iLowFPS: 0 - property int m_iShowFPS: 60 - - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - onM_bFocusChanged: - root.focus = m_bFocus; - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - Keys.onPressed: - (event)=> - { - //print("Keys.onPressed 0:") - - contextMain.slSendKeyEvent(1, event.key, event.text); - event.accepted = true; - } - - Keys.onReleased: - (event)=> - { - contextMain.slSendKeyEvent(2, event.key, event.text); - event.accepted = true; - } - - MouseArea - { - anchors.fill: parent - - onReleased: (mouse)=> - { - - } - } - - - function fTimer() - { - fVideoReload(); - } - - function fDescktopRealSize(_bVar) - { - root.m_bFrameRealSize = !root.m_bFrameRealSize; - } - - function fVideoStartStop(_sUrl, _iVar) - { - //print("fVideoStartStop 0: " + _sUrl); - - root.m_iRestartNew = 0; - root.m_iPlayRestart = 0; - showVideoFilter.m_bFrameNew = true; - showVideoFilter.m_iFramePrew = 0; - - - if(_sUrl.length > 0) - { - m_iFPS = m_iDataFPS = m_iShowFPS = 0; - - root.fPlay(_sUrl, _iVar) - } - else - root.fPlay("", 0) - - } - - - function fVideoReload() - { - - //print("fVideoReload 0: " + root.m_iRestartNew + " / " + m_iPlayRestart); - - if(showVideoFilter.m_iFramePrew < 0) - { - showVideoFilter.m_bFrameNew = false; - - if(root.m_iRestartNew < 6 && root.m_sURL.length > 0) - { - //print("fVideoReload 1: " + root.m_iRestartNew); - - root.m_iPlayRestart++; - - if(root.m_iPlayRestart > 10) - { - //print("fVideoReload 2: " + root.m_iPlayRestart); - - - // if(root.m_bReConnect) - // fPlay(root.m_sURL, 1); - // else - contextMain.slReConnectToDesktop(); - - root.m_bReConnect = !root.m_bReConnect; - - root.m_iPlayRestart = 0; - - root.m_iRestartNew++; - } - } - else - root.m_sURL = ""; - - } - else - { - showVideoFilter.m_bFrameNew = true; - - root.m_iDataFPS = root.m_iFPS; - - //print("fVideoReload 5.0: " + root.m_iDataFPS); - - if(root.m_iDataFPS > 0 && root.m_iDataFPS < 3 && root.m_sURL.length > 0) - { - root.m_iLowFPS++; - if(root.m_iLowFPS > 3) - { - //print("fVideoReload 5.1: "); - - root.m_iLowFPS = 0; - root.fPlay("", 0) - //root.fPlay(root.m_sURL, 1) - contextMain.slReConnectToDesktop(); - //root.fPlay("gst-pipeline: rtspsrc location=rtsp://127.0.0.1:8504/live/111 ! queue ! decodebin3 ! videoconvert ! qtvideosink", 1) - } - } - else - root.m_iLowFPS = 0; - - root.m_iFPS = 0; - - if(root.m_iShowFPS == 60) - root.m_iShowFPS = 0; - - } - - showVideoFilter.m_iFramePrew = -1; - - - if(root.m_iShowFPS < 60) - root.m_iShowFPS++; - - - } - - - function fPlay(_sUrl, _iPlay) - { - camera.source = "" - - root.m_sURL = _sUrl; - - //print("fPlay 0: url = " + root.m_sURL); - - if(_iPlay > 0) - { - - if(_iPlay == 1) - { - if(root.m_sURL.length > 0) - root.m_iShowFPS = 60; - - - camera.source = root.m_sURL; - camera.play(); - } - else - camera.pause() - } - else - { - camera.stop(); - } - - if(root.m_sURL.length > 0) - showVideoFilter.m_iFramePrew = -1; - else - showVideoFilter.m_iFramePrew = 0; - } - - - Item { - id: id_itBoxVideo - anchors.centerIn: parent - - height: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW / m_dKWH : m_iTempFrameH - width: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW : m_iTempFrameH * m_dKWH - - - property int m_iFrameW: videoOutput.sourceRect.width - property int m_iFrameH: videoOutput.sourceRect.height - property int m_iTempFrameH: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.height : m_iFrameH - property double m_dKWH : m_iFrameW / m_iFrameH - property int m_iDrawFrameW: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.width : m_iFrameW - - - MouseArea - { - id: id_mouseVideo - anchors.fill: parent - hoverEnabled: true - - property var a_bBtPress: [false, false] - property bool a_bBtLeftPressed: false - - - acceptedButtons: Qt.LeftButton | Qt.RightButton - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - - contextMain.slSendMouseEvent(4, wheel.angleDelta.y < 0 ? 0 : 1 - , 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - - onPressed: (mouse)=> - { - root.parent.focus = true; - - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = true; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtPress[0] = true; - - a_bBtLeftPressed = true; - } - - if(root.m_sURL.length > 0 && root.m_iPlayRestart < 2) - contextMain.slSendMouseEvent(1, a_bBtLeftPressed, 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onPressed 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onReleased: (mouse)=> - { - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = false; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtLeftPressed = true; - - a_bBtPress[0] = false; - } - - contextMain.slSendMouseEvent(2, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onReleased 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onPositionChanged: - { - //print("onPositionChanged 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - //print("onReleased 5: " + id_imVideo.width + " / " + mouseX + " / " + (100 * mouseX/id_imVideo.width) + " / " + 100 * (100 * mouseX/id_imVideo.width)); - - if(root.m_sURL.length > 0 && root.m_iPlayRestart < 2) - contextMain.slSendMouseEvent(3, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - } - - - MediaPlayer { - id: camera - source: "" - //source: "rtmp://localhost/111/ live=1" - //source: "gst-pipeline: rtmpsrc location='rtmp://localhost/111/ live=1' ! queue ! decodebin3 ! videoconvert ! qtvideosink" - //source: "gst-pipeline: rtmpsrc location='rtmp://localhost/111/ live=1' ! queue ! decodebin3 ! videoconvert ! vpudec ! fpsdisplaysink video-sink=glimagesink - - //autoPlay: true - - - onStatusChanged: - { - var a_sVar = ""; - - - - print("player status: code " + status); - - // if(status != 2 && status != 6) - // print("player 1: status: \n src: " + source + "\n code: " + status + "\n " + a_sVar); - - // print("player 2: " + source.toString().length); - - - } - - onErrorChanged: - { - var a_sVar = ""; - - //print("player error: \n src: " + source + "\n code: " + error + "\n " + a_sVar + "\n " + errorString); - - } - - } - - VideoOutput { - id: videoOutput - anchors.fill: parent - source: camera - //visible: camera.availableCamera && camera.cameraStatus == Camera.ActiveStatus - autoOrientation: true - //fillMode: VideoOutput.PreserveAspectCrop - //rotation: initialRotation() - - filters: [ showVideoFilter ] - } - - MyFilter { - id: showVideoFilter - - property bool m_bFrameNew: false - property int m_iFramePrew: 0 - - onFrameNumChanged : - { - root.m_iRestartNew = 0; - root.m_iPlayRestart = 0; - showVideoFilter.m_bFrameNew = true; - showVideoFilter.m_iFramePrew = frameNum; - - root.m_iFPS++; - - //print("showVideoFilter 0: " + frameNum) - //print("showVideoFilter 1: " + m_iFramePrew + " / " + m_bFrameNew) - - } - - } - - - - } - - Item { - id: id_itLoading - anchors.right: parent.right - anchors.rightMargin: y - y:2 - rotation: 0 - visible: root.m_sURL.length > 0 && !showVideoFilter.m_bFrameNew ? true : false - - property int size: 40 - property int lineWidth: 5 - property real value: 0 - - property color primaryColor: "#99ff0000" - property color secondaryColor: "#00e0e0e0" - - property int animationDuration: 1000 - - width: size - height: size - - onValueChanged: { - canvas.degree = value * 360; - } - - Canvas { - id: canvas - - property real degree: 250 - - anchors.fill: parent - antialiasing: true - - onDegreeChanged: { - requestPaint(); - } - - onPaint: { - var ctx = getContext("2d"); - - var x = id_itLoading.width/2; - var y = id_itLoading.height/2; - - var radius = id_itLoading.size/2 - id_itLoading.lineWidth - var startAngle = (Math.PI/180) * 270; - var fullAngle = (Math.PI/180) * (270 + 360); - var progressAngle = (Math.PI/180) * (270 + degree); - - ctx.reset() - - ctx.lineCap = 'round'; - ctx.lineWidth = id_itLoading.lineWidth; - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, fullAngle); - ctx.strokeStyle = id_itLoading.secondaryColor; - ctx.stroke(); - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, progressAngle); - ctx.strokeStyle = id_itLoading.primaryColor; - ctx.stroke(); - } - - // Behavior on degree { - // NumberAnimation { - // duration: root.animationDuration - // } - // } - } - - Timer - { - interval: 50; running: parent.visible; repeat: true - onTriggered: - { - parent.rotation += 30; - - if(parent.rotation > 360) - { - parent.rotation -= 360; - } - } - } - - } - - - Rectangle - { - x: 3 - y: 3 - width: children[0].width + 5 - height: children[0].height + 10 - visible: false //root.m_sURL.length > 0 && root.m_iShowFPS > 0 && root.m_iShowFPS < 30 && !id_itLoading.visible ? true : false - - Text { - anchors.centerIn: parent - text: root.m_iDataFPS + qsTr(" fps") - font.bold: true - font.pixelSize: 20 - color: "#ff0000" - } - } - -} diff --git a/src/qml5/playerRTSP.qml b/src/qml5/playerRTSP.qml deleted file mode 100644 index d284ee9..0000000 --- a/src/qml5/playerRTSP.qml +++ /dev/null @@ -1,190 +0,0 @@ -import QtQuick 2.12 -import QtMultimedia 5.12 - -Item { - id: root - objectName: "obPlayerRtsp" - anchors.fill: parent - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - - MouseArea - { - id: id_mouseMain - anchors.fill: parent - - property int a_iMousStartX : 0 - property int a_iMousStartY : 0 - property int a_iMove : 0 - property bool a_bDoubleClicked: false - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - } - - onPositionChanged: - { - if(id_tMouseMainLongPress.running) - { - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - } - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > Math.abs( mouseX - id_mouseMain.a_iMousStartX )) - { - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > 5) - { - id_mouseMain.a_iMousStartY = mouseY - } - } - else - { - id_mouseMain.a_iMove = mouseX - id_mouseMain.a_iMousStartX; - id_mouseMain.a_iMousStartX = mouseX; - - } - - - } - - onPressed: (mouse)=> - { - id_mouseMain.a_iMousStartX = mouseX; - id_mouseMain.a_iMousStartY = mouseY; - - if(!id_tMouseMainDoubleClicked.running) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.start() - } - else - { - a_bDoubleClicked = true; - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.start(); - } - - onReleased: (mouse)=> - { - id_mouseMain.a_iMousStartX = 0; - id_mouseMain.a_iMousStartY = 0; - - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - else - { - if( id_mouseMain.a_iMove == 0 ) - { - - - } - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - - id_mouseMain.a_iMove = 0; - } - - Timer - { - id: id_tMouseMainDoubleClicked - interval: 200; - repeat: false - - onTriggered: - { - } - } - - Timer - { - id: id_tMouseMainLongPress - interval: 200; - repeat: true - - property int m_iLongPress: 0 - - onTriggered: - { - m_iLongPress++; - - if(m_iLongPress > 4) - { - m_iLongPress = 0; - stop(); - } - } - } - - } - - function fSetUrl(_sUrl) - { - print(_sUrl); - - id_vRTSP.source = _sUrl; - id_vRTSP.source = "gst-launch-1.0 /udpsrc port=5012 ! application/x-rtp, encoding-name=H264, payload=96 ! rtph264depay ! queue ! h264parse ! avdec_h264 ! videoconvert ! autovideosink" - id_vRTSP.play(); - } - - - -// Video { -// id: id_vRTSP -// anchors.fill: parent -// source: "" -// autoPlay: false -// opacity: 1.0 -// fillMode: Image.Stretch -// muted: false -// } - - MediaPlayer { - id: id_vRTSP - source: "" - muted: false - autoPlay: false - } - - VideoOutput { - id: camera1 - anchors.fill: parent - source: id_vRTSP - } - -} diff --git a/src/qml5/userUI.qml b/src/qml5/userUI.qml deleted file mode 100644 index 0d19807..0000000 --- a/src/qml5/userUI.qml +++ /dev/null @@ -1,250 +0,0 @@ -import QtQuick 2.12 -import QtMultimedia 5.15 - -Rectangle { - id: root - objectName: "obUserUI" - anchors.fill: parent - color: "#0047AB" - //color: "#ff0000" - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - - MouseArea - { - id: id_mouseMain - anchors.fill: parent - - property int a_iMousStartX : 0 - property int a_iMousStartY : 0 - property int a_iMove : 0 - property bool a_bDoubleClicked: false - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - } - - onPositionChanged: - { - if(id_tMouseMainLongPress.running) - { - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - } - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > Math.abs( mouseX - id_mouseMain.a_iMousStartX )) - { - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > 5) - { - id_mouseMain.a_iMousStartY = mouseY - } - } - else - { - id_mouseMain.a_iMove = mouseX - id_mouseMain.a_iMousStartX; - id_mouseMain.a_iMousStartX = mouseX; - - } - - - } - - onPressed: (mouse)=> - { - id_mouseMain.a_iMousStartX = mouseX; - id_mouseMain.a_iMousStartY = mouseY; - - if(!id_tMouseMainDoubleClicked.running) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.start() - } - else - { - a_bDoubleClicked = true; - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.start(); - } - - onReleased: (mouse)=> - { - id_mouseMain.a_iMousStartX = 0; - id_mouseMain.a_iMousStartY = 0; - - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - else - { - if( id_mouseMain.a_iMove == 0 ) - { - - - } - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - - id_mouseMain.a_iMove = 0; - } - - Timer - { - id: id_tMouseMainDoubleClicked - interval: 200; - repeat: false - - onTriggered: - { - } - } - - Timer - { - id: id_tMouseMainLongPress - interval: 200; - repeat: true - - property int m_iLongPress: 0 - - onTriggered: - { - m_iLongPress++; - - if(m_iLongPress > 4) - { - m_iLongPress = 0; - stop(); - } - } - } - - } - - - Loader { - id: id_loadPlayer - anchors.fill: parent - focus: true - - source: contextMain.slPlayerVar() === 0 ? "playerNew.qml" : "player.qml"; - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadPlayer::slotData 0: " + _iId) - - - } - - } - - Loader { - id: id_loadMenu - anchors.fill: parent - - source:"menu.qml"; - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadPlayer::slotData 0: " + _iId) - - - } - - } - - Loader { - id: id_loadMessageStatus - anchors.fill: parent - - source:"messageStatus.qml"; - - visible: false - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadMessageStatus::slotData 0: " + _iId) - - switch(_iId) - { - case 0: - id_loadMessageStatus.visible = false; - break; - } - - - } - - } - -} diff --git a/src/qml6.qrc b/src/qml6.qrc deleted file mode 100644 index e79d34c..0000000 --- a/src/qml6.qrc +++ /dev/null @@ -1,20 +0,0 @@ - - - qml6/menu.qml - qml6/menu_ComandLine.qml - qml6/menu_Desktop.qml - qml6/menu_FileCopy.qml - qml6/menu_Login.qml - qml6/menu_Server.qml - qml6/menu_Support.qml - qml6/menu_VideoQuality.qml - qml6/menu_ViewSize.qml - qml6/messageStatus.qml - qml6/MyCheckBox.qml - qml6/player.qml - qml6/playerNew.qml - qml6/playerRTSP.qml - qml6/userUI.qml - qml6/main.qml - - diff --git a/src/qml6/MyCheckBox.qml b/src/qml6/MyCheckBox.qml deleted file mode 100644 index 214c82e..0000000 --- a/src/qml6/MyCheckBox.qml +++ /dev/null @@ -1,35 +0,0 @@ -import QtQuick -import QtQuick.Controls.Basic - - -CheckBox { - id: id_cbCast - - indicator: Rectangle { - implicitWidth: 28 - implicitHeight: implicitWidth - x: id_cbCast.leftPadding - y: parent.height / 2 - height / 2 - radius: 3 - border.color: id_cbCast.down ? "#80000000" : "#000000" - - Rectangle { - width: parent.width - 10 - height: parent.height - 10 - anchors.centerIn: parent - radius: 2 - color: id_cbCast.down ? "#80000000" : "#000000" - visible: id_cbCast.checked - } - } - - contentItem: Text { - text: id_cbCast.text - font.bold: true - font.pixelSize: 16 - opacity: enabled ? 1.0 : 0.3 - color: id_cbCast.down ? "#80000000" : "#000000" - verticalAlignment: Text.AlignVCenter - leftPadding: id_cbCast.indicator.width + id_cbCast.spacing - } -} diff --git a/src/qml6/main.qml b/src/qml6/main.qml deleted file mode 100644 index 4261be4..0000000 --- a/src/qml6/main.qml +++ /dev/null @@ -1,84 +0,0 @@ -import QtQuick 2.15 -import QtQuick.Window 2.15 - -Window { - x: 70 - y:30 - width: 900 - height: 700 - //visibility: Window.Maximized - visible: true - title: "" - - - Component.onCompleted: - { - id_tStart.start(); - - title = contextMain.slAppName() - } - - Component.onDestruction: - { - contextMain.slotDestruction(); - } - - function fFullScreen(_bVar) - { - if(visibility != Window.FullScreen) - visibility = Window.FullScreen - else - visibility = Window.Maximized - } - - - Loader { - id: id_loadUserUI - anchors.fill: parent - focus: true - - source:"userUI.qml"; - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadUserUI::slotData 0: " + _iId) - - - } - - } - - - Timer - { - id: id_tStart - interval: 1000; running: false; repeat: false - onTriggered: - { - contextMain.slotFindCheldren(); - } - } - - Timer - { - id: id_tCurrentTime - interval: 1000; running: true; repeat: true - onTriggered: - { - contextMain.slotTimer() - } - } - -} diff --git a/src/qml6/menu.qml b/src/qml6/menu.qml deleted file mode 100644 index a0cbb9d..0000000 --- a/src/qml6/menu.qml +++ /dev/null @@ -1,838 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls.Basic - -Item { - id: root - objectName: "obMenu" - anchors.fill: parent - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - onHeightChanged: - { - if(id_loadMenuItem.visible) - { - id_loadMenuItem.fHeightUpdate(); - } - } - - MouseArea - { - anchors.fill: id_colMenu - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - function fConnectClient(_bVar) - { - id_Stream.m_bConnectClient = _bVar; - } - - function fConnectServer(_iVar) - { - //print("fConnectServer 0: " + _iVar ) - - if(_iVar == 1) - { - id_Connect.color = "#0096FF"; - id_itLogin.enabled = true; - id_recConnecting.visible = false; - } - else - { - id_Connect.color = "#ccffffff"; - id_itLogin.enabled = false; - - if(_iVar == 2) - id_recConnecting.visible = true; - else - id_recConnecting.visible = false; - } - - } - - function fFileCopyVisible(_bVar) - { - id_itFileCopy.enabled = _bVar; - - if(!_bVar && id_loadMenuItem.m_iPage == 4) - id_loadMenuItem.m_iPage = 0; - - } - - function fStream(_bVar) - { - id_itComandLine.m_bAcvive = !_bVar; - //id_itVideoQuality.enabled = _bVar; - } - - Column - { - id: id_colMenu - anchors.horizontalCenter: parent.horizontalCenter - - Rectangle - { - id: id_recMenuTab - anchors.horizontalCenter: parent.horizontalCenter - width: children[1].width - height: id_TitleM.visible ? 50 : children[1].height + 3 - color: id_loadMenuItem.m_iPage == 0 ? - id_TitleM.visible ? "#808080" : "#99808080" - : "#000000" - - border.color: id_TitleM.visible ? "#000000" : "#00000000" - border.width: 1 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - if(id_loadMenuItem.m_iPage == 0) - { - if(id_Open.rotation == 0) - { - id_Open.rotation = 180; - } - else - { - id_Open.rotation = 0; - } - } - - id_loadMenuItem.m_iPage = 0; - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Row - { - anchors.verticalCenter: parent.verticalCenter - Row - { - anchors.verticalCenter: parent.verticalCenter - Item { - width: 3 - height: 1 - } - - Rectangle - { - id: id_Connect - anchors.verticalCenter: parent.verticalCenter - color: "#ccffffff" - width: 8 - height: width - border.color: "#90000000" - } - - Text { - id: id_Open - anchors.verticalCenter: parent.verticalCenter - text: qsTr(" ^ ") - font.bold: true - font.pixelSize: 14 - color: "#ccffffff" - rotation: 180 - - } - - Rectangle - { - id: id_Stream - anchors.verticalCenter: parent.verticalCenter - color: id_Stream.m_bConnectClient ? "#ff0000" : "#ccffffff" - width: id_Connect.width - height: width - border.color: id_Connect.border.color - - property bool m_bConnectClient: false - } - - Item { - width: 5 - height: 1 - } - - } - - Text { - id: id_TitleM - width: 110 - text: qsTr("Menu") - horizontalAlignment: Text.AlignHCenter - font.bold: true - font.pixelSize: 24 - color: "#ffffff" - visible: id_Open.rotation == 0 ? true : false - } - } - - Rectangle - { - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - //anchors.bottomMargin: 1 - width: parent.width - 2 - height: 2 - color: "#ffffff" - visible: id_TitleM.visible - } - - Rectangle - { - id: id_recConnecting - anchors.right: parent.left - anchors.rightMargin: 2 - anchors.verticalCenter: parent.verticalCenter - width: children[0].width + 10 - height: parent.children[1].height + 3 - color: "#90ff0000" - visible: false - - Text { - anchors.centerIn: parent - text: qsTr("connecting... ") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - } - - Rectangle - { - width: parent.width - height: id_colData.visible ? children[0].height + 2 : 0 - color: id_recMenuTab.color - visible: id_TitleM.visible - - border.color: "#000000" - border.width: 1 - - clip: true - - onVisibleChanged: - { - if(!visible) - id_loadMenuItem.m_iPage = 0; - } - - Flickable { - x: 0 - width: parent.width - 2 * x - height: id_colData.height + id_recMenuTab.height < root.height - 10 ? id_colData.height : root.height - id_recMenuTab.height - 10 - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 0) : parent.width - visible: !id_loadMenuItem.visible - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 3; - } - - onPositionChanged: - (mouse)=> - { - - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Server") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - id: id_itLogin - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 1; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Login") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - enabled: id_itLogin.enabled - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 2; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Desktop") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - Item { - id: id_itFileCopy - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - //visible: false - enabled: false - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 4; - - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("File copy") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - id: id_itComandLine - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - //enabled: id_itFileCopy.enabled && m_bAcvive ? true : false - enabled: id_itFileCopy.enabled ? true : false - - property bool m_bAcvive: false - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 6 - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Command line") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - id: id_itVideoQuality - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - //enabled: false; - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 7; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Video quality") - font.bold: true - font.pixelSize: 18 - color: parent.enabled ? "#ffffff" : "#30000000" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 5; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("View size") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - Item { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - 6 - height: 50 - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_loadMenuItem.m_iPage = 8; - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Support") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - opacity: parent.children[0].pressed ? 0.5 : 1.0 - } - - Rectangle - { - anchors.bottom: parent.bottom - width: parent.width - height: 1 - color: "#ffffff" - } - - } - - - - Item { - width: 1 - height: 5 - } - - } - - } - } - - } - - - - Loader { - id: id_loadMenuItem - y: id_recMenuTab.height - 2 - width: id_loadMenuItem.m_iPage == 6 ? root.width - : 400 >= root.width ? root.width - 10 : 400 - anchors.horizontalCenter: parent.horizontalCenter - height: parent.height - id_colMenu.children[0].height - - - visible: m_iPage == 0 ? false : true - active: m_iPage == 0 ? false : true - source: m_iPage == 0 ? "" - : m_iPage == 1 ? "menu_Login.qml" - : m_iPage == 2 ? "menu_Desktop.qml" - : m_iPage == 3 ? "menu_Server.qml" - : m_iPage == 4 ? "menu_FileCopy.qml" - : m_iPage == 5 ? "menu_ViewSize.qml" - : m_iPage == 6 ? "menu_ComandLine.qml" - : m_iPage == 7 ? "menu_VideoQuality.qml" - : "menu_Support.qml" - - property int m_iPage: 0 - - onLoaded: - { - item.signalData.connect(slotData) - - if(id_loadMenuItem.m_iPage == 3) - item.fConnect(id_itLogin.enabled) - - fHeightUpdate(); - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadMenuItem::slotData 0: " + _iId) - - switch(_iId) - { - case 0: - id_loadMenuItem.m_iPage = 0; - break; - case 1: - fHeightUpdate(); - break; - } - - } - - function fHeightUpdate() - { - if(id_loadMenuItem.m_iPage == 6) - id_loadMenuItem.height = parent.height - y; - else - { - if(parent.height - id_colMenu.children[0].height < id_loadMenuItem.item.m_iH ) - { - id_loadMenuItem.height = parent.height - id_colMenu.children[0].height; - } - else - { - id_loadMenuItem.height = id_loadMenuItem.item.m_iH - } - } - } - - } - - -} diff --git a/src/qml6/menu_ComandLine.qml b/src/qml6/menu_ComandLine.qml deleted file mode 100644 index 763eec6..0000000 --- a/src/qml6/menu_ComandLine.qml +++ /dev/null @@ -1,608 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 - -Rectangle { - id: root - objectName: "obComandLine" - anchors.fill: parent - color: "#808080" - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - parent.height = parent.parent.height; - - id_tiReguest.text = ""; - - if(!id_tiReguest.cursorVisible) - { - id_tiReguest.cursorPosition = id_tiReguest.text.length; - id_tiReguest.cursorVisible = true - id_tiReguest.forceActiveFocus(); - } - - - } - - Component.onDestruction: - { - - } - - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - function fResponse(_iVar, _sData) - { - id_tiResponse.text += _sData; - id_tiResponse.cursorPosition = id_tiResponse.text.length; - id_svResp.scrollToBottom(); - } - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Command line") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Column - { - id: id_colData - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - - Item { - width: 1 - height: 20 - } - - Column - { - width: parent.width - - Text { - text: qsTr("Input:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - font.underline: true - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiReguest.cursorVisible) - { - id_tiReguest.cursorPosition = id_tiReguest.text.length; - id_tiReguest.cursorVisible = true - id_tiReguest.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiReguest.selectAll(); - } - } - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: parent.width - height: root.height/8 - color: "#ffffff" - - - - ScrollView { - anchors.fill: parent - rightPadding: 7 - - - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AlwaysOn - - TextArea { - id: id_tiReguest - wrapMode: Text.Wrap - - text: "" - color: "#000000" - font.pixelSize: 16 - - selectByMouse: true - - clip: true - - onTextChanged: - { - - } - -// Keys.onPressed: -// (event)=> -// { -// if(event.key == ) -// contextMain.slSendKeyEvent(1, event.key, event.text); -// event.accepted = true; -// } - - Keys.onReturnPressed: { - id_recReguest.fPress(); - } - Keys.onEnterPressed: { - id_recReguest.fPress(); - } - - } - } - - - - } - } - - Item { - width: 1 - height: 10 - } - - Item - { - width: parent.width - height: 50 - - Rectangle - { - id: id_recReguest - width: parent.width/3 - height: 40 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recReguest.fPress(); - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - function fPress() - { - if(id_tiReguest.text.length < 2) - return; - - if(id_tiResponse.text.lastIndexOf("->") != id_tiResponse.text.length - 2) - { - id_tiResponse.text += "\n->"; - } - - id_tiResponse.text += id_tiReguest.text - id_tiResponse.text += "\r\n-BEGIN------------------------------------\r\n"; - id_tiResponse.cursorPosition = id_tiResponse.text.length; - id_svResp.scrollToBottom(); - - if(id_chkCyrillic.checked) - contextMain.slComandLine(id_tiReguest.text, 2); - else - contextMain.slComandLine(id_tiReguest.text, 1); - - // id_tiReguest.text = ""; - // id_tiReguest.cursorPosition = id_tiReguest.text.length; - - } - - Text { - anchors.centerIn: parent - text: qsTr("Request") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - - Rectangle - { - width: parent.width/3 - height: 40 - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - contextMain.slComandLine("stopRun", 1); - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Kill") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - height: 1 - color: "#000000" - } - } - - - Item { - width: 1 - height: 10 - } - - } - - Column - { - width: id_colData.width - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: id_recCancel.top - anchors.bottomMargin: 10 - visible: children[2].height > 0 ? true : false - - Item { - width: parent.width - height: children[0].height > children[1].height ? children[0].height : children[1].height - - Text { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Output:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - font.underline: true - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiResponse.cursorVisible) - { - id_tiResponse.cursorPosition = id_tiResponse.text.length; - id_tiResponse.cursorVisible = true - id_tiResponse.forceActiveFocus(); - } - } - - } - } - - MyCheckBox { - id: id_chkCyrillic - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - text: qsTr("use cyrillic") - //font.bold: true - font.pixelSize: 18 - } - - } - - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: parent.width - height: root.height - (id_colData.y + id_colData.height) - id_recCancel.height - - parent.children[0].height - parent.children[1].height - - parent.children[3].height - parent.children[4].height - 10 - color: "#ffffff" - - - - ScrollView { - id: id_svResp - anchors.fill: parent - rightPadding: 7 - - - contentWidth: children.implicitWidth - contentHeight: children.implicitHeight - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - ScrollBar.vertical.policy: ScrollBar.AlwaysOn - clip: true - - function scrollToBottom() { - ScrollBar.vertical.position = 1.0 - ScrollBar.vertical.size - } - - - TextArea { - id: id_tiResponse - wrapMode: Text.Wrap - - text: "" - color: "#000000" - font.pixelSize: 16 - selectByMouse: true - - clip: true - - onTextChanged: - { - - } - } - } - - - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: children[1].width + 40 - height: 40 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_tiResponse.text = ""; - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("C lear") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/menu_Desktop.qml b/src/qml6/menu_Desktop.qml deleted file mode 100644 index 5ff68cd..0000000 --- a/src/qml6/menu_Desktop.qml +++ /dev/null @@ -1,889 +0,0 @@ -import QtQuick -import QtQuick.Controls.Basic - -Rectangle { - id: root - objectName: "obMenuDesktop" - width: 300 - color: "#808080" - height: parent.height - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - property bool m_bUserSelected: false - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - if(!id_tiLog.cursorVisible) - { - id_tiLog.cursorPosition = id_tiLog.text.length; - id_tiLog.cursorVisible = true - id_tiLog.forceActiveFocus(); - } - } - - Component.onDestruction: - { - id_tSearch.stop(); - - id_lmDesktopUser.clear(); - } - - function fChkComandLine(_bVar) - { - if(_bVar) - { - id_chkScreen.checked = false - id_chkComandLine.checked = true - } - else - { - - id_chkScreen.checked = true - id_chkComandLine.checked = false - } - } - - function fConnect(_bVar) - { - if(_bVar) - id_tConnect.stop() - else - id_tConnect.start() - } - - function fAddDesktop(_sUser, _sDesctopId) - { - //print("fAddDesktop 0: " + _sUser + " / " + _sDesctopId) - - if(_sUser == "0" && _sDesctopId == "0") - { - id_lvUser.m_bNewSelect = true; - var a_bSel = false; - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - if( id_lmDesktopUser.get(s).obOld ) - { - id_lmDesktopUser.remove(s); - } - else - { - if(id_lmDesktopUser.get(s).obId === id_lvUser.m_sIdD) - a_bSel = true; - } - } - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - id_lmDesktopUser.get(s).obOld = true; - } - - root.m_bUserSelected = a_bSel; - - return; - } - - id_lvUser.m_bNewSelect = false; - - id_tSearch.m_iSearch = 0; - - var a_bAdd = true; - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - //print("fAddDesktop 4.0: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - // if(id_lmDesktopUser.get(s).obTitle.indexOf( _sUser ) >= 0 ) - // { - // print("fAddDesktop 4.1: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - // id_lmDesktopUser.remove(s); - // } - // else - { - //print("fAddDesktop 4.2: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - if(id_lmDesktopUser.get(s).obId === _sDesctopId ) - { - //print("fAddDesktop 4.3: " + id_lmDesktopUser.get(s).obTitle + " / " + _sUser) - - id_lmDesktopUser.get(s).obOld = false; - a_bAdd = false; - - break; - } - - } - } - - if(a_bAdd) - { - //print("fAddDesktop 6.0: " + _sDesctopId + " / " + _sUser) - - if(_sDesctopId == id_lvUser.m_sIdD && id_lvUser.m_sLoginD === _sUser) - { - //print("fAddDesktop 6.1: ") - - id_lmDesktopUser.append({ obId: _sDesctopId - , obTitle: _sUser - , obSelect: true - , obScrollW: 0 - , obOld: false - }) - - root.m_bUserSelected = true; - } - else - { - if(id_lvUser.m_sIdD.length == 0 - && id_tiLog.text === _sUser) - { - //print("fAddDesktop 6.2: ") - - id_lmDesktopUser.append({ obId: _sDesctopId - , obTitle: _sUser - , obSelect: true - , obScrollW: 0 - , obOld: false - }) - - id_lvUser.m_sIdD = _sDesctopId; - id_lvUser.m_sLoginD = _sUser; - root.m_bUserSelected = true; - } - else - { - //print("fAddDesktop 6.3: ") - - id_lmDesktopUser.append({ obId: _sDesctopId - , obTitle: _sUser - , obSelect: false - , obScrollW: 0 - , obOld: false - }) - } - } - } - - //print("fAddDesktop 10: " + "---------------------------------------------") - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Desktop") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 20 - } - - Column - { - width: parent.width - - Item - { - width: parent.width - height: children[0].height - - Text { - text: qsTr("Search login:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiLog.cursorVisible) - { - id_tiLog.cursorPosition = id_tiLog.text.length; - id_tiLog.cursorVisible = true - id_tiLog.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiLog.selectAll(); - } - } - } - - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - anchors.right: parent.right - //anchors.rightMargin: 5 - anchors.left: parent.children[0].right - anchors.leftMargin: 5 - - TextInput { - id: id_tiLog - width: parent.width - 4 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - Component.onCompleted: - { - text = contextMain.slDeskLogin(); - } - - - onTextChanged: - { - id_lvUser.m_bNewSelect = true; - fSearch(); - } - - onAccepted: - { - id_lvUser.m_bNewSelect = true; - fSearch(); - } - - function fSearch() - { - id_tSearch.m_iSearch = 0; - - if(id_lvUser.m_bNewSelect) - { - id_lvUser.m_bNewSelect = false; - id_lmDesktopUser.clear(); - } - - if(id_tiLog.text.length > 0) - { - root.fAddDesktop("0", "0"); - contextMain.slSearchDesktop(id_tiLog.text); - } - } - - } - } - - - } - - Timer - { - id: id_tSearch - interval: 500; running: true; repeat: true - property int m_iSearch: 0 - onTriggered: - { - m_iSearch++; - - if(m_iSearch > 4) - { - m_iSearch = 0; - id_tiLog.fSearch(); - } - } - } - - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: parent.width - height: 1 - color: "#90000000" - } - - ListView { - id: id_lvUser - width: parent.width; - height: 140 - clip: true - - property string m_sLoginD: "" - property string m_sIdD: "" - property bool m_bNewSelect: false - - ScrollBar.vertical: ScrollBar - { - policy: size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - //visible: size < 1 - - onSizeChanged: - { - for(var i = 0; i < id_lmDesktopUser.count; i++) - { - if(size < 1) - { - id_lmDesktopUser.get(i).obScrollW = this.width + 1; - } - else - { - id_lmDesktopUser.get(i).obScrollW = 0; - } - } - } - } - - ListModel { - id: id_lmDesktopUser - } - - - model: id_lmDesktopUser - delegate: id_comItem - - Component { - id: id_comItem - Item { - width: parent == null ? 1 : parent.width - obScrollW - height: 40 - - - Item - { - anchors.fill: parent - opacity: children[0].pressed ? 0.5 : 1.0 - - MouseArea { - anchors.fill: parent - - onPressed: - (mouse)=> - { - for(var i = 0, s = id_lmDesktopUser.count; i < s; i++) - { - id_lmDesktopUser.get(i).obSelect = false; - } - - obSelect = true; - root.m_bUserSelected = true; - - id_lvUser.m_sLoginD = obTitle - id_lvUser.m_sIdD = obId - - if(!id_tiPass.cursorVisible) - { - id_tiPass.cursorPosition = id_tiPass.text.length; - id_tiPass.cursorVisible = true - id_tiPass.forceActiveFocus(); - } - } - } - - Text { - x: 5 - width: parent.width - 2*x - anchors.verticalCenter: parent.verticalCenter - //font.bold: true - font.pointSize: 14 - text: obTitle // + "-" + obId + "-" + index - color: obSelect ? "#80000000" : "white" - clip: true - } - - // Rectangle - // { - // width: parent.width - // height: 1 - // anchors.bottom: parent.bottom - // color: "#cc000000" - // } - - } - } - } - - } - - Rectangle - { - width: parent.width - height: 1 - color: "#90000000" - } - - Item { - width: 1 - height: 15 - } - - - Item - { - width: parent.width - height: children[0].height - - Text { - text: qsTr("Password:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPass.cursorVisible) - { - id_tiPass.cursorPosition = id_tiPass.text.length; - id_tiPass.cursorVisible = true - id_tiPass.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPass.selectAll(); - id_tiLog.update() - } - } - } - - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - anchors.right: parent.right - //anchors.rightMargin: 5 - anchors.left: parent.children[0].right - anchors.leftMargin: 5 - - TextInput { - id: id_tiPass - width: parent.width - 4 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - Component.onCompleted: - { - text = contextMain.slDeskPassword(); - } - - } - } - - - } - - Item { - width: 1 - height: 20 - } - - Item { - width: parent.width - height: 50 - - - MyCheckBox { - id: id_chkScreen - checked: true - text: qsTr("Screen capture") - font.bold: true - font.pixelSize: 14 - - onPressed: - { - id_chkComandLine.checked = false - id_chkScreen.checked = false - - //id_recNewConnect.fConnect(true); - - } - - - } - - MyCheckBox { - id: id_chkComandLine - anchors.right: parent.right - text: qsTr("Command line") - font.bold: true - font.pixelSize: 14 - - Component.onCompleted: - { - if(!contextMain.slComandLineStatus()) - { - fChkComandLine(false); - } - else - { - fChkComandLine(true); - } - } - - - - - onPressed: - { - id_chkScreen.checked = false - id_chkComandLine.checked = false - - //id_recNewConnect.fConnect(false); - } - } - } - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - id: id_recNewConnect - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recNewConnect.fConnect(id_chkScreen.checked); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("New connection") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - - function fConnect(_bVar) - { - //print("fConnect 0: " + id_lvUser.m_sLoginD + " / " + id_tiPass.text + " / " + root.m_bUserSelected) - - if( (root.m_bUserSelected - && (id_lvUser.m_sLoginD.length > 0 && id_tiPass.text.length > 0) - //|| (contextMain.slDeskLogin().length > 0 && contextMain.slDeskPassword().length > 0) - ) - ) - { - var a_bSel = false; - - for(var i = 0, s = id_lmDesktopUser.count - 1; s >= i; s--) - { - if(id_lmDesktopUser.get(s).obSelect) - { - a_bSel = true - break; - } - } - - if(a_bSel) - { - contextMain.slDisConnectDesktop(0); - contextMain.slUseComandLine(!_bVar); - contextMain.slConnectToDesktop(_bVar, id_lvUser.m_sLoginD, id_tiPass.text, id_lvUser.m_sIdD); - } - else - { - contextMain.slClientControl("308", 17, "Select user..."); - } - } - else - { - if( id_lvUser.m_sLoginD.length == 0 ) - contextMain.slClientControl("308", 17, "Select user..."); - else - if( id_tiPass.text.length == 0 ) - contextMain.slClientControl("308", 17, "Password input..."); - - } - } - } - - Rectangle - { - width: 20 - height: 2 - anchors.centerIn: parent - color: "#000000" - rotation: 0 - visible: id_tConnect.running && id_lvUser.m_sLoginD.length > 0 && id_tiPass.text.length ? true : false - - Timer - { - id: id_tConnect - interval: 10; running: false; repeat: true - onTriggered: - { - parent.rotation += 5; - if(parent.rotation > 360) - parent.rotation = 5; - - if(!root.m_bUserSelected) - id_recDisConnect.fDisConnect(); - } - } - } - - Rectangle - { - id: id_recDisConnect - width: id_recNewConnect.width - height: id_recNewConnect.height - anchors.right: parent.right - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recDisConnect.fDisConnect(); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Disconnect") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - - function fDisConnect() - { - contextMain.slDisConnectDesktop(1); - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/menu_FileCopy.qml b/src/qml6/menu_FileCopy.qml deleted file mode 100644 index bcaaf60..0000000 --- a/src/qml6/menu_FileCopy.qml +++ /dev/null @@ -1,499 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.5 - -Rectangle { - id: root - objectName: "obMenuFileCopy" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - if(!id_tiFilePath.cursorVisible) - { - id_tiFilePath.cursorPosition = id_tiFilePath.text.length; - id_tiFilePath.cursorVisible = true - id_tiFilePath.forceActiveFocus(); - } - } - - Component.onDestruction: - { - - } - - function fFileWrited(_iVar, _Data) - { - //print("fFileWrited: " + _iVar + " / " + _Data) - - if(_iVar == 4) - { - id_StatusCopy.text = _Data; - - return; - } - - id_FileWrited.value = _Data/100 - - id_ProcCopy.text = (_Data + " %") - - if(_iVar == 0) - { - id_StatusCopy.text = "Invalid file path." - } - else - if(_iVar == 1) - { - id_StatusCopy.text = "" - } - else - { - if(_iVar == 2) - { - id_StatusCopy.text = "Failed copy." - } - else - { - if(_iVar == 3) - { - id_StatusCopy.text = "Success copy." - } - else - { - - } - } - } - } - - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- File copy") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 20 - } - - Column - { - width: parent.width - - Text { - text: qsTr("File path:") - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiFilePath.cursorVisible) - { - id_tiFilePath.cursorPosition = id_tiFilePath.text.length; - id_tiFilePath.cursorVisible = true - id_tiFilePath.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiFilePath.selectAll(); - } - } - } - - Item { - width: 1 - height: 5 - } - - Rectangle - { - - width: parent.width - height: children[0].height + 10 - color: "#10000000" - - - TextInput { - id: id_tiFilePath - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 14 - - clip: true - - onTextChanged: - { - if(text.length == 0) - return; - - while(text.charAt(0) == ' ') - text = text.substring(1); - - if( text.indexOf("file:///") == 0) - { - text = text.substring( ("file:///").length ); - } - } - - onAccepted: - { - } - } - } - - - } - - Item { - width: 1 - height: 30 - } - - - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - width: parent.width/2 - 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - visible: id_FileWrited.value == 0 ? true : false - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_FileWrited.value = 0; - contextMain.slFileCopy(1, id_tiFilePath.text.trim()); - - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Get file") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: parent.width/2 - 20 - height: children[1].height + 20 - anchors.right: parent.right - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - visible: id_FileWrited.value == 0 ? true : false - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_FileWrited.value = 0; - contextMain.slFileCopy(2, id_tiFilePath.text.trim()); - - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Send file") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: parent.width - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - visible: id_FileWrited.value > 0 ? true : false - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - //id_FileWrited.value = 0; - contextMain.slFileCopy(0, ""); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Stop") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - } - - Item { - width: 1 - height: 30 - visible: id_FileWrited.value - } - - ProgressBar { - id: id_FileWrited - width: parent.width - value: 0.0 - visible: value == 0 ? false : true - } - - Text { - id: id_ProcCopy - anchors.right: id_FileWrited.right - text: qsTr("") - //font.bold: true - font.pixelSize: 16 - color: "#000000" - visible: id_FileWrited.value - - } - - Item { - width: 1 - height: 30 - visible: id_StatusCopy.visible - } - - Text { - id: id_StatusCopy - width: parent.width - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("") - wrapMode: Text.Wrap - //font.bold: true - font.pixelSize: 18 - color: "#000000" - visible: text.length == 0 ? false : true - } - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/menu_Login.qml b/src/qml6/menu_Login.qml deleted file mode 100644 index 073d6a8..0000000 --- a/src/qml6/menu_Login.qml +++ /dev/null @@ -1,413 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuLogin" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - property int m_iTitleW: 110 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - id_tiLog.text = contextMain.slLogin(); - id_tiPass.text = contextMain.slPassword(); - - } - - Component.onDestruction: - { - - } - - function fConnect(_bVar) - { - if(_bVar == 1) - id_tConnect.stop() - else - id_tConnect.start() - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Your login") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - id: id_flMain - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 20 - } - - Row - { - Text { - text: qsTr("Login:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiLog.cursorVisible) - { - id_tiLog.cursorPosition = id_tiLog.text.length; - id_tiLog.cursorVisible = true - id_tiLog.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiLog.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiLog - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - } - } - } - - Item { - width: 1 - height: 15 - } - - Row - { - - Text { - text: qsTr("Password:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPass.cursorVisible) - { - id_tiPass.cursorPosition = id_tiPass.text.length; - id_tiPass.cursorVisible = true - id_tiPass.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPass.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiPass - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - } - } - - } - - Item { - width: 1 - height: 25 - } - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slConnectToServer(id_tiLog.text, id_tiPass.text); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("New connection") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: 20 - height: 2 - anchors.right: parent.right - anchors.rightMargin: 5 - anchors.verticalCenter: parent.verticalCenter - color: "#000000" - rotation: 0 - visible: id_tConnect.running - - Timer - { - id: id_tConnect - interval: 10; running: false; repeat: true - onTriggered: - { - parent.rotation += 5; - if(parent.rotation > 360) - parent.rotation = 5; - } - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/menu_Server.qml b/src/qml6/menu_Server.qml deleted file mode 100644 index 1116f3b..0000000 --- a/src/qml6/menu_Server.qml +++ /dev/null @@ -1,917 +0,0 @@ -import QtQuick -import QtQuick.Controls.Basic - -Rectangle { - id: root - objectName: "obMenuServer" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 20 - property int m_iTitleW: 120 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - id_tiIP.text = contextMain.slServerIP(); - id_tiPortTCP.text = contextMain.slPortTCP(); - id_tiRtspPort.text = contextMain.slPortRTSP(); - id_tiRtmpPort.text = contextMain.slPortRTMP(); - } - - Component.onDestruction: - { - - } - - function fConnect(_bVar) - { - if(_bVar == 1) - id_tConnect.stop() - else - id_tConnect.start() - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Server") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - id: id_flMain - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - - Column - { - Item { - width: 1 - height: 20 - } - - MyCheckBox { - id: id_chkServDev - objectName: "obChkServDev" - text: qsTr("use the developer server") - //font.bold: true - font.pixelSize: 18 - - Component.onCompleted: - { - id_chkServDev.checked = contextMain.slDevServer(); - } - - onCheckedChanged: - { - if(!id_chkServDev.checked) - { - contextMain.fUpdateServerData(); - id_tiPortTCP.text = contextMain.slPortTCP(); - id_tiRtspPort.text = contextMain.slPortRTSP(); - id_tiRtmpPort.text = contextMain.slPortRTMP(); - } - } - - } - - Item { - anchors.right: id_chkServDev.right - anchors.rightMargin: 5 - width: children[0].width - height: children[0].height - - Text { - y: -7 - text: qsTr("(limited time)") - color: "#000000" - font.pixelSize: 16 - } - } - - - - Item { - width: 1 - height: 15 - visible: id_chkServDev.checked - } - - Row - { - visible: id_chkServDev.checked - - Text { - text: qsTr("key:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiKey.cursorVisible) - { - id_tiKey.cursorPosition = id_tiKey.text.length; - id_tiKey.cursorVisible = true - id_tiKey.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiKey.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiKey - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - Component.onCompleted: - { - id_tiKey.text = contextMain.slKeyDevServer(); - } - } - } - - } - } - - Item { - width: 1 - height: 40 - } - - Column{ - visible: !id_chkServDev.checked - - Row - { - Text { - text: qsTr("password:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPassword.cursorVisible) - { - id_tiPassword.cursorPosition = id_tiPassword.text.length; - id_tiPassword.cursorVisible = true - v.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPassword.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiPassword - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - Component.onCompleted: - { - id_tiPassword.text = contextMain.slServerPassword(); - } - - } - } - - } - - Item { - width: 1 - height: 15 - } - } - - - - Row - { - Text { - text: qsTr("ip:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiIP.cursorVisible) - { - id_tiIP.cursorPosition = id_tiIP.text.length; - id_tiIP.cursorVisible = true - id_tiIP.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiIP.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiIP - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - - - - } - - Column{ - visible: !id_chkServDev.checked - - - Item { - width: 1 - height: 15 - - } - - Row - { - - Text { - text: qsTr("port:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiPortTCP.cursorVisible) - { - id_tiPortTCP.cursorPosition = id_tiPortTCP.text.length; - id_tiPortTCP.cursorVisible = true - id_tiPortTCP.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiPortTCP.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiPortTCP - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - } - - Item { - width: 1 - height: 30 - //visible: false - } - - Row - { - //visible: false - - Text { - text: qsTr("rtsp-port:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiRtspPort.cursorVisible) - { - id_tiRtspPort.cursorPosition = id_tiRtspPort.text.length; - id_tiRtspPort.cursorVisible = true - id_tiRtspPort.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiRtspPort.selectAll(); - } - } - } - - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiRtspPort - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - - } - - Item { - width: 1 - height: 15 - //visible: false - } - - Row - { - //visible: false - - Text { - text: qsTr("rtmp-port:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiRtmpPort.cursorVisible) - { - id_tiRtmpPort.cursorPosition = id_tiRtmpPort.text.length; - id_tiRtmpPort.cursorVisible = true - id_tiRtmpPort.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiRtmpPort.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiRtmpPort - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - } - } - - } - - } - - Item { - width: 1 - height: 30 - } - - Item { - width: parent.width - height: children[0].height - - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(id_chkServDev.checked) - { - if(contextMain.slIsIP(id_tiIP.text) - && id_tiKey.text.length > 7 - && id_tiPassword.text.length > 3 - ) - { - contextMain.slServerUpdateData(id_tiIP.text, "0", "0", "0", id_tiKey.text, id_tiPassword.text); - } - } - else - if(contextMain.slIsIP(id_tiIP.text) - && contextMain.slIsNumber(id_tiPortTCP.text) - && contextMain.slIsNumber(id_tiRtspPort.text) - && contextMain.slIsNumber(id_tiRtmpPort.text) - && id_tiPortTCP.text.indexOf('-') < 0 - && id_tiRtspPort.text.indexOf('-') < 0 - && id_tiRtmpPort.text.indexOf('-') < 0 - && id_tiPassword.text.length > 3 - ) - { - contextMain.slServerUpdateData(id_tiIP.text, id_tiPortTCP.text, id_tiRtspPort.text, id_tiRtmpPort.text, "xxxxxxxx", id_tiPassword.text); - } - } - } - - Text { - anchors.centerIn: parent - text: qsTr("New connection") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: 20 - height: 2 - anchors.right: parent.right - anchors.rightMargin: 5 - anchors.verticalCenter: parent.verticalCenter - color: "#000000" - rotation: 0 - visible: id_tConnect.running - - Timer - { - id: id_tConnect - interval: 100; running: false; repeat: true - onTriggered: - { - parent.rotation += 15; - if(parent.rotation > 360) - parent.rotation = 15; - } - } - } - - } - - - - - Column - { - width: parent.width - visible: !id_chkServDev.checked - - Item { - width: 1 - height: 30 - } - - Item - { - width: parent.width - height: children[1].height - - Text { - text: qsTr("low activity disconnect time:") - //width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - anchors.bottom: parent.children[1].bottom - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiTimeLA.cursorVisible) - { - id_tiTimeLA.cursorPosition = id_tiTimeLA.text.length; - id_tiTimeLA.cursorVisible = true - id_tiTimeLA.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiTimeLA.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.left: parent.children[0].right - anchors.right: parent.children[2].left - anchors.leftMargin: 10 - anchors.rightMargin: 3 - - - TextInput { - id: id_tiTimeLA - width: parent.width - 6 - anchors.centerIn: parent - - text: "0" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - } - } - - Text { - text: qsTr("sec.") - color: "#ffffff" - font.pixelSize: 20 - anchors.right: parent.right - anchors.rightMargin: 10 - anchors.bottom: parent.children[1].bottom - } - - } - - Item { - width: 1 - height: 10 - } - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slLowActivityDiscTime(id_tiTimeLA.text); - } - } - - Text { - anchors.centerIn: parent - text: qsTr(" Apply ") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/menu_Support.qml b/src/qml6/menu_Support.qml deleted file mode 100644 index dd2fd71..0000000 --- a/src/qml6/menu_Support.qml +++ /dev/null @@ -1,587 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuSupport" - width: 300 - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 10 - property int m_iTitleW: 110 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - //id_tiIP.text = contextMain.slServerIP(); - } - - Component.onDestruction: - { - - } - - onM_iHChanged: - { - signalData(1, "", "", "", "", "", "") - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Support") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - - Flickable { - id: id_flMain - x: 10 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - MouseArea - { - anchors.fill: parent - onReleased: - (mouse)=> - { - id_txtMail.focus = false - } - - } - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - - - Item { - width: 1 - height: 20 - } - - Image { - height: 100 - width: 3 * height - anchors.horizontalCenter: parent.horizontalCenter - source: "qrc:/image/baner.png" - - MouseArea { - anchors.fill: parent - - onReleased: - { - Qt.openUrlExternally(id_txtFTurl.a_link) - } - } - - } - - Item { - width: 1 - height: 5 - } - - Item { - width: parent.width - height: children[0].height - - Text { - id: id_txtFTurl - //color: "#ffffff" - font.bold: true - font.pixelSize: 20 - text: 'BypassNAT' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://in-spectrum.github.io/BypassNAT/" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.children[2].left - anchors.rightMargin: 20 - anchors.bottom: parent.children[0].bottom - text: ' GitHub ' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://github.com/In-spectrum/BypassNAT?tab=readme-ov-file" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[1].bottom - text: 'MIT license' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://github.com/In-spectrum/BypassNAT?tab=MIT-1-ov-file#" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - } - - Item { - width: 1 - height: 20 - } - - Item { - width: parent.width - height: children[0].height - - Text { - color: "#ffffff" - font.bold: true - font.pixelSize: 18 - text: "meil" - } - - TextEdit { - id: id_txtMail - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[0].bottom - text: "alexandr.deryk@gmail.com" - readOnly: true - persistentSelection: false - focus: true - } - } - - - - Column - { - width: parent.width - - Item { - width: 1 - height: 20 - } - - Text { - color: "#ffffff" - font.pixelSize: 20 - text: "was used:" - } - - Item { - width: 1 - height: 10 - } - - Item { - width: parent.width - height: children[0].height - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 20 - text: "Qt" - } - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[0].bottom - text: 'LGPL-v3 license' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://www.gnu.org/licenses/lgpl-3.0.txt" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - } - - Item { - width: 1 - height: 10 - visible: false - } - - Item { - width: parent.width - height: children[0].height - visible: false - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 20 - text: "GStreamer" - } - - Text { - color: "#ffffff" - //font.bold: true - font.pixelSize: 16 - anchors.right: parent.right - anchors.bottom: parent.children[0].bottom - text: 'LGPL-v2.1 license' - onLinkActivated: Qt.openUrlExternally(a_link) - - property string a_link: "https://github.com/GStreamer/gstreamer/blob/main/LICENSE" - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton // Don't eat the mouse clicks - cursorShape: Qt.PointingHandCursor - } - } - } - - } - - - - - - Item { - width: 1 - height: 40 - visible: false - } - - Row - { - visible: false - Text { - text: qsTr("Server IP:") - width: root.m_iTitleW - color: "#ffffff" - font.bold: true - font.pixelSize: 20 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(!id_tiIP.cursorVisible) - { - id_tiIP.cursorPosition = id_tiIP.text.length; - id_tiIP.cursorVisible = true - id_tiIP.forceActiveFocus(); - } - } - - onDoubleClicked: - (mouse)=> - { - id_tiIP.selectAll(); - } - } - } - - Rectangle - { - height: children[0].height + 4 - color: "#10000000" - anchors.bottom: parent.children[0].bottom - anchors.bottomMargin: -2 - width: id_flMain.width - parent.children[0].width - 10 - - TextInput { - id: id_tiIP - width: parent.width - 6 - anchors.centerIn: parent - - text: "" - color: "#ffffff" - font.pixelSize: 20 - - clip: true - - onTextChanged: - { - text = text.replace(" ",""); - } - - } - } - - - - } - - - Item { - width: 1 - height: 30 - } - - Item { - visible: false - width: parent.width - height: children[0].height - - - Rectangle - { - width: children[1].width + 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - if(contextMain.slIsIP(id_tiIP.text) ) - { - contextMain.slSendStatIP(id_tiIP.text); - } - } - } - - Text { - anchors.centerIn: parent - text: qsTr(" Apply ") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - Rectangle - { - width: 20 - height: 2 - anchors.right: parent.right - anchors.rightMargin: 5 - anchors.verticalCenter: parent.verticalCenter - color: "#000000" - rotation: 0 - visible: id_tConnect.running - - Timer - { - id: id_tConnect - interval: 10; running: false; repeat: true - onTriggered: - { - parent.rotation += 5; - if(parent.rotation > 360) - parent.rotation = 5; - } - } - } - - } - - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/menu_VideoQuality.qml b/src/qml6/menu_VideoQuality.qml deleted file mode 100644 index 4042db6..0000000 --- a/src/qml6/menu_VideoQuality.qml +++ /dev/null @@ -1,749 +0,0 @@ -import QtQuick -import QtQuick.Controls.Basic - -Rectangle { - id: root - objectName: "obMenuVideoQuality" - width: parent.width - color: "#808080" - height: parent.height - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - - } - - Component.onDestruction: - { - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - function fSetStatus(_iSizeF, _iFPS, _iEnvoderV, _iEncSpeed, _iBetrate, _iLatencyZ, _iStreamRTSP, _iSoundCapture) - { - switch(_iSizeF) - { - case 1: - id_rbFS2.checked = true; - break; - case 2: - id_rbFS3.checked = true; - break; - case 3: - id_rb480.checked = true; - break; - default: - id_rbFS1.checked = true; - break; - } - - id_slFPS.value = _iFPS; - - switch(_iEnvoderV) - { - case 1: - id_rbGPU.checked = true; - break; - default: - id_rbCPU.checked = true; - break; - } - - switch(_iEncSpeed) - { - case 1: - id_rbSpeedE2.checked = true; - break; - case 2: - id_rbSpeedE3.checked = true; - break; - case 3: - id_rbSpeedE4.checked = true; - break; - default: - id_rbSpeedE1.checked = true; - break; - } - - id_slBt.value = _iBetrate/10; - - id_cbLatZ.checked = _iLatencyZ; - - switch(_iStreamRTSP) - { - case 1: - id_rbRTSP.checked = true; - break; - default: - id_rbRTMP.checked = true; - break; - } - - id_cbSoundCapture.checked = _iSoundCapture; - - } - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- Video quality") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Component.onCompleted: - { - contextMain.slVideoQualityStatus(); - } - - Item { - width: 1 - height: 20 - } - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Stream") - font.bold: true - font.pixelSize: 16 - - //visible: false - - Component.onCompleted: - { - if(contextMain.slStreamRTSP()) - { - id_rbRTSP.checked = true - id_rbRTMP.checked = false - } - else - { - id_rbRTSP.checked = false - id_rbRTMP.checked = true - } - } - - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - RadioButton { - id: id_rbRTMP - anchors.verticalCenter: parent.verticalCenter - text: qsTr("RTMP") - checked: true - } - - RadioButton { - id: id_rbRTSP - width: 120 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("RTSP") - font.pixelSize: 16 - } - } - } - - - Item { - width: 1 - height: 20 - } - - - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Frame size") - font.bold: true - font.pixelSize: 16 - - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - RadioButton { - id: id_rbFS1 - width: 120 - anchors.verticalCenter: parent.verticalCenter - checked: true - text: qsTr("Original") - font.pixelSize: 16 - - } - - RadioButton { - id: id_rbFS2 - width: 120 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Full HD") - font.pixelSize: 16 - - } - - RadioButton { - id: id_rbFS3 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("HD") - - - } - - RadioButton { - id: id_rb480 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("480h") - visible: false - - - } - } - } - - - Item { - width: 1 - height: 10 - } - - - GroupBox { - width: parent.width - height: 70 - title: qsTr("FPS") - font.bold: true - font.pixelSize: 16 - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - - - Slider { - id: id_slFPS - width: parent.parent.width - 85 - anchors.verticalCenter: parent.verticalCenter - from: 10 - value: 30 - to: 60 - stepSize: 5 - } - - Text { - width: 30 - anchors.verticalCenter: parent.verticalCenter - text: " " + (parent.children[0].value == 0 ? 1 : Math.round(parent.children[0].value) ) - font.bold: true - font.pixelSize: 16 - color: "#000000" - } - - - } - } - - - Item { - width: 1 - height: 10 - } - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Encoder h.264") - font.bold: true - font.pixelSize: 16 - - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - RadioButton { - id: id_rbCPU - width: 120 - anchors.verticalCenter: parent.verticalCenter - checked: true - text: qsTr("use CPU") - font.pixelSize: 16 - } - - RadioButton { - id: id_rbGPU - anchors.verticalCenter: parent.verticalCenter - text: qsTr("use GPU") - } - } - } - - - Item { - width: 1 - height: 10 - visible: !id_rbGPU.checked - } - - GroupBox { - width: parent.width - title: qsTr("Encoding speed") - font.bold: true - font.pixelSize: 16 - visible: !id_rbGPU.checked - - - Column - { - Row - { - RadioButton { - id: id_rbSpeedE1 - width: 120 - text: qsTr("ultrafast") - font.pixelSize: 16 - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[1].children[0].checked = false; - parent.parent.children[1].children[1].checked = false; - } - } - - } - - RadioButton { - id: id_rbSpeedE2 - checked: true - text: qsTr("veryfast") - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[1].children[0].checked = false; - parent.parent.children[1].children[1].checked = false; - } - } - - } - } - - Row - { - RadioButton { - id: id_rbSpeedE3 - width: 120 - text: qsTr("medium") - font.pixelSize: 16 - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[0].children[0].checked = false; - parent.parent.children[0].children[1].checked = false; - } - } - } - - RadioButton { - id: id_rbSpeedE4 - text: qsTr("slower") - - onCheckedChanged: - { - if(checked) - { - parent.parent.children[0].children[0].checked = false; - parent.parent.children[0].children[1].checked = false; - } - } - } - } - } - } - - - Item { - width: 1 - height: 10 - } - - GroupBox { - width: parent.width - height: 70 - title: qsTr("Bitrate") - font.bold: true - font.pixelSize: 16 - - Row - { - anchors.verticalCenter: parent.verticalCenter - height: 20 - - Slider { - id: id_slBt - width: id_slFPS.width - anchors.verticalCenter: parent.verticalCenter - from: 0.5 - value: 4 - to: 10 - stepSize: 0.5 - } - - Text { - width: 30 - anchors.verticalCenter: parent.verticalCenter - text: " " + parent.children[0].value.toFixed(1) + " Mbit." - font.bold: true - font.pixelSize: 16 - color: "#000000" - } - - } - } - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: children[0].height - - MyCheckBox { - id: id_cbLatZ - x: 5 - text: qsTr("Zero latency") - visible: !id_rbGPU.checked - - } - - MyCheckBox { - id: id_cbSoundCapture - anchors.right: parent.right - anchors.rightMargin: id_cbLatZ.x - text: qsTr("Sound capture") - } - - - } - - - - Item { - width: 1 - height: 20 - } - - Item { - width: parent.width - height: children[0].height - - Rectangle - { - width: parent.width/2 - 20 - height: children[1].height + 20 - color: "#ffffff" - border.color: "#000000" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - var a_iSizeF = 0; - if(id_rbFS2.checked) - a_iSizeF = 1; - else - if(id_rbFS3.checked) - a_iSizeF = 2; - else - if(id_rb480.checked) - a_iSizeF = 3; - - var a_iEnvoderV = 0; - if(id_rbGPU.checked) - a_iEnvoderV = 1; - - - var a_iEncSpeed = 0; - if(id_rbSpeedE2.checked) - a_iEncSpeed = 1; - else - if(id_rbSpeedE3.checked) - a_iEncSpeed = 2; - else - if(id_rbSpeedE4.checked) - a_iEncSpeed = 3; - - - var a_iLatencyZ = 0; - if(id_cbLatZ.checked) - a_iLatencyZ = 1; - - var a_iSound = 0; - if(id_cbSoundCapture.checked) - a_iSound = 1; - - contextMain.slVideoQualityGet(a_iSizeF, id_slFPS.value, a_iEnvoderV, a_iEncSpeed, 10*id_slBt.value, a_iLatencyZ, id_rbRTSP.checked, a_iSound); - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Apply") - font.bold: true - font.pixelSize: 14 - color: "#000000" - } - } - - - - - Item - { - width: children[1].width + 20 - height: children[1].height + 20 - - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - - opacity: children[0].pressed ? 0.6 : 1.0 - - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - - id_slFPS.value = 30; - id_rbFS1.checked = true; - id_rbCPU.checked = true; - id_rbSpeedE2.checked = true; - id_slBt.value = 2.5; - id_cbLatZ.checked = true; - id_cbSoundCapture.checked = false; - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Default propertys") - font.underline: true - font.bold: true - font.pixelSize: 16 - color: "#90000000" - } - } - - } - - - Item { - width: 1 - height: 10 - } - - } - - - } - - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/menu_ViewSize.qml b/src/qml6/menu_ViewSize.qml deleted file mode 100644 index b23fe85..0000000 --- a/src/qml6/menu_ViewSize.qml +++ /dev/null @@ -1,305 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.15 - -Rectangle { - id: root - objectName: "obMenuViewSize" - width: 300 - color: "#808080" - border.color: "#000000" - border.width: 1 - - property int m_iH: id_recTitle.height + id_colData.height + id_recCancel.height + 50 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - - } - - Component.onDestruction: - { - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - // onWheel: - // (wheel)=> { - // } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#000000" - - Item { - width: 2 * children[0].width - height: parent.height - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("- View size") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - Flickable { - x: 5 - width: parent.width - 2 * x - anchors.top: id_recTitle.bottom - anchors.bottom: id_recCancel.top - //interactive: id_scrollBar.size < 1 ? true : false - - clip: true - - ScrollBar.vertical: ScrollBar { - id: id_scrollBar - policy: id_scrollBar.size < 1 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - visible: size < 1 ? true : false - } - - //contentWidth: parent.width - x - 5 // The important part - contentHeight: id_colData.height // Same - - Column - { - id: id_colData - width: id_scrollBar.visible ? (parent.width - id_scrollBar.width - 10) : parent.width - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: 40 - - - Item - { - anchors.fill: parent - opacity: children[0].pressed ? 0.5 : 1.0 - - MouseArea { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slFullScreen(true); - } - } - - Text { - x: 5 - width: parent.width - 2*x - anchors.verticalCenter: parent.verticalCenter - //font.bold: true - font.pointSize: 18 - text: "Application full size" - color: "white" - clip: true - } - - Rectangle - { - width: parent.width - height: 1 - anchors.bottom: parent.bottom - color: "#cc000000" - } - - } - } - - Item { - width: 1 - height: 15 - } - - Item { - width: parent.width - height: 40 - - - Item - { - anchors.fill: parent - opacity: children[0].pressed ? 0.5 : 1.0 - - MouseArea { - anchors.fill: parent - - onPressed: - (mouse)=> - { - contextMain.slDesktopRealSize(true); - } - } - - Text { - x: 5 - width: parent.width - 2*x - anchors.verticalCenter: parent.verticalCenter - //font.bold: true - font.pointSize: 18 - text: "Real desktop size" - color: "white" - clip: true - } - - Rectangle - { - width: parent.width - height: 1 - anchors.bottom: parent.bottom - color: "#cc000000" - } - - } - } - - Item { - width: 1 - height: 5 - } - - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - -} diff --git a/src/qml6/messageStatus.qml b/src/qml6/messageStatus.qml deleted file mode 100644 index 7dcf79a..0000000 --- a/src/qml6/messageStatus.qml +++ /dev/null @@ -1,307 +0,0 @@ -import QtQuick 2.12 - -Rectangle { - id: root - objectName: "obMessageStatus" - anchors.fill: parent - color: "#30000000" - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - id_recCancel.fCancel(); - } - - onPositionChanged: - (mouse)=> - { - - } - } - - - function fStatus(_iVar, _sData) - { - //print("fStatus 0: " + _iVar + " -> " + _sData) - - id_txtTitle.text = ""; - - - - if(_iVar > 300) - { - id_txtInfo.text = ""; - } - else - if(_iVar > 200) - { - - switch(_iVar%10) - { - case 1: - id_txtTitle.text = "- Error"; - break; - case 2: - id_txtTitle.text = "- Warning"; - break; - } - - id_txtInfo.text = "Server data:\n\n"; - - } - else - { - switch(_iVar%10) - { - case 1: - id_txtTitle.text = "- Error"; - break; - case 2: - id_txtTitle.text = "- Warning"; - break; - } - - id_txtInfo.text = "Client data:\n\n"; - } - - - id_txtInfo.text += _sData; - - root.parent.visible = true; - - } - - Rectangle { - id: id_recStatus - anchors.centerIn: parent - width: parent.width - 20 > 600 ? 600 : parent.width - 20 - color: "#808080" - height: parent.height - 20 > 400 ? 400 : parent.height - 20 - border.color: "#000000" - border.width: 1 - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - - } - - Component.onDestruction: - { - - } - - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - - Rectangle - { - id: id_recTitle - width: parent.width - height: 50 - color: "#90ff0000" - - Item { - width: 2 * children[0].width - height: parent.height - visible: false - - Text { - x: 10 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("<-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - MouseArea - { - anchors.fill: parent - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - } - } - - - Text { - id: id_txtTitle - anchors.right: parent.right - anchors.rightMargin: 15 - anchors.verticalCenter: parent.verticalCenter - text: qsTr("-") - font.bold: true - font.pixelSize: 20 - color: "#ffffff" - } - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - anchors.bottom: parent.bottom - color: "#ffffff" - } - } - - - - Item { - width: parent.width - 40 - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: id_recTitle.bottom - anchors.topMargin: 20 - anchors.bottom: id_recCancel.top - anchors.bottomMargin: 20 - - Text { - id: id_txtInfo - anchors.fill: parent - - text: qsTr("") - font.bold: true - font.pixelSize: 18 - color: "#ffffff" - wrapMode: Text.Wrap - } - - } - - Item - { - id: id_recCancel - width: parent.width - height: 50 - anchors.bottom: parent.bottom - - Rectangle - { - width: parent.width - 2 * root.border.width - anchors.horizontalCenter: parent.horizontalCenter - height: 2 - color: "#ffffff" - } - - Rectangle - { - width: children[1].width + 30 - height: parent.height - 10 - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 7 - color: "#70000000" - border.color: "#ffffff" - radius: 7 - opacity: children[0].pressed ? 0.6 : 1.0 - - MouseArea - { - anchors.fill: parent - hoverEnabled: true - - onWheel: - (wheel)=> { - } - - - onPressed: - (mouse)=> - { - id_recCancel.fCancel() - } - - onReleased: - (mouse)=> - { - } - - onPositionChanged: - (mouse)=> - { - } - } - - Text { - anchors.centerIn: parent - text: qsTr("Cancel") - font.bold: true - font.pixelSize: 14 - color: "#ffffff" - } - } - - - function fCancel() - { - root.signalData(0, 0, 0, 0, 0, 0, 0) - } - } - - } - - - -} diff --git a/src/qml6/player.qml b/src/qml6/player.qml deleted file mode 100644 index d1b555e..0000000 --- a/src/qml6/player.qml +++ /dev/null @@ -1,486 +0,0 @@ -import QtQuick 2.12 - - -Item { - id: root - objectName: "obVideo" - anchors.fill: parent - focus: true - - property bool m_bFocus: parent.focus - property bool m_bFrameRealSize: true - property bool m_bPlay: false - property int m_iFrame: -1; - property int m_iFramePrew: -1; - property int m_iRestartNew: 0 - property int m_iPlayRestart: 0 - - property int m_iFPS: 0 - property int m_iDataFPS: 0 - property int m_iLowFPS: 0 - property int m_iShowFPS: 60 - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - onM_bFocusChanged: - root.focus = m_bFocus; - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - Keys.onPressed: - (event)=> - { - contextMain.slSendKeyEvent(1, event.key, event.text); - event.accepted = true; - } - - Keys.onReleased: - (event)=> - { - contextMain.slSendKeyEvent(2, event.key, event.text); - event.accepted = true; - } - - - MouseArea - { - id: id_mouseMain - anchors.fill: parent - - property int a_iMousStartX : 0 - property int a_iMousStartY : 0 - property int a_iMove : 0 - property bool a_bDoubleClicked: false - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - } - - onPositionChanged: - { - if(id_tMouseMainLongPress.running) - { - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - } - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > Math.abs( mouseX - id_mouseMain.a_iMousStartX )) - { - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > 5) - { - id_mouseMain.a_iMousStartY = mouseY - } - } - else - { - id_mouseMain.a_iMove = mouseX - id_mouseMain.a_iMousStartX; - id_mouseMain.a_iMousStartX = mouseX; - - } - - - } - - onPressed: (mouse)=> - { - - root.parent.focus = true; - - id_mouseMain.a_iMousStartX = mouseX; - id_mouseMain.a_iMousStartY = mouseY; - - if(!id_tMouseMainDoubleClicked.running) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.start() - } - else - { - a_bDoubleClicked = true; - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.start(); - } - - onReleased: (mouse)=> - { - id_mouseMain.a_iMousStartX = 0; - id_mouseMain.a_iMousStartY = 0; - - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - else - { - if( id_mouseMain.a_iMove == 0 ) - { - - - } - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - - id_mouseMain.a_iMove = 0; - } - - Timer - { - id: id_tMouseMainDoubleClicked - interval: 200; - repeat: false - - onTriggered: - { - } - } - - Timer - { - id: id_tMouseMainLongPress - interval: 200; - repeat: true - - property int m_iLongPress: 0 - - onTriggered: - { - m_iLongPress++; - - if(m_iLongPress > 4) - { - m_iLongPress = 0; - stop(); - } - } - } - - } - - - function fTimer() - { - if(m_bPlay && id_itLoading.m_bLoading < 10) - id_itLoading.m_bLoading++; - - fVideoReload(); - } - - function fVideoStartStop(_sData, _iVar) - { - root.m_iRestartNew = root.m_iPlayRestart = 0; - - if(_iVar > 0) - { - m_bPlay = true; - } - else - { - m_bPlay = false; - - } - - id_itLoading.m_bLoading = 5; - root.m_iFrame = root.m_iFramePrew = -1; - - } - - function fVideoReload() - { - //print("fVideoReload 0: " + root.m_iRestartNew + " / " + m_iPlayRestart); - - if(!root.m_bPlay) - return; - - if(root.m_iFramePrew == root.m_iFrame) - { - if(root.m_iRestartNew < 6) - { - //print("fVideoReload 1: " + root.m_iRestartNew); - - root.m_iPlayRestart++; - - if(root.m_iPlayRestart > 10) - { - //print("fVideoReload 2: " + root.m_iPlayRestart); - - contextMain.slReConnectToDesktop(); - - root.m_iPlayRestart = 0; - - root.m_iRestartNew++; - } - } - else - { - contextMain.slDisConnectDesktop(1); - } - } - - root.m_iFramePrew = root.m_iFrame; - - } - - - - function fDescktopRealSize(_bVar) - { - root.m_bFrameRealSize = !root.m_bFrameRealSize; - } - - - - function updateFrame(_uFrameCounter, _iWf, _iHf) - { - id_itLoading.m_bLoading = 0; - - id_imVideo.source = "image://streamNum_" - + "1" - + "/stream_" - + _uFrameCounter; - - id_imVideo.m_iFrameW = _iWf; - id_imVideo.m_iFrameH = _iHf; - - root.m_iFrame = _uFrameCounter; - root.m_iRestartNew = root.m_iPlayRestart = 0; - } - - - - Image { - id:id_imVideo - anchors.centerIn: parent - -// height: m_iTempFrameH * m_dKWH > parent.width ? parent.width / m_dKWH : m_iTempFrameH -// width: m_iTempFrameH * m_dKWH > parent.width ? parent.width : m_iTempFrameH * m_dKWH - - height: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW / m_dKWH : m_iTempFrameH - width: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW : m_iTempFrameH * m_dKWH - - //source: "image/save.png" - - property int m_iFrameW: 0 - property int m_iFrameH: 0 - - property int m_iTempFrameH: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.height : m_iFrameH - property double m_dKWH : m_iFrameW / m_iFrameH - - property int m_iDrawFrameW: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.width : m_iFrameW - - MouseArea - { - id: id_mouseVideo - anchors.fill: parent - hoverEnabled: true - - property var a_bBtPress: [false, false] - property bool a_bBtLeftPressed: false - - - acceptedButtons: Qt.LeftButton | Qt.RightButton - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - - contextMain.slSendMouseEvent(4, wheel.angleDelta.y < 0 ? 0 : 1 - , 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - - onPressed: (mouse)=> - { - root.parent.focus = true; - - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = true; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtPress[0] = true; - - a_bBtLeftPressed = true; - } - - contextMain.slSendMouseEvent(1, a_bBtLeftPressed, 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onPressed 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onReleased: (mouse)=> - { - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = false; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtLeftPressed = true; - - a_bBtPress[0] = false; - } - - contextMain.slSendMouseEvent(2, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onReleased 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onPositionChanged: - { - //print("onPositionChanged 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - //print("onReleased 5: " + id_imVideo.width + " / " + mouseX + " / " + (100 * mouseX/id_imVideo.width) + " / " + 100 * (100 * mouseX/id_imVideo.width)); - - - contextMain.slSendMouseEvent(3, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - } - - - } - - Item { - id: id_itLoading - anchors.right: parent.right - anchors.rightMargin: y - y:2 - rotation: 0 - visible: m_bPlay && m_bLoading > 2 ? true : false - - property real m_bLoading: 3 - - property int size: 40 - property int lineWidth: 5 - property real value: 0 - - property color primaryColor: "#99ff0000" - property color secondaryColor: "#00e0e0e0" - - property int animationDuration: 1000 - - width: size - height: size - - onValueChanged: { - canvas.degree = value * 360; - } - - Canvas { - id: canvas - - property real degree: 250 - - anchors.fill: parent - antialiasing: true - - onDegreeChanged: { - requestPaint(); - } - - onPaint: { - var ctx = getContext("2d"); - - var x = id_itLoading.width/2; - var y = id_itLoading.height/2; - - var radius = id_itLoading.size/2 - id_itLoading.lineWidth - var startAngle = (Math.PI/180) * 270; - var fullAngle = (Math.PI/180) * (270 + 360); - var progressAngle = (Math.PI/180) * (270 + degree); - - ctx.reset() - - ctx.lineCap = 'round'; - ctx.lineWidth = id_itLoading.lineWidth; - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, fullAngle); - ctx.strokeStyle = id_itLoading.secondaryColor; - ctx.stroke(); - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, progressAngle); - ctx.strokeStyle = id_itLoading.primaryColor; - ctx.stroke(); - } - - // Behavior on degree { - // NumberAnimation { - // duration: root.animationDuration - // } - // } - } - - Timer - { - interval: 50; running: parent.visible; repeat: true - onTriggered: - { - parent.rotation += 30; - - if(parent.rotation > 360) - { - parent.rotation -= 360; - } - } - } - - } - -} diff --git a/src/qml6/playerNew.qml b/src/qml6/playerNew.qml deleted file mode 100644 index 580e1f4..0000000 --- a/src/qml6/playerNew.qml +++ /dev/null @@ -1,496 +0,0 @@ -import QtQuick -import QtMultimedia - -Item { - id: root - objectName: "obVideo" - anchors.fill: parent - focus: true - - property bool m_bFocus: parent.focus - property bool m_bFrameRealSize: true - property string m_sURL: "" - property int m_iPlayRestart: 0 - property int m_iRestartNew: 0 - property bool m_bReConnect: false - property int m_iFPS: 0 - property int m_iDataFPS: 0 - property int m_iLowFPS: 0 - property int m_iShowFPS: 60 - - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - onM_bFocusChanged: - root.focus = m_bFocus; - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - Keys.onPressed: - (event)=> - { - //print("Keys.onPressed 0:") - - contextMain.slSendKeyEvent(1, event.key, event.text); - event.accepted = true; - } - - Keys.onReleased: - (event)=> - { - contextMain.slSendKeyEvent(2, event.key, event.text); - event.accepted = true; - } - - MouseArea - { - anchors.fill: parent - - onReleased: (mouse)=> - { - - } - } - - - function fTimer() - { - fVideoReload(); - } - - function fDescktopRealSize(_bVar) - { - root.m_bFrameRealSize = !root.m_bFrameRealSize; - } - - function fVideoStartStop(_sUrl, _iVar) - { - //print("fVideoStartStop 0: " + _sUrl); - - root.m_iRestartNew = 0; - root.m_iPlayRestart = 0; - id_Player.m_bFrameNew = true; - id_Player.m_iFramePrew = 0; - - - if(_sUrl.length > 0) - { - m_iFPS = m_iDataFPS = m_iShowFPS = 0; - - root.fPlay(_sUrl, _iVar) - } - else - root.fPlay("", 0) - - } - - - function fVideoReload() - { - - //print("fVideoReload 0: " + root.m_iRestartNew + " / " + m_iPlayRestart); - - if(id_Player.m_iFramePrew < 0) - { - id_Player.m_bFrameNew = false; - - if(root.m_iRestartNew < 6 && root.m_sURL.length > 0) - { - //print("fVideoReload 1: " + root.m_iRestartNew); - - root.m_iPlayRestart++; - - if(root.m_iPlayRestart > 10) - { - //print("fVideoReload 2: " + root.m_iPlayRestart); - - - // if(root.m_bReConnect) - // fPlay(root.m_sURL, 1); - // else - contextMain.slReConnectToDesktop(); - - root.m_bReConnect = !root.m_bReConnect; - - root.m_iPlayRestart = 0; - - root.m_iRestartNew++; - } - } - else - root.m_sURL = ""; - - } - else - { - id_Player.m_bFrameNew = true; - - root.m_iDataFPS = root.m_iFPS; - - //print("fVideoReload 5.0: " + root.m_iDataFPS); - - if(root.m_iDataFPS > 0 && root.m_iDataFPS < 3 && root.m_sURL.length > 0) - { - root.m_iLowFPS++; - if(root.m_iLowFPS > 3) - { - //print("fVideoReload 5.1: "); - - root.m_iLowFPS = 0; - root.fPlay("", 0) - //root.fPlay(root.m_sURL, 1) - contextMain.slReConnectToDesktop(); - //root.fPlay("gst-pipeline: rtspsrc location=rtsp://127.0.0.1:8504/live/111 ! queue ! decodebin3 ! videoconvert ! qtvideosink", 1) - } - } - else - root.m_iLowFPS = 0; - - root.m_iFPS = 0; - - if(root.m_iShowFPS == 60) - root.m_iShowFPS = 0; - - } - - id_Player.m_iFramePrew = -1; - - - if(root.m_iShowFPS < 60) - root.m_iShowFPS++; - - - } - - - function fPlay(_sUrl, _iPlay) - { - id_Player.source = "" - - root.m_sURL = _sUrl; - - //print("fPlay 0: url = " + root.m_sURL); - - if(_iPlay > 0) - { - - if(_iPlay == 1) - { - if(root.m_sURL.length > 0) - root.m_iShowFPS = 60; - - - id_Player.source = root.m_sURL; - id_Player.play(); - } - else - id_Player.pause() - } - else - { - id_Player.stop(); - } - - if(root.m_sURL.length > 0) - id_Player.m_iFramePrew = -1; - else - id_Player.m_iFramePrew = 0; - } - - - Item { - id: id_itBoxVideo - anchors.centerIn: parent - - height: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW / m_dKWH : m_iTempFrameH - width: m_iTempFrameH * m_dKWH > m_iDrawFrameW ? m_iDrawFrameW : m_iTempFrameH * m_dKWH - - - property int m_iFrameW: id_videoOutput.sourceRect.width - property int m_iFrameH: id_videoOutput.sourceRect.height - property int m_iTempFrameH: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.height : m_iFrameH - property double m_dKWH : m_iFrameW / m_iFrameH - property int m_iDrawFrameW: !root.m_bFrameRealSize || m_iFrameW > parent.width || m_iFrameH > parent.height ? parent.width : m_iFrameW - - - MouseArea - { - id: id_mouseVideo - anchors.fill: parent - hoverEnabled: true - - property var a_bBtPress: [false, false] - property bool a_bBtLeftPressed: false - - - acceptedButtons: Qt.LeftButton | Qt.RightButton - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - - contextMain.slSendMouseEvent(4, wheel.angleDelta.y < 0 ? 0 : 1 - , 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - - onPressed: (mouse)=> - { - root.parent.focus = true; - - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = true; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtPress[0] = true; - - a_bBtLeftPressed = true; - } - - if(root.m_sURL.length > 0 && root.m_iPlayRestart < 2) - contextMain.slSendMouseEvent(1, a_bBtLeftPressed, 1 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onPressed 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onReleased: (mouse)=> - { - a_bBtLeftPressed = false; - - if (mouse.button === Qt.RightButton) - { - a_bBtPress[1] = false; - } - else - if (mouse.button === Qt.LeftButton) - { - a_bBtLeftPressed = true; - - a_bBtPress[0] = false; - } - - contextMain.slSendMouseEvent(2, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - - //print("onReleased 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - } - - onPositionChanged: - { - //print("onPositionChanged 5: " + a_bBtLeftPressed + " / " + a_bBtPress + " / " + mouseX + " / " + mouseY); - - //print("onReleased 5: " + id_imVideo.width + " / " + mouseX + " / " + (100 * mouseX/id_imVideo.width) + " / " + 100 * (100 * mouseX/id_imVideo.width)); - - if(root.m_sURL.length > 0 && root.m_iPlayRestart < 2) - contextMain.slSendMouseEvent(3, a_bBtLeftPressed, 0 - , 100 * (100 * mouseX/parent.width) - , 100 * (100 * mouseY/parent.height) ); - } - - } - - - MediaPlayer { - id: id_Player - source: "" - //source: "rtmp://localhost/111/ live=1" - //source: "gst-pipeline: rtmpsrc location='rtmp://localhost/111/ live=1' ! queue ! decodebin3 ! videoconvert ! qtvideosink" - //source: "gst-pipeline: rtmpsrc location='rtmp://localhost/111/ live=1' ! queue ! decodebin3 ! videoconvert ! vpudec ! fpsdisplaysink video-sink=glimagesink - - //autoPlay: true - videoOutput: id_videoOutput - - property bool m_bFrameNew: false - property int m_iFramePrew: 0 - - - onMediaStatusChanged: - { - var a_sVar = ""; - - - print("player status: code " + mediaStatus); - - // if(status != 2 && status != 6) - //print("player 1: status: \n src: " + source + "\n code: " + mediaStatus + "\n " + a_sVar); - - - // print("player 2: " + source.toString().length); - - - } - - - onErrorChanged: - { - var a_sVar = ""; - - - print("player error: code " + error); - //print("player error: \n src: " + source + "\n code: " + error + "\n " + a_sVar + "\n " + errorString); - - } - - - - onPositionChanged : - { - contextMain.slUpdateFrame(1, 1, 0); - - root.m_iRestartNew = 0; - root.m_iPlayRestart = 0; - id_Player.m_bFrameNew = true; - id_Player.m_iFramePrew++; - - if(id_Player.m_iFramePrew > 100000) - id_Player.m_iFramePrew = 1 - - root.m_iFPS++; - - //print("id_Player 1: " + id_Player.m_iFramePrew + " / " + id_Player.m_bFrameNew + " / " + id_Player.position) - - } - - } - - VideoOutput { - id: id_videoOutput - anchors.fill: parent - } - - } - - Item { - id: id_itLoading - anchors.right: parent.right - anchors.rightMargin: y - y:2 - rotation: 0 - visible: root.m_sURL.length > 0 && !id_Player.m_bFrameNew ? true : false - - property int size: 40 - property int lineWidth: 5 - property real value: 0 - - property color primaryColor: "#99ff0000" - property color secondaryColor: "#00e0e0e0" - - property int animationDuration: 1000 - - width: size - height: size - - onValueChanged: { - canvas.degree = value * 360; - } - - Canvas { - id: canvas - - property real degree: 250 - - anchors.fill: parent - antialiasing: true - - onDegreeChanged: { - requestPaint(); - } - - onPaint: { - var ctx = getContext("2d"); - - var x = id_itLoading.width/2; - var y = id_itLoading.height/2; - - var radius = id_itLoading.size/2 - id_itLoading.lineWidth - var startAngle = (Math.PI/180) * 270; - var fullAngle = (Math.PI/180) * (270 + 360); - var progressAngle = (Math.PI/180) * (270 + degree); - - ctx.reset() - - ctx.lineCap = 'round'; - ctx.lineWidth = id_itLoading.lineWidth; - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, fullAngle); - ctx.strokeStyle = id_itLoading.secondaryColor; - ctx.stroke(); - - ctx.beginPath(); - ctx.arc(x, y, radius, startAngle, progressAngle); - ctx.strokeStyle = id_itLoading.primaryColor; - ctx.stroke(); - } - - // Behavior on degree { - // NumberAnimation { - // duration: root.animationDuration - // } - // } - } - - Timer - { - interval: 50; running: parent.visible; repeat: true - onTriggered: - { - parent.rotation += 30; - - if(parent.rotation > 360) - { - parent.rotation -= 360; - } - } - } - - } - - - Rectangle - { - x: 3 - y: 3 - width: children[0].width + 5 - height: children[0].height + 10 - visible: false //root.m_sURL.length > 0 && root.m_iShowFPS > 0 && root.m_iShowFPS < 30 && !id_itLoading.visible ? true : false - - Text { - anchors.centerIn: parent - text: root.m_iDataFPS + qsTr(" fps") - font.bold: true - font.pixelSize: 20 - color: "#ff0000" - } - } - -} diff --git a/src/qml6/playerRTSP.qml b/src/qml6/playerRTSP.qml deleted file mode 100644 index d284ee9..0000000 --- a/src/qml6/playerRTSP.qml +++ /dev/null @@ -1,190 +0,0 @@ -import QtQuick 2.12 -import QtMultimedia 5.12 - -Item { - id: root - objectName: "obPlayerRtsp" - anchors.fill: parent - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - - MouseArea - { - id: id_mouseMain - anchors.fill: parent - - property int a_iMousStartX : 0 - property int a_iMousStartY : 0 - property int a_iMove : 0 - property bool a_bDoubleClicked: false - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - } - - onPositionChanged: - { - if(id_tMouseMainLongPress.running) - { - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - } - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > Math.abs( mouseX - id_mouseMain.a_iMousStartX )) - { - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > 5) - { - id_mouseMain.a_iMousStartY = mouseY - } - } - else - { - id_mouseMain.a_iMove = mouseX - id_mouseMain.a_iMousStartX; - id_mouseMain.a_iMousStartX = mouseX; - - } - - - } - - onPressed: (mouse)=> - { - id_mouseMain.a_iMousStartX = mouseX; - id_mouseMain.a_iMousStartY = mouseY; - - if(!id_tMouseMainDoubleClicked.running) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.start() - } - else - { - a_bDoubleClicked = true; - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.start(); - } - - onReleased: (mouse)=> - { - id_mouseMain.a_iMousStartX = 0; - id_mouseMain.a_iMousStartY = 0; - - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - else - { - if( id_mouseMain.a_iMove == 0 ) - { - - - } - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - - id_mouseMain.a_iMove = 0; - } - - Timer - { - id: id_tMouseMainDoubleClicked - interval: 200; - repeat: false - - onTriggered: - { - } - } - - Timer - { - id: id_tMouseMainLongPress - interval: 200; - repeat: true - - property int m_iLongPress: 0 - - onTriggered: - { - m_iLongPress++; - - if(m_iLongPress > 4) - { - m_iLongPress = 0; - stop(); - } - } - } - - } - - function fSetUrl(_sUrl) - { - print(_sUrl); - - id_vRTSP.source = _sUrl; - id_vRTSP.source = "gst-launch-1.0 /udpsrc port=5012 ! application/x-rtp, encoding-name=H264, payload=96 ! rtph264depay ! queue ! h264parse ! avdec_h264 ! videoconvert ! autovideosink" - id_vRTSP.play(); - } - - - -// Video { -// id: id_vRTSP -// anchors.fill: parent -// source: "" -// autoPlay: false -// opacity: 1.0 -// fillMode: Image.Stretch -// muted: false -// } - - MediaPlayer { - id: id_vRTSP - source: "" - muted: false - autoPlay: false - } - - VideoOutput { - id: camera1 - anchors.fill: parent - source: id_vRTSP - } - -} diff --git a/src/qml6/userUI.qml b/src/qml6/userUI.qml deleted file mode 100644 index 0d19807..0000000 --- a/src/qml6/userUI.qml +++ /dev/null @@ -1,250 +0,0 @@ -import QtQuick 2.12 -import QtMultimedia 5.15 - -Rectangle { - id: root - objectName: "obUserUI" - anchors.fill: parent - color: "#0047AB" - //color: "#ff0000" - - - signal signalData(int _iId, var _vData_1, var _vData_2, var _vData_3, var _vData_4, var _vData_5, var _vData_6) - - - Component.onCompleted: - { - } - - Component.onDestruction: - { - - } - - - MouseArea - { - id: id_mouseMain - anchors.fill: parent - - property int a_iMousStartX : 0 - property int a_iMousStartY : 0 - property int a_iMove : 0 - property bool a_bDoubleClicked: false - - onWheel: (wheel)=> { - - if(wheel.angleDelta.y > 0) - { - } - else - { - if(wheel.angleDelta.y < 0) - { - - } - } - } - - onPositionChanged: - { - if(id_tMouseMainLongPress.running) - { - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - } - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > Math.abs( mouseX - id_mouseMain.a_iMousStartX )) - { - if(Math.abs( mouseY - id_mouseMain.a_iMousStartY ) > 5) - { - id_mouseMain.a_iMousStartY = mouseY - } - } - else - { - id_mouseMain.a_iMove = mouseX - id_mouseMain.a_iMousStartX; - id_mouseMain.a_iMousStartX = mouseX; - - } - - - } - - onPressed: (mouse)=> - { - id_mouseMain.a_iMousStartX = mouseX; - id_mouseMain.a_iMousStartY = mouseY; - - if(!id_tMouseMainDoubleClicked.running) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.start() - } - else - { - a_bDoubleClicked = true; - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.start(); - } - - onReleased: (mouse)=> - { - id_mouseMain.a_iMousStartX = 0; - id_mouseMain.a_iMousStartY = 0; - - - if( a_bDoubleClicked ) - { - a_bDoubleClicked = false; - id_tMouseMainDoubleClicked.stop() - } - else - { - if( id_mouseMain.a_iMove == 0 ) - { - - - } - } - - id_tMouseMainLongPress.m_iLongPress = 0 - id_tMouseMainLongPress.stop(); - - id_mouseMain.a_iMove = 0; - } - - Timer - { - id: id_tMouseMainDoubleClicked - interval: 200; - repeat: false - - onTriggered: - { - } - } - - Timer - { - id: id_tMouseMainLongPress - interval: 200; - repeat: true - - property int m_iLongPress: 0 - - onTriggered: - { - m_iLongPress++; - - if(m_iLongPress > 4) - { - m_iLongPress = 0; - stop(); - } - } - } - - } - - - Loader { - id: id_loadPlayer - anchors.fill: parent - focus: true - - source: contextMain.slPlayerVar() === 0 ? "playerNew.qml" : "player.qml"; - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadPlayer::slotData 0: " + _iId) - - - } - - } - - Loader { - id: id_loadMenu - anchors.fill: parent - - source:"menu.qml"; - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadPlayer::slotData 0: " + _iId) - - - } - - } - - Loader { - id: id_loadMessageStatus - anchors.fill: parent - - source:"messageStatus.qml"; - - visible: false - - onLoaded: - { - item.signalData.connect(slotData) - } - - Component.onDestruction: { - if (item) { - item.signalData.disconnect(slotData) - } - } - - - function slotData(_iId, _vData_1, _vData_2, _vData_3, _vData_4, _vData_5, _vData_6) - { - //print("id_loadMessageStatus::slotData 0: " + _iId) - - switch(_iId) - { - case 0: - id_loadMessageStatus.visible = false; - break; - } - - - } - - } - -} diff --git a/src/settingsapp.cpp b/src/settingsapp.cpp index a1e7e95..202e53c 100644 --- a/src/settingsapp.cpp +++ b/src/settingsapp.cpp @@ -12,24 +12,15 @@ void SettingsApp::fReadSettings() //QSettings a_setReg(QLatin1String("Inspectrum"), StaticData::m_sNameApp ); QSettings a_setReg(StaticData::m_sSettingsFile, QSettings::IniFormat ); a_setReg.beginGroup(QLatin1String("/Settings")); - StaticData::m_sServerIP = a_setReg.value(tr("/serverIP"), "localhost").toString(); //12.3.213.214 - StaticData::m_sServerPassword = a_setReg.value(tr("/serverPassword"), "1111").toString(); + StaticData::m_sServerIP = a_setReg.value(tr("/serverIP"), "localhost").toString(); + //StaticData::m_sServerPassword = a_setReg.value(tr("/serverPassword"), "1111").toString(); StaticData::m_sPortTCP = a_setReg.value(tr("/portTCP"), 1235).toString().toUShort(); //1235 - StaticData::m_sPortRTSP = a_setReg.value(tr("/portRTSP"), 8554).toString().toUShort(); //8504 - StaticData::m_sPortRTMP = a_setReg.value(tr("/portRTMP"), 1935).toString().toUShort(); //1935 - StaticData::_iCurStreamRTSP = StaticData::_iStreamRTSP = a_setReg.value(tr("/streamRTSP"), 0).toBool(); //false - StaticData::_iCurEnvoderV = StaticData::_iEnvoderV = a_setReg.value(tr("/streamEncoderType"), 0).toString().toUShort(); //0 - - if(!StaticData::fAvailableNvh264enc()) - StaticData::_iCurEnvoderV = 0; StaticData::m_sKeyDevServer = a_setReg.value(tr("/keyDevServer"), "xxxxxxxx").toString(); StaticData::m_bDevServer = a_setReg.value(tr("/devServer"), 0).toBool(); //false if(StaticData::m_bDevServer) { StaticData::m_sPortTCP = 1267; - StaticData::m_sPortRTSP = 8512; - StaticData::m_sPortRTMP = 1959; StaticData::m_sMyId = fGetIdForDevServer(); } @@ -60,8 +51,6 @@ void SettingsApp::fSaveServerData(QString _sIP, QString _sPortTCP, QString _sPor StaticData::m_bDevServer = true; StaticData::m_sKeyDevServer = _sKeyDevServer; StaticData::m_sPortTCP = 1267; - StaticData::m_sPortRTSP = 8512; - StaticData::m_sPortRTMP = 1959; } else { @@ -72,42 +61,15 @@ void SettingsApp::fSaveServerData(QString _sIP, QString _sPortTCP, QString _sPor StaticData::m_bDevServer = false; StaticData::m_sPortTCP = _sPortTCP.toUShort(); - StaticData::m_sPortRTSP = _sPortRTSP.toUShort(); - StaticData::m_sPortRTMP = _sPortRTMP.toUShort(); a_setReg.setValue(QLatin1String("/portTCP"), _sPortTCP); - a_setReg.setValue(QLatin1String("/portRTSP"), _sPortRTSP); - a_setReg.setValue(QLatin1String("/portRTMP"), _sPortRTMP); } a_setReg.setValue(QLatin1String("/serverIP"), StaticData::m_sServerIP); a_setReg.setValue(QLatin1String("/devServer"), StaticData::m_bDevServer); a_setReg.setValue(QLatin1String("/keyDevServer"), StaticData::m_sKeyDevServer); - a_setReg.setValue(QLatin1String("/serverPassword"), StaticData::m_sServerPassword); - a_setReg.endGroup(); - -} - -void SettingsApp::fSaveStreamRTSP(bool _bVar) -{ - StaticData::_iStreamRTSP = _bVar; - - //QSettings a_setReg(QLatin1String("Inspectrum"), StaticData::m_sNameApp ); - QSettings a_setReg(StaticData::m_sSettingsFile, QSettings::IniFormat ); - a_setReg.beginGroup(QLatin1String("/Settings")); - a_setReg.setValue(QLatin1String("/streamRTSP"), StaticData::_iStreamRTSP); - a_setReg.endGroup(); -} - -void SettingsApp::fSaveEvcoderType(int _iVar) -{ - StaticData::_iCurEnvoderV = _iVar; - - //QSettings a_setReg(QLatin1String("Inspectrum"), StaticData::m_sNameApp ); - QSettings a_setReg(StaticData::m_sSettingsFile, QSettings::IniFormat ); - a_setReg.beginGroup(QLatin1String("/Settings")); - a_setReg.setValue(QLatin1String("/streamEncoderType"), StaticData::_iCurEnvoderV); + //a_setReg.setValue(QLatin1String("/serverPassword"), StaticData::m_sServerPassword); a_setReg.endGroup(); } @@ -117,8 +79,6 @@ void SettingsApp::fUpdateServerData() QSettings a_setReg(StaticData::m_sSettingsFile, QSettings::IniFormat ); a_setReg.beginGroup(QLatin1String("/Settings")); StaticData::m_sPortTCP = a_setReg.value(tr("/portTCP"), 1235).toString().toUShort(); //1235 - StaticData::m_sPortRTSP = a_setReg.value(tr("/portRTSP"), 8554).toString().toUShort(); //8504 - StaticData::m_sPortRTMP = a_setReg.value(tr("/portRTMP"), 1935).toString().toUShort(); //1935 a_setReg.endGroup(); //qDebug() << "SettingsApp::fUpdateServerData 10:" << StaticData::m_sPortTCP; @@ -149,6 +109,8 @@ QString SettingsApp::fGetIdForDevServer() if(a_sId != "0") a_sId += "_uds"; + //qDebug() << "SettingsApp::fGetIdForDevServer 10:" << a_sId; + return a_sId; } diff --git a/src/settingsapp.h b/src/settingsapp.h index 9c99a3b..3d2e482 100644 --- a/src/settingsapp.h +++ b/src/settingsapp.h @@ -18,8 +18,6 @@ class SettingsApp : public QObject public slots: void fReadSettings(); void fSaveServerData(QString _sIP, QString _sPortTCP, QString _sPortRTSP, QString _sPortRTMP, QString _sKeyDevServer, QString _sServerPas); - void fSaveStreamRTSP(bool _bVar); - void fSaveEvcoderType(int _iVar); void fUpdateServerData(); bool slDevServer();