Skip to content

Commit 20d4e43

Browse files
committed
Merge branch 'master' of https://github.com/sandialabs/InterSpec
2 parents e9b6244 + b8d4a11 commit 20d4e43

36 files changed

+324
-127
lines changed

InterSpec/InterSpecServer.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ namespace InterSpecServer
284284
/** If true, will open the WebView inspector console on launch. */
285285
bool m_open_dev_tools;
286286

287+
#if( USE_LEAFLET_MAP )
288+
/** The key to use to access the https://arcgis.com server to get map tiles from.
289+
This value overides the default one built into InterSpec, if specified.
290+
*/
291+
std::string m_arcgis_key;
292+
#endif
293+
287294
/** Returns application config, as determined from defaults and then
288295
InterSpec_app_settings.json files.
289296

InterSpec/LeafletRadMap.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ class LeafletRadMap : public Wt::WContainerWidget
9696

9797
#if( BUILD_AS_ELECTRON_APP || IOS || ANDROID || BUILD_AS_OSX_APP || BUILD_AS_LOCAL_SERVER || BUILD_AS_WX_WIDGETS_APP )
9898
/** Look in the users data directory for a file named "arcgis\_key.txt", whose contents is the arcgis access key.
99+
If that file isnt present, will look in `InterSpec_app_settings.json` file for a "ArcGisKey" value to use.
99100
100101
Newlines, whitespaces, and some other invalid characters are discarded.
101102
102-
If the file does not exist, an empty string is returned.
103-
If the file exists, but after removing invalid characters, it is less than 6 characters, then "empty" is returned.
104-
If the file exists, and has a somewhat valid seeming contents, will return those.
103+
If the file(s) do not exist, an empty string is returned.
104+
If a file exists, but after removing invalid characters, it is less than 6 characters, then "empty" is returned.
105+
If a file exists, and has a somewhat valid seeming contents, will return those.
105106
106107
\sa InterSpec::writableDataDirectory
107108
*/
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
{
2-
"Usage": "Rename this file to 'InterSpec_app_settings.json' and placed either in the 'data' folder of the InterSpec distribution, or in the user data store (see 'Help' -> 'About InterSpec...' -> 'Data', for example on Windows: 'C:\\Users\\<username>\\AppData\\Roaming\\InterSpec'",
3-
"Purpose": "This file allows you to change settings for how InterSpec is launched; only intended for debugging or advanced usuage. You must close all InterSpec windows before settings will take effect.",
2+
"Usage": "Rename this file to 'InterSpec_app_settings.json' and placed either in the 'data' folder of the InterSpec distribution, or in the user data store (see 'Help' -> 'About InterSpec...' -> 'Data', for example on Windows: 'C:\\Users\\<username>\\AppData\\Roaming\\InterSpec'. All settings in this file are optional, so you can remove any settings you dont want to change/specify, and the default values will be used for that setting.",
3+
"Purpose": "This file allows you to change settings for how InterSpec is launched; only intended for debugging or advanced usage. You must close all InterSpec windows before settings will take effect.",
44

55
"ProxySetting": "",
6-
"ProxySetting_Documentation": "Only applicable to Windows and Linux builds. Valid values are: empty (default), 'direct', 'auto_detect', 'system'; any other string will be interpreted as the 'proxyRules' setting documented at https://www.electronjs.org/docs/latest/api/session#sessetproxyconfig (an value might be 'http=proxy.somecompany.com:80,direct://'). This setting is only applicable if you use the map tool (the only part of InterSpec to use the internet); if map tiles wont load, and you are behind a proxy, you may need to set this setting; usually a value of 'system' will work. If you set this settting, and you are not behind a proxy, InterSpec startup time may hang for ~30 seconds, usually with a white screen, while a proxy request times out.",
6+
"ProxySetting_Documentation": "Only applicable to Windows and Linux builds. Valid values are: empty (default), 'direct', 'auto_detect', 'system'; any other string will be interpreted as the 'proxyRules' setting documented at https://www.electronjs.org/docs/latest/api/session#sessetproxyconfig (an value might be 'http=proxy.somecompany.com:80,direct://'). This setting is only applicable if you use the map tool (the only part of InterSpec to use the internet); if map tiles wont load, and you are behind a proxy, you may need to set this setting; usually a value of 'system' will work. If you set this setting, and you are not behind a proxy, InterSpec startup time may hang for ~30 seconds, usually with a white screen, while a proxy request times out.",
77

88
"HttpPortToServeOn": 0,
9-
"HttpPortToServeOn_Documentation": "The HTTP port to serve the application on; if zero (recomended!), will choose random port on startup. Otherwise choose a port larger than 1024 (e.x., 8080) since ports below this may require admin privledges (never run InterSpec as admin!).",
9+
"HttpPortToServeOn_Documentation": "The HTTP port to serve the application on; if zero (recommended!), will choose random high-numbered port on startup. Otherwise you can choose a port larger than 1024 (e.x., 8080) since ports below this may require admin privileges (never run InterSpec as admin!). If you specify a non-zero value, then only one session of InterSpec can run on your computer at a time (although that one session may have multiple windows open).",
1010

1111
"RestorePreviousSession": true,
1212
"RestorePreviousSession_Documentation": "When true (default), InterSpec may attempt to restore your previous session in InterSpec.",
1313

1414
"AllowTokenFreeSessions": false,
15-
"AllowTokenFreeSessions_Documentation": "Normally external sessions (i.e. 'View' -> 'Use in external browser') get assigned a one-time-use token that is required to load InterSpec into the browser. Without a valid token, you cant load a session in the browser. If you allow external sessions without tokens, then the token wont be needed - and any application that can access your localhost network can create a session and potentually access your data. It is not recomended to to enable this setting.",
15+
"AllowTokenFreeSessions_Documentation": "Normally external sessions (i.e. 'View' -> 'Use in external browser') get assigned a one-time-use token that is required to load InterSpec into the browser. Without a valid token, you cant load a session in the browser. If you allow external sessions without tokens, then the token wont be needed - and any application that can access your localhost network (i.e., your computers internal network that is only accessible on your computer) can create a session and potentially access your data. It is not recommended to to enable this setting.",
1616

1717
"OpenDevTools": false,
18-
"OpenDevTools_Documentation": "Enables right-clicking on an element to open the WebView Dev Tools to allow debugging JavaScript errors you may run into (please report to InterSpec@sandia.gov if you find any)"
18+
"OpenDevTools_Documentation": "Enables right-clicking on an element to open the WebView Dev Tools to allow debugging JavaScript errors you may run into (please report to InterSpec@sandia.gov if you find any). On macOS you will still need to select 'Edit' -> 'Enable Web Inspector'.",
19+
20+
"ArcGisKey": "",
21+
"ArcGisKey_Documentation": "If specified (i.e., non-empty string), this key will be used to use to access the https://arcgis.com server to get map tiles from, when you invoke invoke the map tool."
1922
}

