Commit Graph

441 Commits

Author SHA1 Message Date
Volker Lanz a26bda1ca8 re-init the file systems when loading a new backend
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119646
2010-04-27 14:49:28 +00:00
Volker Lanz 1c97342be3 if the file system we want to set the combo box to cannot be found in it, set
it to the first value; don't set it to -1

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119609
2010-04-27 13:19:34 +00:00
Volker Lanz 1b8a5eb6be don't capitalize the color config names
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119578
2010-04-27 12:38:56 +00:00
Volker Lanz 0bc6695513 remove the NO_THREADED_DEVICE_SCANNER ifdefs, they are not requires anymore
(and never really were)

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119568
2010-04-27 12:14:53 +00:00
Volker Lanz 19ed42c34b make sure we hide the scan progress dialog even if there is no progress at all
(most likely the case when there are no devices found at all)

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119566
2010-04-27 12:11:50 +00:00
Volker Lanz f8e81095ea add a formatted spin box
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119557
2010-04-27 11:41:35 +00:00
Volker Lanz 004e83447b turn off keyboard tracking for the spin boxes if align is on; this mostly
alleviates the problems arising from overwriting the spin box values if the new
value is illegal since we don't see values while they are being entered

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119551
2010-04-27 11:21:16 +00:00
Volker Lanz b28c212a9d make the spin boxes in SizeDialogBase work properly with aligned partitions,
mostly.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119547
2010-04-27 11:04:59 +00:00
Volker Lanz 0649420740 whitespace
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119522
2010-04-27 10:14:54 +00:00
Volker Lanz d08ce3ac78 move the updateLength-code from the part resizer widget to SizeDialogBase
because that's where it's actually being used exclusively.

don't update the spinbox value in
SizeDialogBase::onFreeSpaceBefore/AfterChanged() because if we do that the user
cannot enter values digit by digit anymore (we'll just overwrite what he entered
after each keystroke)

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119113
2010-04-26 15:37:02 +00:00
Volker Lanz 80cbafc7cb set spin box stepping for capacity, too
make sure we set the correct value for the free space spinboxes after
calculating the new first/last sector

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119091
2010-04-26 14:34:59 +00:00
Volker Lanz 1322c015e0 make sure start and end are aligned when updating a partition's length
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119081
2010-04-26 14:14:14 +00:00
Volker Lanz 42cc630639 update TODO
don't check for length constraints when moving a partition: the length must not
change anyway and the logic wouldn't work because the length DOES change in
between calls to update first and last sector

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119076
2010-04-26 14:03:41 +00:00
Volker Lanz 0284f685a8 make PartitionAlignment::alignedFirstSector() and
PartitionAlignment::alignedLastSector() take the min and max first/last, the
min length and the max length as args, making a lot of stuff in
PartitionAlignment superfluous.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119051
2010-04-26 13:14:29 +00:00
Volker Lanz b6f60697e9 no need to align new or inserted partitions: they're replacing unallocated or
existing partitions which will be aligned if that is what the user configured

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119049
2010-04-26 13:12:48 +00:00
Volker Lanz 32f610d28a make changing the free space after a partition work with aligning, mostly.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119010
2010-04-26 11:46:38 +00:00
Volker Lanz 6b89377253 make changing the free space before a partition work with aligning, mostly.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119007
2010-04-26 11:30:06 +00:00
Volker Lanz 31936a5072 set maximum for sector
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1119006
2010-04-26 11:24:51 +00:00
Volker Lanz 8dcd4cd1de use QDoubleSpinBox instead of the integer version for free space before and
after and for capacity so that fractions are possible for these values

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1118931
2010-04-26 08:50:57 +00:00
Volker Lanz c9a9402fbe add toDouble()
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1118928
2010-04-26 08:43:16 +00:00
Laurent Montel 444cc70394 Fix ui files
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1116400
2010-04-19 11:47:04 +00:00
Volker Lanz d4772c37fb make resizeLogicals take start and end delta as args to it does not always have
to delete and re-create the unallocated first and last child in an extended
partition, which is a waste of resources

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1116005
2010-04-18 11:36:00 +00:00
Volker Lanz 2bbb4ddcb4 move the code to calc the start and end of an unallocated partition to its own
static method

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1116004
2010-04-18 11:35:05 +00:00
Script Kiddy a3d0681d7e SVN_SILENT made messages (.desktop file)
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115953
2010-04-18 06:26:19 +00:00
Volker Lanz 1747d31bd2 fix setupDialog and setupConstraints in SizeDialogBase and reverse the order
they're called in in the various dialog ctors to how it was in 1.0.x (which
makes a lot more sense)

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115388
2010-04-16 09:28:39 +00:00
Volker Lanz 5e6b74e1af use the setters in init() for readonly and move allowed; also, call the setters
in the order the args are in

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115387
2010-04-16 09:27:39 +00:00
Volker Lanz 511c20476c fix off by one
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115384
2010-04-16 09:05:08 +00:00
Volker Lanz 50ee02a24a fix calculation of min and max first and last for aligned case
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115379
2010-04-16 08:40:33 +00:00
Volker Lanz 067eeb018d Do not merge resize/new/delete ops if an extended partition is involved: Too
many things can go wrong, all of them leading to crashes.

