View Single Post
Old 10-26-2013, 05:09 PM   #1
At_Libitum
Addict
At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.At_Libitum ought to be getting tired of karma fortunes by now.
 
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.
At_Libitum is offline   Reply With Quote