ralsina / aranduka

Automatically exported from code.google.com/p/aranduka
0 stars 1 forks source link

Abstraction of basic UI stuff like modals #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We could create a basic core module to do some UI stuff that is repeated in 
many places. I'm currently thinking of displaying modals with messages for the 
user or asking for confirmation (QMessageBox), but it could be extended to 
other stuff.

For example, some plugins that don't have a UI (like the OPDS publisher) may 
need to display some messages to the user in case of error, or to show some 
information (like the URL where the catalog is published). With this module we 
could have all these type of messages centralized and let the plugin forget 
about importing Qt's modules. 

Needless to say, it would also help us repeat less code.

What do you think? What would you call it?

Original issue reported on code.google.com by andresgattinoni on 1 Feb 2011 at 7:01

GoogleCodeExporter commented 9 years ago
I don't know. Isn't QMessageBox enough? If the plugin is out-of-process it 
can't use it but it can't call our abstraction either.

Original comment by roberto.alsina on 1 Feb 2011 at 7:15

GoogleCodeExporter commented 9 years ago
Maybe I'm too crazy about abstraction and wrappers. Whenever I see that I call 
the same "external" function (external to my code) many times, I try to create 
some sort of wrapper, so that it's easier to make any changes afterwards when 
the code gets larger.
Maybe it's too much here, but sometimes it's helpful. 

Original comment by andresgattinoni on 1 Feb 2011 at 7:24

GoogleCodeExporter commented 9 years ago
I would see the point if we wanted to abstract away PyQt as a whole, but I 
don't see us doing that :-)

Other than that, it would be a wrapper around QtGui.QMessageBox that would look 
a lot like it, I think.

Original comment by roberto.alsina on 1 Feb 2011 at 7:37

GoogleCodeExporter commented 9 years ago
Ok, we can revisit this issue in the future if we need some common action to 
take place before or after showing a modal, or if I come up with something else 
that could be added to the "ui stuff" module. I'm closing the issue.

Original comment by andresgattinoni on 1 Feb 2011 at 10:40