Commit Graph

71 Commits

Author SHA1 Message Date
Volker Lanz 856ef859eb rename msdos_vista to msdos and make sure to use sector-based-alignment instead
of vista. also use cylinder based instead of msdos legacy.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1097441
2010-03-01 12:00:07 +00:00
Volker Lanz 2d49f64f16 export classes
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1097419
2010-03-01 10:50:35 +00:00
Volker Lanz be401e1ca7 completed encapsulating all libparted-specific stuff in a subclass derived from
CoreBackend*

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1097216
2010-02-28 17:57:55 +00:00
Volker Lanz 05db0f55ea begin moving all libparted-related stuff to a backend class.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1096873
2010-02-27 21:32:00 +00:00
Volker Lanz 8bc47ee964 rename any occurences of "disk label" to partition table for consistency
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1095455
2010-02-24 11:32:12 +00:00
Volker Lanz a8b19642fc rename "snapping" to "aligning" partitions
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1095443
2010-02-24 11:06:32 +00:00
Volker Lanz fe975b9dfb check for correct alignment only after the partition table type has been set
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1095436
2010-02-24 10:44:11 +00:00
Volker Lanz ed5c0da0ba fix typos in comment
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1095435
2010-02-24 10:43:06 +00:00
Volker Lanz df26044041 rename LibParted class to LibPartedBackend (plus files)
introduce a CoreBackend superclass for all future backends


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1095129
2010-02-23 18:04:45 +00:00
Volker Lanz 2eb8c42c1d Remove the few lines related to dbus stuff as long as we're not using any of it
anyway.

Refactor PartitionManagerWidget() and MainWindopw(), moving lots of stuff not
directly related to the PartTableWidget/TreePartition-combo from the former to
the latter. This completely breaks the KCM for now.

Remember the currently selected device across rescans.

Use the partition and device container widget for the context menus of
partitions and devices.

Use QMegatObject::connectSlotByName() where possible, even setting object names
where required to make that work.

Emit operationsChanged() and devicesChanged() in OperationStack because only
that makes any sense.

Add devices properties to toolbar.

Rename itemActivated signal in PartTableWidget to itemDoubleClicked.

DeviceScanner, OperationRunner and OperationStack are child QObjects of
MainWindow now.


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1095086
2010-02-23 16:30:05 +00:00
Volker Lanz 4849ec5ff8 Add colors to identify each individual type of file system plus a config page
to change these colors.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1091881
2010-02-17 19:39:24 +00:00
Volker Lanz 51faaebb38 Add some basic configuration dialog stuff.
Remove the option to create msdos-vista-compatible partition tables. Instead,
use a global config to determine which alignment to use.

Add a device properties dialog.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1091755
2010-02-17 13:18:25 +00:00
Volker Lanz 95ace6b7d3 make first and last usable sector methods static to libparted, no one else is
using them

move the code used to map libparted partition flags to our own flags from the
job to LibParted

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1090002
2010-02-14 12:35:01 +00:00
Volker Lanz bfbe3eed58 clean up includes and doxygen comments
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1089994
2010-02-14 11:42:44 +00:00
Volker Lanz d9fd184c9d Add some basic read-write-locking to the previewDevices.
Remove comment about race conditions when setting the selected device. Turns
out this wasn't at all the case. It was a signal loop, instead.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1089499
2010-02-13 11:25:56 +00:00
Volker Lanz 8ee33739c6 use previewDevices(), not the property itself, in OperationStack
use operationStack().previewDevices() where possible in the pm widget

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1089122
2010-02-12 13:30:28 +00:00
Volker Lanz 921d6b18e6 add some config values for advanced stuff:
- allow applying operations for non-root users if
  "allowApplyOperationsForNonRoot" is set to true (default is false)

- hide the radio button to create vista msdos partition tables unless
  "allowCreateVistaPartitionTable" is true (default is false). The reason for
  this is that there are, of course, no "vista msdos partition tables" in
  reality, it's just a Microsoft stupidity that only works as long as there is
  actually a partition starting at sector 2048 in that partition table. If the
  partition table is just created empty, we have no way to determine it was
  meant to be a "vista msdos partition table".

- allow settings the sector alignment for msdos-vista partition tables (default
  is 2048, just like vista).


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1088920
2010-02-11 22:26:51 +00:00
Volker Lanz 6f5680866c Add a DeviceScanner class. Move code to scan for devices from
core/libparted.cpp to this new class and use this class in
PartitionManagerWidget

Move the libparted-specific code to inspect _one_ device to a static method in
LibParted.

Make scanning for devices asynchronous with the new DeviceScanner class.

Introduce a progress dialog to show progress while scanning.

Rename the progress dialog for applying operations to something less generic.

Remove the signal emitted when the status bar should change: It's the same
logic used for the signal emitted when operations change.

Remove the onFinished() method in PartitionManagerWidget and directly connect
the finished signal from the apply-progress-dialog to the scanDevices slot.

Rename the PartitionManagerWidget::selectionChanged() signal to the less generic
PartitionManagerWidget::selectedPartitionChanged().

Rename PartitionManagerWidget::clearSelection() to the less generic
PartitionManagerWidget::clearSelectedPartition().

NOTE: The DeviceScanner class is a thread and exposes some race conditions if
not used with caution (aka workarounds). See comments in
PartitionManagerWidget::onScanDevicesFinished().

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1088844
2010-02-11 18:47:51 +00:00
Volker Lanz 75181b6d2f add method to change icon name after instantiation
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1088835
2010-02-11 18:34:09 +00:00
Volker Lanz 3ba56f1fd1 make sectorAlignment signed (all sector numbers throughout the application are
signed)

