This repository has been archived by the owner on Jul 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.py
76 lines (59 loc) · 2.03 KB
/
interface.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
#! /usr/bin/env python3
from PyQt5 import QtGui
from _interface import Ui_AdwinWindow
import common
DISABLED = 0
UPDATE = 1
ENABLED = 2
class AdwinInterface(Ui_AdwinWindow):
def __init__(self, window):
self.window = window
self.setupUi(window)
self.set_status(DISABLED)
def set_status(self, status=DISABLED):
if status == DISABLED:
self.button_status.setText("DISABLED")
status_icon = QtGui.QIcon("icons/disabled.svg")
if status == UPDATE:
self.button_status.setText("UPDATE")
status_icon = QtGui.QIcon("icons/update.svg")
if status == ENABLED:
self.button_status.setText("ENABLED")
status_icon = QtGui.QIcon("icons/enabled.svg")
self.button_status.setIcon(status_icon)
@property
def sources(self):
return common.str_to_list(self.edit_sources.toPlainText())
@sources.setter
def sources(self, in_list):
self.edit_sources.setPlainText(common.list_to_str(in_list))
@sources.deleter
def sources(self):
self.edit_sources.clear()
@property
def whitelist(self):
return common.str_to_list(self.edit_whitelist.toPlainText())
@whitelist.setter
def whitelist(self, in_list):
self.edit_whitelist.setPlainText(common.list_to_str(in_list))
@whitelist.deleter
def whitelist(self):
self.edit_whitelist.clear()
@property
def blacklist(self):
return common.str_to_list(self.edit_blacklist.toPlainText())
@blacklist.setter
def blacklist(self, in_list):
self.edit_blacklist.setPlainText(common.list_to_str(in_list))
@blacklist.deleter
def blacklist(self):
self.edit_blacklist.clear()
@property
def redirects(self):
return common.str_to_list(self.edit_redirects.toPlainText())
@redirects.setter
def redirects(self, in_list):
self.edit_redirects.setPlainText(common.list_to_str(in_list))
@redirects.deleter
def redirects(self):
self.edit_redirects.clear()