| 1 |
# This program is free software; you can redistribute it and/or modify |
| 2 |
# it under the terms of the GNU General Public License as published by |
| 3 |
# the Free Software Foundation; either version 1, or (at your option) |
| 4 |
# any later version. |
| 5 |
# |
| 6 |
# This program is distributed in the hope that it will be useful, |
| 7 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 8 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 9 |
# GNU General Public License for more details. |
| 10 |
# |
| 11 |
# You should have received a copy of the GNU General Public License |
| 12 |
# along with this program; if not, write to the Free Software |
| 13 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 14 |
|
| 15 |
|
| 16 |
from xlgui.preferences import widgets |
| 17 |
from xl.nls import gettext as _ |
| 18 |
from xl import xdg |
| 19 |
|
| 20 |
name = _('Lyrics Viewer') |
| 21 |
ui = xdg.get_data_path('ui', 'preferences', 'lyrics.ui') |
| 22 |
|
| 23 |
|
| 24 |
DEFAULT_FONT = None |
| 25 |
|
| 26 |
|
| 27 |
class LyricsFontPreference(widgets.FontButtonPreference): |
| 28 |
default = None |
| 29 |
name = 'plugin/lyricsviewer/lyrics_font' |
| 30 |
|
| 31 |
def __init__(self, preferences, widget): |
| 32 |
self.default = DEFAULT_FONT |
| 33 |
widgets.FontButtonPreference.__init__(self, preferences, widget) |
| 34 |
|
| 35 |
|
| 36 |
class LyricsFontResetButtonPreference(widgets.FontResetButtonPreference): |
| 37 |
default = None |
| 38 |
name = 'plugin/lyricsviewer/reset_button' |
| 39 |
condition_preference_name = 'plugin/lyricsviewer/lyrics_font' |
| 40 |
|
| 41 |
def __init__(self, preferences, widget): |
| 42 |
self.default = DEFAULT_FONT |
| 43 |
widgets.FontResetButtonPreference.__init__(self, preferences, widget) |