BUG:232092

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115229
2010-04-15 17:34:34 +00:00
Volker Lanz 34842c84cb make PartResizerWidget::resizeLogicals do the "right" thing for non extended
partitions (i.e., just remove any children)

call resizeLogicals() when a new partition's role changes in NewDialog so it
gets an unallocated child if it's now extended or the unallocated child is
removed if not anymore.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115223
2010-04-15 16:59:56 +00:00
Volker Lanz 70b47376d3 one friend less, huzzah
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115202
2010-04-15 16:04:40 +00:00
Volker Lanz 8632b7cf0d Move the workaround-code that replaced making a temp copy of a partition for
the ResizeDialog to said dialog instead of cluttering the
PartitionManagetWidget's call with that.

Call updatePartitions() after exec'ing ResizeDialog() even if the dialog was
not accepted as it might have deleted and re-created unallocated children of
extended partitions anyway -- and that would crash us later.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115191
2010-04-15 15:30:08 +00:00
Volker Lanz 0bebc1a2d0 Don't update logicals when moving an extended partition:
Moving extended partitions is not allowed if they have logicals and calling the
resizeLogicals() method will remove the unallocated partition the user has with
an 98% probability clicked to drag from under our feet, causing moving to fail.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115167
2010-04-15 14:25:55 +00:00
Volker Lanz ee5f16ad34 don't crash when creating a size dialog: don't set moveAllowed before the
partWidget is created

make sure to always create unallocated partitions when resizing an extended,
not only if it already has one.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115158
2010-04-15 13:41:12 +00:00
Volker Lanz ca76d30c3d Align a partition if it's newly created (or inserted), the one it replaces
was not aligned and aligning is on.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115135
2010-04-15 10:46:36 +00:00
Volker Lanz ee40f89db7 Make PartitionAlignment a shell around static methods only.
Make sure aligning partitions actually works in the part resizer. Could still
need work and even thought.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115134
2010-04-15 10:45:43 +00:00
Volker Lanz 9436c18f69 Do not create a temporary Partition instance for resizing. This does not work
anymore because when aligning the resized partition it is no longer known if an
existing partition is the source of the temporary copy or some other partition.

Let the ResizeDialog modify the original and restore its start and end sector
after the dialog has been executed instead.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115133
2010-04-15 10:38:48 +00:00
Volker Lanz 82f08a4f8b use PartitionAlignment::sectorAlignment, not Config::sectorAlignment
let the PartResizerWidget know the state of the align checkbox

use the toggled, not the stateChanged signal from the align checkbox

make sure PartResizerWidget::setMoveAllowed is called before PartResizerWidget::init


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115131
2010-04-15 10:32:12 +00:00
Volker Lanz 65500ac0f3 change arg name so it doesn't clash with a method name
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115130
2010-04-15 10:26:51 +00:00
Volker Lanz cc1542fa84 change the way the number of free sectors before and after a partition is
calculated: 

In case of the free sectors after a partition, we used to just add the length
of the following unallocated partition to the last sector. This does not work
for extended partitions where unallocated partitions have
number_of_sectors_per_track free space before AND after them.

This is because if a new partition is created in place of the unallocated space
and this partition is followed by another logical, we need two times
number_of_sectors_per_track for two extended boot records.

If, however, the partition in question is simply resized to fill up all space
following it (and is still followed by a logical), we only need ONE EBR.

To solve this, we now use the difference between the following partition's last
sector and the partition's last sector instead.

The same is true for free sectors preceding a partition, of course.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115127
2010-04-15 10:20:36 +00:00
Volker Lanz c97d7cd15a small layout fix
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115125
2010-04-15 10:14:06 +00:00
Volker Lanz c91e6201a0 add config option to set if partitions are aligned per default
don't use title case in labels in the config


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114762
2010-04-14 12:55:27 +00:00
Volker Lanz 9426e3afec add new class PartitionAlignment and move all alignment related stuff there
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114380
2010-04-13 10:04:01 +00:00
Volker Lanz 9d0e0774ef When looking for a partition that already occupies a sector we want to align
to, make sure that if we find an unallocated one it's either logical if we're
aligning a logical or primary if we're aligning a primary.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114138
2010-04-12 20:16:11 +00:00
Volker Lanz 881ff2a4d2 whitespace
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114125
2010-04-12 19:56:43 +00:00
Volker Lanz 3d6b74453e check the constraints (first and last sector min and max) again after aligning
a partition to make sure we're not going over those. of course
PartitionTable::alignPartition() shouldn't move first and last sector to
anywhere it's not allowed to, but currently it seems buggy enough to do so and
the check won't hurt.

PartitionTable::alignPartition() still needs to be fixed, of course.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114084
2010-04-12 18:20:14 +00:00
Volker Lanz d349fbd591 don't try to move a partition if first sector or last sector don't change
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114076
2010-04-12 17:51:21 +00:00
Volker Lanz f1bc4afde8 also set PartWidgets to visible
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114071
2010-04-12 17:29:29 +00:00
Volker Lanz ea2e6cba9f move more code from setupConstraints to setupDialog as another workaround. this
really needs fixing.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114067
2010-04-12 17:05:10 +00:00
Volker Lanz ec44af261e move childWidgets() from PartWidget and PartTableWidget to the common base
class

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114051
2010-04-12 16:22:14 +00:00