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
This commit is contained in:
parent
06e7a29038
commit
4849ec5ff8
|
@ -25,5 +25,27 @@
|
|||
<entry name="allowApplyOperationsAsNonRoot" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry key="FileSystemColorCode$(colorNumber)" type="Color">
|
||||
<parameter name="colorNumber" type="UInt" max="18"/>
|
||||
<default param="0">252,242,220</default>
|
||||
<default param="1">187,249,207</default>
|
||||
<default param="2">122,145,180</default>
|
||||
<default param="3">143,169,210</default>
|
||||
<default param="4">173,205,255</default>
|
||||
<default param="5">155,155,130</default>
|
||||
<default param="6">204,179,215</default>
|
||||
<default param="7">229,201,240</default>
|
||||
<default param="8">244,214,255</default>
|
||||
<default param="9">216,220,135</default>
|
||||
<default param="10">251,255,157</default>
|
||||
<default param="11">200,255,254</default>
|
||||
<default param="12">137,200,198</default>
|
||||
<default param="13">210,136,142</default>
|
||||
<default param="14">240,165,171</default>
|
||||
<default param="15">151,220,134</default>
|
||||
<default param="16">252,242,222</default>
|
||||
<default param="17">255,255,255</default>
|
||||
<default param="18">247,231,231</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
|
|
@ -35,6 +35,7 @@ class PartResizerWidget;
|
|||
class InsertDialog;
|
||||
class NewDialog;
|
||||
class EditMountPointDialog;
|
||||
class PartPropsDialog;
|
||||
|
||||
class CreateFileSystemOperation;
|
||||
class RestoreOperation;
|
||||
|
@ -75,6 +76,7 @@ class Partition : public PartitionNode
|
|||
friend class InsertDialog;
|
||||
friend class NewDialog;
|
||||
friend class EditMountPointDialog;
|
||||
friend class PartPropsDialog;
|
||||
|
||||
friend class CreateFileSystemOperation;
|
||||
friend class RestoreOperation;
|
||||
|
|
|
@ -45,24 +45,25 @@ class FileSystem
|
|||
enum Type
|
||||
{
|
||||
Unknown = 0,
|
||||
Extended,
|
||||
Extended = 1,
|
||||
|
||||
Ext2,
|
||||
Ext3,
|
||||
Ext4,
|
||||
LinuxSwap,
|
||||
Fat16,
|
||||
Fat32,
|
||||
Ntfs,
|
||||
ReiserFS,
|
||||
Reiser4,
|
||||
Xfs,
|
||||
Jfs,
|
||||
Hfs,
|
||||
HfsPlus,
|
||||
Ufs,
|
||||
Unformatted,
|
||||
__lastType
|
||||
Ext2 = 2,
|
||||
Ext3 = 3,
|
||||
Ext4 = 4,
|
||||
LinuxSwap = 5,
|
||||
Fat16 = 6,
|
||||
Fat32 = 7,
|
||||
Ntfs = 8,
|
||||
ReiserFS = 9,
|
||||
Reiser4 = 10,
|
||||
Xfs = 11,
|
||||
Jfs = 12,
|
||||
Hfs = 13,
|
||||
HfsPlus = 14,
|
||||
Ufs = 15,
|
||||
Unformatted = 16,
|
||||
|
||||
__lastType = 17
|
||||
};
|
||||
|
||||
/** The type of support for a given FileSystem action */
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "gui/configureoptionsdialog.h"
|
||||
|
||||
#include "ui_configurepagegeneral.h"
|
||||
#include "ui_configurepagefilesystemcolors.h"
|
||||
#include "ui_configurepageadvanced.h"
|
||||
|
||||
class GeneralPageWidget : public QWidget, public Ui::ConfigurePageGeneral
|
||||
|
@ -28,6 +29,12 @@ class GeneralPageWidget : public QWidget, public Ui::ConfigurePageGeneral
|
|||
GeneralPageWidget(QWidget* parent) : QWidget(parent) { setupUi(this); }
|
||||
};
|
||||
|
||||
class FileSystemColorsPageWidget : public QWidget, public Ui::ConfigurePageFileSystemColors
|
||||
{
|
||||
public:
|
||||
FileSystemColorsPageWidget(QWidget* parent) : QWidget(parent) { setupUi(this); }
|
||||
};
|
||||
|
||||
class AdvancedPageWidget : public QWidget, public Ui::ConfigurePageAdvanced
|
||||
{
|
||||
public:
|
||||
|
@ -39,5 +46,6 @@ ConfigureOptionsDialog::ConfigureOptionsDialog(QWidget* parent, const QString& n
|
|||
{
|
||||
setFaceType(KPageDialog::Tabbed);
|
||||
addPage(new GeneralPageWidget(this), i18n("General"), QString(), i18n("General Settings"));
|
||||
addPage(new FileSystemColorsPageWidget(this), i18n("File System Colors"), QString(), i18n("File System Color Settings"));
|
||||
addPage(new AdvancedPageWidget(this), i18n("Advanced"), QString(), i18n("Advanced Settings"));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,544 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigurePageFileSystemColors</class>
|
||||
<widget class="QWidget" name="ConfigurePageFileSystemColors">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>509</width>
|
||||
<height>504</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>3</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>File Systems</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="textLabel">
|
||||
<property name="text">
|
||||
<string>ext2:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode2"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="textLabel_2">
|
||||
<property name="text">
|
||||
<string>ext3:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode3"/>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>43</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="textLabel_3">
|
||||
<property name="text">
|
||||
<string>ext4:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode4"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="textLabel_4">
|
||||
<property name="text">
|
||||
<string>linuxswap:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode5"/>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="textLabel_6">
|
||||
<property name="text">
|
||||
<string>fat16:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode6"/>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>43</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QLabel" name="textLabel_5">
|
||||
<property name="text">
|
||||
<string>fat32:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode7"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="textLabel_9">
|
||||
<property name="text">
|
||||
<string>ntfs:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode8"/>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="textLabel_7">
|
||||
<property name="text">
|
||||
<string>reiserfs:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode9"/>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>43</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="6">
|
||||
<widget class="QLabel" name="textLabel_8">
|
||||
<property name="text">
|
||||
<string>reiser4:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="7">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode10"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="textLabel_10">
|
||||
<property name="text">
|
||||
<string>xfs:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode11"/>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="textLabel_11">
|
||||
<property name="text">
|
||||
<string>jfs</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode12"/>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>43</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="6">
|
||||
<widget class="QLabel" name="textLabel_12">
|
||||
<property name="text">
|
||||
<string>hfs:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="7">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode13"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="textLabel_14">
|
||||
<property name="text">
|
||||
<string>hfsplus:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode14"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="textLabel_15">
|
||||
<property name="text">
|
||||
<string>ufs:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode15"/>
|
||||
</item>
|
||||
<item row="4" column="5">
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>43</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="6">
|
||||
<widget class="QLabel" name="textLabel_13">
|
||||
<property name="text">
|
||||
<string>extended:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="7">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode1"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="textLabel_16">
|
||||
<property name="text">
|
||||
<string>unknown:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode0"/>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>17</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="textLabel_17">
|
||||
<property name="text">
|
||||
<string>unformatted:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode16"/>
|
||||
</item>
|
||||
<item row="5" column="5" colspan="3">
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>176</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Available and Used Space</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="textLabel_19">
|
||||
<property name="text">
|
||||
<string>Available:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode17"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_14">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>61</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="textLabel_18">
|
||||
<property name="text">
|
||||
<string>Used:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="KColorButton" name="kcfg_FileSystemColorCode18"/>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>167</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KColorButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>kcolorbutton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -67,7 +67,10 @@ void NewDialog::setupDialog()
|
|||
fsNames.append(fs->name());
|
||||
|
||||
qSort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
|
||||
dialogWidget().comboFileSystem().addItems(fsNames);
|
||||
|
||||
foreach (const QString& fsName, fsNames)
|
||||
dialogWidget().comboFileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName);
|
||||
|
||||
QString selected = FileSystem::nameForType(FileSystem::defaultFileSystem());
|
||||
dialogWidget().comboFileSystem().setCurrentIndex(dialogWidget().comboFileSystem().findText(selected));
|
||||
|
||||
|
@ -137,6 +140,7 @@ void NewDialog::onFilesystemChanged(int idx)
|
|||
setupConstraints();
|
||||
|
||||
dialogWidget().partResizerWidget().updateLength(partition().length());
|
||||
dialogWidget().partResizerWidget().update();
|
||||
|
||||
updateHideAndShow();
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "util/globallog.h"
|
||||
#include "util/capacity.h"
|
||||
#include "util/report.h"
|
||||
#include "util/helpers.h"
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kaction.h>
|
||||
|
@ -444,7 +445,10 @@ static QTreeWidgetItem* createTreeWidgetItem(const Partition& p)
|
|||
|
||||
quint32 i = 0;
|
||||
item->setText(i++, p.deviceNode());
|
||||
item->setText(i++, p.fileSystem().name());
|
||||
|
||||
item->setText(i, p.fileSystem().name());
|
||||
item->setIcon(i, createFileSystemColor(p.fileSystem().type(), 14));
|
||||
i++;
|
||||
|
||||
item->setText(i, p.mountPoints().join(", "));
|
||||
if (p.isMounted())
|
||||
|
@ -1186,6 +1190,7 @@ void PartitionManagerWidget::onFileSystemSupport()
|
|||
void PartitionManagerWidget::onSettingsChanged(const QString&)
|
||||
{
|
||||
enableActions();
|
||||
updatePartitions();
|
||||
}
|
||||
|
||||
void PartitionManagerWidget::onConfigureOptions()
|
||||
|
|
|
@ -292,10 +292,20 @@ void PartPropsDialog::setupFileSystemComboBox()
|
|||
|
||||
qSort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
|
||||
|
||||
dialogWidget().fileSystem().addItems(fsNames);
|
||||
foreach (const QString& fsName, fsNames)
|
||||
dialogWidget().fileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName);
|
||||
|
||||
dialogWidget().fileSystem().setCurrentIndex(dialogWidget().fileSystem().findText(selected));
|
||||
}
|
||||
|
||||
void PartPropsDialog::updatePartitionFileSystem()
|
||||
{
|
||||
FileSystem* fs = FileSystemFactory::create(newFileSystemType(), partition().firstSector(), partition().lastSector());
|
||||
partition().deleteFileSystem();
|
||||
partition().setFileSystem(fs);
|
||||
dialogWidget().partResizerWidget().update();
|
||||
}
|
||||
|
||||
void PartPropsDialog::onFilesystemChanged(int)
|
||||
{
|
||||
if (partition().state() == Partition::StateNew || warnFileSystemChange() || KMessageBox::warningContinueCancel(this,
|
||||
|
@ -308,6 +318,7 @@ void PartPropsDialog::onFilesystemChanged(int)
|
|||
setDirty();
|
||||
updateHideAndShow();
|
||||
setWarnFileSystemChange();
|
||||
updatePartitionFileSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -332,6 +343,7 @@ void PartPropsDialog::onRecreate(int state)
|
|||
dialogWidget().fileSystem().setCurrentIndex(dialogWidget().fileSystem().findText(partition().fileSystem().name()));
|
||||
dialogWidget().fileSystem().setEnabled(false);
|
||||
updateHideAndShow();
|
||||
updatePartitionFileSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
#include "fs/filesystem.h"
|
||||
|
||||
#include "core/partition.h"
|
||||
#include "core/partitiontable.h"
|
||||
|
||||
#include <kdialog.h>
|
||||
|
||||
class Device;
|
||||
class Partition;
|
||||
class PartPropsWidget;
|
||||
|
||||
class QWidget;
|
||||
|
@ -79,14 +79,22 @@ class PartPropsDialog : public KDialog
|
|||
bool isReadOnly() const { return m_ReadOnly; }
|
||||
void setForceRecreate(bool b) { m_ForceRecreate = b; }
|
||||
|
||||
void updatePartitionFileSystem();
|
||||
|
||||
protected slots:
|
||||
void setDirty();
|
||||
void onFilesystemChanged(int idx);
|
||||
void onRecreate(int);
|
||||
|
||||
private:
|
||||
// m_Device and m_Partition cannot be const because the PartResizerWidget takes
|
||||
// both as nonconst even in read only mode (which is a bad design flaw and should be
|
||||
// fixed by splitting it in a PartDisplayWidget that is read-only and a PartResizerWidget
|
||||
// subclassed from that, maybe)
|
||||
Device& m_Device;
|
||||
Partition& m_Partition;
|
||||
// m_Partition is also not a reference because we want to be able to change it and
|
||||
// forget the changes if the user cancels the dialog
|
||||
Partition m_Partition;
|
||||
bool m_WarnFileSystemChange;
|
||||
PartPropsWidget* m_DialogWidget;
|
||||
bool m_ReadOnly;
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include <kcolorscheme.h>
|
||||
#include <kglobalsettings.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/** Creates a new PartWidget
|
||||
@param parent pointer to the parent widget
|
||||
@param ptWidget pointer to the PartTableWidget this widget will be in
|
||||
|
@ -111,7 +113,7 @@ void PartWidget::drawPartition(QWidget* destWidget)
|
|||
|
||||
// draw border
|
||||
painter.setPen(colorScheme.foreground().color());
|
||||
painter.setBrush(colorScheme.background(partition()->roles().has(PartitionRole::Extended) ? KColorScheme::PositiveBackground : KColorScheme::NeutralBackground));
|
||||
painter.setBrush(Config::fileSystemColorCode(partition()->fileSystem().type()));
|
||||
painter.drawRect(QRect(0, 0, destWidget->width() - 1, destWidget->height() - 1));
|
||||
|
||||
if (partition()->roles().has(PartitionRole::Extended))
|
||||
|
|
|
@ -34,6 +34,12 @@
|
|||
#include <QProcess>
|
||||
#include <QFileInfo>
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QIcon>
|
||||
#include <QPixmap>
|
||||
#include <QRect>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
@ -72,8 +78,8 @@ bool checkPermissions()
|
|||
{
|
||||
if (geteuid() != 0)
|
||||
{
|
||||
// only try to gain root privileges if we have a valid (kde|gk)su(do) command and
|
||||
// we did not try so before: the dontsu-option is there to make sure there are no
|
||||
// only try to gain root privileges if we have a valid (kde|gk)su(do) command and
|
||||
// we did not try so before: the dontsu-option is there to make sure there are no
|
||||
// endless loops of calling the same non-working (kde|gk)su(do) binary again and again.
|
||||
if (!suCommand().isEmpty() && !KCmdLineArgs::parsedArgs()->isSet("dontsu"))
|
||||
{
|
||||
|
@ -82,13 +88,13 @@ bool checkPermissions()
|
|||
// first argument is our own command again (i.e., argv[0])
|
||||
if (!args.isEmpty())
|
||||
args.removeFirst();
|
||||
|
||||
|
||||
// arguments to partition manager must be _one_ argument to (kde|gk)su(do)
|
||||
const QString suArgs = qApp->applicationFilePath() + args.join(" ") + " --dontsu";
|
||||
if (QProcess::execute(suCommand(), QStringList() << suArgs) == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return KMessageBox::warningContinueCancel(NULL, i18nc("@info",
|
||||
"<para><warning>You do not have administrative privileges.</warning></para>"
|
||||
"<para>It is possible to run <application>%1</application> without these privileges. "
|
||||
|
@ -126,3 +132,15 @@ bool caseInsensitiveLessThan(const QString& s1, const QString& s2)
|
|||
{
|
||||
return s1.toLower() < s2.toLower();
|
||||
}
|
||||
|
||||
QIcon createFileSystemColor(FileSystem::Type type, quint32 size)
|
||||
{
|
||||
QPixmap pixmap(size, size);
|
||||
QPainter painter(&pixmap);
|
||||
painter.setPen(QColor(0, 0, 0));
|
||||
painter.setBrush(Config::fileSystemColorCode(type));
|
||||
painter.drawRect(QRect(0, 0, pixmap.width() - 1, pixmap.height() - 1));
|
||||
painter.end();
|
||||
|
||||
return QIcon(pixmap);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,11 @@
|
|||
|
||||
#include "util/libpartitionmanagerexport.h"
|
||||
|
||||
#include "fs/filesystem.h"
|
||||
|
||||
class KAboutData;
|
||||
class QString;
|
||||
class QIcon;
|
||||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT void registerMetaTypes();
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT void unblockSigChild();
|
||||
|
@ -34,4 +37,6 @@ LIBPARTITIONMANAGERPRIVATE_EXPORT KAboutData* createPartitionManagerAboutData();
|
|||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT bool caseInsensitiveLessThan(const QString& s1, const QString& s2);
|
||||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT QIcon createFileSystemColor(FileSystem::Type type, quint32 size);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue