Debian Codegraph @

HercUtilities/Dasdcat.cpp

raw symbols SCIP
1 /*
2 * File: Dasdcat.cpp
3 *
4 * Author: Jacob Dekel
5 * Created on: Aug 7, 2009
6 *
7 * Copyright (c) 2009-2013 Jacob Dekel
8 * $Id$
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
25 #include "Dasdcat.h"cxx . . $ `<file>/HercUtilities/Dasdcat.h`/
26 #include "HerculesStudio.h"cxx . . $ `<file>/HercStudio/HerculesStudio.h`/
27 #include "UtilityRunner.h"cxx . . $ `<file>/HercUtilities/UtilityRunner.h`/
28 #include "Preferences.h"cxx . . $ `<file>/HercStudio/Preferences.h`/
29
30 #include <QFileDialog>
31 #include <QMessageBox>
32
33 #include <csignal>
34
35
36 Dasdcatcxx . . $ Dasdcat#::Dasdcatcxx . . $ Dasdcat#Dasdcat(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent)
37 : GenericUtilitycxx . . $ GenericUtility#("dasdcat"cxx . . $ QString#QString(e1217c004a86c950).,parent)
38 {
39 uicxx . . $ Dasdcat#ui..setupUicxx . . $ Ui_DasdcatClass#setupUi(108f35f7aa7f3cf9).(this);
40 uicxx . . $ Dasdcat#ui..listRadioButtoncxx . . $ Ui_DasdcatClass#listRadioButton.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true);
41 uicxx . . $ Dasdcat#ui..memberNamecxx . . $ Ui_DasdcatClass#memberName.->setDisabledcxx . . $ QWidget#setDisabled(b45ddcbc8423892c).(true);
42
43 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ Dasdcat#ui..runButtoncxx . . $ Ui_DasdcatClass#runButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(runClicked()));
44 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ Dasdcat#ui..exitButtoncxx . . $ Ui_DasdcatClass#exitButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(exitClicked()));
45 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ Dasdcat#ui..browseFileButtoncxx . . $ Ui_DasdcatClass#browseFileButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(browseFileClicked()));
46 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ Dasdcat#ui..browseSfButtoncxx . . $ Ui_DasdcatClass#browseSfButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(browseSfClicked()));
47 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ Dasdcat#ui..specificRadioButtoncxx . . $ Ui_DasdcatClass#specificRadioButton., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(toggled(bool)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(specificToggeled(bool)));
48 }
49
50 Dasdcatcxx . . $ Dasdcat#::~cxx . . $ Dasdcat#`~Dasdcat`(49f6e7a06ebc5aa8).Dasdcatcxx . . $ Dasdcat#()
51 {
52
53 }
54
55 void Dasdcatcxx . . $ Dasdcat#::runClickedcxx . . $ Dasdcat#runClicked(49f6e7a06ebc5aa8).()
56 {
57 if (!runOrStopClickedcxx . . $ GenericUtility#runOrStopClicked(c9857a73d68e59ba).())
58 {
59 uicxx . . $ Dasdcat#ui..runButtoncxx . . $ Ui_DasdcatClass#runButton.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("Run"cxx . . $ QString#QString(85c52e162fed56f9).);
60 return;
61 }
62
63 if (uicxx . . $ Dasdcat#ui..filenamecxx . . $ Ui_DasdcatClass#filename.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
64 {
65 QMessageBoxcxx . . $ QMessageBox#::warningcxx . . $ QMessageBox#warning(21b6fd1dd558cc82).(this, "dasdcat"cxx . . $ QString#QString(85c52e162fed56f9)., "Please specify ckd file to process"cxx . . $ QString#QString(85c52e162fed56f9).,
66 QMessageBoxcxx . . $ QMessageBox#::Okcxx . . $ QMessageBox#Ok., QMessageBoxcxx . . $ QMessageBox#::NoButtoncxx . . $ QMessageBox#NoButton.);
67 return;
68 }
69 if (uicxx . . $ Dasdcat#ui..dsnamecxx . . $ Ui_DasdcatClass#dsname.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
70 {
71 QMessageBoxcxx . . $ QMessageBox#::warningcxx . . $ QMessageBox#warning(21b6fd1dd558cc82).(this, "dasdcat"cxx . . $ QString#QString(85c52e162fed56f9)., "Please specify PDS name"cxx . . $ QString#QString(85c52e162fed56f9).,
72 QMessageBoxcxx . . $ QMessageBox#::Okcxx . . $ QMessageBox#Ok., QMessageBoxcxx . . $ QMessageBox#::NoButtoncxx . . $ QMessageBox#NoButton.);
73 return;
74 }
75 stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> parameterscxx . . $ std/vector#vector(49f6e7a06ebc5aa8).;
76
77 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).("-i"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).);
78 parameters.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(uicxx . . $ Dasdcat#ui..filenamecxx . . $ Ui_DasdcatClass#filename.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).());
79
80 if (!uicxx . . $ Dasdcat#ui..shadowFilecxx . . $ Ui_DasdcatClass#shadowFile.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
81 {
82 stdcxx . . $ std/::stringcxx . . $ std/string# sfcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f). = "sf="cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).;
83 sf +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). uicxx . . $ Dasdcat#ui..shadowFilecxx . . $ Ui_DasdcatClass#shadowFile.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).();
84 parameters.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(sf);
85 }
86 stdcxx . . $ std/::stringcxx . . $ std/string# dsnameSpec = uicxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f)..dsnamecxx . . $ Ui_DasdcatClass#dsname.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).();
87 dsnameSpec +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). "/";
88 if (uicxx . . $ Dasdcat#ui..listRadioButtoncxx . . $ Ui_DasdcatClass#listRadioButton.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
89 {
90 dsnameSpec+=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). "?";
91 }
92 else if (uicxx . . $ Dasdcat#ui..specificRadioButtoncxx . . $ Ui_DasdcatClass#specificRadioButton.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).())
93 {
94 if (uicxx . . $ Dasdcat#ui..memberNamecxx . . $ Ui_DasdcatClass#memberName.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
95 {
96 QMessageBoxcxx . . $ QMessageBox#::warningcxx . . $ QMessageBox#warning(21b6fd1dd558cc82).(this, "dasdcat"cxx . . $ QString#QString(85c52e162fed56f9)., "Member name must be provided when selecting\n'show specific member content'"cxx . . $ QString#QString(85c52e162fed56f9).,
97 QMessageBoxcxx . . $ QMessageBox#::Okcxx . . $ QMessageBox#Ok., QMessageBoxcxx . . $ QMessageBox#::NoButtoncxx . . $ QMessageBox#NoButton.);
98 return;
99 }
100 dsnameSpec +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). uicxx . . $ Dasdcat#ui..memberNamecxx . . $ Ui_DasdcatClass#memberName.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).().toStdStringcxx . . $ QString#toStdString(219584694fe2b248).();
101 dsnameSpec +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). ":c"; // make it readable on log
102 }
103 else if (uicxx . . $ Dasdcat#ui..allRadioButtoncxx . . $ Ui_DasdcatClass#allRadioButton.)
104 {
105 dsnameSpec +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). "*:c";
106 }
107 parameters.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(dsnameSpec);
108 stdcxx . . $ std/::stringcxx . . $ std/string# commandcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f). = "dasdcat"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).;
109
110 executecxx . . $ GenericUtility#execute(e5618828c763ae1e).(command, Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).().hercDircxx . . $ Preferences#hercDir(219584694fe2b248).(), parameters);
111 uicxx . . $ Dasdcat#ui..runButtoncxx . . $ Ui_DasdcatClass#runButton.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).("Stop"cxx . . $ QString#QString(85c52e162fed56f9).);
112 }
113
114
115 void Dasdcatcxx . . $ Dasdcat#::exitClickedcxx . . $ Dasdcat#exitClicked(49f6e7a06ebc5aa8).()
116 {
117 deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).();
118 }
119
120 void Dasdcatcxx . . $ Dasdcat#::browseFileClickedcxx . . $ Dasdcat#browseFileClicked(49f6e7a06ebc5aa8).()
121 {
122 QStringcxx . . $ QString# s = QFileDialogcxx . . $ QString#QString(e1217c004a86c950).::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236).(this,"Browse for disk to update"cxx . . $ QString#QString(85c52e162fed56f9).,uicxx . . $ Dasdcat#ui..filenamecxx . . $ Ui_DasdcatClass#filename.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).());
123 uicxx . . $ Dasdcat#ui..filenamecxx . . $ Ui_DasdcatClass#filename.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(s);
124 }
125
126 void Dasdcatcxx . . $ Dasdcat#::browseSfClickedcxx . . $ Dasdcat#browseSfClicked(49f6e7a06ebc5aa8).()
127 {
128 QStringcxx . . $ QString# s = QFileDialogcxx . . $ QString#QString(e1217c004a86c950).::getOpenFileNamecxx . . $ QFileDialog#getOpenFileName(a6b29be4bec65236).(this,"Browse for shadow file"cxx . . $ QString#QString(85c52e162fed56f9).,uicxx . . $ Dasdcat#ui..shadowFilecxx . . $ Ui_DasdcatClass#shadowFile.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).());
129 uicxx . . $ Dasdcat#ui..shadowFilecxx . . $ Ui_DasdcatClass#shadowFile.->setTextcxx . . $ QLineEdit#setText(3520e46b33348bf6).(s);
130 }
131
132 void Dasdcatcxx . . $ Dasdcat#::specificToggeledcxx . . $ Dasdcat#specificToggeled(b45ddcbc8423892c).(bool checked)
133 {
134 uicxx . . $ Dasdcat#ui..memberNamecxx . . $ Ui_DasdcatClass#memberName.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(checked);
135 }
136
137 void Dasdcatcxx . . $ Dasdcat#::finishedSlotcxx . . $ Dasdcat#finishedSlot(49f6e7a06ebc5aa8).()
138 {
139 }