[gparted] Set activate/deactivate partition menu item name earlier (#741430)



commit 474c5b10b3488698e09b7e1fcbdc6013492e0eb6
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Dec 28 14:21:34 2014 +0000

    Set activate/deactivate partition menu item name earlier (#741430)
    
    So that, even though the menu item is greyed out, it is correctly named
    Activate or Deactivate for an LVM2 Physical Volume on a whole disk
    device, rather than the default Mount or Unmount.
    
    Bug 741430 - GParted cannot recognise LVM signature on unpartitioned
                 drive

 src/Win_GParted.cc |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc
index 4e6a47e..dffb10a 100644
--- a/src/Win_GParted.cc
+++ b/src/Win_GParted.cc
@@ -975,16 +975,7 @@ void Win_GParted::set_valid_operations()
        //if there's something, there's some info ;)
        allow_info( true ) ;
 
-       // No manipulation operations are currently supported on file systems using the
-       // whole disk device.
-       if ( devices[current_device].disktype == "none" )
-               return;
-
-       //flag managing..
-       if ( selected_partition .type != GParted::TYPE_UNALLOCATED && selected_partition .status == 
GParted::STAT_REAL )
-               allow_manage_flags( true ) ; 
-
-       //Activate / deactivate
+       // Set an appropriate name for the activate/deactivate menu item.
        if ( gparted_core .get_filesystem_object ( selected_partition .filesystem ) )
                dynamic_cast<Gtk::Label*>( menu_partition .items()[ MENU_TOGGLE_BUSY ] .get_child() )
                        ->set_label( gparted_core .get_filesystem_object ( selected_partition .filesystem )
@@ -1000,6 +991,11 @@ void Win_GParted::set_valid_operations()
                                                                   : CTEXT_ACTIVATE_FILESYSTEM )
                                                                  ) ;
 
+       // No manipulation operations are currently supported on file systems using the
+       // whole disk device.
+       if ( devices[current_device].disktype == "none" )
+               return;
+
        //Only permit mount/unmount, swapon/swapoff, activate/deactivate if action is available
        if (    selected_partition .status == GParted::STAT_REAL
             && selected_partition .type != GParted::TYPE_EXTENDED
@@ -1027,6 +1023,10 @@ void Win_GParted::set_valid_operations()
           )
                allow_toggle_busy_state( true ) ;
 
+       // Manage flags
+       if ( selected_partition.type != TYPE_UNALLOCATED && selected_partition.status == STAT_REAL )
+               allow_manage_flags( true );
+
 #ifdef ENABLE_ONLINE_RESIZE
        //Find out if online resizing is possible
        if ( selected_partition .busy )


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