Code: Alles auswählen
//VARIABLEN
QString flist;
char choice;
QString target_path;
QString options;
QString s_filepath;
QString s_file;
QProcess prc;
QStringList strlist;
Code: Alles auswählen
void Form1::extract()
{
short pos = s_file.find(".tar" , 0);
s_filepath = s_file.left(pos);
chdir(s_filepath); //cd ..
system("tar xf " + s_file); //extraction
cout<<s_filepath<<endl;
cout<<"GUT: STAGE 1"<<endl;
pushButton_conf->setEnabled(1);
}
void Form1::go_conf(QString path, QString name, QString arg) //
{
prc.addArgument(name);
connect(&prc, SIGNAL(readyReadStdout()), this, SLOT(ready() ) );
connect(&prc, SIGNAL(processExited()), this, SLOT(finish() ) );
choice = 'm';
chdir(path); prc.start();
}
void Form1::conf()
{
short pos = s_file.find(".tar" , 0);
s_filepath = s_file.left(pos);
options = lineEdit_parameters->displayText();
target_path = lineEdit_path->displayText();
go_conf(s_filepath, "./configure", 0);
cout<<"bearbeite ./configure script"<<endl;
}
void Form1::go_make(QString path, QString name)
{
prc.addArgument(name);
connect(&prc, SIGNAL(readyReadStdout()), this, SLOT(ready() ) );
connect(&prc, SIGNAL(processExited()), this, SLOT(finish() ) );
choice = 'i';
chdir(path); prc.start();
}
void Form1::make()
{
short pos = s_file.find(".tar" , 0);
s_filepath = s_file.left(pos);
go_make(s_filepath, "make");
cout<<"baue Programm"<<endl;
}
void Form1::go_install(QString path, QString name)
{
prc.addArgument(name);
connect(&prc, SIGNAL(readyReadStdout()), this, SLOT(ready() ) );
connect(&prc, SIGNAL(processExited()), this, SLOT(finish() ) );
chdir(path); prc.start();
}
void Form1::install()
{
short pos = s_file.find(".tar" , 0);
s_filepath = s_file.left(pos);
go_install(s_filepath, "make install");
cout<<"installiere Programm"<<endl;
//chdir(s_filepath); //cd ..
//flist_writer("system_before_install.log", filelister() );
}
void Form1::ready()
{
while (prc.canReadLineStdout() ) {
textEdit_log->append(prc.readLineStdout() );
}
}
void Form1::finish()
{
textEdit_log->append("PROCESS FINISHED");
if(choice == 'm')
pushButton_make->setEnabled(1);
if(choice == 'i')
pushButton_install->setEnabled(1);
}
void Form1::FileDialog()
{
s_file = QFileDialog::getOpenFileName(
"/home",
"Archiv (*.tar *.tar.gz *.tar.bz2)");
lineEdit_path_packet->setText(s_file);
}
a) das archiv (nur wenn es noch nicht entpackt wurde) an eine andere stelle (wo die ausführende datei liegt) entpackt wird, wenn ich das programm mit der konsole öffne.
b) wenn ich normal per mausklick öffne scheint es als ob die bearbeitenden dateien außerhalb des entpackten verzeichnisses kopiert werden und dort bearbeitet werden. allerdings verändern sich auch innerhalb des verzeichnisses dateien.
c) obwohl ich in den oberen funktionen statt ../configure, "make" ausführe steht im log-widget des programmes immer das selbe (nämlich der configure log)
also, der kram macht mich wirklich ratlos.
das prog dient mir zur übung, also entschuldigt die etwas unsaubere form
ich hoffe man kann mir hier z.T. helfen
MFG