19 #include <QFileDialog> 20 #include <QVBoxLayout> 21 #include <QHBoxLayout> 22 #include <QMessageBox> 28 for(
int i=0;i<15;i++){
InFiles.append(QString(
""));}
30 buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
31 this->setWindowTitle(tr(
"Create Cloud Save Folder"));
36 this->setMinimumSize(458*qApp->desktop()->logicalDpiX()/96,438*qApp->desktop()->logicalDpiY()/96);
37 lblOut=
new QLabel(tr(
"Output Path:"));
39 lineOutPath->setPlaceholderText(tr(
"Folder To Write Files Into"));
43 QHBoxLayout *outpathLayout =
new QHBoxLayout;
44 outpathLayout->addWidget(lblOut);
48 lblUserID=
new QLabel(tr(
"Sign With User Id"));
50 lineUserID->setPlaceholderText(tr(
"Your SE Id number"));
51 IDSpacer=
new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Minimum);
53 QHBoxLayout *userIDLayout =
new QHBoxLayout;
56 userIDLayout->addSpacerItem(
IDSpacer);
62 QHBoxLayout *savegroup00 =
new QHBoxLayout;
71 QHBoxLayout *savegroup01 =
new QHBoxLayout;
80 QHBoxLayout *savegroup02 =
new QHBoxLayout;
89 QHBoxLayout *savegroup03 =
new QHBoxLayout;
98 QHBoxLayout *savegroup04 =
new QHBoxLayout;
107 QHBoxLayout *savegroup05 =
new QHBoxLayout;
114 lineSave06->setPlaceholderText(tr(
"Add Files For each Save you want in your cloud data."));
117 QHBoxLayout *savegroup06 =
new QHBoxLayout;
124 lineSave07->setPlaceholderText(tr(
"You Can Use Any Format That Black Chocobo Can Open"));
127 QHBoxLayout *savegroup07 =
new QHBoxLayout;
134 lineSave08->setPlaceholderText(tr(
"Unused files will be Looked for in the Save Path"));
137 QHBoxLayout *savegroup08 =
new QHBoxLayout;
144 lineSave09->setPlaceholderText(tr(
"Pressing Ok Will Overwrite Any Metadata in the save path"));
147 QHBoxLayout *savegroup09 =
new QHBoxLayout;
152 QVBoxLayout *SaveGroupLayout =
new QVBoxLayout;
153 SaveGroupLayout->addLayout(savegroup00);
154 SaveGroupLayout->addLayout(savegroup01);
155 SaveGroupLayout->addLayout(savegroup02);
156 SaveGroupLayout->addLayout(savegroup03);
157 SaveGroupLayout->addLayout(savegroup04);
158 SaveGroupLayout->addLayout(savegroup05);
159 SaveGroupLayout->addLayout(savegroup06);
160 SaveGroupLayout->addLayout(savegroup07);
161 SaveGroupLayout->addLayout(savegroup08);
162 SaveGroupLayout->addLayout(savegroup09);
168 buttonBox->addButton(QDialogButtonBox::Ok);
169 buttonBox->addButton(QDialogButtonBox::Cancel);
171 QVBoxLayout *FinalLayout=
new QVBoxLayout;
172 FinalLayout->addLayout(outpathLayout);
173 FinalLayout->addLayout(userIDLayout);
177 setLayout(FinalLayout);
221 if(arg1.isEmpty()){
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);}
222 else{
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);}
227 QString temp = QFileDialog::getExistingDirectory(
this,tr(
"Select A Directory To Save Into"),QString(
"%1/Square Enix/FINAL FANTASY VII/").arg(QDir::homePath()));
228 if(!temp.isNull()){
OutPath=temp;}
230 lineUserID->setText(temp.remove(0,temp.lastIndexOf(
"_")+1));
238 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save00"),QDir::homePath());
248 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save01"),QDir::homePath());
258 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save02"),QDir::homePath());
268 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save03"),QDir::homePath());
278 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save04"),QDir::homePath());
288 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save05"),QDir::homePath());
298 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save06"),QDir::homePath());
308 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save07"),QDir::homePath());
318 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save08"),QDir::homePath());
328 QString temp = QFileDialog::getOpenFileName(
this,tr(
"Select A File To Use As Save09"),QDir::homePath());
336 for(
int i=0;i<10;i++)
338 QString OutFile =QString(
"%1/save0%2.ff7").arg(
OutPath,QString::number(i));
342 QFile tempFile(OutFile);
343 if(tempFile.exists())
356 else{QMessageBox::critical(
this,QString(tr(
"File Error")),QString(tr(
"Failure to write the File: %1")).arg(OutFile));}
360 QString achievement(QString(
"%1/achievement.dat").arg(
OutPath));
361 QFile file(achievement);
365 if(!file.open(QIODevice::ReadOnly)){
return;}
374 if(!file.open(QIODevice::WriteOnly)){
return;}
377 file.write(QByteArray(
"\x00\x00\x00\x00\x00\x00\x00\x00"));
bool exportPC(const QString &fileName)
attempt to save fileName as a PC ff7save
bool loadFile(const QString &fileName)
attempt to load fileName as ff7save
edit saves from Final Fantasy 7
bool fixMetaData(QString fileName="", QString OutPath="", QString UserID="")
parse the metadata for 2012 / 2013 release
bool saveFile(const QString &fileName)
attempt to save fileName as ff7save