1
//This file is part of AcetoneISO. Copyright 2006,2007,2008,2009 Marco Di Antonio and Fabrizio Di Marco (acetoneiso@gmail.com)
3
// AcetoneISO is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, either version 3 of the License, or
6
// (at your option) any later version.
8
// AcetoneISO is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License
14
// along with AcetoneISO. If not, see <http://www.gnu.org/licenses/>.
15
void acetoneiso::split()
17
//7z a -v100m test tales_radiant_mythology.cso
20
QDir::setCurrent( bin.path() );
21
split.setFileName("7z");
23
QDir Home = QDir::home();
24
QString fileName = QFileDialog::getOpenFileName(this,tr("Open Image to be splitted"),Home.path() , tr("Image Files (*.iso *.daa *.bin *.mdf *.ashdisc *.bwi *.b5i *.lcd *.img *.cdi *.cif *.p01 *.pdi *.nrg *.ncd *.pxi *.gi *.fcd *.vcd *.c2d *.dmg *.gpg)"));
25
if ( fileName.isNull() ) {
29
QDir Home = QDir::home();
30
QString split_folder = QFileDialog::getSaveFileName(this, tr("AcetoneISO::Insert volume name"), Home.path() + "/AcetoneISO_Volumes");
31
if ( split_folder.isNull() ) {
35
int i = QInputDialog::getInteger(this, tr("AcetoneISO::Split number"),tr("Please insert the volume number in MegaByte:"), 99, 1, 100000, 1, &ok);
41
file = QString::number(i).append("m");
44
QDir::setCurrent( bin.path() );
45
disable_all_button_processes();
46
SPlit.start("7z",QStringList() << "a" << "-y" << "-t7z" << "-m0=lzma" << "-mx=1" << "-mfb=8" << "-md=2m" << "-ms=on" << file << split_folder << fileName);
55
void acetoneiso::merge()
58
/* QFileDialog dialog(this, tr("AcetoneISO::Select Parts keeping CTRL key pressed"), Home.path());
59
dialog.setFileMode(QFileDialog::ExistingFiles);
60
dialog.setViewMode(QFileDialog::Detail);
61
QStringList fileNames;
63
fileNames = dialog.selectedFiles();
64
if (!fileNames.isEmpty()) {
65
QString merged = QFileDialog::getSaveFileName(this, tr("AcetoneISO::Save merged image"),Home.path() + "/Acetone_merged");
66
if (merged.isNull() ) {
70
CAt.setReadChannel(QProcess::StandardOutput);//imposto il canale di lettura del processo
71
CAt.setStandardOutputFile( merged, QIODevice::Truncate );//l'output di cat va nel file merged.
72
CAt.start("cat", QStringList() << fileNames );//faccio partire il processo cat.
79
QDir::setCurrent( bin.path() );
80
split.setFileName("7z");
82
QDir Home = QDir::home();
83
QString fileName = QFileDialog::getOpenFileName(this,tr("Select first volume part"),Home.path() , tr("7Z 001 (*.001)"));
84
if ( fileName.isNull() ) {
88
QString folder = QFileDialog::getExistingDirectory(this, tr("AcetoneISO::Select where to extract image"),Home.path());
89
if (folder.isNull() ) {
95
disable_all_button_processes();
96
SPlit.start("7z",QStringList() << "x" << "-y" << folder << fileName);
99
//7z x -y -oDesktop/ iso_acetoneiso2.iso.7z