Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-25-2024, 07:32 AM   #1
feuille
Connoisseur
feuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enough
 
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
Value for QSpinBox in calibre/src/calibre/gui2/metadata/config.py

Hello Kovid,

in calibre/src/calibre/gui2/metadata/config.py the max value for the number option (spin box) is not set:

Code:
class ConfigWidget(QWidget):
...
def create_widgets(self, opt):
        val = self.plugin.prefs[opt.name]
        if opt.type == 'number':
            c = QSpinBox if isinstance(opt.default, numbers.Integral) else QDoubleSpinBox
            widget = c(self)
            widget.setValue(val)
So the max value, that is visible in the generated config GUI, is set to the default value for QSpinBox (99), as indicated in the Qt docs (https://doc.qt.io/qtforpython-5/PySi.../QSpinBox.html).

Could you please add the statement:
Code:
            widget.setMaximum(val)
to let the user increase the default value?

Thanks!
feuille is offline   Reply With Quote
Old 08-25-2024, 08:07 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The best way to make something like this happen is to do it yourself in a forked source repo, test it, then submit a PR to Kovid. That process permits detailed discussion, keeps a trace of who did what, and as a side benefit runs the unit tests.

I do this by using a forked repo on github then a checked-out repo on my local machine. I pull all changes into the github fork, pull changes to the local repo, do the work, push the changes back, then submit the PR from github.
chaley is offline   Reply With Quote
Advert
Old 08-25-2024, 12:06 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,540
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...b5d817b2c60415
kovidgoyal is online now   Reply With Quote
Old 08-26-2024, 07:37 AM   #4
feuille
Connoisseur
feuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enoughfeuille will become famous soon enough
 
Posts: 59
Karma: 666
Join Date: May 2020
Location: Germany
Device: android smartphone + tablet
Wow!

Quote:
Originally Posted by kovidgoyal View Post
Thanks, Kovid, for the quick (and certainly better) solution!
feuille is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relocate calibre config folder Mervian Calibre 3 09-03-2015 03:00 PM
Recover Calibre config settings from XP? wendy5 Calibre 17 05-28-2014 06:05 PM
ZipImportError: can't find module calibre.gui2.preferences.behavior mom34spartan Library Management 2 07-19-2013 10:56 PM
Bug: Calibre doen't include 'src' in css adrian783 Calibre 0 07-05-2010 11:57 PM
Media/Calibre Error GUI2 kassa Calibre 5 06-04-2009 08:43 PM


All times are GMT -4. The time now is 02:19 AM.


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