steemdesktop - new layout and account history of the last 24h is shown

in #utopian-io7 years ago (edited)

Repository

https://github.com/holgern/steemdesktop

steemdesktop

steemdesktop is a new Qt5 python app that allows it to check the current state of an steem account.

New features

Qt designer is used to layout the application

image.png

I'm using now Qt designer to layout all the widget for Mainwindow.
The ui file can then be converted into a py file by:

pyuic5 ui/mainwindow.ui -o src/main/python/ui_mainwin
dow.py

This py file is then included and added to the main window by:

from ui_mainwindow import Ui_MainWindow

and

class MainWindow(QMainWindow, Ui_MainWindow):
    def __init__(self):
        super(QMainWindow, self).__init__()
        # Set up the user interface from Designer.
        self.setupUi(self)

I added two progressbars for showing the vote power and the available RC. The SP/SBD/STEEM balance is shown using three QLabels. The upvote of the last 24 hours are shown in a QListWidget. Curation rewards and author rewards are shown below.

Using a QRunnable to prevent GUI blocking

I'm using the following class to automatically let a function run in a thread, in order to prevent gui blocking.

class Worker(QRunnable):
    '''
    Worker thread

    Inherits from QRunnable to handler worker thread setup, signals and wrap-up.

    :param callback: The function callback to run on this worker thread. Supplied args and 
                     kwargs will be passed through to the runner.
    :type callback: function
    :param args: Arguments to pass to the callback function
    :param kwargs: Keywords to pass to the callback function

    '''

    def __init__(self, fn, *args, **kwargs):
        super(Worker, self).__init__()
        # Store constructor arguments (re-used for processing)
        self.fn = fn
        self.args = args
        self.kwargs = kwargs

    @pyqtSlot()
    def run(self):
        '''
        Initialise the runner function with passed args, kwargs.
        '''
        self.fn(*self.args, **self.kwargs)

The usage is then:

self.threadpool = QThreadPool()
worker = Worker(self.refresh_account)
self.threadpool.start(worker)   

In this case, the refresh_account function is started in a new thread.

Parse and show account history of the last 24 hours

I'm continuously parse the account history every 15 s of the last 24 hours. Only new ops are stored and displayed.

image.png

The block number, trx index, op index and the virtual op index is stored in self.append_hist_info
and used to skip older operations when starting from start_block - 3. This allows it reduce the number of api calls by preventing to reload the account history every time. The account history index itself is not reliable.

    def append_account_hist(self):
        start_block = self.append_hist_info["start_block"]
        trx_ids = self.append_hist_info["trx_ids"]
        for op in self.hist_account.history(start=start_block - 3, use_block_num=True):
            if op["block"] < start_block:
                continue
            elif op["block"] == start_block:
                if op["trx_id"] in trx_ids:
                    continue
                else:
                    trx_ids.append(op["trx_id"])
            else:
                trx_ids = [op["trx_id"]]

            start_block = op["block"]
            self.account_history.append(op)        
        self.append_hist_info["start_block"] = start_block
        self.append_hist_info["trx_ids"] = trx_ids

Printing a notification on every new account history operation

When the check box is set, a notification is send on every new account history op.
image.png

Deploy binaries for linux and osx

image.png

Finally, I managed it to automatically upload binaries for osx and linux. They can be downloaded from https://github.com/holgern/steemdesktop/releases

Roadmap

I'm planing store the complete account history in a file and use the account history for some calculations:

  • curation rewards
  • reputation over time
  • SP over time
    I'm also planing to enhance the notification system and to parse all steem blocks. This allow it to show mentions and other thinks.

Commits

Simplify and improve all account history functions

Move account refresh and update account hist to threads

  • commit e7b210a
  • New Worker class for running function in a thread
  • timer call now the thread function, which prevent gui freezing
  • The account history of the last 24 h is now loaded not at once, only new ops are loaded

Display account history of the last 24 hours

Use qtdesigner to generate layout

  • commit c04a832
  • show vote power, RC and balances
  • latest upvotes, curation and author rewards
  • layout is generated from ui file

GitHub Account

https://github.com/holgern

Sort:  
  • Great article with lots of images, code samples and explanations.
  • Great use of your knowledge of Python to further Steem
  • And I discovered something new: curl --upload-file "$BUILD" https://transfer.sh/

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @helo! Keep up the good work!

Great project @holger80, looking forward to this getting more and more new features :) A live feed of new activity related to one or multiple accounts would be marvelous, if you want to f.e. watch the @nextcolony bidding ;)

I will add some options for filtering and improve the notification layout for the different op types in the next release.
Watching multiple accounts is a good feature,I will work on it :).

I think this has the potential of being kind of a big deal. I suspect when someone is on an exchange, deciding which token to speculate on, some potental speculators look at the coin’s wallet before buying. They kinda hit a small snag when researching Steem.

They might spend, at most, 5 minutes of research in this area, per coin. And I don’t think they pull the trigger on Steem because all of the wallets are either web based or content centric.

If there was a windows wallet that looked as close as possible as a bitcoin-qt style wallet, I bet that would be enough for that class of users to get onboard.

For this to be even more effective, it’d also be nice if the blockchain supported anonymous public/private key addresses for sending/receiving funds, i.e., addresses unrelated to full accounts.

That would be neat if you could use this to watch several accounts at once in on location.

Definitely something thats interesting and I dont think any other options currently have that capabillity.

Something else that would be intereting if this displayed an "alert" when a power down was started. Could be a quick glance for people to use to ensure there account hasnt been compromised.


Everything is okay! 👌


You received an automatic vote, because I believe in you and I love what you create! ;)

A huge hug from @amico! 🤗

😍 I love promoting @steembasicincome sharing my !sbi status 😜
If you dislike it, please let me know: thanks! 🙏

Hi @amico!

  • you have 168 units and 702 bonus units
  • your rshares balance is 2688547579534 or 1.865 $
  • your next SBI upvote is predicted to be 0.373 $

Structure of your total SBI vote value:

  • 9.11 % has come from your subscription level
  • 83.75 % has come from your bonus units
  • 6.62 % has come from upvoting rewards
  • 0.52 % has come from new account bonus or extra value from pre-automation rewards


    A pending upvote balance is tracked for you in our database. Each time you post, your balance is drawn down by up to 20%. If you post again before that amount is replenished, your next upvote will be smaller. Our minimum upvote for posts is $0.012. Your balance accumulates until a minimum upvote can be delivered with 20% of your pending balance.

Hey @amico, we are trying very hard to keep our status lookup tools from creating an excessive amount of blockchain spam. If you are auto-posting regularly, can you please leave our status calls out of it?

Thanks!

#sbi-skip

Oh yes, for sure!
Thanks for letting me know.

A huge hug
@amico

Nice history

Posted using Partiko Android

Congratulations @holger80! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 25000 upvotes. Your next target is to reach 30000 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

3 years on Steem - The distribution of commemorative badges has begun!
Happy Birthday! The Steem blockchain is running for 3 years.
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Hi @holger80!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hi, @holger80!

You just got a 2.96% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hey, @holger80!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!