Skip to content

Commit

Permalink
Merge pull request #4 from alei1180/3-add-in-menu-github-project-page
Browse files Browse the repository at this point in the history
Добавить в меню ссылку на проект (#3)
  • Loading branch information
alei1180 authored Aug 11, 2024
2 parents 4a7a5f0 + 915e62d commit d6a237c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ocvc/ocvc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import webbrowser
from ctypes import windll

import keyboard
Expand All @@ -15,14 +16,19 @@ def run(app_name: str) -> None:
app_name,
app_image,
title=app_name,
menu=pystray.Menu(pystray.MenuItem("Close", on_clicked)),
menu=pystray.Menu(
pystray.MenuItem("GitHub", on_clicked),
pystray.MenuItem("Close", on_clicked),
),
)

app.run(setup)


def on_clicked(app_icon: pystray.Icon, item: pystray.MenuItem) -> None:
if str(item) == "Close":
if str(item) == "GitHub":
webbrowser.open("https://github.com/alei1180/ocvc", new=2)
elif str(item) == "Close":
app_icon.visible = False
app_icon.stop()

Expand Down Expand Up @@ -83,7 +89,7 @@ def file_name_from_window(window_name: str) -> str:
os.makedirs(path_to_save)

cut_interval = window_name_cut_interval(window_name)
file_name = window_name[cut_interval["begin"]:cut_interval["end"]]
file_name = window_name[cut_interval["begin"] : cut_interval["end"]]
file_name = file_name.replace(":", "")
file_name = file_name.replace("[Только для чтения]", "")
file_name = file_name.strip()
Expand Down

0 comments on commit d6a237c

Please sign in to comment.