Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update master - v15.7.0 #131

Merged
merged 25 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
63a81dd
added missing languages to release workflow
Arne-Weber Jun 7, 2024
33be1da
Update Polski.json
Patriot99 Jun 9, 2024
cb03010
Translate Dansk.json via GitLocalize
overkongen Jun 10, 2024
175d346
Translate Português.json via GitLocalize
sabala Jun 10, 2024
2606eb7
Translate Indonesian.json via GitLocalize
zizimonzter Jun 10, 2024
1bd4d89
update patch_notes & README for translations
Arne-Weber Jun 10, 2024
d7e3b9f
removeca call for polish translation from release
Arne-Weber Jun 10, 2024
e735002
Added issue templates
Windows200000 Jun 10, 2024
e955743
Translate Dansk.json via GitLocalize
overkongen Jun 10, 2024
5cc3892
removed call for Danish translation in release
Arne-Weber Jun 10, 2024
7aa8413
Merge branch 'in-dev' of https://github.com/Windows200000/TwitchDrops…
Arne-Weber Jun 10, 2024
7709943
Handle ["broadcaster": null] response from Twitch
Arne-Weber Jun 12, 2024
58b9035
patch notes - "broadcaster": null fix
Arne-Weber Jun 12, 2024
c807756
Added saving window position and always visible tray
Arne-Weber Jun 13, 2024
6dc4f7d
patch notes: window position and visible tray
Arne-Weber Jun 13, 2024
b2f0816
translations patch notes and readme
Arne-Weber Jun 13, 2024
13704ef
removed call to translate FR & NL from release workflow
Arne-Weber Jun 13, 2024
93228fb
Translate Nederlandse.json via GitLocalize
T-Raptor Jun 13, 2024
3c40eb8
Translate Français.json via GitLocalize
HiroLeWeeb Jun 13, 2024
563c6e3
Merge branch 'in-dev' of https://github.com/Windows200000/TwitchDrops…
Arne-Weber Jun 13, 2024
7a2950d
removed wrong newline in patch notes
Arne-Weber Jun 13, 2024
8f014e5
updated release workflow to show version at start of name
Arne-Weber Jun 13, 2024
282c285
Improved issue templates
Arne-Weber Jun 14, 2024
2d7f309
Reworked GitHub issues and moved to .yaml
Arne-Weber Jun 14, 2024
8ef04a8
Translate Français.json via GitLocalize
HiroLeWeeb Jun 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Bug report
description: Create a bug report.
labels: ["Bug"]
body:


- type: markdown
attributes:
value: |
## Before submitting an issue, look at the [project goals](https://github.com/Windows200000/TwitchDropsMiner-updated#project-goals)!

### Bad Title:
- Need help
- Cookie Jar
- Received error (working fine prior to reboot)
- I am getting an error when trying to run

### Good Title:
- Not finding any Campaigns
- Random crash with GQL error "PersistedQueryNotFound"
- TypeError: 'NoneType' object is not subscriptable
- Drops not being claimed in the intended way, causing some to be missed and no notifications

- type: textarea
attributes:
label: Description
description: A clear and concise description of what the bug is.
placeholder: TDM crashes when I open the `Inventory` tab.
validations:
required: true

- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior. Being able to reliably cause a bug can often result in a quick fix.
placeholder: |
1. Add Rust Twitch Drops
2. Reload
3. Go to Inventory tab
validations:
required: true

- type: textarea
attributes:
label: Expected behavior
description: What should have happened?
placeholder: The `Inventory` tab shows.
validations:
required: true

- type: textarea
attributes:
label: Observed behavior
description: What actually happened?
placeholder: TDM stopped responding.
validations:
required: true

- type: textarea
attributes:
label: Screenshots
description: Add any relevant screenshots.
validations:
required: false

- type: textarea
attributes:
label: Logs
description: |
If you have them, provide any logs. They can help, even if no error is shown.
Ideally run with `-vvv --debug-gql --debug-ws --log`.
placeholder: |
```
11:35:35: No available channels to watch. Waiting for an ONLINE channel...
12:35:39: No available channels to watch. Waiting for an ONLINE channel...
13:35:44: No available channels to watch. Waiting for an ONLINE channel...
14:35:48: No available channels to watch. Waiting for an ONLINE channel...
15:33:21: ibai goes ONLINE, switching...
15:33:21: Watching: ibai
```
validations:
required: false

