Skip to content

Commit

Permalink
AutoSplitImage Class and simplified code
Browse files Browse the repository at this point in the history
Simplified and reduced image conversions
Reduced duplicated code, especially in settings
  • Loading branch information
Avasam committed Dec 6, 2021
1 parent f0fa0e2 commit 96938cd
Show file tree
Hide file tree
Showing 15 changed files with 539 additions and 894 deletions.
5 changes: 4 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ color=always
max-line-length=120
; Auto generated
exclude=src/gen/
ignores=Y015
; Linebreak before binary operator
; Allow default value other than "..."
; Allow imports at the bottom of file
ignore=W503,Y015,E402
per-file-ignores=
; Quotes
__init__.pyi:Q000
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ extension-pkg-allow-list = ["PyQt6", "win32ui"]
[tool.pylint.FORMAT]
max-line-length = 120

[tool.pylint.DESIGN]
max-attributes = 15

[tool.pylint.'MESSAGES CONTROL']
# Same as SonarLint
max-complexity = 15
# At least same as max-complexity
max-branches = 15
# https://pylint.pycqa.org/en/latest/user_guide/options.html#naming-styles
module-naming-style = "any"
Expand Down
25 changes: 17 additions & 8 deletions res/design.ui
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@
</property>
</widget>
<widget class="QPushButton" name="reset_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>500</x>
Expand All @@ -205,6 +208,9 @@
</property>
</widget>
<widget class="QPushButton" name="undo_split_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>494</x>
Expand All @@ -221,6 +227,9 @@
</property>
</widget>
<widget class="QPushButton" name="skip_split_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>560</x>
Expand Down Expand Up @@ -727,7 +736,7 @@
<string>FPS Limit:</string>
</property>
</widget>
<widget class="QDoubleSpinBox" name="fps_limit_spinbox">
<widget class="QSpinBox" name="fps_limit_spinbox">
<property name="geometry">
<rect>
<x>62</x>
Expand All @@ -739,20 +748,20 @@
<property name="prefix">
<string/>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="minimum">
<double>30.000000000000000</double>
<number>30</number>
</property>
<property name="maximum">
<double>5000.000000000000000</double>
<number>5000</number>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
<number>1</number>
</property>
<property name="value">
<double>60.000000000000000</double>
<number>60</number>
</property>
<property name="decimals" stdset="0">
<number>0</number>
</property>
</widget>
<widget class="QLabel" name="current_split_image_file_label">
Expand Down
10 changes: 5 additions & 5 deletions src/AutoControlledWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ def run(self):
self.autosplit.closeEvent()
break
if line == "start":
self.autosplit.start_suto_splitter()
self.autosplit.start_auto_splitter()
elif line in {"split", "skip"}:
self.autosplit.start_skip_split()
self.autosplit.skip_split_signal.emit()
elif line == "undo":
self.autosplit.start_undo_split()
self.autosplit.undo_split_signal.emit()
elif line == "reset":
self.autosplit.start_reset()
self.autosplit.reset_signal.emit()
elif line.startswith("settings"):
# Allow for any split character between "settings" and the path
self.autosplit.load_settings_file_path = line[9:]
settings.load_settings(self.autosplit, load_settings_from_livesplit=True)
# TODO: Not yet implemented in AutoSplit Integration
# elif line == 'pause':
# self.start_pause()
# self.pause_signal.emit()
Loading

0 comments on commit 96938cd

Please sign in to comment.