src/ColorThemeWidget.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ ColorThemeWidget::ColorThemeWidget(WContainerWidget *parent)
7777
cell = table->elementAt(row, 1);
7878
cell->setColumnSpan(2);
7979
m_themeTitle = new WLineEdit("Title not assigned", cell);
80+
m_themeTitle->setAttributeValue( "ondragstart", "return false" );
8081
label->setBuddy(m_themeTitle);
8182
m_themeTitle->setWidth(WLength(95, WLength::Percentage));
8283

@@ -85,7 +86,8 @@ ColorThemeWidget::ColorThemeWidget(WContainerWidget *parent)
8586
label = new WLabel("Description",cell);
8687
cell = table->elementAt(row, 1);
8788
cell->setColumnSpan(2);
88-
m_themeDescription = new WLineEdit("Desc not assigned", cell);
89+
m_themeDescription = new WLineEdit("Desc not assigned", cell);
90+
m_themeDescription->setAttributeValue( "ondragstart", "return false" );
8991
label->setBuddy(m_themeDescription);
9092
m_themeDescription->setWidth(WLength(95, WLength::Percentage));
9193

@@ -456,6 +458,7 @@ ColorThemeWidget::ColorThemeWidget(WContainerWidget *parent)
456458
{
457459
cell = table->elementAt(i,0);
458460
m_specificRefLineName[i] = new WLineEdit( cell );
461+
m_specificRefLineName[i]->setAttributeValue( "ondragstart", "return false" );
459462
nuclideSuggest->forEdit( m_specificRefLineName[i], WSuggestionPopup::Editing );
460463
m_specificRefLineName[i]->changed().connect( boost::bind( &ColorThemeWidget::specificRefLineSourceChangedCallback, this, i ) );
461464
m_specificRefLineName[i]->enterPressed().connect( boost::bind( &ColorThemeWidget::specificRefLineSourceChangedCallback, this, i ) );

src/CompactFileManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ CompactFileManager::CompactFileManager( SpecMeasManager *fileManager,
190190

191191
m_displayedPreTexts[typeindex] = new WText( m_sampleDivs[typeindex] );
192192
WLineEdit *edit = new WLineEdit( m_sampleDivs[typeindex] );
193+
edit->setAttributeValue( "ondragstart", "return false" );
193194
edit->addStyleClass( "SampleNumInput" );
194195
edit->setValidator( validator );
195196
edit->setAutoComplete( false );

src/DbFileBrowser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ void SnapshotBrowser::startEditSelected()
881881

882882
WLabel *label = new WLabel( "Name" );
883883
WLineEdit *nameEdit = new WLineEdit();
884+
nameEdit->setAttributeValue( "ondragstart", "return false" );
884885
nameEdit->setEmptyText( "(Name to store under)" );
885886
nameEdit->setText( state->name );
886887
layout->addWidget( label, 0, 0 );

src/DecayActivityDiv.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ class DateLengthCalculator : public WContainerWidget
532532
m_layout->addWidget( label, 2, 0, AlignMiddle );
533533

534534
m_duration = new WLineEdit();
535+
536+
m_duration->setAttributeValue( "ondragstart", "return false" );
535537
#if( BUILD_AS_OSX_APP || IOS )
536538
m_duration->setAttributeValue( "autocorrect", "off" );
537539
m_duration->setAttributeValue( "spellcheck", "off" );
@@ -875,6 +877,7 @@ class DateLengthCalculator : public WContainerWidget
875877

876878
cell = nuctbl->elementAt(1 + rowOffset, 1);
877879
WLineEdit *activityEdit = new WLineEdit(cell);
880+
activityEdit->setAttributeValue( "ondragstart", "return false" );
878881
#if( BUILD_AS_OSX_APP || IOS )
879882
activityEdit->setAttributeValue( "autocorrect", "off" );
880883
activityEdit->setAttributeValue( "spellcheck", "off" );
@@ -944,6 +947,7 @@ class DateLengthCalculator : public WContainerWidget
944947

945948
cell = nuctbl->elementAt(2 + rowOffset, 1);
946949
WLineEdit *ageEdit = new WLineEdit(cell);
950+
ageEdit->setAttributeValue( "ondragstart", "return false" );
947951
#if( BUILD_AS_OSX_APP || IOS )
948952
ageEdit->setAttributeValue( "autocorrect", "off" );
949953
ageEdit->setAttributeValue( "spellcheck", "off" );
@@ -1508,6 +1512,7 @@ class CsvDownloadGui : public AuxWindow
15081512

15091513
el = table->elementAt(0,1);
15101514
m_ageEdit = new WLineEdit( timeSpanStr, el );
1515+
m_ageEdit->setAttributeValue( "ondragstart", "return false" );
15111516
#if( BUILD_AS_OSX_APP || IOS )
15121517
m_ageEdit->setAttributeValue( "autocorrect", "off" );
15131518
m_ageEdit->setAttributeValue( "spellcheck", "off" );
@@ -1716,6 +1721,7 @@ void DecayActivityDiv::init()
17161721
//Initialize all member widgets; will assign parentage later on
17171722
// m_nuclides( 0 ),
17181723
m_displayTimeLength = new WLineEdit( "" );
1724+
m_displayTimeLength->setAttributeValue( "ondragstart", "return false" );
17191725
#if( BUILD_AS_OSX_APP || IOS )
17201726
m_displayTimeLength->setAttributeValue( "autocorrect", "off" );
17211727
m_displayTimeLength->setAttributeValue( "spellcheck", "off" );

src/DecayChainChart.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ pair<AuxWindow *, DecayChainChart *>
367367
(Wt::WFlags<AuxWindowProperties>( AuxWindowProperties::DisableCollapse )
368368
| AuxWindowProperties::EnableResize) );
369369

370+
WPushButton *close = window->addCloseButtonToFooter();
371+
close->clicked().connect( boost::bind( &AuxWindow::hide, window ) );
372+
370373
WGridLayout *layout = window->stretcher();
371374
layout->addWidget( chart, 0, 0 );
372375
layout->setContentsMargins( 0, 0, 0, 0 );

src/DecaySelectNuclideDiv.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ void DecaySelectNuclide::init()
226226
Wt::XHTMLUnsafeText );
227227
m_isotopeSearch = new WLineEdit();
228228

