Skip to content

Commit 09b8b49

Browse files
committed
Make so text fields dont get focus automatically on mobile (keep keyboard from popping up). Get compiling on Android
1 parent 5c89893 commit 09b8b49

File tree

7 files changed

+41
-37
lines changed

7 files changed

+41
-37
lines changed

src/InterSpec.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4315,7 +4315,8 @@ void InterSpec::stateSaveTag()
43154315
WGridLayout *layout = window->stretcher();
43164316

43174317
WLineEdit *edit = new WLineEdit();
4318-
edit->setFocus(true);
4318+
if( !isMobile() )
4319+
edit->setFocus(true);
43194320
WText *label = new WText( "Name" );
43204321
layout->addWidget( label, 2, 0 );
43214322
layout->addWidget( edit, 2, 1 );
@@ -7037,7 +7038,7 @@ void InterSpec::handleToolTabChanged( int tab )
70377038
const int calibtab = m_toolsTabs->indexOf(m_calibrateContainer);
70387039
const int searchTab = m_toolsTabs->indexOf(m_isotopeSearchContainer);
70397040

7040-
if( m_referencePhotopeakLines && (tab == refTab) )
7041+
if( m_referencePhotopeakLines && (tab == refTab) && !isMobile() )
70417042
m_referencePhotopeakLines->setFocusToIsotopeEdit();
70427043

70437044
if( m_isotopeSearch && (m_currentToolsTab==searchTab) )

src/ShieldingSourceDisplay.cpp

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,12 @@ void ShieldingSelect::init()
662662
m_thicknessEdit->blurred().connect( this, &ShieldingSelect::removeUncertFromThickness );
663663

664664
if( m_forFitting )
665-
m_materialEdit->setFocus();
665+
{
666+
InterSpecApp *app = dynamic_cast<InterSpecApp *>( wApp );
667+
const bool isMobile = (app && app->isMobile());
668+
if( !isMobile )
669+
m_materialEdit->setFocus();
670+
}
666671
}//void ShieldingSelect::init()
667672

668673

@@ -3505,32 +3510,12 @@ void ShieldingSourceDisplay::Chi2Graphic::paint( Wt::WPainter &painter,
35053510

35063511
if( nrow > 0 && !IsNan(sqrt(chi2)) )
35073512
{
3508-
WString text;
3509-
//The chi2/dof turns out fairly bad, so well not display it!
3510-
// const int dof = nrow - m_nFitForPar;
3511-
// if( (m_nFitForPar>0) && (dof>0) )
3512-
// {
3513-
// chi2 /= dof;
3514-
//#ifndef WT_NO_STD_WSTRING
3515-
// text = L"\x03C7\x00B2/dof={1}"; //χ²
3516-
//#else
3517-
// text = "&chi;<sup>2</sup>/dof={1}"; //χ²
3518-
//#endif
3519-
// char buffer[32];
3520-
// snprintf( buffer, sizeof(buffer), "%.2g", chi2 );
3521-
// text.arg( buffer );
3522-
// }else
3523-
// {
3524-
#ifndef WT_NO_STD_WSTRING
3525-
text = L"\x003C" L"dev\x003E={1}\x03C3"; //L"\x003Cdev\x003E={1}\x03C3"
3526-
#else
3527-
text = "&lt;dev&gt;={1}&sigma;"; //χ²
3528-
#endif
3529-
char buffer[32];
3530-
snprintf( buffer, sizeof(buffer), "%.2g", (sqrt(chi2)/nrow) );
3531-
text.arg( buffer );
3532-
3533-
// }
3513+
char buffer[64];
3514+
snprintf( buffer, sizeof(buffer), "&lt;dev&gt;=%.2g&sigma;", (sqrt(chi2)/nrow) ); //χ²
3515+
//snprintf( buffer, sizeof(buffer), "\x3c\xCF\x87\x3E=%.2g\xCF\x83", (sqrt(chi2)/nrow) ); //χ²
3516+
3517+
3518+
WString text = WString::fromUTF8(buffer);
35343519

35353520
#ifndef WT_NO_STD_WSTRING
35363521
const size_t msglen = text.value().size();

target/android/InterSpec/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ android {
2323
applicationId "gov.sandia.interspec"
2424
minSdkVersion 19
2525
targetSdkVersion 27
26-
versionCode 6
27-
versionName "1.0.1"
26+
versionCode 7
27+
versionName "1.0.1a"
2828
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2929
externalNativeBuild {
3030
cmake {
@@ -38,6 +38,7 @@ android {
3838
}
3939
signingConfig signingConfigs.config
4040
}
41+
4142
buildTypes {
4243
release {
4344
minifyEnabled false
@@ -49,7 +50,6 @@ android {
4950
}
5051
externalNativeBuild {
5152
cmake {
52-
version "3.10.2"
5353
path "../../../../CMakeLists.txt"
5454
}
5555
}
@@ -85,7 +85,7 @@ android {
8585
// armeabi-v7a, arm64-v8a, x86, x86_64
8686
}
8787
}
88-
buildToolsVersion '28.0.3'
88+
buildToolsVersion '27.0.3'
8989
}
9090

9191
dependencies {

target/android/InterSpec/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.0'
10+
classpath 'com.android.tools.build:gradle:3.1.3'
1111

1212

1313
// NOTE: Do not place your application dependencies here; they belong

target/android/InterSpec/gradle.properties

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
#org.gradle.jvmargs=-Xmx1536m
9+
org.gradle.jvmargs=-Xmx1536m
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. More details, visit
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1313
# org.gradle.parallel=true
14+
15+
#systemProp.http.proxyHost=
16+
#systemProp.http.proxyPort=
17+
#systemProp.http.proxyUser=
18+
#systemProp.http.proxyPassword=
19+
20+
#systemProp.https.proxyHost=.proxy.host
21+
#systemProp.https.proxyPort=
22+
#systemProp.https.proxyUser=
23+
#systemProp.https.proxyPassword=
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Jan 17 13:31:10 PST 2019
1+
#Fri May 18 16:25:19 PDT 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
rm -f app/src/main/assets/interspec-assets.zip
4+
cd ../../../
5+
zip -9 -r --exclude=*OUO* --exclude=*ouo* --exclude=*.svn* --exclude=*.git* --exclude=*.DS_Store target/android/InterSpec/app/src/main/assets/interspec-assets.zip InterSpec_resources data example_spectra
6+
cd build_xcode
7+
zip -ur -9 -r --exclude=*OUO* --exclude=*ouo* --exclude=*.svn* --exclude=*.git* --exclude=*.DS_Store ../target/android/InterSpec/app/src/main/assets/interspec-assets.zip resources
8+

0 commit comments

Comments
 (0)