| 1 | /* ---------------------------------- winDialog.cpp -------------------------------------------------------------------------- |
| 2 | Class to display a dialog and declare rsync and ssh paths |
| 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 "winDialog.h"cxx . . $ `<file>/src/winDialog.h`/ |
| 33 | |
| 34 | #include <QSignalMapper> |
| 35 | #include <QDirModel> |
| 36 | #include <QCompleter> |
| 37 | #include <QCloseEvent> |
| 38 | |
| 39 | #include "qdirdialog.h"cxx . . $ `<file>/src/qdirdialog.h`/ |
| 40 | #include "global.h"cxx . . $ `<file>/src/global.h`/ |
| 41 | |
| 42 | // class winDialog Constructor================================================================================================= |
| 43 | // Displays a simple dialog with text info, ok-cancel buttons and lineEdits for user input |
| 44 | winDialogcxx . . $ winDialog#::winDialogcxx . . $ winDialog#winDialog(108f35f7aa7f3cf9). (QWidgetcxx . . $ QWidget# *parent) : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d). (parent) |
| 45 | { |
| 46 | uiDcxx . . $ winDialog#uiD..setupUicxx . . $ Ui_winDialog#setupUi(d194de0c0f68c28b).(this); |
| 47 | |
| 48 | uiDcxx . . $ winDialog#uiD..lineEdit_rsyncPathcxx . . $ Ui_winDialog#lineEdit_rsyncPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(rsyncCommandPathcxx . . $ Global/rsyncCommandPath.); |
| 49 | uiDcxx . . $ winDialog#uiD..lineEdit_sshPathcxx . . $ Ui_winDialog#lineEdit_sshPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(sshCommandPathcxx . . $ Global/sshCommandPath.); |
| 50 | uiDcxx . . $ winDialog#uiD..lineEdit_cygpathcxx . . $ Ui_winDialog#lineEdit_cygpath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(cygpathCommandcxx . . $ Global/cygpathCommand.); |
| 51 | uiDcxx . . $ winDialog#uiD..lineEdit_dosdevcxx . . $ Ui_winDialog#lineEdit_dosdev. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(dosdevCommandcxx . . $ Global/dosdevCommand.); |
| 52 | uiDcxx . . $ winDialog#uiD..lineEdit_vshadowcxx . . $ Ui_winDialog#lineEdit_vshadow. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(vshadowDircxx . . $ Global/vshadowDir.); |
| 53 | uiDcxx . . $ winDialog#uiD..lineEdit_tempdircxx . . $ Ui_winDialog#lineEdit_tempdir. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(tempDirPathcxx . . $ Global/tempDirPath.); |
| 54 | uiDcxx . . $ winDialog#uiD..lineEdit_appdircxx . . $ Ui_winDialog#lineEdit_appdir.-> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(luckyBackupDircxx . . $ Global/luckyBackupDir.); |
| 55 | |
| 56 | |
| 57 | //connect okay & cancel pushButton SLOTs ---------------- |
| 58 | connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiDcxx . . $ winDialog#uiD..pushButton_okcxx . . $ Ui_winDialog#pushButton_ok., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( okay() ) ); |
| 59 | connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiDcxx . . $ winDialog#uiD..pushButton_cancelcxx . . $ Ui_winDialog#pushButton_cancel., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( cancel() ) ); |
| 60 | |
| 61 | //Connect all toolButtons with the browse SLOT |
| 62 | //Map all the toolButton signals and transmit a different integer depending on the toolbutton |
| 63 | QSignalMappercxx . . $ QSignalMapper# *signalMapper = new QSignalMappercxx . . $ QSignalMapper#(this); |
| 64 | signalMapper -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_rsynccxx . . $ Ui_winDialog#toolButton_rsync., 0 ); |
| 65 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_rsynccxx . . $ Ui_winDialog#toolButton_rsync., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 66 | signalMapper -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_sshcxx . . $ Ui_winDialog#toolButton_ssh., 1 ); |
| 67 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_sshcxx . . $ Ui_winDialog#toolButton_ssh., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 68 | signalMapper -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_cygpathcxx . . $ Ui_winDialog#toolButton_cygpath., 2 ); |
| 69 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_cygpathcxx . . $ Ui_winDialog#toolButton_cygpath., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 70 | signalMapper -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_dosdevcxx . . $ Ui_winDialog#toolButton_dosdev., 3 ); |
| 71 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_dosdevcxx . . $ Ui_winDialog#toolButton_dosdev., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 72 | signalMapper -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_vshadowcxx . . $ Ui_winDialog#toolButton_vshadow., 4 ); |
| 73 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_vshadowcxx . . $ Ui_winDialog#toolButton_vshadow., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 74 | signalMapper -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_tempdircxx . . $ Ui_winDialog#toolButton_tempdir., 5 ); |
| 75 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_tempdircxx . . $ Ui_winDialog#toolButton_tempdir., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 76 | signalMapper -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_appdircxx . . $ Ui_winDialog#toolButton_appdir., 6 ); |
| 77 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_appdircxx . . $ Ui_winDialog#toolButton_appdir., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 78 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(signalMapper, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(mapped( const int)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( browse( const int) ) ); |
| 79 | |
| 80 | //Connect all toolButtons with the useDefault SLOT |
| 81 | //Map all the toolButton signals and transmit a different integer depending on the toolbutton |
| 82 | QSignalMappercxx . . $ QSignalMapper# *signalMapper2 = new QSignalMappercxx . . $ QSignalMapper#(this); |
| 83 | signalMapper2 -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_defaultRsynccxx . . $ Ui_winDialog#toolButton_defaultRsync., 0 ); |
| 84 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_defaultRsynccxx . . $ Ui_winDialog#toolButton_defaultRsync., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper2 , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 85 | signalMapper2 -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_defaultSshcxx . . $ Ui_winDialog#toolButton_defaultSsh., 1 ); |
| 86 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_defaultSshcxx . . $ Ui_winDialog#toolButton_defaultSsh., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper2 , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 87 | signalMapper2 -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_defaultCygpathcxx . . $ Ui_winDialog#toolButton_defaultCygpath., 2 ); |
| 88 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_defaultCygpathcxx . . $ Ui_winDialog#toolButton_defaultCygpath., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper2 , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 89 | signalMapper2 -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_defaultDosdevcxx . . $ Ui_winDialog#toolButton_defaultDosdev., 3 ); |
| 90 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_defaultDosdevcxx . . $ Ui_winDialog#toolButton_defaultDosdev., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper2 , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 91 | signalMapper2 -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_defaultVshadowcxx . . $ Ui_winDialog#toolButton_defaultVshadow., 4 ); |
| 92 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_defaultVshadowcxx . . $ Ui_winDialog#toolButton_defaultVshadow., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper2 , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 93 | signalMapper2 -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_defaultTempdircxx . . $ Ui_winDialog#toolButton_defaultTempdir., 5 ); |
| 94 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_defaultTempdircxx . . $ Ui_winDialog#toolButton_defaultTempdir., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper2 , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 95 | signalMapper2 -> setMappingcxx . . $ QSignalMapper#setMapping(3f47e595a91bc133). ( uiDcxx . . $ winDialog#uiD..toolButton_defaultAppdircxx . . $ Ui_winDialog#toolButton_defaultAppdir., 6 ); |
| 96 | connectcxx . . $ QObject#connect(158df1d9a01a3410). (uiDcxx . . $ winDialog#uiD..toolButton_defaultAppdircxx . . $ Ui_winDialog#toolButton_defaultAppdir., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (clicked() ), signalMapper2 , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`! (map())); |
| 97 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(signalMapper2, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(mapped( const int)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( useDefault( const int) ) ); |
| 98 | |
| 99 | //initialize a completer for the lineEdits |
| 100 | QCompletercxx . . $ QCompleter# *completer = new QCompletercxx . . $ QCompleter#QCompleter(749de1b6ae65bddd).(this); |
| 101 | completer -> setModelcxx . . $ QCompleter#setModel(c6e1f1e42522b780).(new QDirModelcxx . . $ QDirModel#(completer)); |
| 102 | uiDcxx . . $ winDialog#uiD..lineEdit_rsyncPathcxx . . $ Ui_winDialog#lineEdit_rsyncPath. -> setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 103 | uiDcxx . . $ winDialog#uiD..lineEdit_sshPathcxx . . $ Ui_winDialog#lineEdit_sshPath. -> setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 104 | uiDcxx . . $ winDialog#uiD..lineEdit_cygpathcxx . . $ Ui_winDialog#lineEdit_cygpath. -> setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 105 | uiDcxx . . $ winDialog#uiD..lineEdit_dosdevcxx . . $ Ui_winDialog#lineEdit_dosdev. -> setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 106 | uiDcxx . . $ winDialog#uiD..lineEdit_vshadowcxx . . $ Ui_winDialog#lineEdit_vshadow. -> setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 107 | uiDcxx . . $ winDialog#uiD..lineEdit_tempdircxx . . $ Ui_winDialog#lineEdit_tempdir. -> setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 108 | uiDcxx . . $ winDialog#uiD..lineEdit_appdircxx . . $ Ui_winDialog#lineEdit_appdir. -> setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(completer); |
| 109 | } |
| 110 | |
| 111 | |
| 112 | // --------------------------------okay pressed------------------------------------------------ |
| 113 | void winDialogcxx . . $ winDialog#::okaycxx . . $ winDialog#okay(49f6e7a06ebc5aa8).() |
| 114 | { |
| 115 | rsyncCommandPathcxx . . $ Global/rsyncCommandPath. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiDcxx . . $ winDialog#uiD..lineEdit_rsyncPathcxx . . $ Ui_winDialog#lineEdit_rsyncPath. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 116 | sshCommandPathcxx . . $ Global/sshCommandPath. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiDcxx . . $ winDialog#uiD..lineEdit_sshPathcxx . . $ Ui_winDialog#lineEdit_sshPath. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 117 | cygpathCommandcxx . . $ Global/cygpathCommand. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiDcxx . . $ winDialog#uiD..lineEdit_cygpathcxx . . $ Ui_winDialog#lineEdit_cygpath. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 118 | dosdevCommandcxx . . $ Global/dosdevCommand. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiDcxx . . $ winDialog#uiD..lineEdit_dosdevcxx . . $ Ui_winDialog#lineEdit_dosdev. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 119 | vshadowDircxx . . $ Global/vshadowDir. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiDcxx . . $ winDialog#uiD..lineEdit_vshadowcxx . . $ Ui_winDialog#lineEdit_vshadow. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 120 | tempDirPathcxx . . $ Global/tempDirPath. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiDcxx . . $ winDialog#uiD..lineEdit_tempdircxx . . $ Ui_winDialog#lineEdit_tempdir. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 121 | luckyBackupDircxx . . $ Global/luckyBackupDir. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). uiDcxx . . $ winDialog#uiD..lineEdit_appdircxx . . $ Ui_winDialog#lineEdit_appdir. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 122 | // if (!vshadowDir.endsWith(SLASH)) |
| 123 | // vshadowDir=vshadowDir+SLASH; |
| 124 | // if (!tempDirPath.endsWith(SLASH)) |
| 125 | // tempDirPath=tempDirPath+SLASH; |
| 126 | if (!luckyBackupDircxx . . $ Global/luckyBackupDir..endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(SLASHcxx . . $ Global/SLASH.)) |
| 127 | luckyBackupDircxx . . $ Global/luckyBackupDir.=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).luckyBackupDircxx . . $ Global/luckyBackupDir.+cxx . . $ operator+(fab9b4f80031f353).SLASHcxx . . $ Global/SLASH.; |
| 128 | setAppDircxx . . $ Global/setAppDir(7df51288a9ebd664).(luckyBackupDircxx . . $ QString#QString(132dd6869045752b).); |
| 129 | |
| 130 | closecxx . . $ QWidget#close(c9857a73d68e59ba).(); |
| 131 | } |
| 132 | |
| 133 | // --------------------------------cancel pressed------------------------------------------------ |
| 134 | void winDialogcxx . . $ winDialog#::cancelcxx . . $ winDialog#cancel(49f6e7a06ebc5aa8).() |
| 135 | { |
| 136 | closecxx . . $ QWidget#close(c9857a73d68e59ba).(); |
| 137 | } |
| 138 | |
| 139 | void winDialogcxx . . $ winDialog#::closeEventcxx . . $ winDialog#closeEvent(642e80679aeb34f8).(QCloseEventcxx . . $ QCloseEvent# *event) |
| 140 | { |
| 141 | event->acceptcxx . . $ QEvent#accept(49f6e7a06ebc5aa8).(); |
| 142 | } |
| 143 | |
| 144 | // browse button pressed===================================================================================================== |
| 145 | //opens a QFileDialog to browse for files/folders locally |
| 146 | void winDialogcxx . . $ winDialog#::browsecxx . . $ winDialog#browse(d4f767463ce0a6b3).(const int type) |
| 147 | { |
| 148 | QStringcxx . . $ QString# newLineEditcxx . . $ QString#QString(ced63f7c635d850d).; |
| 149 | QDirDialogcxx . . $ QDirDialog#* fd; |
| 150 | |
| 151 | switch (type) |
| 152 | { |
| 153 | //rsync browse button |
| 154 | case 0: newLineEdit =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QFileDialogcxx . . $ QFileDialog#::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236). (this, trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Select rsync command", |
| 155 | "file selection dialog title"),uiDcxx . . $ winDialog#uiD..lineEdit_rsyncPathcxx . . $ Ui_winDialog#lineEdit_rsyncPath. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(),trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Executable Files (*.exe)")); |
| 156 | if (newLineEdit !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "") //if something is selected indeed |
| 157 | uiDcxx . . $ winDialog#uiD..lineEdit_rsyncPathcxx . . $ Ui_winDialog#lineEdit_rsyncPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(newLineEditcxx . . $ QString#QString(132dd6869045752b).)); |
| 158 | break; |
| 159 | //ssh browse button |
| 160 | case 1: newLineEdit =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QFileDialogcxx . . $ QFileDialog#::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236). (this, trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Select ssh command", |
| 161 | "file selection dialog title"),uiDcxx . . $ winDialog#uiD..lineEdit_sshPathcxx . . $ Ui_winDialog#lineEdit_sshPath. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(),trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Executable Files (*.exe)")); |
| 162 | if (newLineEdit !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "") //if something is selected indeed |
| 163 | uiDcxx . . $ winDialog#uiD..lineEdit_sshPathcxx . . $ Ui_winDialog#lineEdit_sshPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(newLineEditcxx . . $ QString#QString(132dd6869045752b).)); |
| 164 | break; |
| 165 | //cygpath browse button |
| 166 | case 2: newLineEdit =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QFileDialogcxx . . $ QFileDialog#::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236). (this, trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Select cygpath command", |
| 167 | "file selection dialog title"),uiDcxx . . $ winDialog#uiD..lineEdit_cygpathcxx . . $ Ui_winDialog#lineEdit_cygpath. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(),trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Executable Files (*.exe)")); |
| 168 | if (newLineEdit !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "") //if something is selected indeed |
| 169 | uiDcxx . . $ winDialog#uiD..lineEdit_cygpathcxx . . $ Ui_winDialog#lineEdit_cygpath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(newLineEditcxx . . $ QString#QString(132dd6869045752b).)); |
| 170 | break; |
| 171 | //dosdev browse button |
| 172 | case 3: newLineEdit =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QFileDialogcxx . . $ QFileDialog#::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236). (this, trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Select dosdev command", |
| 173 | "file selection dialog title"),uiDcxx . . $ winDialog#uiD..lineEdit_dosdevcxx . . $ Ui_winDialog#lineEdit_dosdev. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(),trcxx . . $ winDialog#tr(75d9f1c324b4579d).("Executable Files (*.exe)")); |
| 174 | if (newLineEdit !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "") //if something is selected indeed |
| 175 | uiDcxx . . $ winDialog#uiD..lineEdit_dosdevcxx . . $ Ui_winDialog#lineEdit_dosdev. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(newLineEditcxx . . $ QString#QString(132dd6869045752b).)); |
| 176 | break; |
| 177 | //vshadow browse button |
| 178 | case 4: |
| 179 | fd = new QDirDialogcxx . . $ QDirDialog#( ".exe"cxx . . $ QString#QString(85c52e162fed56f9)., uiDcxx . . $ winDialog#uiD..lineEdit_vshadowcxx . . $ Ui_winDialog#lineEdit_vshadow. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(), this, |
| 180 | "Dir selection" ); |
| 181 | fd->setWindowTitlecxx . . $ QWidget#setWindowTitle(3520e46b33348bf6).( "Select vshadow directory"cxx . . $ QString#QString(85c52e162fed56f9). ); |
| 182 | // show the dialog |
| 183 | if( fd->execcxx . . $ QDialog#exec(b126dc7c1de90089).() == QDialogcxx . . $ QDialog#::Acceptedcxx . . $ QDialog#Accepted. ) |
| 184 | newLineEdit =cxx . . $ QString#`operator=`(4f35bf974e7f8568). (fd->directorycxx . . $ QFileDialog#directory(ac6552cf9b6b4ed1).()).absolutePathcxx . . $ QDir#absolutePath(6ef7b6c27b00b43d).(); |
| 185 | if (newLineEdit !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "") //if something is selected indeed |
| 186 | uiDcxx . . $ winDialog#uiD..lineEdit_vshadowcxx . . $ Ui_winDialog#lineEdit_vshadow. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(newLineEditcxx . . $ QString#QString(132dd6869045752b).)); |
| 187 | break; |
| 188 | //temp browse button |
| 189 | case 5: |
| 190 | fd = new QDirDialogcxx . . $ QDirDialog#( ""cxx . . $ QString#QString(85c52e162fed56f9)., uiDcxx . . $ winDialog#uiD..lineEdit_tempdircxx . . $ Ui_winDialog#lineEdit_tempdir. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(), this, |
| 191 | "Dir selection" ); |
| 192 | fd->setWindowTitlecxx . . $ QWidget#setWindowTitle(3520e46b33348bf6).( "Select temporary directory"cxx . . $ QString#QString(85c52e162fed56f9). ); |
| 193 | // show the dialog |
| 194 | if( fd->execcxx . . $ QDialog#exec(b126dc7c1de90089).() == QDialogcxx . . $ QDialog#::Acceptedcxx . . $ QDialog#Accepted. ) |
| 195 | newLineEdit =cxx . . $ QString#`operator=`(4f35bf974e7f8568). (fd->directorycxx . . $ QFileDialog#directory(ac6552cf9b6b4ed1).()).absolutePathcxx . . $ QDir#absolutePath(6ef7b6c27b00b43d).(); |
| 196 | if (newLineEdit !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "") //if something is selected indeed |
| 197 | uiDcxx . . $ winDialog#uiD..lineEdit_tempdircxx . . $ Ui_winDialog#lineEdit_tempdir. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(newLineEditcxx . . $ QString#QString(132dd6869045752b).)); |
| 198 | break; |
| 199 | //luckybackup browse button |
| 200 | case 6: |
| 201 | fd = new QDirDialogcxx . . $ QDirDialog#( ".ini"cxx . . $ QString#QString(85c52e162fed56f9)., uiDcxx . . $ winDialog#uiD..lineEdit_appdircxx . . $ Ui_winDialog#lineEdit_appdir. -> textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(), this, |
| 202 | "Dir selection" ); |
| 203 | fd->setWindowTitlecxx . . $ QWidget#setWindowTitle(3520e46b33348bf6).( "Select luckybackup directory"cxx . . $ QString#QString(85c52e162fed56f9). ); |
| 204 | // show the dialog |
| 205 | if( fd->execcxx . . $ QDialog#exec(b126dc7c1de90089).() == QDialogcxx . . $ QDialog#::Acceptedcxx . . $ QDialog#Accepted. ) |
| 206 | newLineEdit =cxx . . $ QString#`operator=`(4f35bf974e7f8568). (fd->directorycxx . . $ QFileDialog#directory(ac6552cf9b6b4ed1).()).absolutePathcxx . . $ QDir#absolutePath(6ef7b6c27b00b43d).(); |
| 207 | if (newLineEdit !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "") //if something is selected indeed |
| 208 | uiDcxx . . $ winDialog#uiD..lineEdit_appdircxx . . $ Ui_winDialog#lineEdit_appdir. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(newLineEditcxx . . $ QString#QString(132dd6869045752b).)); |
| 209 | break; |
| 210 | } |
| 211 | |
| 212 | } |
| 213 | |
| 214 | // default button pressed===================================================================================================== |
| 215 | //opens a QFileDialog to browse for files/folders locally |
| 216 | //This dialog is possible only for non-*nix systems |
| 217 | void winDialogcxx . . $ winDialog#::useDefaultcxx . . $ winDialog#useDefault(d4f767463ce0a6b3).(const int type) |
| 218 | { |
| 219 | switch (type) |
| 220 | { |
| 221 | //rsync default button |
| 222 | case 0: if (WINrunningcxx . . $ Global/WINrunning.) |
| 223 | uiDcxx . . $ winDialog#uiD..lineEdit_rsyncPathcxx . . $ Ui_winDialog#lineEdit_rsyncPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(rsyncDefaultWinCommandcxx . . $ Global/rsyncDefaultWinCommand.); // Default rsync path for windows (declared in global.h) |
| 224 | if (OS2runningcxx . . $ Global/OS2running.) |
| 225 | uiDcxx . . $ winDialog#uiD..lineEdit_rsyncPathcxx . . $ Ui_winDialog#lineEdit_rsyncPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(rsyncDefaultCommandcxx . . $ Global/rsyncDefaultCommand.); // Default rsync path for OS2 (declared in global.h) |
| 226 | break; |
| 227 | //ssh default button |
| 228 | case 1: if (WINrunningcxx . . $ Global/WINrunning.) |
| 229 | uiDcxx . . $ winDialog#uiD..lineEdit_sshPathcxx . . $ Ui_winDialog#lineEdit_sshPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(sshDefaultWinCommandcxx . . $ Global/sshDefaultWinCommand.); // Default ssh path for windows (declared in global.h) |
| 230 | if (OS2runningcxx . . $ Global/OS2running.) |
| 231 | uiDcxx . . $ winDialog#uiD..lineEdit_sshPathcxx . . $ Ui_winDialog#lineEdit_sshPath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(sshDefaultCommandcxx . . $ Global/sshDefaultCommand.); // Default ssh path for OS2 (declared in global.h) |
| 232 | break; |
| 233 | case 2: |
| 234 | uiDcxx . . $ winDialog#uiD..lineEdit_cygpathcxx . . $ Ui_winDialog#lineEdit_cygpath. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(cygpathDefaultCommandcxx . . $ Global/cygpathDefaultCommand.); |
| 235 | break; |
| 236 | case 3: |
| 237 | uiDcxx . . $ winDialog#uiD..lineEdit_dosdevcxx . . $ Ui_winDialog#lineEdit_dosdev. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(dosdevDefaultCommandcxx . . $ Global/dosdevDefaultCommand.); |
| 238 | break; |
| 239 | case 4: |
| 240 | uiDcxx . . $ winDialog#uiD..lineEdit_vshadowcxx . . $ Ui_winDialog#lineEdit_vshadow. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(vshadowDefaultDircxx . . $ Global/vshadowDefaultDir.); |
| 241 | break; |
| 242 | case 5: |
| 243 | uiDcxx . . $ winDialog#uiD..lineEdit_tempdircxx . . $ Ui_winDialog#lineEdit_tempdir. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(tempDefaultDirPathcxx . . $ Global/tempDefaultDirPath.); |
| 244 | break; |
| 245 | case 6: |
| 246 | uiDcxx . . $ winDialog#uiD..lineEdit_appdircxx . . $ Ui_winDialog#lineEdit_appdir. -> setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(luckyBackupDefaultDircxx . . $ Global/luckyBackupDefaultDir.); |
| 247 | break; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | // modifySlashes =========================================================================================================== |
| 252 | // function to change / to \ for windows (normally when file dialog is used) |
| 253 | QStringcxx . . $ QString# winDialogcxx . . $ winDialog#::modifySlashescxx . . $ winDialog#modifySlashes(f7f320d754b8fd09).(QStringcxx . . $ QString# pathToModify) |
| 254 | { |
| 255 | pathToModify.replacecxx . . $ QString#replace(192e628656427d1c).("/"cxx . . $ QString#QString(85c52e162fed56f9).,SLASHcxx . . $ Global/SLASH.); |
| 256 | return pathToModifycxx . . $ QString#QString(28715ad661ad3cec).; |
| 257 | } |
| 258 | |
| 259 | // end of winDialog.cpp --------------------------------------------------------------------------- |
| 260 |