[OpenSuSE rolling] Missing icons in SSH private key buttons (BiT root)
ont4300 opened this issue ยท 22 comments
I should add that this occurs when running as root... Tom.
I've been thinking though (always dangerous at best!).
If I run backintime-qt_polkit, I am running the backup as root. In this case, I should be using the ssh keys for the root user and not any other user. I cannot change the private key settings. That is, the keys have to be from the root directory. In this case, not showing the symbols for "searching for a key", or "adding a key" would properly be blanked out.
In addition, if I click on where the button where the directory icon would be, the program presents a a directory window that can be scrolled through. However, a selected file is not moved to the private key window, and no hidden files or directories are shown.
I think this is what is going on. Whoever wrote the code was correct in preventing us from making a mistake.
Perhaps some mention of this should be made in the documentation.
Thanks... Tom.
Which desktop environment do you use? KDE, Gnome3...?
Could you please post the output of this diagnostics code here (copy into a terminal):
# Determine the display server
echo $XDG_SESSION_TYPE
# if you are using X11:
pkexec env DISPLAY=$DISPLAY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY python3 -c "from PyQt5.QtGui import QIcon; from PyQt5.QtWidgets import QSystemTrayIcon,QApplication; app = QApplication(['']); print('isSystemTrayAvailable: ' + str(QSystemTrayIcon.isSystemTrayAvailable())); print('Theme name: ' + QIcon.themeName()); print('has theme icon <document-save>: ' + str(QIcon.hasThemeIcon('document-save'))); print('themeSearchPaths: ' + str(QIcon.themeSearchPaths())); print('fallbackSearchPaths: ' + str(QIcon.fallbackSearchPaths()))"
# if you are using Wayland:
pkexec env QT_QPA_PLATFORM=wayland-egl XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY python3 -c "from PyQt5.QtGui import QIcon; from PyQt5.QtWidgets import QSystemTrayIcon,QApplication; app = QApplication(['']); print('isSystemTrayAvailable: ' + str(QSystemTrayIcon.isSystemTrayAvailable())); print('Theme name: ' + QIcon.themeName()); print('has theme icon <document-save>: ' + str(QIcon.hasThemeIcon('document-save'))); print('themeSearchPaths: ' + str(QIcon.themeSearchPaths())); print('fallbackSearchPaths: ' + str(QIcon.fallbackSearchPaths()))"
I suspect missing icons like reported in some other issues (missing tray icon) and need to know the theme settings that lack some icons...
I have looked-up the icon file names in the source code. Could you please check if the icon files exist in your theme's icon folder by showing the output of these commands:
cd /usr/share/icons/hicolor
find | grep folder
find | grep list-add
I expect no exact hits (eg. no folder.png
or list-add.png
)
OK, THX, the reason for the missing icons is:
Not all icon themes include every single icon specified in the FreeDesktop specification.
It is related to #1306 and could be fixed together. In know now what to do to fix the missing icons but the fix will not be as easy as I initially thought (requires a Qt5 object which would create a circular import dependency - it looks like I have to do a bigger refactoring to fix this).
I will try to find a first work-around by setting the fallback icon theme to a most-likely installed one.
Regarding your other findings when you click on the first button to select a private key file:
However, a selected file is not moved to the private key window
Do you mean, the selected file is not put into the "private key" text field after clicking on "Open"?
I could neither reproduce nor see indications for this behavior (running as root) in the source code:
backintime/qt/settingsdialog.py
Lines 1901 to 1910 in 675c8b4
Could you please check this another time and provide more detailed instructions to reproduce this.
and no hidden files or directories are shown.
That is correct and by default. To show hidden files you normally do a right click an check the "show hidden files" box:
it populated the private key box. However, I could not edit the text in the private key box. I guess that is the proper operation.
Yes, editing the private key file URI is not allowed, it is shown read-only and you only change it by selecting another one
(I just realized there seems to be no way to delete it ;-)
I tried clicking the + button but nothing happened. Don't know if that is right.
The "+" button is meant to generate a new PPK and is only possible if you have not yet selected any private key file so this is correct to (even though I don't like disabled button without any indication why it is disabled).
Could you please show me your installed icon themes (because there are two workarounds: 1. Install a supported icon theme like oxygen 2. Add one of your themes that contains our required icons to the list of supported and probed themes):
dir /usr/share/icons
Edit: My workaround would be to change the list of probed themes here in your /usr/share/backintime/qt/icon.py
file:
Lines 19 to 22 in 675c8b4
by adding your installed themes (that contain the missing files - find/grep it) to the list, eg.
for theme in ('ubuntu-mono-dark', 'gnome', 'oxygen', "Adwaita", "breeze", "HighContrast"):
Edit: Could you please show me the active style (part of the "theme") and which styles are really supported on your computer:
# Show active and supported styles in Qt5
pkexec env DISPLAY=$DISPLAY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY python3 -c "from PyQt5.QtGui import QIcon; from PyQt5.QtWidgets import QSystemTrayIcon,QApplication,QStyleFactory; app = QApplication(['']); print(f'QT style: {app.style().objectName()}'); print(f'QT supported styles: {QStyleFactory.keys()}')"
# On my Ubuntu 20.04 with Gnome3:
# QT style: fusion
# QT supported styles: ['Breeze', 'cleanlooks', 'gtk2', 'cde', 'motif', 'plastique', 'qt5ct-style', 'Windows', 'Fusion']
The thing is: Themes must be installed via a (distro) package to have all files available. Qt5 does check this and ignores non-available styles (part of a"theme").
You can enforce a different supported style with this command (and check if all icons are visible in BiT then):
# use a style name from QT supported styles (the name is case-insensitive)
pkexec env QT_STYLE_OVERRIDE=oxygen backintime-qt_polkit --debug
As requested... Tom.
Sorry, I messed up with the GitHub frontend and deleted some parts of your post. This was a mistake. My apologize.
dir /usr/share/icons
drwxr-xr-x 1 root root 70 Nov 15 11:34 oxygen
Although the directory exists the Oxygen icon set does not show up in the KDE Settings program.
I installed oxygen5-icon-theme using Yast, and the icon set showed up (System Settings --> Appearance --> Icons).
the icons now exist in the buttons.
THX for publishing your solution!
I did some tests and think the pure existence of the icon folders does not imply the style/theme is fully installed:
- normally a theme/style must be installed via a (distro) package and support Qt5
- Not every theme/style is available in any environment (eg.
qt5ct
works only on X11, not on Wayland).
So the only reliable diagnostics is to ask Qt5 which styles are available (see the code in the edit of my comment here: #1364 (comment)).
Would it be possible to show me the output of these commands with and without the installed oxygen5-icon-theme
so that I can confirm that my intended fix will work. Sorry for your extra work but I want to be sure about the reason...).
What commands? Running BIT or file listing?
What commands? Running BIT or file listing?
# Show active and supported styles in Qt5
pkexec env DISPLAY=$DISPLAY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY python3 -c "from PyQt5.QtGui import QIcon; from PyQt5.QtWidgets import QSystemTrayIcon,QApplication,QStyleFactory; app = QApplication(['']); print(f'QT style: {app.style().objectName()}'); print(f'QT supported styles: {QStyleFactory.keys()}')"
QT style: fusion
QT supported styles: ['Breeze', 'gtk2', 'Windows', 'Fusion']
Is this with or without oxygen5-icon-theme
because I don't see oxygen
in the list of supported styles?
For me it is interesting to see if the supported styles did change after installing oxygen5-icon-theme
(this requires de-installation of this package to run my script + re-installing it and run my script again).
So, if you want to use the full Oxygen, you have to install both the theme and icon set [2 separate packages].
In this case, installing the icons alone solved the problems of the missing icons on the buttons.
Perfect summary on how to fix this issue ๐
THX a lot for your really great testing support!
I will now prepare a fix for the upcoming BiT release to
- [DONE] improve the debug output
- [CANCELED -> probing improved] disable the internal logic which probes different themes since it may end up in activating a non-installed theme (oxygen)
Lines 19 to 22 in 675c8b4
- [DONE] extend the README.md to describe the dependencies of theme and icon packages
- [POSTPONED] (most-probably) also fix #1306 after having reproduced it (looks like the same underlying problem)
Edit: I have just opened a PR #1367 as "partial fix" adding the "DONE" parts of above list.
The "POSTPONED" parts I will implement separately with #1306 since I need to reproduce the tray icon issues first and then jointly fix it (incl. solving the icon loader issue from described here).
I am closing this now as fixed and will be contained in the next release.
Please open a new issue in case of any problems.