View Single Post
Old 03-06-2024, 07:32 PM   #1291
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: 11,173
Karma: 77304081
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
From smarteject_plugin.py is the option to display a prompt if the user attempts to ejected with unsynced books on a Reading List:


Code:
        if 'Reading List' in self.gui.iactions and prefs['checkreadinglistsync']:
            rl_plugin = self.gui.iactions['Reading List']
            list_names = rl_plugin.get_list_names(exclude_auto=True)
            all_list_names = rl_plugin.get_list_names(exclude_auto=False)
            auto_list_names = list(set(all_list_names) - set(list_names))
            if self.gui.device_manager.is_device_connected:
                sync_total = rl_plugin._count_books_for_connected_device()
                rl_plugin.sync_now_action.setEnabled(bool(sync_total > 0) or len(auto_list_names) > 0)
                if sync_total > 0:
                    if question_dialog(self.gui, _("Sync Reading List?"), _("There are books that need syncing according to Reading List.<p>Sync Books?"), show_copy_button=False):
                        rl_plugin.sync_now(force_sync=True)
                        return
Would it be possible to use something like this in Action Chains? For simplicity, just halt the chain and inform user if there's unsynced books.

Last edited by ownedbycats; 03-06-2024 at 07:44 PM.
ownedbycats is online now   Reply With Quote