View Single Post
Old 04-01-2021, 12:38 PM   #475
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,204
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
[LIST][*]The "Chain Variables" action template
Code:
program:
	set_book_vars('sum', sum)
fails with the exception
Code:
Traceback (most recent call last):
  File "...\calibre_dev\src\calibre\utils\formatter.py", line 1098, in expr
  File "...\calibre_dev\src\calibre\utils\formatter.py", line 843, in do_node_func
  File "...\calibre_dev\src\calibre\utils\formatter_functions.py", line 136, in eval_
  File "calibre_plugins.action_chains.templates", line 181, in evaluate
AttributeError: 'ChainInterfaceAction' object has no attribute 'book_vars'
The same thing happens with "Formula" actions.
This is not happening for me. I need the exported chain zip to trigger the error.

Quote:
Originally Posted by chaley View Post
You have a self.resize(700, 750) on line 424 of templates.py. The template dialog now remembers its geometry, so I think you can remove that.
It does not remember the size for me (calibre 5.14) e.g. formulas dialog. If I remove it scrollbars kick in for both directions. I have to resize manually everytime I use the dialog. I just tested again by commenting out the resizing, same result.


Quote:
Originally Posted by chaley View Post
I don't think you need the big "Icons keys" bar across the middle of the Add actions dialog. Use tooltips on the icons in the table.
I will remove the bar. Tooltips are already used.

Quote:
Originally Posted by chaley View Post
I would consider getting rid of the new first-level button dialog, replacing it with top-level menu items. As it is that dialog forces "extra" clicks. The only one missing from the top-level menu is "Keyboard Shortcuts. Reserve "Customize plugin" for when the user is doing something plugin-wide, such as if you add fonts or color schemes. Alternatively use a second-level menu.
As you already pointed all items (except keyboard shortcuts) already have top-level menu items, so no need for extra clicks. The chains dialog now have a separate menu item called "Add/Modify chains".

The button dialog was added not for the buttons, but for setting global options for the plugin. I had one in a transitional version that I removed, but I decided to keep the dialog for future use. If this is confusing, I can hide it until I need it.

Quote:
Originally Posted by chaley View Post
The suggestions are predicated on using two columns for the icons, one for the conditions and one for the scopes.
I intially started this way but I didn't like it and scrapped it. The logic here is I don't want to clutter the table with extra columns, which most probably will not be used by most people (conditions and scopes), as it might add to the confusion. Maybe more people weighing on this would help resolve this issue.



I like your idea of clikcing on icons triggering the appropriate dialogs, but there are two problems with this:
  • As I explained previously, I am not sure about the two column solution. And with one icons column, I do not know how to intercept a click on one of the icons in a cell. I presume this is possible and will look on how to do it. But I am not sure how far I can go with this.
  • The dropdown button while not a pretty solution, has the advantage of allowing setting the same condition/scope for multiple actions at once. This can be replaced by context menu. The current beta already have context menu with add and remove scopes items. I can add two items for conditions as well.

Quote:
Originally Posted by chaley View Post
Don't have an "Action doesn't support scopes" icon. An empty table cell would indicate that no scope can be set
I had this because as I said in the previous paragraph, a user can use the button to set scopes on multiple actions simultaneously, and I wanted to give hints about actions that are not going respond to this. Thought maybe that would be more clear than having a blank cell (while using the negated scope icon for action that support but does not have scopes). I will re-think this.

Quote:
Originally Posted by chaley View Post
You might consider short labels with long tooltips that explain what it means. I think it is impossible to have labels that both are concise and explain what the user needs to know. Tooltips are used as documentation throughout calibre so a calibre user would expect that.
I will shorten the label. But I am still having trouble with explaining book vars in detail.
capink is offline   Reply With Quote