use a qdoublespinbox instead of a qspinbox for sectors so values higher than

2^31 fit

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1104299
This commit is contained in:
Volker Lanz 2010-03-17 10:48:24 +00:00
parent c384fdaf21
commit a892c765cb
5 changed files with 17 additions and 20 deletions

11
TODO
View File

@ -20,17 +20,8 @@ Plans and ideas for 1.1:
* offer a) no alignment of partition boundaries at all or b) legacy cylinder
alignment or c) sector based alignment (the name is misleading, though)
* the size dialog base is a mess with its confusing free before/after stuff.
redesign to use first and last sector and nothing else and calc the rest from
there.
* offer to skip aligning the partition when creating it in that details widget?
* once the above redesign is done, allow the user to adjust first and last
sector directly. maybe offer a details dialog widget. maybe also offer to
skip aligning the partition when creating it in that details widget?
* write a KFormattedSpinBox widget to allow qint64 instead of int and to show
sector numbers nicely
===============================================================================
Bugs to fix for 1.1:

View File

@ -131,12 +131,12 @@ void SizeDialogBase::setupConnections()
connect(&dialogWidget().spinFreeAfter(), SIGNAL(valueChanged(int)), SLOT(onFreeSpaceAfterChanged(int)));
connect(&dialogWidget().spinCapacity(), SIGNAL(valueChanged(int)), SLOT(onCapacityChanged(int)));
connect(&dialogWidget().spinFirstSector(), SIGNAL(valueChanged(int)), SLOT(onSpinFirstSectorChanged(int)));
connect(&dialogWidget().spinLastSector(), SIGNAL(valueChanged(int)), SLOT(onSpinLastSectorChanged(int)));
connect(&dialogWidget().spinFirstSector(), SIGNAL(valueChanged(double)), SLOT(onSpinFirstSectorChanged(double)));
connect(&dialogWidget().spinLastSector(), SIGNAL(valueChanged(double)), SLOT(onSpinLastSectorChanged(double)));
}
void SizeDialogBase::onSpinFirstSectorChanged(int newFirst)
void SizeDialogBase::onSpinFirstSectorChanged(double newFirst)
{
if (newFirst >= minimumFirstSector())
{
@ -145,7 +145,7 @@ void SizeDialogBase::onSpinFirstSectorChanged(int newFirst)
}
}
void SizeDialogBase::onSpinLastSectorChanged(int newLast)
void SizeDialogBase::onSpinLastSectorChanged(double newLast)
{
if (newLast <= maximumLastSector())
{

View File

@ -74,8 +74,8 @@ class SizeDialogBase : public KDialog
void onFreeSpaceBeforeChanged(int newBefore);
void onFreeSpaceAfterChanged(int newAfter);
void onSpinFirstSectorChanged(int newFirst);
void onSpinLastSectorChanged(int newLast);
void onSpinFirstSectorChanged(double newFirst);
void onSpinLastSectorChanged(double newLast);
protected:
SizeDialogWidget* m_SizeDialogWidget;

View File

@ -43,8 +43,8 @@ class SizeDialogWidget : public QWidget, public Ui::SizeDialogWidgetBase
QSpinBox& spinFreeAfter() { Q_ASSERT(m_SpinFreeAfter); return *m_SpinFreeAfter; }
QSpinBox& spinCapacity() { Q_ASSERT(m_SpinCapacity); return *m_SpinCapacity; }
QSpinBox& spinFirstSector() { Q_ASSERT(m_SpinFirstSector); return *m_SpinFirstSector; }
QSpinBox& spinLastSector() { Q_ASSERT(m_SpinLastSector); return *m_SpinLastSector; }
QDoubleSpinBox& spinFirstSector() { Q_ASSERT(m_SpinFirstSector); return *m_SpinFirstSector; }
QDoubleSpinBox& spinLastSector() { Q_ASSERT(m_SpinLastSector); return *m_SpinLastSector; }
QLabel& labelMinSize() { Q_ASSERT(m_LabelMinSize); return *m_LabelMinSize; }
QLabel& labelMaxSize() { Q_ASSERT(m_LabelMaxSize); return *m_LabelMaxSize; }

View File

@ -328,7 +328,7 @@
</widget>
</item>
<item row="11" column="1" colspan="2">
<widget class="QSpinBox" name="m_SpinFirstSector">
<widget class="QDoubleSpinBox" name="m_SpinFirstSector">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>3</horstretch>
@ -338,6 +338,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
</widget>
</item>
<item row="12" column="0">
@ -360,7 +363,7 @@
</widget>
</item>
<item row="12" column="1" colspan="2">
<widget class="QSpinBox" name="m_SpinLastSector">
<widget class="QDoubleSpinBox" name="m_SpinLastSector">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>3</horstretch>
@ -370,6 +373,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>0</number>
</property>
</widget>
</item>
<item row="13" column="0" colspan="3">