[gparted] Correct dialog title displaying libparted exceptions (#743825)



commit 9294a10fbdc68f0eb669cb7357033f022c4ef135
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Wed Jan 14 08:54:11 2015 +0000

    Correct dialog title displaying libparted exceptions (#743825)
    
    Encountered this dialog:
    
        Libparted Bug Found!
    
        (-) Invalid argument during seek for read on /dev/md1
    
                              [ Retry ] [ Cancel ] [ Ignore ]
    
    After investigation found that GParted was asking libparted to read from
    sector -1.  Libparted was actually reporting an error but GParted was
    incorrectly displaying this as a bug.  This was because setting the
    dialog title was falling through from the error case to the bug case.
    Fix this.
    
    Also provide unique titles for all libparted exception types so that
    they can all be distinguished.
    
     *  List of exceptions from libparted: enum _PedExceptionType
        http://www.gnu.org/software/parted/api/group__PedException.html
    
    Bug 743825 - gparted displaying dialog: libparted bug found!

 src/GParted_Core.cc |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 3f8b45b..816a9cc 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -3645,18 +3645,29 @@ public:
                {
                        switch( e.type )
                        {
-                       case PED_EXCEPTION_WARNING:
-                               set_title( _("Libparted Warning") );
-                               property_message_type() = Gtk::MESSAGE_WARNING;
-                               break;
                        case PED_EXCEPTION_INFORMATION:
                                set_title( _("Libparted Information") );
                                property_message_type() = Gtk::MESSAGE_INFO;
                                break;
+                       case PED_EXCEPTION_WARNING:
+                               set_title( _("Libparted Warning") );
+                               property_message_type() = Gtk::MESSAGE_WARNING;
+                               break;
                        case PED_EXCEPTION_ERROR:
                                set_title( _("Libparted Error") );
+                               break;
+                       case PED_EXCEPTION_FATAL:
+                               set_title( _("Libparted Fatal") );
+                               break;
+                       case PED_EXCEPTION_BUG:
+                               set_title( _("Libparted Bug") );
+                               break;
+                       case PED_EXCEPTION_NO_FEATURE:
+                               set_title( _("Libparted Unsupported Feature") );
+                               break;
                        default:
-                               set_title( _("Libparted Bug Found!") );
+                               set_title( _("Libparted unknown exception") );
+                               break;
                        }
                        if (e.options & PED_EXCEPTION_FIX)
                                add_button( _("Fix"), PED_EXCEPTION_FIX );


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]