Commit 11eefbc5 authored by Vladislav's avatar Vladislav

Added gui_edit_db_file

parent 9f2a1b18
...@@ -1375,7 +1375,7 @@ pw_init_db () { ...@@ -1375,7 +1375,7 @@ pw_init_db () {
else else
if [[ "${PW_DISABLED_CREATE_DB}" != 1 ]] ; then if [[ "${PW_DISABLED_CREATE_DB}" != 1 ]] ; then
if [[ ! -z "${PORTWINE_DB}" ]] ; then if [[ ! -z "${PORTWINE_DB}" ]] ; then
export PORTWINE_DB_FILE=$(grep -il "\#${PORTWINE_DB}.exe" "${PORT_SCRIPTS_PATH}/portwine_db"/*) export PORTWINE_DB_FILE=$(grep -il "#${PORTWINE_DB}.exe" "${PORT_SCRIPTS_PATH}/portwine_db"/*)
if [[ -z "${PORTWINE_DB_FILE}" ]] ; then if [[ -z "${PORTWINE_DB_FILE}" ]] ; then
{ {
echo "#!/usr/bin/env bash" echo "#!/usr/bin/env bash"
...@@ -3538,7 +3538,10 @@ gui_edit_db () { ...@@ -3538,7 +3538,10 @@ gui_edit_db () {
if check_wayland_session ; then if check_wayland_session ; then
rm_from_var PW_EDIT_DB_LIST "PW_USE_US_LAYOUT" rm_from_var PW_EDIT_DB_LIST "PW_USE_US_LAYOUT"
else
rm_from_var PW_EDIT_DB_LIST "PW_USE_NATIVE_WAYLAND"
fi fi
if check_flatpak ; then if check_flatpak ; then
rm_from_var PW_EDIT_DB_LIST "PW_USE_RUNTIME" rm_from_var PW_EDIT_DB_LIST "PW_USE_RUNTIME"
fi fi
...@@ -3770,8 +3773,8 @@ A brief instruction: ...@@ -3770,8 +3773,8 @@ A brief instruction:
exit 0 exit 0
;; ;;
150) 150)
xdg-open "${PORTWINE_DB_FILE}" & print_info "Restarting PP after update ppdb file..."
exit 0 gui_edit_db_file
;; ;;
esac esac
} }
...@@ -5230,6 +5233,28 @@ gui_open_user_conf () { ...@@ -5230,6 +5233,28 @@ gui_open_user_conf () {
} }
export -f gui_open_user_conf export -f gui_open_user_conf
gui_edit_db_file () {
GUI_EDIT_DB_FILE="$("${pw_yad}" --title="$(gettext "EDIT DB")" \
--text-info --editable --width=800 --height=600 \
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" \
--button="$(gettext "SETTINGS")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"":1 \
--button="$(gettext "SAVE")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"":2 \
--filename="${PORTWINE_DB_FILE}" 2>/dev/null)"
YAD_STATUS="$?"
case "$YAD_STATUS" in
1|252)
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
;;
2)
echo "${GUI_EDIT_DB_FILE}" > "${PORTWINE_DB_FILE}"
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
;;
esac
}
gui_open_scripts_from_backup () { gui_open_scripts_from_backup () {
cd "${PORT_WINE_TMP_PATH}/scripts_backup/" || fatal cd "${PORT_WINE_TMP_PATH}/scripts_backup/" || fatal
PW_SCRIPT_FROM_BACKUP=$("${pw_yad}" --file --width=650 --height=500 \ PW_SCRIPT_FROM_BACKUP=$("${pw_yad}" --file --width=650 --height=500 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment