Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
fix symbolic icons, app menu and few small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Mar 9, 2017
1 parent d9464e4 commit dc4622d
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 27 deletions.
9 changes: 6 additions & 3 deletions IconRequests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ def get_icon(icon_path):
:return: GdkPixbux Image
"""
try:
icon = GdkPixbuf.Pixbuf.new_from_file(icon_path)
if icon.get_width() != 48 or icon.get_height() != 48:
icon = icon.scale_simple(48, 48, GdkPixbuf.InterpType.BILINEAR)
if "symbolic" in icon_path:
icon = (None, icon_path)
else:
icon = GdkPixbuf.Pixbuf.new_from_file(icon_path)
if icon.get_width() != 48 or icon.get_height() != 48:
icon = icon.scale_simple(48, 48, GdkPixbuf.InterpType.BILINEAR)
return icon
except GLib.Error:
return None
Expand Down
7 changes: 6 additions & 1 deletion IconRequests/widgets/application_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ def generate(self):
image = Gtk.Image(xalign=0)
icon = get_icon(self.desktop_file.icon_path)
if icon:
image.set_from_pixbuf(icon)
if type(icon) == tuple:
icon_name = path.basename(icon[1]).replace(".svg", "")
image.set_from_gicon(Gio.ThemedIcon(name=icon_name),
Gtk.IconSize.DIALOG)
else:
image.set_from_pixbuf(icon)
else:
image.set_from_icon_name("image-missing", Gtk.IconSize.DIALOG)
image_box.pack_start(image, True, False, 6)
Expand Down
4 changes: 3 additions & 1 deletion IconRequests/widgets/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def generate_window(self, application):
self.popover = Gtk.Popover.new_from_model(self.menu_button, application.menu)
self.popover.props.width_request = 200
self.menu_button.connect("clicked", self.show_menu_popover)

else:
self.menu_button.set_visible(False)
self.menu_button.set_no_show_all(True)
self.revealer = self.builder.get_object("Revealer")
self.search_list = [self.all, self.unsupported, self.hardcoded]

Expand Down
2 changes: 1 addition & 1 deletion data/ui/about.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<property name="destroy_with_parent">True</property>
<property name="type_hint">menu</property>
<property name="program_name">Icon Requests</property>
<property name="version">0.1.1</property>
<property name="version">0.1.2</property>
<property name="comments" translatable="yes">Simple application to report missing icons to github repository</property>
<property name="license" translatable="yes">This program comes with absolutely no warranty. See the &lt;a href="http://www.gnu.org/licenses/gpl-3.0.html"&gt;GNU General Public License, version 3 or later&lt;/a&gt; for details.</property>
<property name="authors">Bilal Elmoussaoui</property>
Expand Down
22 changes: 14 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# See https://github.com/mesonbuild/meson/issues/226
project('icon-requests', 'c',
version: '0.1.1')

project('icon-requests', 'c', version: '0.1.2')

message('Looking for dependencies')
python = find_program('python3')
git = find_program('git', required : false)
intltool_merge = find_program('intltool-merge')
Expand All @@ -12,15 +10,13 @@ else
GITVERSION = ''
endif

message('Looking for dependencies')
py3 = find_program('python3')
glib = dependency('glib-2.0')
gobject = dependency('gobject-2.0')
gir = dependency('gobject-introspection-1.0')
gtk = dependency('gtk+-3.0', version : '>=3.16')

message('Getting python install dir')
r = run_command(py3, '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')
r = run_command(python, '-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')
if r.returncode() != 0
error('Cannot find python install dir')
endif
Expand All @@ -40,6 +36,13 @@ conf.set('VERSION', meson.project_version())
conf.set('BUILDDIR', meson.current_build_dir())
conf.set('PYTHONDIR', python_dir)

if get_option('post_install') == true
post_install = 'enabled'
else
post_install = 'disabled'
endif
message('post install script is : ' + post_install)

subdir('data')
subdir('po')

Expand All @@ -52,4 +55,7 @@ configure_file(input : 'icon-requests.in', output : 'icon-requests', configurati

configure_file = '@0@/icon-requests'.format(meson.current_build_dir())
install_data(configure_file, install_dir: 'bin')
meson.add_install_script('meson_post_install.sh')

if get_option('post_install') == true
meson.add_install_script('meson_post_install.sh')
endif
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('post_install', type : 'boolean', value : 'true')
14 changes: 7 additions & 7 deletions po/icon-requests.pot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: icon-requests\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-05 19:39+0100\n"
"POT-Creation-Date: 2017-03-09 14:33+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -32,24 +32,24 @@ msgstr ""
msgid "Quit"
msgstr ""

#: IconRequests/widgets/application_row.py:76
#: IconRequests/widgets/application_row.py:81
msgid "Report"
msgstr ""

#: IconRequests/widgets/application_row.py:89
#: IconRequests/widgets/application_row.py:94
msgid "Fix"
msgstr ""

#: IconRequests/widgets/application_row.py:132
#: IconRequests/widgets/application_row.py:137
msgid "Please check your connexion"
msgstr ""

#: IconRequests/widgets/application_row.py:136
#: IconRequests/widgets/application_row.py:162
#: IconRequests/widgets/application_row.py:141
#: IconRequests/widgets/application_row.py:167
msgid "Theme not supported"
msgstr ""

#: IconRequests/widgets/application_row.py:140
#: IconRequests/widgets/application_row.py:145
msgid "You've reached your API limits"
msgstr ""

Expand Down
15 changes: 9 additions & 6 deletions update_pot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ xgettext \
${BASEDIR}/data/icon-requests.appdata.xml.in

# Merge the messages with existing po files
echo "Merging with existing translations... "
for file in ${BASEDIR}/po/*.po
do
echo -n $file
msgmerge --update $file $OUTPUT_FILE
done
po_files=$(find ${BASEDIR}/po/ -name "*.po")
if [ ${#po_files[@]} != 0 ]; then
echo "Merging with existing translations..."
for file in $po_files
do
echo -n $file
msgmerge --update $file $OUTPUT_FILE
done
fi

0 comments on commit dc4622d

Please sign in to comment.