← Back to team overview

qpdfview team mailing list archive

Re: Single instance on Windows

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Razi,

Am 19.11.2014 um 18:40 schrieb Seyyed Razi Alavizadeh:
> Hello again,
> 
> D-Bus is available on Windows AFAIK, c.f. [1]. Of course, it isn't
>  installed (and probably setup?) by default.
> 
> 
> Yes, but it's not out of the box, user have to install and setup 
> it. Another issue is that QtDBus module is a Unix-only library.

QtDBus being Unix only is definitely a problem...

> The 'Qt single application solution' by Trolltech/Digia is 
> implemented use file system semaphores and sockets if I remember 
> correctly and it would probably be quite a pain to reimplement the 
> IPC functionality of D-Bus using this, so I don't think this is
> too useful.
> 
> 
> The good point about this solution is that it removes dependency on
> "D-Bus" and also works out of the box on Windows although 
> implementing it needs some developing time.

- From the Unix POV, there is absolutely no incentive to remove the
D-Bus dependency. On the contrary the integration with the most common
(and nicely high-level) IPC mechansim makes it very easy for third
party programs to interact with qpdfview. So in any case, I would only
look for a fallback if D-Bus is not available for whatever reason.

> So before we jump right into this, I would further pursue using 
> D-Bus on Windows. Since KDE4 is available on Windows and it uses 
> D-Bus heavily, it must definitely be functional. The question is 
> more whether it needs any special setup and looking at [2], it
> does not seem so.
> 
> 
> Indeed one can uses binary provided by Windows project of KDE4.
> And the setup process is just setting two environment variables
> and auto-start dbus-launch.exe on Windows startup.

Ok, probably nothing a user will do just to install qpdfview. But then
he will usually not grab Poppler and DjvuLibre sources or binaries either?

> The other thing I would check is whether there exists another IPC 
> mechanism on Windows that is as well-integrated into Qt as D-Bus 
> is.
> 
> 
> No.

Ok.

> After searching I found that some users successfully compiled 
> QtDBUS on Windows, it can be done in two ways: (A) Re-configure Qt 
> with "D-Bus" enabled and then recompile Qt. (B) Modify QtDBus 
> source and add #undef QT_NO_DBUS everywhere needed and then
> compile QtDBus. I don't have enough free time and free HD space to
> test solution (A) but for me solution (B) worked successfully (at
> least with qpdfview)

Interesting... What does the KDE for Windows project use as a D-Bus
interface? Does KDE have its own D-Bus wrapper? This would then maybe
be a prime candidate as an alternative to QtDBus? But then most
Windows users prefer the applications shipped as binary installers and
probably would not care how the file "QtDBus.dll" in the program's
folder came into the world?

What I really do not want within qpdfview's code base is code for
marshalling method invocation and arguments into bare strings for
transmission via some basic IPC mechanism.
Especially since every program that would like to use this, would have
to reimplement this low-level stuff as well which is exactly what
D-Bus was supposed to get us rid of. With the current state of
affairs, one can just write a few lines of Python code to get
immediate remote control of D-Bus-enabled applications.

> Since you are probably more or less our only Windows user (We don't
> even provide binaries...), we really have to balance effort versus
> yield here. (Of course, if you do the work, this goes a long way
> towards inclusion, but then I am just not comfortable with carrying
> around such an amount of code (as with DDE) for a rarely (from our
> perspective) platform.)
> 
> 
> Don't you think if we release an un/official installer for Windows 
> then balance will change to Windows side? ;-)

Actually I am not so sure about that since they are much more
well-entrenched alternatives on Windows, e.g. SumatraPDF. So to be
honest, I don't think qpdfview would make the cut if faced with the
Windows competition for most potential users.

> P.S.: What about switching to some nice and cozy Linux distribution
> with D-Bus right out of the box? ;-)
> 
> Good solution :-D (Which distribution is nice and cozy from your 
> point of view? ;-))
> 
> Indeed Windows is my default because it seems BIOS of my laptop is 
> not supported correctly with Linux, but I promise after buying a 
> new laptop my default will be Linux :-D

Really, I don't want to force you to switch or anything. It is just
that Windows is not that important as a platform for a lot of FOSS in
general and qpdfview in particular. And as so much effort is invested
into our common FOSS and FreeDesktop infrastructure, every additional
user of it makes me happy.

As for Linux distributions, I don't have too strong opinions on that.
If you never used one before, just start with something popular like
Ubuntu or Debian and then try a few other ones until you are happy.
Personally, I employ a mixture of Arch Linux and OpenSUSE in my
immediate environment.

> I hope to see Windows binary released officially but if it's not
> in TODO list then at least I'll release it unofficially for my 
> classmates and professors.

As with the MuPDF plug-in, the only reason there is no "official"
Windows binary, is that there has not been a maintainer stepping up
and pledging him/herself to provide. We did build Windows binaries
some time ago just to try it out, but currently I do not have regular
access to a (virtual) machine running Windows, so I definitely can't
do it and as per above, I also don't think the potential Window user
base is very large.

