Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[desktopintegration] kdialog error? #116

Open
probonopd opened this issue Oct 27, 2016 · 21 comments
Open

[desktopintegration] kdialog error? #116

probonopd opened this issue Oct 27, 2016 · 21 comments

Comments

@probonopd
Copy link
Member

AppImage/AppImageKit@b313884#commitcomment-19587596

probonopd referenced this issue in AppImage/AppImageKit Oct 27, 2016
@darealshinji
Copy link
Contributor

What about adding your own copy of a dialog program? YAD is lightweight, portable and depends only on GTK2 libs. Or I could try to write something using fltk, similar to what I've been working on here. fltk is very small and made for static linking.

@probonopd
Copy link
Member Author

probonopd commented Nov 20, 2016

Can you post a hello world with fltk? Could it be used to be embedded right into runtime.c even?

@darealshinji
Copy link
Contributor

Here's a very simple dialog tool using fltk: https://gist.github.com/darealshinji/74985e3474574fc2bee456555a27b517
Note: fltk uses C++

Runtime dependencies in this case are:

libX11.so.6
libXext.so.6
libpthread.so.0
libXinerama.so.1
libXfixes.so.3
libXcursor.so.1
libXft.so.2
libXrender.so.1
libfontconfig.so.1
libdl.so.2
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libc.so.6

spectacle v31852

@probonopd
Copy link
Member Author

Thanks for the example, look and feel is a bit non-native, still wondering if there are no more straightforward native solutions.

@darealshinji
Copy link
Contributor

darealshinji commented Jun 7, 2017

The problem here is KDE. Qt dialogs have a native look and feel to KDE but not to other environments, and they may not even run unless Qt libraries are already installed. GTK+ on the other side may look really ugly on KDE. The solution would be either to write two dialog tools and figure out at runtime whether we're on KDE or not, or you can use a toolkit like FTLK which is small, portable and requires only X11 libs.

edit:

Maybe this looks better:

shot

Usage: ./appimage_dialog --message="Do you want to install desktop integration?" --title="Desktop Integration" --button1="Yes" --button2="No"

Code: https://gist.github.com/darealshinji/fe1845d4c90d62eee92c6bcf2860d2c3

@probonopd
Copy link
Member Author

Thanks @darealshinji. Much better, but still not really "native" looking. I need to play with it a bit under different Gtk+/KDE themes.

@lurch
Copy link

lurch commented Jun 7, 2017

Looks very similar to https://en.wikipedia.org/wiki/Zenity but I've no idea how well Zenity performs / looks on different desktop environments.

EDIT: Doh! I must have been thinking of a different project. I forgot AppImages use zenity already, apologies for the noise ;-)

@darealshinji
Copy link
Contributor

A little update: https://gist.github.com/darealshinji/fe1845d4c90d62eee92c6bcf2860d2c3

shot

I hope this looks better. Options are:

  --title=TITLE
  --message=MESSAGE
  --button1=LABEL
  --button2=LABEL

Use only --button2 if you want just 1 button.

By the way, unless you use the native toolkit (Qt4, Qt5, GTK2, GTK3) it will never look 100% native.

@darealshinji
Copy link
Contributor

What about a radio button list, so you would only need 1 window to pop up?

list

Though I must admit that all solutions have a "lot of" text, which may be an issue for people that are not good in English. Maybe a combination of short, clear hints and pictograms could do it.

@probonopd
Copy link
Member Author

Perhaps:

Do you want to...

3 buttons:
[Never] [No] [Yes]

@darealshinji
Copy link
Contributor

darealshinji commented Jun 24, 2017

Here's my new draft, including an attempt to do some localization.
Usage is ./appimage_dialog AppName

source

dlg

@darealshinji
Copy link
Contributor

What about this? Can be set via command line to either use the system colors or the blue from the AppImage icon. Icons are LGPL licensed. And the red button actually drops down when you press it.

dialog

@probonopd
Copy link
Member Author

probonopd commented Jul 10, 2017

Wow, looks impressive. I'd use the system color version but without the red X.

The second entry should be "Create menu entry and launch app".

@darealshinji
Copy link
Contributor

darealshinji commented Jul 10, 2017

Should I change the close button or should the window just use the window manager decoration instead? (you can actually drag the window by clicking on the background)

@probonopd
Copy link
Member Author

I'd say window manager decoration

@darealshinji
Copy link
Contributor

Yeah, I'd say so too. I've attached the sources and the tool.
First argument will be the window title, otherwise it defaults to "AppImage".
Return values are: launch app -> 0, menu entry -> 1, disable message + launch app -> 2, close window -> 3.

appimage-dialog.zip

@darealshinji
Copy link
Contributor

@darealshinji
Copy link
Contributor

Here are all source and images files, licenses and a build script: https://github.com/darealshinji/AppImageKit/tree/appimage-dialog

@probonopd
Copy link
Member Author

probonopd commented Jul 14, 2017

Thank you. Would you like to add the logic from the old desktopintegration bash script?

@darealshinji
Copy link
Contributor

I haven't tested it but I think this should work: https://gist.github.com/darealshinji/25cce18c4a8d6c9baae86f214de9c923#file-desktopintegration-sh-L203

Scroll down the revisions if you want to see the important changes: https://gist.github.com/darealshinji/25cce18c4a8d6c9baae86f214de9c923/revisions

@darealshinji
Copy link
Contributor

Source files and build script added to AppImageKit: https://github.com/darealshinji/AppImageKit/tree/appimagetool_master_fltk
I could make a PR if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants