pcbnew: Re-add missing user units python

When moving user user units out of the global, we missed that Python
calls were using it.  This re-adds a function to retrieve user units
allowing the python scripts to show users dialogs in their preferred
units.
This commit is contained in:
Seth Hillbrand 2019-02-19 05:46:08 -08:00
parent 69c1263c02
commit b426b9e784
2 changed files with 15 additions and 0 deletions

View File

@ -146,6 +146,15 @@ void UpdateUserInterface()
}
int GetUserUnits()
{
if( s_PcbEditFrame )
return s_PcbEditFrame->GetUserUnits();
return -1;
}
bool IsActionRunning()
{
return ACTION_PLUGINS::IsActionRunning();

View File

@ -69,6 +69,12 @@ void WindowZoom( int xl, int yl, int width, int height );
*/
void UpdateUserInterface();
/**
* Returns the currently selected user unit value for the interface
* @return 0 = Inches, 1=mm, -1 if the frame isn't set
*/
int GetUserUnits();
/**
* Are we currently in an action plugin?
*/