diff options
-rw-r--r-- | src/gdu/gdu-error.c | 34 | ||||
-rw-r--r-- | src/gdu/gdu-error.h | 34 | ||||
-rw-r--r-- | src/palimpsest/gdu-shell.c | 53 |
3 files changed, 8 insertions, 113 deletions
diff --git a/src/gdu/gdu-error.c b/src/gdu/gdu-error.c index b74fbb4..956c61c 100644 --- a/src/gdu/gdu-error.c +++ b/src/gdu/gdu-error.c @@ -72,46 +72,16 @@ _gdu_error_fixup (GError *error) matched = TRUE; if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.Failed") == 0) error->code = GDU_ERROR_FAILED; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.Inhibited") == 0) - error->code = GDU_ERROR_INHIBITED; else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.Busy") == 0) error->code = GDU_ERROR_BUSY; else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.Cancelled") == 0) error->code = GDU_ERROR_CANCELLED; + else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.Inhibited") == 0) + error->code = GDU_ERROR_INHIBITED; else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.InvalidOption") == 0) error->code = GDU_ERROR_INVALID_OPTION; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.AlreadyMounted") == 0) - error->code = GDU_ERROR_ALREADY_MOUNTED; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotMounted") == 0) - error->code = GDU_ERROR_NOT_MOUNTED; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotCancellable") == 0) - error->code = GDU_ERROR_NOT_CANCELLABLE; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotPartition") == 0) - error->code = GDU_ERROR_NOT_PARTITION; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotPartitionTable") == 0) - error->code = GDU_ERROR_NOT_PARTITION_TABLE; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotLabeled") == 0) - error->code = GDU_ERROR_NOT_LABELED; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotFilesystem") == 0) - error->code = GDU_ERROR_NOT_FILESYSTEM; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotLuks") == 0) - error->code = GDU_ERROR_NOT_LUKS; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotLocked") == 0) - error->code = GDU_ERROR_NOT_LOCKED; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotUnlocked") == 0) - error->code = GDU_ERROR_NOT_UNLOCKED; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotLinuxMd") == 0) - error->code = GDU_ERROR_NOT_LINUX_MD; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotLinuxMdComponent") == 0) - error->code = GDU_ERROR_NOT_LINUX_MD_COMPONENT; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotDrive") == 0) - error->code = GDU_ERROR_NOT_DRIVE; else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotSupported") == 0) error->code = GDU_ERROR_NOT_SUPPORTED; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.NotFound") == 0) - error->code = GDU_ERROR_NOT_FOUND; - else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.AtaSmartNotAvailable") == 0) - error->code = GDU_ERROR_ATA_SMART_NOT_AVAILABLE; else if (strcmp (name, "org.freedesktop.DeviceKit.Disks.Error.AtaSmartWouldWakeup") == 0) error->code = GDU_ERROR_ATA_SMART_WOULD_WAKEUP; else diff --git a/src/gdu/gdu-error.h b/src/gdu/gdu-error.h index 40acc9a..aa39cd3 100644 --- a/src/gdu/gdu-error.h +++ b/src/gdu/gdu-error.h @@ -34,26 +34,11 @@ G_BEGIN_DECLS /** * GduError: * @GDU_ERROR_FAILED: The operation failed. - * @GDU_ERROR_INHIBITED: The daemon is being inhibited. * @GDU_ERROR_BUSY: The device is busy * @GDU_ERROR_CANCELLED: The operation was cancelled + * @GDU_ERROR_INHIBITED: The daemon is being inhibited. * @GDU_ERROR_INVALID_OPTION: An invalid option was passed - * @GDU_ERROR_ALREADY_MOUNTED: Device is already mounted. - * @GDU_ERROR_NOT_MOUNTED: Device is not mounted. - * @GDU_ERROR_NOT_CANCELLABLE: Operation is not cancellable. - * @GDU_ERROR_NOT_PARTITION: Device is not a partition. - * @GDU_ERROR_NOT_PARTITION_TABLE: Device is not a partition table. - * @GDU_ERROR_NOT_LABELED: Device is not labeled. - * @GDU_ERROR_NOT_FILESYSTEM: Device is not a file system. - * @GDU_ERROR_NOT_LUKS: Device is not a LUKS encrypted device. - * @GDU_ERROR_NOT_LOCKED: Device is not locked. - * @GDU_ERROR_NOT_UNLOCKED: Device is not unlocked. - * @GDU_ERROR_NOT_LINUX_MD: Device is not a Linux md Software RAID device. - * @GDU_ERROR_NOT_LINUX_MD_COMPONENT: Device is not a Linux md Software RAID component. - * @GDU_ERROR_NOT_DRIVE: Device is not a drive. * @GDU_ERROR_NOT_SUPPORTED: Operation not supported. - * @GDU_ERROR_NOT_FOUND: Given device does not exist. - * @GDU_ERROR_ATA_SMART_NOT_AVAILABLE: Device does not support S.M.A.R.T. * @GDU_ERROR_ATA_SMART_WOULD_WAKEUP: Getting S.M.A.R.T. data for the device would require to spin it up. * * Error codes in the #GDU_ERROR domain. @@ -61,26 +46,11 @@ G_BEGIN_DECLS typedef enum { GDU_ERROR_FAILED, - GDU_ERROR_INHIBITED, GDU_ERROR_BUSY, GDU_ERROR_CANCELLED, + GDU_ERROR_INHIBITED, GDU_ERROR_INVALID_OPTION, - GDU_ERROR_ALREADY_MOUNTED, - GDU_ERROR_NOT_MOUNTED, - GDU_ERROR_NOT_CANCELLABLE, - GDU_ERROR_NOT_PARTITION, - GDU_ERROR_NOT_PARTITION_TABLE, - GDU_ERROR_NOT_LABELED, - GDU_ERROR_NOT_FILESYSTEM, - GDU_ERROR_NOT_LUKS, - GDU_ERROR_NOT_LOCKED, - GDU_ERROR_NOT_UNLOCKED, - GDU_ERROR_NOT_LINUX_MD, - GDU_ERROR_NOT_LINUX_MD_COMPONENT, - GDU_ERROR_NOT_DRIVE, GDU_ERROR_NOT_SUPPORTED, - GDU_ERROR_NOT_FOUND, - GDU_ERROR_ATA_SMART_NOT_AVAILABLE, GDU_ERROR_ATA_SMART_WOULD_WAKEUP } GduError; diff --git a/src/palimpsest/gdu-shell.c b/src/palimpsest/gdu-shell.c index 464171a..78e7989 100644 --- a/src/palimpsest/gdu-shell.c +++ b/src/palimpsest/gdu-shell.c @@ -2001,68 +2001,23 @@ gdu_shell_raise_error (GduShell *shell, case GDU_ERROR_FAILED: error_msg = _("The operation failed."); break; - case GDU_ERROR_INHIBITED: - error_msg = _("The daemon is being inhibited."); - break; case GDU_ERROR_BUSY: error_msg = _("The device is busy."); break; case GDU_ERROR_CANCELLED: error_msg = _("The operation was cancelled."); break; + case GDU_ERROR_INHIBITED: + error_msg = _("The daemon is being inhibited."); + break; case GDU_ERROR_INVALID_OPTION: error_msg = _("An invalid option was passed."); break; - case GDU_ERROR_ALREADY_MOUNTED: - error_msg = _("The device is already mounted."); - break; - case GDU_ERROR_NOT_MOUNTED: - error_msg = _("The device is not mounted."); - break; - case GDU_ERROR_NOT_CANCELLABLE: - error_msg = _("The operation can not be cancelled."); - break; - case GDU_ERROR_NOT_PARTITION: - error_msg = _("The device is not a partition."); - break; - case GDU_ERROR_NOT_PARTITION_TABLE: - error_msg = _("The device is not a partition table."); - break; - case GDU_ERROR_NOT_LABELED: - error_msg = _("The device is not labeled."); - break; - case GDU_ERROR_NOT_FILESYSTEM: - error_msg = _("The device is not a file system."); - break; - case GDU_ERROR_NOT_LUKS: - error_msg = _("The device is not a LUKS encrypted device."); - break; - case GDU_ERROR_NOT_LOCKED: - error_msg = _("The device is not locked."); - break; - case GDU_ERROR_NOT_UNLOCKED: - error_msg = _("The device is not unlocked."); - break; - case GDU_ERROR_NOT_LINUX_MD: - error_msg = _("The device is not a Linux md Software RAID device."); - break; - case GDU_ERROR_NOT_LINUX_MD_COMPONENT: - error_msg = _("The device is not a Linux md Software RAID component."); - break; - case GDU_ERROR_NOT_DRIVE: - error_msg = _("The device is not a drive."); - break; case GDU_ERROR_NOT_SUPPORTED: error_msg = _("The operation is not supported."); break; - case GDU_ERROR_NOT_FOUND: - error_msg = _("The device does not exist."); - break; - case GDU_ERROR_ATA_SMART_NOT_AVAILABLE: - error_msg = _("The device does not support S.M.A.R.T."); - break; case GDU_ERROR_ATA_SMART_WOULD_WAKEUP: - error_msg = _("Getting S.M.A.R.T. data would require to wake up the device."); + error_msg = _("Getting ATA SMART data would wake up the device."); break; default: error_msg = _("Unknown error"); |