Commit e3aab73a authored by Oliver Behnke's avatar Oliver Behnke

Merge branch 'master' into drupal-eah-einstein

parents 7e3d0aa7 01bdfffd
......@@ -64,7 +64,7 @@ jobs:
before_install:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get -qq update ) fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get install -y freeglut3-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libsqlite3-dev libgtk2.0-dev libwebkitgtk-dev mingw-w64 binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 realpath p7zip-full ) fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( sudo apt-get install -y freeglut3-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libgtk2.0-dev libwebkitgtk-dev mingw-w64 binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 realpath p7zip-full ) fi
- if [[ "${BOINC_TYPE}" == "integration-test" ]]; then ( sudo apt-get install ansible/xenial-backports; sudo service mysql stop; ) fi
before_script:
......
......@@ -156,7 +156,6 @@ download_and_build "${opensslDirName}" "${opensslFileName}" "${opensslURL}" "${R
download_and_build "${caresDirName}" "${caresFileName}" "${caresURL}" "${ROOTDIR}/mac_build/buildc-ares.sh" "libcares.a" "x86_64"
download_and_build "${curlDirName}" "${curlFileName}" "${curlURL}" "${ROOTDIR}/mac_build/buildcurl.sh" "libcurl.a" "x86_64"
download_and_build "${wxWidgetsDirName}" "${wxWidgetsFileName}" "${wxWidgetsURL}" "${ROOTDIR}/mac_build/buildWxMac.sh ${wxoption}" "libwx_osx_cocoa_static.a" "x86_64"
download_and_build "${sqliteDirName}" "${sqliteFileName}" "${sqliteURL}" "${ROOTDIR}/mac_build/buildsqlite3.sh" "libsqlite3.a" "x86_64"
download_and_build "${freetypeDirName}" "${freetypeFileName}" "${freetypeURL}" "${ROOTDIR}/mac_build/buildfreetype.sh" "libfreetype.a" "x86_64"
download_and_build "${ftglDirName}" "${ftglFileName}" "${ftglURL}" "${ROOTDIR}/mac_build/buildFTGL.sh" "libftgl.a" "x86_64"
......
cmake_minimum_required(VERSION 3.11)
cmake_policy(VERSION 3.11)
project (rappture)
set(SRC_RAPPTURE_CORE
src/core/RpDXWriterFStubs.c
src/core/RpLibraryFStubs.c
src/core/RpUnitsFStubs.c
src/core/RpUtilsFStubs.c
src/core/scew_extras.c
src/core/RpBindingsDict.cc
src/core/RpBuffer.cc
src/core/RpBufferCInterface.cc
src/core/RpDXWriter.cc
src/core/RpDXWriterFInterface.cc
src/core/RpEncode.cc
src/core/RpEntityRef.cc
src/core/RpFortranCommon.cc
src/core/RpLibrary.cc
src/core/RpLibraryCInterface.cc
src/core/RpLibraryFInterface.cc
src/core/RpOutcome.cc
src/core/RpOutcomeCInterface.cc
src/core/RpPtr.cc
src/core/RpResult.cc
src/core/RpUnits.cc
src/core/RpUnitsCInterface.cc
src/core/RpUnitsFInterface.cc
src/core/RpUnitsStd.cc
src/core/RpUtils.cc
src/core/RpUtilsCInterface.cc
src/core/RpUtilsFInterface.cc
src/core/b64/cdecode.c
src/core/b64/cencode.c
src/core/scew/attribute.c
src/core/scew/element.c
src/core/scew/error.c
src/core/scew/parser.c
# src/core/scew/scew_extras.c
src/core/scew/str.c
src/core/scew/tree.c
src/core/scew/writer.c
src/core/scew/xattribute.c
src/core/scew/xerror.c
src/core/scew/xhandler.c
src/core/scew/xparser.c
src/core/scew/xprint.c
)
set(HEADERS
src/core/rappture.h
src/core/RpBindingsDict.h
src/core/RpBuffer.h
src/core/RpBufferCHelper.h
src/core/RpBufferCInterface.h
src/core/RpDict.h
src/core/RpDXWriter.h
src/core/RpDXWriterFInterface.h
src/core/RpDXWriterFStubs.h
src/core/RpEncode.h
src/core/RpEntityRef.h
src/core/RpFortranCommon.h
src/core/RpLibrary.h
src/core/RpLibraryCInterface.h
src/core/RpLibraryFInterface.h
src/core/RpLibraryFStubs.h
src/core/RpOutcome.h
src/core/RpOutcomeCHelper.h
src/core/RpOutcomeCInterface.h
src/core/RpPtr.h
src/core/RpSimpleBuffer.h
src/core/RpUnits.h
src/core/RpUnitsCInterface.h
src/core/RpUnitsFInterface.h
src/core/RpUnitsFStubs.h
src/core/RpUnitsStd.h
src/core/RpUtils.h
src/core/RpUtilsCInterface.h
src/core/RpUtilsFInterface.h
src/core/RpUtilsFStubs.h
src/core/scew_extras.h
)
add_definitions("-DRAPPTURE_VERSION=1.9")
add_definitions("-DSVN_VERSION=6713")
add_definitions("-D_USE_MATH_DEFINES")
add_library(rappture ${SRC_RAPPTURE_CORE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/core/)
find_package(EXPAT REQUIRED)
target_link_libraries(rappture PRIVATE EXPAT::EXPAT)
install(TARGETS rappture
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(FILES ${HEADERS} DESTINATION include/rappture)
\ No newline at end of file
Source: rappture
Version: 1.9
Description: Rappture is a toolkit supporting Rapid application infrastructure, making it quick and easy to develop powerful scientific applications.
Build-Depends: expat
diff --git a/src/core/RpDXWriter.cc b/src/core/RpDXWriter.cc
index e4748b35..d835aa43 100644
--- a/src/core/RpDXWriter.cc
+++ b/src/core/RpDXWriter.cc
@@ -18,6 +18,7 @@
#include <cfloat>
#include <RpDXWriter.h>
#include <assert.h>
+#include <unistd.h>
using namespace Rappture;
DXWriter::DXWriter() :
diff --git a/src/core/scew/scew.h b/src/core/scew/scew.h
index 9741ed59..924a7aed 100644
--- a/src/core/scew/scew.h
+++ b/src/core/scew/scew.h
@@ -61,11 +61,11 @@
# define SCEW_LIB_D
# endif /* _DEBUG */
-# if defined(SCEW_LIB_U) || defined(SCEW_LIB_S) || defined(SCEW_LIB_D)
-# pragma comment( lib, "scew_" SCEW_LIB_U SCEW_LIB_S SCEW_LIB_D ".lib" )
-# else
-# pragma comment( lib, "scew.lib" )
-# endif
+// # if defined(SCEW_LIB_U) || defined(SCEW_LIB_S) || defined(SCEW_LIB_D)
+// # pragma comment( lib, "scew_" SCEW_LIB_U SCEW_LIB_S SCEW_LIB_D ".lib" )
+// # else
+// # pragma comment( lib, "scew.lib" )
+// # endif
#endif /* _WIN32 */
include(vcpkg_common_functions)
vcpkg_download_distfile(ARCHIVE
URLS "https://nanohub.org/app/site/downloads/rappture/rappture-src-20130903.tar.gz"
FILENAME "rappture-src-20130903.tar.gz"
SHA512 3b42569d056c5e80762eada3aff23d230d4ba8f6f0078de44d8571a713dde91e31e66fe3c37ceb66e934a1410b338fb481aeb5a29ef56b53da4ad2e8a2a2ae59
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/fixBuild.patch"
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}/src/core/)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/unistd.h DESTINATION ${SOURCE_PATH}/src/core/)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(
INSTALL ${SOURCE_PATH}/license.terms
DESTINATION ${CURRENT_PACKAGES_DIR}/share/rappture
RENAME copyright
)
#ifndef _UNISTD_H_
#define _UNISTD_H_
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif
#endif
......@@ -121,7 +121,7 @@ android {
}
}
ext {
coroutines_version = '1.3.7'
coroutines_version = '1.3.8'
dagger_version = '2.28.1'
lifecycle_version = '2.2.0'
powermock_version = '2.0.5'
......@@ -129,22 +129,22 @@ ext {
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'commons-codec:commons-codec:1.14'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.squareup.okio:okio:2.8.0'
implementation 'commons-io:commons-io:2.7'
implementation 'org.apache.commons:commons-lang3:3.10'
implementation 'org.apache.commons:commons-lang3:3.11'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// Coroutine dependencies
......@@ -157,7 +157,7 @@ dependencies {
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test:core:1.3.0'
testImplementation 'com.google.guava:guava-testlib:28.2-jre'
testImplementation 'junit:junit:4.13'
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
......
......@@ -40,16 +40,16 @@
<!-- Effectively a hint for the Google Play store only and at the Leanback UI Library -->
<uses-feature
android:name="android.software.leanback"
android:required="false" /> <!-- Implies some sort of D-pad, game controller, joystick, remote control, etc -->
android:required="false" />
<uses-feature
android:name="android.hardware.gamepad"
android:required="false" />
android:required="false" /> <!-- Implies some sort of D-pad, game controller, joystick, remote control, etc -->
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" /> <!-- Effectively a hint for the Google Play store only -->
android:required="false" />
<uses-feature
android:name="android.hardware.type.television"
android:required="false" />
android:required="false" /> <!-- Effectively a hint for the Google Play store only -->
<application
android:name=".BOINCApplication"
......@@ -77,7 +77,6 @@
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="tv.ouya.intent.category.APP" />
</intent-filter>
</activity>
<activity
......
......@@ -23,7 +23,6 @@ import android.app.Service
import android.content.*
import android.content.pm.PackageManager
import android.content.res.Configuration
import android.net.Uri
import android.os.Bundle
import android.os.IBinder
import android.os.RemoteException
......@@ -33,10 +32,11 @@ import android.widget.AdapterView
import android.widget.AdapterView.OnItemClickListener
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.net.toUri
import androidx.core.os.bundleOf
import androidx.fragment.app.replace
import androidx.legacy.app.ActionBarDrawerToggle
import androidx.lifecycle.lifecycleScope
import edu.berkeley.boinc.adapter.NavDrawerListAdapter
import edu.berkeley.boinc.adapter.NavDrawerListAdapter.NavDrawerItem
......@@ -46,10 +46,7 @@ import edu.berkeley.boinc.client.IMonitor
import edu.berkeley.boinc.client.Monitor
import edu.berkeley.boinc.databinding.MainBinding
import edu.berkeley.boinc.ui.eventlog.EventLogActivity
import edu.berkeley.boinc.utils.Logging
import edu.berkeley.boinc.utils.RUN_MODE_AUTO
import edu.berkeley.boinc.utils.RUN_MODE_NEVER
import edu.berkeley.boinc.utils.writeClientModeAsync
import edu.berkeley.boinc.utils.*
import kotlinx.coroutines.launch
class BOINCActivity : AppCompatActivity() {
......@@ -112,18 +109,15 @@ class BOINCActivity : AppCompatActivity() {
// enabling action bar app icon and behaving it as toggle button
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
supportActionBar!!.setHomeButtonEnabled(true)
supportActionBar!!.setHomeAsUpIndicator(R.drawable.ic_baseline_menu_white)
// TODO: Replace with a non-deprecated class.
mDrawerToggle = object : ActionBarDrawerToggle(this, binding.drawerLayout,
R.drawable.ic_baseline_menu_white, //nav menu toggle icon
R.string.app_name, // nav drawer openapplicationContext - description for accessibility
R.string.app_name // nav drawer close - description for accessibility
) {
override fun onDrawerClosed(view: View) {
supportActionBar!!.title = mTitle
// calling onPrepareOptionsMenu() to show action bar icons
supportInvalidateOptionsMenu()
invalidateOptionsMenu()
}
override fun onDrawerOpened(drawerView: View) {
......@@ -131,9 +125,10 @@ class BOINCActivity : AppCompatActivity() {
// force redraw of all items (adapter.getView()) in order to adapt changing icons or number of tasks/notices
mDrawerListAdapter.notifyDataSetChanged()
// calling onPrepareOptionsMenu() to hide action bar icons
supportInvalidateOptionsMenu()
invalidateOptionsMenu()
}
}
mDrawerToggle.drawerArrowDrawable.color = getColorCompat(R.color.white)
binding.drawerLayout.addDrawerListener(mDrawerToggle)
// pre-select fragment
......@@ -145,9 +140,8 @@ class BOINCActivity : AppCompatActivity() {
if (targetFragId < 0 && savedInstanceState != null) {
targetFragId = savedInstanceState.getInt("navBarSelectionId")
}
val item: NavDrawerItem?
item = if (targetFragId < 0) {
// if non of the above, go to default
val item: NavDrawerItem? = if (targetFragId < 0) {
// if none of the above, go to default
mDrawerListAdapter.getItem(0)
} else {
mDrawerListAdapter.getItemForId(targetFragId)
......@@ -188,12 +182,13 @@ class BOINCActivity : AppCompatActivity() {
if (Logging.DEBUG) {
Log.d(Logging.TAG, "BOINCActivity onNewIntent() for target fragment: $id")
}
val item = mDrawerListAdapter.getItemForId(id)
if (item != null) {
dispatchNavBarOnClick(item, false)
} else if (Logging.WARNING) {
Log.w(Logging.TAG, "onNewIntent: requested target fragment is null, for id: $id")
val item: NavDrawerItem? = if (id < 0) {
// if ID is -1, go to default
mDrawerListAdapter.getItem(0)
} else {
mDrawerListAdapter.getItemForId(id)
}
dispatchNavBarOnClick(item, false)
}
override fun onResume() { // gets called by system every time activity comes to front. after onCreate upon first creation
......@@ -264,8 +259,8 @@ class BOINCActivity : AppCompatActivity() {
ft.replace<ProjectsFragment>(R.id.frame_container)
fragmentChanges = true
}
R.string.menu_help -> startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://boinc.berkeley.edu/wiki/BOINC_Help")))
R.string.menu_report_issue -> startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://boinc.berkeley.edu/trac/wiki/ReportBugs")))
R.string.menu_help -> startActivity(Intent(Intent.ACTION_VIEW, "https://boinc.berkeley.edu/wiki/BOINC_Help".toUri()))
R.string.menu_report_issue -> startActivity(Intent(Intent.ACTION_VIEW, "https://boinc.berkeley.edu/trac/wiki/ReportBugs".toUri()))
R.string.menu_about -> {
val dialog = Dialog(this).apply {
requestWindowFeature(Window.FEATURE_NO_TITLE)
......@@ -322,7 +317,7 @@ class BOINCActivity : AppCompatActivity() {
if (newComputingStatus != clientComputingStatus) {
// computing status has changed, update and invalidate to force adaption of action items
clientComputingStatus = newComputingStatus
supportInvalidateOptionsMenu()
invalidateOptionsMenu()
}
if (numberProjectsInNavList != monitor!!.projects.size) {
numberProjectsInNavList = mDrawerListAdapter.compareAndAddProjects(monitor!!.projects)
......
......@@ -18,7 +18,9 @@
*/
package edu.berkeley.boinc
import androidx.appcompat.app.AppCompatDelegate
import android.app.NotificationChannel
import android.app.NotificationManager
import android.os.Build
import androidx.multidex.MultiDexApplication
import androidx.preference.PreferenceManager
import edu.berkeley.boinc.di.AppComponent
......@@ -28,10 +30,26 @@ import edu.berkeley.boinc.utils.setAppTheme
open class BOINCApplication : MultiDexApplication() {
override fun onCreate() {
super.onCreate()
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
setAppTheme(sharedPreferences.getString("theme", "light")!!)
// Create notification channels for use on API 26 and higher.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val notificationManager = getSystemService(NotificationManager::class.java)
// Create main notification channel.
val mainChannelName = getString(R.string.main_notification_channel_name)
val mainChannel = NotificationChannel("main-channel", mainChannelName, NotificationManager.IMPORTANCE_HIGH)
mainChannel.description = getString(R.string.main_notification_channel_description)
notificationManager.createNotificationChannel(mainChannel)
// Create notice notification channel.
val noticeChannelName = getString(R.string.notice_notification_channel_name)
val noticeChannel = NotificationChannel("notice-channel", noticeChannelName, NotificationManager.IMPORTANCE_HIGH)
noticeChannel.description = getString(R.string.notice_notification_channel_description)
notificationManager.createNotificationChannel(noticeChannel)
}
}
val appComponent: AppComponent by lazy {
......
......@@ -24,9 +24,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.graphics.Bitmap
import android.graphics.Point
import android.net.Uri
import android.os.Bundle
import android.os.RemoteException
import android.text.SpannableString
......@@ -35,6 +33,8 @@ import android.util.Log
import android.view.*
import android.widget.Button
import android.widget.TextView
import androidx.core.graphics.scale
import androidx.core.net.toUri
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import edu.berkeley.boinc.databinding.ProjectDetailsLayoutBinding
......@@ -251,7 +251,7 @@ class ProjectDetailsFragment : Fragment() {
content.setSpan(UnderlineSpan(), 0, content.length, 0)
binding.projectUrl.text = content
binding.projectUrl.setOnClickListener {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(project!!.masterURL)))
startActivity(Intent(Intent.ACTION_VIEW, project!!.masterURL.toUri()))
}