forked from Frutto-Hub/akniga.org_book_downloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathakniga_gui.py
31 lines (24 loc) · 910 Bytes
/
akniga_gui.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
import sys
from process_gui import ProcessWindow
from PyQt5.QtWidgets import *
from PyQt5 import uic, QtGui
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
uic.loadUi('ui/main.ui', self)
self.processes = []
def onButtonOpenPathClick(self):
path = QFileDialog.getExistingDirectory(self, caption='Выбрать каталог')
self.linePath.setText(path)
def onButtonDownloadClick(self):
sub_window = ProcessWindow(self.lineURL.text(), self.linePath.text())
self.mdiArea.addSubWindow(sub_window)
sub_window.show()
def onButtonPaste(self):
if 'akniga.org' in app.clipboard().text():
self.lineURL.setText(app.clipboard().text())
if __name__ == "__main__":
app = QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
sys.exit(app.exec_())