After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705596 - Partition Information Dialog - let user copy warnings
Partition Information Dialog - let user copy warnings
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2013-08-07 01:30 UTC by Dan Jacobson
Modified: 2013-12-09 18:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make warnings selectable (v1) (4.11 KB, patch)
2013-10-20 09:15 UTC, Mike Fleetwood
none Details | Review
GParted Information Dialog with libarted message and GParted Message (45.63 KB, image/png)
2013-10-20 16:06 UTC, Curtis Gedak
  Details
Make warnings selectable (v2) (4.33 KB, patch)
2013-10-21 17:46 UTC, Mike Fleetwood
none Details | Review

Description Dan Jacobson 2013-08-07 01:30:38 UTC
The user clicks Information.
If there is a warning at bottom, he cannot copy it with his mouse.
Comment 1 Curtis Gedak 2013-08-07 17:05:35 UTC
Confirmed problem with GParted 0.16.1.

The text under the "! Warning:" title cannot be selected and copied.
Comment 2 Curtis Gedak 2013-10-05 16:11:22 UTC
Renaming report title from:
   let user copy warnings
to:
   Partition Information Dialog - let user copy warnings
Comment 3 Mike Fleetwood 2013-10-20 09:15:43 UTC
Created attachment 257739 [details] [review]
Make warnings selectable (v1)

Hi Curtis,

Here's the patch for this.

This is one method I used to create 3 warning messages for a single
partition to see how multiple messages are displayed and selectable.

1) Create 2 partitions of size 2GB formatted as LVM2 PV.

2) Create VG spanning those 2 partitions:
      lvm vgcreate testvg /dev/sda7 /dev/sda8

3) Manually resize one PV without resizing the partition:
      lvm pvresize --setphysicalvolumesize 1G /dev/sda7
   [1st message: unallocated space]

4) Export the VG:
      lvm vgexport testvg
   [2nd message: PV belongs to exported VG]

5) Maunally wipe second PV:
      wipefs /dev/sda8
      wipefs -a /dev/sda8
   [3rd message: one or more PVs is missing]

Thanks,
Mike
Comment 4 Curtis Gedak 2013-10-20 16:06:55 UTC
Created attachment 257765 [details]
GParted Information Dialog with libarted message and GParted Message

Hi Mike,

Thanks for developing this patch, and for providing a set of test
steps.  Using the steps I can see the messages, each separated by a
blank line.

However if the message originates from an external tool, such as
libparted (e.g., "The device /dev/sdc1 doesn't exist" [1]), then these
messages usually end with a final new line character.  In these
circumstances, two blank lines separate different messages.

I thought about adding logic to check for trailing new line
characters, but even that would not work in all cases because the
external tool messages might also include blank lines.

The more I think about it, the more I think your current patch is
likely the best compromise, and involves less complexity.

What do you think?

If you agree, I will commit the patch from comment #3 as is.

Curtis

[1] This particular message arises because I have a MIRROR FAKE RAID
and hence individual disk devices in the RAID do not have
corresponding partition path names (sdb and sdc in the RAID, so no
sdb1 or sdc1).  Only the FAKE RAID partition path name exists.  E.g.,
/dev/mapper/isw_efjbbijhh_Vol0p1
Comment 5 Mike Fleetwood 2013-10-21 17:46:00 UTC
Created attachment 257782 [details] [review]
Make warnings selectable (v2)

Hi Curtis,

Here's version 2 of the patch.  Updates code and comments to make the
the trailing new line at the end of each message optional.


This is another test case I used to create multiple error messages from
an external command with trailing new lines and a GParted internal
message from which I removed a blank line.

1) Create a test xfs file system.

2) Move /usr/sbin/xfs_db to /usr/sbin/xfs_db.exe.

3) Create executable /usr/sbin/xfs_db containing:

#!/usr/bin/env python
import sys
import subprocess
args = ['/usr/sbin/xfs_db.exe'] + sys.argv[1:-1] + ['/dev/ram0']
ret = subprocess.call(args)
sys.exit(ret)


Thanks,
Mike
Comment 6 Curtis Gedak 2013-10-22 16:26:01 UTC
Thank you Mike for the updated patch and the new test.  The code looks good to me and all of my testing has been successful.

The patch in comment #5 has been committed to the git repository for inclusion in the next release of GParted.

The relevant git commit can be viewed at the following link:

Make Partition Information dialog warnings selectable (#705596)
https://git.gnome.org/browse/gparted/commit/?id=98cd693818e22e4758074848759b547c8fef4997
Comment 7 Curtis Gedak 2013-12-09 18:11:30 UTC
This enhancement was included in the GParted 0.17.0 release on December 9, 2013.