Skip to content
Snippets Groups Projects
Commit e0727444 authored by Vincent Texier's avatar Vincent Texier
Browse files

Merge branch 'dev' of https://github.com/Insoleet/cutecoin into vtexier

parents 994f82f2 32b996eb
No related branches found
No related tags found
No related merge requests found
-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
+OkuE6N36B9K
-----END CERTIFICATE-----
......@@ -46,7 +46,7 @@ QToolButton {
<item>
<widget class="QLabel" name="label_welcome">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;TestText&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
......@@ -77,7 +77,7 @@ QToolButton {
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonFollowStyle</enum>
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
......@@ -110,7 +110,7 @@ QToolButton {
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonFollowStyle</enum>
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
......@@ -137,7 +137,7 @@ QToolButton {
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonFollowStyle</enum>
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
......
......@@ -5,6 +5,7 @@
import sys, os, subprocess, multiprocessing
from cx_Freeze import setup, Executable
from PyQt5 import QtCore
#############################################################################
# preparation des options
......@@ -18,13 +19,22 @@ packages = ["libnacl"]
includefiles = []
if sys.platform == "win32":
includefiles.append("platforms/win32/libEGL.dll")
app = QtCore.QCoreApplication(sys.argv)
pyqt_path = QtCore.QCoreApplication.libraryPaths()[0]
print(pyqt_path)
libEGL_path = os.path.join(os.path.dirname(pyqt_path), "libEGL.dll")
qt5svg_path = os.path.join(os.path.dirname(pyqt_path), "Qt5Svg.dll")
includefiles.append(libEGL_path)
includefiles.append(qt5svg_path)
includefiles.append("platforms/win32/libsodium.dll")
elif sys.platform == "darwin":
pass
else:
pass
includefiles.append(os.path.join("res", "certs", "DigiCertHighAssuranceEVRootCA.crt"))
options = {"path": sys.path,
"includes": includes,
"include_files": includefiles,
......
......@@ -330,6 +330,7 @@ class Application(QObject):
def latest_version(self):
version = (True, __version__)
logging.debug(os.environ["REQUESTS_CA_BUNDLE"])
releases = requests.get("https://api.github.com/repos/ucoin-io/cutecoin/releases")
latest = None
for r in releases.json():
......
......@@ -22,6 +22,7 @@ else:
parameters = {'home': path.join(config_path, 'cutecoin'),
'data': path.join(config_path, 'cutecoin', 'data')}
if not path.exists(parameters['home']):
logging.info("Creating home directory")
makedirs((parameters['home']))
......
......@@ -54,7 +54,6 @@ class cached(object):
finally:
inst._cache_mutex.unlock()
inst._cache_mutex.unlock()
return value
def __repr__(self):
......
......@@ -32,11 +32,14 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
Constructor
'''
super().__init__()
logging.debug("Info")
self.setupUi(self)
self.community = community
self.account = account
self.password_asker = password_asker
logging.debug("Table")
members_model = MembersTableModel(community)
logging.debug("Filter")
proxy_members = MembersFilterProxyModel()
proxy_members.setSourceModel(members_model)
self.table_community_members.setModel(proxy_members)
......
......@@ -42,21 +42,26 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
self.community = community
self.password_asker = password_asker
self.status_label = status_label
logging.debug("Com")
self.tab_community = CommunityTabWidget(self.app.current_account,
self.community,
self.password_asker)
logging.debug("Wal")
self.tab_wallets = WalletsTabWidget(self.app,
self.app.current_account,
self.community,
self.password_asker)
logging.debug("Net")
self.tab_network = NetworkTabWidget(self.community)
logging.debug("Connect")
self.community.new_block_mined.connect(self.refresh_block)
persons_watcher = self.app.monitor.persons_watcher(self.community)
persons_watcher.person_changed.connect(self.tab_community.refresh_person)
bc_watcher = self.app.monitor.blockchain_watcher(self.community)
bc_watcher.error.connect(self.display_error)
logging.debug("Connected")
person = Person.lookup(self.app.current_account.pubkey, self.community)
try:
......@@ -69,6 +74,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
warning_expiration_time = int(sig_validity / 3)
will_expire_soon = (current_time > expiration_date - warning_expiration_time)
logging.debug("Try")
if will_expire_soon:
days = QDateTime().currentDateTime().daysTo(QDateTime.fromTime_t(expiration_date))
if days > 0:
......@@ -86,7 +92,6 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
self.tabs_account.setEnabled(False)
else:
self.tabs_account.setEnabled(True)
self.refresh_wallets()
blockchain_init = QDateTime()
blockchain_init.setTime_t(self.community.get_block(1).mediantime)
......@@ -149,6 +154,7 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget):
block_number = blockid['number']
self.status_label.setText("Connected : Block {0}"
.format(block_number))
self.refresh_wallets()
@pyqtSlot(str)
def display_error(self, error):
......
......@@ -120,6 +120,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
@pyqtSlot()
def loader_finished(self):
logging.debug("Finished loading")
self.refresh()
self.busybar.hide()
QApplication.restoreOverrideCursor()
......@@ -259,6 +260,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
currency_tab.refresh_wallets()
def refresh_communities(self):
logging.debug("CLEAR")
self.currencies_tabwidget.clear()
if self.app.current_account:
for community in self.app.current_account.communities:
......@@ -330,7 +332,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.status_label.setText("")
self.password_asker = None
else:
logging.debug("Show currencies loading")
self.currencies_tabwidget.show()
logging.debug("Hide homescreen")
self.homescreen.hide()
self.action_set_as_default.setEnabled(self.app.current_account.name
!= self.app.default_account)
......@@ -345,7 +349,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.menu_contacts.setEnabled(True)
self.action_configure_parameters.setEnabled(True)
self.menu_actions.setEnabled(True)
self.password_asker = PasswordAskerDialog(self.app.current_account)
self.setWindowTitle("CuteCoin {0} - Account : {1}".format(__version__,
self.app.current_account.name))
......
......@@ -16,6 +16,19 @@ from cutecoin.core.app import Application
if __name__ == '__main__':
# activate ctrl-c interrupt
signal.signal(signal.SIGINT, signal.SIG_DFL)
if getattr(sys, 'frozen', False):
# The application is frozen
datadir = os.path.dirname(sys.executable)
os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(datadir, "DigiCertHighAssuranceEVRootCA.crt")
else:
# The application is not frozen
# Change this bit to match where you store your data files:
datadir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(datadir,
"res", "certs",
"DigiCertHighAssuranceEVRootCA.crt")
cutecoin = QApplication(sys.argv)
app = Application(sys.argv)
QLocale.setDefault(QLocale("en_GB"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment