Skip to content

Commit

Permalink
Many improvements in the pyramids system, UI and schemes
Browse files Browse the repository at this point in the history
* MNG/Webp animations support

* Fix GIF loading

* Hashmarks searching

* Hashmarks schema validation

* Async hashmarks broadcast message JSON validation in the
  pubsub service

* searchAllByMetadata() now async

* Use a rotating cube in the status bar as a P2P connection
  quality indicator (rather than a boring label).
  The more peers you have, the faster the cube rotates.

* New animation: rotating-cube-redflash-140-6fps.gif

* Mediaplayer UI fixes

* Add a "Reload" button in the DAG viewer when
  viewing a node from an IPNS path

* ipfs.dag.EvolvingDAG: support DAG rewinding

* The UI should now be more uniform across platforms,
  we use the Fusion style everywhere

* Can now filter for pubsub events in the eventlog watcher

* Improve the pyramids system, adding a type of pyramid
  that works on an EDAG (Evolving DAG). The image gallery
  is a first simple example of that.

* The dweb: scheme handler is now 'native' (derives from
  NativeIPFSSchemeHandler and is fully async) which means
  it does not use the go-ipfs http gw (there's no scheme
  left which uses the gateway now).

* The NativeIPFSSchemeHandler, when faced with an unknown
  dag type, will redirect to 'index.html' if present at the
  dag root (time will tell if it's a good idea ..)

* Minor changes in the DAG viewer UI (use a  single tool button)

revbump to 0.4.18
  • Loading branch information
cipres authored and cipres committed Oct 21, 2019
1 parent 64a8502 commit a872b4d
Show file tree
Hide file tree
Showing 93 changed files with 3,232 additions and 1,115 deletions.
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.. image:: https://gitlab.com/galacteek/galacteek/raw/master/share/icons/galacteek.png
.. image:: https://gitlab.com/galacteek/galacteek/raw/master/share/icons/galacteek-incandescent.png
:align: center
:width: 128
:height: 128
Expand Down Expand Up @@ -245,6 +245,9 @@ License

**galacteek** is offered under the GNU GPL3 license

The logos and animations are licensed under the Creative
Commons CC-BY-SA license.

Some elements from the ipfs-css_ repository (CSS files and fonts) are included.

Some icons from the "Oxygen" icons set are included.
Expand Down
2 changes: 2 additions & 0 deletions galacteek.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ SOURCES = galacteek/application.py \
galacteek/ui/browser.py \
galacteek/ui/chat.py \
galacteek/ui/clipboard.py \
galacteek/ui/colors.py \
galacteek/ui/dag.py \
galacteek/ui/dialogs.py \
galacteek/ui/downloads.py \
galacteek/ui/feeds.py \
galacteek/ui/files.py \
galacteek/ui/hashmarks.py \
galacteek/ui/helpers.py \
galacteek/ui/history.py \
galacteek/ui/i18n.py \
galacteek/ui/imgview.py \
galacteek/ui/ipfssearch.py \
Expand Down
2 changes: 1 addition & 1 deletion galacteek/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# ..............................................................................
#

__version__ = '0.4.17'
__version__ = '0.4.18'

from galacteek.core.asynclib import * # noqa
from galacteek.core import glogger
Expand Down
21 changes: 14 additions & 7 deletions galacteek/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
from galacteek.ui import peers
from galacteek.ui import history
from galacteek.ui.resource import IPFSResourceOpener
from galacteek.ui.style import GalacteekStyle

from galacteek.ui.helpers import *
from galacteek.ui.i18n import *
Expand Down Expand Up @@ -160,6 +161,7 @@ class GalacteekApplication(QApplication):
"""

manualAvailable = pyqtSignal(str, dict)
messageDisplayRequest = pyqtSignal(str, str)

def __init__(self, debug=False, profile='main', sslverify=True,
enableOrbital=False, progName=None, cmdArgs={}):
Expand Down Expand Up @@ -219,7 +221,7 @@ def __init__(self, debug=False, profile='main', sslverify=True,
self.initDapps()
self.createMainWindow()

self.setStyle()
self.applyStyle()
self.clipboardInit()

@property
Expand Down Expand Up @@ -327,7 +329,7 @@ def ipfsDataLocation(self):
def orbitDataLocation(self):
return self._orbitDataLocation

def setStyle(self, theme='default'):
def applyStyle(self, theme='default'):
qssPath = ":/share/static/qss/{theme}/galacteek.qss".format(
theme=theme)
qssFile = QFile(qssPath)
Expand All @@ -342,21 +344,23 @@ def setStyle(self, theme='default'):
# in the resources file.. set some default stylesheet here?
pass

self.gStyle = GalacteekStyle()
self.setStyle(self.gStyle)

def debug(self, msg):
if self.debugEnabled:
log.debug(msg)

def initSystemTray(self):
self.systemTray = QSystemTrayIcon(self)
self.systemTray.setIcon(getIcon('galacteek.png'))
self.systemTray.setIcon(getIcon('galacteek-incandescent.png'))
self.systemTray.show()
self.systemTray.activated.connect(self.onSystemTrayIconClicked)
self.systemTray.setToolTip(GALACTEEK_NAME)

systemTrayMenu = QMenu(self.mainWindow)

actionShow = systemTrayMenu.addAction('Show')
actionShow.setIcon(getIcon('galacteek.png'))
actionShow.setIcon(getIcon('galacteek-incandescent.png'))
actionShow.triggered.connect(self.onShowWindow)

systemTrayMenu.addSeparator()
Expand All @@ -379,7 +383,7 @@ def initMisc(self):
self.resourceOpener = IPFSResourceOpener(parent=self)

self.downloadsManager = downloads.DownloadsManager(self)
self.marksLocal = IPFSMarks(self.localMarksFileLocation)
self.marksLocal = IPFSMarks(self.localMarksFileLocation, backup=True)
self.importDefaultHashmarks(self.marksLocal)

self.marksLocal.addCategory('general')
Expand Down Expand Up @@ -409,7 +413,7 @@ def importDefaultHashmarks(self, marksLocal):
for fn in listing:
if fn.endswith('.json'):
path = pkg_resources.resource_filename(pkg, fn)
marks = IPFSMarks(path)
marks = IPFSMarks(path, autosave=False)
marksLocal.merge(marks)

# Follow ipfs.io
Expand Down Expand Up @@ -596,6 +600,9 @@ def setupMainObjects(self):

self.rscAnalyzer = ResourceAnalyzer(parent=self)

self.messageDisplayRequest.connect(
lambda msg, title: messageBox(msg, title=title))

def setupAsyncLoop(self):
"""
Install the quamash event loop and enable debugging
Expand Down
19 changes: 19 additions & 0 deletions galacteek/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from datetime import datetime
from datetime import timezone
from dateutil import parser as duparser
from sys import version_info

from PyQt5.QtWidgets import QApplication
Expand All @@ -7,6 +10,22 @@ def runningApp():
return QApplication.instance()


def utcDatetime():
return datetime.now(timezone.utc)


def utcDatetimeIso():
return utcDatetime().isoformat()


def parseDate(date):
if isinstance(date, str):
try:
return duparser.parse(date)
except Exception:
pass


def isoformat(dt, sep=' ', timespec='seconds'):
if version_info.major == 3 and version_info.minor < 6:
return dt.isoformat(sep)
Expand Down
10 changes: 9 additions & 1 deletion galacteek/core/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from galacteek.ipfs import ipfsOp

from galacteek.ipfs.cidhelpers import IPFSPath
from galacteek.ipfs.mimetype import MIMEType
from galacteek.ipfs.mimetype import detectMimeType

Expand All @@ -19,11 +20,18 @@ def __init__(self, parent=None):
self.app = QApplication.instance()

@ipfsOp
async def __call__(self, ipfsop, ipfsPath):
async def __call__(self, ipfsop, pathRef):
"""
:param IPFSPath ipfsPath
"""

if isinstance(pathRef, IPFSPath):
ipfsPath = pathRef
elif isinstance(pathRef, str):
ipfsPath = IPFSPath(pathRef, autoCidConv=True)
else:
raise ValueError('Invalid input value')

path = ipfsPath.objPath
mHashMeta = await self.app.multihashDb.get(path)

Expand Down
Loading

0 comments on commit a872b4d

Please sign in to comment.