Commit Graph

109 Commits

Author SHA1 Message Date
Luca Bacci 83b98885f6 modern-gtk2: Use OptionComboBox class for alignment combobox (!17)
First part in a series of commits to replace Gtk::OptionMenu widgets
with GParted::OptionComboBox.

This specific commit is about partition alignment combobox.

Closes !17 - Gtk2 modernisation
2018-11-12 21:50:42 +00:00
Mike Fleetwood a3b47ca14a Move struct FS and FS_Limits into FileSystem.h
Struct FS and struct FS_Limits are strongly related to the FileSystem
class, both being return values from members and associated with storing
file system attributes.  Move their definitions from Utils.h into
FileSystem.h.
2018-01-28 10:09:35 -07:00
Mike Fleetwood 175d27c55d Rename enum FILESYSTEM to FSType
There are too many different types of things named "filesystem" in the
GParted code with the potential to cause confusion.  Namely:

    std::vector<FS> FILESYSTEMS
                              Vector of file system capabilities.

    class FileSystem          Base class interfacing to file system
                              specific executables for querying and
                              modification.

    enum FILESYSTEM           Symbolic constants representing each file
                              system type.

Many recent written or re-written functions already used a variable
named fstype.  Rename enum FILESYSTEM to enum FSType to clearly
distinguish it from the other things with very similar names.  Only
changing the name of the enumeration, not the name of variables of that
type too because that is a lot more lines of code and those can be
changed when the relevant code is re-written.
2018-01-28 10:09:35 -07:00
Mike Fleetwood 46bf5a383e Extract common code into GParted_Core::get_filesystem_limits() (#787204)
There are multiple repetitions of the same code getting a FileSystem
object, checking for NULL and then calling the file system specific
get_filesystem_limits().  Extract that into a common function.

GParted_Core::get_filesystem_limits() can't use the file system from the
passed Partition object because that is the current file system which
will be different from the intended file system for new and format
operations.  So would look up the wrong derived FileSystem specific
object and call the wrong get_filesystem_limits().  Hence still needing
fstype as a separate parameter to pass the intended file system.

Bug 787204 - Minimum and maximum size of the UDF partition/disk
2018-01-28 10:09:35 -07:00
Mike Fleetwood 668957c0a4 Pass Partition object to get_filesystem_limits() (#787204)
As described in the previous commit, this is so that file system
specific implementations can dynamically determine size limits based on
Partition object attributes: such as the device sector size and the file
system block size.  (Assuming set_used_sectors() sets
partition.fs_block_size for the type of file system in question).

Bug 787204 - Minimum and maximum size of the UDF partition/disk
2018-01-28 10:09:35 -07:00
Mike Fleetwood 4fa262d7e3 Switch to using struct FS_Limits inside Dialog_Partition_New (#787204)
Change Dialog_Partition_New to use a fs_limits rather than struct FS
and .MIN and .MAX.  No passing of struct FS_Limits required.  Just use
the FILESYSTEMS vector of struct FS to provide the file system type and
look up it's size limits each time the selection changes.

Bug 787204 - Minimum and maximum size of the UDF partition/disk
2018-01-28 10:09:35 -07:00
Mike Fleetwood ea269cc929 Switch from whole_device flag to TYPE_UNPARTITIONED (#788308)
Remove whole_device flag and replace with new partition type
TYPE_UNPARTITIONED.  Minimally adapt the remaining code to compile and
run.

Bug 788308 - Remove whole_device partition flag
2017-10-03 08:22:19 -06:00
Mike Fleetwood 8979913a3f Remove "../include/" from GParted header #includes
It made the code look a little messy, is easily resolved in the build
system and made the dependencies more complicated than needed.  Each
GParted header was tracked via multiple different names (different
numbers of "../include/" prefixes).  For example just looking at how
DialogFeatures.o depends on Utils.h:

    $ cd src
    $ make DialogFeatures.o
    $ egrep ' [^ ]*Utils.h' .deps/DialogFeatures.Po
     ../include/DialogFeatures.h ../include/../include/Utils.h \
     ../include/../include/../include/../include/../include/../include/Utils.h \
     ../include/../include/../include/Utils.h \

After removing "../include/" from the GParted header #includes, just
need to add "-I../include" to the compile command via the AM_CPPFLAGS in
src/Makefile.am.  Now the dependencies on GParted header files are
tracked under a single name (with a single "../include/" prefix).  Now
DialogFeatures.o only depends on a single name to Utils.h:

    $ make DialogFeatures.o
    $ egrep ' [^ ]*Utils.h' .deps/DialogFeatures.Po
     ../include/DialogFeatures.h ../include/Utils.h ../include/i18n.h \
2016-12-12 13:15:34 -07:00
Mike Fleetwood e86e7b91b2 Prevent crypt-luks appearing in the Create New dialog and Format menu (#760080)
This patchset is adding read-only LUKS support.  Creation of LUKS is
planned to be a tick box adding encryption in the Create New Partition
dialog.  Therefore remove the greyed out crypt-luks entry in the Create
New Partition dialog and the Format menu.

Bug 760080 - Implement read-only LUKS support
2016-01-29 13:41:40 -07:00
Mike Fleetwood 24fa553385 Remove unnecessary sector_size parameter from Get_New_Partition methods
The sector_size parameter is unnecessary as the value can be retrieved
from the sector size of the selected Partition object on which the
create new, copy & paste or resize/move operation is being performed.

For the create new and resize/move operations it is trivial as the
existing unallocated or in use Partition object on which the operation
is being perform already contains the correct sector size.  For the copy
& paste operation, which can copy across disk devices of different
sector sizes, we merely have to use the sector size of the existing
selected (destination) Partition object rather than copied (source)
Partition object.  Hence these relevant lines in the new code:

    Dialog_Partition_Copy::set_data(selected_partition, copied_partition)
        new_partition = copied_partition.clone();
        ...
        new_partition->sector_size = selected_partition.sector_size;
2016-01-26 10:11:35 -07:00
Mike Fleetwood 320e166c03 Implement and use virtual Partition copy constructor clone() (#759726)
Final step for full polymorphic handling of Partition objects is to
implement a virtual copy constructor.  C++ doesn't directly support
virtual copy constructors, so instead use the virtual copy constructor
idiom [1].  (Just a virtual method called clone() which is implemented
in every polymorphic class and creates a clone of the current object and
returns a pointer to it).

Then replace all calls to the (monomorphic) Partition object copy
constructor throughout the code, except in the clone() implementation
itself, with calls to the new virtual clone() method "virtual copy
constructor".

Also have to make the Partition destructor virtual too [2][3] so that
the derived class destructor is called when deleting using a base class
pointer.  C++ supports this directly.

[1] Wikibooks: More C++ Idioms / Virtual Constructor
    https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Virtual_Constructor

[2] When to use virtual destructors?
    http://stackoverflow.com/questions/461203/when-to-use-virtual-destructors

[3] Virtuality
    Guideline #4: A base class destructor should be either public and
    virtual, or protected and nonvirtual
    http://www.gotw.ca/publications/mill18.htm

Bug 759726 - Implement Partition object polymorphism

SQUASH: When first using pointers to Partition and calling delete
2016-01-26 10:11:35 -07:00
Mike Fleetwood 4a6cbcd0f1 Use pointer to Partition in Dialog_Base_Partition and derived classes (#759726)
Now use a pointer to the Partition object in Dialog_Base_Partition class
and derived classes, Dialog_Partition_{Copy,New,Resize_Move}.  This is
equivalent to how the Partition objects are managed in the Operation and
derived classes.

The Partition object is allocated and copy constructed in each derived
classes' set_data() method, called from each constructor and deallocated
in the destructors.  Considering the remaining Big 3, these classes are
never copy constructed or copy assigned so provide private definitions
and no implementations so the compiler enforces this.

Bug 759726 - Implement Partition object polymorphism
2016-01-26 10:11:35 -07:00
Mike Fleetwood f6b45a0429 Use Partition pointer adoption everywhere when adding items into a PartitionVector (#759726)
Replace all the current code which uses push_back() and insert() of a
local Partition object and gets it copy constructed into a
PartitionVector.  Instead allocate a Partition object on the heap and
adopt a pointer into the PartitionVector using push_back_adopt() and
insert_adopt().

Bug 759726 - Implement Partition object polymorphism
2016-01-26 10:11:35 -07:00
Mike Fleetwood 48d898ebfd Include Partition.h header everywhere it's used
Lots of files which use the Partition class relied on the declaration
being included via other header files.  This is bad practice.

Add #include "Partition.h" into every file which uses the Partition
class which doesn't already include it.  Header file #include guards are
specifically to allow this.
2016-01-26 10:11:35 -07:00
Mike Fleetwood c249b7286d Fix temporary path name of new partitions (#759488)
In the UI new partitions were being named "unallocated" instead of
"New Partition #1", etc.  Also deleting a new partition not yet created
deletes all new partitions from the operation list because it matches
by name only and they were all named "unallocated".  Broken by this
recent commit:

    762cd1094a
    Return class member from Dialog_Partition_New::Get_New_Partition() (#757671)

Prior to this commit in the create new partition dialog code did these
relevant steps:
    Dialog_Partition_New::Get_New_Partition()
        Partition part_temp;
        ...
        part_temp.Set(..., "New Partition #%1", ...);

Create local Partition object using default constructor which calls
Partition::Reset() and clears the paths vector.  It then calls Set()
which appends the new name making the vector:
    paths = ["New Partition #%1"]

After the above commit the code did these steps:
    Dialog_Partition_New::Dialog_Partition_New(..., selected_partition, ...)
        set_data(..., selected_partition, ...);
            new_partition = selected_partition;

    Dialog_Partition_New::Get_New_Partition(...)
        new_partition.Set(..., "New Partition #%1", ...);

New_partition is copied from the selected unallocated partition in which
the new partition will be created.  So new_partition is now named
"unallocated".  Then the Set() call appends the new name making the
vector:
    paths = ["unallocated", "New Partition #%1"]

As get_path() returns the first name in the paths vector the path name
changed from "New Partition #%1" to "unallocated" causing this bug.

Fix by resetting the new_partition object to clear all vestiges of it
being a copy of the selected unallocated partition, Reset() call, before
then calling Set().  This then appends the new name to an empty vector
making it contain just the required new name:
    paths = ["New Partition #%1"]

Bug 759488 - Pending create partitions are all getting named
             "unallocated"
2015-12-18 09:35:28 -07:00
Mike Fleetwood 2c4df87a2c Return reference from Get_New_Partition() (#757671)
Return newly constructed partition object by reference rather than by
copy from the Copy, Resize/Move and New dialog classes.  This is another
case of stopping copying partition objects in preparation for using
polymorphic Partition objects.  In C++ polymorphism has to use pass by
pointer and reference and not pass by value, copying, to avoid object
slicing.

The returned reference to the partition is only valid until the dialog
object containing the new_partition member is destroyed.  This is okay
because in all three cases the returned referenced partition is copied
into a context with new lifetime expectations before the dialog object
is destroyed.

Case 1: GParted_Core::activate_paste()
    Referenced new_partition is copied in the OperationCopy constructor
    before the dialog object goes out of scope.

    Operation * operation = new OperationCopy( ...,
                                               dialog.Get_New_Partition( ... ),
                                               ... );

Case 2: GParted_Core::activate_new()
    Referenced new_partition is copied in the OperationCreate
    constructor before the dialog object goes out of scope.

    Operation * operation = new OperationCreate( ...,
                                                 dialog.Get_New_Partition( ... ) );

Case 3: GParted_Core::activate_resize()
    Temporary partition object is copied from the referenced
    new_partition before the dialog object goes out of scope.

    Partition part_temp = dialog.Get_New_Partition( ... );

Bug 757671 - Rework Dialog_Partition_New::Get_New_Partition() a bit
2015-11-11 10:12:18 -07:00
Mike Fleetwood 762cd1094a Return class member from Dialog_Partition_New::Get_New_Partition() (#757671)
Replace the use of local Partition variable with class member in
preparation for Dialog_Partition_New::Get_New_Partition() being changed
to return the new partition object by reference instead of by value.
    part_temp -> new_partition

Bug 757671 - Rework Dialog_Partition_New::Get_New_Partition() a bit
2015-11-11 10:12:18 -07:00
Mike Fleetwood c86b258475 Create unallocated space within new extended partition after aligning boundaries (#757671)
When creating a new extended partition, the unallocated space within it
was being created before adjusting the partition boundaries for
alignment reasons.  This must be wrong.  Move creation of the
unallocated space to after adjusting the partition boundaries for
alignment reasons.  First introduced by this commit:

    a30f991ca5
    Fix size reduced by 1 MiB when created after cylinder aligned partition

Also added a big FIXME comment explaining how further adjustments are
still made by snap_to_alignment() to the partition boundaries including
a test case where this too late adjustment causes overlapping boundaries
and apply to fail.

Bug 757671 - Rework Dialog_Partition_New::Get_New_Partition() a bit
2015-11-11 10:12:18 -07:00
Mike Fleetwood 451c2eac43 Rename parameter to selected_partition in Dialog_Partition_New methods (#757671)
This is just to make the parameter name in the Dialog_Partition_New
constructor and set_data() method match the name of the equivalent
parameter in the Dialog_Partition_Copy and Dialog_Partition_Resize_Move
classes.  (All three classes inherit from Dialog_Base_Partition and have
similar interfaces).

Bug 757671 - Rework Dialog_Partition_New::Get_New_Partition() a bit
2015-11-11 10:12:18 -07:00
Mike Fleetwood 7a4a375ed6 Remove Set_Data() from the copy, resize/move and new dialog class APIs
The copy, resize/move and new dialog classes (Dialog_Partition_Copy,
Dialog_Partition_Resize_Move and Dialog_Partition_New respectively) had
to be used like this:

    construct dialog object passing some parameters
    call Set_Data() to pass more parameters
    run() dialog
    call Get_New_Partition()

There is nothing in the classes which forces Set_Data() to be called,
but it must be called for the dialogs to work and prevent GParted from
crashing.

Make these class APIs safer by making it impossible to program
incorrectly in this regard.  Move all the additional parameters from
each Set_Data() method to each constructor.  The constructors just call
the now private set_data() methods.
2015-06-10 10:44:33 -06:00
Mike Fleetwood 32a5ace156 Rename Dialog_Base_Partition member to new_partition
The member variable was named selected_partition.  It is assigned from
Win_GParted::selected_partition_ptr (which is a pointer to a const
partition object so is never updated).  This gives connotations that it
won't be modified.

However it is updated freely as the new resultant partition object is
prepared before being returned from the dialog, most notable in the
Get_New_Partition() methods.

Therefore rename from selected_partition to new_partition.
2015-06-10 10:44:33 -06:00
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