13 次代碼提交 292c4201bd ... 1105114906

作者 SHA1 備註 提交日期
  Tristan 1105114906 Update README.md 3 年之前
  Tristan bc322b4bf9 fixed the connecting widget 3 年之前
  Tristan ffe882cf08 small tweaks, v0.1.1 3 年之前
  Tristan db45180beb improve threading WIP 3 年之前
  Tristan 009338321d deploy v0.1.0 3 年之前
  Tristan 297f7639f5 some cleanups and new features 3 年之前
  Tristan 4cc3eb3dc3 adds search 3 年之前
  Tristan 5a3db8d43c thread fixes and small changes 3 年之前
  Tristan e3ef2f99f6 Adds chapters and fix some window layering 3 年之前
  Tristan 8f4c71f7ff Merge branch 'dev2' of into dev 3 年之前
  Tristan f05b1e1e1b Memory usage optomisations 3 年之前
  Tristan f2d3b3b642 start lyberry to a provided lbry uri 3 年之前
  Tristan 7132187ba4 Significantly reduce memory usage by closing and deleting pages 3 年之前

+ 0 - 1
MANIFEST.in

@@ -1,6 +1,5 @@
 include README.md
 include LICENSE.txt
-include lyberry_qt/conf.toml
 include lyberry_qt/designer/*.ui
 include lyberry_qt/images/*.png
 

+ 30 - 11
README.md

@@ -4,37 +4,56 @@ A Qt LBRY client that uses the LyBerry Api
 
 ## Status
 
-Still in an early stage, but many essential features are in place.
+Still in an early stage, but many essential features are in place:
 
 - Following Feed
 - Watch Videos (in configurable external video player)
 - Read Articles (in configurable external text reader)
-- Read / Write Comments
+- Read / Write / Reply to Comments (on configurable comment server)
+- Basic search
 
-## Usage
+## Installation
+
+First [install a recent version of Python 3](https://www.python.org/downloads/).
 
-install with pip
+Then install the package with pip:
 
 ```
 pip install lyberry-qt
 ```
 
-run
+Get more info from Python about installing packages:
+<https://packaging.python.org/en/latest/tutorials/installing-packages/>
+
+## Usage
+
+Run the app:
 
 ```
 lyberry-qt
 ```
 
-Videos will probably open in your browser by default. To change this go to the settings page (in the Qt version) and change player\_cmd to your video player.
+LyBerry depends on the lbrynet daemon. This is provided by [the official LBRY Desktop application](https://lbry.com/get), so if that is open in the background LyBerry should just work, and will share the logged in accounts.
+
+You can instead run the daemon alone; get more info about that here: <https://github.com/lbryio/lbry-sdk#installation>. LyBerry is designed to work with the daemon over the network, so you could leave this running on a homeserver for good uptime seeding content. (Note: Don't expose the lbrynet api to the open Internet!)
 
-You can also change settings in conf.json in your relevant config directory. (eg on linux edit ~/.config/lyberry/conf.json)
+Videos will try to open in [mpv](https://mpv.io) by default. This option can be changed with the `player_cmd` setting, found on the settings page. On windows, you will want to change `mpv` to `mpv.exe`. You could also use VLC, or another video player if you wish.
+
+You can also change settings in conf.toml in your relevant config directory. (eg on linux edit ~/.config/lyberry/conf.toml)
 
 If some thumbnails are not showing you may need to install a Qt image format library on your system. Search for this using your package manager.
 
-## Support
+## Help
+
+Join my space on matrix! I am happy to help you getting started, and I welcome feedback and discussion.
+
+General Matrix Space: [#bean-machine:tristans.cloud](https://matrix.to/#/#bean-machine:tristans.cloud)
+
+LyBerry Matrix channel: [#lyberry:tristans.cloud](https://matrix.to/#/#lyberry:tristans.cloud)
+
+## Contributing
 
-Sharing my project and providing fixes and upgrades are the best way to support it.
-You may join my space on matrix for discussions of my software. <https://matrix.to/#/#bean-machine:tristans.cloud>
+Sharing my project is the best way to support it! If you can contribute code too, that would be awesome!
 
 Otherwise, I would greatly appreciate any donations with Monero (XMR), a secure and private currency for the internet:
 
@@ -42,7 +61,7 @@ openalias: tristans.cloud
 
 87uvs847voZW4QzLqCb3prfSeTjVgxo8PKCAGmeYQTKYd58yU7FD9PJY2eoDXW7y4jNozfHW3bq6SC6MZaB6Qgcz9Cib1DS
 
-You can also support my channel on LBRY, where I sometimes post updates: <lbry:@MyBeansAreBaked:b>
+You can also support my channel on LBRY, where I sometimes post updates: <lbry://@MyBeansAreBaked:b>
 
 I put more frequent low effort updates on <lbry://@MyBeansAreBaking#3>
 

+ 7 - 23
lyberry_qt/__init__.py

@@ -1,34 +1,18 @@
 #!/usr/bin/env python3
 
-import lyberry_api.api as lbry_api
-import lyberry_api.pub as lbry_pub
-import lyberry_api.channel as lbry_channel
-
-from PyQt5.QtCore import QObject, QThread, pyqtSignal
-from PyQt5 import QtCore, QtGui, QtWidgets, uic
-
-from lyberry_qt.helpers import relative_path
-
+from lyberry_api import LBRY_Api
 import sys
-import os
-import requests
-import traceback
-import time
-import re
-
-from lyberry_qt import settings
+from PyQt5 import QtWidgets
 from lyberry_qt.qt_window import MainWindow
 
-app_settings = settings.settings
-
-lbry = lbry_api.LBRY_Api(
-    lbrynet_api = app_settings['lbrynet_api'],
-    comment_api = app_settings['comment_api']
-)
+lbry = LBRY_Api()
 
 def main():
     app = QtWidgets.QApplication(sys.argv)
-    window = MainWindow(lbry)
+    url = None
+    if len(sys.argv) > 1:
+        url = sys.argv[-1]
+    window = MainWindow(lbry, start_url = url)
     window.show()
     sys.exit(app.exec_())
 

+ 12 - 7
lyberry_qt/comment_screen.py

@@ -1,26 +1,31 @@
 from PyQt5 import QtWidgets, uic
+from PyQt5.QtCore import pyqtSignal
 
 from lyberry_qt import helpers
 
 class CommentWidget(QtWidgets.QDialog):
+    change_url = pyqtSignal(str)
     def __init__(self, comment):
         super(CommentWidget, self).__init__()
         uic.loadUi(helpers.relative_path('designer/comment.ui'), self)
         self.comment = comment
         self.pub = comment.pub
         self._lbry = comment._LBRY_api
-        self.message.setText(comment.msg)
+        self.message.setText(helpers.fix_markdown(self.comment.msg))
+        self.message.linkActivated.connect(self.change_url.emit)
         self.channel_button.setText(comment.channel.name)
         self.show_replies_button.setText(str(comment.replies_amt) + " Replies")
-        if comment.replies_amt > 0:
-            self.show_replies_button.clicked.connect(self.show_replies)
-        else:
-            self.show_replies_button.setEnabled(False)
-
+        self.show_replies_button.clicked.connect(self.show_replies)
+        self.show_replies_button.setEnabled(comment.replies_amt > 0)
         self.write_comment_button.clicked.connect(self.write_comment)
 
     def write_comment(self):
-        self.write_comment_section.addWidget(WriteCommentWidget(self, self.comment))
+        self.writing_section = WriteCommentWidget(self, self.comment)
+        self.write_comment_section.addWidget(self.writing_section)
+        self.write_comment_button.setEnabled(False)
+        self.writing_section.finished.connect(lambda: 
+            self.write_comment_button.setEnabled(True)
+            )
     
     def show_replies(self):
         for comment in self.comment.replies:

+ 0 - 5
lyberry_qt/conf.toml

@@ -1,5 +0,0 @@
-player_cmd = "xdg-open {}"
-viewer_cmd = "xdg-open {}"
-lbrynet_api = "http://localhost:5279"
-comment_api = "https://comments.odysee.com/api/v2"
-

+ 3 - 0
lyberry_qt/connect.py

@@ -22,12 +22,15 @@ class Connector(QObject):
                 break
 
 class ConnectingWidget(QtWidgets.QDialog):
+    change_url = pyqtSignal(str)
+
     def __init__(self, lbry):
         super(ConnectingWidget, self).__init__()
         loadUi(relative_path('designer/connecting.ui'), self)
         self._lbry = lbry
         self.reconnect_button.clicked.connect(self.reconnect)
         self.thread = QThread()
+        self.url = 'about:connecting'
 
     def reconnect(self):
         self.status.setText('RECONNECTING')

+ 20 - 5
lyberry_qt/designer/account.ui

@@ -28,11 +28,26 @@
     </widget>
    </item>
    <item>
-    <layout class="QVBoxLayout" name="acc_list_section">
-     <item>
-      <layout class="QHBoxLayout" name="horizontalLayout_2"/>
-     </item>
-    </layout>
+    <widget class="QScrollArea" name="scrollArea">
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="scrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>376</width>
+        <height>185</height>
+       </rect>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <layout class="QVBoxLayout" name="acc_list_section"/>
+       </item>
+      </layout>
+     </widget>
+    </widget>
    </item>
    <item>
     <widget class="QLabel" name="label_add_acc">

+ 3 - 0
lyberry_qt/designer/channel.ui

@@ -85,6 +85,9 @@
              <property name="text">
               <string>Description</string>
              </property>
+             <property name="textInteractionFlags">
+              <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+             </property>
             </widget>
            </item>
           </layout>

+ 6 - 3
lyberry_qt/designer/comment.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>366</width>
-    <height>92</height>
+    <width>431</width>
+    <height>209</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -26,7 +26,7 @@
       <bool>true</bool>
      </property>
      <property name="openExternalLinks">
-      <bool>true</bool>
+      <bool>false</bool>
      </property>
      <property name="textInteractionFlags">
       <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
@@ -50,6 +50,9 @@
      </item>
      <item>
       <widget class="QPushButton" name="show_replies_button">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
        <property name="text">
         <string>replies</string>
        </property>

+ 0 - 0
lyberry_qt/designer/following.ui


部分文件因文件數量過多而無法顯示