Skip to content

Commit

Permalink
merge yumex-dnf-4.3.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Lauridsen committed May 11, 2016
2 parents 3715271 + 4e51d1d commit d96ee76
Show file tree
Hide file tree
Showing 18 changed files with 954 additions and 4,638 deletions.
3,172 changes: 465 additions & 2,707 deletions ChangeLog

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ clean: $(CLEAN_TARGETS)


get-builddeps:
@sudo dnf install python3-devel python3-gobject perl-TimeDate gettext intltool transifex-client
@sudo dnf install python3-devel python3-gobject gettext intltool transifex-client

archive:
@rm -rf ${APPNAME}-${VERSION}.tar.gz
Expand All @@ -50,9 +50,8 @@ archive:
@rm -rf ${APPNAME}-${VERSION}.tar.gz
@echo "The archive is in ${BUILDDIR}/SOURCES/${APPNAME}-$(VERSION).tar.gz"

# needs perl-TimeDate for git2cl
changelog:
@git log --pretty --numstat --summary | tools/git2cl > ChangeLog
$(PYTHON) tools/git2cl.py

upload:
@scp ~/rpmbuild/SOURCES/${APPNAME}-${VERSION}.tar.gz yum-extender.org:public_html/dnl/yumex/source/.
Expand All @@ -73,6 +72,9 @@ release-publish:
@$(MAKE) rpm

release-cleanup:
@git checkout develop
@git merge --no-ff release-${VERSION} -m "merge ${APPNAME}-${VERSION} release"
@git push origin
@git branch -D release-${VERSION}

test-cleanup:
Expand All @@ -93,7 +95,7 @@ test-release:
@cat ${APPNAME}.spec | sed -e 's/${VER_REGEX}/\1${BUMPED_MINOR}/' -e 's/\(^Release:\s*\)\([0-9]*\)\(.*\)./\10.1.${GITDATE}%{?dist}/' > ${APPNAME}-test.spec ; mv ${APPNAME}-test.spec ${APPNAME}.spec
@git commit -a -m "bumped ${APPNAME} version ${NEW_VER}-${NEW_REL}"
# Make Changelog
@git log --pretty --numstat --summary | ./tools/git2cl > ChangeLog
$(PYTHON) tools/git2cl.py
@git commit -a -m "updated ChangeLog"
# Make archive
@rm -rf ${APPNAME}-${NEW_VER}.tar.gz
Expand Down
4 changes: 0 additions & 4 deletions gfx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ clean:
echo "Nothing to do"

install:
mkdir -p $(DESTDIR)$(DATADIR)/$(APPNAME)/gfx
mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
install -m644 yumex-icon.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/$(APPNAME).svg
install -m644 yumex-icon.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps/$(APPNAME).png
install -m644 tray*.png $(DESTDIR)$(DATADIR)/$(APPNAME)/gfx/.
install -m644 spinner*.gif $(DESTDIR)$(DATADIR)/$(APPNAME)/gfx/.

Binary file removed gfx/spinner-small.gif
Binary file not shown.
Binary file removed gfx/spinner.gif
Binary file not shown.
Binary file removed gfx/tray-error.png
Binary file not shown.
Binary file removed gfx/tray-info.png
Binary file not shown.
Binary file removed gfx/tray-no-updates.png
Binary file not shown.
Binary file removed gfx/tray-updates.png
Binary file not shown.
Binary file removed gfx/tray-working.png
Binary file not shown.
454 changes: 275 additions & 179 deletions src/yumex.ui

Large diffs are not rendered by default.

28 changes: 13 additions & 15 deletions src/yumex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def get_root_backend(self):
errmsg = _(
'DNF is locked by another process.\n\n'
'Yum Extender will exit')
dialogs.show_information(self, errmsg)
self.error_dialog.show(errmsg)
# close down and exit yum extender
#self.status.SetWorking(False) # reset working state
#self.status.SetYumexIsRunning(self.pid, False)
Expand Down Expand Up @@ -171,7 +171,8 @@ def exception_handler(self, e):
close = False
if errmsg == '':
errmsg = msg
dialogs.show_information(self, errmsg)
self.error_dialog.show(errmsg)

