![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 265
Karma: 724240
Join Date: Aug 2013
Device: KyBook
|
Continuable dialog in plugin
I am confronted with the following.
In my ereader I have the option to turn on/off iTunes File sharing. When it is turned off, I can still access the native database and library to import books into Calibre, so when iTunes Sharing is disabled the plugin is going to be switched to Read-Only mode. However, I would like to put up a notification dialog telling so. I've tried info_dialog, but this derives from message_box and I always get a type error when passing self as first argument (the parent). I've also looked at UserFeedback, but this one aborts further execution and therefore does not give the wanted result. The dialog needs to be called when inside the book function (which is a job controled function I believe) and so far I have not had much success finding a dialog function in the code that does what I want. Is there a plugin using a continuable warning dialog that I can look at to see what other options I may have? Dialog needs only to inform. info_dialog seems to be the best option but the first argument is giving me a headache. According to source it calls message_box with self as first argument and also is called itself in this manner. from what I can see. But every time I do the same, that type error pops up called as Code:
info_dialog(self, 'Warning', 'Read-Only Mode' , 'It appears that iTunes Sharing is disabled.\nYou will not be able to uploade books.\Only import books into Calibre' ).show() Code:
File "Y:\Code\calibre\src\calibre\gui2\__init__.py", line 347, in info_dialog File "Y:\Code\calibre\src\calibre\gui2\dialogs\message_box.py", line 29, in __init__ TypeError: QDialog(QWidget parent=None, Qt.WindowFlags flags=0): argument 1 has unexpected type 'iOSReaderApp' Last edited by At_Libitum; 10-26-2013 at 05:25 PM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use self.gui not self
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with dialog... | VydorScope | Writers' Corner | 9 | 06-14-2013 09:57 PM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 02:24 AM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |
A dialog with Borders | Taylor514ce | Sony Reader | 45 | 06-19-2008 11:04 PM |