Projects/ds4clonerestore/ds4clonerestore/src/restore.h

00001 /******************************************************
00002 * DS4 Clone-Restore
00003 *
00004 * DS4 Laser Technology srl
00005 *
00006 * author: Carsana Francesco <francescocarsana@ds4.it>
00007 *******************************************************/
00008 
00009 #ifndef RESTORE_H
00010 #define RESTORE_H
00011 
00012 #include <kapplication.h>
00013 #include <qdir.h>
00014 #include <qmessagebox.h>
00015 #include <qstringlist.h>
00016 #include <qcombobox.h>
00017 #include <qcheckbox.h>
00018 #include <qradiobutton.h>
00019 #include <qfile.h>
00020 #include <qlistview.h>
00021 #include <qprocess.h>
00022 #include <qcursor.h>
00023 #include <kled.h>
00024 #include <vector>
00025 #include <cstdlib>
00026 #include <sys/mount.h>
00027 #include <errno.h>
00028 
00029 #include "restoredlg.h"
00030 #include "restoreoutput.h"
00031 #include "utility.h"
00032 
00033 using namespace std;
00034 
00035 
00037 struct partitionData
00038 {
00039     QString name; 
00040     QString start; 
00041     QString size; 
00042     QString id; 
00043     bool bootable; 
00044 };
00045 
00046 
00048 
00056 class Restore : public restoreDlg
00057 {
00058     Q_OBJECT
00059 
00060 
00061 public:
00062 
00064     Restore(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00065 
00067     ~Restore();
00068 
00070 
00076     void Init(bool *mountedRev, bool *mountedServer); // inizializza il widget, caricando seriali, date e tabella partizioni
00077 
00078 
00079 
00080 public slots:
00081 
00083     virtual void btnCancelRestore_clicked();
00084     
00086     virtual void btnStartRestore_clicked();
00087     
00089     virtual void btnMountRev_clicked();
00090     
00092     virtual void btnMountServer_clicked();
00093     
00095     virtual void cmbSerial_activated(const QString& string);
00096     
00098     virtual void cmbDate_activated(const QString& string);
00099     
00101     virtual void radRev_clicked();
00102     
00104     virtual void radServer_clicked();
00105     
00107     virtual void readFromStdout();
00108     
00110     virtual void readFromStderr();
00111     
00113 
00116     virtual void closeEvent(QCloseEvent *e);
00117 
00118 
00119 private:
00120 
00122     QWidget* mainWin;
00123     
00125     QDir* dir;
00126     
00128     QStringList machineList;
00129     
00131     QStringList dateList;
00132     
00134     QFile *partitionTableFile;
00135     
00137     vector<partitionData> vecPartitions;
00138     
00140     QProcess *proc;
00141     
00143     RestoreOutput *output;
00144     
00146     char pathRev[20];
00147     
00149     char deviceHDSource[20];
00150     
00152     char deviceHDDestination[20];
00153     
00155     char pathServer[20];
00156     
00158     char addressServer[20];
00159     
00161     char swapPartition[20];
00162     
00164     bool *revMounted;
00165     
00167     bool *serverMounted;
00168     
00170     bool foundedRev;
00171     
00173     bool foundedServer;
00174 
00176 
00184     void ParsePartitionLine(QString line, partitionData& p);
00185     
00187 
00193     QString FindHDSource(QString fileName);
00194     
00196 
00203     QString Src2Dest(QString source);
00204     
00206 
00209     void Close();
00210 };
00211 
00212 #endif
00213 

Generato il Wed Jun 13 18:59:37 2007 per DS4CloneRestore da  doxygen 1.5.2