Display information about the next generation of alpha versions

This commit is contained in:
Manuel Cortez 2019-11-22 17:35:55 -06:00
parent 55193a958d
commit c19fbf40a0
4 changed files with 37 additions and 1 deletions

View File

@ -1,4 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys
### ToDo: Remove this piece of code a month later or something like that, when the migration to the cx_freeze executable will be complete.
def is_pyinstaller():
if hasattr(sys, 'frozen') and hasattr(sys, '_MEIPASS'):
return True
else:
return False
name = "Socializer" name = "Socializer"
version = "0.23" version = "0.23"

View File

@ -14,6 +14,7 @@ import output
import logging import logging
import keys import keys
import application import application
from wxUI.commonMessages import alpha_reminder
if hasattr(sys, "frozen"): if hasattr(sys, "frozen"):
sys.excepthook = lambda x, y, z: logging.critical(''.join(traceback.format_exception(x, y, z))) sys.excepthook = lambda x, y, z: logging.critical(''.join(traceback.format_exception(x, y, z)))
from mysc.thread_utils import call_threaded from mysc.thread_utils import call_threaded
@ -51,6 +52,9 @@ def setup():
from sessionmanager import sessionManager from sessionmanager import sessionManager
log.debug("Created Application mainloop object") log.debug("Created Application mainloop object")
if application.is_pyinstaller():
log.debug("Showing reminder about next Socializer alpha... ")
alpha_reminder()
sm = sessionManager.sessionManagerController() sm = sessionManager.sessionManagerController()
sm.show() sm.show()
del sm del sm

View File

@ -1,5 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
import datetime
import webbrowser
import sys
import wx import wx
import application import application
@ -75,4 +78,19 @@ def unblock_person():
return wx.MessageDialog(None, _("Are you sure you want to unblock this user?"), _("Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal() return wx.MessageDialog(None, _("Are you sure you want to unblock this user?"), _("Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal()
def post_failed(): def post_failed():
return wx.MessageDialog(None, _("Unfortunately, we could not send your last post or message to VK. Would you like to try again?"), _("Post failed"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal() return wx.MessageDialog(None, _("Unfortunately, we could not send your last post or message to VK. Would you like to try again?"), _("Post failed"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal()
### ToDo: same instructions than in application.py
def alpha_reminder():
deadline = datetime.datetime(2019, 11, 27)
now = datetime.datetime.now()
if now >= deadline:
msg = wx.MessageDialog(None, _("In order to keep receiving updates, you are required to download the alpha version of socializer from scratch from our website. Would you like to download it now? If you press 'yes', you will be redirected automatically to the direct download for the new alpha version, and socializer will be closed automatically. If you do not wish to download the new alpha, take into account that the current version will no longer receive updates"), _("Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal()
if msg == wx.ID_NO:
return
url = "https://code.manuelcortez.net/manuelcortez/socializer/-/jobs/artifacts/master/raw/socializer.zip?job=alpha"
webbrowser.open_new_tab(url)
sys.exit()
return
else:
return wx.MessageDialog(None, _("Please remember that from November 27, 2019, you will have to download the alpha version from scratch from the Socializer website. The alpha version you are currently running will no longer receive updates. The new alpha version, which must be downloaded from the project's page, should not be considered suspicious by most antivirus vendors and all automatic updates will be sent to the new generation of socializer alpha. Thank you for your patience."), _("Important notice"), style=wx.OK).ShowModal()

View File

@ -13,6 +13,8 @@ class postMenu(wx.Menu):
self.dislike = self.Append(wx.NewId(), _("Dislike")) self.dislike = self.Append(wx.NewId(), _("Dislike"))
self.dislike.Enable(False) self.dislike.Enable(False)
self.comment = self.Append(wx.NewId(), _("Add comment")) self.comment = self.Append(wx.NewId(), _("Add comment"))
self.fav = self.Append(wx.NewId(), _("Add to favorites"))
self.fav.Enable(False)
if can_delete: if can_delete:
self.delete = self.Append(wx.NewId(), _("Delete")) self.delete = self.Append(wx.NewId(), _("Delete"))
else: else:
@ -41,6 +43,8 @@ class peopleMenu(wx.Menu):
self.view_profile = self.Append(wx.NewId(), _("View profile")) self.view_profile = self.Append(wx.NewId(), _("View profile"))
self.message = self.Append(wx.NewId(), _("Send a message")) self.message = self.Append(wx.NewId(), _("Send a message"))
self.timeline = self.Append(wx.NewId(), _("Open timeline")) self.timeline = self.Append(wx.NewId(), _("Open timeline"))
self.fav = self.Append(wx.NewId(), _("Add to favorites"))
self.fav.Enable(False)
if not_friend == False: if not_friend == False:
self.common_friends = self.Append(wx.NewId(), _("View friends in common")) self.common_friends = self.Append(wx.NewId(), _("View friends in common"))
if is_request == False and is_subscriber == False and not_friend == False: if is_request == False and is_subscriber == False and not_friend == False:
@ -67,6 +71,8 @@ class documentMenu(wx.Menu):
else: else:
self.action = self.Append(wx.NewId(), _("Add to my documents")) self.action = self.Append(wx.NewId(), _("Add to my documents"))
self.open_in_browser = self.Append(wx.NewId(), _("Open in vk.com")) self.open_in_browser = self.Append(wx.NewId(), _("Open in vk.com"))
self.fav = self.Append(wx.NewId(), _("Add to favorites"))
self.fav.Enable(False)
class commentMenu(wx.Menu): class commentMenu(wx.Menu):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):