adjust createUnallocated() so that it leaves sectorAlignment sectors free after
the start of an extended partition for a vista disk label, not sectorsPerTrack

check for the right minimum size for vista and msdos

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1084213
2010-02-02 18:04:38 +00:00
Volker Lanz 9f2ff10e2f Check if we can actually access the device via libparted and don't just segfault if that fails.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1084199
2010-02-02 17:39:58 +00:00
Volker Lanz 6438c7172d remove requirement for msdos_vista partitions to start at xxxxxxx2048 and end
at xxxxxx2047 -- the vista installer seems to act that way but it's apparently
not really required.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1084191
2010-02-02 17:16:47 +00:00
Volker Lanz 896d31e179 make snapping rules for start and end of partitions more abstract and begin
implementing vista's weird snapping rules.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1083886
2010-02-02 08:40:24 +00:00
Volker Lanz c809be064a begin work on new disk label type for msdos(vista)
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1083614
2010-02-01 16:32:45 +00:00
Volker Lanz 85a0a22a27 make sure snapping to the front works even if the partition's first sector
before snapping is between firstUsable and the first cylinder boundary

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1083411
2010-02-01 09:50:30 +00:00
Volker Lanz e7d7283a22 actually use the calculated value, snappedFirst and don't calc it again
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1083355
2010-02-01 09:08:33 +00:00
Volker Lanz 8ecc3ccdf3 fix off by one in getting the first usable sector
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1083353
2010-02-01 09:08:06 +00:00
Volker Lanz 17f37760ae use information from KDiskFreeSpaceInfo only if the partition is mounted
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1082385
2010-01-30 11:52:37 +00:00
Volker Lanz 7d90e9f78d don't assume on creating a new partition table that the existing partition
table will be able to inform us about first and last usable sector... need to
have some defaults here.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1082202
2010-01-29 23:20:22 +00:00
Volker Lanz c2f127d903 make GPT support work: account for GPT writing a copy of its meta information
to the end of the device, thus requiring us to leave some free space at the end

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1082076
2010-01-29 16:41:42 +00:00
Volker Lanz 87f2f41e1f add basic support for GPT disk labels
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1081931
2010-01-29 11:25:28 +00:00
Volker Lanz 44af166f83 rename all values in CommandSupportType to make them more unique
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1081018
2010-01-27 13:00:14 +00:00
Volker Lanz a6427ee3ce rename log class to Log to avoid clashes with the C math lib function of the
same name

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1080742
2010-01-26 21:12:42 +00:00
Volker Lanz 908bfe3669 add "shred partition" feature
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1076584
2010-01-18 12:31:00 +00:00
Volker Lanz dc3f666f19 add mount point edit dialog as new friend... you can never have enough of those
anyway.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1075808
2010-01-16 20:19:22 +00:00
Volker Lanz c0adc7dbf5 use KDE's KIO functionality to find mount points and determine free space on
mounted partitions

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1075185
2010-01-15 16:30:24 +00:00
Volker Lanz 13df1ba5fc SVN_SILENT: Doc string fixed.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1074960
2010-01-15 01:55:39 +00:00
Volker Lanz 8058585d49 Improved device discovery via Solid.
Use the Solid-provided icon name for devices.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1074953
2010-01-15 01:46:45 +00:00
Volker Lanz 1051962f62 use Solid to scan for devices insteaf of the /proc/partitions hack
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1074921
2010-01-14 23:13:08 +00:00
Volker Lanz b394afa487 do not any longer make a disctinction between internal support for a command
and libparted support: this distinction has not been used anywhere.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1073174
2010-01-11 19:23:35 +00:00
Volker Lanz bab4194a10 use libblkid api for UUID too.
no static functions for reading labels and uuids: that doesn't make any sense.
just use methods in FileSystem and its implementations. this means no more
distinction between internal and external support (for reading labels and UUIDs
that is), but I don't see that this will be missed.


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1073165
2010-01-11 18:50:38 +00:00
Volker Lanz 016addec2e use libblkid api and not external process invokations to read FS labels
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1073145
2010-01-11 18:14:16 +00:00
Volker Lanz 79aed672b6 Probe for devices on our own, using /proc/partitions, and making libparted look
at each device separately instead of relying on parted_probe_all. The latter
segfaults when it finds entries in /dev/mapper it cannot understand and hangs
for a long time when a floppy is configured in the machine's BIOS but not
actually present.

Of course this is nothing more than a workaround.

BUG: 221580


svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1070840
2010-01-06 21:57:34 +00:00
Volker Lanz f09f60029f Delete unallocated children when removing them from the partition table.
BUG:218679

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1062714
2009-12-15 19:12:53 +00:00
Volker Lanz 4d4f757a3f sort devices by name after scanning.
BUG:218667

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1062443
2009-12-14 20:06:11 +00:00
Volker Lanz 64edd529e0 don't require mount points to exist for unmounting or else deactivating swap
never works.

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1050111
2009-11-16 16:59:25 +00:00
Volker Lanz 0652b8776c add children prop to class header init list
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1046697
2009-11-09 14:02:10 +00:00
Volker Lanz 455d667da4 add q_disable_copy macro
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1046683
2009-11-09 13:55:25 +00:00
Volker Lanz cf3c6d202e fix r941151: if the text is split, start counting at 1 again.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1006481
2009-08-03 20:06:39 +00:00
Volker Lanz 5c0acb2bba Read and display UUID for some filesystems.
svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=964310
2009-05-06 14:19:23 +00:00