[Update] Update通知ボタン、Help and Infoボタンを押したときにview.pyで定義しているコールバック関数が呼ばれるように。

実際にリンク先に飛ぶがURLは仮置き。
This commit is contained in:
Sakamoto Shiina
2023-09-24 20:42:40 +09:00
parent 80e8c0d2b3
commit bfda7a6e25
3 changed files with 23 additions and 10 deletions

20
view.py
View File

@@ -1,6 +1,8 @@
from typing import Union
from types import SimpleNamespace
from tkinter import font as tk_font
import webbrowser
from languages import selectable_languages
from customtkinter import StringVar, IntVar, BooleanVar, END as CTK_END, get_appearance_mode
@@ -46,6 +48,12 @@ class View():
CALLBACK_OPEN_CONFIG_WINDOW=None,
CALLBACK_CLOSE_CONFIG_WINDOW=None,
# Open Help and Information Page
CALLBACK_CLICKED_HELP_AND_INFO=self.openWebPage_Booth,
# Open Update Page
CALLBACK_CLICKED_UPDATE_AVAILABLE=self.openWebPage_VrctDocuments,
# Main Window
# Sidebar
@@ -392,6 +400,18 @@ class View():
# self._insertSampleConversationToTextbox()
@staticmethod
def openWebPage(url:str):
webbrowser.open_new_tab(url)
def openWebPage_Booth(self):
self.openWebPage("https://booth.pm/ja/items/4814313")
self._printToTextbox_Info("Opened Booth page in your web browser.")
def openWebPage_VrctDocuments(self):
self.openWebPage("https://booth.pm/ja/items/4814313") # temporally, this url is Booth link.
self._printToTextbox_Info("Opened the VRCT Documents page in your web browser.")
@staticmethod
def showUpdateAvailableButton():
vrct_gui.update_available_container.grid()