Debian Codegraph @

src/manageWizard.cpp

raw symbols SCIP
1 /* ---------------------------------- managewizard.cpp ---------------------------------------------------------------------------
2 Class to launch a wizard for restore, delete a backup
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 project version : Please see "main.cpp" for project version
23
24 developer : luckyb
25 last modified : 22 May 2016
26 ===============================================================================================================================
27 ===============================================================================================================================
28 */
29 #include "manageWizard.h"cxx . . $ `<file>/src/manageWizard.h`/
30
31 #include <QCloseEvent>
32 #include <QFileDialog>
33 #include <QProcess>
34 #include <QTextCodec>
35
36 #include "global.h"cxx . . $ `<file>/src/global.h`/
37 #include "operationClass.h"cxx . . $ `<file>/src/operationClass.h`/
38
39 QProcesscxx . . $ QProcess# *commandProcesscxx . . $ commandProcess.;
40
41 // class manageWizard Constructor=================================================================================================
42 // Launches a wizard
43 manageWizardcxx . . $ manageWizard#::manageWizardcxx . . $ manageWizard#manageWizard(53ba369086eed9c2). (QStringcxx . . $ QString# type, QStringcxx . . $ QString# SOURCE, QStringcxx . . $ QString# DEST, int snapshot, QWidgetcxx . . $ QWidget# *parent) : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d). (parent)
44 {
45 // initialize variables
46 currentSnapcxx . . $ manageWizard#currentSnap. = snapshot; // this is the current snapshot number
47 snapshotsNocxx . . $ manageWizard#snapshotsNo. = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListSizecxx . . $ operation#GetSnapshotsListSize(455f465bc33b4cdf).(); // this is the number of snapshots
48 wizard_typecxx . . $ manageWizard#wizard_type. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). type;
49 snapToRestorecxx . . $ manageWizard#snapToRestore. = snapshotsNocxx . . $ manageWizard#snapshotsNo.-2; // This means the previous of the very last snapshot
50
51 procRunningcxx . . $ manageWizard#procRunning. = false;
52 procKilledcxx . . $ manageWizard#procKilled. = false;
53 writeToLogcxx . . $ Global/writeToLog. = false;
54 DeleteAftercxx . . $ manageWizard#DeleteAfter. = false;
55 firstScrollcxx . . $ manageWizard#firstScroll. = true;
56 MainRuncxx . . $ manageWizard#MainRun. = true;
57
58 QStringListcxx . . $ QStringList# arguments = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetArgscxx . . $ operation#GetArgs(e1dbd5c4feadc8f5).();
59 sourcecxx . . $ manageWizard#source. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). SOURCE; // the full path of the source
60 if (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetTypeDirContentscxx . . $ operation#GetTypeDirContents(50ce9a9e25b4a850).())
61 sourceLastcxx . . $ manageWizard#sourceLast. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
62 else
63 sourceLastcxx . . $ manageWizard#sourceLast. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). calculateLastPathcxx . . $ Global/calculateLastPath(f7f320d754b8fd09).(sourcecxx . . $ QString#QString(132dd6869045752b).) +cxx . . $ operator+(fab9b4f80031f353). SLASHcxx . . $ Global/SLASH.; // This is the lowest dir of the source
64
65 destcxx . . $ manageWizard#dest. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). DEST; // the full path of the destination
66 timecxx . . $ manageWizard#time. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(currentSnapcxx . . $ manageWizard#currentSnap.);
67 if (timecxx . . $ manageWizard#time. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "")
68 timeReadablecxx . . $ manageWizard#timeReadable. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("not available","refers to a date-time");
69 else
70 timeReadablecxx . . $ manageWizard#timeReadable. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). timecxx . . $ manageWizard#time..midcxx . . $ QString#mid(44b7563da18aea72).(0,4) +cxx . . $ operator+(3d22f08efddf8107). "/" +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time..midcxx . . $ QString#mid(44b7563da18aea72).(4,2) +cxx . . $ operator+(3d22f08efddf8107). "/" +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time..midcxx . . $ QString#mid(44b7563da18aea72).(6,2) +cxx . . $ operator+(3d22f08efddf8107). " - " +cxx . . $ operator+(fab9b4f80031f353).
71 timecxx . . $ manageWizard#time..midcxx . . $ QString#mid(44b7563da18aea72).(8,2) +cxx . . $ operator+(3d22f08efddf8107). ":" +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time..midcxx . . $ QString#mid(44b7563da18aea72).(10,2) +cxx . . $ operator+(3d22f08efddf8107). ":" +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time..midcxx . . $ QString#mid(44b7563da18aea72).(12,2); //QString
72
73 QDircxx . . $ QDir# snapSpecificDircxx . . $ QDir#QDir(3520e46b33348bf6).(destcxx . . $ manageWizard#dest. +cxx . . $ operator+(fab9b4f80031f353). snapDefaultDircxx . . $ Global/snapDefaultDir. +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time. +cxx . . $ operator+(fab9b4f80031f353). SLASHcxx . . $ Global/SLASH.);
74 if (snapSpecificDir.existscxx . . $ QDir#exists(50ce9a9e25b4a850).())
75 snapSpecificDirExistscxx . . $ manageWizard#snapSpecificDirExists. = true;
76 else
77 snapSpecificDirExistscxx . . $ manageWizard#snapSpecificDirExists. = false;
78
79 // delete backup;if this are more than one snapshots available, set dir to delete as snapSpecificDir
80 if ((wizard_typecxx . . $ manageWizard#wizard_type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "deleteBackup") && (snapshotsNocxx . . $ manageWizard#snapshotsNo. > 1))
81 destcxx . . $ manageWizard#dest. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). snapSpecificDir.absolutePathcxx . . $ QDir#absolutePath(6ef7b6c27b00b43d).();
82
83 if (WINrunningcxx . . $ Global/WINrunning. && Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotecxx . . $ operation#GetRemote(50ce9a9e25b4a850).())
84 {
85 destcxx . . $ manageWizard#dest..replacecxx . . $ QString#replace(192e628656427d1c).("/"cxx . . $ QString#QString(85c52e162fed56f9).,XnixSLASHcxx . . $ Global/XnixSLASH.);
86 if (destcxx . . $ manageWizard#dest..endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(XnixSLASHcxx . . $ Global/XnixSLASH.+cxx . . $ operator+(fab9b4f80031f353).XnixSLASHcxx . . $ Global/XnixSLASH.))
87 destcxx . . $ manageWizard#dest..chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1);
88 }
89 else if (notXnixRunningcxx . . $ Global/notXnixRunning.) // OS2 actually !!
90 {
91 destcxx . . $ manageWizard#dest..replacecxx . . $ QString#replace(192e628656427d1c).("/"cxx . . $ QString#QString(85c52e162fed56f9).,SLASHcxx . . $ Global/SLASH.);
92 if (destcxx . . $ manageWizard#dest..endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(SLASHcxx . . $ Global/SLASH.+cxx . . $ operator+(fab9b4f80031f353).SLASHcxx . . $ Global/SLASH.))
93 destcxx . . $ manageWizard#dest..chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1);
94 }
95
96 errorCountcxx . . $ manageWizard#errorCount. = 0 ;
97 errorsFoundcxx . . $ Global/errorsFound. = 0;
98 outputStringcxx . . $ manageWizard#outputString. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
99 outputErrorcxx . . $ manageWizard#outputError. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
100
101 uiWcxx . . $ manageWizard#uiW..setupUicxx . . $ Ui_manageWizard#setupUi(d194de0c0f68c28b).(this);
102
103 // initialize the gui
104 this -> resizecxx . . $ QWidget#resize(3e454b8ccf442868).(580,300);
105 guiInitializecxx . . $ manageWizard#guiInitialize(49f6e7a06ebc5aa8).();
106
107 //connections ----------------
108 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiWcxx . . $ manageWizard#uiW..button_cancelcxx . . $ Ui_manageWizard#button_cancel., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( cancelPressed() ) );
109 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiWcxx . . $ manageWizard#uiW..button_startcxx . . $ Ui_manageWizard#button_start., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( startAction() ) );
110 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiWcxx . . $ manageWizard#uiW..button_abortcxx . . $ Ui_manageWizard#button_abort., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( abortAction() ) );
111 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiWcxx . . $ manageWizard#uiW..checkBox_DeleteAftercxx . . $ Ui_manageWizard#checkBox_DeleteAfter., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( stateChanged(int) ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( deleteAfterChanged() ) );
112
113 commandProcesscxx . . $ commandProcess. = new QProcesscxx . . $ QProcess#(this); //create a new qprocess (for rsync) & connect signals
114 connectcxx . . $ QObject#connect(158df1d9a01a3410).(commandProcesscxx . . $ commandProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(readyReadStandardError()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(appendCommandOutput()));
115 connectcxx . . $ QObject#connect(158df1d9a01a3410).(commandProcesscxx . . $ commandProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(readyReadStandardOutput()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(appendCommandOutput()));
116 connectcxx . . $ QObject#connect(158df1d9a01a3410).(commandProcesscxx . . $ commandProcess., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`! (finished(int, QProcess::ExitStatus)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(procFinished()));
117
118 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiWcxx . . $ manageWizard#uiW..button_previouscxx . . $ Ui_manageWizard#button_previous., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( prevError() ) ); //connect previous pushButton SLOT
119 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiWcxx . . $ manageWizard#uiW..button_nextcxx . . $ Ui_manageWizard#button_next., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( nextError() ) ); //connect next pushButton SLOT
120 connectcxx . . $ QObject#connect(158df1d9a01a3410). ( uiWcxx . . $ manageWizard#uiW..pushButton_changeRestorecxx . . $ Ui_manageWizard#pushButton_changeRestore., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( clicked() ), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( changeRestorePath() ) ); //connect change pushButton SLOT
121 }
122 // SLOTS-------------------------------------------------------------------------------------
123
124 // cancel button pressed=====================================================================================================
125 // emmit a QCloseEvent
126 void manageWizardcxx . . $ manageWizard#::cancelPressedcxx . . $ manageWizard#cancelPressed(49f6e7a06ebc5aa8).()
127 {
128 closecxx . . $ QWidget#close(c9857a73d68e59ba).(); //emmit a QcloseEvent
129 }
130
131 // QCloseEvent emitted =====================================================================================================
132 //close the wizard (if a process is not running)
133 void manageWizardcxx . . $ manageWizard#::closeEventcxx . . $ manageWizard#closeEvent(642e80679aeb34f8).(QCloseEventcxx . . $ QCloseEvent# *event)
134 {
135 if (procRunningcxx . . $ manageWizard#procRunning.)
136 event->ignorecxx . . $ QEvent#ignore(49f6e7a06ebc5aa8).();
137 else
138 event->acceptcxx . . $ QEvent#accept(49f6e7a06ebc5aa8).();
139 }
140
141 // deleteAfterChanged()=====================================================================================================
142 // actions when checkbox "delete source data" state changed
143 void manageWizardcxx . . $ manageWizard#::deleteAfterChangedcxx . . $ manageWizard#deleteAfterChanged(49f6e7a06ebc5aa8).()
144 {
145 DeleteAftercxx . . $ manageWizard#DeleteAfter. = uiWcxx . . $ manageWizard#uiW..checkBox_DeleteAftercxx . . $ Ui_manageWizard#checkBox_DeleteAfter. -> isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).(); //set bool DeleteAfter according to checkbox (only applies at RESTORE)
146 QStringcxx . . $ QString# labelText = "<b><font color=red>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("WARNING") +cxx . . $ operator+(3d22f08efddf8107). "</font></b>: ";
147 if (DeleteAftercxx . . $ manageWizard#DeleteAfter.)
148 labelText.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("The restore directory will become identical to the backup snapshot"));
149 else
150 labelText.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Existing backup files will replace the corresponding files at the restore directory",
151 "information message - line1."));
152
153 labelText.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(".<br>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("If the information above is correct, click <b>start</b> to begin",
154 "information message - line2.\nPlease leave tags <b></b> intact and surrounding 'start translated'") +cxx . . $ operator+(3d22f08efddf8107). ".");
155 uiWcxx . . $ manageWizard#uiW..label_messagecxx . . $ Ui_manageWizard#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(labelText);
156
157
158
159
160
161 // ********************* FOR TESTING PURPOSES **************************************************************************
162 /*calcCommandArgs();
163 QString ArgsString = "";
164 count=0;
165 while (count < commandArguments.size())
166 {
167 if (commandArguments[count].contains("-e ssh "))
168 {
169 ArgsString.append("-e \"" + commandArguments[count].remove(0,3) + "\" ");
170 }
171 else
172 ArgsString.append(commandArguments[count]+" ");
173 count++;
174 }
175 labelText.append("<br><br><font color=red>" + ArgsString + "</font>");
176 uiW.label_message -> setText(labelText);
177 */
178 // ********************* END TESTING PURPOSES **************************************************************************
179 }
180
181 // start button pressed=====================================================================================================
182 // start the action
183 void manageWizardcxx . . $ manageWizard#::startActioncxx . . $ manageWizard#startAction(49f6e7a06ebc5aa8).()
184 {
185 DeleteAftercxx . . $ manageWizard#DeleteAfter. = uiWcxx . . $ manageWizard#uiW..checkBox_DeleteAftercxx . . $ Ui_manageWizard#checkBox_DeleteAfter. -> isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).(); //set bool DeleteAfter according to checkbox (only applies at RESTORE)
186 DryRuncxx . . $ Global/DryRun. = uiWcxx . . $ manageWizard#uiW..checkBox_DryRuncxx . . $ Ui_manageWizard#checkBox_DryRun. -> isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).(); //set bool DeleteAfter according to checkbox (only applies at RESTORE)
187
188 //change the gui
189 uiWcxx . . $ manageWizard#uiW..button_nextcxx . . $ Ui_manageWizard#button_next. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
190 uiWcxx . . $ manageWizard#uiW..button_nextcxx . . $ Ui_manageWizard#button_next. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
191 uiWcxx . . $ manageWizard#uiW..button_previouscxx . . $ Ui_manageWizard#button_previous. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
192 uiWcxx . . $ manageWizard#uiW..button_previouscxx . . $ Ui_manageWizard#button_previous. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (false);
193 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
194 uiWcxx . . $ manageWizard#uiW..button_cancelcxx . . $ Ui_manageWizard#button_cancel. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
195 uiWcxx . . $ manageWizard#uiW..groupBox_titlecxx . . $ Ui_manageWizard#groupBox_title. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
196 uiWcxx . . $ manageWizard#uiW..button_abortcxx . . $ Ui_manageWizard#button_abort. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
197 uiWcxx . . $ manageWizard#uiW..checkBox_DryRuncxx . . $ Ui_manageWizard#checkBox_DryRun. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
198 uiWcxx . . $ manageWizard#uiW..button_startcxx . . $ Ui_manageWizard#button_start. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
199
200 // logfile actions if real run is performed - is always true for DELETE actions
201 //This is the RESTORE/DELETE logfile
202 if (!DryRuncxx . . $ Global/DryRun.)
203 {
204 if (wizard_typecxx . . $ manageWizard#wizard_type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "restoreBackup")
205 logfilenamecxx . . $ Global/logfilename. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). logDircxx . . $ Global/logDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time. +cxx . . $ operator+(3d22f08efddf8107). "-RESTORE" +cxx . . $ operator+(3d22f08efddf8107). ".log";
206 else
207 logfilenamecxx . . $ Global/logfilename. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). logDircxx . . $ Global/logDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time. +cxx . . $ operator+(3d22f08efddf8107). "-DELETE" +cxx . . $ operator+(3d22f08efddf8107). ".log";
208
209 logfilecxx . . $ Global/logfile..setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(logfilenamecxx . . $ Global/logfilename.); // this is the logfile
210
211 if (logfilecxx . . $ Global/logfile..opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::WriteOnlycxx . . $ QIODevice#WriteOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) //create a new log file
212 writeToLogcxx . . $ Global/writeToLog. = true; //& if it's ok set this to true
213 else
214 writeToLogcxx . . $ Global/writeToLog. = false;
215 }
216
217 runProcesscxx . . $ manageWizard#runProcess(49f6e7a06ebc5aa8).();
218 }
219
220 // procFinished =====================================================================================================
221 // actions when the process is finished
222 void manageWizardcxx . . $ manageWizard#::procFinishedcxx . . $ manageWizard#procFinished(49f6e7a06ebc5aa8).()
223 {
224 procRunningcxx . . $ manageWizard#procRunning. = false;
225 if ( (wizard_typecxx . . $ manageWizard#wizard_type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "restoreBackup") && (snapToRestorecxx . . $ manageWizard#snapToRestore. >= currentSnapcxx . . $ manageWizard#currentSnap. ) )
226 {
227 MainRuncxx . . $ manageWizard#MainRun. = false;
228
229 timecxx . . $ manageWizard#time. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(snapToRestorecxx . . $ manageWizard#snapToRestore.);
230 QStringcxx . . $ QString# tslashcxx . . $ QString#QString(ced63f7c635d850d).;
231 if (WINrunningcxx . . $ Global/WINrunning. && Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotecxx . . $ operation#GetRemote(50ce9a9e25b4a850).())
232 tslash=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).XnixSLASHcxx . . $ Global/XnixSLASH.;
233 else
234 tslash=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).SLASHcxx . . $ Global/SLASH.;
235 QDircxx . . $ QDir# snapSpecificDircxx . . $ QDir#QDir(3520e46b33348bf6).(destcxx . . $ manageWizard#dest. +cxx . . $ operator+(fab9b4f80031f353). snapDefaultDircxx . . $ Global/snapDefaultDir. +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time. +cxx . . $ operator+(fab9b4f80031f353). tslash);
236
237 if (snapSpecificDir.existscxx . . $ QDir#exists(50ce9a9e25b4a850).())
238 snapSpecificDirExistscxx . . $ manageWizard#snapSpecificDirExists. = true;
239 else
240 snapSpecificDirExistscxx . . $ manageWizard#snapSpecificDirExists. = false;
241
242 snapToRestorecxx . . $ manageWizard#snapToRestore.--;
243
244 runProcesscxx . . $ manageWizard#runProcess(49f6e7a06ebc5aa8).();
245 return;
246 }
247
248 logfilecxx . . $ Global/logfile..closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); // close the RESTORE/DELETE logfile
249
250 errorsFoundcxx . . $ Global/errorsFound. = errorCountcxx . . $ manageWizard#errorCount.;
251 errorCountcxx . . $ manageWizard#errorCount. = 0; // reset the error count
252 uiWcxx . . $ manageWizard#uiW..button_abortcxx . . $ Ui_manageWizard#button_abort. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
253 uiWcxx . . $ manageWizard#uiW..button_cancelcxx . . $ Ui_manageWizard#button_cancel. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (true);
254 uiWcxx . . $ manageWizard#uiW..button_cancelcxx . . $ Ui_manageWizard#button_cancel. -> setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("close"));
255 if (errorsFoundcxx . . $ Global/errorsFound. > 0)
256 {
257 firstScrollcxx . . $ manageWizard#firstScroll.=true;
258 uiWcxx . . $ manageWizard#uiW..button_nextcxx . . $ Ui_manageWizard#button_next. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c). (true);
259 }
260
261 // if delete backup just finished normally (not ABORTED) with no errors
262 if ( (wizard_typecxx . . $ manageWizard#wizard_type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "deleteBackup") && (errorsFoundcxx . . $ Global/errorsFound. == 0) && (!procKilledcxx . . $ manageWizard#procKilled.) )
263 {
264 //delete the backup logfile
265 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("<br><font color=blue><b>..." +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Deleting snapshot logfile",
266 "info message displayed during ...logfile deletion") +cxx . . $ operator+(3d22f08efddf8107)."</b></font><br>");
267 QStringcxx . . $ QString# logNameToDelete = logDircxx . . $ Global/logDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353).
268 timecxx . . $ manageWizard#time. +cxx . . $ operator+(3d22f08efddf8107). ".log";
269 QFilecxx . . $ QFile# logToDeletecxx . . $ QFile#QFile(49f6e7a06ebc5aa8).;
270 logToDelete.setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(logNameToDelete); // this is the logfile of the snapshot to delete
271 if (logToDelete.removecxx . . $ QFile#remove(c9857a73d68e59ba).())
272 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(" <font color=green>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("success",
273 "info message displayed after ...logfile deletion") +cxx . . $ operator+(3d22f08efddf8107)."</font><br><br>");
274 else
275 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(" <font color=red>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("failed",
276 "info message displayed after ...logfile deletion") +cxx . . $ operator+(3d22f08efddf8107)."</font><br><br>");
277
278 //delete the .changes file
279 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("<font color=blue><b>..." +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Deleting file that lists snapshot changes",
280 "info message displayed during ...file deletion") +cxx . . $ operator+(3d22f08efddf8107)."</b></font><br>");
281 QStringcxx . . $ QString# changesNameToDelete = snapChangesDircxx . . $ Global/snapChangesDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353).
282 timecxx . . $ manageWizard#time. +cxx . . $ operator+(3d22f08efddf8107). ".changes.log";
283 QFilecxx . . $ QFile# changesFileToDeletecxx . . $ QFile#QFile(49f6e7a06ebc5aa8).;
284 changesFileToDelete.setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(changesNameToDelete); // this is the .changes file of the snapshot to delete
285 if (changesFileToDelete.removecxx . . $ QFile#remove(c9857a73d68e59ba).())
286 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(" <font color=green>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("success",
287 "info message displayed after ...file deletion") +cxx . . $ operator+(3d22f08efddf8107)."</font><br><br>");
288 else
289 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(" <font color=red>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("failed",
290 "info message displayed after ...file deletion") +cxx . . $ operator+(3d22f08efddf8107)."</font><br><br>");
291
292 //remove the specific snapshot from the Task
293 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).("<font color=blue><b>..." +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Updating list of snapshots"
294 ,"info message displayed during ...snaps list update") +cxx . . $ operator+(3d22f08efddf8107)."</b></font><br>");
295 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> RemoveSnapshotsListItemcxx . . $ operation#RemoveSnapshotsListItem(d4f767463ce0a6b3). (currentSnapcxx . . $ manageWizard#currentSnap.);
296 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(" <font color=green>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("success",
297 "info message displayed after ...snapshots list update") +cxx . . $ operator+(3d22f08efddf8107)."</font><br><br>");
298
299 int currentSnaps = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListSizecxx . . $ operation#GetSnapshotsListSize(455f465bc33b4cdf).(); // this is the current number of snapshots
300 bool emptySnapList = Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> SnapshotsListIsEmptycxx . . $ operation#SnapshotsListIsEmpty(c9857a73d68e59ba).(); // Is the list empty ??
301
302 //update the last execution time to the last snapshot or to nothing if no snapshots exist
303 QDateTimecxx . . $ QDateTime# newTimecxx . . $ QDateTime#QDateTime(ced63f7c635d850d).; // empty time variable
304 if (!emptySnapList)
305 newTime =cxx . . $ QDateTime#`operator=`(6dbf9ff24243cdf2). QDateTimecxx . . $ QDateTime#::fromStringcxx . . $ QDateTime#fromString(231687af0a676ea1).(Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.]-> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(currentSnaps-1),"yyyyMMddhhmmss"cxx . . $ QString#QString(85c52e162fed56f9).);
306 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> SetLastExecutionTimecxx . . $ operation#SetLastExecutionTime(738e092a5192a79).(newTimecxx . . $ QDateTime#QDateTime(5da15eb5af6b9895).);
307
308 //update the last execution errors to "-1" (not available)
309 Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> SetLastExecutionErrorscxx . . $ operation#SetLastExecutionErrors(d4f767463ce0a6b3).(-1);
310 }
311
312
313 QStringcxx . . $ QString# InfoMessage = "<br><font color=magenta>=====================================<br><b>... "cxx . . $ QString#QString(85c52e162fed56f9).;
314 if (procKilledcxx . . $ manageWizard#procKilled.)
315 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Aborted") );
316 else
317 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Finished") );
318
319 if (DryRuncxx . . $ Global/DryRun.)
320 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(" (" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("simulation") +cxx . . $ operator+(3d22f08efddf8107). ")");
321
322 InfoMessage.appendcxx . . $ QString#append(d02845eef0c33901).("</b></font><br>");
323
324 if (errorsFoundcxx . . $ Global/errorsFound. ==0 )
325 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).("<font color=green><b>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("no errors") +cxx . . $ operator+(3d22f08efddf8107). "</b></font>");
326 else
327 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).("<font color=red><b>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("errors found") +cxx . . $ operator+(3d22f08efddf8107). "</b></font>");
328 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(InfoMessage);
329 }
330
331 // abort button pressed=====================================================================================================
332 // abort the action
333 void manageWizardcxx . . $ manageWizard#::abortActioncxx . . $ manageWizard#abortAction(49f6e7a06ebc5aa8).()
334 {
335 if (commandProcesscxx . . $ commandProcess.->statecxx . . $ QProcess#state(12547b18370478e0).() == QProcesscxx . . $ QProcess#::Runningcxx . . $ QProcess#Running.)
336 {
337 procKilledcxx . . $ manageWizard#procKilled. = true;
338 MainRuncxx . . $ manageWizard#MainRun. = false;
339 commandProcesscxx . . $ commandProcess. -> killcxx . . $ QProcess#kill(49f6e7a06ebc5aa8).(); //kill commandProcess
340 commandProcesscxx . . $ commandProcess. -> waitForFinishedcxx . . $ QProcess#waitForFinished(83c267b20bac841a).();
341 }
342 else
343 procFinishedcxx . . $ manageWizard#procFinished(49f6e7a06ebc5aa8).(); // the process might not be running for some weird reason, so call procFinished !!
344 }
345 // appendCommandOutput =====================================================================================================
346 //update dialog with new data (text - progressbar) - also update logfile
347 void manageWizardcxx . . $ manageWizard#::appendCommandOutputcxx . . $ manageWizard#appendCommandOutput(49f6e7a06ebc5aa8).()
348 {
349 //update textBrowser ------------------------------------------------------------------------------------------------------
350 QTextCodeccxx . . $ QTextCodec# *codec = QTextCodeccxx . . $ QTextCodec#::codecForNamecxx . . $ QTextCodec#codecForName(914382192c9ca379).("UTF-8");
351 outputStringcxx . . $ manageWizard#outputString. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). codec->toUnicodecxx . . $ QTextCodec#toUnicode(5b58488ffc88f4c0).(commandProcesscxx . . $ commandProcess. -> readAllStandardOutputcxx . . $ QProcess#readAllStandardOutput(b3c286cec66e09f4).());
352 outputErrorcxx . . $ manageWizard#outputError. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). codec->toUnicodecxx . . $ QTextCodec#toUnicode(5b58488ffc88f4c0).(commandProcesscxx . . $ commandProcess. -> readAllStandardErrorcxx . . $ QProcess#readAllStandardError(b3c286cec66e09f4).());
353
354 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(outputStringcxx . . $ manageWizard#outputString.);
355 logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-standard"cxx . . $ QString#QString(85c52e162fed56f9)., outputStringcxx . . $ QString#QString(132dd6869045752b)., 0);
356
357 if (outputErrorcxx . . $ manageWizard#outputError. !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636)."")
358 {
359 errorCountcxx . . $ manageWizard#errorCount.++;
360 errorsFoundcxx . . $ Global/errorsFound.++;
361 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(logFileUpdatecxx . . $ Global/logFileUpdate(5faf0f1f209776e3).("rsync-error"cxx . . $ QString#QString(85c52e162fed56f9)., outputErrorcxx . . $ QString#QString(132dd6869045752b)., 0));
362 }
363 }
364
365 // change button pressed=====================================================================================================
366 // Change the restore directory
367 void manageWizardcxx . . $ manageWizard#::changeRestorePathcxx . . $ manageWizard#changeRestorePath(49f6e7a06ebc5aa8).()
368 {
369 QStringcxx . . $ QString# newRestore = QFileDialogcxx . . $ QFileDialog#::getExistingDirectorycxx . . $ QFileDialog#getExistingDirectory(a1339ef2a1b3555a). (this, trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Select new restore directory", "directory selection dialog title"),
370 sourcecxx . . $ manageWizard#source., QFileDialogcxx . . $ QFileDialog#::ShowDirsOnlycxx . . $ QFileDialog#ShowDirsOnly. |cxx . . $ `operator|`(11bb0297066bad47). QFileDialogcxx . . $ QFileDialog#::DontResolveSymlinkscxx . . $ QFileDialog#DontResolveSymlinks.);
371
372 //'if something is selected indeed
373 if (newRestore !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "")
374 {
375 //if the new restore dir does not end with /
376 if (!newRestore.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(SLASHcxx . . $ Global/SLASH.))
377 newRestore.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(SLASHcxx . . $ Global/SLASH.);
378 sourcecxx . . $ manageWizard#source. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). newRestore;
379 }
380 guiInitializecxx . . $ manageWizard#guiInitialize(49f6e7a06ebc5aa8).();
381 }
382
383 // previous error button pressed=====================================================================================================
384 // jumb to previous error
385 void manageWizardcxx . . $ manageWizard#::prevErrorcxx . . $ manageWizard#prevError(49f6e7a06ebc5aa8).()
386 {
387 errorCountcxx . . $ manageWizard#errorCount.--; //decrease the current error by one
388
389 if (errorCountcxx . . $ manageWizard#errorCount. == 0 ) // if the current error is the first disable the previous button
390 uiWcxx . . $ manageWizard#uiW..button_previouscxx . . $ Ui_manageWizard#button_previous. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
391
392 if (errorCountcxx . . $ manageWizard#errorCount. < errorsFoundcxx . . $ Global/errorsFound.-1) //if the current error is less than the last one, enable the next button
393 uiWcxx . . $ manageWizard#uiW..button_nextcxx . . $ Ui_manageWizard#button_next. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
394
395 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView. -> scrollToAnchorcxx . . $ QTextEdit#scrollToAnchor(3520e46b33348bf6).("error" +cxx . . $ operator+(c75c3ae4eb9af1a8). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).(errorCountcxx . . $ manageWizard#errorCount.+1));
396 }
397
398 // next error button pressed=====================================================================================================
399 // jumb to next error
400 void manageWizardcxx . . $ manageWizard#::nextErrorcxx . . $ manageWizard#nextError(49f6e7a06ebc5aa8).()
401 {
402 if (!firstScrollcxx . . $ manageWizard#firstScroll.)
403 errorCountcxx . . $ manageWizard#errorCount.++; // increase the current error by one
404 firstScrollcxx . . $ manageWizard#firstScroll. = false;
405
406 if (errorCountcxx . . $ manageWizard#errorCount. == errorsFoundcxx . . $ Global/errorsFound.-1) // If the current error is the last, disable the next button
407 uiWcxx . . $ manageWizard#uiW..button_nextcxx . . $ Ui_manageWizard#button_next. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false);
408
409 if (errorCountcxx . . $ manageWizard#errorCount. > 0) // if the current error is greater than the first one enable the previous button
410 uiWcxx . . $ manageWizard#uiW..button_previouscxx . . $ Ui_manageWizard#button_previous. -> setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(true);
411
412 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView. -> scrollToAnchorcxx . . $ QTextEdit#scrollToAnchor(3520e46b33348bf6).("error" +cxx . . $ operator+(c75c3ae4eb9af1a8). countStrcxx . . $ Global/countStr..setNumcxx . . $ QString#setNum(6483560ce2afa901).(errorCountcxx . . $ manageWizard#errorCount.+1));
413 }
414
415 // FUNCTIONS-------------------------------------------------------------------------------------
416
417 // guiInitialize()=====================================================================================================
418 // Initialize the gui
419 void manageWizardcxx . . $ manageWizard#::guiInitializecxx . . $ manageWizard#guiInitialize(49f6e7a06ebc5aa8).()
420 {
421 uiWcxx . . $ manageWizard#uiW..button_nextcxx . . $ Ui_manageWizard#button_next. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
422 uiWcxx . . $ manageWizard#uiW..button_previouscxx . . $ Ui_manageWizard#button_previous. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
423 uiWcxx . . $ manageWizard#uiW..button_abortcxx . . $ Ui_manageWizard#button_abort. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
424 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
425
426 if (wizard_typecxx . . $ manageWizard#wizard_type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "deleteBackup")
427 {
428 uiWcxx . . $ manageWizard#uiW..pushButton_logocxx . . $ Ui_manageWizard#pushButton_logo. -> setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6). (QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/luckyPrefix/remove.png"cxx . . $ QString#QString(85c52e162fed56f9).));
429 uiWcxx . . $ manageWizard#uiW..groupBox_titlecxx . . $ Ui_manageWizard#groupBox_title. -> setTitlecxx . . $ QGroupBox#setTitle(3520e46b33348bf6).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Delete backup","this is the title of a wizard"));
430 uiWcxx . . $ manageWizard#uiW..label_timecxx . . $ Ui_manageWizard#label_time. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Date & time","simple label of the wizard gui") +cxx . . $ operator+(3d22f08efddf8107). ": <font color=magenta><b>" +cxx . . $ operator+(fab9b4f80031f353). timeReadablecxx . . $ manageWizard#timeReadable. +cxx . . $ operator+(3d22f08efddf8107). "</b></font>");
431 uiWcxx . . $ manageWizard#uiW..label_pathscxx . . $ Ui_manageWizard#label_paths. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Path","...is a directory path") +cxx . . $ operator+(3d22f08efddf8107). ": <font color=blue><b>" +cxx . . $ operator+(fab9b4f80031f353). destcxx . . $ manageWizard#dest. +cxx . . $ operator+(3d22f08efddf8107). "</b></font>");
432 uiWcxx . . $ manageWizard#uiW..label_messagecxx . . $ Ui_manageWizard#label_message. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).("<b><font color=red>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("WARNING") +cxx . . $ operator+(3d22f08efddf8107). "</font></b>: " +cxx . . $ operator+(fab9b4f80031f353).
433 trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("You are about to delete backup data","information message - line1") +cxx . . $ operator+(3d22f08efddf8107). ".<br>" +cxx . . $ operator+(fab9b4f80031f353).
434 trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("If the information above is correct, click <b>start</b> to begin",
435 "information message - line2.\nPlease leave tags <b></b> intact and surrounding 'start' translated") +cxx . . $ operator+(3d22f08efddf8107).
436 ".");
437 uiWcxx . . $ manageWizard#uiW..checkBox_DryRuncxx . . $ Ui_manageWizard#checkBox_DryRun. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
438 uiWcxx . . $ manageWizard#uiW..checkBox_DeleteAftercxx . . $ Ui_manageWizard#checkBox_DeleteAfter. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
439 uiWcxx . . $ manageWizard#uiW..pushButton_changeRestorecxx . . $ Ui_manageWizard#pushButton_changeRestore. -> setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c). (false);
440 }
441 if (wizard_typecxx . . $ manageWizard#wizard_type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "restoreBackup")
442 {
443 uiWcxx . . $ manageWizard#uiW..pushButton_logocxx . . $ Ui_manageWizard#pushButton_logo. -> setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6). (QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(":/luckyPrefix/manage.png"cxx . . $ QString#QString(85c52e162fed56f9).));
444 //uiW.pushButton_logo -> setText (tr("change"));
445 uiWcxx . . $ manageWizard#uiW..groupBox_titlecxx . . $ Ui_manageWizard#groupBox_title. -> setTitlecxx . . $ QGroupBox#setTitle(3520e46b33348bf6).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Restore backup","this is the title of a wizard"));
446 uiWcxx . . $ manageWizard#uiW..label_timecxx . . $ Ui_manageWizard#label_time. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Date & time","simple label of the wizard gui") +cxx . . $ operator+(3d22f08efddf8107).
447 ": <font color=magenta><b>" +cxx . . $ operator+(fab9b4f80031f353). timeReadablecxx . . $ manageWizard#timeReadable. +cxx . . $ operator+(3d22f08efddf8107). "</b></font><br>" +cxx . . $ operator+(fab9b4f80031f353).
448 trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Backup path","...is the backup directory path") +cxx . . $ operator+(3d22f08efddf8107). ": <font color=blue><b>" +cxx . . $ operator+(fab9b4f80031f353). destcxx . . $ manageWizard#dest. +cxx . . $ operator+(3d22f08efddf8107). "</b></font>");
449
450 uiWcxx . . $ manageWizard#uiW..label_pathscxx . . $ Ui_manageWizard#label_paths. -> setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Restore path","...is the restore directory path") +cxx . . $ operator+(3d22f08efddf8107). ": <font color=blue><b>" +cxx . . $ operator+(fab9b4f80031f353). sourcecxx . . $ manageWizard#source. +cxx . . $ operator+(3d22f08efddf8107)."</b></font>");
451 deleteAfterChangedcxx . . $ manageWizard#deleteAfterChanged(49f6e7a06ebc5aa8).();
452 }
453 }
454
455 // calcCommandArgs()=====================================================================================================
456 // function to calculate command arguments for RESTORE
457 void manageWizardcxx . . $ manageWizard#::calcCommandArgscxx . . $ manageWizard#calcCommandArgs(49f6e7a06ebc5aa8).()
458 {
459 commandArgumentscxx . . $ manageWizard#commandArguments..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).();
460 commandArgumentscxx . . $ manageWizard#commandArguments. =cxx . . $ QStringList#`operator=`(335bb966c1744308). AppendArgumentscxx . . $ Global/AppendArguments(20f639a182fdbea2).(Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.]);
461 commandArgumentscxx . . $ manageWizard#commandArguments..removeLastcxx . . $ QList#removeLast(49f6e7a06ebc5aa8).(); // remove the last 2 arguments (hopefuly source & destination)
462 commandArgumentscxx . . $ manageWizard#commandArguments..removeLastcxx . . $ QList#removeLast(49f6e7a06ebc5aa8).();
463
464 // Scan the list and remove all arguments that are not needed
465 // keep all other arguments intact
466 countcxx . . $ manageWizard#count. =0;
467
468 while (countcxx . . $ manageWizard#count. < commandArgumentscxx . . $ manageWizard#commandArguments..sizecxx . . $ QList#size(ea6fe5115c70a13f).())
469 {
470 if ( (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.].containscxx . . $ QString#contains(8cce4688c16f48f3).("--exclude"cxx . . $ QString#QString(85c52e162fed56f9).)) ||
471 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.].containscxx . . $ QString#contains(8cce4688c16f48f3).("--include"cxx . . $ QString#QString(85c52e162fed56f9).)) ||
472 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "--prune-empty-dirs") ||
473 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "-m") ||
474 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "--update") ||
475 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "-u") ||
476 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "--delay-updates") ||
477 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.].containscxx . . $ QString#contains(8cce4688c16f48f3).("--delete"cxx . . $ QString#QString(85c52e162fed56f9).)) ||
478 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.].containscxx . . $ QString#contains(8cce4688c16f48f3).("--backup"cxx . . $ QString#QString(85c52e162fed56f9).)) ||
479 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.].containscxx . . $ QString#contains(8cce4688c16f48f3).("--filter"cxx . . $ QString#QString(85c52e162fed56f9).)) ||
480 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.].containscxx . . $ QString#contains(8cce4688c16f48f3).("--log"cxx . . $ QString#QString(85c52e162fed56f9).)) ||
481 (commandArgumentscxx . . $ manageWizard#commandArguments.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).countcxx . . $ manageWizard#count.] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "--del")
482 )
483 commandArgumentscxx . . $ manageWizard#commandArguments..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(countcxx . . $ manageWizard#count.); //remove the argument if one of the above is true
484 else
485 countcxx . . $ manageWizard#count.++;
486 }
487
488 if (DryRuncxx . . $ Global/DryRun.)
489 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).("--dry-run"cxx . . $ QString#QString(85c52e162fed56f9).); // add --dry-run if checkbox checked
490
491 //exclude stuff that have been backed-up, after the snapshot was made
492 //this means read the changes.logs files from every snapshot after the current one
493 countcxx . . $ manageWizard#count. = currentSnapcxx . . $ manageWizard#currentSnap.+1;
494 while (countcxx . . $ manageWizard#count. < snapshotsNocxx . . $ manageWizard#snapshotsNo.)
495 {
496 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).("--exclude-from=" +cxx . . $ operator+(c75c3ae4eb9af1a8). snapChangesDircxx . . $ Global/snapChangesDir. +cxx . . $ operator+(fab9b4f80031f353). profileNamecxx . . $ Global/profileName. +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353). Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetNamecxx . . $ operation#GetName(6ef7b6c27b00b43d).() +cxx . . $ operator+(3d22f08efddf8107). "-" +cxx . . $ operator+(fab9b4f80031f353).
497 (Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetSnapshotsListItemcxx . . $ operation#GetSnapshotsListItem(3f3c3d0e9c0eb37f).(countcxx . . $ manageWizard#count.)) +cxx . . $ operator+(3d22f08efddf8107). ".changes.log");
498 countcxx . . $ manageWizard#count.++;
499 }
500
501 if (MainRuncxx . . $ manageWizard#MainRun.)
502 {
503 //exclude the luckybackup snapshots directory cause it is inside the destination
504 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).("--exclude=" +cxx . . $ operator+(c75c3ae4eb9af1a8). snapDefaultDircxx . . $ Global/snapDefaultDir.);
505
506 // add --delete options if checkbox checked
507 if (DeleteAftercxx . . $ manageWizard#DeleteAfter.)
508 {
509 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).("--delete-after"cxx . . $ QString#QString(85c52e162fed56f9).);
510 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).("--delete-excluded"cxx . . $ QString#QString(85c52e162fed56f9).);
511 }
512
513 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).(destcxx . . $ manageWizard#dest.); // set new dest as source Argument - as it was calculated at manageWizard
514 }
515 else
516 {
517 QStringcxx . . $ QString# tslashcxx . . $ QString#QString(ced63f7c635d850d).;
518 if (WINrunningcxx . . $ Global/WINrunning. && Operationcxx . . $ Global/Operation.[currentOperationcxx . . $ Global/currentOperation.] -> GetRemotecxx . . $ operation#GetRemote(50ce9a9e25b4a850).())
519 tslash=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).XnixSLASHcxx . . $ Global/XnixSLASH.;
520 else
521 tslash=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).SLASHcxx . . $ Global/SLASH.;
522
523 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).(destcxx . . $ manageWizard#dest. +cxx . . $ operator+(fab9b4f80031f353). snapDefaultDircxx . . $ Global/snapDefaultDir. +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time. +cxx . . $ operator+(fab9b4f80031f353). tslash +cxx . . $ operator+(fab9b4f80031f353). sourceLastcxx . . $ manageWizard#sourceLast.);
524 }
525
526 commandArgumentscxx . . $ manageWizard#commandArguments..appendcxx . . $ QList#append(77d9f17553126ecb).(sourcecxx . . $ manageWizard#source.); // set new source as destination ...as it was calculated at manageWizard or changed by changeRestorePath
527 }
528
529
530
531 // runProcess()()=====================================================================================================
532 // Run the desired process
533 void manageWizardcxx . . $ manageWizard#::runProcesscxx . . $ manageWizard#runProcess(49f6e7a06ebc5aa8).()
534 {
535 bool skipTHIS = false;
536
537 // specify command & arguments & append information message
538 QStringcxx . . $ QString# commandLocal =""cxx . . $ QString#QString(85c52e162fed56f9).; commandArgumentscxx . . $ manageWizard#commandArguments..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); // the local command is used here !!
539 QStringcxx . . $ QString# InfoMessage = "<br><font color=magenta><b>"cxx . . $ QString#QString(85c52e162fed56f9).;
540 if (wizard_typecxx . . $ manageWizard#wizard_type. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "restoreBackup")
541 {
542 commandLocal =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). rsyncCommandPathcxx . . $ Global/rsyncCommandPath.;
543
544 calcCommandArgscxx . . $ manageWizard#calcCommandArgs(49f6e7a06ebc5aa8).(); //calculate command arguments and set commandArguments
545
546 if (MainRuncxx . . $ manageWizard#MainRun.)
547 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Restoring data: main trunk","info message displayed during ...data restoration"));
548 else
549 {
550 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Restoring data: snapshot files","info message displayed during ...data restoration") +cxx . . $ operator+(3d22f08efddf8107). " - " +cxx . . $ operator+(fab9b4f80031f353). timecxx . . $ manageWizard#time.);
551 if (!snapSpecificDirExistscxx . . $ manageWizard#snapSpecificDirExists.)
552 skipTHIS = true;
553 }
554 if (DryRuncxx . . $ Global/DryRun.)
555 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(" (" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("simulation") +cxx . . $ operator+(3d22f08efddf8107). ")");
556 }
557 else
558 {
559 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("Deleting data","info message displayed during ...data deletion"));
560 QDircxx . . $ QDir# destFoldercxx . . $ QDir#QDir(3520e46b33348bf6).(destcxx . . $ manageWizard#dest.);
561 if (destFolder.existscxx . . $ QDir#exists(50ce9a9e25b4a850).())
562 {
563 commandLocal =cxx . . $ QString#`operator=`(d02845eef0c33901). "rm";
564 commandArgumentscxx . . $ manageWizard#commandArguments. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). "-rvf"cxx . . $ QString#QString(85c52e162fed56f9). <<cxx . . $ QStringList#`operator<<`(85116071a693d053). destcxx . . $ manageWizard#dest.;
565 }
566 else
567 skipTHIS = true;
568
569 }
570
571 InfoMessage.appendcxx . . $ QString#append(d02845eef0c33901).(" ...</b><br>=====================================</font><br>");
572
573 if (skipTHIS)
574 InfoMessage.appendcxx . . $ QString#append(6a89d0b7f4d2681c).("<br><font color=blue>" +cxx . . $ operator+(c75c3ae4eb9af1a8). trcxx . . $ manageWizard#tr(75d9f1c324b4579d).("No snapshot specific data exist. Skipping...","info message displayed during ...data restoration/deletion") +cxx . . $ operator+(3d22f08efddf8107)."</font><br>");
575
576 uiWcxx . . $ manageWizard#uiW..actionViewcxx . . $ Ui_manageWizard#actionView.->appendcxx . . $ QTextEdit#append(3520e46b33348bf6).(InfoMessage);
577
578 // These are for testing purposes~~~~~~~~~~~~~~~~~~~~
579 //commandLocal = "sleep";
580 //commandArguments.clear();commandArguments << "4";
581 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
582
583 // Do not start specific snapshot data restoration if the relevant snapshots dir does not exist
584 // or do not delete the snapshots folder if it does not exist
585 if (skipTHIS)
586 procFinishedcxx . . $ manageWizard#procFinished(49f6e7a06ebc5aa8).();
587 else
588 {
589 commandProcesscxx . . $ commandProcess. -> startcxx . . $ QProcess#start(5e315ba9c811784d). (commandLocal,commandArgumentscxx . . $ manageWizard#commandArguments.);
590 commandProcesscxx . . $ commandProcess. -> waitForStartedcxx . . $ QProcess#waitForStarted(83c267b20bac841a).();
591 procRunningcxx . . $ manageWizard#procRunning. = true;
592 }
593 }
594 // end of managewizard.cpp ---------------------------------------------------------------------------
595