-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
47 lines (40 loc) · 1.93 KB
/
main.py
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
import sys
import app
import gui
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow, QApplication
class Salvation(QMainWindow, app.App):
def __init__(self):
super().__init__()
self.svn = app.svn.Client()
self.ui = gui.ui.Ui_MainWindow()
self.ui.setupUi(self)
self.setup_ui()
self.register_ui_event()
def setup_ui(self):
self.setup_ui_statusbar()
self.setup_ui_bundle()
self.setup_ui_repoconfig()
self.setup_ui_remotesvn()
self.ui.statusbar.showMessage("[Welcome] Powered by LIU-Yinyi :D")
def register_ui_event(self):
# win_bundlelist
self.ui.listWidget_repos.setContextMenuPolicy(Qt.CustomContextMenu)
self.ui.listWidget_repos.customContextMenuRequested.connect(self.event_listwidget_repos_right_click)
self.ui.listWidget_repos.mousePressEvent = self.event_listwidget_repos_left_click
# win_reposconfig
self.ui.pushButton_loginPassword.clicked.connect(self.event_button_login_by_password)
self.ui.pushButton_loginKey.clicked.connect(self.event_button_login_by_sshkey)
self.ui.pushButton_loadKey.clicked.connect(self.event_button_load_sshkey)
self.ui.lineEdit_address.textChanged.connect(self.event_lineedit_address_onchange)
# win_remotesvn
self.ui.treeView_remoteSvn.setExpandsOnDoubleClick(False) # avoid expanding twice
self.ui.treeView_remoteSvn.mousePressEvent = self.event_remotesvn_treeview_left_click
self.ui.treeView_remoteSvn.mouseDoubleClickEvent = self.event_remotesvn_treeview_left_double_click
self.ui.treeView_remoteSvn.setContextMenuPolicy(Qt.CustomContextMenu)
self.ui.treeView_remoteSvn.customContextMenuRequested.connect(self.event_remotesvn_treeview_right_click)
if __name__ == '__main__':
application = QApplication(sys.argv)
windows = Salvation()
windows.show()
sys.exit(application.exec_())