-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.py
269 lines (266 loc) · 17.7 KB
/
mainwindow.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
from PySide2 import QtCore, QtGui, QtWidgets
class UIMainWindow(object):
def setupUi(self, main_window):
main_window.setObjectName("MainWindow")
main_window.resize(1310, 600)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(main_window.sizePolicy().hasHeightForWidth())
main_window.setSizePolicy(sizePolicy)
main_window.setMinimumSize(QtCore.QSize(1310, 600))
main_window.setMaximumSize(QtCore.QSize(1310, 600))
self.centralwidget = QtWidgets.QWidget(main_window)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
self.centralwidget.setSizePolicy(sizePolicy)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 9, 1291, 541))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.main_layout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.main_layout.setContentsMargins(0, 0, 0, 0)
self.main_layout.setObjectName("main_layout")
self.profile_frame = QtWidgets.QFrame(self.horizontalLayoutWidget)
self.profile_frame.setMaximumSize(QtCore.QSize(280, 16777215))
self.profile_frame.setFrameShape(QtWidgets.QFrame.Box)
self.profile_frame.setFrameShadow(QtWidgets.QFrame.Plain)
self.profile_frame.setObjectName("profile_frame")
self.verticalLayoutWidget = QtWidgets.QWidget(self.profile_frame)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 261, 521))
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
self.profile_layout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
self.profile_layout.setContentsMargins(0, 0, 0, 0)
self.profile_layout.setObjectName("profile_layout")
self.profile_label = QtWidgets.QLabel(self.verticalLayoutWidget)
self.profile_label.setObjectName("profile_label")
self.profile_layout.addWidget(self.profile_label)
self.profile_list = QtWidgets.QListWidget(self.verticalLayoutWidget)
self.profile_list.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
self.profile_list.setObjectName("profile_list")
self.profile_layout.addWidget(self.profile_list)
self.remove_profile_button = QtWidgets.QPushButton(self.horizontalLayoutWidget, text="Remove...")
self.remove_profile_button.setObjectName("remove_profile_button")
self.migrate_profile_button = QtWidgets.QPushButton(self.horizontalLayoutWidget, text="Migrate Subs")
self.migrate_profile_button.setObjectName("migrate_profile_button")
# self.purge_profile_button = QtWidgets.QPushButton(self.horizontalLayoutWidget, text="Purge...")
# self.purge_profile_button.setObjectName("purge_profile_button")
self.profile_button_layout = QtWidgets.QHBoxLayout()
self.profile_button_layout.addWidget(self.remove_profile_button)
self.profile_button_layout.addWidget(self.migrate_profile_button)
# self.profile_button_layout.addWidget(self.purge_profile_button)
self.profile_layout.addLayout(self.profile_button_layout)
self.main_layout.addWidget(self.profile_frame)
self.submission_frame = QtWidgets.QFrame(self.horizontalLayoutWidget)
self.submission_frame.setMinimumSize(QtCore.QSize(700, 0))
self.submission_frame.setFrameShape(QtWidgets.QFrame.Box)
self.submission_frame.setFrameShadow(QtWidgets.QFrame.Plain)
self.submission_frame.setObjectName("submission_frame")
self.verticalLayoutWidget_2 = QtWidgets.QWidget(self.submission_frame)
self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(10, 10, 681, 521))
self.verticalLayoutWidget_2.setObjectName("verticalLayoutWidget_2")
self.submission_layout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2)
self.submission_layout.setContentsMargins(0, 0, 0, 0)
self.submission_layout.setObjectName("submission_layout")
self.submission_label = QtWidgets.QLabel(self.verticalLayoutWidget_2)
self.submission_label.setObjectName("submission_label")
self.submission_layout.addWidget(self.submission_label)
self.submission_search_bar = QtWidgets.QLineEdit(self.verticalLayoutWidget_2)
self.submission_search_bar.setObjectName("submission_search_bar")
self.submission_layout.addWidget(self.submission_search_bar)
self.content_tree = QtWidgets.QTreeWidget()
self.content_tree.setColumnCount(2)
self.content_tree.setHeaderLabels(["ID", "Created On"])
self.content_tree.setColumnWidth(0,505)
self.content_tree.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
self.submission_layout.addWidget(self.content_tree)
self.submission_progress_bar = QtWidgets.QProgressBar()
self.submission_progress_bar.setValue(0)
self.submission_layout.addWidget(self.submission_progress_bar)
self.submission_progress_status = QtWidgets.QLabel("Start program...")
self.submission_layout.addWidget(self.submission_progress_status)
self.submission_button_layout = QtWidgets.QHBoxLayout()
self.submission_button_layout.setObjectName("submission_button_layout")
self.submission_search_button = QtWidgets.QPushButton(self.verticalLayoutWidget_2)
self.submission_search_button.setObjectName("submission_search_button")
self.submission_button_layout.addWidget(self.submission_search_button)
self.submission_dump_button = QtWidgets.QPushButton(self.verticalLayoutWidget_2)
self.submission_dump_button.setObjectName("submission_dump_button")
self.submission_button_layout.addWidget(self.submission_dump_button)
self.submission_delete_button = QtWidgets.QPushButton(self.verticalLayoutWidget_2)
self.submission_delete_button.setObjectName("submission_delete_button")
self.submission_button_layout.addWidget(self.submission_delete_button)
self.submission_clear_btn = QtWidgets.QPushButton(self.verticalLayoutWidget_2)
self.submission_clear_btn.setObjectName("submission_clear_btn")
self.submission_button_layout.addWidget(self.submission_clear_btn)
self.submission_layout.addLayout(self.submission_button_layout)
self.main_layout.addWidget(self.submission_frame)
self.filter_frame = QtWidgets.QFrame(self.horizontalLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.filter_frame.sizePolicy().hasHeightForWidth())
self.filter_frame.setSizePolicy(sizePolicy)
self.filter_frame.setFrameShape(QtWidgets.QFrame.Box)
self.filter_frame.setFrameShadow(QtWidgets.QFrame.Plain)
self.filter_frame.setObjectName("filter_frame")
self.formLayoutWidget = QtWidgets.QWidget(self.filter_frame)
self.formLayoutWidget.setGeometry(QtCore.QRect(10, 10, 275, 521))
self.formLayoutWidget.setObjectName("formLayoutWidget")
self.filter_layout = QtWidgets.QFormLayout(self.formLayoutWidget)
self.filter_layout.setObjectName("filter_layout")
self.filter_label = QtWidgets.QLabel(self.formLayoutWidget)
self.filter_label.setObjectName("filter_label")
self.filter_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.filter_label)
self.comment_radio = QtWidgets.QRadioButton(self.formLayoutWidget)
self.comment_radio.setChecked(True)
self.comment_radio.setObjectName("comment_radio")
self.filter_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.comment_radio)
self.post_radio = QtWidgets.QRadioButton(self.formLayoutWidget)
self.post_radio.setObjectName("post_radio")
self.filter_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.post_radio)
self.sort_label = QtWidgets.QLabel(self.formLayoutWidget)
self.sort_label.setObjectName("sort_label")
self.filter_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.sort_label)
self.sort_combo = QtWidgets.QComboBox(self.formLayoutWidget)
self.sort_combo.setMinimumSize(QtCore.QSize(0, 0))
self.sort_combo.setObjectName("sort_combo")
self.sort_combo.addItem("")
self.sort_combo.addItem("")
self.filter_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.sort_combo)
self.time_combo = QtWidgets.QComboBox(self.formLayoutWidget)
self.time_combo.setObjectName("time_combo")
self.time_combo.addItem("")
self.time_combo.addItem("")
self.filter_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.time_combo)
self.time_edit = QtWidgets.QDateTimeEdit(self.formLayoutWidget)
self.time_edit.setObjectName("time_edit")
self.filter_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.time_edit)
self.max_score_label = QtWidgets.QLabel(self.formLayoutWidget)
self.max_score_label.setObjectName("score_label")
self.filter_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.max_score_label)
self.max_score_spin = QtWidgets.QSpinBox(self.formLayoutWidget)
self.max_score_spin.setMaximum(9999999)
self.max_score_spin.setMinimum(-9999999)
self.max_score_spin.setObjectName("max_score_spin")
self.max_score_spin.setValue(9999999)
self.filter_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.max_score_spin)
self.min_score_label = QtWidgets.QLabel(self.formLayoutWidget)
self.min_score_label.setObjectName("min_score_label")
self.filter_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.min_score_label)
self.min_score_spin = QtWidgets.QSpinBox(self.formLayoutWidget)
self.min_score_spin.setMaximum(9999999)
self.min_score_spin.setMinimum(-9999999)
self.min_score_spin.setValue(-9999999)
self.min_score_spin.setObjectName("min_score_spin")
self.filter_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.min_score_spin)
self.award_label = QtWidgets.QLabel(self.formLayoutWidget)
self.award_label.setObjectName("award_label")
self.filter_layout.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.award_label)
self.award_combo = QtWidgets.QComboBox(self.formLayoutWidget)
self.award_combo.setObjectName("award_combo")
self.award_combo.addItem("")
self.award_combo.addItem("")
self.award_combo.addItem("")
self.filter_layout.setWidget(8, QtWidgets.QFormLayout.FieldRole, self.award_combo)
self.edited_label = QtWidgets.QLabel(self.formLayoutWidget)
self.edited_label.setObjectName("edited_label")
self.filter_layout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.edited_label)
self.edited_combo = QtWidgets.QComboBox(self.formLayoutWidget)
self.edited_combo.setObjectName("edited_combo")
self.edited_combo.addItem("")
self.edited_combo.addItem("")
self.edited_combo.addItem("")
self.filter_layout.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.edited_combo)
self.subreddit_label = QtWidgets.QLabel(self.formLayoutWidget)
self.subreddit_label.setObjectName("subreddit_label")
self.filter_layout.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.subreddit_label)
self.subreddit_edit = QtWidgets.QLineEdit(self.formLayoutWidget)
self.subreddit_edit.setObjectName("subreddit_edit")
self.filter_layout.setWidget(10, QtWidgets.QFormLayout.FieldRole, self.subreddit_edit)
self.removed_combo = QtWidgets.QComboBox()
self.removed_combo.addItems(["NA", "Yes", "No"])
self.filter_layout.addRow(QtWidgets.QLabel("Removed"), self.removed_combo)
self.main_layout.addWidget(self.filter_frame)
main_window.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(main_window)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1310, 22))
self.menubar.setObjectName("menubar")
self.profile_menu = QtWidgets.QMenu(self.menubar)
self.profile_menu.setObjectName("profile_menu")
self.autodelete_menu = QtWidgets.QMenu(self.menubar)
self.autodelete_menu.setObjectName("menuAutodelete")
main_window.setMenuBar(self.menubar)
self.create_profile_action = QtWidgets.QAction(main_window)
self.create_profile_action.setObjectName("create_profile_action")
self.import_profile_action = QtWidgets.QAction(main_window)
self.import_profile_action.setObjectName("import_profile_action")
self.export_profile_action = QtWidgets.QAction(main_window)
self.export_profile_action.setObjectName("export_profile_action")
self.actionRemove = QtWidgets.QAction(main_window)
self.actionRemove.setObjectName("actionRemove")
self.actionCreate_2 = QtWidgets.QAction(main_window)
self.actionCreate_2.setObjectName("actionCreate_2")
self.modify_autodelete_action = QtWidgets.QAction(main_window)
self.modify_autodelete_action.setObjectName("modify_autodelete_action")
self.remove_autodelete_action = QtWidgets.QAction(main_window)
self.remove_autodelete_action.setObjectName("remove_autodelete_action")
self.create_autodelete_action = QtWidgets.QAction(main_window)
self.create_autodelete_action.setObjectName("create_autodelete_action")
self.modify_profile_action = QtWidgets.QAction(main_window)
self.modify_profile_action.setObjectName("modify_profile_action")
self.profile_menu.addAction(self.create_profile_action)
self.profile_menu.addAction(self.modify_profile_action)
self.profile_menu.addAction(self.import_profile_action)
self.profile_menu.addAction(self.export_profile_action)
self.autodelete_menu.addSeparator()
self.autodelete_menu.addAction(self.create_autodelete_action)
self.autodelete_menu.addAction(self.modify_autodelete_action)
self.autodelete_menu.addAction(self.remove_autodelete_action)
self.menubar.addAction(self.profile_menu.menuAction())
# self.menubar.addAction(self.autodelete_menu.menuAction())
self.retranslateUi(main_window)
QtCore.QMetaObject.connectSlotsByName(main_window)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Reddit Content Manager"))
self.profile_label.setText(_translate("MainWindow", "Profile"))
self.remove_profile_button.setText(_translate("MainWindow", "Remove..."))
self.submission_label.setText(_translate("MainWindow", "Content"))
self.submission_search_bar.setPlaceholderText(_translate("MainWindow", "Search For Text Within Content"))
self.submission_search_button.setText(_translate("MainWindow", "Search"))
self.submission_dump_button.setText(_translate("MainWindow", "Dump..."))
self.submission_delete_button.setText(_translate("MainWindow", "Delete"))
self.submission_clear_btn.setText(_translate("MainWindow", "Clear"))
self.filter_label.setText(_translate("MainWindow", "Filters"))
self.comment_radio.setText(_translate("MainWindow", "Comments"))
self.post_radio.setText(_translate("MainWindow", "Posts"))
self.sort_label.setText(_translate("MainWindow", "Sort:"))
self.sort_combo.setItemText(0, _translate("MainWindow", "New"))
self.sort_combo.setItemText(1, _translate("MainWindow", "Top"))
self.time_combo.setItemText(0, _translate("MainWindow", "After"))
self.time_combo.setItemText(1, _translate("MainWindow", "Before"))
self.max_score_label.setText(_translate("MainWindow", "Max Score:"))
self.min_score_label.setText(_translate("MainWindow", "Min Score:"))
self.award_label.setText(_translate("MainWindow", "Awarded:"))
self.award_combo.setItemText(0, _translate("MainWindow", "NA"))
self.award_combo.setItemText(1, _translate("MainWindow", "Yes"))
self.award_combo.setItemText(2, _translate("MainWindow", "No"))
self.edited_label.setText(_translate("MainWindow", "Edited:"))
self.edited_combo.setItemText(0, _translate("MainWindow", "NA"))
self.edited_combo.setItemText(1, _translate("MainWindow", "Yes"))
self.edited_combo.setItemText(2, _translate("MainWindow", "No"))
self.subreddit_label.setText(_translate("MainWindow", "Subreddit"))
self.profile_menu.setTitle(_translate("MainWindow", "Profile"))
self.autodelete_menu.setTitle(_translate("MainWindow", "Autodelete"))
self.create_profile_action.setText(_translate("MainWindow", "Create..."))
self.import_profile_action.setText(_translate("MainWindow", "Import..."))
self.export_profile_action.setText(_translate("MainWindow", "Export..."))
self.actionRemove.setText(_translate("MainWindow", "Remove"))
self.actionCreate_2.setText(_translate("MainWindow", "Create..."))
self.modify_autodelete_action.setText(_translate("MainWindow", "Modify..."))
self.remove_autodelete_action.setText(_translate("MainWindow", "Remove"))
self.create_autodelete_action.setText(_translate("MainWindow", "Create..."))
self.modify_profile_action.setText(_translate("MainWindow", "Modify..."))