- type: input
attributes:
label: OS
description: What Operating System are you using?
placeholder: Windows 11 | Linux Mint
validations:
required: true

- type: input
attributes:
label: Build
description: How are you running TDM?
placeholder: from source | .exe | AppImage
validations:
required: true

- type: input
attributes:
label: Version/Commit
description: What version are you using? If you are NOT using an official release, enter the commit.
placeholder: v1.5.0 | 54ef767
validations:
required: true

- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem.
placeholder: You got to the end, thanks for reporting! ;)
validations:
required: false
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Feature request
description: Suggest an idea for TDM.
labels: ["Enhancement"]
body:


- type: markdown
attributes:
value: |
## Before submitting an issue, look at the [project goals](https://github.com/Windows200000/TwitchDropsMiner-updated#project-goals)!
If your issue is specific to one Operating System, consider whether it should be a bug report instead.
Create only **one issue per feature**. This ensures no feature is forgotten.

### Bad Title:
- 32-bit | What do you actually want?
- Status Icon in the tray | What should it do?
- Received error (working fine prior to reboot)
- I am getting an error when trying to run

### Good Title:
- Create a build for 32-bit Windows
- Exclude impossible campaigns
- TypeError: 'NoneType' object is not subscriptable
- Drops not being claimed in the intended way, causing some to be missed and no notifications

- type: textarea
attributes:
label: Problem
description: Is your feature request related to a problem? If so, provide a clear and concise description of what the problem is.
placeholder: When I have many Windows open, it can take a while to find TDM.
validations:
required: false

- type: textarea
attributes:
label: Suggestion(s)
description: What do you want to happen/change.
placeholder: Don't hide tray icon when TDM window is open.
validations:
required: true

