|
2010-07-06
, 17:38
|
Posts: 376 |
Thanked: 56 times |
Joined on Jan 2010
|
#322
|
Sonic, are you scanning books specifically? If so, my ISBN plugin may be helpful; it looks up ISBN/EAN numbers on Amazon. It's successfully looked up every book I've tested so far.
|
2010-07-07
, 09:21
|
Posts: 2,102 |
Thanked: 1,309 times |
Joined on Sep 2006
|
#323
|
The Following User Says Thank You to lardman For This Useful Post: | ||
|
2010-07-07
, 12:27
|
Posts: 252 |
Thanked: 252 times |
Joined on Nov 2009
|
#324
|
Does anyone know of any example code for manipulating the addressbook/contacts list using purely Qt? If so I'd prefer to move to that directly, otherwise I guess it's possible to pull in glib headers, I'll soon find out!
P.S. As long as mbarcode is left open, the .vcf file will be left in ~/.mbarcode/temp/
The plugins system is cool! To get the feel for it, I made a simple plugin to look up ISBN's on Amazon. Is this something Of General Interest?
Also, one code suggestion: it would seem cleaner to pass a QWidget* to initInterface, so each plugin doesn't need to know about mainwindow.h. I'd be happy to do this if you want to give me commit access.
Yes, that does sound reasonable. The portrait support is just how the main page rotates, and in no way designed to be that way on purpose.
Before you start expending time on this though, there was talk of moving to a UI more like that of maemo-mapper - i.e. something pretty and full screen (camera in this case) with buttons as overlays, and then the history/till-roll list could be a pull-out tab (in which case it may be better left as a vertical list, I don't know). Any thoughts in general (from everyone) on whether a prettier UI would be beneficial?
I've just pushed a new version of mBarcode + the plugins.
Now the plugins should depend on mBarcode, and the QRcode plugin should add vCards...
Edit: not all the plugins, the 1D plugin refuses to build and I've no clue why - missing a header which should be pulled in by one of the deps. I'll try to fix that this evening, but in any case not a big problem as there were no changes there other than to the control file.
|
2010-07-07
, 12:58
|
Posts: 252 |
Thanked: 252 times |
Joined on Nov 2009
|
#325
|
I believe our best choice for the future is the Qt Mobility Contacts API. The only problem is that the Qt Mobility library is still only in extras-devel, and thus cannot be moved up to extras testing. Our best choice for now is probably to either use your .vcf workaround or figuring out how to talk directly to the abook.
|
2010-07-07
, 13:03
|
Posts: 111 |
Thanked: 80 times |
Joined on Oct 2009
|
#326
|
Thanks! I think passing a QWidget* might be a solution, but you would have to cast it to a MainWindow (which is going to be renamed to something less general very soon) if you want to use the functions/data in the class. I don't really know which gives the most overhead, and I suggest that we continue to "know about" the main app unless it is causing any big problems(?).
|
2010-07-07
, 13:12
|
Posts: 252 |
Thanked: 252 times |
Joined on Nov 2009
|
#327
|
My thinking was that if it's really a "plugin", it shouldn't be accessing anything from the class (yes, it needs to connect to the barcodeDecoded function, but that doesn't need to pointer; that's the magic of Qt's slots/signals.)
At least, none of the current plugins require anything from the MainWindow class...
|
2010-07-07
, 13:28
|
Posts: 111 |
Thanked: 80 times |
Joined on Oct 2009
|
#328
|
You're right about that there are no plugins using anything but the signal as of now, I just thought it could be useful for some plugins to have access to more data from there. I might be wrong, though
How would you go about and do the connection without passing down a MainWindow class pointer? Is it enough with the QWidget* to do that?
|
2010-07-07
, 13:33
|
Posts: 252 |
Thanked: 252 times |
Joined on Nov 2009
|
#329
|
Yeah, just a QWidget* is enough. I did a quick test earlier, and that worked fine.
|
2010-07-07
, 14:24
|
Posts: 1,096 |
Thanked: 760 times |
Joined on Dec 2008
|
#330
|
In the GTK+ version of mBarcode I called abook functions directly to add the vCard, but getting the abook header to work in a C++ program was throwing up errors.
I therefore decided to write the vCard to a vcf file and open it using the mime handlers (which works in the filemanager for example), however, if I try to call uri_open directly it just does nothing, and if I use the QDesktopServices:penURL() function then it just opens the vCard in the browser as text (even though the implementation and docs look as though it should open the file with the correct handler app).
Any help/ideas gratefully accepted.
P.S. As long as mbarcode is left open, the .vcf file will be left in ~/.mbarcode/temp/