1. 27 May, 2019 2 commits
  2. 22 May, 2019 4 commits
  3. 15 May, 2019 2 commits
    • Luca Bacci's avatar
      Set the xalign property for Gtk::Labels (!40) · 12f08d38
      Luca Bacci authored and Mike Fleetwood's avatar Mike Fleetwood committed
      With the same case as from the previous commit, the very long "Mounted
      on ..." text is now wrapped, but the text may not be left justified.
      Slowly adjust the dialog width and see how the text wrapping is updated
      to fit the size adjustment but the text is centred rather than left
      This is because setting the halign property to Gtk::ALIGN_START does not
      guarantee left alignment of text for wrapped or ellipsized Gtk::Labels.
      Use the xalign property instead.
      To set the xalign property there is a method in the GtkMisc (Gtk::Misc)
      base class:
        gtk_misc_set_alignment (Gtk::Misc::set_alignment)
      However, GtkMisc (Gtk::Misc) was deprecated in Gtk 3.14 (Gtkmm 3.14)
      and in Gtk 3.16 (gtkmm 3.16) set_alignment() was replaced with the
      introduction of two new methods:
        gtk_label_set_xalign (Gtk::Label::set_xalign)
        gtk_label_set_yalign (Gtk::Label::set_yalign)
      Add a check for Gtkmm method Gtk::Label::set_xalign() in configure.ac
      and use it when available.
      [1] Gtk3 Reference Documentation - gtk_misc_set_alignment()
          "gtk_misc_set_alignment has been deprecated since version 3.14 and
          should not be used in newly-written code. Use GtkWidget's alignment
          ("halign" and "valign") and margin properties or GtkLabel's
          "xalign" and "yalign" properties."
      [2] Gtkmm 3.16 Gtk::Misc Class Reference, set_alignment() method
      [3] GNOME BugZilla - EmptyBoxes: instructions_label's alignment is off
      [4] Gtk commit from 2014-09-16:
          GtkLabel: add x/yalign properties
      [5] Gtk3 Reference Documentation - gtk_label_set_xalign()
      [6] Gtkmm 3.16 Gtk::Label Class Reference, set_xalign() method
      Closes !40 - Limit wrapping labels
    • Luca Bacci's avatar
      Set a default max_width_chars for wrapping Gtk::Labels (!40) · 769d19e0
      Luca Bacci authored and Mike Fleetwood's avatar Mike Fleetwood committed
      Opening the Partition Information dialog for a file system mounted on a
      very long mount point, or on openSUSE which mounts the OS from 10 btrfs
      subvolumes from the same partition, will cause the dialog to be very
      wide as the "Mounted on ..." text is not wrapped.
      Back in Gtk2, when width_chars / max_width_chars were not set, wrapping
      labels had a default width beyond which text wrapped onto a new line
      For Gtk3 this default width was first reworked a bit [2], and then was
      removed for the very early Gtk3 3.0.10 release [3].
      It is recommended that applications explicitly set default values,
      otherwise wrapping labels never wrap when requesting their natural
      [1] Gtk 2.24.32 source code - gtk/gtklabel.c:2975
              "This long string gives a good enough length for any line to
      [2] Gtk commit from 2010-04-21:
          Make sure not to base the minimum size on "max-width-chars", only
          the natural size.
              "This string is just about long enough."
      [3] Gtk commit from 2011-04-17:
          label: Don't try to guess a label's size
          People should use window default sizes or label
          width-chars/max-width-chars to find the ideal layout for a label
          instead of relying on magic.
      Closes !40 - Limit wrapping labels
  4. 13 May, 2019 1 commit
    • Luca Bacci's avatar
      Request natural width in Gtk::ScrolledWindows for Gtk >= 3.22 (!39) · eeffd505
      Luca Bacci authored and Mike Fleetwood's avatar Mike Fleetwood committed
      Before Gtk 3.22 GtkScrolledWindow propagated natural size to its
      Children and so on to descendants.  In Gtk 3.22 this was changed to
      always request the minimum size.  This was done because it is believed
      to be a safer default (gives a better behaviour) in case of dynamic
      content inside the scrolled window, that is, content that may change
      allocated size. [1][2][3]
      When the scrolled window content is not dynamic the natural size is
      preferable because it gives a better looking layout and without any
      In the case of GParted content which is not dynamic, so request the
      scrolled windows to allocate children at natural sizes for Gtk >= 3.22.
      The benefits of natural size allocation are evident in presence of
      wrapping labels (for example inside the "Partition Info" dialog), that
      with the minimum size request likely end up taking a very small width.
      [1] Gtk commit from 2016-08-31:
          GtkScrolledWindow: Make propagation of natural child sizes optional
          "Making propagation of child natural sizes mandatory (or default,
          even) was evidently a mistake as this causes dynamic content in a
          scrolled window to resize it's parent when the scrolled window is
          competing for space with an adjacent widget."
      [2] Gtk 3.22 Reference Documentation -
      [3] Gtkmm 3.24 Gtk::ScrolledWindow Class Reference,
          set_propagate_natural_width() method
      [4] Gtkmm 3.21.6 NEWS
          "ScrolledWindow: Added get/set_propagate_natural_height/width() and
          the properties."
      Closes !39 - Always request natural size inside Gtk::ScrolledWindow
  5. 10 May, 2019 1 commit
  6. 01 May, 2019 1 commit
  7. 30 Apr, 2019 1 commit
  8. 27 Apr, 2019 20 commits
  9. 22 Apr, 2019 4 commits
    • Mike Fleetwood's avatar
      Update includes in DialogFeatures.h and .cc · 2c19a620
      Mike Fleetwood authored
      Mostly add, but also remove, #includes so both DialogFeatures.h and .cc
      include exactly the header files each needs to get the definitions they
      Header file #include guards are there to specifically enable this.
    • Mike Fleetwood's avatar
      Rename method to DialogFeatures::load_one_filesystem() · 57e8ac50
      Mike Fleetwood authored
      To better reflect that it is loading the supported actions for one file
      system into the treeview, just like it's parent load_filesystems() is
      initiating the loading for all the file systems.
    • Mike Fleetwood's avatar
      Fix available Partition menu options not being updated on rescan (!38) · 4939b941
      Mike Fleetwood authored
      Select a partition and look at the available actions in the Partition
      menu.  Then add or remove some commands which that particular file
      system uses and rescan to detect those changes.  Open the Partition menu
      again.  It doesn't reflect the changes of supported actions seen in the
      File System Support dialog.  Select a different partition and then
      select the original partition again.  Now the available actions in the
      Partition menu reflect the changes of supported actions.
      Have been testing by adding and removing /sbin/e2label to add and
      remove EXT2/3/4 file system labelling support just because that feature
      has existed for a very long time and EXT2/3/4 are displayed near the top
      of the File System Support dialog.  Tested this minor issue existed as
      far back as GParted 0.3.7.
      Fix by simply also refreshing the valid operations to update the
      Partition menu after updating the found file system specific commands.
      Closes !38 - Fixes for minor issues with File System Support rescanning
    • Mike Fleetwood's avatar
      Fix File System Support dialog not showing changes after rescan (!38) · 7ea91bca
      Mike Fleetwood authored
      Open the File System Support dialog, either add or remove some file
      system specific commands used by GParted and press the
      [Rescan For Supported Actions] button.  The supported actions don't
      change.  However after just closing and reopening the dialog, the
      supported actions do reflect the added or removed file system specific
      Bisected to this commit:
          Display "other" in the File System Support dialog (!13)
      The problem is that commit made a subset copy of the
      GParted_Core::FILESYSTEMS vector, obtained from get_filesystems(), so
      when the rescan ran and the FILESYSTEMS vector was updated with new
      supported actions, the dialog still displayed the original subset copy,
      so didn't reflect the changed supported actions.
      Fix by passing a reference to the GParted_Core::FILESYSTEMS vector,
      obtained from get_filesystems(), and perform the necessary filtering
      inside the dialog, like before the above faulty commit.  Additionally
      finding and adding "other" file system to the end of the list.
      Closes !38 - Fixes for minor issues with File System Support rescanning
  10. 17 Apr, 2019 4 commits
    • Mike Fleetwood's avatar
      Stop checking for 'ntfslabel --new-serial' support · 1b172646
      Mike Fleetwood authored and Curtis Gedak's avatar Curtis Gedak committed
      The oldest supported distributions have these versions of ntfs-3g /
        Distro             EOL        ntfs-3g / ntfsprogs
      - Debian 8           2020-Jun   2014.2.16AR.2
      - RHEL / CentOS 7    2024-Jun   2017.3.23
      - Ubuntu 14.04 LTS   2019-Apr   2013.1.13AR.1
      The oldest version of ntfs-3g / ntfsprogs on Ubuntu 14.04 LTS includes
      support for the --new-serial option.
          $ ntfslabel -V
          ntfslabel v2013.1.13AR.1 (libntfs-3g) - Display, or set, the label for an NTFS Volume.
          $ ntfslabel --help | grep -- --new-serial
                  --new-serial   Set a new serial number
      Therefore it is no longer necessary to check for this option as it is
      always available.  The worst case scenario is that some how an old
      version of ntfslabel is used which doesn't support this option.  In such
      a case GParted goes from not supporting changing the UUID to claiming
      support, but presumably it would fail with an error reporting unknown
      option when applied.  Arguably better from an end user support point of
    • Mike Fleetwood's avatar
      Consolidate common if have ntfsresize command conditions · d795cccb
      Mike Fleetwood authored and Curtis Gedak's avatar Curtis Gedak committed
    • Mike Fleetwood's avatar
      Switch to faster ntfsinfo to read NTFS usage (#47) · ef4d4cb1
      Mike Fleetwood authored and Curtis Gedak's avatar Curtis Gedak committed
      A user reported GParted was slow to refresh and timing ntfsresize to
      query his file systems found that it was taking 4.7 seconds and 9.2
      seconds for sizes 31.7 GiB and 49 GiB NTFS file systems respectively.
      Almost 14 seconds just to read the usage.
      Created a 4 GiB NTFS and filled it with as many 4 KiB files as possible,
      just over 800,000 files.
          # df -k /mnt/2
          Filesystem     1K-blocks    Used Available Use% Mounted on
          /dev/sdb2        4194300 4193860       440 100% /mnt/2
          # df -i /mnt/2
          Filesystem     Inodes  IUsed IFree IUse% Mounted on
          /dev/sdb2      819640 808591 11049   99% /mnt/2
      Testing perform of ntfsresize:
          # time ntfsresize --info --force --no-progress-bar /dev/sdb2 | \
          > egrep 'Current volume size|resize at|Cluster size'
          Cluster size       : 4096 bytes
          Current volume size: 4294963712 bytes (4295 MB)
          You might resize at 4294516736 bytes (freeing 450560 bytes).
          real    0m5.231s
          user    0m2.072s
          sys     0m3.014s
      Computation of figures:
          Clusters per volume = 4294963712 / 4096 = 1048575.125
          Free clusters = (4294963712 - 4294516736) / 4096 = 109.125
      Testing performance of ntfscluster, as used before this commit [1] from
      GParted 0.3 in 2006:
          # time ntfscluster --force /dev/sdb2 | \
          > egrep 'bytes per cluster|bytes per volume|clusters per volume|clusters of free space'
          bytes per cluster       : 4096
          bytes per volume        : 4294963200
          clusters per volume     : 131071
          clusters of free space  : 110
          real    0m4.243s
          user    0m1.629s
          sys     0m2.587s
      Note that the clusters per volume figure reported by ntfscluster is
      wrong.  4294963200 / 4096 = 1048575, not 131071.
      Testing performance using ntfsinfo:
          # time ntfsinfo --mft /dev/sdb2 | \
          egrep 'Cluster Size|Volume Size in Clusters|Free Clusters'
                  Cluster Size: 4096
                  Volume Size in Clusters: 1048575
                  Free Clusters: 110 (0.0%)
          real    0m0.022s
          user    0m0.012s
          sys     0m0.018s
      Repeating the above tests while also using 'btrace /dev/sdb2' and Ctrl-C
      around each test via a separate terminal, reports these numbers of I/Os
      being performed:
        Command      Read requests   Read bytes
      - ntfsresize           2,695     1116 MiB
      - ntfscluster          2,685     1116 MiB
      - ntfsinfo                13     2208 KiB
      No wonder that ntfsresize and ntfscluster take a long time, they read
      just over 1 GiB of data from the 4 GiB file system, where as ntfsinfo
      only reads just over 2 MiB.
      Switch to using ntfsinfo to report file system usage.
      [1] 9d956594
          replaced ntfscluster with ntfsresize (see #350789)
      Closes #47 - GParted is slow refreshing NTFS file systems
    • Daniel Mustieles García's avatar
      Updated Spanish translation · 8a7d7fbc
      Daniel Mustieles García authored