~ubuntu-branches/ubuntu/saucy/acetoneiso/saucy

« back to all changes in this revision

Viewing changes to acetoneiso/sources/split.h

  • Committer: Bazaar Package Importer
  • Author(s): Nick Andrik
  • Date: 2010-01-19 20:16:15 UTC
  • Revision ID: james.westby@ubuntu.com-20100119201615-bdokwbbqhn1fo1iq
Tags: upstream-2.2.1
ImportĀ upstreamĀ versionĀ 2.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//This file is part of AcetoneISO. Copyright 2006,2007,2008,2009 Marco Di Antonio and Fabrizio Di Marco (acetoneiso@gmail.com)
 
2
//
 
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.
 
7
//
 
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.
 
12
//
 
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()
 
16
{
 
17
//7z a -v100m test tales_radiant_mythology.cso
 
18
QDir bin("/usr/bin");
 
19
QFile split;
 
20
QDir::setCurrent( bin.path() );
 
21
split.setFileName("7z");
 
22
 
 
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() ) {
 
26
    return;
 
27
  }
 
28
 else{
 
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() ) {
 
32
        }
 
33
        else{
 
34
        bool ok;
 
35
        int i = QInputDialog::getInteger(this, tr("AcetoneISO::Split number"),tr("Please insert the volume number in MegaByte:"), 99, 1, 100000, 1, &ok);
 
36
                if (!ok) {
 
37
                   return;
 
38
                 }
 
39
                else {
 
40
                 QString file;
 
41
                 file = QString::number(i).append("m");
 
42
                 file.prepend("-v");
 
43
                 bin = split_folder;
 
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);
 
47
                        progBarra();
 
48
                 }
 
49
           }
 
50
      }
 
51
  
 
52
 
 
53
}
 
54
 
 
55
void acetoneiso::merge()
 
56
{
 
57
 
 
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;
 
62
if (dialog.exec()) {
 
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() ) {
 
67
         return;
 
68
       }
 
69
      else{
 
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.
 
73
         progBarra();
 
74
       }
 
75
    }
 
76
 }*/
 
77
QDir bin("/usr/bin");
 
78
QFile split;
 
79
QDir::setCurrent( bin.path() );
 
80
split.setFileName("7z");
 
81
 
 
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() ) {
 
85
    return;
 
86
  }
 
87
 else{
 
88
         QString folder = QFileDialog::getExistingDirectory(this, tr("AcetoneISO::Select where to extract image"),Home.path());
 
89
         if (folder.isNull() ) {
 
90
          }
 
91
         else {
 
92
 
 
93
                 QString file;
 
94
                 folder.prepend("-o");
 
95
         disable_all_button_processes();
 
96
                 SPlit.start("7z",QStringList()  << "x" << "-y" << folder << fileName);
 
97
                        progBarra();
 
98
                 
 
99
           //7z x -y -oDesktop/ iso_acetoneiso2.iso.7z
 
100
      }
 
101
 
 
102
}
 
103
 
 
104
}
 
105
 
 
106