starting prusaslicer from gcode viewer and vice versa, by menus or by stl drop on icon. Bring gcode viewer forward after start.

This commit is contained in:
David Kocik 2020-10-12 13:44:08 +02:00
parent 92b2d624a4
commit 4b224359ef
9 changed files with 143 additions and 64 deletions

View file

@ -20,6 +20,13 @@
-(void)message_update:(NSNotification *)msg
{
//NSLog(@"recieved msg %@", msg);
[self bring_forward];
//pass message
Slic3r::GUI::wxGetApp().other_instance_message_handler()->handle_message(std::string([msg.userInfo[@"data"] UTF8String]));
}
-(void) bring_forward
{
//demiaturize all windows
for(NSWindow* win in [NSApp windows])
{
@ -30,8 +37,6 @@
}
//bring window to front
[[NSApplication sharedApplication] activateIgnoringOtherApps : YES];
//pass message
Slic3r::GUI::wxGetApp().other_instance_message_handler()->handle_message(std::string([msg.userInfo[@"data"] UTF8String]));
}
@end
@ -67,6 +72,13 @@ void OtherInstanceMessageHandler::unregister_for_messages()
NSLog(@"warning: unregister instance InstanceCheck notifications not required");
}
}
void OtherInstanceMessageHandler::bring_instance_forward()
{
if (m_impl_osx) {
[m_impl_osx bring_forward];
}
}
}//namespace GUI
}//namespace Slicer