forked from metabrainz/picard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
754 additions
and
795 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Picard, the next-generation MusicBrainz tagger | ||
# Copyright (C) 2006 Lukáš Lalinský | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
||
import sys | ||
import os.path | ||
from PyQt4 import QtGui | ||
|
||
if sys.platform == 'win32': | ||
_search_paths = [] | ||
else: | ||
_search_paths = [ | ||
os.path.expanduser('~/.icons'), | ||
os.path.join(os.environ.get('XDG_DATA_DIRS', '/usr/share'), 'icons'), | ||
'/usr/share/pixmaps', | ||
] | ||
|
||
if 'GNOME_DESKTOP_SESSION_ID' in os.environ: | ||
_current_theme = os.popen('gconftool-2 -g /desktop/gnome/interface/icon_theme').read().strip() or None | ||
else: | ||
_current_theme = None | ||
|
||
ICON_SIZE_MENU = ('16x16',) | ||
ICON_SIZE_TOOLBAR = ('22x22',) | ||
ICON_SIZE_ALL = ('22x22', '16x16') | ||
|
||
def lookup(name, size=ICON_SIZE_ALL): | ||
icon = QtGui.QIcon() | ||
if _current_theme: | ||
for path in _search_paths: | ||
for subdir in ('actions', 'places', 'devices'): | ||
fullpath = os.path.join(path, _current_theme, size[0], subdir, name) | ||
if os.path.exists(fullpath + '.png'): | ||
icon.addFile(fullpath + '.png') | ||
for s in size[1:]: | ||
icon.addFile(os.path.join(path, _current_theme, s, subdir, name) + '.png') | ||
return icon | ||
for s in size: | ||
icon.addFile(os.path.join(':', 'images', s, name) + '.png') | ||
return icon |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
File renamed without changes
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters