From cbd376b62ebec712ec041b6f3830511f8cd0fd3b Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 24 Aug 2023 15:25:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme=E5=92=8C=E5=85=B3?= =?UTF-8?q?=E4=BA=8E=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 13 ++++++++++++- about_app.py | 16 +++++++++++++--- ui/option_menu.py | 4 +++- window.py | 4 +--- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Readme.md b/Readme.md index aa6a965..5ac2f72 100644 --- a/Readme.md +++ b/Readme.md @@ -4,4 +4,15 @@

Sonist - 基于mpd后端的音乐播放器

-
\ No newline at end of file + + +### 感觉以下第三方库 + +- [`python-mpd2`](https://github.com/Mic92/python-mpd2), 本项目内置了修改版的`python-mpd2`, 加入了Gtk的信号与槽机制的支持, 并更加友好的方式处理异常, 减少程序崩溃。 +- [`python-mutagen`](https://github.com/quodlibet/mutagen) + + + + +### 开源协议 +本项目采用`MIT`开源协议。 \ No newline at end of file diff --git a/about_app.py b/about_app.py index 649ed5a..9d0ed2b 100644 --- a/about_app.py +++ b/about_app.py @@ -13,11 +13,21 @@ class AboutWindow(Gtk.AboutDialog): super().__init__(self) self.set_program_name('Sonist Gtk') - # self.set_logo('youtube') self.set_logo_icon_name('google-chrome') self.set_license_type(Gtk.License.MIT_X11) self.set_version('0.1.0') self.set_website('https://github.com/app-cat/sonist-gtk') self.set_website_label('官网') - self.set_copyright('© 2023 Yutent') - self.set_comments('Sonist-Gtk 是一个界面美观, 基于MPD后端的音乐播放器, 使用python + gtk3开发。') \ No newline at end of file + self.set_authors([ + 'Yutent (Sonist)', + 'Mic92 (python-mpd2)', + 'quodlibet (python-mutagen)' + ]) + self.set_copyright('© 2023 Yutent ') + self.set_comments('Sonist-Gtk 是一个界面美观, 基于MPD后端的音乐播放器, 使用python + gtk3开发。') + + self.connect("response", self.on_close) + + + def on_close(self, dialog, res): + self.hide() \ No newline at end of file diff --git a/ui/option_menu.py b/ui/option_menu.py index bee995d..3a23c1e 100644 --- a/ui/option_menu.py +++ b/ui/option_menu.py @@ -7,8 +7,9 @@ from gi.repository import Gtk, Gdk, GObject from .image import ScaleImage class OptionMenu(Gtk.Menu): - def __init__(self): + def __init__(self, app): Gtk.Menu.__init__(self) + self.app = app btn_icos = [ './usr/share/sonist/setting.png', @@ -50,6 +51,7 @@ class OptionMenu(Gtk.Menu): case '退出应用': pass case '关于播放器': + self.app.about.present() pass diff --git a/window.py b/window.py index f1026e9..c94b24d 100644 --- a/window.py +++ b/window.py @@ -62,7 +62,7 @@ class SonistWindow(Gtk.Window): # 菜单按钮 menu_btn = ImageButton('./usr/share/sonist/menu.png') - popup_menu = OptionMenu() + popup_menu = OptionMenu(app) menu_btn.connect('clicked', lambda w: popup_menu.show(w)) layout.put(menu_btn, 276, 6) @@ -228,8 +228,6 @@ class SonistWindow(Gtk.Window): @idle def sync_state(self, stat = None, song = None, first = False): self.ctrl_box.disabled = False - print(threading.active_count()) - print(threading.current_thread()) self.stat = stat or self.get_mpd_stat()