diff --git a/res/certs/DigiCertHighAssuranceEVRootCA.crt b/res/certs/DigiCertHighAssuranceEVRootCA.crt new file mode 100644 index 0000000000000000000000000000000000000000..4b1bc66be0f740d2c41cc87db8b789fe17ba7198 --- /dev/null +++ b/res/certs/DigiCertHighAssuranceEVRootCA.crt @@ -0,0 +1,23 @@ +-----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----- diff --git a/res/ui/homescreen.ui b/res/ui/homescreen.ui index b26d8fc1279adbbba46043460d8589c3bdd95107..9b80e39c6b67b4d0e2e75c4eb0719dbc98729a14 100644 --- a/res/ui/homescreen.ui +++ b/res/ui/homescreen.ui @@ -46,7 +46,7 @@ QToolButton { <item> <widget class="QLabel" name="label_welcome"> <property name="text"> - <string><html><head/><body><p>TestText</p></body></html></string> + <string><html><head/><body><p><br/></p></body></html></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> diff --git a/setup.py b/setup.py index b4a0739e34df62b0d3314cee1688fdbd3a05fa71..34660a7fe8964e28889e295c3d001a7e63102627 100644 --- a/setup.py +++ b/setup.py @@ -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, diff --git a/src/cutecoin/core/app.py b/src/cutecoin/core/app.py index 4c4af5b9415464252def998870da8b3b15655595..1f2a30d18a58e6ce956672052b8f4251e335573c 100644 --- a/src/cutecoin/core/app.py +++ b/src/cutecoin/core/app.py @@ -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(): diff --git a/src/cutecoin/core/config.py b/src/cutecoin/core/config.py index d921a711e52da081aed82b0ba8bf009d1eddee49..3f35a2550146a95f62a0ac582008859d25aeb341 100644 --- a/src/cutecoin/core/config.py +++ b/src/cutecoin/core/config.py @@ -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'])) diff --git a/src/cutecoin/core/person.py b/src/cutecoin/core/person.py index f11e87b66d912679ba1ff57c84b48c04ba3f90ce..0afdf4b0effc4be4ff245d7d656676aca473a267 100644 --- a/src/cutecoin/core/person.py +++ b/src/cutecoin/core/person.py @@ -54,7 +54,6 @@ class cached(object): finally: inst._cache_mutex.unlock() - inst._cache_mutex.unlock() return value def __repr__(self): diff --git a/src/cutecoin/gui/community_tab.py b/src/cutecoin/gui/community_tab.py index 85ab4f7d19fd55be3d6fcb1d769e2673168fafa9..d12cd9d0f98b001a75ddfbfbe62710bfe2fb808d 100644 --- a/src/cutecoin/gui/community_tab.py +++ b/src/cutecoin/gui/community_tab.py @@ -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) diff --git a/src/cutecoin/gui/currency_tab.py b/src/cutecoin/gui/currency_tab.py index a558d0346d4f396242cdaebb3f9bcf9f908bc130..4a976992087281f67cc787e6b1c89137c8b1198a 100644 --- a/src/cutecoin/gui/currency_tab.py +++ b/src/cutecoin/gui/currency_tab.py @@ -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: @@ -68,7 +73,8 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): sig_validity = self.community.parameters['sigValidity'] 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): diff --git a/src/cutecoin/gui/mainwindow.py b/src/cutecoin/gui/mainwindow.py index 33e3523082c14a5b04c2156525ee8600d5249977..480f56ea9b9555781e797a2fb256e6b5debeffb6 100644 --- a/src/cutecoin/gui/mainwindow.py +++ b/src/cutecoin/gui/mainwindow.py @@ -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() @@ -169,7 +170,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): logging.debug("Busybar : {:} : {:}".format(value, maximum)) self.busybar.setValue(value) self.busybar.setMaximum(maximum) - + if self.app.current_account: self.app.save_cache(self.app.current_account) @@ -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: @@ -268,8 +270,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.status_label) tab_currency.refresh() self.currencies_tabwidget.addTab(tab_currency, - QIcon(":/icons/currency_icon"), - community.name) + QIcon(":/icons/currency_icon"), + community.name) except NoPeerAvailable as e: QMessageBox.critical(self, "Could not join {0}".format(community.currency), str(e), @@ -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)) diff --git a/src/cutecoin/main.py b/src/cutecoin/main.py index ac61453c55d5e0af518e7a21b05f098d39033e58..c84d83f77c031468cd9e8e9f2e64dc81ae0af84b 100755 --- a/src/cutecoin/main.py +++ b/src/cutecoin/main.py @@ -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"))