| 1 | /* ---------------------------------- textDialog.cpp -------------------------------------------------------------------------- |
| 2 | Class to display a simple go-noGo dialog |
| 3 | |
| 4 | =============================================================================================================================== |
| 5 | =============================================================================================================================== |
| 6 | This file is part of "luckyBackup" project |
| 7 | Copyright, Loukas Avgeriou |
| 8 | luckyBackup is distributed under the terms of the GNU General Public License |
| 9 | luckyBackup is free software: you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by |
| 11 | the Free Software Foundation, either version 3 of the License, or |
| 12 | (at your option) any later version. |
| 13 | |
| 14 | luckyBackup is distributed in the hope that it will be useful, |
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | GNU General Public License for more details. |
| 18 | |
| 19 | You should have received a copy of the GNU General Public License |
| 20 | along with luckyBackup. If not, see <http://www.gnu.org/licenses/>. |
| 21 | |
| 22 | |
| 23 | project version : Please see "main.cpp" for project version |
| 24 | |
| 25 | developer : luckyb |
| 26 | last modified : 22 May 2016 |
| 27 | |
| 28 | =============================================================================================================================== |
| 29 | =============================================================================================================================== |
| 30 | */ |
| 31 | |
| 32 | #include "textDialog.h"cxx . . $ `<file>/src/textDialog.h`/ |
| 33 | |
| 34 | #include <QClipboard> |
| 35 | |
| 36 | #include "global.h"cxx . . $ `<file>/src/global.h`/ |
| 37 | |
| 38 | // class textDialog Constructor================================================================================================= |
| 39 | // Displays a simple dialog with text info, ok-cancel buttons and a lineEdit for user input |
| 40 | textDialogcxx . . $ textDialog#::textDialogcxx . . $ textDialog#textDialog(9c8c077708043c75). (const QStringcxx . . $ QString# type, const QStringcxx . . $ QString# ReplaceInput, QWidgetcxx . . $ QWidget# *parent) : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d). (parent) |
| 41 | { |
| 42 | uiTcxx . . $ textDialog#uiT..setupUicxx . . $ Ui_textDialog#setupUi(d194de0c0f68c28b).(this); |
| 43 | uiTcxx . . $ textDialog#uiT..checkBox_selectcxx . . $ Ui_textDialog#checkBox_select. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 44 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 45 | uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 46 | |
| 47 | //connect okay & cancel pushButton SLOTs ---------------- |
| 48 | connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiTcxx . . $ textDialog#uiT..pushButton_okcxx . . $ Ui_textDialog#pushButton_ok., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( okay() ) ); |
| 49 | connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( cancel() ) ); |
| 50 | |
| 51 | GoOncxx . . $ textDialog#GoOn. = 0; |
| 52 | Typecxx . . $ textDialog#Type. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). type; |
| 53 | TextPassedcxx . . $ textDialog#TextPassed. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). ReplaceInput; |
| 54 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "NewProfile") |
| 55 | { |
| 56 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Enter the name of the new profile :")); |
| 57 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setEchoModecxx . . $ QLineEdit#setEchoMode(c3447ea4f1c9f77d). (QLineEditcxx . . $ QLineEdit#::Normalcxx . . $ QLineEdit#Normal.); |
| 58 | } |
| 59 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "RenameProfile") |
| 60 | { |
| 61 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Enter the new name of the profile :")); |
| 62 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setEchoModecxx . . $ QLineEdit#setEchoMode(c3447ea4f1c9f77d). (QLineEditcxx . . $ QLineEdit#::Normalcxx . . $ QLineEdit#Normal.); |
| 63 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(ReplaceInput); |
| 64 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> selectAllcxx . . $ QLineEdit#selectAll(49f6e7a06ebc5aa8).(); |
| 65 | } |
| 66 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "ProfileDescription") |
| 67 | { |
| 68 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 69 | uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 70 | this -> resizecxx . . $ QWidget#resize(3e454b8ccf442868).(640, 480); |
| 71 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Profile description :")); |
| 72 | uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> setPlainTextcxx . . $ QPlainTextEdit#setPlainText(3520e46b33348bf6).(ReplaceInput); |
| 73 | uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> selectAllcxx . . $ QPlainTextEdit#selectAll(49f6e7a06ebc5aa8).(); |
| 74 | } |
| 75 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "ImportProfile") |
| 76 | { |
| 77 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("A profile with the same name already exists") +cxx . . $ operator+(3d22f08efddf8107). "<br>" +cxx . . $ operator+(fab9b4f80031f353). |
| 78 | trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Please enter a different name")); |
| 79 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setEchoModecxx . . $ QLineEdit#setEchoMode(c3447ea4f1c9f77d). (QLineEditcxx . . $ QLineEdit#::Normalcxx . . $ QLineEdit#Normal.); |
| 80 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(ReplaceInput); |
| 81 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> selectAllcxx . . $ QLineEdit#selectAll(49f6e7a06ebc5aa8).(); |
| 82 | } |
| 83 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "password") |
| 84 | { |
| 85 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Enter password :")); |
| 86 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setEchoModecxx . . $ QLineEdit#setEchoMode(c3447ea4f1c9f77d). (QLineEditcxx . . $ QLineEdit#::Passwordcxx . . $ QLineEdit#Password.); |
| 87 | } |
| 88 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "passphrase") |
| 89 | { |
| 90 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Enter passphrase :")); |
| 91 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setEchoModecxx . . $ QLineEdit#setEchoMode(c3447ea4f1c9f77d). (QLineEditcxx . . $ QLineEdit#::Passwordcxx . . $ QLineEdit#Password.); |
| 92 | } |
| 93 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "CloneWarning") |
| 94 | { |
| 95 | uiTcxx . . $ textDialog#uiT..checkBox_selectcxx . . $ Ui_textDialog#checkBox_select. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 96 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 97 | uiTcxx . . $ textDialog#uiT..checkBox_selectcxx . . $ Ui_textDialog#checkBox_select. -> setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6). (trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Do not show this again for this task")); |
| 98 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 99 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("You have selected to \"Backup the contents of the source directory\"<br>together with the \"delete files on the destination\" option") +cxx . . $ operator+(3d22f08efddf8107)."<br><br>" +cxx . . $ operator+(fab9b4f80031f353). trcxx . . $ textDialog#tr(75d9f1c324b4579d).("BEWARE, if your intention is NOT to clone source to destination !!") +cxx . . $ operator+(3d22f08efddf8107)."<br><br>" +cxx . . $ operator+(fab9b4f80031f353). |
| 100 | trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Are you sure you wish to proceed ??") +cxx . . $ operator+(3d22f08efddf8107). "<br><br>"); |
| 101 | resizecxx . . $ QWidget#resize(1c5f201b4c2f0aba).(sizeHintcxx . . $ QDialog#sizeHint(4b3b776e5ee2b367).()); |
| 102 | } |
| 103 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "ValidateDialog") |
| 104 | { |
| 105 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 106 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 107 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setPixmapcxx . . $ QLabel#setPixmap(8887f7d25b86c3f4).(QPixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":/luckyPrefix/validate.png"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 108 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Copy command to clipboard")); |
| 109 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/luckyPrefix/copy.png"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 110 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(ReplaceInput); |
| 111 | resizecxx . . $ QWidget#resize(1c5f201b4c2f0aba).(sizeHintcxx . . $ QDialog#sizeHint(4b3b776e5ee2b367).()); |
| 112 | } |
| 113 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "ViewCurrentCrontab") |
| 114 | { |
| 115 | this -> resizecxx . . $ QWidget#resize(3e454b8ccf442868).(640, 480); |
| 116 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 117 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 118 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(ReplaceInput); |
| 119 | } |
| 120 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "emailOutput") |
| 121 | { |
| 122 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 123 | uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 124 | this -> resizecxx . . $ QWidget#resize(3e454b8ccf442868).(640, 480); |
| 125 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("eMail information")); |
| 126 | uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> setPlainTextcxx . . $ QPlainTextEdit#setPlainText(3520e46b33348bf6).(ReplaceInput); |
| 127 | uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> setReadOnlycxx . . $ QPlainTextEdit#setReadOnly(b45ddcbc8423892c).(true); |
| 128 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 129 | } |
| 130 | |
| 131 | // The next are used instead of standard Qt dialogs for translation reasons |
| 132 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "QtInformation") |
| 133 | { |
| 134 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 135 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 136 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setPixmapcxx . . $ QLabel#setPixmap(8887f7d25b86c3f4).(QPixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":/luckyPrefix/validate.png"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 137 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(ReplaceInput); |
| 138 | |
| 139 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 140 | resizecxx . . $ QWidget#resize(1c5f201b4c2f0aba).(sizeHintcxx . . $ QDialog#sizeHint(4b3b776e5ee2b367).()); |
| 141 | } |
| 142 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "QtWarning") |
| 143 | { |
| 144 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 145 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 146 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setPixmapcxx . . $ QLabel#setPixmap(8887f7d25b86c3f4).(QPixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":/luckyPrefix/warning.png"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 147 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(ReplaceInput); |
| 148 | |
| 149 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 150 | resizecxx . . $ QWidget#resize(1c5f201b4c2f0aba).(sizeHintcxx . . $ QDialog#sizeHint(4b3b776e5ee2b367).()); |
| 151 | } |
| 152 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "QtCritical") |
| 153 | { |
| 154 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 155 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 156 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setPixmapcxx . . $ QLabel#setPixmap(8887f7d25b86c3f4).(QPixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":/luckyPrefix/cancel.png"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 157 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(ReplaceInput); |
| 158 | |
| 159 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 160 | resizecxx . . $ QWidget#resize(1c5f201b4c2f0aba).(sizeHintcxx . . $ QDialog#sizeHint(4b3b776e5ee2b367).()); |
| 161 | } |
| 162 | if (type ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "QtQuestion") |
| 163 | { |
| 164 | uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(false); |
| 165 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(true); |
| 166 | uiTcxx . . $ textDialog#uiT..label_warningcxx . . $ Ui_textDialog#label_warning. -> setPixmapcxx . . $ QLabel#setPixmap(8887f7d25b86c3f4).(QPixmapcxx . . $ QPixmap#QPixmap(dec4543235ec9b46).(":/luckyPrefix/about.png"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 167 | uiTcxx . . $ textDialog#uiT..label_messagecxx . . $ Ui_textDialog#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(ReplaceInput); |
| 168 | |
| 169 | uiTcxx . . $ textDialog#uiT..pushButton_cancelcxx . . $ Ui_textDialog#pushButton_cancel. -> setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("No")); |
| 170 | uiTcxx . . $ textDialog#uiT..pushButton_okcxx . . $ Ui_textDialog#pushButton_ok. -> setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(trcxx . . $ textDialog#tr(75d9f1c324b4579d).("Yes")); |
| 171 | resizecxx . . $ QWidget#resize(1c5f201b4c2f0aba).(sizeHintcxx . . $ QDialog#sizeHint(4b3b776e5ee2b367).()); |
| 172 | } |
| 173 | } |
| 174 | // SLOTS------------------------------------------------------------------------------------- |
| 175 | // --------------------------------okay pressed------------------------------------------------ |
| 176 | void textDialogcxx . . $ textDialog#::okaycxx . . $ textDialog#okay(49f6e7a06ebc5aa8).() |
| 177 | { |
| 178 | GoOncxx . . $ textDialog#GoOn. = 1; |
| 179 | userInputcxx . . $ textDialog#userInput. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiTcxx . . $ textDialog#uiT..lineEdit_userInputcxx . . $ Ui_textDialog#lineEdit_userInput. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 180 | |
| 181 | // Do not perform any further actions for the following categories: |
| 182 | if ((Typecxx . . $ textDialog#Type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "password") || (Typecxx . . $ textDialog#Type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "passphrase")) |
| 183 | { |
| 184 | closecxx . . $ QWidget#close(c9857a73d68e59ba).(); |
| 185 | return; |
| 186 | } |
| 187 | if (Typecxx . . $ textDialog#Type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "ProfileDescription") |
| 188 | { |
| 189 | userInputcxx . . $ textDialog#userInput. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiTcxx . . $ textDialog#uiT..textEdit_userInputcxx . . $ Ui_textDialog#textEdit_userInput. -> toPlainTextcxx . . $ QPlainTextEdit#toPlainText(6ef7b6c27b00b43d).(); |
| 190 | closecxx . . $ QWidget#close(c9857a73d68e59ba).(); |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | //remove trailing or starting whitespaces and invalid characters |
| 195 | QStringListcxx . . $ QStringList# invalidcxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 196 | invalid <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "`"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "!"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "@"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "#"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "$"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "%"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "%"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "^"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "&"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "*"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "("cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). ")"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "+"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "="cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "{"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "["cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "}"cxx . . $ QString#QString(85c52e162fed56f9). |
| 197 | <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "]"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). ":"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). ";"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "\""cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "'"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "|"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "\\"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "<"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). ","cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). ">"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "?"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "/"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 198 | for (int count=0; count<invalid.sizecxx . . $ QList#size(ea6fe5115c70a13f).(); ++count) |
| 199 | userInputcxx . . $ textDialog#userInput..replacecxx . . $ QString#replace(192e628656427d1c).(invalid.atcxx . . $ QList#at(e2681f9bb6b2f357).(count),""cxx . . $ QString#QString(85c52e162fed56f9).); |
| 200 | |
| 201 | while ( (userInputcxx . . $ textDialog#userInput..endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(" "cxx . . $ QString#QString(85c52e162fed56f9).)) || (userInputcxx . . $ textDialog#userInput..endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("."cxx . . $ QString#QString(85c52e162fed56f9).)) ) |
| 202 | userInputcxx . . $ textDialog#userInput..chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1); |
| 203 | while ( (userInputcxx . . $ textDialog#userInput..startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("."cxx . . $ QString#QString(85c52e162fed56f9).)) || (userInputcxx . . $ textDialog#userInput..startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(" "cxx . . $ QString#QString(85c52e162fed56f9).)) ) |
| 204 | userInputcxx . . $ textDialog#userInput..removecxx . . $ QString#remove(6483560ce2afa901).(0,1); |
| 205 | |
| 206 | if (userInputcxx . . $ textDialog#userInput. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "") |
| 207 | GoOncxx . . $ textDialog#GoOn. = 2; |
| 208 | |
| 209 | if (userInputcxx . . $ textDialog#userInput. ==cxx . . $ `operator==`(5bc2975d2d751687). profileNamecxx . . $ Global/profileName.) |
| 210 | GoOncxx . . $ textDialog#GoOn. = 3; |
| 211 | |
| 212 | if (uiTcxx . . $ textDialog#uiT..checkBox_selectcxx . . $ Ui_textDialog#checkBox_select. -> isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).()) //"Do not show this again check box |
| 213 | GoOncxx . . $ textDialog#GoOn. = 4; |
| 214 | closecxx . . $ QWidget#close(c9857a73d68e59ba).(); |
| 215 | } |
| 216 | // --------------------------------cancel pressed------------------------------------------------ |
| 217 | void textDialogcxx . . $ textDialog#::cancelcxx . . $ textDialog#cancel(49f6e7a06ebc5aa8).() |
| 218 | { |
| 219 | //GoOn == 0 |
| 220 | if (Typecxx . . $ textDialog#Type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "ValidateDialog") |
| 221 | { |
| 222 | QStringcxx . . $ QString# sourcecxx . . $ QString#QString(ced63f7c635d850d)., destcxx . . $ QString#QString(ced63f7c635d850d)., Command_Clipboardcxx . . $ QString#QString(ced63f7c635d850d).; |
| 223 | |
| 224 | //copy command to clipboard |
| 225 | TextPassedcxx . . $ textDialog#TextPassed. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). TextPassedcxx . . $ textDialog#TextPassed..rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(TextPassedcxx . . $ textDialog#TextPassed..sizecxx . . $ QString#size(455f465bc33b4cdf).()-TextPassedcxx . . $ textDialog#TextPassed..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("<font color=red>"cxx . . $ QString#QString(85c52e162fed56f9).)); //remove all irrelevant text |
| 226 | source =cxx . . $ QString#`operator=`(4f35bf974e7f8568). TextPassedcxx . . $ textDialog#TextPassed..rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(TextPassedcxx . . $ textDialog#TextPassed..sizecxx . . $ QString#size(455f465bc33b4cdf).()-TextPassedcxx . . $ textDialog#TextPassed..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("<font color=magenta>"cxx . . $ QString#QString(85c52e162fed56f9).)); //copy source & dest inside QString source |
| 227 | TextPassedcxx . . $ textDialog#TextPassed..removecxx . . $ QString#remove(d7c3fdecc68f03c6).(source); //remove source & dest from whole command |
| 228 | dest =cxx . . $ QString#`operator=`(4f35bf974e7f8568). source.rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(source.sizecxx . . $ QString#size(455f465bc33b4cdf).()-source.lastIndexOfcxx . . $ QString#lastIndexOf(a1e52806cd31c200).("<font color=magenta>"cxx . . $ QString#QString(85c52e162fed56f9).)); //copy dest inside QString dest |
| 229 | source.removecxx . . $ QString#remove(d7c3fdecc68f03c6).(dest); //remove dest from source |
| 230 | |
| 231 | source.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("<font color=magenta>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 232 | source.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("</font>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 233 | source.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("<br>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 234 | if (source.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(" "cxx . . $ QString#QString(85c52e162fed56f9).)) |
| 235 | source.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1); |
| 236 | source.replacecxx . . $ QString#replace(192e628656427d1c).(" "cxx . . $ QString#QString(85c52e162fed56f9).,"\\ "cxx . . $ QString#QString(85c52e162fed56f9).); //replace whitespaces with " \" |
| 237 | |
| 238 | dest.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("<font color=magenta>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 239 | dest.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("</font>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 240 | dest.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("<br>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 241 | dest.replacecxx . . $ QString#replace(192e628656427d1c).(" "cxx . . $ QString#QString(85c52e162fed56f9).,"\\ "cxx . . $ QString#QString(85c52e162fed56f9).); |
| 242 | |
| 243 | Command_Clipboard =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). TextPassedcxx . . $ textDialog#TextPassed. +cxx . . $ operator+(fab9b4f80031f353). source +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). dest; |
| 244 | Command_Clipboard.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("<font color=red>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 245 | Command_Clipboard.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("<font color=blue>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 246 | Command_Clipboard.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("</font>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 247 | Command_Clipboard.removecxx . . $ QString#remove(d7c3fdecc68f03c6).("<br>"cxx . . $ QString#QString(85c52e162fed56f9).,Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 248 | |
| 249 | QClipboardcxx . . $ QClipboard# *clipboard = QApplicationcxx . . $ QApplication#::clipboardcxx . . $ QGuiApplication#clipboard(a5a00f8d44f5ac9e).(); |
| 250 | clipboard->setTextcxx . . $ QClipboard#setText(9f492b8a441aa8de).(Command_Clipboard); |
| 251 | } |
| 252 | else |
| 253 | closecxx . . $ QWidget#close(c9857a73d68e59ba).(); |
| 254 | } |
| 255 | |
| 256 | void textDialogcxx . . $ textDialog#::closeEventcxx . . $ textDialog#closeEvent(642e80679aeb34f8).(QCloseEventcxx . . $ QCloseEvent# *event) |
| 257 | { |
| 258 | event->acceptcxx . . $ QEvent#accept(49f6e7a06ebc5aa8).(); |
| 259 | } |
| 260 | // --------------------------------accessors----------------------------------- |
| 261 | int textDialogcxx . . $ textDialog#::getGoOncxx . . $ textDialog#getGoOn(b126dc7c1de90089).() |
| 262 | { |
| 263 | return GoOncxx . . $ textDialog#GoOn. ; |
| 264 | } |
| 265 | QStringcxx . . $ QString# textDialogcxx . . $ textDialog#::getUserInputcxx . . $ textDialog#getUserInput(4365c3963150523e).() |
| 266 | { |
| 267 | return userInputcxx . . $ QString#QString(132dd6869045752b).; |
| 268 | } |
| 269 | |
| 270 | // end of textDialog.cpp --------------------------------------------------------------------------- |
| 271 |