229+
m_nuclideActivityEdit->setAttributeValue( "ondragstart", "return false" );
230+
m_nuclideAgeEdit->setAttributeValue( "ondragstart", "return false" );
231+
m_isotopeSearch->setAttributeValue( "ondragstart", "return false" );
229232
#if( BUILD_AS_OSX_APP || IOS )
230233
m_nuclideActivityEdit->setAttributeValue( "autocorrect", "off" );
231234
m_nuclideActivityEdit->setAttributeValue( "spellcheck", "off" );

src/DoseCalcWidget.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ class GammaSourceEnter : public Wt::WContainerWidget
251251
label->addStyleClass( "DoseFieldLabel" );
252252
m_nuclideEdit = new WLineEdit();
253253
m_nuclideEdit->setAutoComplete( false );
254+
m_nuclideEdit->setAttributeValue( "ondragstart", "return false" );
254255
#if( BUILD_AS_OSX_APP || IOS )
255256
m_nuclideEdit->setAttributeValue( "autocorrect", "off" );
256257
m_nuclideEdit->setAttributeValue( "spellcheck", "off" );
@@ -264,7 +265,9 @@ class GammaSourceEnter : public Wt::WContainerWidget
264265
layout->addWidget( label, 1, 0, AlignMiddle );
265266
label->addStyleClass( "DoseFieldLabel" );
266267
m_nuclideAgeEdit = new WLineEdit();
268+
267269
m_nuclideAgeEdit->setAutoComplete( false );
270+
m_nuclideAgeEdit->setAttributeValue( "ondragstart", "return false" );
268271
#if( BUILD_AS_OSX_APP || IOS )
269272
m_nuclideAgeEdit->setAttributeValue( "autocorrect", "off" );
270273
m_nuclideAgeEdit->setAttributeValue( "spellcheck", "off" );
@@ -971,7 +974,9 @@ void DoseCalcWidget::init()
971974

