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

Commit

Permalink
few improvements and fixes, release 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Mar 3, 2017
1 parent b479e81 commit 1cc5155
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
4 changes: 2 additions & 2 deletions IconRequests/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self):

self.menu = Gio.Menu()
cssProviderFile = Gio.File.new_for_uri(
'resource:///org/gnome/IconRequests/style.css')
'resource:///org/gnome/IconRequests/css/style.css')
cssProvider = Gtk.CssProvider()
screen = Gdk.Screen.get_default()
styleContext = Gtk.StyleContext()
Expand Down Expand Up @@ -91,7 +91,7 @@ def about_dialog():
Shows about dialog
"""
builder = Gtk.Builder()
builder.add_from_resource('/org/gnome/IconRequests/about.ui')
builder.add_from_resource('/org/gnome/IconRequests/ui/about.ui')

dialog = builder.get_object("AboutDialog")
return dialog
Expand Down
7 changes: 2 additions & 5 deletions IconRequests/modules/upload/imgur.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ def upload_icon(self, image_path, title=None):
"title": title
}
try:
query = requests.post(UPLOAD_URI, data, headers=headers, timeout=0.05)
query = requests.post(UPLOAD_URI, data, headers=headers)
if query.status_code == 200:
return query.json()["data"]["link"]
else:
raise ConnexionError
return None
except requests.exceptions.ConnectionError:
raise ConnexionError
return None
else:
return None
return None
5 changes: 4 additions & 1 deletion IconRequests/widgets/application_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def generate(self):
description_label = Gtk.Label()
description_label.set_justify(Gtk.Justification.LEFT)
description_label.set_text(self.desktop_file.getComment())
description_label.set_tooltip_text(self.desktop_file.getComment())
description_label.set_ellipsize(Pango.EllipsizeMode.END)
description_label.get_style_context().add_class("application-label")
label_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
Expand All @@ -53,7 +54,9 @@ def generate(self):

path_label = Gtk.Label()
path_label.set_justify(Gtk.Justification.LEFT)
path_label.set_text(self.desktop_file.path)
file_path = path.join(self.desktop_file.path, self.desktop_file.desktop_file)
path_label.set_text(file_path)
path_label.set_tooltip_text(file_path)
path_label.set_ellipsize(Pango.EllipsizeMode.END)
path_label.get_style_context().add_class("application-path")
path_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
Expand Down
10 changes: 6 additions & 4 deletions IconRequests/widgets/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from gettext import gettext as _
import logging
from IconRequests.const import DESKTOP_FILE_DIRS, settings, repositories, ICONS_IGNORE_LIST
from IconRequests.utils import (get_supported_icons, is_gnome,
from IconRequests.utils import (get_supported_icons, is_gnome,
is_app_menu, get_issues_list)
from IconRequests.modules.upload.imgur import Imgur
from IconRequests.modules.desktop import DesktopFile
Expand All @@ -27,7 +27,7 @@ def __init__(self, application):
# Initiate the uploading server
self.upload_service = Imgur(settings)
self.builder = Gtk.Builder.new_from_resource(
"/org/gnome/IconRequests/mainwindow.ui")
"/org/gnome/IconRequests/ui/mainwindow.ui")
self.generate_window(application)

def generate_window(self, application):
Expand Down Expand Up @@ -74,7 +74,7 @@ def generate_window(self, application):
# Watch the icon name gsettings
self.gsettings = Gio.Settings.new("org.gnome.desktop.interface")
self.gsettings.connect("changed", self.refresh_icons_view)

self.start()

def emit(self, *args):
Expand Down Expand Up @@ -103,6 +103,7 @@ def __on_key_press(self, widget, event):
self.search_entry.set_text("")
else:
self.search_entry.grab_focus_without_selecting()
return True

if keyname == "backspace":
if (len(self.search_entry.get_text()) == 0
Expand Down Expand Up @@ -172,7 +173,8 @@ def generate_apps_list(self):
if path.isdir(desktop_dir):
all_files = glob("{0}*.desktop".format(desktop_dir))
for desktop_file in all_files:
obj = DesktopFile(desktop_file, self.upload_service, supported_icons, issues_list)
obj = DesktopFile(desktop_file, self.upload_service,
supported_icons, issues_list)
icon_name = obj.getIcon()
if icon_name not in already_added and icon_name not in ICONS_IGNORE_LIST:
self.db.append(obj)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions data/icon-requests.gresource.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/IconRequests">
<file>style.css</file>
<file>css/style.css</file>
<file>repos.json</file>
<file>issue.model</file>
<file preprocess="xml-stripblanks">about.ui</file>
<file preprocess="xml-stripblanks">mainwindow.ui</file>
<file preprocess="xml-stripblanks">ui/about.ui</file>
<file preprocess="xml-stripblanks">ui/mainwindow.ui</file>
</gresource>
</gresources>
2 changes: 1 addition & 1 deletion data/about.ui → 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</property>
<property name="version">0.1.1</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
File renamed without changes.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See https://github.com/mesonbuild/meson/issues/226
project('icon-requests', 'c',
version: '0.1')
version: '0.1.1')


python = find_program('python3')
Expand Down
11 changes: 8 additions & 3 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-01-31 07:26+0100\n"
"POT-Creation-Date: 2017-03-03 01:21+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 Down Expand Up @@ -40,14 +40,19 @@ msgstr ""
msgid "Fix"
msgstr ""

#: IconRequests/widgets/application_row.py:125
#: IconRequests/widgets/application_row.py:124
msgid "Please check your connexion"
msgstr ""

#: IconRequests/widgets/application_row.py:147
#: IconRequests/widgets/application_row.py:128
#: IconRequests/widgets/application_row.py:154
msgid "Theme not supported"
msgstr ""

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

#: data/icon-requests.desktop.in:4
msgid "Missing Icon Requests"
msgstr ""
Expand Down

0 comments on commit 1cc5155

Please sign in to comment.