diff --git a/.gitignore b/.gitignore index ce85a3d..7ddd909 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,9 @@ Thumbs.db # Vim swap files *.swp +# png files +*.png + # Virtualenv ignore bin/ lib/ diff --git a/res/get_sizes.sh b/res/get_sizes.sh new file mode 100755 index 0000000..2aa4c47 --- /dev/null +++ b/res/get_sizes.sh @@ -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 diff --git a/res/jsoninspector.desktop b/res/jsoninspector.desktop old mode 100644 new mode 100755 index ccb9a03..e2cd65d --- a/res/jsoninspector.desktop +++ b/res/jsoninspector.desktop @@ -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= diff --git a/res/jsoninspector.glade b/res/jsoninspector.glade index 342ee57..c4faca0 100644 --- a/res/jsoninspector.glade +++ b/res/jsoninspector.glade @@ -54,7 +54,7 @@ center 200 180 - java-1.7.0 + jsoninspector @@ -176,7 +176,7 @@ False JSON Inspector center - java-1.7.0 + jsoninspector diff --git a/res/jsoninspector.svg b/res/jsoninspector.svg new file mode 100644 index 0000000..3f66a09 --- /dev/null +++ b/res/jsoninspector.svg @@ -0,0 +1,1004 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/jsoninspector128x128.png b/res/jsoninspector128x128.png deleted file mode 100644 index b7b8e29..0000000 Binary files a/res/jsoninspector128x128.png and /dev/null differ diff --git a/res/jsoninspector16x16.png b/res/jsoninspector16x16.png deleted file mode 100644 index b1247fd..0000000 Binary files a/res/jsoninspector16x16.png and /dev/null differ diff --git a/res/jsoninspector32x32.png b/res/jsoninspector32x32.png deleted file mode 100644 index cc768a5..0000000 Binary files a/res/jsoninspector32x32.png and /dev/null differ diff --git a/res/jsoninspector48x48.png b/res/jsoninspector48x48.png deleted file mode 100644 index f7f74f2..0000000 Binary files a/res/jsoninspector48x48.png and /dev/null differ diff --git a/res/jsoninspector64x64.png b/res/jsoninspector64x64.png deleted file mode 100644 index d002999..0000000 Binary files a/res/jsoninspector64x64.png and /dev/null differ diff --git a/setup.py b/setup.py index 089886b..c792a54 100644 --- a/setup.py +++ b/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')