Changed the bitmap icons for svg and added a generator for the sizes. It's almost there, but we still don't have our icon to show our nor our desktop entry.
This commit is contained in:
parent
f34ebca209
commit
6007a1379b
11 changed files with 1073 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -44,6 +44,9 @@ Thumbs.db
|
|||
# Vim swap files
|
||||
*.swp
|
||||
|
||||
# png files
|
||||
*.png
|
||||
|
||||
# Virtualenv ignore
|
||||
bin/
|
||||
lib/
|
||||
|
|
15
res/get_sizes.sh
Executable file
15
res/get_sizes.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
SIZES=( 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 )
|
||||
|
||||
# If we can't find the svg, cd into res, we're
|
||||
# probably being called from the root of
|
||||
# the source tree
|
||||
if [ ! -e jsoninspector.svg ]; then
|
||||
cd res
|
||||
fi
|
||||
|
||||
for s in "${SIZES[@]}"; do
|
||||
echo "Creating $s image from svg" ;
|
||||
convert -background none jsoninspector.svg -resize $s jsoninspector$s.png
|
||||
done
|
25
res/jsoninspector.desktop
Normal file → Executable file
25
res/jsoninspector.desktop
Normal file → Executable file
|
@ -1,8 +1,21 @@
|
|||
[Desktop Entry]
|
||||
Name=JSON Inspector
|
||||
Exec=jsoninspector.py
|
||||
Terminal=false
|
||||
Categories=GTK;Development;
|
||||
Comment[en_US]=A tool for examining JSON text easily
|
||||
Comment=A tool for examining JSON text easily
|
||||
Exec=jsoninspector
|
||||
GenericName[en_US]=JSON Inspector
|
||||
GenericName=JSON Inspector
|
||||
Icon=jsoninspector
|
||||
Type=Application
|
||||
Categories=GNOME;GTK;Development;
|
||||
Comment=JSON Inspector
|
||||
MimeType=
|
||||
Name[en_US]=JSON Inspector
|
||||
Name=JSON Inspector
|
||||
Path=
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
TerminalOptions=
|
||||
TryExec=/usr/bin/jsoninspector
|
||||
Type=Application
|
||||
X-DBUS-ServiceName=
|
||||
X-DBUS-StartupType=
|
||||
X-KDE-SubstituteUID=false
|
||||
X-KDE-Username=
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<property name="window_position">center</property>
|
||||
<property name="default_width">200</property>
|
||||
<property name="default_height">180</property>
|
||||
<property name="icon_name">java-1.7.0</property>
|
||||
<property name="icon_name">jsoninspector</property>
|
||||
<signal name="delete-event" handler="onCopyJSONDelete" swapped="no"/>
|
||||
<signal name="destroy" handler="onCopyJSONDestroy" swapped="no"/>
|
||||
<child>
|
||||
|
@ -176,7 +176,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">JSON Inspector</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="icon_name">java-1.7.0</property>
|
||||
<property name="icon_name">jsoninspector</property>
|
||||
<signal name="delete-event" handler="onMainWindowDelete" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox" id="box1">
|
||||
|
|
1004
res/jsoninspector.svg
Normal file
1004
res/jsoninspector.svg
Normal file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 290 KiB |
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1,010 B |
Binary file not shown.
Before Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.8 KiB |
33
setup.py
33
setup.py
|
@ -1,4 +1,4 @@
|
|||
import ez_setup, sys, shutil, os, os.path
|
||||
import ez_setup, sys, shutil, os, os.path, subprocess
|
||||
ez_setup.use_setuptools()
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
@ -28,16 +28,26 @@ class CustomInstall(install):
|
|||
|
||||
except:
|
||||
print "Warning: error copying translation files."
|
||||
|
||||
# Generate the icons
|
||||
try:
|
||||
result = subprocess.call(['./res/get_sizes.sh'])
|
||||
|
||||
except:
|
||||
result = 1
|
||||
|
||||
if result != 0:
|
||||
print "Warning: Error generating icons"
|
||||
|
||||
# Copy the icons
|
||||
print "Installing application icons..."
|
||||
for icon_size in ['16x16', '32x32', '48x48', '64x64', '128x128']:
|
||||
for icon_size in ['{sz}x{sz}'.format(sz = x) for x in ['16', '22','24', '32', '36', '48', '64', '72', '96', '128', '192']]:
|
||||
try:
|
||||
shutil.copyfile('res/jsoninspector' + icon_size + ".png",
|
||||
'/usr/share/icons/hicolor/' + icon_size + "/apps/jsoninspector.png")
|
||||
|
||||
except:
|
||||
print "Warning: error copying icon {size}.".format(icon_size)
|
||||
print "Warning: error copying icon {size}.".format(size = icon_size)
|
||||
|
||||
try:
|
||||
shutil.copyfile('res/jsoninspector48x48.png', '/usr/share/pixmaps/jsoninspector.png')
|
||||
|
@ -45,6 +55,23 @@ class CustomInstall(install):
|
|||
except:
|
||||
print "Warning: error copying icon to pixmaps directory."
|
||||
|
||||
try:
|
||||
shutil.copyfile('res/jsoninspector.svg' ,'/usr/share/icons/hicolor/scalable/apps/jsoninspector.svg')
|
||||
|
||||
except:
|
||||
print "Warning: error copying svg to scalable."
|
||||
|
||||
print "Updating icon cache..."
|
||||
|
||||
try:
|
||||
result = subprocess.call(['/usr/bin/gtk-update-icon-cache /usr/share/icons/hicolor/'])
|
||||
|
||||
except:
|
||||
result = 1
|
||||
|
||||
if result != 0:
|
||||
print "Warning: Error updating hicolor icon cache."
|
||||
|
||||
try:
|
||||
print "Installing glade file..."
|
||||
shutil.copyfile('res/jsoninspector.glade', '/usr/local/share/jsoninspector/jsoninspector.desktop')
|
||||
|
|
Loading…
Reference in a new issue