Commit Graph

549 Commits

Author SHA1 Message Date
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 3830db2b9c updated
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1115136
2010-04-15 10:46:45 +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 17809b5107 updated
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114146
2010-04-12 20:39:30 +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
Volker Lanz 92a9bd2878 make PartWidgetBase a QWidget
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114049
2010-04-12 16:14:10 +00:00
Volker Lanz 22978e66b8 don't keep a list of our children in PartTableWidget either; like in
PartWidget, we can just let Qt handle that for us

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114047
2010-04-12 16:08:13 +00:00
Volker Lanz c1a6713e45 Remember the active PartWidget in the widget, not in the PartTableWidget. This
means the PartWidget doesn't need to know its PartTableWidget anymore.

Don't keep a list of child widgets, Qt will do that for us.

Remove the showChildren param and property from PartWidget, it wasn't used
anymore.

Rename active() to isActive() in PartWidget for consistency.


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1114033
2010-04-12 14:35:02 +00:00
Volker Lanz 3f1b211df9 no one is calling the code in drawPartition() but the paint event so move it to
the paint event handler. also, remove a superflous assert in the ctor.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113987
2010-04-12 12:48:17 +00:00
Volker Lanz 0d2f3ccc84 clean up partwidget class: don't use qpointers, don't use a pointer for access
to the partition property. still needs more work.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113951
2010-04-12 10:55:13 +00:00
Volker Lanz d98563b094 updated
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113950
2010-04-12 10:53:19 +00:00
Volker Lanz 7fd7cab700 updated
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113936
2010-04-12 10:15:44 +00:00
Volker Lanz f2e216cb43 check if there actually is a partition in the partwidget before accessing it
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113935
2010-04-12 10:15:30 +00:00
Volker Lanz 72775ba8a0 this is surely const
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113930
2010-04-12 09:45:14 +00:00
Volker Lanz aabeab1d54 show an ok-icon if smart status is ok and hide the icon label if smart status
is unknown

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113927
2010-04-12 09:23:55 +00:00
Volker Lanz 812b5082e5 updated
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113915
2010-04-12 08:51:51 +00:00
Volker Lanz 6d8192b18e use the icons the kstandardguiitem would use in all kguiitems we create
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113772
2010-04-11 18:19:24 +00:00
Volker Lanz 2f822dd21b check if device has more than 2^32 sectors if user wants to create an msdos
partition table on it and show a warning in that case. also make the default
GPT.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113771
2010-04-11 18:06:47 +00:00
Volker Lanz cf9ecebd1f turns out which sector alignment is used on import is determined by the app
wide default in the settings. well. for now, include the information in the
export, but ignore it on import.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113752
2010-04-11 17:16:43 +00:00
Volker Lanz 34f7a37010 one todo less
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113738
2010-04-11 16:09:59 +00:00
Volker Lanz 10bc881dfd use KIO for file IO where appropriate
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113737
2010-04-11 16:12:16 +00:00
Volker Lanz 216868d8ee use KTemporaryFile
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113723
2010-04-11 15:41:35 +00:00
Volker Lanz 8c95cfc03b update
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113720
2010-04-11 15:36:26 +00:00
Volker Lanz 4180318c41 remove kdebug line we apparently forgot to remove ;-)
use KIO to save files (actually, use a temp file and copy it with KIO::move)


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113694
2010-04-11 14:29:20 +00:00
Volker Lanz 74aaf31554 updated
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1113693
2010-04-11 14:28:19 +00:00
Script Kiddy bd896e98cd SVN_SILENT made messages (.desktop file)
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1109899
2010-04-01 06:38:15 +00:00
Volker Lanz 60fd180a41 updated
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1108262
2010-03-28 11:31:12 +00:00
Yuri Chornoivan f322030288 typo fix
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1108229
2010-03-28 07:58:08 +00:00
Script Kiddy d33325f853 SVN_SILENT made messages (.desktop file)
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1108218
2010-03-28 07:16:27 +00:00
Volker Lanz 5c9b7dc134 end header with a newline
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1108119
2010-03-27 21:18:41 +00:00