- type: textarea
attributes:
label: Additional notes
description: Add any other context, ideas or screenshots about the feature request here.
placeholder: There should be an option to allways hide/show it.
validations:
required: false
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ jobs:
artifactErrorsFailBuild: true
artifacts: artifacts/*/*
body: |
# ⚠️ Please help with translation as tracked in #2 and channel points as tracked in #23 !
# ⚠️ Please help with translation as tracked in #2 (العربية, Português, Indonesian) and channel points as tracked in #23 !

***
**This is an automatically generated updated version of the application, that includes the latest master branch changes.**
Expand All @@ -251,7 +251,7 @@ jobs:
## Patch notes:
${{ steps.patch_notes.outputs.content }}

name: Updated tested build - ${{ steps.version.outputs.v-version }} (${{ steps.vars.outputs.sha_short }})
name: ${{ steps.version.outputs.v-version }} \- Updated tested build (${{ steps.vars.outputs.sha_short }})
prerelease: false
removeArtifacts: true
tag: ${{ steps.version.outputs.v-version }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ if they aren't already there. Doing so ensures proper markdown rendering on Gith
@Bamboozul - For the entirety of the Arabic (العربية) translation.
@Kjerne - For the entirety of the Danish (Dansk) translation.

For updating Translations: @Kuddus73, @VSeryi, @Windows200000, @BreakshadowCN, @kilroy98, @zelda0079, @Calvineries, @notNSANE, @ElvisDesigns, @DogancanYr, @Nollasko, @rvpv, @flxderdev, @5wi5wi, @fgr1178707QQ, @Suz1e, @Patriot99
For updating Translations: @Kuddus73, @VSeryi, @Windows200000, @BreakshadowCN, @kilroy98, @zelda0079, @Calvineries, @notNSANE, @ElvisDesigns, @DogancanYr, @Nollasko, @rvpv, @flxderdev, @5wi5wi, @fgr1178707QQ, @Suz1e, @Patriot99, @overkongen, @zizimonzter, @sabala, @hiroweeb, @T-Raptor
49 changes: 38 additions & 11 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,9 @@ def __init__(self, manager: GUIManager, master: ttk.Widget):
self.icon_image = Image_module.open(resource_path("pickaxe.ico"))
self._button = ttk.Button(master, command=self.minimize, text=_("gui", "tray", "minimize"))
self._button.grid(column=0, row=0, sticky="ne")
self.always_show_icon = True # Ensure there is a way to restore the window position, in case it's shown off-screen (e.g. Second monitor)
if self.always_show_icon:
self._start()

def __del__(self) -> None:
self.stop()
Expand Down Expand Up @@ -1080,7 +1083,8 @@ def get_title(self, drop: TimedDrop | None) -> str:

def _start(self):
loop = asyncio.get_running_loop()
drop = self._manager.progress._drop
if not self.always_show_icon:
drop = self._manager.progress._drop

# we need this because tray icon lives in a separate thread
def bridge(func):
Expand All @@ -1090,11 +1094,23 @@ def bridge(func):
pystray.MenuItem(_("gui", "tray", "show"), bridge(self.restore), default=True),
pystray.Menu.SEPARATOR,
pystray.MenuItem(_("gui", "tray", "quit"), bridge(self.quit)),
pystray.MenuItem(f'{_("gui", "tray", "show")} ({_("gui", "inventory", "filter", "refresh")})', bridge(self.restore_position)),
)
self.icon = pystray.Icon("twitch_miner", self.icon_image, self.get_title(drop), menu)
if self.always_show_icon:
self.icon = pystray.Icon("twitch_miner", self.icon_image, self.get_title(None), menu)
else:
self.icon = pystray.Icon("twitch_miner", self.icon_image, self.get_title(drop), menu)
# self.icon.run_detached()
loop.run_in_executor(None, self.icon.run)

def restore_position(self):
if not self.always_show_icon:
if self.icon is not None:
# self.stop()
self.icon.visible = False
self._manager._root.geometry("0x0+0+0")
self._manager._root.deiconify()

def stop(self):
if self.icon is not None:
self.icon.stop()
Expand All @@ -1104,16 +1120,18 @@ def quit(self):
self._manager.close()

def minimize(self):
if self.icon is None:
self._start()
else:
self.icon.visible = True
if not self.always_show_icon:
if self.icon is None:
self._start()
else:
self.icon.visible = True
self._manager._root.withdraw()

def restore(self):
if self.icon is not None:
# self.stop()
self.icon.visible = False
if not self.always_show_icon:
if self.icon is not None:
# self.stop()
self.icon.visible = False
self._manager._root.deiconify()

def notify(
Expand Down Expand Up @@ -1483,6 +1501,7 @@ class _SettingsVars(TypedDict):
priority_only: IntVar
prioritize_by_ending_soonest: IntVar
tray_notifications: IntVar
window_position: StringVar


class SettingsPanel:
Expand All @@ -1502,6 +1521,7 @@ def __init__(self, manager: GUIManager, master: ttk.Widget, root: tk.Tk):
"priority_only": IntVar(master, self._settings.priority_only),
"prioritize_by_ending_soonest": IntVar(master, self._settings.prioritize_by_ending_soonest),
"tray_notifications": IntVar(master, self._settings.tray_notifications),
"window_position": IntVar(master, self._settings.window_position),
}
master.rowconfigure(0, weight=1)
master.columnconfigure(0, weight=1)
Expand Down Expand Up @@ -1928,6 +1948,11 @@ def __init__(self, twitch: Twitch):
set_root_icon(root, resource_path("pickaxe.ico"))
root.title(WINDOW_TITLE) # window title
root.bind_all("<KeyPress-Escape>", self.unfocus) # pressing ESC unfocuses selection
# restore last window position
if self._twitch.settings.window_position:
root.geometry(self._twitch.settings.window_position)
else:
self._twitch.settings.window_position = self._root.geometry()
# Image cache for displaying images
self._cache = ImageCache(self)

Expand Down Expand Up @@ -2051,7 +2076,7 @@ def __init__(self, twitch: Twitch):
if self._twitch.settings.dark_theme:
set_theme(root, self, "dark")
else:
set_theme(root, self, "default") #
set_theme(root, self, "default")

# https://stackoverflow.com/questions/56329342/tkinter-treeview-background-tag-not-working
def _fixed_map(self, option):
Expand Down Expand Up @@ -2164,6 +2189,7 @@ def unfocus(self, event):

# these are here to interface with underlaying GUI components
def save(self, *, force: bool = False) -> None:
self._twitch.settings.window_position = self._root.geometry()
self._cache.save(force=force)

def grab_attention(self, *, sound: bool = True):
Expand Down Expand Up @@ -2425,7 +2451,8 @@ async def main(exit_event: asyncio.Event):
prioritize_by_ending_soonest=False,
autostart_tray=False,
exclude={"Lit Game"},
tray_notifications=True
tray_notifications=True,
window_position= "940x690+3203+345",
)
)
mock.change_state = lambda state: mock.gui.print(f"State change: {state.value}")
Expand Down
Loading
Loading