-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddt.py
executable file
·141 lines (120 loc) · 3.81 KB
/
ddt.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys, os
from PySide.QtCore import *
from PySide.QtGui import *
from paramiko import SSHClient, AutoAddPolicy
from yelib.qt.layout import *
from yelib.task import *
#from tabs.BaseTab import BaseTab, IconLabel
from SettingsDlg import SettingsDlg
from MainArea import MainArea
__version__ = "1.1"
STYLE_SHEET = """
/*
QTabBar::tab,
*/
QPushButton {
border: 1px outset rgb(150,150,150);
border-radius: 3px;
}
QPushButton:hover {
border: 1.5px outset dimgray;
background: rgb(150,150,150);
}
/*
QTabBar::tab:hover { background: rgb(150,150,150); }
QTabBar::tab:selected {
color: rgb(220,220,220);
background: rgb(130,130,130);
border: 1px inset rgb(150,150,150);
}
QTabWidget::pane { border:1px solid rgb(150,150,150);}
*/
QStatusBar::item { border:0; }
QLineEdit, QTextEdit, QComboBox,
QListWidget, QTableWidget, QGroupBox {
padding: 2px; border-radius: 3px;
border:1px solid rgb(150,150,150);
}
QLineEdit:focus, QTextEdit:focus {
border:1.5px solid goldenrod;
}
QGroupBox{ margin-top: 5px; }
QGroupBox::title { left: 10px; top: -5px; }
QListWidget, QTableWidget { padding: 0; }
QListWidget::item { margin:2px; }
QListWidget::item QLineEdit:focus { border:0; border-radius:0; margin:0; padding:0; }
QHeaderView::section {
padding: 3px;
border: 1px solid rgb(150,150,150);
}
QTextBrowser {
color: white;
/* background:lightyellow; */
background: rgb(50,50,50);
padding: 5px; border: 0;
}
IconLabel { border:0; }
/*
IconLabel:hover { background:none; }
*/
"""
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setFont(QFont("Monospace", 10))
self.dlgSettings = SettingsDlg(self)
self.dlgSettings.setModal(True)
self.dlgSettings.load()
self.main = MainArea(self)
self.setCentralWidget(self.main)
self.createToolBar()
self.createStatusBar()
self.setWindowTitle('Svn Tool')
self.setWindowIcon(QIcon('image/logo.png'))
self.setStyleSheet(STYLE_SHEET)
def createStatusBar(self):
self.lbLoadingText = QLabel()
self.lbLoadingGif = QLabel()
self.lbLoadingGif.hide()
movie = QMovie("image/loading.gif")
movie.start()
self.lbLoadingGif.setMovie(movie)
self.statusBar()
self.statusBar().addWidget(self.lbLoadingText)
self.statusBar().addWidget(self.lbLoadingGif)
def createToolBar(self):
self.myTb = self.addToolBar("Svn Tool")
self.myTb.addAction( QAction(
QIcon('image/computer.png'), "Open Settings Dialog", self,
#statusTip="Open Settings Dialog",
triggered=self.openSettingsTab) )
self.myTb.addAction( QAction(
QIcon('image/stop.png'), "Stop Current Running Task", self,
#statusTip="Stop Current Running Task",
triggered=self.stopCurrentTask) )
def stopCurrentTask(self):
TaskWorker().stop_task()
def openSettingsTab(self):
self.dlgSettings.show()
def center(self):
self.move(
QApplication.desktop().screen().rect().center() -
self.rect().center() )
def closeEvent(self, event):
#self.dlgSettings.saveConfig()
self.main.close()
event.accept()
def showLoading(self, msg, loading=True):
self.lbLoadingText.setText(msg)
#self.statusBar().showMessage(msg)
self.lbLoadingGif.setVisible(loading)
def notifyConfigChanged(self):
self.main.updateAppList()
if __name__ == "__main__":
app = QApplication(sys.argv)
win = MainWindow()
win.show()
win.center()
sys.exit(app.exec_())