Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
- removed unused icons
- updated various icons
- added scaling to sidebar width
- rearranged settings page
- added default filename to combat export
- removed unneccesary table column width resizong
  • Loading branch information
Shinga13 committed May 23, 2024
1 parent 6361985 commit 933c0a8
Show file tree
Hide file tree
Showing 40 changed files with 238 additions and 202 deletions.
299 changes: 156 additions & 143 deletions OSCRUI/app.py

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions OSCRUI/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ def save_combat(self, combat_num: int):
Parameters:
- :param combat_num: number of combat in self.combats
"""
if not self.parser1.active_combat:
combat = self.parser1.active_combat
if not combat:
return
base_dir = os.path.dirname(self.entry.text())
filename = combat.map
if combat.difficulty is not None and combat.difficulty != '':
filename += ' ' + combat.difficulty
filename += f' {combat.start_time.strftime('%Y-%m-%d %H.%M')}.log'
base_dir = f'{os.path.dirname(self.entry.text())}/{filename}'
if not base_dir:
base_dir = self.app_dir
path = self.browse_path(base_dir, 'Logfile (*.log);;Any File (*.*)', save=True)
Expand Down
3 changes: 0 additions & 3 deletions OSCRUI/displayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ def create_overview(self):
table_layout.addWidget(table)
self.widgets.overview_table_frame.setLayout(table_layout)
table.resizeColumnsToContents()
horizontal_header = table.horizontalHeader()
for col in range(len(TABLE_HEADER)):
horizontal_header.resizeSection(col, horizontal_header.sectionSize(col) + 5)


@setup_plot
Expand Down
2 changes: 1 addition & 1 deletion OSCRUI/iofunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def browse_path(self, default_path: str = None, types: str = 'Any File (*.*)', s
if default_path is None or default_path == '':
default_path = self.app_dir
default_path = os.path.abspath(default_path)
if not os.path.exists(default_path):
if not os.path.exists(os.path.dirname(default_path)):
default_path = self.app_dir
if save:
f = QFileDialog.getSaveFileName(self.window, 'Save Log', default_path, types)[0]
Expand Down
12 changes: 6 additions & 6 deletions OSCRUI/leagueconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ def slot_ladder(self, selected_map):
table = self.widgets.ladder_table
table.setModel(sorting_proxy)
table.resizeColumnsToContents()
table_header = table.horizontalHeader()
for col in range(len(model._header)):
table_header.resizeSection(col, table_header.sectionSize(col) + 5)
# table_header = table.horizontalHeader()
# for col in range(len(model._header)):
# table_header.resizeSection(col, table_header.sectionSize(col) + 5)


def extend_ladder(self):
Expand All @@ -136,8 +136,7 @@ def extend_ladder(self):
return

ladder_data = self.league_api.ladder_entries(
self.league_api.current_ladder_id, self.league_api.pages_loaded + 1
)
self.league_api.current_ladder_id, self.league_api.pages_loaded + 1)
if ladder_data is not None:
if len(ladder_data.results) < 50:
self.league_api.entire_ladder_loaded = True
Expand All @@ -163,7 +162,8 @@ def extend_ladder(self):
row.get("build", "Unknown"),
)
)
self.widgets.ladder_table.model().sourceModel().extend_data(table_index, table_data, logfile_ids)
self.widgets.ladder_table.model().sourceModel().extend_data(
table_index, table_data, logfile_ids)


def download_and_view_combat(self):
Expand Down
4 changes: 3 additions & 1 deletion OSCRUI/widgetbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@

RFIXED = QHeaderView.ResizeMode.Fixed


SMPIXEL = QAbstractItemView.ScrollMode.ScrollPerPixel

SCROLLOFF = Qt.ScrollBarPolicy.ScrollBarAlwaysOff
SCROLLON = Qt.ScrollBarPolicy.ScrollBarAlwaysOn


def create_button(self, text, style: str = 'button', parent=None, style_override={}, toggle=None):
"""
Expand Down
1 change: 0 additions & 1 deletion assets/arrow-down.svg

This file was deleted.

1 change: 0 additions & 1 deletion assets/arrow-right.svg

This file was deleted.

1 change: 1 addition & 0 deletions assets/chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/chevron-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/collapse-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/collapse-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/database.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/expand-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/expand-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/export-parse.svg

This file was deleted.

1 change: 1 addition & 0 deletions assets/export.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/fat-arrow-down.svg

This file was deleted.

1 change: 0 additions & 1 deletion assets/gear.svg

This file was deleted.

Binary file removed assets/loading.png
Binary file not shown.
7 changes: 0 additions & 7 deletions assets/log-cut-tight.svg

This file was deleted.

7 changes: 0 additions & 7 deletions assets/log-cut-wide.svg

This file was deleted.

5 changes: 0 additions & 5 deletions assets/log-down.svg

This file was deleted.

5 changes: 0 additions & 5 deletions assets/log-up.svg

This file was deleted.

Binary file removed assets/oscrbanner-slim-dark.png
Binary file not shown.
Binary file removed assets/oscrbanner-slim.png
Binary file not shown.
1 change: 1 addition & 0 deletions assets/page-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/page-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions assets/parser-left-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/parser-left.svg

This file was deleted.

22 changes: 22 additions & 0 deletions assets/parser-right-3.svg
1 change: 0 additions & 1 deletion assets/parser-right.svg
Diff not rendered.
1 change: 0 additions & 1 deletion assets/refresh-cw.svg
Diff not rendered.
1 change: 0 additions & 1 deletion assets/save-cw.svg
Diff not rendered.
2 changes: 1 addition & 1 deletion assets/save.svg
2 changes: 1 addition & 1 deletion assets/star.svg
1 change: 1 addition & 0 deletions assets/thick-chevron-down.svg
1 change: 0 additions & 1 deletion assets/truncate-cw.svg
Diff not rendered.
12 changes: 6 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Launcher():

version = '2024.05b230'
version = '2024.05b231'
__version__ = '0.1'

# holds the style of the app
Expand Down Expand Up @@ -484,11 +484,11 @@ class Launcher():
},
# down-pointing arrow
'::branch:open:has-children': {
'image': 'url(assets/arrow-down.svg)'
'image': 'url(assets/chevron-down.svg)'
},
# right-pointing arrow
'::branch:closed:has-children': {
'image': 'url(assets/arrow-right.svg)'
'image': 'url(assets/chevron-right.svg)'
}
},
# header of the analysis table; ::section refers to the individual buttons
Expand Down Expand Up @@ -521,7 +521,7 @@ class Launcher():
'color': '@fg',
'font': '@subhead',
'::down-arrow': {
'image': 'url(assets/fat-arrow-down.svg)',
'image': 'url(assets/thick-chevron-down.svg)',
'width': '@margin',
},
'::drop-down': {
Expand Down Expand Up @@ -697,8 +697,8 @@ def base_path() -> str:
@staticmethod
def app_config() -> dict:
config = {
'minimum_window_width': 1280,
'minimum_window_height': 1016,
'minimum_window_width': 1370,
'minimum_window_height': 907,
'settings_path': r'/.OSCR_settings.ini',
'templog_folder_path': r'/~temp_log_files',
'link_website': '',
Expand Down

0 comments on commit 933c0a8

Please sign in to comment.