diff options
-rw-r--r-- | .build.yml | 185 | ||||
-rw-r--r-- | .github/dependabot.yml | 8 | ||||
-rwxr-xr-x | .github/workflows/archlinux.sh | 41 | ||||
-rwxr-xr-x | .github/workflows/builds.sh | 65 | ||||
-rw-r--r-- | .github/workflows/builds.yml | 79 | ||||
-rwxr-xr-x | .github/workflows/debian.sh | 53 | ||||
-rwxr-xr-x | .github/workflows/fedora.sh | 47 | ||||
-rw-r--r-- | .github/workflows/release.yml | 36 | ||||
-rwxr-xr-x | .github/workflows/ubuntu.sh | 50 | ||||
-rw-r--r-- | .travis.yml | 84 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | eel/eel-labeled-image.c | 219 | ||||
-rw-r--r-- | libcaja-private/caja-file-operations.c | 24 | ||||
-rw-r--r-- | libcaja-private/caja-icon-container.c | 5 | ||||
-rw-r--r-- | libcaja-private/caja-progress-info.c | 4 | ||||
-rw-r--r-- | libcaja-private/caja-progress-info.h | 2 | ||||
-rw-r--r-- | src/caja-desktop-window.c | 1 | ||||
-rw-r--r-- | src/file-manager/fm-properties-window.c | 50 |
18 files changed, 518 insertions, 437 deletions
diff --git a/.build.yml b/.build.yml deleted file mode 100644 index ffe389c9..00000000 --- a/.build.yml +++ /dev/null @@ -1,185 +0,0 @@ -########################################################## -# THE FOLLOWING LINES IS USED BY docker-build -########################################################## -requires: - archlinux: - # Useful URL: https://git.archlinux.org/svntogit/community.git/tree/caja - - autoconf-archive - - clang - - gcc - - git - - make - - exempi - - file - - gobject-introspection - - gvfs - - intltool - - libexif - - libnotify - - libsm - - mate-common - - mate-desktop - - which - - xorgproto - - debian: - # Useful URL: https://github.com/mate-desktop/debian-packages - # Useful URL: https://salsa.debian.org/debian-mate-team/caja - - autopoint - - clang - - clang-tools - - cppcheck - - git - - gobject-introspection - - gtk-doc-tools - - intltool - - libdconf-dev - - libexempi-dev - - libexif-dev - - libgail-3-dev - - libgirepository1.0-dev - - libglib2.0-dev - - libgtk-3-dev - - libgtk-layer-shell-dev - - libmate-desktop-dev - - libnotify-dev - - libpango1.0-dev - - libselinux1-dev - - libstartup-notification0-dev - - libx11-dev - - libxml2-dev - - mate-desktop - - mate-common - - python3-lxml - - quilt - - shared-mime-info - - xvfb - - fedora: - # Useful URL: https://src.fedoraproject.org/cgit/rpms/caja.git/ - - autoconf-archive - - clang-analyzer - - clang - - cppcheck-htmlreport - - git - - gcc - - gtk3-devel - - gtk-layer-shell-devel - - make - - redhat-rpm-config - - dbus-glib-devel - - desktop-file-utils - - exempi-devel - - gobject-introspection-devel - - cairo-gobject-devel - - libexif-devel - - libselinux-devel - - libSM-devel - - libxml2-devel - - mate-common - - mate-desktop-devel - - pango-devel - - python3-lxml - - startup-notification-devel - - libnotify-devel - - ubuntu: - - autopoint - - clang - - clang-tools - - git - - gobject-introspection - - gtk-doc-tools - - intltool - - libdconf-dev - - libexempi-dev - - libexif-dev - - libgail-3-dev - - libgirepository1.0-dev - - libglib2.0-dev - - libgtk-3-dev - - libgtk-layer-shell-dev - - libmate-desktop-dev - - libnotify-dev - - libpango1.0-dev - - libselinux1-dev - - libstartup-notification0-dev - - libx11-dev - - libxml2-dev - - mate-common - - python3-lxml - - quilt - - shared-mime-info - -variables: - - 'CHECKERS=" - -enable-checker deadcode.DeadStores - -enable-checker alpha.deadcode.UnreachableCode - -enable-checker alpha.core.CastSize - -enable-checker alpha.core.CastToStruct - -enable-checker alpha.core.IdenticalExpr - -enable-checker alpha.core.SizeofPtr - -enable-checker alpha.security.ArrayBoundV2 - -enable-checker alpha.security.MallocOverflow - -enable-checker alpha.security.ReturnPtrRange - -enable-checker alpha.unix.SimpleStream - -enable-checker alpha.unix.cstring.BufferOverlap - -enable-checker alpha.unix.cstring.NotNullTerminated - -enable-checker alpha.unix.cstring.OutOfBounds - -enable-checker alpha.core.FixedAddr - -enable-checker security.insecureAPI.strcpy"' - -before_scripts: - - if [ ${DISTRO_NAME} == "debian" ];then - - egrep -lRZ 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' . | xargs -0 -l sed -i -e 's/G_GNUC_BEGIN_IGNORE_DEPRECATIONS/ /g' - - egrep -lRZ 'G_GNUC_END_IGNORE_DEPRECATIONS' . | xargs -0 -l sed -i -e 's/G_GNUC_END_IGNORE_DEPRECATIONS/ /g' - - fi - - curl -Ls -o /usr/bin/gla11y https://github.com/hypra/gla11y/raw/v0.3/gla11y - - chmod +x /usr/bin/gla11y - -build_scripts: - - if [ ${DISTRO_NAME} == "debian" ];then - - export CFLAGS+=" -Wsign-compare -Wunused-macros" - - cppcheck --enable=warning,style,performance,portability,information,missingInclude . - - fi - - - NOCONFIGURE=1 ./autogen.sh - - scan-build $CHECKERS ./configure --enable-empty-view --enable-compile-warnings=maximum - - if [ $CPU_COUNT -gt 1 ]; then - - if [ ${DISTRO_NAME} == "debian" ];then - - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make -j $(( CPU_COUNT + 1 )) - - make clean - - fi - - scan-build $CHECKERS --keep-cc -o html-report make -j $(( CPU_COUNT + 1 )) - - else - - if [ ${DISTRO_NAME} == "debian" ];then - - scan-build $CHECKERS --keep-cc --use-cc=clang --use-c++=clang++ -o html-report make - - make clean - - fi - - scan-build $CHECKERS --keep-cc -o html-report make - - fi - -after_scripts: - - if [ ${DISTRO_NAME} == "fedora" ];then - - cppcheck --xml --output-file=cppcheck.xml --enable=warning,style,performance,portability,information,missingInclude . - - cppcheck-htmlreport --title=${REPO_NAME} --file=cppcheck.xml --report-dir=cppcheck-htmlreport - - ./gen-index -l 20 -i https://github.com/${OWNER_NAME}/mate-icon-theme/raw/master/mate/16x16/apps/system-file-manager.png - - fi - - if [ ${DISTRO_NAME} == "debian" ];then - - make install - - if xvfb-run make check; then :; else cat eel/test-suite.log; cat src/test-suite.log; false; fi - - fi - - make distcheck - -releases: - draft: false - prerelease: false - checksum: true - file_glob: true - files: caja-*.tar.xz - github_release: - tags: true - overwrite: true - base_version: 1.20.0 - notify_servers: - - https://release.mate-desktop.org/release diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..80851cd3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# Enable dependabot to keep our GHA pins automatically +# updated, so we don't fall too far behind in the future +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/archlinux.sh b/.github/workflows/archlinux.sh new file mode 100755 index 00000000..a43d05e1 --- /dev/null +++ b/.github/workflows/archlinux.sh @@ -0,0 +1,41 @@ +#!/usr/bin/bash + +# Use grouped output messages +infobegin() { + echo "::group::${1}" +} +infoend() { + echo "::endgroup::" +} + +# Required packages on Archlinux +requires=( + autoconf-archive + ccache + clang + exempi + file + gcc + gcc + git + glib2-devel + gobject-introspection + gvfs + intltool + libexif + libnotify + libsm + make + mate-common + mate-desktop + which + xorgproto +) + +infobegin "Update system" +pacman --noconfirm -Syu +infoend + +infobegin "Install dependency packages" +pacman --noconfirm -S ${requires[@]} +infoend diff --git a/.github/workflows/builds.sh b/.github/workflows/builds.sh new file mode 100755 index 00000000..c2e7b589 --- /dev/null +++ b/.github/workflows/builds.sh @@ -0,0 +1,65 @@ +#!/usr/bin/bash + +set -e +set -o pipefail + +CPUS=$(grep processor /proc/cpuinfo | wc -l) + +# Use grouped output messages +infobegin() { + echo "::group::${1}" +} +infoend() { + echo "::endgroup::" +} + +# Run meson first, then run autotools +# Because meson dist requires a clean git workspace +# Autotools will modify some files (such as po, etc.), making them dirty. +if [ -f meson.build ]; then + + infobegin "Configure (meson)" + meson setup _build --prefix=/usr + infoend + + infobegin "Build (meson)" + meson compile -C _build + infoend + + infobegin "Test (meson)" + ninja -C _build test + infoend + + infobegin "Dist (meson)" + # Git safedirectory stop ninja dist + # https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 + # https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory + git config --global --add safe.directory ${PWD} + ninja -C _build dist + infoend +fi + +if [ -f autogen.sh ]; then + infobegin "Configure (autotools)" + NOCONFIGURE=1 ./autogen.sh + ./configure --prefix=/usr --enable-compile-warnings=maximum || { + cat config.log + exit 1 + } + infoend + + infobegin "Build (autotools)" + make -j ${CPUS} + infoend + + infobegin "Check (autotools)" + make -j ${CPUS} check || { + find -name test-suite.log -exec cat {} \; + # (check-program:25212): Gtk-WARNING **: 12:05:15.567: cannot open display: + } + infoend + + infobegin "Distcheck (autotools)" + make -j ${CPUS} distcheck + infoend +fi diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml new file mode 100644 index 00000000..65d7e2eb --- /dev/null +++ b/.github/workflows/builds.yml @@ -0,0 +1,79 @@ +name: CI Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +# cancel already running builds of the same branch or pull request +concurrency: + group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + build: + name: Build on ${{matrix.container}} (using ${{matrix.cc}}) + runs-on: ubuntu-latest + container: + image: ${{matrix.container}} + volumes: + - /tmp/.cache + - /var/cache/apt + + strategy: + fail-fast: false # don't cancel other jobs in the matrix if one fails + matrix: + container: + [ + "debian:testing", + "fedora:latest", + "ubuntu:rolling", + "archlinux:latest", + ] + cc: ["gcc"] + cxx: ["g++"] + include: + - container: "archlinux:latest" + cc: "clang" + cxx: "clang++" + + env: + # Speed up build with ccache + CC: ccache ${{ matrix.cc }} + CXX: ccache ${{ matrix.cxx }} + CONTAINER: ${{ matrix.container }} + + steps: + - name: Setup environment variables + id: distro-name + shell: bash + run: | + split=(${CONTAINER//:/ }) + distro=${split[0]} + short_sha=${SHA:0:8} + echo "DISTRO=$distro" | tee -a $GITHUB_ENV + - name: Install git command + shell: bash + run: | + echo "::group::Install git ..." + apt-get update -qq && apt-get install --assume-yes git || true + dnf update -y && dnf install -y git || true + pacman --noconfirm -Sy git || true + echo "::endgroup::" + - name: Repository checkout + uses: actions/checkout@v4 + with: + submodules: "true" + - name: Install dependency packages + run: .github/workflows/${{ env.DISTRO }}.sh + - name: Enable ccache to speed up builds + uses: hendrikmuhs/[email protected] + with: + key: ${{ env.DISTRO }}-${{ matrix.cc }} + + - name: Build the source code + run: .github/workflows/builds.sh diff --git a/.github/workflows/debian.sh b/.github/workflows/debian.sh new file mode 100755 index 00000000..93386f70 --- /dev/null +++ b/.github/workflows/debian.sh @@ -0,0 +1,53 @@ +#!/usr/bin/bash + +# Use grouped output messages +infobegin() { + echo "::group::${1}" +} +infoend() { + echo "::endgroup::" +} + +# Required packages on Debian +requires=( + autopoint + ccache + clang + clang-tools + cppcheck + git + gobject-introspection + gtk-doc-tools + intltool + libdconf-dev + libexempi-dev + libexif-dev + libgail-3-dev + libgirepository1.0-dev + libglib2.0-dev + libgtk-3-dev + libgtk-layer-shell-dev + libmate-desktop-dev + libnotify-dev + libpango1.0-dev + libselinux1-dev + libstartup-notification0-dev + libx11-dev + libxml2-dev + mate-common + mate-desktop + python3-lxml + quilt + shared-mime-info + xvfb +) + +infobegin "Update system" +apt-get update -qq +infoend + +infobegin "Install dependency packages" +env DEBIAN_FRONTEND=noninteractive \ + apt-get install --assume-yes \ + ${requires[@]} +infoend diff --git a/.github/workflows/fedora.sh b/.github/workflows/fedora.sh new file mode 100755 index 00000000..eb8bc3f5 --- /dev/null +++ b/.github/workflows/fedora.sh @@ -0,0 +1,47 @@ +#!/usr/bin/bash + +# Use grouped output messages +infobegin() { + echo "::group::${1}" +} +infoend() { + echo "::endgroup::" +} + +# Required packages on Fedora +requires=( + autoconf-archive + cairo-gobject-devel + ccache + clang + clang-analyzer + cppcheck-htmlreport + dbus-glib-devel + desktop-file-utils + exempi-devel + gcc + git + gobject-introspection-devel + gtk-layer-shell-devel + gtk3-devel + libSM-devel + libexif-devel + libnotify-devel + libselinux-devel + libxml2-devel + make + mate-common + mate-desktop-devel + pango-devel + python3-lxml + redhat-rpm-config + startup-notification-devel +) + +infobegin "Update system" +dnf update -y +infoend + +infobegin "Install dependency packages" +dnf install -y ${requires[@]} +infoend diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..764b9266 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release Version +on: + push: + tags: + - "v*.*.*" + +env: + MATE_DESKTOP_VERSION: 1.28.2 + CACHE_PATH: /tmp/.cache + +jobs: + release: + name: Release New Version + runs-on: ubuntu-latest + steps: + - name: Repository checkout + uses: actions/checkout@v4 + with: + submodules: "true" + + - name: Install dependency packages + run: sudo .github/workflows/ubuntu.sh + + - name: Build the source code + run: .github/workflows/builds.sh + + - name: Install GH CLI + uses: dev-hanz-ops/[email protected] + with: + gh-cli-version: 2.39.1 + + - name: Create github release + run: | + gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes caja-*.tar.xz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ubuntu.sh b/.github/workflows/ubuntu.sh new file mode 100755 index 00000000..93c079f7 --- /dev/null +++ b/.github/workflows/ubuntu.sh @@ -0,0 +1,50 @@ +#!/usr/bin/bash + +# Use grouped output messages +infobegin() { + echo "::group::${1}" +} +infoend() { + echo "::endgroup::" +} + +# Required packages on Ubuntu +requires=( + autopoint + ccache + clang + clang-tools + git + gobject-introspection + gtk-doc-tools + intltool + libdconf-dev + libexempi-dev + libexif-dev + libgail-3-dev + libgirepository1.0-dev + libglib2.0-dev + libgtk-3-dev + libgtk-layer-shell-dev + libmate-desktop-dev + libnotify-dev + libpango1.0-dev + libselinux1-dev + libstartup-notification0-dev + libx11-dev + libxml2-dev + mate-common + python3-lxml + quilt + shared-mime-info +) + +infobegin "Update system" +apt-get update -y +infoend + +infobegin "Install dependency packages" +env DEBIAN_FRONTEND=noninteractive \ + apt-get install --assume-yes \ + ${requires[@]} +infoend diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 63a13ccd..00000000 --- a/.travis.yml +++ /dev/null @@ -1,84 +0,0 @@ -# vim: set ts=2 sts=2 sw=2 expandtab : -dist: jammy -language: shell -os: linux -services: - - docker - -addons: - apt: - packages: - - python3-pip - - python3-setuptools - -branches: - except: - - gh-pages - -before_install: - - curl -Ls -o docker-build https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/docker-build - - curl -Ls -o gen-index https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/gen-index.sh - - chmod +x docker-build gen-index - -install: - - pip3 install PyGithub - - ./docker-build --name ${DISTRO} --config .build.yml --install - -script: - - ./docker-build --name ${DISTRO} --verbose --config .build.yml --build scripts - -notifications: - irc: - if: (tag OR branch = master) AND - repo = mate-desktop/caja - channels: - - "irc.libera.chat#mate-dev" - template: - - "[%{repository_name}] %{author}: %{commit_subject}" - - "[%{branch}] %{commit} %{message} %{build_url}" - on_success: never - on_failure: always - -before_deploy: - - yes | gem update --system --force - - gem install bundler - - gem install uri - - gem install logger - -deploy: - - provider: pages - edge: - branch: v2.0.5 - token: $GITHUB_TOKEN - keep_history: false - committer_from_gh: true - target_branch: gh-pages - local_dir: html-report - strategy: git - on: - all_branches: true - condition: ${DISTRO} =~ ^fedora.*$ - - provider: script - edge: - branch: v2.0.5 - script: ./docker-build --verbose --config .build.yml --release github - on: - tags: true - condition: "${TRAVIS_TAG} =~ ^v.*$ && ${DISTRO} =~ ^fedora.*$" - -after_success: - - 'if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_PULL_REQUEST" != "false" && ${DISTRO} =~ ^fedora.*$ ]]; then - REPO_SLUG_ARRAY=(${TRAVIS_REPO_SLUG//\// }); - REPO_NAME=${REPO_SLUG_ARRAY[1]}; - URL="https://${REPO_NAME}.mate-desktop.dev"; - COMMENT="Code analysis completed"; - curl -H "Authorization: token $GITHUB_TOKEN" -X POST - -d "{\"state\": \"success\", \"description\": \"$COMMENT\", \"context\":\"scan-build\", \"target_url\": \"$URL\"}" - https://api.github.com/repos/${TRAVIS_REPO_SLUG}/statuses/${TRAVIS_PULL_REQUEST_SHA}; - fi' - -env: -# - DISTRO="archlinux:latest" - - DISTRO="debian:testing" - - DISTRO="fedora:latest" -# - DISTRO="ubuntu:rolling" @@ -1,4 +1,4 @@ -[](https://travis-ci.org/mate-desktop/caja) +[](https://github.com/mate-desktop/caja/actions/workflows/builds.yml) [](https://github.com/mate-desktop/caja/releases) [](https://webchat.freenode.net/?channels=mate) diff --git a/eel/eel-labeled-image.c b/eel/eel-labeled-image.c index c7539bc8..200f1e41 100644 --- a/eel/eel-labeled-image.c +++ b/eel/eel-labeled-image.c @@ -90,6 +90,10 @@ static GType eel_labeled_image_toggle_button_get_type (void); /* GtkWidgetClass methods */ static GType eel_labeled_image_accessible_get_type (void); +static GType eel_labeled_image_button_accessible_get_type (void); +static GType eel_labeled_image_check_button_accessible_get_type (void); +static GType eel_labeled_image_toggle_button_accessible_get_type (void); +static GType eel_labeled_image_radio_button_accessible_get_type (void); /* Private EelLabeledImage methods */ static EelDimensions labeled_image_get_image_dimensions (const EelLabeledImage *labeled_image); @@ -2178,17 +2182,6 @@ eel_labeled_image_set_can_focus (EelLabeledImage *labeled_image, gtk_widget_set_can_focus (GTK_WIDGET (labeled_image), can_focus); } -static AtkObjectClass *a11y_parent_class = NULL; - -static void -eel_labeled_image_accessible_initialize (AtkObject *accessible, - gpointer widget) -{ - a11y_parent_class->initialize (accessible, widget); - atk_object_set_role (accessible, ATK_ROLE_IMAGE); - -} - static EelLabeledImage * get_image (gpointer object) { @@ -2248,29 +2241,27 @@ eel_labeled_image_accessible_image_interface_init (AtkImageIface *iface) iface->get_image_size = eel_labeled_image_accessible_image_get_size; } -typedef struct _EelLabeledImageAccessible EelLabeledImageAccessible; -typedef struct _EelLabeledImageAccessibleClass EelLabeledImageAccessibleClass; - -struct _EelLabeledImageAccessible -{ - GtkContainerAccessible parent; -}; - -struct _EelLabeledImageAccessibleClass -{ - GtkContainerAccessibleClass parent_class; -}; +typedef GtkContainerAccessible EelLabeledImageAccessible; +typedef GtkContainerAccessibleClass EelLabeledImageAccessibleClass; G_DEFINE_TYPE_WITH_CODE (EelLabeledImageAccessible, eel_labeled_image_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE, G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, eel_labeled_image_accessible_image_interface_init)); + +static void +eel_labeled_image_accessible_initialize (AtkObject *accessible, + gpointer widget) +{ + ATK_OBJECT_CLASS (eel_labeled_image_accessible_parent_class)->initialize (accessible, widget); + atk_object_set_role (accessible, ATK_ROLE_IMAGE); +} + static void eel_labeled_image_accessible_class_init (EelLabeledImageAccessibleClass *klass) { AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass); - a11y_parent_class = g_type_class_peek_parent (klass); atk_class->get_name = eel_labeled_image_accessible_get_name; atk_class->initialize = eel_labeled_image_accessible_initialize; @@ -2281,123 +2272,63 @@ eel_labeled_image_accessible_init (EelLabeledImageAccessible *accessible) { } -static void -eel_labeled_image_button_class_init (GtkWidgetClass *klass) -{ -} - -static GType -eel_labeled_image_button_get_type (void) -{ - static GType type = 0; - - if (!type) - { - GTypeInfo info = - { - sizeof (GtkButtonClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) eel_labeled_image_button_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkButton), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - NULL /* value_table */ - }; - - type = g_type_register_static - (GTK_TYPE_BUTTON, - "EelLabeledImageButton", &info, 0); - } - - return type; -} - -static GType -eel_labeled_image_check_button_get_type (void) -{ - static GType type = 0; - - if (!type) - { - GTypeInfo info = - { - sizeof (GtkCheckButtonClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) eel_labeled_image_button_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkCheckButton), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - NULL /* value_table */ - }; - - type = g_type_register_static - (GTK_TYPE_CHECK_BUTTON, - "EelLabeledImageCheckButton", &info, 0); - } - - return type; -} - -static GType -eel_labeled_image_toggle_button_get_type (void) -{ - static GType type = 0; - - if (!type) - { - GTypeInfo info = - { - sizeof (GtkToggleButtonClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) eel_labeled_image_button_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkToggleButton), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - NULL /* value_table */ - }; - - type = g_type_register_static - (GTK_TYPE_TOGGLE_BUTTON, - "EelLabeledImageToggleButton", &info, 0); - } - - return type; -} - -static GType -eel_labeled_image_radio_button_get_type (void) -{ - static GType type = 0; - - if (!type) - { - GTypeInfo info = - { - sizeof (GtkRadioButtonClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) eel_labeled_image_button_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkRadioButton), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - NULL /* value_table */ - }; - - type = g_type_register_static - (GTK_TYPE_RADIO_BUTTON, - "EelLabeledImageRadioButton", &info, 0); - } - - return type; -} +/* Defines GObject types for the various buttons. This takes care of creating + * the related accessible type as well and to plug it to the base + * EelLabeledImageAccessible which handles those cases as well -- having + * different accessible types for each of those is only required to inherit + * from the correct GTK accessible parent. */ + +#define DEFINE_LABELLED_IMAGE_BUTTON_TYPE(TN, t_n, TP, T_P, ATP, A_T_P) \ + typedef TP TN; \ + typedef TP##Class TN##Class; \ + typedef ATP TN##Accessible; \ + typedef ATP##Class TN##AccessibleClass; \ + G_DEFINE_TYPE (TN, t_n, T_P) \ + G_DEFINE_TYPE_WITH_CODE (TN##Accessible, t_n##_accessible, A_T_P, \ + G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, \ + eel_labeled_image_accessible_image_interface_init)) \ + static void t_n##_class_init(TN##Class *klass) \ + { \ + gtk_widget_class_set_accessible_type (GTK_WIDGET_CLASS (klass), \ + t_n##_accessible_get_type ()); \ + } \ + static void t_n##_init (TN *obj) \ + { \ + } \ + static void t_n##_accessible_class_init(TN##AccessibleClass *klass) \ + { \ + AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass); \ + atk_class->get_name = eel_labeled_image_accessible_get_name; \ + } \ + static void t_n##_accessible_init (TN##Accessible *obj) \ + { \ + } + + +DEFINE_LABELLED_IMAGE_BUTTON_TYPE (EelLabeledImageButton, + eel_labeled_image_button, + GtkButton, + GTK_TYPE_BUTTON, + GtkButtonAccessible, + GTK_TYPE_BUTTON_ACCESSIBLE) + +DEFINE_LABELLED_IMAGE_BUTTON_TYPE (EelLabeledImageCheckButton, + eel_labeled_image_check_button, + GtkCheckButton, + GTK_TYPE_CHECK_BUTTON, + GtkToggleButtonAccessible, + GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE) + +DEFINE_LABELLED_IMAGE_BUTTON_TYPE (EelLabeledImageToggleButton, + eel_labeled_image_toggle_button, + GtkToggleButton, + GTK_TYPE_TOGGLE_BUTTON, + GtkToggleButtonAccessible, + GTK_TYPE_TOGGLE_BUTTON_ACCESSIBLE) + +DEFINE_LABELLED_IMAGE_BUTTON_TYPE (EelLabeledImageRadioButton, + eel_labeled_image_radio_button, + GtkRadioButton, + GTK_TYPE_RADIO_BUTTON, + GtkRadioButtonAccessible, + GTK_TYPE_RADIO_BUTTON_ACCESSIBLE) diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index 6ab8697d..4b51c907 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -1879,7 +1879,7 @@ trash_files (CommonJob *job, GList *files, guint *files_skipped) for (l = files; l != NULL && !job_aborted (job); l = l->next) { - caja_progress_info_get_ready (job->progress); + caja_progress_info_get_ready (job->progress, job->time); file = l->data; @@ -3632,7 +3632,7 @@ copy_move_directory (CopyMoveJob *copy_job, nextinfo = g_file_enumerator_next_file (enumerator, job->cancellable, skip_error?NULL:&error); while (!job_aborted (job) && (info = nextinfo) != NULL) { - caja_progress_info_get_ready (job->progress); + caja_progress_info_get_ready (job->progress, job->time); nextinfo = g_file_enumerator_next_file (enumerator, job->cancellable, skip_error?NULL:&error); src_file = g_file_get_child (src, @@ -4598,7 +4598,7 @@ copy_files (CopyMoveJob *job, for (l = job->files; l != NULL && !job_aborted (common); l = l->next) { - caja_progress_info_get_ready (common->progress); + caja_progress_info_get_ready (common->progress, common->time); src = l->data; @@ -4915,7 +4915,7 @@ move_file_prepare (CopyMoveJob *move_job, } retry: - caja_progress_info_get_ready (job->progress); + caja_progress_info_get_ready (job->progress, job->time); flags = G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_NO_FALLBACK_FOR_MOVE; if (overwrite) { @@ -5091,7 +5091,7 @@ move_files_prepare (CopyMoveJob *job, total = left = g_list_length (job->files); - caja_progress_info_get_ready (common->progress); + caja_progress_info_get_ready (common->progress, common->time); report_move_progress (job, total, left); i = 0; @@ -5155,7 +5155,7 @@ move_files (CopyMoveJob *job, for (l = fallbacks; l != NULL && !job_aborted (common); l = l->next) { - caja_progress_info_get_ready (common->progress); + caja_progress_info_get_ready (common->progress, common->time); fallback = l->data; src = fallback->file; @@ -5269,6 +5269,8 @@ move_job (GIOSchedulerJob *io_job, goto aborted; } + g_timer_start (job->common.time); + memset (&transfer_info, 0, sizeof (transfer_info)); move_files (job, fallbacks, @@ -5579,7 +5581,7 @@ link_job (GIOSchedulerJob *io_job, for (l = job->files; l != NULL && !job_aborted (common); l = l->next) { - caja_progress_info_get_ready (common->progress); + caja_progress_info_get_ready (common->progress, common->time); src = l->data; @@ -5721,7 +5723,7 @@ set_permissions_file (SetPermissionsJob *job, caja_progress_info_pulse_progress (common->progress); - caja_progress_info_get_ready (common->progress); + caja_progress_info_get_ready (common->progress, common->time); free_info = FALSE; if (info == NULL) { @@ -6086,7 +6088,7 @@ create_job (GIOSchedulerJob *io_job, count = 1; retry: - caja_progress_info_get_ready (common->progress); + caja_progress_info_get_ready (common->progress, common->time); error = NULL; if (job->make_dir) { @@ -6416,7 +6418,7 @@ delete_trash_file (CommonJob *job, gboolean del_file, gboolean del_children) { - caja_progress_info_get_ready (job->progress); + caja_progress_info_get_ready (job->progress, job->time); if (job_aborted (job)) { return; @@ -6565,7 +6567,7 @@ mark_desktop_file_trusted (CommonJob *common, GFileInfo *info; retry: - caja_progress_info_get_ready (common->progress); + caja_progress_info_get_ready (common->progress, common->time); error = NULL; if (!g_file_load_contents (file, diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 4c4c084c..d30add27 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4416,7 +4416,10 @@ destroy (GtkWidget *object) /* destroy interactive search dialog */ if (container->details->search_window) { - gtk_widget_destroy (container->details->search_window); + /*current GTK docs do not advise calling gtk_widget_destroy on child widgets + *gtk_widget_destroy (container->details->search_window); + *also note that GtkContainer destroys it's child widgets when it is destroyed + */ container->details->search_window = NULL; container->details->search_entry = NULL; if (container->details->typeselect_flush_timeout) diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c index 1db11351..7ded7ae4 100644 --- a/libcaja-private/caja-progress-info.c +++ b/libcaja-private/caja-progress-info.c @@ -707,7 +707,7 @@ widget_state_notify_paused_callback (ProgressWidgetData *data) } void -caja_progress_info_get_ready (CajaProgressInfo *info) +caja_progress_info_get_ready (CajaProgressInfo *info, GTimer *time) { if (info->waiting) { G_LOCK (progress_info); @@ -717,8 +717,10 @@ caja_progress_info_get_ready (CajaProgressInfo *info) g_source_set_callback (source, (GSourceFunc)widget_state_notify_paused_callback, info->widget, NULL); g_source_attach (source, NULL); + g_timer_stop (time); while (info->waiting) g_cond_wait (&info->waiting_c, &G_LOCK_NAME(progress_info)); + g_timer_continue (time); } G_UNLOCK (progress_info); } diff --git a/libcaja-private/caja-progress-info.h b/libcaja-private/caja-progress-info.h index c713361b..4b3e59f4 100644 --- a/libcaja-private/caja-progress-info.h +++ b/libcaja-private/caja-progress-info.h @@ -51,7 +51,7 @@ GType caja_progress_info_get_type (void) G_GNUC_CONST; */ CajaProgressInfo *caja_progress_info_new (gboolean should_start, gboolean can_pause); -void caja_progress_info_get_ready (CajaProgressInfo *info); +void caja_progress_info_get_ready (CajaProgressInfo *info, GTimer *time); void caja_progress_info_disable_pause (CajaProgressInfo *info); GList * caja_get_all_progress_info (void); diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c index 662c2472..771ddd53 100644 --- a/src/caja-desktop-window.c +++ b/src/caja-desktop-window.c @@ -116,6 +116,7 @@ caja_desktop_window_init (CajaDesktopWindow *window) gtk_widget_hide (CAJA_WINDOW (window)->details->statusbar); gtk_widget_hide (CAJA_WINDOW (window)->details->menubar); + gtk_window_set_decorated (GTK_WINDOW (window), FALSE); /* Don't allow close action on desktop */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS; diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 3be02ed9..e615e1fa 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -364,11 +364,13 @@ add_prompt_and_separator (GtkWidget *vbox, const char *prompt_text) static void get_image_for_properties_window (FMPropertiesWindow *window, char **icon_name, + char **display_name_, GdkPixbuf **icon_pixbuf) { CajaIconInfo *icon, *new_icon; GList *l; gint icon_scale; + gchar *display_name = NULL; icon = NULL; icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (window->details->notebook)); @@ -382,6 +384,7 @@ get_image_for_properties_window (FMPropertiesWindow *window, icon = caja_file_get_icon (file, CAJA_ICON_SIZE_STANDARD, icon_scale, CAJA_FILE_ICON_FLAGS_USE_THUMBNAILS | CAJA_FILE_ICON_FLAGS_IGNORE_VISITING); + display_name = caja_file_get_string_attribute (file, "type"); } else { new_icon = caja_file_get_icon (file, CAJA_ICON_SIZE_STANDARD, icon_scale, CAJA_FILE_ICON_FLAGS_USE_THUMBNAILS | @@ -390,6 +393,8 @@ get_image_for_properties_window (FMPropertiesWindow *window, g_object_unref (icon); g_object_unref (new_icon); icon = NULL; + g_free (display_name); + display_name = g_strdup (_("Multiple files")); break; } g_object_unref (new_icon); @@ -406,11 +411,23 @@ get_image_for_properties_window (FMPropertiesWindow *window, *icon_name = g_strdup (caja_icon_info_get_used_name (icon)); } + if (display_name_ != NULL) { + if (! display_name) { + display_name = g_strdup (_("No files")); + } else if (! caja_icon_info_get_used_name (icon)) { + g_free (display_name); + display_name = g_strdup (_("User-defined icon")); + } + *display_name_ = display_name; + display_name = NULL; + } + if (icon_pixbuf != NULL) { *icon_pixbuf = caja_icon_info_get_pixbuf_at_size (icon, CAJA_ICON_SIZE_STANDARD); } g_object_unref (icon); + g_free (display_name); } static void @@ -419,8 +436,9 @@ update_properties_window_icon (FMPropertiesWindow *window) GdkPixbuf *pixbuf; cairo_surface_t *surface; char *name; + char *display_name; - get_image_for_properties_window (window, &name, &pixbuf); + get_image_for_properties_window (window, &name, &display_name, &pixbuf); if (name != NULL) { gtk_window_set_icon_name (GTK_WINDOW (window), name); @@ -432,7 +450,10 @@ update_properties_window_icon (FMPropertiesWindow *window) gtk_widget_get_window (GTK_WIDGET (window))); gtk_image_set_from_surface (GTK_IMAGE (window->details->icon_image), surface); + atk_object_set_name (gtk_widget_get_accessible (window->details->icon_image), display_name); + g_free (name); + g_free (display_name); g_object_unref (pixbuf); cairo_surface_destroy (surface); } @@ -547,7 +568,8 @@ create_image_widget (FMPropertiesWindow *window, button = NULL; if (is_customizable) { button = gtk_button_new (); - gtk_container_add (GTK_CONTAINER (button), image); + gtk_widget_set_tooltip_text (button, _("Change associated icon")); + gtk_button_set_image (GTK_BUTTON (button), image); /* prepare the image to receive dropped objects to assign custom images */ gtk_drag_dest_set (GTK_WIDGET (image), @@ -4223,13 +4245,23 @@ add_permissions_combo_box (FMPropertiesWindow *window, GtkGrid *grid, GtkListStore *store; GtkCellRenderer *cell; GtkTreeIter iter; - - if (short_label) { - label = attach_title_field (grid, _("Access:")); - } else if (is_folder) { - label = attach_title_field (grid, _("Folder access:")); - } else { - label = attach_title_field (grid, _("File access:")); + AtkObject *atk_object; + static const gchar *const descriptions[4][3] = { + { N_("Access:"), N_("Folder access:"), N_("File access:") }, + /* As the UI lacks semantic grouping, provide more context for accessibility */ + { N_("User access:"), N_("User folder access:"), N_("User file access:") }, + { N_("Group access:"), N_("Group folder access:"), N_("Group file access:") }, + { N_("Others access:"), N_("Others folder access:"), N_("Others file access:") } + }; + const guint group = short_label ? 0 : is_folder ? 1 : 2; + + g_return_if_fail (type + 1 < G_N_ELEMENTS (descriptions)); + + label = attach_title_field (grid, _(descriptions[0][group])); + + atk_object = gtk_widget_get_accessible (GTK_WIDGET (label)); + if (GTK_IS_ACCESSIBLE (atk_object)) { + atk_object_set_name (atk_object, _(descriptions[type + 1][group])); } store = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN); |