2015-02-07 00:32:25 +00:00
/*************************************************************************
* Copyright ( C ) 2008 , 2009 by Volker Lanz < vl @ fidra . de > *
2016-03-02 18:33:40 +00:00
* Copyright ( C ) 2016 by Andrius Š tikonas < andrius @ stikonas . eu > *
2015-02-07 00:32:25 +00:00
* *
* This program is free software ; you can redistribute it and / or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation ; either version 3 of *
* the License , or ( at your option ) any later version . *
* *
* This program is distributed in the hope that it will be useful , *
* but WITHOUT ANY WARRANTY ; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the *
* GNU General Public License for more details . *
* *
* You should have received a copy of the GNU General Public License *
* along with this program . If not , see < http : //www.gnu.org/licenses/>.*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2008-09-24 20:32:01 +01:00
# include "gui/partpropsdialog.h"
# include "gui/partpropswidget.h"
2016-01-12 00:12:49 +00:00
# include <core/partition.h>
# include <core/device.h>
2008-09-24 20:32:01 +01:00
2016-01-12 00:12:49 +00:00
# include <fs/filesystemfactory.h>
2009-05-05 20:33:55 +01:00
2016-01-12 00:12:49 +00:00
# include <util/capacity.h>
# include <util/helpers.h>
2015-06-12 13:11:29 +01:00
# include "util/guihelpers.h"
2008-09-24 20:32:01 +01:00
2014-05-17 03:06:58 +01:00
# include <QComboBox>
2014-05-18 21:41:48 +01:00
# include <QFontDatabase>
2014-05-17 03:06:58 +01:00
# include <QLineEdit>
2014-05-18 21:41:48 +01:00
# include <QLocale>
2014-05-17 03:06:58 +01:00
# include <QPushButton>
2014-05-13 23:53:37 +01:00
# include <QtAlgorithms>
2014-05-17 03:06:58 +01:00
# include <KConfigGroup>
2014-05-13 23:53:37 +01:00
# include <KLocalizedString>
2014-05-18 21:41:48 +01:00
# include <KMessageBox>
# include <KSharedConfig>
2008-09-24 20:32:01 +01:00
/** Creates a new PartPropsDialog
2015-07-13 15:17:41 +01:00
@ param parent pointer to the parent widget
@ param d the Device the Partition is on
@ param p the Partition to show properties for
2008-09-24 20:32:01 +01:00
*/
PartPropsDialog : : PartPropsDialog ( QWidget * parent , Device & d , Partition & p ) :
2015-07-13 15:17:41 +01:00
QDialog ( parent ) ,
m_Device ( d ) ,
m_Partition ( p ) ,
m_WarnFileSystemChange ( false ) ,
m_DialogWidget ( new PartPropsWidget ( this ) ) ,
m_ReadOnly ( partition ( ) . isMounted ( ) | | partition ( ) . state ( ) = = Partition : : StateCopy | | partition ( ) . state ( ) = = Partition : : StateRestore | | d . partitionTable ( ) - > isReadOnly ( ) ) ,
m_ForceRecreate ( false )
2008-09-24 20:32:01 +01:00
{
2015-07-13 15:17:41 +01:00
mainLayout = new QVBoxLayout ( this ) ;
setLayout ( mainLayout ) ;
mainLayout - > addWidget ( & dialogWidget ( ) ) ;
2014-05-17 03:06:58 +01:00
2015-07-13 15:17:41 +01:00
setWindowTitle ( xi18nc ( " @title:window " , " Partition properties: <filename>%1</filename> " , partition ( ) . deviceNode ( ) ) ) ;
2008-09-24 20:32:01 +01:00
2015-07-13 15:17:41 +01:00
setupDialog ( ) ;
setupConnections ( ) ;
2008-09-24 20:32:01 +01:00
2015-07-13 15:17:41 +01:00
KConfigGroup kcg ( KSharedConfig : : openConfig ( ) , " partPropsDialog " ) ;
restoreGeometry ( kcg . readEntry < QByteArray > ( " Geometry " , QByteArray ( ) ) ) ;
2008-09-24 20:32:01 +01:00
}
/** Destroys a PartPropsDialog */
PartPropsDialog : : ~ PartPropsDialog ( )
{
2015-07-13 15:17:41 +01:00
KConfigGroup kcg ( KSharedConfig : : openConfig ( ) , " partPropsDialog " ) ;
kcg . writeEntry ( " Geometry " , saveGeometry ( ) ) ;
2008-09-24 20:32:01 +01:00
}
/** @return the new label */
QString PartPropsDialog : : newLabel ( ) const
{
2015-07-13 15:17:41 +01:00
return dialogWidget ( ) . label ( ) . text ( ) ;
2008-09-24 20:32:01 +01:00
}
/** @return the new Partition flags */
PartitionTable : : Flags PartPropsDialog : : newFlags ( ) const
{
2015-07-13 15:17:41 +01:00
PartitionTable : : Flags flags ;
2008-09-24 20:32:01 +01:00
2015-07-13 15:17:41 +01:00
for ( int i = 0 ; i < dialogWidget ( ) . listFlags ( ) . count ( ) ; i + + )
if ( dialogWidget ( ) . listFlags ( ) . item ( i ) - > checkState ( ) = = Qt : : Checked )
flags | = static_cast < PartitionTable : : Flag > ( dialogWidget ( ) . listFlags ( ) . item ( i ) - > data ( Qt : : UserRole ) . toInt ( ) ) ;
2008-09-24 20:32:01 +01:00
2015-07-13 15:17:41 +01:00
return flags ;
2008-09-24 20:32:01 +01:00
}
/** @return the new FileSystem type */
FileSystem : : Type PartPropsDialog : : newFileSystemType ( ) const
{
2015-07-13 15:17:41 +01:00
return FileSystem : : typeForName ( dialogWidget ( ) . fileSystem ( ) . currentText ( ) ) ;
2008-09-24 20:32:01 +01:00
}
void PartPropsDialog : : setupDialog ( )
{
2015-07-13 15:17:41 +01:00
dialogButtonBox = new QDialogButtonBox ;
okButton = dialogButtonBox - > addButton ( QDialogButtonBox : : Ok ) ;
cancelButton = dialogButtonBox - > addButton ( QDialogButtonBox : : Cancel ) ;
mainLayout - > addWidget ( dialogButtonBox ) ;
okButton - > setEnabled ( false ) ;
cancelButton - > setFocus ( ) ;
cancelButton - > setDefault ( true ) ;
2016-05-18 22:23:59 +01:00
connect ( dialogButtonBox , & QDialogButtonBox : : accepted , this , & PartPropsDialog : : accept ) ;
connect ( dialogButtonBox , & QDialogButtonBox : : rejected , this , & PartPropsDialog : : reject ) ;
2015-07-13 15:17:41 +01:00
dialogWidget ( ) . partWidget ( ) . init ( & partition ( ) ) ;
const QString mp = partition ( ) . mountPoint ( ) . isEmpty ( )
? i18nc ( " @item mountpoint " , " (none found) " )
: partition ( ) . mountPoint ( ) ;
dialogWidget ( ) . mountPoint ( ) . setText ( mp ) ;
dialogWidget ( ) . role ( ) . setText ( partition ( ) . roles ( ) . toString ( ) ) ;
QString statusText = i18nc ( " @label partition state " , " idle " ) ;
if ( partition ( ) . isMounted ( ) ) {
if ( partition ( ) . roles ( ) . has ( PartitionRole : : Extended ) )
statusText = i18nc ( " @label partition state " , " At least one logical partition is mounted. " ) ;
else if ( ! partition ( ) . mountPoint ( ) . isEmpty ( ) )
statusText = xi18nc ( " @label partition state " , " mounted on <filename>%1</filename> " , mp ) ;
else
statusText = i18nc ( " @label partition state " , " mounted " ) ;
}
dialogWidget ( ) . status ( ) . setText ( statusText ) ;
dialogWidget ( ) . uuid ( ) . setText ( partition ( ) . fileSystem ( ) . uuid ( ) . isEmpty ( ) ? i18nc ( " @item uuid " , " (none) " ) : partition ( ) . fileSystem ( ) . uuid ( ) ) ;
setupFileSystemComboBox ( ) ;
// don't do this before the file system combo box has been set up!
dialogWidget ( ) . label ( ) . setText ( newLabel ( ) . isEmpty ( ) ? partition ( ) . fileSystem ( ) . label ( ) : newLabel ( ) ) ;
dialogWidget ( ) . capacity ( ) . setText ( Capacity : : formatByteSize ( partition ( ) . capacity ( ) ) ) ;
if ( Capacity ( partition ( ) , Capacity : : Available ) . isValid ( ) ) {
const qint64 availPercent = ( partition ( ) . fileSystem ( ) . length ( ) - partition ( ) . fileSystem ( ) . sectorsUsed ( ) ) * 100 / partition ( ) . fileSystem ( ) . length ( ) ;
const QString availString = QStringLiteral ( " %1% - %2 " )
. arg ( availPercent )
. arg ( Capacity : : formatByteSize ( partition ( ) . available ( ) ) ) ;
const QString usedString = QStringLiteral ( " %1% - %2 " )
. arg ( 100 - availPercent )
. arg ( Capacity : : formatByteSize ( partition ( ) . used ( ) ) ) ;
dialogWidget ( ) . available ( ) . setText ( availString ) ;
dialogWidget ( ) . used ( ) . setText ( usedString ) ;
} else {
dialogWidget ( ) . available ( ) . setText ( Capacity : : invalidString ( ) ) ;
dialogWidget ( ) . used ( ) . setText ( Capacity : : invalidString ( ) ) ;
}
dialogWidget ( ) . firstSector ( ) . setText ( QLocale ( ) . toString ( partition ( ) . firstSector ( ) ) ) ;
dialogWidget ( ) . lastSector ( ) . setText ( QLocale ( ) . toString ( partition ( ) . lastSector ( ) ) ) ;
dialogWidget ( ) . numSectors ( ) . setText ( QLocale ( ) . toString ( partition ( ) . length ( ) ) ) ;
setupFlagsList ( ) ;
updateHideAndShow ( ) ;
setMinimumSize ( dialogWidget ( ) . size ( ) ) ;
resize ( dialogWidget ( ) . size ( ) ) ;
2008-09-24 20:32:01 +01:00
}
void PartPropsDialog : : setupFlagsList ( )
{
2015-07-13 15:17:41 +01:00
int f = 1 ;
QString s ;
while ( ! ( s = PartitionTable : : flagName ( static_cast < PartitionTable : : Flag > ( f ) ) ) . isEmpty ( ) ) {
if ( partition ( ) . availableFlags ( ) & f ) {
QListWidgetItem * item = new QListWidgetItem ( s ) ;
dialogWidget ( ) . listFlags ( ) . addItem ( item ) ;
item - > setFlags ( Qt : : ItemIsUserCheckable | Qt : : ItemIsEnabled ) ;
item - > setData ( Qt : : UserRole , f ) ;
item - > setCheckState ( ( partition ( ) . activeFlags ( ) & f ) ? Qt : : Checked : Qt : : Unchecked ) ;
}
f < < = 1 ;
}
2008-09-24 20:32:01 +01:00
}
void PartPropsDialog : : updateHideAndShow ( )
{
2015-07-13 15:17:41 +01:00
// create a temporary fs for some checks
const FileSystem * fs = FileSystemFactory : : create ( newFileSystemType ( ) , - 1 , - 1 , - 1 , QString ( ) ) ;
2016-04-14 19:18:36 +01:00
if ( fs = = nullptr | | fs - > supportSetLabel ( ) = = FileSystem : : cmdSupportNone ) {
2015-07-13 15:17:41 +01:00
dialogWidget ( ) . label ( ) . setReadOnly ( true ) ;
dialogWidget ( ) . noSetLabel ( ) . setVisible ( true ) ;
dialogWidget ( ) . noSetLabel ( ) . setFont ( QFontDatabase : : systemFont ( QFontDatabase : : SmallestReadableFont ) ) ;
QPalette palette = dialogWidget ( ) . noSetLabel ( ) . palette ( ) ;
QColor f = palette . color ( QPalette : : Foreground ) ;
f . setAlpha ( 128 ) ;
palette . setColor ( QPalette : : Foreground , f ) ;
dialogWidget ( ) . noSetLabel ( ) . setPalette ( palette ) ;
} else {
dialogWidget ( ) . label ( ) . setReadOnly ( isReadOnly ( ) ) ;
dialogWidget ( ) . noSetLabel ( ) . setVisible ( false ) ;
}
// when do we show the uuid?
const bool showUuid =
partition ( ) . state ( ) ! = Partition : : StateNew & & // not for new partitions
2016-04-14 19:18:36 +01:00
! ( fs = = nullptr | | fs - > supportGetUUID ( ) = = FileSystem : : cmdSupportNone ) ; // not if the FS doesn't support it
2015-07-13 15:17:41 +01:00
dialogWidget ( ) . showUuid ( showUuid ) ;
delete fs ;
// when do we show available and used capacity?
const bool showAvailableAndUsed =
partition ( ) . state ( ) ! = Partition : : StateNew & & // not for new partitions
! partition ( ) . roles ( ) . has ( PartitionRole : : Extended ) & & // neither for extended
! partition ( ) . roles ( ) . has ( PartitionRole : : Unallocated ) & & // or for unallocated
newFileSystemType ( ) ! = FileSystem : : Unformatted ; // and not for unformatted file systems
dialogWidget ( ) . showAvailable ( showAvailableAndUsed ) ;
dialogWidget ( ) . showUsed ( showAvailableAndUsed ) ;
// when do we show the file system combo box?
const bool showFileSystem =
! partition ( ) . roles ( ) . has ( PartitionRole : : Extended ) & & // not for extended, they have no file system
2016-05-18 11:54:24 +01:00
! partition ( ) . roles ( ) . has ( PartitionRole : : Unallocated ) & & // and not for unallocated: no choice there
2016-05-18 19:14:20 +01:00
// do now show file system comboBox for open luks volumes.
! ( partition ( ) . roles ( ) . has ( PartitionRole : : Luks ) & & partition ( ) . fileSystem ( ) . type ( ) ! = FileSystem : : Luks ) ;
2015-07-13 15:17:41 +01:00
dialogWidget ( ) . showFileSystem ( showFileSystem ) ;
// when do we show the recreate file system check box?
const bool showCheckRecreate =
showFileSystem & & // only if we also show the file system
partition ( ) . fileSystem ( ) . supportCreate ( ) ! = FileSystem : : cmdSupportNone & & // and support creating this file system
partition ( ) . fileSystem ( ) . type ( ) ! = FileSystem : : Unknown & & // and not for unknown file systems
2016-05-17 18:53:14 +01:00
partition ( ) . state ( ) ! = Partition : : StateNew & & // or new partitions
! partition ( ) . roles ( ) . has ( PartitionRole : : Luks ) ; // or encrypted filesystems
2015-07-13 15:17:41 +01:00
dialogWidget ( ) . showCheckRecreate ( showCheckRecreate ) ;
// when do we show the list of partition flags?
const bool showListFlags =
partition ( ) . state ( ) ! = Partition : : StateNew & & // not for new partitions
! partition ( ) . roles ( ) . has ( PartitionRole : : Unallocated ) ; // and not for unallocated space
dialogWidget ( ) . showListFlags ( showListFlags ) ;
dialogWidget ( ) . checkRecreate ( ) . setEnabled ( ! isReadOnly ( ) ) ;
dialogWidget ( ) . listFlags ( ) . setEnabled ( ! isReadOnly ( ) ) ;
dialogWidget ( ) . fileSystem ( ) . setEnabled ( ! isReadOnly ( ) & & ! forceRecreate ( ) ) ;
2008-09-24 20:32:01 +01:00
}
void PartPropsDialog : : setupConnections ( )
{
2016-05-22 20:03:49 +01:00
connect ( & dialogWidget ( ) . label ( ) , & QLineEdit : : textEdited , this , & PartPropsDialog : : setDirty2 ) ;
connect ( & dialogWidget ( ) . fileSystem ( ) , static_cast < void ( QComboBox : : * ) ( int ) > ( & QComboBox : : currentIndexChanged ) , this , & PartPropsDialog : : onFilesystemChanged ) ;
connect ( & dialogWidget ( ) . checkRecreate ( ) , & QCheckBox : : stateChanged , this , & PartPropsDialog : : onRecreate ) ;
2015-07-13 15:17:41 +01:00
// We want to enable the OK-button whenever the user checks or unchecks a flag in the flag list.
// But it seems Qt doesn't offer a foolproof way to detect if this has happened: The currentRow/ItemChanged
// signal only means the _current_ item has changed, but not necessarily that it was checked/unchecked. And
// itemClicked alone isn't enough either. We choose to rather enable the OK-button too often than too
// seldom.
2016-05-22 20:03:49 +01:00
connect ( & dialogWidget ( ) . listFlags ( ) , & QListWidget : : itemClicked , this , & PartPropsDialog : : setDirty ) ;
connect ( & dialogWidget ( ) . listFlags ( ) , & QListWidget : : currentRowChanged , this , & PartPropsDialog : : setDirty3 ) ;
2008-09-24 20:32:01 +01:00
}
2016-05-22 20:03:49 +01:00
void PartPropsDialog : : setDirty ( void * )
2008-09-24 20:32:01 +01:00
{
2015-07-13 15:17:41 +01:00
okButton - > setEnabled ( true ) ;
okButton - > setDefault ( true ) ;
2008-09-24 20:32:01 +01:00
}
void PartPropsDialog : : setupFileSystemComboBox ( )
{
2015-07-13 15:17:41 +01:00
dialogWidget ( ) . fileSystem ( ) . clear ( ) ;
QString selected ;
QStringList fsNames ;
2016-05-18 19:14:20 +01:00
for ( const FileSystem * fs : FileSystemFactory : : map ( ) )
{
// If the partition isn't encrypted, skip the luks FS
if ( fs - > type ( ) = = FileSystem : : Luks & & partition ( ) . fileSystem ( ) . type ( ) ! = FileSystem : : Luks )
2015-07-13 15:17:41 +01:00
continue ;
2016-05-18 19:14:20 +01:00
if ( partition ( ) . fileSystem ( ) . type ( ) = = fs - > type ( ) | | ( fs - > supportCreate ( ) ! = FileSystem : : cmdSupportNone & &
partition ( ) . capacity ( ) > = fs - > minCapacity ( ) & & partition ( ) . capacity ( ) < = fs - > maxCapacity ( ) ) ) {
QString name = fs - > name ( ) ;
2015-07-13 15:17:41 +01:00
2016-05-18 19:14:20 +01:00
if ( partition ( ) . fileSystem ( ) . type ( ) = = fs - > type ( ) )
2015-07-13 15:17:41 +01:00
selected = name ;
2016-05-18 19:14:20 +01:00
// If the partition isn't extended, skip the extended FS
if ( fs - > type ( ) = = FileSystem : : Extended & & ! partition ( ) . roles ( ) . has ( PartitionRole : : Extended ) )
2015-07-13 15:17:41 +01:00
continue ;
2016-05-18 19:14:20 +01:00
// The user cannot change the filesystem back to "unformatted" once a filesystem has been created.
if ( fs - > type ( ) = = FileSystem : : Unformatted ) {
// .. but if the file system is unknown to us, show the unformatted option as the currently selected one
if ( partition ( ) . fileSystem ( ) . type ( ) = = FileSystem : : Unknown ) {
name = FileSystem : : nameForType ( FileSystem : : Unformatted ) ;
selected = name ;
} else if ( partition ( ) . fileSystem ( ) . type ( ) ! = FileSystem : : Unformatted & & partition ( ) . state ( ) ! = Partition : : StateNew )
continue ;
}
fsNames . append ( name ) ;
}
2015-07-13 15:17:41 +01:00
}
qSort ( fsNames . begin ( ) , fsNames . end ( ) , caseInsensitiveLessThan ) ;
2016-05-18 19:14:20 +01:00
for ( const QString & fsName : fsNames )
dialogWidget ( ) . fileSystem ( ) . addItem ( createFileSystemColor ( FileSystem : : typeForName ( fsName ) , 8 ) , fsName ) ;
2015-07-13 15:17:41 +01:00
dialogWidget ( ) . fileSystem ( ) . setCurrentIndex ( dialogWidget ( ) . fileSystem ( ) . findText ( selected ) ) ;
const FileSystem * fs = FileSystemFactory : : create ( FileSystem : : typeForName ( dialogWidget ( ) . fileSystem ( ) . currentText ( ) ) , - 1 , - 1 , - 1 , QString ( ) ) ;
dialogWidget ( ) . m_EditLabel - > setMaxLength ( fs - > maxLabelLength ( ) ) ;
2008-09-24 20:32:01 +01:00
}
2010-02-17 19:39:24 +00:00
void PartPropsDialog : : updatePartitionFileSystem ( )
{
2015-07-13 15:17:41 +01:00
FileSystem * fs = FileSystemFactory : : create ( newFileSystemType ( ) , partition ( ) . firstSector ( ) , partition ( ) . lastSector ( ) ) ;
partition ( ) . deleteFileSystem ( ) ;
partition ( ) . setFileSystem ( fs ) ;
dialogWidget ( ) . partWidget ( ) . update ( ) ;
2010-02-17 19:39:24 +00:00
}
2008-09-24 20:32:01 +01:00
void PartPropsDialog : : onFilesystemChanged ( int )
{
2015-07-13 15:17:41 +01:00
if ( partition ( ) . state ( ) = = Partition : : StateNew | | warnFileSystemChange ( ) | | KMessageBox : : warningContinueCancel ( this ,
xi18nc ( " @info " , " <para><warning>You are about to lose all data on partition <filename>%1</filename>.</warning></para> "
" <para>Changing the file system on a partition already on disk will erase all its contents. If you continue now and apply the resulting operation in the main window, all data on <filename>%1</filename> will unrecoverably be lost.</para> " , partition ( ) . deviceNode ( ) ) ,
xi18nc ( " @title:window " , " Really Recreate <filename>%1</filename> with File System %2? " , partition ( ) . deviceNode ( ) , dialogWidget ( ) . fileSystem ( ) . currentText ( ) ) ,
KGuiItem ( i18nc ( " @action:button " , " Change the File System " ) , QStringLiteral ( " arrow-right " ) ) ,
KGuiItem ( i18nc ( " @action:button " , " Do Not Change the File System " ) , QStringLiteral ( " dialog-cancel " ) ) , QStringLiteral ( " reallyChangeFileSystem " ) ) = = KMessageBox : : Continue ) {
setDirty ( ) ;
updateHideAndShow ( ) ;
setWarnFileSystemChange ( ) ;
updatePartitionFileSystem ( ) ;
const FileSystem * fs = FileSystemFactory : : create ( FileSystem : : typeForName ( dialogWidget ( ) . fileSystem ( ) . currentText ( ) ) , - 1 , - 1 , - 1 , QString ( ) ) ;
dialogWidget ( ) . m_EditLabel - > setMaxLength ( fs - > maxLabelLength ( ) ) ;
} else {
dialogWidget ( ) . fileSystem ( ) . disconnect ( this ) ;
setupFileSystemComboBox ( ) ;
2016-05-22 20:03:49 +01:00
connect ( & dialogWidget ( ) . fileSystem ( ) , static_cast < void ( QComboBox : : * ) ( int ) > ( & QComboBox : : currentIndexChanged ) , this , & PartPropsDialog : : onFilesystemChanged ) ;
2015-07-13 15:17:41 +01:00
}
2008-09-24 20:32:01 +01:00
}
void PartPropsDialog : : onRecreate ( int state )
{
2015-07-13 15:17:41 +01:00
if ( state = = Qt : : Checked & & ( warnFileSystemChange ( ) | | KMessageBox : : warningContinueCancel ( this ,
xi18nc ( " @info " , " <para><warning>You are about to lose all data on partition <filename>%1</filename>.</warning></para> "
" <para>Recreating a file system will erase all its contents. If you continue now and apply the resulting operation in the main window, all data on <filesystem>%1</filesystem> will unrecoverably be lost.</para> " , partition ( ) . deviceNode ( ) ) ,
xi18nc ( " @title:window " , " Really Recreate File System on <filename>%1</filename>? " , partition ( ) . deviceNode ( ) ) ,
KGuiItem ( i18nc ( " @action:button " , " Recreate the File System " ) , QStringLiteral ( " arrow-right " ) ) ,
KGuiItem ( i18nc ( " @action:button " , " Do Not Recreate the File System " ) , QStringLiteral ( " dialog-cancel " ) ) , QStringLiteral ( " reallyRecreateFileSystem " ) ) = = KMessageBox : : Continue ) ) {
setDirty ( ) ;
setWarnFileSystemChange ( ) ;
setForceRecreate ( true ) ;
dialogWidget ( ) . fileSystem ( ) . setCurrentIndex ( dialogWidget ( ) . fileSystem ( ) . findText ( partition ( ) . fileSystem ( ) . name ( ) ) ) ;
dialogWidget ( ) . fileSystem ( ) . setEnabled ( false ) ;
updateHideAndShow ( ) ;
updatePartitionFileSystem ( ) ;
} else {
setForceRecreate ( false ) ;
dialogWidget ( ) . checkRecreate ( ) . setCheckState ( Qt : : Unchecked ) ;
dialogWidget ( ) . fileSystem ( ) . setEnabled ( true ) ;
updateHideAndShow ( ) ;
}
2008-09-24 20:32:01 +01:00
}