Impact Layer Merge Dialog.
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 2 of the License, or (at your option) any later version.
Bases: PyQt4.QtGui.QDialog, Ui_NeedsManagerDialogBase
Dialog class for the InaSAFE global minimum needs configuration.
New in version 2.2..
Handle add new resource requests.
Add a resource to the minimum needs table.
|Parameters:||resource (dict) – The resource to be added|
Clear the resource list.
Discard the changes to the resource add/edit.
Handle edit resource requests.
Export minimum needs to a json file.
This method will save the current state of the minimum needs setup. Then open a dialog allowing the user to browse to the desired destination location and allow the user to save the needs as a json file.
Import minimum needs from an existing json file.
The minimum needs are loaded from a file into the table. This state is only saved if the form is accepted.
Load the profiles into the dropdown list.
Mark the current profile as pending by colouring the text red.
Mark the current profile as saved by colouring the text black.
Create a new profile by name.
Slot for when tab changes in the stacked widget changes.
|Parameters:||index (int) – Index of the now active tab.|
Populate the list resource list.
Overload the base dialog reject event so we can handle state change.
If the user is in resource editing mode, clicking close button, window [x] or pressing escape should switch context back to the profile view, not close the whole window.
Remove the current profile.
Make sure the user is sure.
Remove the currently selected resource.
Save the current state of the minimum needs widget.
The minimum needs widget current state is saved to the QSettings via the appropriate QMinimumNeeds class’ method.
Save the minimum needs under a new profile name.
Accept the add/edit of the current resource.
Select a given profile by index.
Slot for when profile is selected.
|Parameters:||index (int) – The selected item’s index|
Select a given profile by profile name
|Parameters:||profile_name (str) – The profile name|
Set up the resource parameter for the add/edit view.
Load the help text for the dialog.
Switch context tabs by tab widget name.
|Parameters:||page (QWidget) – The page should be focussed.|