Skip to content

Commit

Permalink
New features for Linux (HandBrake#4897)
Browse files Browse the repository at this point in the history
* LinGUI: Bump GTK 3 minimum version to 3.22

Should be available in all currently supported distributions.
Also removed conditionals that are no longer needed.

* LinGUI: Bump GTK 4 minimum version to 4.4

GTK 4 support is currently based on a beta version and doesn't work
due to deprecations in the release versions. Further changes are
needed before it will build successfully.

* LinGUI: Use GtkFileChooserNative

When xdg-desktop-portal is available, a dialog native to
the desktop environment is used instead of the GTK one.
Fixes HandBrake#4700

* LinGUI: Refactor Add Multiple dialog

Moves all the code for the Add Multiple dialog from
queuehandler.c to title-add.c and renames functions and
actions to match. This will help make the code easier to
maintain and allow for further improvements.

* LinGUI: Add menu option to Add All items

Adds all titles to the queue immediately. If the destination
filenames are not unique, opens the Add Multiple dialog instead.
Also stops adding items if an error occurs instead of continuing
and creating repeated error messages (Fixes HandBrake#4438).

* LinGUI: Drag and drop support for videos

Drag a video or folder onto the HandBrake window and it will be
scanned as if it had been opened through the file dialog. Works
with most file managers (Nautilus, Dolphin, Nemo, Thunar etc.)
Closes HandBrake#969

* LinGUI: Rearrange Filter tab to match other platforms

* LinGUI: Add XML chapter import and export

- Imports chapter titles only
- Exports full chapter details including time stamps
- Supports the Matroska XML chapter format
- Reads chapters from the default EditionEntry
- Uses the first ChapterString found for each chapter

* LinGUI: Fix symbolic icons on old GTK versions

* LinGUI: Fix function prototype warnings

Fixes most warnings caused by old-style function declarations
and non-static functions with no header declarations.
Warnings were found by compiling in GCC 12 with the flags:
-Wmissing-declarations
-Wmissing-parameter-type
-Wmissing-prototypes
-Wold-style-declaration
-Wold-style-definition
-Wstrict-prototypes

* LinGUI: Use structured logging

Replaces the custom logging functions with standard GLib ones,
using the __func__ macro introduced in C99 for function names.
Instead of using the --debug argument, debug messages are shown if
the environment variable G_MESSAGES_DEBUG is set to 'ghb' or 'all'.

* Linux: Add more diagnostic info to log

Prints the current operating system, kernel version and data
directories to the activity log.

* LinGUI: Use native paths for dropped files

Try to get a native path instead of a URI for files added via
drag and drop so that libhb can access them through GVFS.

* Fix warning if dialog is created with no OK button

* LinGUI: Automatic pause to save battery power

- Listens on DBus for battery status events
- Pauses encoding if unplugged or entering power save mode
- Resumes when power is restored or exiting power save mode
- Encodes can still be started while on battery power
- Doesn't resume when plugged in if paused manually
- Preferences option for pause on unplug

* LinGUI: Run autoupdate to fix configure.ac warnings

* LinGUI: New auto-naming options

{codec} - The codec of the encoded video (such as H.264)
{bit-depth} - The bit depth for the encoded video as an integer
{width} - The storage width of the encoded video
{height} - The storage height of the encoded video
{modification-date} - The modification date of the source file
{modification-time} - The modification time of the source file

* LinGUI: Update translation template

- Rename metainfo template so that gettext recognizes it

* LinGUI: Removed leftover version guards

* Linux: Add CPU info to activity log

- Remove temp dir info as it is often inaccurate

* LinGUI: Miscellaneous fixes

- Free unneeded filename
- Fix XML chapter export crash
- Replace unneeded printf calls with g_debug
- Update deprecated margin-left property

* LinGUI: Access D-Bus asynchronously

* LinGUI: Option to pause on entering power save

* LinGUI: Pause encoding when battery is low

* LinGUI: Tweak power save options

Although there's no option for it in the UI, adding LowBatteryLevel
to preferences.json will set the level at which encoding is paused.

* LinGUI: Update translation files
  • Loading branch information
robxnano authored Feb 21, 2023
1 parent 596ee2d commit 0425ddb
Show file tree
Hide file tree
Showing 79 changed files with 50,404 additions and 36,463 deletions.
34 changes: 20 additions & 14 deletions gtk/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ AM_MAINTAINER_MODE

AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC(gcc clang)
AC_ISC_POSIX
AC_SEARCH_LIBS([strerror],[cposix])
AC_PROG_CXX(g++ clang++)
AM_PROG_CC_STDC
AC_HEADER_STDC

AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
po/Makefile.in
Makefile
Expand All @@ -35,7 +34,7 @@ AC_SUBST(CC_FOR_BUILD)

# introduce the optional configure parameter for the path of libXXX.a
AC_ARG_WITH(hb,
AC_HELP_STRING(
AS_HELP_STRING(
[--with-hb=prefix],
[try this for the hb-library prefix install directory]
),
Expand Down Expand Up @@ -123,7 +122,7 @@ GETTEXT_PACKAGE=ghb
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])

AM_PROG_LIBTOOL
LT_INIT

AC_SYS_LARGEFILE

Expand All @@ -144,16 +143,16 @@ esac

PKG_PROG_PKG_CONFIG

HAVE_GTK_400=0
HAVE_GTK_316=0
HAVE_GTK_4_4=0
HAVE_GTK_3_22=0
if test "x$use_gtk4" = "xyes" ; then
PKG_CHECK_MODULES([gtk], [gtk4 >= 3.92], [HAVE_GTK_400=1], [HAVE_GTK_400=0])
PKG_CHECK_MODULES([gtk], [gtk4 >= 4.4], [HAVE_GTK_4_4=1], [HAVE_GTK_4_4=0])
else
PKG_CHECK_MODULES([gtk], [gtk+-3.0 >= 3.16], [HAVE_GTK_316=1], [HAVE_GTK_316=0])
PKG_CHECK_MODULES([gtk], [gtk+-3.0 >= 3.22], [HAVE_GTK_3_22=1], [HAVE_GTK_3_22=0])
fi

if test "$HAVE_GTK_316" -eq 0 -a "$HAVE_GTK_400" -eq 0 ; then
AC_MSG_ERROR("GTK 3.16 or above is required)
if test "$HAVE_GTK_3_22" -eq 0 -a "$HAVE_GTK_4_4" -eq 0 ; then
AC_MSG_ERROR("GTK 3.22 or above is required)
fi
HB_LIBS="$HB_LIBS $gtk_LIBS"
HB_CPPFLAGS="$HB_CPPFLAGS $gtk_CFLAGS"
Expand All @@ -173,6 +172,13 @@ if test "x$have_gudev" = "xyes" ; then
CFLAGS="$CFLAGS -D_HAVE_GUDEV"
fi

pkg_libxml2="libxml-2.0"
PKG_CHECK_MODULES([libxml2], [$pkg_libxml2], have_libxml2=yes, have_libxml2=no)
if test "x$have_libxml2" = "xyes" ; then
HB_LIBS="$HB_LIBS $libxml2_LIBS"
HB_CPPFLAGS="$HB_CPPFLAGS $libxml2_CFLAGS"
fi

GST1_MODULES="gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 gstreamer-pbutils-1.0"
if test "x$gst_disable" = "xno" ; then
PKG_CHECK_MODULES([gstreamer1], [$GST1_MODULES], use_gst1=yes, use_gst1=no)
Expand Down Expand Up @@ -202,8 +208,8 @@ else
CFLAGS="$CFLAGS -D_NO_UPDATE_CHECK"
fi

AM_CONDITIONAL([GHB_GTK_4_00], [test "$HAVE_GTK_400" -eq 1])
AM_CONDITIONAL([GHB_GTK_3_16], [test "$HAVE_GTK_316" -eq 1])
AM_CONDITIONAL([GHB_GTK_4_4], [test "$HAVE_GTK_4_4" -eq 1])
AM_CONDITIONAL([GHB_GTK_3_22], [test "$HAVE_GTK_3_22" -eq 1])

AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])

Expand Down
6 changes: 3 additions & 3 deletions gtk/po/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Free Software Foundation, Inc.
COPYRIGHT_HOLDER = HandBrake Team

# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU =
PACKAGE_GNU = no

# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
Expand All @@ -41,7 +41,7 @@ PACKAGE_GNU =
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS =
MSGID_BUGS_ADDRESS = https://github.com/HandBrake/Handbrake/issues

# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
Expand Down
2 changes: 1 addition & 1 deletion gtk/po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# List of source files containing translatable strings.
src/menu.ui
src/ghb3.ui
src/fr.handbrake.ghb.metainfo.template.xml
src/fr.handbrake.ghb.metainfo.xml.in.in
src/audiohandler.c
src/callbacks.c
src/chapters.c
Expand Down
Loading

0 comments on commit 0425ddb

Please sign in to comment.