Skip to content

Commit

Permalink
Bitmessage updates, moon3 theme, config editor ..
Browse files Browse the repository at this point in the history
* Themes updates

* Use the new config system more and more to replace
the old settings file

* Per-module config editor, using a tree widget

* Move i18n stuff to galacteek/i18n

* More work on the bitmessage client

* New GIFs, change some icons to work better with the moon3 theme
  • Loading branch information
cipres authored and cipres committed Feb 10, 2021
1 parent 0532a70 commit 3a39d87
Show file tree
Hide file tree
Showing 152 changed files with 9,257 additions and 6,861 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/galacteek-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# os: [ubuntu-18.04, macos-latest, windows-latest]
os: [windows-latest]
os: [ubuntu-18.04, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 2 additions & 0 deletions AppImage/AppRun
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export PATH=${HERE}/usr/bin:$PATH
export LD_LIBRARY_PATH=${HERE}/usr/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$PYTHONPATH:${HERE}/usr/lib/python3.7/site-packages
export QT_QPA_PLATFORM_PLUGIN_PATH=${HERE}/usr/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms
export QT_STYLE_OVERRIDE=Fusion

APPIQT_LIBPATH=${HERE}/usr/lib/python3.7/site-packages/PyQt5/Qt/lib

if [ ! -z "${container}" ] && [ x"${container}" == x"firejail" ]; then
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ This is build 42.
This makes the boot process faster.
- Change default fonts for web engine widgets

### Fixed
- Memory leak in the BrowserTab object
- UTF-8 rendering of blog posts

## [0.4.41] - 2020-12-04
### Added
- Tor support
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ tox:

upload: dists
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

themes:
@python setup.py build_ui --tasks=themes

ui:
@python setup.py build_ui
12 changes: 4 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ See the releases_ page for all releases.
Sponsor this project
====================

See the sponsor_ page for all the possible ways to donate to this project.

.. image:: https://raw.githubusercontent.com/pinnaculum/galacteek/master/share/icons/github-mark.png
:target: https://github.com/sponsors/pinnaculum
:alt: Sponsor with Github Sponsors
Expand All @@ -52,13 +54,6 @@ Sponsor this project
:alt: Sponsor with Liberapay
:align: left

.. image:: https://github.githubassets.com/images/modules/site/icons/funding_platforms/patreon.svg
:target: https://patreon.com/galacteek
:alt: Sponsor with Patreon
:align: left
:width: 90
:height: 90

Screencasts
===========

Expand Down Expand Up @@ -220,6 +215,7 @@ from the ipfs-logo_ project's repository is included, unchanged.
.. _aioipfs: https://gitlab.com/cipres/aioipfs
.. _aiomonitor: https://github.com/aio-libs/aiomonitor
.. _asyncqt: https://github.com/gmarull/asyncqt
.. _sponsor: https://github.com/pinnaculum/galacteek/SPONSOR.rst
.. _quamash: https://github.com/harvimt/quamash
.. _go-ipfs: https://github.com/ipfs/go-ipfs
.. _dist.ipfs.io: https://dist.ipfs.io
Expand All @@ -239,4 +235,4 @@ from the ipfs-logo_ project's repository is included, unchanged.
.. _IPID: https://github.com/jonnycrunch/ipid
.. _wasmer: https://wasmer.io/
.. _cyber: https://cybercongress.ai
.. _Bitmessage: https://wiki.bitmessage.org/Bitmessage%20Technical%20Paper.pdf
.. _Bitmessage: https://wiki.bitmessage.org/
23 changes: 23 additions & 0 deletions SPONSOR.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Github and Liberapay
====================

.. image:: https://raw.githubusercontent.com/pinnaculum/galacteek/master/share/icons/github-mark.png
:target: https://github.com/sponsors/pinnaculum
:alt: Sponsor with Github Sponsors
:align: left

.. image:: https://raw.githubusercontent.com/pinnaculum/galacteek/master/share/icons/liberapay.png
:target: https://liberapay.com/galacteek/donate
:alt: Sponsor with Liberapay
:align: left

Cryptocurrency donations
========================

You can also make a donation with Bitcoin:

.. image:: https://raw.githubusercontent.com/pinnaculum/galacteek/master/share/crypto/btc/btc-donate.png
:alt: Donate with Bitcoin
:align: left

BTC: **1Cgwbzi6R4TgWp7AG67BPwYY1iz15ATR7A**
16 changes: 9 additions & 7 deletions galacteek.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SOURCES = galacteek/application.py \
SOURCES = galacteek/application/__init__.py \
galacteek/appsettings.py \
galacteek/ui/browser.py \
galacteek/ui/browser/__init__.py \
galacteek/ui/camera.py \
galacteek/ui/chat.py \
galacteek/ui/clipboard.py \
Expand All @@ -10,14 +10,14 @@ SOURCES = galacteek/application.py \
galacteek/ui/dids.py \
galacteek/ui/downloads.py \
galacteek/ui/feeds.py \
galacteek/ui/files.py \
galacteek/ui/files/__init__.py \
galacteek/ui/hashmarks.py \
galacteek/ui/helpers.py \
galacteek/ui/history.py \
galacteek/ui/history/__init__.py \
galacteek/ui/i18n.py \
galacteek/ui/imgview.py \
galacteek/ui/ipfssearch.py \
galacteek/ui/unixfs.py \
galacteek/ui/files/unixfs.py \
galacteek/ui/keys.py \
galacteek/ui/mainui.py \
galacteek/ui/mediaplayer.py \
Expand All @@ -30,7 +30,7 @@ SOURCES = galacteek/application.py \
galacteek/ui/settings.py \
galacteek/ui/textedit.py \
galacteek/ui/userwebsite.py \
galacteek/ui/widgets.py
galacteek/ui/widgets/__init__.py

FORMS += galacteek/ui/forms/addkeydialog.ui \
galacteek/ui/forms/addhashmarkdialog.ui \
Expand All @@ -42,6 +42,7 @@ FORMS += galacteek/ui/forms/addkeydialog.ui \
galacteek/ui/forms/chatchannelslist.ui \
galacteek/ui/forms/chatroom.ui \
galacteek/ui/forms/dagview.ui \
galacteek/ui/forms/dmessenger.ui \
galacteek/ui/forms/donatedialog.ui \
galacteek/ui/forms/files.ui\
galacteek/ui/forms/ipfscidinputdialog.ui \
Expand All @@ -61,4 +62,5 @@ FORMS += galacteek/ui/forms/addkeydialog.ui \
galacteek/ui/forms/timeframeselector.ui

TRANSLATIONS = share/translations/galacteek_en.ts \
share/translations/galacteek_fr.ts \
share/translations/galacteek_es.ts \
share/translations/galacteek_fr.ts
112 changes: 29 additions & 83 deletions galacteek/application.py → galacteek/application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

from galacteek.core.asynclib import asyncify
from galacteek.core.asynclib import cancelAllTasks
from galacteek.core.aservice import GService
from galacteek.core.aservice import cached_property

from galacteek.services import cached_property
from galacteek.core.ctx import IPFSContext
from galacteek.core.profile import UserProfile
from galacteek.core.multihashmetadb import IPFSObjectMetadataDatabase
Expand Down Expand Up @@ -106,11 +106,6 @@

from galacteek.ipdapps.loader import DappsRegistry

from galacteek.browser.webprofiles import IPFSProfile
from galacteek.browser.webprofiles import Web3Profile
from galacteek.browser.webprofiles import MinimalProfile
from galacteek.browser.webprofiles import AnonymousProfile

from galacteek.dweb.webscripts import ipfsClientScripts
from galacteek.dweb.render import defaultJinjaEnv

Expand All @@ -131,10 +126,7 @@
from galacteek.appsettings import *
from galacteek.core.ipfsmarks import IPFSMarks

from galacteek.services.bitmessage.service import BitMessageClientService
from galacteek.services.tor.service import TorService
from galacteek.services.tor.service import TorServiceRuntimeConfig
from galacteek.services.ethereum.service import EthereumService
from galacteek.services.app import AppService

from yarl import URL

Expand Down Expand Up @@ -232,58 +224,6 @@ def gatewayUrl(self):
return self._gatewayUrl


class AppService(GService):
# Bitmessage service
bmService: BitMessageClientService = None

# Tor service
torService: TorService = None

# Eth
ethService: EthereumService = None

def __init__(self, *args, **kw):
self.app = kw.pop('app')

super().__init__(*args, **kw)

@cached_property
def bmService(self) -> BitMessageClientService:
return BitMessageClientService(
self.app._bitMessageDataLocation
)

@cached_property
def ethService(self) -> EthereumService:
return EthereumService(
self.app._ethDataLocation
)

@cached_property
def torService(self) -> TorService:
return TorService(
self.app.dataPathForService('tor'),
TorServiceRuntimeConfig(
cfgLocation=self.app._torConfigLocation,
dataLocation=self.app._torDataDirLocation
)
)

async def on_start(self) -> None:
log.debug('Starting main application service')

# Dependencies

log.debug('Adding runtime dependencies')

await self.add_runtime_dependency(self.bmService)
await self.add_runtime_dependency(self.torService)
await self.add_runtime_dependency(self.ethService)

async def on_stop(self) -> None:
log.debug('Stopping main application service')


class GalacteekApplication(QApplication):
"""
Galacteek application class
Expand All @@ -310,6 +250,7 @@ def __init__(self, debug=False, profile='main', sslverify=True,
self.setQuitOnLastWindowClosed(False)

self._mode = mode
self._theme = None
self._cmdArgs = cmdArgs
self._debugEnabled = debug
self._appProfile = profile
Expand Down Expand Up @@ -362,6 +303,15 @@ def s(self) -> AppService:
def eth(self):
return self.s.ethService

@property
def theme(self):
return self._theme

@theme.setter
def theme(self, theme):
log.debug(f'Changing theme: {theme!r}')
self._theme = theme

@property
def cmdArgs(self):
return self._cmdArgs
Expand Down Expand Up @@ -510,10 +460,10 @@ def readQSSFile(self, path):
qFile.open(QFile.ReadOnly)
styleSheetBa = qFile.readAll()
return styleSheetBa.data().decode('utf-8')
except BaseException:
except BaseException as err:
# that would probably occur if the QSS is not
# in the resources file.. set some default stylesheet here?
pass
log.debug(f'readQSSFile error: {err}')

def themeChange(self, name=None):
theme = cGet('theme', mod='galacteek.ui')
Expand Down Expand Up @@ -627,11 +577,14 @@ def setupTranslator(self):
if self.translator:
QApplication.removeTranslator(self.translator)

lang = cGet('language')
qmPath = f':/share/translations/{GALACTEEK_NAME}_{lang}.qm'

self.translator = QTranslator()
QApplication.installTranslator(self.translator)
lang = self.settingsMgr.getSetting(CFG_SECTION_UI, CFG_KEY_LANG)
self.translator.load(':/share/translations/galacteek_{0}.qm'.format(
lang))

if self.translator.load(qmPath):
log.debug(f'Translator load OK from: {qmPath}')
self.installTranslator(self.translator)

def createMainWindow(self, show=True):
self.mainWindow = mainui.MainWindow(self)
Expand Down Expand Up @@ -877,11 +830,7 @@ async def setupOrmDb(self, dbpath: Path):
ensure(self.sqliteDb.setup())
self.modelAtomFeeds = AtomFeedsModel(self.sqliteDb.feeds, parent=self)

self.urlHistory = history.URLHistory(
self.sqliteDb,
enabled=self.settingsMgr.urlHistoryEnabled,
parent=self
)
self.urlHistory = history.URLHistory(parent=self)

if not await database.initOrm(str(dbpath)):
await self.dbConfigured.emit(False)
Expand Down Expand Up @@ -984,9 +933,7 @@ def setupMainObjects(self):
self.solarSystem = SolarSystem()
self.mimeTypeIcons = preloadMimeIcons()
self.hmSynchronizer = HashmarksSynchronizer()
self.ipidManager = IPIDManager(
resolveTimeout=self.settingsMgr.ipidIpnsTimeout
)
self.ipidManager = IPIDManager()

self.towers = {
'dags': DAGSignalsTower(self),
Expand Down Expand Up @@ -1340,6 +1287,7 @@ async def setupProfileAndRepo(self, ipfsop):

pDialog.stop()
pDialog.log('Ready to roll')
pDialog.showProgress(False)

await ipfsop.sleep(0.5)

Expand Down Expand Up @@ -1448,14 +1396,12 @@ def getClipboardText(self):
return self.clipTracker.getText()

def initWebProfiles(self):
from galacteek.browser.webprofiles import wpRegisterFromConfig

self.scriptsIpfs = ipfsClientScripts(self.getIpfsConnectionParams())

self.webProfiles = {
'minimal': MinimalProfile(parent=self),
'ipfs': IPFSProfile(parent=self),
'web3': Web3Profile(parent=self),
'anonymous': AnonymousProfile(parent=self)
}
# Register web profiles
wpRegisterFromConfig(self)

def allWebProfilesSetAttribute(self, attribute, val):
for pName, profile in self.webProfiles.items():
Expand Down
10 changes: 10 additions & 0 deletions galacteek/application/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
envs:
default:
language: en

languagesAvailable:
- code: en
displayName: 'English'

- code: es
displayName: 'Spanish (Castilian)'
2 changes: 1 addition & 1 deletion galacteek/blockchain/ethereum/contract.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import attr
from galacteek import log
from galacteek.core.aservice import GService
from galacteek.services import GService
from galacteek.core.ps import makeKeySmartContract
from galacteek.core.ps import gHub
from web3 import Account
Expand Down
8 changes: 8 additions & 0 deletions galacteek/blockchain/ethereum/infura/endpoints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
INFURA_MAINNET_DOMAIN = 'mainnet.infura.io'
INFURA_ROPSTEN_DOMAIN = 'ropsten.infura.io'
INFURA_GOERLI_DOMAIN = 'goerli.infura.io'
INFURA_RINKEBY_DOMAIN = 'rinkeby.infura.io'
INFURA_KOVAN_DOMAIN = 'kovan.infura.io'

WEBSOCKET_SCHEME = 'wss'
HTTP_SCHEME = 'https'
Loading

0 comments on commit 3a39d87

Please sign in to comment.