From 788c1a8ef84c13974951f6b33bb6a2d86a47e235 Mon Sep 17 00:00:00 2001 From: William Johnson Date: Wed, 2 Oct 2024 09:51:52 -0700 Subject: [PATCH] Fix up file export layout for mobile, a little. A few other small changes. --- InterSpec_resources/ExportSpecFile.css | 46 +++++++++++++++++------- InterSpec_resources/favicon.ico | Bin 0 -> 15406 bytes data/config/wt_config_localweb.xml | 2 +- src/ExportSpecFile.cpp | 13 ++++--- src/InterSpec.cpp | 48 +++++++++++++++++-------- src/SpectraFileModel.cpp | 2 +- 6 files changed, 78 insertions(+), 33 deletions(-) create mode 100644 InterSpec_resources/favicon.ico diff --git a/InterSpec_resources/ExportSpecFile.css b/InterSpec_resources/ExportSpecFile.css index 3c8c742f..751df5eb 100644 --- a/InterSpec_resources/ExportSpecFile.css +++ b/InterSpec_resources/ExportSpecFile.css @@ -63,9 +63,17 @@ { flex-grow: 2; margin-top: 5px; + height: 330px; } -.ExportSpecFileTool .ExportSpecFileBody .ExportColTitle +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFileTabs > .Wt-stack +{ + height: 300px; + display: flex; + flex-direction: column; +} + +.ExportSpecFileTool .ExportColTitle { display: block; white-space: nowrap; @@ -92,6 +100,24 @@ row-gap: 5px; } +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSelect, +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFormat, +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSamples, +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecOptions +{ + border: none; + + margin-left: auto; + margin-right: auto; + margin-top: 10px; +} + +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSelect, +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFormat, +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSamples +{ + overflow-y: auto; +} .ExportSpecFileTool .ExportSpecSamples { @@ -110,7 +136,7 @@ margin-right: 5px; } -.ExportSpecFileTool .ExportSpecFileBody .ExportSpecSelect .ExportSpecInfo +.ExportSpecFileTool .ExportSpecSelect .ExportSpecInfo { display: inline-block; overflow-y: auto; @@ -133,9 +159,7 @@ .ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecSelect { - margin-left: auto; - margin-right: auto; - margin-top: 10px; + } .ExportSpecInfo .ExportSpecInfoTable @@ -175,13 +199,6 @@ height: 100%; } -.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecFormat -{ - height: 300px; - overflow-y: auto; -} - - .ExportSpecFileTool .ExportSpecFormat .ExportSpecFormatMenu.SideMenu { overflow-y: auto; @@ -230,6 +247,11 @@ border-bottom: none; } +.ExportSpecFileTool.ExportSpecFileToolPhone .ExportSpecOptions +{ + width: 100%; +} + .ExportSpecFileTool .ExportSpecFileBody .ExportSpecOptions .ExportColTitle { } diff --git a/InterSpec_resources/favicon.ico b/InterSpec_resources/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..4999cb53b5bfb0a7b7b2f4fdad07c1b57433aec7 GIT binary patch literal 15406 zcmeHOSyYr)67D(4yk{Qfan5lbW=22qtJmpxJt%X%N)JEMQ_*j4{#72$~pN z0NFtVG&D3zvv;#eH;bSkibf+~G?@f5nnc-5zNz}#zx^AVrJJUsXTmvs?%%ind+V#Z zb?erxDrB-h$)1os^^}a-MY1hV%4E;VWU@tztlyvhi%gbDea}2||M!2&WNm+y$)2Wn zXb6q4_EY2V@7{2G(d3XBu6*tdTZ&y7Cyu$_-*yr z8rOjFtEZeAKTv0ad`k~}G~Li=*UWwF*QcOMGhwCnJXS>X!#n&mhFUA;G=8MD20P!X z$7;45&jyBFm9EmmuR2E8XAA%==5^Cd!Y%&)G|aw zHPO4Lg|ST6O1lRNg#q99nI58lv(t#|!_5ebYQu8kkw5FzX1nn#Bl?iI&t7h~T1rru zsDrPj3+vSF@YeJQW4zU!Sg&cd8^1=`if?HBrt-||crvXV!P**>;+~mhJ~7yanxb+PXOvrYgT6<!M(4gyJummm&1g(2 z!sjoi(ek^#_g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;deW~TiyOc@Fl-Oidp&`5L|=&gwHWX|8pSn?TMD@v98ZX_uF;@qLrywtg)~4 zVII6l?_zx4#rM6n9>wmId}tpS)AR7+{kk_%_UtQ#hU%#9QTOO#zkg2N?5;+_Ye`tH zd{A@bqdbL__(S-y&og@Ol*}dPyEyLqt|}yK*$clQ0|El|NZ-B>H)!8DU4Q3bZjr`9 zx4&F!#86!!u9?`!@q8`KLi6Y1{GO~&ara)O8Y4@Mi+sBqi_`N_{XiSxe~xMhEw`=|K$AR?+*#ME`k36D`>D! literal 0 HcmV?d00001 diff --git a/data/config/wt_config_localweb.xml b/data/config/wt_config_localweb.xml index d4acddfc..f902695d 100644 --- a/data/config/wt_config_localweb.xml +++ b/data/config/wt_config_localweb.xml @@ -594,7 +594,7 @@ by setting this property, or for an individual application entry point by passing a location to WServer::addEntryPoint(). --> - + InterSpec_resources/favicon.ico diff --git a/src/ExportSpecFile.cpp b/src/ExportSpecFile.cpp index 28629813..0ad0807f 100644 --- a/src/ExportSpecFile.cpp +++ b/src/ExportSpecFile.cpp @@ -125,6 +125,8 @@ const std::vector> sm_file_ #if( USE_QR_CODES ) namespace { + const int ns_min_screen_width_for_wide_layout = 750; + std::string clean_uuid( string uuid ) { SpecUtils::trim(uuid); @@ -741,18 +743,19 @@ void ExportSpecFileTool::init() const bool showToolTips = InterSpecUser::preferenceValue( "ShowTooltips", m_interspec ); const bool isMobile = m_interspec && m_interspec->isMobile(); - const int screenWidth = m_interspec->renderedWidth(); - const bool isPhone = (screenWidth > 100) ? (screenWidth < 640) : m_interspec->isPhone(); - if( isMobile ) addStyleClass( "ExportSpecFileToolMobile" ); + const int screenWidth = m_interspec->renderedWidth(); + const bool isPhone = (screenWidth > 100) ? (screenWidth < ns_min_screen_width_for_wide_layout) : m_interspec->isPhone(); + WTabWidget *mobileTabs = nullptr; WContainerWidget *body = nullptr; if( isPhone ) { addStyleClass( "ExportSpecFileToolPhone" ); + mobileTabs = new WTabWidget( this ); mobileTabs->addStyleClass( "ExportSpecFileTabs" ); }else @@ -3619,7 +3622,7 @@ ExportSpecFileWindow::ExportSpecFileWindow( InterSpec *viewer ) addStyleClass( "export-spec-file" ); const int w = viewer->renderedWidth(); - const bool isPhone = (w > 100) ? (w < 640) : (viewer && viewer->isPhone()); + const bool isPhone = (w > 100) ? (w < ns_min_screen_width_for_wide_layout) : (viewer && viewer->isPhone()); if( isPhone ) { @@ -3627,7 +3630,7 @@ ExportSpecFileWindow::ExportSpecFileWindow( InterSpec *viewer ) }else { //setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 800.0) : 800.0 ,WLength::Pixel), WLength::Auto ); - setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 600.0) : 600.0 ,WLength::Pixel), WLength::Auto ); + setMinimumSize( WLength(w > 100 ? std::min(0.95*w, 650.0) : 650.0, WLength::Pixel), WLength::Auto ); } m_tool = new ExportSpecFileTool( viewer, contents() ); m_tool->done().connect( boost::bind(&ExportSpecFileWindow::accept, this) ); diff --git a/src/InterSpec.cpp b/src/InterSpec.cpp index 549607a7..9f3ea20f 100644 --- a/src/InterSpec.cpp +++ b/src/InterSpec.cpp @@ -11039,24 +11039,44 @@ void InterSpec::setSpectrum( std::shared_ptr meas, if( (spec_type == SpecUtils::SpectrumType::Foreground) && previous && (previous != meas) ) { - closeShieldingSourceFit(); + saveShieldingSourceModelToForegroundSpecMeas(); +#if( USE_REL_ACT_TOOL ) + saveRelActManualStateToForegroundSpecMeas(); + saveRelActAutoStateToForegroundSpecMeas(); +#endif #if( USE_DB_TO_STORE_SPECTRA ) - //if( m_user->preferenceValue( "AutoSaveSpectraToDb" ) ) - //{ - // //We also need to do this in the InterSpec destructor as well. - // // Also maybe change size limitations to only apply to auto saving - // if( current_state_index >= 0 ) - // { - // //Save to (HEAD) of current state - // }else - // { - // //Create a state - // //Handle case where file is to large to be saved - // } - //} + /* + if( previous && m_user->preferenceValue( "AutoSaveSpectraToDb" ) ) + { + //We also need to do this in the InterSpec destructor as well. + // Also maybe change size limitations to only apply to auto saving + const long long int current_state_index = currentAppStateDbId(); + if( current_state_index >= 0 ) + { + startStoreStateInDb( false, false, false, false ); //save snapshot + }else + { + m_fileManager->saveToDatabase( previous ); + } + }//if( + */ #endif //#if( USE_DB_TO_STORE_SPECTRA ) + // Close Shielding/Source fit Window + if( m_shieldingSourceFitWindow ) + { + delete m_shieldingSourceFitWindow; + m_shieldingSourceFitWindow = nullptr; + m_shieldingSourceFit = nullptr; + } + + + if( m_relActAutoGui ) + { + // TODO: Should we close this? + } + if( m_riidDisplay ) programmaticallyCloseRiidResults(); }//if( (spec_type == SpecUtils::SpectrumType::Foreground) && !!previous && (previous != meas) ) diff --git a/src/SpectraFileModel.cpp b/src/SpectraFileModel.cpp index c4befd9a..99152efc 100644 --- a/src/SpectraFileModel.cpp +++ b/src/SpectraFileModel.cpp @@ -343,7 +343,7 @@ std::shared_ptr SpectraFileHeader::resetFromDatabase( std::shared_ptr memobj = dbdata->decodeSpectrum(); setMeasurmentInfo( memobj ); - m_displayName = info->filename; + m_displayName = SpecUtils::filename( info->filename ); m_uploadTime = info->uploadTime; m_modifiedSinceDecode = info->userHasModified;