From cecb4c23b2393568809b6c38031c02c40e5b8ebc Mon Sep 17 00:00:00 2001 From: Pablo Castellano Date: Mon, 1 Jul 2013 17:25:00 +0200 Subject: [PATCH] [Lite gui] Allow changing quote currency backwards with right click --- gui/gui_lite.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gui/gui_lite.py b/gui/gui_lite.py index 6e690ba2..9490feb0 100644 --- a/gui/gui_lite.py +++ b/gui/gui_lite.py @@ -4,6 +4,7 @@ import sys try: from PyQt4.QtCore import * from PyQt4.QtGui import * + from PyQt4.Qt import Qt import PyQt4.QtCore as QtCore except ImportError: @@ -482,9 +483,13 @@ class MiniWindow(QDialog): self.quote_currencies.insert(0, currency) self.refresh_balance() - def change_quote_currency(self): - self.quote_currencies = \ - self.quote_currencies[1:] + self.quote_currencies[0:1] + def change_quote_currency(self, forward=True): + if forward: + self.quote_currencies = \ + self.quote_currencies[1:] + self.quote_currencies[0:1] + else: + self.quote_currencies = \ + self.quote_currencies[-1:] + self.quote_currencies[0:-1] self.actuator.set_config_currency(self.quote_currencies[0]) self.refresh_balance() @@ -643,7 +648,7 @@ class BalanceLabel(QLabel): def mousePressEvent(self, event): """Change the fiat currency selection if window background is clicked.""" if self.state != self.SHOW_CONNECTING: - self.change_quote_currency() + self.change_quote_currency(event.button() == Qt.LeftButton) def set_balance_text(self, btc_balance, quote_text): """Set the amount of bitcoins in the gui."""