Commit Graph

88 Commits

Author SHA1 Message Date
Mike Fleetwood 5fd7c92671 Add partition name to Create New Partition dialog (#746214)
Add a partition name entry box to the Create New Partition dialog.  The
entry box is greyed out (not sensitive) for partition table types which
don't support partition naming.  Currently only supported for GPTs.  See
Utils::get_max_partition_name_length() for details.

There was a slightly wider gap between the file system combobox row and
the label entry row when there were only three widgets on the right hand
side of the dialog.  This has been removed now that there are four
widgets so that they are all evenly spaced and they line up with the
four widgets on the left hand side.

So far the partition name can be entered and previewed, but isn't yet
applied to the disk.

Bug 746214 - Partition naming enhancements
2015-03-25 10:02:43 -06:00
Mike Fleetwood 6a9a06af0e Pass Device object when setting up Dialog_Partition_New (#746214)
Adding a partition name entry to the Create New Partition dialog will
need access to these two Device methods: partition_naming_supported()
and get_max_partition_length().  The Set_Data() function already takes
two parameters, only_unformatted and disktype, taken from Device member
variables.

Rather than add two more parameters to the Set_Data() function pass the
Device object instead, replacing the current only_unformatted and
disktype parameters.

Bug 746214 - Partition name enhancements
2015-03-25 10:02:43 -06:00
Mike Fleetwood 650f4c7f20 Remove redundant Gtk::Entry calls in Create New Partition dialog
This is a small tidy-up to remove Gtk::Entry method calls on the file
system label entry box in the Create New Partition dialog which serve no
purpose.

filesystem_label_entry.set_activates_default( true );
    It trying to make the Create New Partition dialog automatically
    close  when Enter is pressed with focus in the label entry box.
    However this doesn't work, presumably because the default widget for
    the dialog is not the Add button.  Remove.

filesystem_label_entry.set_text( partition.get_filesystem_label() );
    Initialises the text in the entry box with the file system label
    from the passed partition object.  The label is blank and the entry
    box defaults to blank.  Achieves nothing.  Remove.

filesystem_label_entry.select_region( 0, filesystem_label_entry.get_text_length() );
    Highlights the empty text in the entry box.  Achieves nothing.
    Remove.

NOTE:
The same set of Gtk::Entry method calls in Dialog_FileSystem_Label() and
Dialog_Partition_Name, which are editing the existing file system label
and partition name respectively, do work and have a useful effect so
shouldn't be removed.
2015-03-25 10:02:43 -06:00
Mike Fleetwood fc599270c2 Rename member object to filesystem_label_entry (#746214)
Rename Gtk::Entry object entry -> filesystem_label_entry in the
Dialog_Partition_New class.  This is in preparation for the introduction
of the partition name entry box in the Create New Partition dialog.

Bug 746214 - Partition name enhancements
2015-03-25 10:02:43 -06:00
Mike Fleetwood 5098744f9a Add whole_device flag to the partition object (#743181)
Need to be able to take different actions in the GParted_Core partition
manipulation methods and in Win_GParted UI methods to deal with
libparted supported partitions or whole disk devices without a partition
table.  Add boolean whole_device to the partition object and set
appropriately to allow for this.

Bug 743181 - Add unpartitioned drive read-write support
2015-03-09 11:04:13 -06:00
Mike Fleetwood 63aeb150ac Rename member variables and methods in Partition class (#741424)
class Partition:
    have_label    -> have_filesystem_label
    label         -> filesystem_label
    label_known() -> filesystem_label_known()
    get_label()   -> get_filesystem_label()
    set_label()   -> set_filesystem_label()

Bug 741424 - Add support for GPT partition names
2015-02-01 10:08:23 -07:00
Mike Fleetwood 6220a35dac Rework population of the create new partition file system list
Simplify how the list of file system types is populated in the Create
New Partition dialog.  Change from copying everything and removing
unwanted items to only copying required items.  Makes the code simpler
and therefore easier to understand.
2014-10-30 09:55:01 -06:00
Mike Fleetwood 88f67058e8 Use supported_filesystem() predicate (#738471)
Use GParted_Core::supported_filesystem() to remove the need to
explicitly list the growing number of recognised, but otherwise
unsupported, file system signatures in multiple places.

Bug #738471 - ReFS file system is not recognised
2014-10-30 09:55:01 -06:00
Mike Fleetwood 9728479771 Recognise BitLocker encrypted partitions (#723232)
Only recognises partitions containing BitLocker Disk Encryption content.
No other actions are supported.

Bug #723232 - BitLocker Disk Encryption not recognised
2014-01-31 09:55:05 -07:00
Daniel Mustieles 3861b9257b Replace obsolete FSF postal address in copyright notices (#721565)
This is part of parent bug:
    Bug #721455 - Obsolete info in license text on multiple modules

and GNOME Goal:
    https://wiki.gnome.org/Initiatives/GnomeGoals/Proposals

    * verify all source files to make sure they have a license and a
      copyright, and that both are up-to-date

Bug #721565 -  License text contains obsolete FSF postal address
2014-01-26 10:53:23 +00:00
Phillip Susi 73f2c689f7 Change default file system to ext4 (#711114)
In the Create New Partition dialog use ext4 as the default choice for
new file systems.  It has been the preferred file system of
distributions for many years.  Use ext3 and ext2 as second and third
choice defaults.  This handles RHEL/CentOS 5.x which doesn't support
ext4.

Bug #711114 - Change default fs to ext4
2013-10-31 21:16:14 +00:00
Mike Fleetwood fac3f5b865 Recognise Linux Swap Suspend and Software RAID partitions (#709640)
Recognise in kernel, Linux Swap Suspend partitions.  (When hibernated
the kernel write the RAM out to swap space and changes the magic string
from swap space to suspend).  Recognition required either
libparted >= 1.8.8.1 or blkid from util-linux >= 2.15 or before that
blkid from e2fsprogs >= 1.39.

Recognise Linux Software RAID partitions.  Recognition requires blkid
from util-linux >= 2.15.

Example:

    # blkid /dev/sda10 /dev/sda11
    /dev/sda10: ... TYPE="swsuspend"
    /dev/sda11: ... TYPE="linux_raid_member"

    # parted /dev/sda print
    Model: ATA SAMSUNG HM500JI (scsi)
    Disk /dev/sda: 500GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number  Start   End     Size    Type      File system     Flags
    ...
    10      361GB   362GB   1074MB  logical   swsusp
    11      362GB   363GB   1074MB  logical                   raid

Bug #709640 - Linux Swap Suspend and Software RAID partitions not
              recognised
2013-10-19 10:05:54 -06:00
Mike Fleetwood d4f68eb730 Add new "cleared" file system format (#688882)
Add "cleared" to the bottom of list of file system formats available in
the Create new Partition dialog and in the Format to --> (file system
list) menu.  This clears existing file system signatures in the newly
created partitions and existing partitions respectively.

Bug #688882 - Improve clearing of file system signatures
2013-03-25 10:06:39 -06:00
sinlu bes ecb1f57594 Make the partition label length dependent from the file system (#689318)
fixes Bug #689318 - filesystem type specific support for partition name
                    maximum length
2012-12-30 16:55:03 +00:00
Mike Fleetwood 686ec8f713 Make GParted recognise reading blank file system labels (#685656)
GParted doesn't notice when a file system label is changed to blank.
GParted first calls the file system specific read_label() method.  When
the label is blank read_label() correctly sets partition.label to the
zero length string.  Second GParted_Core::set_device_partitions() treats
the zero length string to mean that the label is unset and calls
FS_Info::get_label() to retrieve it from the cache of blkid output.
Blkid also doesn't notice when the file system label has been changed to
blank so reports the previous label.  Hence GParted displays the
previous file system label.

Fix by making label a private member variable of the class Partition and
providing access methods set_label(), get_label() and label_known()
which track whether the label has been set or not.  This only fixes the
fault for file systems which use file system specific commands to read
the label and when these tools are installed.  Otherwise GParted uses,
or has to fall back on using, the buggy blkid command to read the file
system label.

NOTE:
Many of the file system specific read_label() methods use a tool which
outputs more than just the label and use Utils::regexp_label() to match
leading text and the label itself.  If the surrounding text changes or
disappears altogether to indicated a blank label, regexp_label() doesn't
match anything and returns the zero length string.  This  is exactly
what is required and is passed to set_label() to set the label to blank.

Bug 685656 - GParted doesn't notice when file system label is changed to
             blank
2012-11-04 12:26:09 +00:00
Mike Fleetwood c3ab62591b Add creation of LVM2 PVs (#670171)
Add creation of Physical Volumes specifying LVM2 metatdata format:
    lvm pvcreate -M 2 /dev/DEVICE

Also set the partition type to identify its contents as LVM.  Note that
libparted treats every partition type as a file system except LVM which
it treats as a flag, hence GParted displaying "lvm" in the Manage Flags
dialog.  Never the less libparted set the partition types correctly.
For MBR partitioning the type is 8e "Linux LVM" and for GPT partitioning
the type is E6D6D379-F507-44C2-A23C-238F2A3DF928.  Setting the partition
type as LVM is not strictly required as LVM2 scans the contents of all
partitions looking for PVs, but it is best practice.

Bug #670171 - Add LVM PV read-write support
2012-08-30 13:47:45 -06:00
Rogier Goossens 1197a52174 New partition dialog: first filesystem in list is always included
Even if invalid, the first filesystem in list is always included.

This is an off-by-one error, which was triggered when the first member
of FILESYSTEMS was no longer a regular filesystem, as a result of
commit ce9feeda0e9a04da04cec0a1b01512ed68c2495c:
'Make FileSystem objects in GParted_Core accessible and usable by others'
2012-02-18 10:32:30 -07:00
Mike Fleetwood 391e5e12f9 Rename FS_LVM2 -> FS_LVM2_PV (#160787)
This is the first step of adding support for just LVM2 Phyiscal Volumes,
a subset of full LVM2 support.

Make it clear that it is only LVM2 PVs being treated like a file system.

Bug #160787 - lvm support
2012-01-31 10:26:51 -07:00
Curtis Gedak 2bcd5d2954 Cleanup btrfs code
Move btrfs higher up the file system list.
Remove btrfs skip references as btrfs is now supported.
2011-10-22 10:44:29 -06:00
Curtis Gedak 55b71a77bc Fix unused parameter compiler warning
Removed unused parameter.  Prior to this change the compiler would
complain with the following message:

error: unused parameter ‘cylinder_size’
2011-07-18 13:31:54 -06:00
Curtis Gedak 813010b148 Update AUTHORS file and minor variable rename
Add recognition for the work done by Markus Elfring.
Also minor variable rename and added comment for patch to bug #634090.
2011-07-18 13:28:49 -06:00
Markus Elfring 91b971691d Bug #634090: Change some attributes to local variables
Some classes contained private attributes which were used only by a single
member function. Such items were moved to the corresponding function implementations
to stress their limited usage scope.

A few unused variables were also deleted.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2011-07-18 13:28:49 -06:00
Curtis Gedak 8a58b5b53e Enable compile and link with libparted 3.0 (#651559)
The release of (lib)parted 3.0 includes a change to the Application
Programing Interface - API.  Most importantly, libparted 3.0 removes
many file system specific function calls, and hence the capabilities
provided by these functions.  In order for GParted to compile and link
with libparted 3.0, this libparted functionality is lost.

Specifically, the functionality that is lost when GParted is compiled
and linked with libparted 3.0 is as follows:

  - Loss of ability to grow and shrink FAT16 and FAT32 file systems
  - Loss of ability to shrink HFS and HFS+ file systems
  - Loss of ability to determine used and unused sectors in HFS and
      HFS+ file systems
  - Loss of ability to erase file system signatures on partition
      create and format

It is hoped that other free software projects will include some or all
of the above lost functionality, which can then be added back to
GParted.

This commit includes a change in how FAT16 and FAT32 file systems are
moved.  Specifically the move is now performed internally by GParted
when linked with libparted 3.0.  The move functionality is provided by
libparted for prior libparted versions (e.g. less than 3.0).

This is the final enhancement in a series of commits that enable
GParted to compile with libparted version 3.0.

Closes Bug #651559 - Doesn't compile against parted 3.0
2011-06-09 09:59:41 -06:00
Seth Heeren 18fed5030f leaked FS structures for new partition dialog
FILESYSTEMS vector copies anyway
2010-10-05 12:46:26 -06:00
Luca Bruno 9c41afae91 Use ext2 as default when creating new filesystems
Default to ext2 for filesystem creation, instead of the
alphabetically preceding btrfs. Do not use get_label(),
as it is not available in older gtkmm.
2010-10-05 08:51:53 -06:00
Curtis Gedak adc55bec50 Fix partitions created using MiB alignment are 1 MiB larger (#631026)
Closes bug #631026 - Partitions created using MiB alignment are
                     1 MiB larger than specified
2010-09-30 11:31:25 -06:00
Curtis Gedak a30f991ca5 Fix size reduced by 1 MiB when created after cylinder aligned partition
Prior to this enhancement creating a new partition aligned to MiB
after a partition aligned to cylinder would result in the creation of
a partition that was 1 MiB smaller in size than requested.  In the
case of a 1 MiB new partition, a warning message would be displayed
indicating that "A partition cannot have a length of 0 sectors".

This problem is avoided by applying similar logic as was used to
address the following bug:
Bug #626946 - Destination partition smaller than source partition
2010-09-09 13:18:02 -06:00
Curtis Gedak b74dba4f67 Change behavior to better align with GNOME HIG on drop-down lists
Quote from GNOME Human Interface Guidelines 2.2.1 on Drop-down lists:

     "Selecting an item from a drop-down list should not affect the
     values of any other controls. It may sensitize, insensitize, hide
     or show other controls, however."
2010-05-26 17:33:38 -06:00
Curtis Gedak 95c9577d8f Limit graphic movement according to required boot record space
Also respect minimum size for extended partition in graphical
representation.

This change is part of adding the option to align to MiB (#617409).
2010-05-25 16:26:08 -06:00
Curtis Gedak 40bb656de5 Disable resizing when the total area is less than two mebibytes 2010-05-25 16:26:07 -06:00
Curtis Gedak e62a23b5b5 Add partition alignment option to align to MiB (#617409)
Make align to MiB the default setting instead of align to cylinder.

Migrate logic for alignment to cylinder into its own method
snap_to_cylinder, and place common logic in snap_to_alignment.

Add alignment checks for situations where space is needed for Master
Boot Record or Extended Boot Record.

Adjust ranges on spin buttons according to required boot record space.

Copy fix for off by one sector (#596552) from
Dialog_Partition_New::Get_New_Partition to
Dialog_Base_Partition::Get_New_Partition

Enhance resize / move logic for checking locations of nearby logical
partitions to not depend on the partition ordering.

Note: This commit does not include limiting graphic movement according
to required boot record space.
2010-05-20 10:00:14 -06:00
Curtis Gedak 2cdfb4c55a Change partition alignment check box to a drop down menu
Also add signal handler to alignment menu to update file system
minimum size.
This enhancement is to prepare for adding a third alignment
option to align to MiB.
2010-05-09 14:45:26 -06:00
Curtis Gedak 7e2ca14756 Rename get_length method to get_sector_length
This rename is to try to reduce future confusion between
partition length in sectors versus partition length in bytes.
2010-04-28 09:11:44 -06:00
Curtis Gedak 70448f4fb0 Replace sector math with get_byte_length method where appropriate
This change is in preparation for supporting sectors sizes > 512 bytes.
2010-04-27 12:54:14 -06:00
Curtis Gedak cb08e8c7dd Remove 512 byte based units and rename _FACTOR to BYTE
With the removal of the 512 byte constants, such as MEBIBYTE, it
was possible to rename the _FACTOR constants back to BYTE
constants.  The _FACTOR constants, such as MEBI_FACTOR, were a
temporary measure to help in the transition to support devices
with sector sizes > 512 bytes.
2010-04-26 13:40:38 -06:00
Curtis Gedak 81a903cda2 Replace constant MEBIBYTE with appropriate MEBI_FACTOR math
This change is in preparation for supporting sectors sizes > 512 bytes.
2010-04-26 13:21:18 -06:00
Curtis Gedak 5d2bf2ec5d Replace default sector size with appropriate sector size
This change is in preparation for supporting sectors sizes > 512 bytes.
2010-04-26 11:52:33 -06:00
Curtis Gedak 74ecd2ed3f Set sector size and add to operation and dialog methods
This change is in preparation for supporting sectors sizes > 512 bytes.
2010-04-19 19:22:31 -06:00
Curtis Gedak eb7e09aac8 Remove GParted:: prefix from in front of UNIT constants 2010-03-24 14:37:08 -06:00
Curtis Gedak 1aa81bba94 Enhance sector_to_unit() for sector sizes > 512 bytes 2010-03-24 14:37:08 -06:00
Curtis Gedak f9f603256e Convert file system maximum from sector to byte value 2010-03-24 14:37:08 -06:00
Curtis Gedak 40d7dbac4b Convert file system minimum from sector to byte value 2010-03-24 14:37:08 -06:00
Curtis Gedak 70584176de Disable extended option for non-MSDOS and non-DVH disk types (#583906)
According to parted documentation, only "msdos" and "dvh" disk
types (or partition table types) support extended partitions.
All other disk types support primary partitions only.
2010-02-24 11:39:42 -07:00
Curtis Gedak 8cfb27b718 Cleanup file copyright entries
Restore copyright entries by original author to those of his last
known repository commit titled "released gparted-0.3.4 on
LarryT's request." on Feb 25, 2007.

Add my own copyright entries for files in which I changed source
code.  Files in which I only made spelling changes do not have my
copyright entry added.
2009-11-05 11:08:49 -07:00
Curtis Gedak a960d280d8 Change field labels to sentence capitalization (#583885)
This change done to align with the GNOME Human Interface Guidelines.
http://library.gnome.org/devel/hig-book/stable/design-text-labels.html.en
2009-10-21 15:25:44 -06:00
Seth Hunter df541b8986 Fix problem with create new partition size off by one sector (#596552)
With "Round to cylinders" deactivated, creating a new partition would
create a partition that was one sector too large.

Closes GParted bug #596552
2009-09-28 16:32:04 -06:00
Curtis Gedak dc1ab54d8f Added detection of btrfs file system
svn path=/trunk/; revision=1075
2009-02-23 20:22:30 +00:00
Curtis Gedak 3ef0293876 Added detection of LUKS encrypted partitions
svn path=/trunk/; revision=1071
2009-02-18 16:19:49 +00:00
Curtis Gedak 4ef71e5004 Added lvm2 physical volume detection
svn path=/trunk/; revision=1000
2008-12-07 18:43:35 +00:00
Curtis Gedak c4bc4430c7 Fixed incorrect spelling of filesystem and mountpoint
svn path=/trunk/; revision=970
2008-11-18 23:58:17 +00:00