972975

973976
m_doseEnter = new WLineEdit( m_enterWidgets[i] );
977+
974978
m_doseEnter->setAutoComplete( false );
979+
m_doseEnter->setAttributeValue( "ondragstart", "return false" );
975980
#if( BUILD_AS_OSX_APP || IOS )
976981
m_doseEnter->setAttributeValue( "autocorrect", "off" );
977982
m_doseEnter->setAttributeValue( "spellcheck", "off" );
@@ -1022,7 +1027,9 @@ void DoseCalcWidget::init()
10221027

10231028
m_activityEnter = new WLineEdit( m_enterWidgets[i] );
10241029
m_activityEnter->addStyleClass( "DoseEnterTxt" );
1030+
10251031
m_activityEnter->setAutoComplete( false );
1032+
m_activityEnter->setAttributeValue( "ondragstart", "return false" );
10261033
#if( BUILD_AS_OSX_APP || IOS )
10271034
m_activityEnter->setAttributeValue( "autocorrect", "off" );
10281035
m_activityEnter->setAttributeValue( "spellcheck", "off" );
@@ -1096,7 +1103,9 @@ void DoseCalcWidget::init()
10961103

10971104

10981105
m_distanceEnter = new WLineEdit( "100 cm" );
1106+
10991107
m_distanceEnter->setAutoComplete( false );
1108+
m_distanceEnter->setAttributeValue( "ondragstart", "return false" );
11001109
#if( BUILD_AS_OSX_APP || IOS )
11011110
m_distanceEnter->setAttributeValue( "autocorrect", "off" );
11021111
m_distanceEnter->setAttributeValue( "spellcheck", "off" );

0 commit comments

Comments
 (0)