Browse Source

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.
pull/13/head
Seth Hillbrand 7 years ago
parent
commit
b426b9e784
  1. 9
      pcbnew/swig/pcbnew_scripting_helpers.cpp
  2. 6
      pcbnew/swig/pcbnew_scripting_helpers.h

9
pcbnew/swig/pcbnew_scripting_helpers.cpp

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

6
pcbnew/swig/pcbnew_scripting_helpers.h

@ -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?
*/

Loading…
Cancel
Save