aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm/gitWizard.h
blob: e49f43aa30825ecbb6c364ec5f8ecfb2319b9a91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2016, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
//  This is the dialog for cloning a git repository
//===========================================
#ifndef _LUMINA_FM_GIT_DIALOG_H
#define _LUMINA_FM_GIT_DIALOG_H

#include <QWizard>
#include <QString>
#include <QMessageBox>
#include <QCloseEvent>

#include "gitCompat.h"

namespace Ui{
	class GitWizard;
};

class GitWizard : public QWizard{
	Q_OBJECT
public:
	GitWizard(QWidget *parent = 0);
	~GitWizard();

	//Input values;
	void setWorkingDir(QString path);

private:
	Ui::GitWizard *ui;
	QString inDir;
	GitProcess *proc;

	QString assembleURL();
	//void showDownload(GitProcess *P);

private slots:
	//Page Change slots
	void pageChanged(int newpage); //called when the "next" button is clicked
	//void finished(int); //called when the "finish" button is clicked
	
	//Page validation slots
	void validateRepo(); //for page_repo
	void validateType(); //for page_type

	//process output
	void readProc();
	void procFinished(int retcode);

protected:
	void closeEvent(QCloseEvent *ev){
	  //Make sure the process is not running first
	  if(proc!=0 && proc->state()!=QProcess::NotRunning){
	    ev->ignore();
	    if(QMessageBox::Yes == QMessageBox::question(this, tr("Stop Download?"), tr("Kill the current download?") ) ){
	      proc->kill();
	    } 
	  }else{
	    QWizard::closeEvent(ev);
	    this->deleteLater(); //we need to clean this up completely
	  }
	}
};

#endif
bgstack15