Skip to content

Commit 656ba9f

Browse files
allywarnermildewey
authored andcommitted
Double clicking on nrrd file in Mac does not start splash screen.
1 parent 7be48a3 commit 656ba9f

3 files changed

Lines changed: 22 additions & 28 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ cmake_install.cmake
1717
install_manifest.txt
1818
CTestTestfile.cmake
1919
DartConfiguration.tcl
20+
xCode_bin

src/Interface/Application/ApplicationInterface.cc

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ ApplicationInterface::ApplicationInterface( std::string file_to_view_on_open ) :
186186
this->private_->tools_dock_window_ = new ToolsDockWidget( this );
187187
this->addDockWidget( Qt::LeftDockWidgetArea, this->private_->tools_dock_window_ );
188188

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

618617
void ApplicationInterface::handle_osx_file_open_event (std::string filename)
619618
{
620-
Seg3D::ProjectHandle current_project = Seg3D::ProjectManager::Instance()->get_current_project();
621-
622619
// must do this to make sure a double-click on a project file doesn't use this executable session
623-
bool new_session = InterfaceManager::Instance()->splash_screen_visibility_state_->get();
620+
bool useCurrentSession = InterfaceManager::Instance()->splash_screen_visibility_state_->get();
624621
if ( !this->private_->splash_screen_ || this->private_->splash_screen_->get_user_interacted() )
625622
{
626-
new_session = false;
623+
useCurrentSession = false;
627624
}
628-
629-
if ( !new_session )
625+
626+
if ( useCurrentSession )
630627
{
631-
boost::filesystem::path app_filepath;
632-
Core::Application::Instance()->get_application_filepath( app_filepath );
633-
634-
std::string command = std::string( "" ) +
635-
app_filepath.parent_path().parent_path().string() + "/Contents/MacOS/Seg3D2 \"" + filename + "\" &";
636-
637-
system( command.c_str() );
628+
this->close();
638629
}
639-
else
640-
{
641-
std::vector<std::string> project_file_extensions = Project::GetProjectFileExtensions();
642630

643-
this->open_initial_project (filename);
644-
}
631+
boost::filesystem::path app_filepath;
632+
Core::Application::Instance()->get_application_filepath( app_filepath );
633+
634+
std::string command = app_filepath.parent_path().parent_path().string()
635+
+ "/Contents/MacOS/Seg3D2 \"" + filename + "\" &";
636+
637+
system( command.c_str() );
645638
}
646639

647640

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

src/Interface/Application/LayerImporterWidget.ui

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@
180180
<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;
181181
&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;
182182
p, li { white-space: pre-wrap; }
183-
&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;
184-
&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>
183+
&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;
184+
&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>
185185
</property>
186186
<property name="textFormat">
187187
<enum>Qt::RichText</enum>
@@ -283,8 +283,8 @@ p, li { white-space: pre-wrap; }
283283
<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;
284284
&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;
285285
p, li { white-space: pre-wrap; }
286-
&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;
287-
&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>
286+
&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;
287+
&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>
288288
</property>
289289
<property name="textFormat">
290290
<enum>Qt::RichText</enum>
@@ -386,8 +386,8 @@ p, li { white-space: pre-wrap; }
386386
<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;
387387
&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;
388388
p, li { white-space: pre-wrap; }
389-
&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;
390-
&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>
389+
&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;
390+
&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>
391391
</property>
392392
<property name="textFormat">
393393
<enum>Qt::RichText</enum>
@@ -489,8 +489,8 @@ p, li { white-space: pre-wrap; }
489489
<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;
490490
&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;
491491
p, li { white-space: pre-wrap; }
492-
&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;
493-
&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>
492+
&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;
493+
&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>
494494
</property>
495495
<property name="textFormat">
496496
<enum>Qt::RichText</enum>

0 commit comments

Comments
 (0)