-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>MainWindow</class> | ||
<widget class="QWidget" name="MainWindow"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>800</width> | ||
<height>600</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>MainWindow</string> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout_2"> | ||
<item row="0" column="0"> | ||
<layout class="QGridLayout" name="gridLayout"> | ||
<property name="sizeConstraint"> | ||
<enum>QLayout::SetMaximumSize</enum> | ||
</property> | ||
<item row="4" column="0"> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QPushButton" name="pushButton_2"> | ||
<property name="text"> | ||
<string>PushButton</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pushButtonUpdate"> | ||
<property name="text"> | ||
<string>update</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pushButton_3"> | ||
<property name="text"> | ||
<string>PushButton</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item row="3" column="0"> | ||
<layout class="QGridLayout" name="gridLayout_3"> | ||
<item row="2" column="0"> | ||
<widget class="QLabel" name="LabelLocalProgress"> | ||
<property name="text"> | ||
<string>Local Progress</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QLabel" name="LabelGlobalProgress"> | ||
<property name="text"> | ||
<string>Global Progress</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="2"> | ||
<widget class="QProgressBar" name="progressBarGlobal"> | ||
<property name="value"> | ||
<number>0</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="2"> | ||
<widget class="QProgressBar" name="progressBarLocal"> | ||
<property name="value"> | ||
<number>0</number> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item row="0" column="0"> | ||
<widget class="QListWidget" name="listWidget"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> | ||
<horstretch>1</horstretch> | ||
<verstretch>1</verstretch> | ||
</sizepolicy> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Form</class> | ||
<widget class="QWidget" name="Form"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>200</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
<item> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>350</width> | ||
<height>16777215</height> | ||
</size> | ||
</property> | ||
<property name="text"> | ||
<string>TextLabel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>TextLabel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pushButton"> | ||
<property name="text"> | ||
<string>PushButton</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import sys | ||
import os | ||
|
||
|
||
# from PySide2.QtWidgets import QApplication, QWidget | ||
# from PySide2.QtCore import QFile | ||
# from PySide2.QtUiTools import QUiLoader | ||
|
||
from PyQt5 import uic | ||
from PyQt5.QtWidgets import QApplication, QWidget, QListWidget, QVBoxLayout, QLabel, QPushButton, QListWidgetItem, \ | ||
QHBoxLayout | ||
from regex import D | ||
from src.main_functions import * | ||
|
||
|
||
class MainWindow(QWidget): | ||
def __init__(self): | ||
super().__init__() | ||
self.load_ui() | ||
self.init() | ||
|
||
def load_ui(self): | ||
uic.loadUi("forms/form.ui", self) | ||
styleSheetStr = str(open("./css/style.scss","r").read()) | ||
self.setStyleSheet(styleSheetStr) | ||
|
||
def init(self): | ||
print('init'); | ||
self.populate_listview() | ||
self.pushButtonUpdate.clicked.connect(self.updateNovels) | ||
|
||
|
||
def populate_listview(self): | ||
novelList = findNovel('') | ||
|
||
for novel in novelList: | ||
novelInfo = getNovelInfoFromFolderName(novel) | ||
novel=Novel(novelInfo[1],novelInfo[0],False) | ||
|
||
# add item to the listview | ||
listItem = QListWidgetItem(self.listWidget) | ||
item_widget = ListItemFromUI(novel) | ||
listItem.setSizeHint(item_widget.sizeHint()) | ||
self.listWidget.addItem(listItem) | ||
self.listWidget.setItemWidget(listItem, item_widget) | ||
def novel_update_notice(self,nb_novel,nb_novel_to_update): | ||
self.progressBarGlobal.setValue( nb_novel/nb_novel_to_update *100) | ||
|
||
def chapter_update_notice(self,nb_chap,nb_chap_to_update): | ||
self.progressBarLocal.setValue( nb_chap/nb_chap_to_update *100) | ||
|
||
def updateNovels(self): | ||
print('updatesing') | ||
for novel in self.listWidget: | ||
pass | ||
|
||
|
||
class ListItemFromUI(QWidget): | ||
def __init__(self,novel:Novel): | ||
super().__init__() | ||
self.novel = Novel; | ||
self.text = novel.titre | ||
uic.loadUi("forms/listItem.ui", self) | ||
self.init() | ||
|
||
def init(self): | ||
self.label_2.setText(self.text) | ||
|
||
|
||
|
||
|
||
if __name__ == "__main__": | ||
app = QApplication([]) | ||
widget = MainWindow() | ||
widget.show() | ||
sys.exit(app.exec_()) | ||
|
||
# app = QtWidgets.QApplication(sys.argv) | ||
|
||
# window = uic.loadUi("form.ui") | ||
# window.show() | ||
# # app.exec() | ||
# sys.exit(app.exec_()) |