# try to exit the backends, ignore errors
if close:
try:
Expand Down Expand Up @@ -216,6 +217,7 @@ def __init__(self, app):
sys.exit()
# transaction result dialog
self.transaction_result = dialogs.TransactionResult(self)
self.error_dialog = dialogs.ErrorDialog(self)

def get_ui(self, widget_name):
return self.ui.get_object(widget_name)
Expand Down Expand Up @@ -289,7 +291,7 @@ def exception_handler(self, e):
close = False
if errmsg == '':
errmsg = msg
dialogs.show_information(self, errmsg)
self.error_dialog.show(errmsg)
# try to exit the backends, ignore errors
if close:
try:
Expand Down Expand Up @@ -321,7 +323,7 @@ def set_working(self, state, insensitive=True):

def _disable_buttons(self, state):
WIDGETS_INSENSITIVE = ['left_buttons', 'right_buttons',
'package_sidebar', 'center_buttons']
'package_sidebar']
for widget in WIDGETS_INSENSITIVE:
self.ui.get_object(widget).set_sensitive(state)

Expand Down Expand Up @@ -879,9 +881,8 @@ def _process_actions(self, from_queue=True):
# check for protected packages
check = self._check_protected(result)
if check:
dialogs.show_information(
self, _("Can't remove protected package(s)"),
'\n'.join(check))
self.error_dialog.show(
_("Can't remove protected package(s)") + '\n'.join(check))
self._reset_on_cancel()
return
# transaction confirmation dialog
Expand All @@ -897,14 +898,13 @@ def _process_actions(self, from_queue=True):
dialogs.show_information(self, _('No pending actions in queue'))
self._reset_on_cancel()
except misc.TransactionBuildError as e: # Error in building transaction
dialogs.show_information(
self, _('Error(s) in building transaction'),
'\n'.join(e.msgs))
self.error_dialog.show(
_('Error(s) in building transaction') + '\n'.join(e.msgs))
self._reset_on_cancel()
except misc.TransactionSolveError as e:
dialogs.show_information(
self, _('Error(s) in search for dependencies'),
'\n'.join(e.msgs))
self.error_dialog.show(
_('Error(s) in search for dependencies') +
'\n'.join(e.msgs))
self._reset_on_error()

###############################################################################
Expand Down Expand Up @@ -1008,11 +1008,9 @@ def on_page_changed(self, widget, page):
"""Handle content page is changed."""
if page == 'packages':
self._search_toggle.set_sensitive(True)
self.extra_filters.set_sensitive(True)
self.search_bar.show()
self.info.show()
else:
self.extra_filters.set_sensitive(False)
self._search_toggle.set_sensitive(False)
self.search_bar.hide()
self.info.show(False)
Expand Down
20 changes: 20 additions & 0 deletions src/yumex/gui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,26 @@ def handle_setting(self, option, state):
os.unlink(const.USER_DESKTOP_FILE)


class ErrorDialog:

def __init__(self, base):
self.base = base
self.dialog = self.base.ui.get_object("error_dialog")
self.dialog.set_transient_for(base)
self._buffer = self.base.ui.get_object('error_buffer')

def show(self, txt):
self._set_text(txt)
self.dialog.show_all()
rc = self.dialog.run()
self.dialog.hide()
self._buffer.set_text('')
return rc == 1

def _set_text(self, txt):
self._buffer.set_text(txt)


class TransactionResult:

def __init__(self, base):
Expand Down
86 changes: 41 additions & 45 deletions src/yumex/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,45 +46,44 @@ class InfoProgressBar:

def __init__(self, ui):
self.ui = ui
self.infobar = ui.get_object("infobar") # infobar revealer
frame = ui.get_object("info_frame")
new_bg = Gdk.RGBA()
if yumex.misc.check_dark_theme():
new_bg.parse("rgb(0,0,0)")
else:
new_bg.parse("rgb(255,255,255)")
frame.override_background_color(Gtk.StateFlags.NORMAL, new_bg)
self.infobar = ui.get_object("info_revealer") # infobar revealer
self.label = ui.get_object("infobar_label")
self.sublabel = ui.get_object("infobar_sublabel")
self.progress = ui.get_object("infobar_progress")
self.spinner = ui.get_object("info_spinner")

