![]() |
#436 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: When using single field edit > marked, is there any way to just set an undefined mark? Mostly just out of curiosity, it's probably easier to just put in "cleanup" or "name of chain" in predefined.
Also, I am not sure what is going on here with the menus but it doesn't feel intended: Last edited by ownedbycats; 03-26-2021 at 04:41 AM. |
![]() |
![]() |
![]() |
#437 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#438 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Now I am curious whether this is epoch time...
|
![]() |
![]() |
![]() |
#439 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
|
![]() |
![]() |
![]() |
#440 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#441 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Quote:
Edit: I can replicate that now. Last edited by capink; 03-26-2021 at 05:06 AM. |
||
![]() |
![]() |
![]() |
#442 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I was under the impression that epoch time was specifically *nix (January 1, 1970) while Windows uses FILETIME (January 1, 1601). I may be mistaken on the exact terms though
|
![]() |
![]() |
![]() |
#443 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
Code:
{ "Confirmation": "from PyQt5.Qt import QWidget, QVBoxLayout, QGroupBox, QTextEdit\n\nfrom calibre.gui2 import question_dialog\nfrom calibre_plugins.action_chains.actions.base import ChainAction\n\nclass ConfirmConfigWidget(QWidget):\n def __init__(self, plugin_action):\n QWidget.__init__(self)\n self._init_controls()\n\n def _init_controls(self):\n\n l = QVBoxLayout()\n self.setLayout(l)\n\n gb = QGroupBox('Confirm message')\n gb_l = QVBoxLayout()\n gb.setLayout(gb_l)\n\n self.tb = QTextEdit()\n self.tb.insertPlainText('Are you sure you want to proceed?')\n\n gb_l.addWidget(self.tb)\n l.addWidget(gb)\n\n def load_settings(self, settings):\n if settings:\n self.tb.setText(settings['message'])\n\n def save_settings(self):\n settings = {}\n settings['message'] = self.tb.toPlainText()\n return settings\n\nclass MyAction(ChainAction):\n\n name = 'Confirm'\n\n def config_widget(self):\n return ConfirmConfigWidget\n\n def run(self, gui, settings, chain_loop):\n message = settings.get('message', 'Are you sure you want to proceed?')\n if not question_dialog(gui, _('Are you sure?'), message, show_copy_button=False):\n raise chain_loop.UserInterrupt\n", "Open Tag Manager": "from PyQt5.Qt import (QApplication, Qt, QWidget, QVBoxLayout, QGroupBox, QComboBox)\n\nfrom calibre.gui2.dialogs.tag_editor import TagEditor\nfrom calibre_plugins.action_chains.actions.base import ChainAction\n\ndef get_possible_cols(db):\n fm = db.field_metadata.custom_field_metadata()\n cols = [ col for col, cmeta in fm.items() if cmeta['is_multiple'] ]\n cols = [ col for col in cols if fm[col]['datatype'] not in ['composite',None] ]\n cols.insert(0, 'tags')\n return cols\n\nclass ItemEditorConfig(QWidget):\n def __init__(self, plugin_action):\n QWidget.__init__(self)\n self.plugin_action = plugin_action\n self.gui = plugin_action.gui\n self.db = self.gui.current_db\n self.possible_cols = self.get_possible_cols()\n self._init_controls()\n\n def _init_controls(self):\n self.blockSignals(True)\n l = QVBoxLayout()\n self.setLayout(l)\n\n col_box = QGroupBox(_('Choose column:'))\n col_box_layout = QVBoxLayout()\n col_box.setLayout(col_box_layout)\n self.col_combobox = QComboBox()\n self.col_combobox.addItems(self.possible_cols)\n self.col_combobox.setCurrentText('tags')\n col_box_layout.addWidget(self.col_combobox)\n l.addWidget(col_box) \n\n l.addStretch(1)\n self.setMinimumSize(300,200)\n self.blockSignals(False)\n\n def get_possible_cols(self):\n return get_possible_cols(self.db)\n\n def load_settings(self, settings):\n if settings:\n self.col_combobox.setCurrentText(settings['col_name'])\n\n def save_settings(self):\n settings = {}\n settings['col_name'] = self.col_combobox.currentText()\n return settings\n\nclass ItemEditorAction(ChainAction):\n\n name = 'Open Tag Manager'\n\n def run(self, gui, settings, chain_loop):\n db = gui.current_db\n rows = gui.current_view().selectionModel().selectedRows()\n book_ids = [ gui.library_view.model().db.id(row.row()) for row in rows ]\n\n col_name = settings['col_name']\n if col_name == 'tags':\n key = None\n else:\n key = col_name\n \n if len(book_ids) == 0:\n return\n elif len(book_ids) == 1:\n book_id = book_ids[0]\n else:\n book_id = None\n\n d = TagEditor(gui, db, book_id, key)\n QApplication.setOverrideCursor(Qt.ArrowCursor)\n try:\n d.exec_()\n finally:\n QApplication.restoreOverrideCursor()\n if d.result() == d.Accepted:\n val = d.tags\n id_map = {book_id: val for book_id in book_ids}\n db.new_api.set_field(col_name, id_map)\n\n del d\n\n def config_widget(self):\n return ItemEditorConfig\n\n def validate(self, settings):\n gui = self.plugin_action.gui\n db = gui.current_db\n if not settings:\n return (_('Settings Error'), _('You must configure this action before running it'))\n col_name = settings['col_name']\n if not col_name in get_possible_cols(db):\n return (_('Column Error'), _('Cannot find a column with name \"{}\" in current library'.format(col_name)))\n return True", "Resort View": "from calibre_plugins.action_chains.actions.base import ChainAction\n\nclass RefreshAction(ChainAction):\n\n name = 'Refresh View'\n\n def run(self, gui, settings, chain_loop):\n gui.current_view().resort()", "view_manager_last_view": "from calibre_plugins.action_chains.templates import TemplateFunction\n\nclass ViewManagerLastVIew(TemplateFunction):\n\n name = 'view_manager_last_view'\n arg_count = 0\n\n def evaluate(self, formatter, kwargs, mi, locals):\n import calibre_plugins.view_manager.config as cfg\n gui = self.plugin_action.gui\n library_config = cfg.get_library_config(gui.current_db)\n return library_config.get(cfg.KEY_LAST_VIEW, '')" } |
|
![]() |
![]() |
![]() |
#444 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Ok, I was able to replicate this and I can see the cause of this. It adds one extra level for every time you open the combobox. Will post a fix shortly.
|
![]() |
![]() |
![]() |
#445 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Edit: Also remove to_timestamp() as format_date() now covers the same functionality. Last edited by capink; 03-26-2021 at 06:24 AM. |
|
![]() |
![]() |
![]() |
#446 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#447 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
|
![]() |
![]() |
![]() |
#448 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Small UI suggestion: Change the tooltip of "Copy menu item row" to "duplicate chain." The wording seems a tiny bit unclear; I thought it would copy the name of the chain.
Also an option to duplicate a specific action in a chain would be helpful sometimes. ![]() |
![]() |
![]() |
![]() |
#449 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,038
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#450 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
![]() That will be simple to do. Should we keep the comments? |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Action Chains Resources | capink | Plugins | 78 | 08-05-2025 04:01 AM |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 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 |