Changeset 1093 for s10k/Vago/xmlToolsInterface
- Timestamp:
- Dec 30, 2017, 2:57:32 PM (7 years ago)
- Location:
- s10k/Vago/xmlToolsInterface
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
s10k/Vago/xmlToolsInterface/xmltoolsinterface.cpp
r1059 r1093 2 2 #include "ui_xmltoolsinterface.h" 3 3 4 XmlToolsInterface::XmlToolsInterface( Logger *myLogger,QWidget *parent) :4 XmlToolsInterface::XmlToolsInterface(QWidget *parent) : 5 5 QMainWindow(parent), 6 6 ui(new Ui::XmlToolsInterface), … … 9 9 ui->setupUi(this); 10 10 this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished. 11 this->myLogger = myLogger; 12 this->xmlProcessor = new XmlProcessor(UtilVago::getAppPath(), this->myLogger, &this->listToProccess); 11 this->xmlProcessor = new XmlProcessor(UtilVago::getAppPath(), &this->listToProccess); 13 12 14 13 // setup the correct input options for the current selection … … 162 161 if(oldFile.exists()){ 163 162 if(!oldFile.remove()){ 164 UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, 165 "Couldn't remove old temporary file to preview XML patch! Existing file:\n" 163 UtilVago::showAndLogErrorPopUpLogButton("Couldn't remove old temporary file to preview XML patch! Existing file:\n" 166 164 + previewFileLocation 167 165 ); … … 170 168 171 169 if(!QFile::copy(currentFileLocation, previewFileLocation)){ 172 UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, 173 "Couldn't create temporary file to preview the XML patch!\nFrom: " + 170 UtilVago::showAndLogErrorPopUpLogButton("Couldn't create temporary file to preview the XML patch!\nFrom: " + 174 171 currentFileLocation + 175 172 "\nTo: " + previewFileLocation … … 204 201 205 202 if(ui->leInputInputFiles->text().trimmed().isEmpty()){ 206 Util:: showErrorPopUp("You must provide an Input File!");203 Util::Dialogs::showError("You must provide an Input File!"); 207 204 return false; 208 205 } 209 206 210 207 if(ui->rbFilterRelativeElements->isChecked() && ui->leFilterElement->text().trimmed().isEmpty()){ 211 Util:: showErrorPopUp("With Relative Elements checked you must provide a Element Name!");208 Util::Dialogs::showError("With Relative Elements checked you must provide a Element Name!"); 212 209 return false; 213 210 } 214 211 215 212 if(ui->cbFilterParentElement->isChecked() && ui->leFilterParentElement->text().trimmed().isEmpty()){ 216 Util:: showErrorPopUp("Parent Element is checked but none was provided!");213 Util::Dialogs::showError("Parent Element is checked but none was provided!"); 217 214 return false; 218 215 } … … 221 218 if(ui->leFilterAttributeName->text().trimmed().isEmpty()) 222 219 { 223 Util:: showErrorPopUp("Attribute Name is checked but none was provided!");220 Util::Dialogs::showError("Attribute Name is checked but none was provided!"); 224 221 return false; 225 222 } … … 227 224 if(ui->leFilterAttributeValue->text().trimmed().isEmpty()) 228 225 { 229 Util:: showErrorPopUp("With Attribute Name checked you must provide a Attribute Value!");226 Util::Dialogs::showError("With Attribute Name checked you must provide a Attribute Value!"); 230 227 return false; 231 228 } … … 234 231 if(ui->rbFilterXPathExpression->isChecked() && ui->leFilterXPathExpression->text().trimmed().isEmpty()) 235 232 { 236 Util:: showErrorPopUp("X-Path Expression is checked but none was provided!");233 Util::Dialogs::showError("X-Path Expression is checked but none was provided!"); 237 234 return false; 238 235 } 239 236 240 237 if(ui->cbXmlToolsOperation->currentText() == "Add Values" && ui->leInputNewValues->text().isEmpty()){ 241 Util:: showErrorPopUp(R"|(With "Add Values" operation selected you must provide the "New Value(s)" to be added.)|");238 Util::Dialogs::showError(R"|(With "Add Values" operation selected you must provide the "New Value(s)" to be added.)|"); 242 239 return false; 243 240 } 244 241 245 242 if(ui->cbXmlToolsOperation->currentText() == "Remove Values" && ui->leInputCurrentValues->text().isEmpty()){ 246 Util:: showErrorPopUp(R"|(With "Remove Value" operation selected you must provide the "Current Value(s)" to be removed.)|");243 Util::Dialogs::showError(R"|(With "Remove Value" operation selected you must provide the "Current Value(s)" to be removed.)|"); 247 244 return false; 248 245 } … … 269 266 // if there's a preview in progress don't display the message below 270 267 if(!this->previewInProgress){ 271 Util:: showPopUp("File(s) processed with sucess!");268 Util::Dialogs::showInfo("File(s) processed with sucess!"); 272 269 } 273 270 } … … 305 302 306 303 if(ui->leInputNewValues->isEnabled()){ 307 currCommand += "--new-val " + Util:: insertQuotes(ui->leInputNewValues->text()) + " ";304 currCommand += "--new-val " + Util::String::insertQuotes(ui->leInputNewValues->text()) + " "; 308 305 } 309 306 310 307 if(ui->leInputCurrentValues->isEnabled()){ 311 currCommand += "--current-val " + Util:: insertQuotes(ui->leInputCurrentValues->text()) + " ";308 currCommand += "--current-val " + Util::String::insertQuotes(ui->leInputCurrentValues->text()) + " "; 312 309 } 313 310 314 311 if(ui->leInputPositions->isEnabled() && !ui->leInputPositions->text().trimmed().isEmpty()){ 315 currCommand += "--positions " + Util:: insertQuotes(ui->leInputPositions->text()) + " ";312 currCommand += "--positions " + Util::String::insertQuotes(ui->leInputPositions->text()) + " "; 316 313 } 317 314 318 315 if(ui->leInputDiffOldNewValue->isEnabled()){ 319 currCommand += "--diff-old-new-val " + Util:: insertQuotes(ui->leInputDiffOldNewValue->text()) + " ";316 currCommand += "--diff-old-new-val " + Util::String::insertQuotes(ui->leInputDiffOldNewValue->text()) + " "; 320 317 } 321 318 322 319 if(ui->rbFilterRelativeElements->isChecked()){ 323 320 if(ui->leFilterElement->isEnabled()){ 324 currCommand += "--element-name " + Util:: insertQuotes(ui->leFilterElement->text()) + " ";321 currCommand += "--element-name " + Util::String::insertQuotes(ui->leFilterElement->text()) + " "; 325 322 } 326 323 if(ui->leFilterParentElement->isEnabled()){ 327 currCommand += "--parent-element-name " + Util:: insertQuotes(ui->leFilterParentElement->text()) + " ";324 currCommand += "--parent-element-name " + Util::String::insertQuotes(ui->leFilterParentElement->text()) + " "; 328 325 } 329 326 if(ui->leFilterAttributeName->isEnabled()){ 330 currCommand += "--attribute-name " + Util:: insertQuotes(ui->leFilterAttributeName->text()) + " ";331 currCommand += "--attribute-value " + Util:: insertQuotes(ui->leFilterAttributeValue->text()) + " ";327 currCommand += "--attribute-name " + Util::String::insertQuotes(ui->leFilterAttributeName->text()) + " "; 328 currCommand += "--attribute-value " + Util::String::insertQuotes(ui->leFilterAttributeValue->text()) + " "; 332 329 } 333 330 } 334 331 else{ 335 332 if(ui->leFilterXPathExpression->isEnabled()){ 336 currCommand += "--xpath-expression " + Util:: insertQuotes(ui->leFilterXPathExpression->text()) + " ";333 currCommand += "--xpath-expression " + Util::String::insertQuotes(ui->leFilterXPathExpression->text()) + " "; 337 334 } 338 335 } 339 336 340 337 if(alternativeFileLocation.isEmpty()){ 341 currCommand += "--files " + Util:: insertQuotes(ui->leInputInputFiles->text());338 currCommand += "--files " + Util::String::insertQuotes(ui->leInputInputFiles->text()); 342 339 } 343 340 else{ 344 currCommand += "--files " + Util:: insertQuotes(alternativeFileLocation);341 currCommand += "--files " + Util::String::insertQuotes(alternativeFileLocation); 345 342 } 346 343 -
s10k/Vago/xmlToolsInterface/xmltoolsinterface.h
r1058 r1093 24 24 25 25 public: 26 explicit XmlToolsInterface( Logger *myLogger,QWidget *parent = 0);26 explicit XmlToolsInterface(QWidget *parent = 0); 27 27 ~XmlToolsInterface(); 28 28 … … 73 73 private: 74 74 Ui::XmlToolsInterface *ui; 75 Logger *myLogger = nullptr;76 75 QStringList listToProccess; //commands to execute 77 76 XmlProcessor *xmlProcessor = nullptr; -
s10k/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp
r1058 r1093 23 23 ui->tePreviewFileText->setText(this->previewText); 24 24 25 highlighterCurrentFile = new BasicXMLSyntaxHighlighter(ui->teCurrentFileText);26 highlighterPreviewFile = new BasicXMLSyntaxHighlighter(ui->tePreviewFileText);25 highlighterCurrentFile.setDocument(ui->teCurrentFileText->document()); 26 highlighterPreviewFile.setDocument(ui->tePreviewFileText->document()); 27 27 28 28 previewFile.close(); … … 172 172 } 173 173 174 highlighterPreviewFile ->rehighlight();175 highlighterCurrentFile ->rehighlight();174 highlighterPreviewFile.rehighlight(); 175 highlighterCurrentFile.rehighlight(); 176 176 } 177 177 178 178 XmlToolsInterfaceCommandPreview::~XmlToolsInterfaceCommandPreview() 179 179 { 180 delete this->highlighterCurrentFile;181 delete this->highlighterPreviewFile;182 180 delete this->lineNumberDisplayCurrentFile; 183 181 delete this->lineNumberDisplayPreviewFile; -
s10k/Vago/xmlToolsInterface/xmltoolsinterfacecommandpreview.h
r1058 r1093 6 6 #include <QScrollBar> 7 7 8 #include "../libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h"9 #include "../libs/LineNumberDisplay/LineNumberDisplay.h"8 #include <BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h> 9 #include <LineNumberDisplay/LineNumberDisplay.h> 10 10 #include "util.h" 11 11 … … 24 24 private: 25 25 Ui::XmlToolsInterfaceCommandPreview *ui; 26 BasicXMLSyntaxHighlighter *highlighterCurrentFile;27 BasicXMLSyntaxHighlighter *highlighterPreviewFile;26 BasicXMLSyntaxHighlighter highlighterCurrentFile; 27 BasicXMLSyntaxHighlighter highlighterPreviewFile; 28 28 LineNumberDisplay *lineNumberDisplayCurrentFile; 29 29 LineNumberDisplay *lineNumberDisplayPreviewFile;
Note:
See TracChangeset
for help on using the changeset viewer.