-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetDlg.h
More file actions
93 lines (81 loc) · 2.14 KB
/
SetDlg.h
File metadata and controls
93 lines (81 loc) · 2.14 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef SETDLG_H
#define SETDLG_H
#include <QDialog>
#include <QTreeWidgetItem>
#include <QMenu>
#include <QAction>
#include "IndexTask.h"
#include "HotKeyEdit.h"
#include <QProcess>
namespace Ui {
class SetDlg;
}
class InstallTask : public QThread
{
Q_OBJECT
public:
InstallTask(){}
~InstallTask() {}
protected:
void run()
{
QProcess process;
QString pythonPath = m_pythonPath + QString("/python.exe");
QString strCmd = QString("\"%1\" -m pip install -i http://mirrors.aliyun.com/pypi/simple "
"--trusted-host mirrors.aliyun.com -r \"%2\"").
arg(pythonPath).arg(m_requirePath);
process.start(strCmd);
process.waitForFinished(-1);
m_exitCode = process.exitCode();
}
public:
QString m_pythonPath;
QString m_requirePath;
int m_exitCode;
};
class SetDlg : public QDialog
{
Q_OBJECT
public:
explicit SetDlg(QWidget *parent = 0);
~SetDlg();
protected:
void closeEvent(QCloseEvent *event);
public slots:
void sltItemDoubleClicked(QTreeWidgetItem * item, int column);
void sltItemChanged(QTreeWidgetItem * item, int column);
void sltWsItemChanged(QTreeWidgetItem* item,int column);
void sltBrowserPath();
void sltOpenFolder();
void sltInstallPlugin();
void sltUinstallPlugin();
void sltOpenUrl();
void sltOpenDetail();
void sltPluginSet();
void sltCustomContextMenuRequested(const QPoint &pos);
void sltPushButtonAdd();
void sltPushButtonDelete();
void sltPushButtonIndex();
void sltPushButtonAddUrl();
void sltPushButtonDelUrl();
void sltTaskFinished();
void sltPushButtonReset();
void sltPushButtonCheckUpdate();
public:
void LoadPlugin();
void AddPlugin(QString& pluginId);
void RemovePlugin(QString& pluginId);
void LoadPath();
void LoadWebSearch();
private:
Ui::SetDlg *ui;
QMenu* m_popMenu;
QAction* m_actionFolder;
QAction* m_actionDetail;
QAction* m_actionInstall;
QAction* m_actionUninstall;
QAction* m_actionSet;
QAction* m_actionOpenUrl;
IndexTask* m_task;
};
#endif // SETDLG_H