Skip to content

Commit

Permalink
Double clicking on nrrd file in Mac does not start splash screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
allywarner authored and mildewey committed Mar 5, 2018
1 parent 7be48a3 commit 656ba9f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake
DartConfiguration.tcl
xCode_bin
33 changes: 13 additions & 20 deletions src/Interface/Application/ApplicationInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ ApplicationInterface::ApplicationInterface( std::string file_to_view_on_open ) :
this->private_->tools_dock_window_ = new ToolsDockWidget( this );
this->addDockWidget( Qt::LeftDockWidgetArea, this->private_->tools_dock_window_ );


// Connect the windows and widgets to their visibility states
QtUtils::QtBridge::Show( this->private_->rendering_dock_window_,
InterfaceManager::Instance()->rendering_dockwidget_visibility_state_ );
Expand Down Expand Up @@ -617,31 +616,25 @@ void ApplicationInterface::HandleCriticalErrorMessage( qpointer_type qpointer, i

void ApplicationInterface::handle_osx_file_open_event (std::string filename)
{
Seg3D::ProjectHandle current_project = Seg3D::ProjectManager::Instance()->get_current_project();

// must do this to make sure a double-click on a project file doesn't use this executable session
bool new_session = InterfaceManager::Instance()->splash_screen_visibility_state_->get();
bool useCurrentSession = InterfaceManager::Instance()->splash_screen_visibility_state_->get();
if ( !this->private_->splash_screen_ || this->private_->splash_screen_->get_user_interacted() )
{
new_session = false;
useCurrentSession = false;
}

if ( !new_session )
if ( useCurrentSession )
{
boost::filesystem::path app_filepath;
Core::Application::Instance()->get_application_filepath( app_filepath );

std::string command = std::string( "" ) +
app_filepath.parent_path().parent_path().string() + "/Contents/MacOS/Seg3D2 \"" + filename + "\" &";

system( command.c_str() );
this->close();
}
else
{
std::vector<std::string> project_file_extensions = Project::GetProjectFileExtensions();

this->open_initial_project (filename);
}
boost::filesystem::path app_filepath;
Core::Application::Instance()->get_application_filepath( app_filepath );

std::string command = app_filepath.parent_path().parent_path().string()
+ "/Contents/MacOS/Seg3D2 \"" + filename + "\" &";

system( command.c_str() );
}


Expand Down Expand Up @@ -694,7 +687,7 @@ bool ApplicationInterface::open_initial_project ( std::string filename )
// No location is set, so no project will be generated on disk for now
ActionNewProject::Dispatch( Core::Interface::GetWidgetActionContext(),
"", "Untitled Project" );
LayerIOFunctions::ImportFiles( NULL, filename );
LayerIOFunctions::ImportFiles( this, filename );
return true;
}

Expand Down
16 changes: 8 additions & 8 deletions src/Interface/Application/LayerImporterWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600;&quot;&gt;Data Volume&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt;: The data will be displayed as solid volume of gray scale values. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600; color:#ffffff;&quot;&gt;Data Volume&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt;: The data will be displayed as solid volume of gray scale values. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
Expand Down Expand Up @@ -283,8 +283,8 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600;&quot;&gt;Single Mask:&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt; The mask will be created by thresholding all the non zero values as selected.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600; color:#ffffff;&quot;&gt;Single Mask:&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt; The mask will be created by thresholding all the non zero values as selected.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
Expand Down Expand Up @@ -386,8 +386,8 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600;&quot;&gt;Series of Masks:&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt; Each mask is defined by a bit plane in the data file.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600; color:#ffffff;&quot;&gt;Series of Masks:&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt; Each mask is defined by a bit plane in the data file.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
Expand Down Expand Up @@ -489,8 +489,8 @@ p, li { white-space: pre-wrap; }
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600;&quot;&gt;Series of Masks&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt;&quot;&gt;: Each unique label in the mask will be given a separate mask.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt;Import file as a &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; font-weight:600; color:#ffffff;&quot;&gt;Series of Masks&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:10pt; color:#ffffff;&quot;&gt;: Each unique label in the mask will be given a separate mask.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
Expand Down

0 comments on commit 656ba9f

Please sign in to comment.