> Best Regards, Razi.

Best regards, Adam.

P.S.: "official" is what we declare official. An installer that is
downloadable via Launchpad and signed by your private key would
definitely be official enough for my purposes.

> 2014-11-18 22:22 GMT+03:30 Adam Reichold <adam.reichold@xxxxxxxxxxx
> <mailto:adam.reichold@xxxxxxxxxxx>>:
> 
> Hello Razi,
> 
> Am 18.11.2014 um 13:04 schrieb Seyyed Razi Alavizadeh:
>> Hello Adam,
> 
>> It seems qpdfview uses DBUS for lots of things specially for 
>> running as a single instance application, but DBUS is available 
>> just in UNIX world. What's your idea about Windows?
> 
> D-Bus is available on Windows AFAIK, c.f. [1]. Of course, it isn't
>  installed (and probably setup?) by default.
> 
>> There are some solutions available for single instance Qt 
>> applications we can use one of them or maybe as a more general 
>> option we can use DDE [1] and re-implement all features available
>> through DBUS by using DDE for Windows, and indeed I also found an
>> interface class for using DDE in Qt applications [2].
> 
> The 'Qt single application solution' by Trolltech/Digia is 
> implemented use file system semaphores and sockets if I remember 
> correctly and it would probably be quite a pain to reimplement the 
> IPC functionality of D-Bus using this, so I don't think this is
> too useful.
> 
> Looking at the DDE wrapper, it seems just as low-level as the above
> solution, I don't think reimplementing the D-Bus functionality
> using this makes too much sense as D-Bus and in extension QtDBus
> mapping the Qt type system to the D-Bus one are there to solve
> exactly these kind of problems generically instead of each
> application reinventing the wheel.
> 
> So before we jump right into this, I would further pursue using 
> D-Bus on Windows. Since KDE4 is available on Windows and it uses 
> D-Bus heavily, it must definitely be functional. The question is 
> more whether it needs any special setup and looking at [2], it
> does not seem so.
> 
> The other thing I would check is whether there exists another IPC 
> mechanism on Windows that is as well-integrated into Qt as D-Bus 
> is.
> 
> Since you are probably more or less our only Windows user (We don't
> even provide binaries...), we really have to balance effort versus
> yield here. (Of course, if you do the work, this goes a long way
> towards inclusion, but then I am just not comfortable with carrying
> around such an amount of code (as with DDE) for a rarely (from our
> perspective) platform.)
> 
> Best regards, Adam.
> 
> P.S.: What about switching to some nice and cozy Linux distribution
> with D-Bus right out of the box? ;-)
> 
> [1] http://www.freedesktop.org/wiki/Software/dbus/#index6h1 [2] 
> http://poquitopicante.blogspot.ca/2012/07/building-dbus-python-on-windows-with.html
>
>
> 
>> [1] http://en.wikipedia.org/wiki/Dynamic_Data_Exchange [2] 
>> https://dl.dropbox.com/u/7323096/DDE/ddecomm.zip
> 
>> Best Regards, Razi
> 
>> Alavizadeh, Sayed Razi My Blog: http://pozh.org 
>> <http://pozh.org/> Saaghar (????????? ???): 
>> http://saaghar.pozh.org/ Saaghar Fan Page: 
>> http://www.facebook.com/saaghar.p Saaghar Mailing List: 
>> http://groups.google.com/group/saaghar
> 
> 
> 
> 
> -- Mailing list: https://launchpad.net/~qpdfview Post to     : 
> qpdfview@xxxxxxxxxxxxxxxxxxx <mailto:qpdfview@xxxxxxxxxxxxxxxxxxx>
>  Unsubscribe : https://launchpad.net/~qpdfview More help   : 
> https://help.launchpad.net/ListHelp
> 
> 
> 
> 
> -- Alavizadeh, Sayed Razi My Blog: http://pozh.org 
> <http://pozh.org/> Saaghar (نرم‌افزار شعر): 
> http://saaghar.pozh.org/ Saaghar Fan Page: 
> http://www.facebook.com/saaghar.p Saaghar Mailing List: 
> http://groups.google.com/group/saaghar
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJUbNweAAoJEPSSjE3STU34sIAIAMUg9TjSRoE16R+4FMb40iJW
XXtwpUSxg5USlMV75jxcwjTQs7XnF9oGKlSIi46p0Rr4apmox1miexIr0xFPGs1G
+1WnXuKk09PL3TgYAhhTOn9kxurmmnH3SvcjvZLBWgUAn02FB6cEbuis9d0Ys5r3
oJUetqDSDGJ7vTZj4n0NKnrVbo4yET+JE2x+cfx8k3EvX82lJlN0tSGPMWbqIxs3
edGJMmoWvIqdmQwNYgzW59MO2EfVVsxfcT1XowPc1fSJdYulCBIAaOo6hEW/I5R1
ANEFQqGNxIvwxfrOAnovUpsp5CdodfIQtfb9JvMgKKTva+9gqP7uikggV+liA3w=
=3uPy
-----END PGP SIGNATURE-----


References