def _show_infobar(self, show=True):
self.infobar.set_reveal_child(show)
if show:
self.infobar.show()
self.spinner.start()
else:
self.spinner.stop()
self.infobar.hide()
self.label.hide()
self.sublabel.hide()
self.progress.hide()
self.progress.set_show_text(False)

def show_progress(self, state):
if state:
self.show_label()
else:
self.hide()
self._show_infobar(False)

def hide(self):
self.label.hide()
self.sublabel.hide()
self.progress.hide()
self._show_infobar(False)
self.progress.set_text("")
#self.progress.set_show_text (False)

def hide_sublabel(self):
self.sublabel.hide()

def show_label(self):
def show_label(self, msg=""):
self.label.set_text(msg)
self.label.show()
self.label.set_text("")

def show_sublabel(self):
def show_sublabel(self, msg=""):
self.sublabel.set_text(msg)
self.sublabel.show()
self.sublabel.set_text("")

def show_all(self):
self.show_label()
Expand All @@ -93,25 +92,21 @@ def show_all(self):

def info(self, msg):
self._show_infobar(True)
self.show_label()
self.label.set_text(msg)
self.show_label(msg)

def info_sub(self, msg):
self._show_infobar(True)
self.show_sublabel()
self.sublabel.set_text(msg)
self.show_sublabel(msg)

def set_progress(self, frac, label=None):
if label:
self.progress.set_text(label)
if frac >= 0.0 and frac <= 1.0:
self.infobar.show()
self._show_infobar()
self.progress.show()
self.progress.set_fraction(frac)
# make sure that the main label is shown, else the progres
# looks bad. this is normally happen when changlog
# or filelist info is needed for at package
# and it will trigger the yum daemon to download the need metadata.
# make sure that the main label is shown, else the progress
# looks bad. this normally happens when changlog or filelist info
# is needed for a package and it will trigger the yum daemon to
# download the need metadata.
if not self.label.get_property('visible'):
self.info(_("Getting Package Metadata"))

Expand Down Expand Up @@ -453,19 +448,23 @@ def on_mouse_motion(self, widget, event, data=None):
# convert coords to TextBuffer coords
x, y = widget.window_to_buffer_coords(Gtk.TextWindowType.TEXT, x, y)
# Get the tags on current pointer location
tags = widget.get_iter_at_location(x, y).get_tags()
# Remove underline and hand mouse pointer
if self.underlined_url:
self.underlined_url.set_property("underline", Pango.Underline.NONE)
widget.get_window(Gtk.TextWindowType.TEXT).set_cursor(None)
self.underlined_url = None
for tag in tags:
if tag in self.url_tags:
# underline the tags and change mouse pointer to hand
tag.set_property("underline", Pango.Underline.SINGLE)
widget.get_window(Gtk.TextWindowType.TEXT).set_cursor(
Gdk.Cursor(Gdk.CursorType.HAND2))
self.underlined_url = tag
itr = widget.get_iter_at_location(x, y)
if isinstance(itr, tuple):
itr = itr[1]
tags = itr.get_tags()
# Remove underline and hand mouse pointer
if self.underlined_url:
self.underlined_url.set_property("underline",
Pango.Underline.NONE)
widget.get_window(Gtk.TextWindowType.TEXT).set_cursor(None)
self.underlined_url = None
for tag in tags:
if tag in self.url_tags:
# underline the tags and change mouse pointer to hand
tag.set_property("underline", Pango.Underline.SINGLE)
widget.get_window(Gtk.TextWindowType.TEXT).set_cursor(
Gdk.Cursor(Gdk.CursorType.HAND2))
self.underlined_url = tag
return False

def add_url(self, text, url, newline=False):
Expand Down Expand Up @@ -777,9 +776,6 @@ def __init__(self, win):
def popup(self):
self._on_button(self._button)

def set_sensitive(self, state):
self._button.set_sensitive(state)

def _on_button(self, button):
self._popover.show_all()

Expand Down
Loading

0 comments on commit d96ee76

Please sign in to comment.