Skip to content
Snippets Groups Projects
Commit 71799d9f authored by inso's avatar inso
Browse files

Fixing multiple bugs on Windows

- Segfault due to double mutex lock
- Couldnt start on due to missing CA signing github
parent cce41c59
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ elif sys.platform == "darwin":
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