Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-30-2020, 03:03 PM   #61
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
The main thing I noticed is that the "Add Actions" window is initially very tiny and I had to widen it to even be able to see the comments and error columns, but that might be because the settings carried over from the old version.
Yes, it remembers the size from the last time.

Quote:
Originally Posted by ownedbycats View Post
Personally I'd put "Settings" to the right of "Comment," but that's personal preference. (Making the columns movable would work.)
Maybe sometime in the future. It depends on how difficult is to do it. Never done it before.

Quote:
Originally Posted by ownedbycats View Post
Column widths reset every time I re-open the dialog. Default width for "Action" column is a bit wide too.
I will see what I can do about this.
capink is offline   Reply With Quote
Old 11-30-2020, 03:04 PM   #62
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,552
Karma: 61120499
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
By the way, I switched back to "Show Marked Books" and did a few tests. It seems to be behaving for the most part.
ownedbycats is offline   Reply With Quote
Advert
Old 11-30-2020, 03:10 PM   #63
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
By the way, I switched back to "Show Marked Books" and did a few tests. It seems to be behaving for the most part.
Good to know. If you need an alternative, you can use the selection modifier with the following in the search box:

Code:
marked:true
or if you are using your own text for marking

Code:
marked:mytext
capink is offline   Reply With Quote
Old 11-30-2020, 06:16 PM   #64
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
Personally I'd put "Settings" to the right of "Comment," but that's personal preference. (Making the columns movable would work.)
Making columns movable turned out to be straightforward. I just set a property and qt takes care of the rest. So, it will be in the next release.

Last edited by capink; 11-30-2020 at 06:22 PM.
capink is offline   Reply With Quote
Old 11-30-2020, 07:22 PM   #65
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Custom action to trim covers from selected books

Code:
from functools import partial

from PyQt5.Qt import (QApplication, Qt)

from calibre.gui2 import error_dialog

from calibre_plugins.action_chains.common_utils import DoubleProgressDialog
from calibre_plugins.action_chains.actions.base import ChainAction

class TrimCover(ChainAction):

    name = 'Trim Cover'
    support_scopes = True

    def trim_covers(self, db, book_ids, pbar):

        from calibre.utils.img import (
            image_from_data, image_to_data, remove_borders_from_image
        )
        
        pbar.update_overall(len(book_ids))
        
        for book_id in book_ids:
            cdata = db.new_api.cover(book_id)
            if cdata:
                img = image_from_data(cdata)
                nimg = remove_borders_from_image(img)
                if nimg is not img:
                    cdata = image_to_data(nimg)
                    db.new_api.set_cover({book_id:cdata})
            msg = _('Trimming cover for book_id: {}'.format(book_id))
            pbar.update_progress(1, msg)

    def run(self, gui, settings, chain):
        db = gui.current_db
        book_ids = chain.scope().get_book_ids()

        callback = partial(self.trim_covers, db, book_ids)
        pd = DoubleProgressDialog(1, callback, gui, window_title=_('Trimming ...'))

        gui.tags_view.blockSignals(True)
        QApplication.setOverrideCursor(Qt.ArrowCursor)
        try:
            pd.exec_()

            pd.thread = None

            if pd.error is not None:
                return error_dialog(gui, _('Failed'),
                        pd.error[0], det_msg=pd.error[1],
                        show=True)
        finally:
            QApplication.restoreOverrideCursor()
            gui.tags_view.recount()

Last edited by capink; 07-26-2021 at 02:46 PM.
capink is offline   Reply With Quote
Advert
Old 11-30-2020, 09:04 PM   #66
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,552
Karma: 61120499
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thank you!

What is the extra (default rightmost) column on the Customize Action Chains window for?
ownedbycats is offline   Reply With Quote
Old 11-30-2020, 09:18 PM   #67
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
Thank you!

What is the extra (default rightmost) column on the Customize Action Chains window for?
Right now it is a placeholder because the table is set to stretch the last column to take all the extra space available, so without it you might end up with a very wide settings button.

Can be used in the future for some features I have in mind if necessary (filtering by tags and library availability).

Edit: The customize actions dialog also supports swapping columns, it also saves the last state but only if you press OK, if you press cancel, it does not remember the column state.

Last edited by capink; 11-30-2020 at 09:24 PM.
capink is offline   Reply With Quote
Old 11-30-2020, 09:28 PM   #68
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,552
Karma: 61120499
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I know that JimmXinu had some problems with View Manager and keyboard shortcuts disappearing when switching between libraries, but he put in a pull request to fix that. You should look into that if it's something you plan to implement.
ownedbycats is offline   Reply With Quote
Old 11-30-2020, 09:38 PM   #69
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
I know that JimmXinu had some problems with View Manager and keyboard shortcuts disappearing when switching between libraries, but he put in a pull request to fix that. You should look into that if it's something you plan to implement.
I am aware of that, although I have not looked at the code yet. I am not sure if the way to go is to store the config in the library and use Jim's code, or it leave it in the json file as it is now, with and option to control library availability (default is available for all, with an option to turn on/off availability from within every library)
capink is offline   Reply With Quote
Old 12-02-2020, 08:53 AM   #70
compurandom
Guru
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 918
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
Presumably you haven't found any library destroying bugs. Would you feel comfortable publishing this plugin in the index yet?
compurandom is offline   Reply With Quote
Old 12-02-2020, 09:31 AM   #71
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Yes. The plan is to ultimately publish this when I feel it has been tested enough without major issues.

Our of curiosity, since you frequent these forums, does it make a difference whether you get it from the thread or the updater?
capink is offline   Reply With Quote
Old 12-02-2020, 09:41 AM   #72
compurandom
Guru
compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.compurandom ought to be getting tired of karma fortunes by now.
 
Posts: 918
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
Quote:
Originally Posted by capink View Post
Our of curiosity, since you frequent these forums, does it make a difference whether you get it from the thread or the updater?
It shouldn't, but it does.
compurandom is offline   Reply With Quote
Old 12-02-2020, 11:39 AM   #73
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,552
Karma: 61120499
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
The updater is fewer steps.
ownedbycats is offline   Reply With Quote
Old 12-02-2020, 05:10 PM   #74
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,227
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
I only want to say thank you for the plugin. I've changed a "small" detail and it's working in calibre 4. It has allowed to simplify a lot of repetitive simple edition, so it has been very useful for me.
Terisa de morgan is offline   Reply With Quote
Old 12-02-2020, 05:28 PM   #75
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by Terisa de morgan View Post
I only want to say thank you for the plugin. I've changed a "small" detail and it's working in calibre 4. It has allowed to simplify a lot of repetitive simple edition, so it has been very useful for me.
A pleasure to hear that, you are always welcome.

Open with action would not work with non-ascii paths, this together with my reluctance to test every change on both calibre 4 and 5 lead to it being released under calibre 5 only.

I will try to code in way that keeps it compatible with python2 whenever possible.
capink is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] Editor Chains capink Plugins 82 04-02-2024 10:56 AM
Action Chains Resources capink Plugins 54 01-29-2024 11:24 PM
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB lrpirlet Plugins 2 08-18-2022 03:15 PM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM


All times are GMT -4. The time now is 11:01 PM.


MobileRead.com is a privately owned, operated and funded community.