Update the Win32 layer from the Emu42 one and improve UI.
This commit is contained in:
parent
54833e4abd
commit
c6afc54a62
9 changed files with 124 additions and 22 deletions
|
@ -56,7 +56,7 @@ NOT WORKING YET
|
||||||
|
|
||||||
CHANGES
|
CHANGES
|
||||||
|
|
||||||
Version 1.4 (2019-04-xx)
|
Version 1.4 (2019-05-xx)
|
||||||
|
|
||||||
- Add a RAM card generator for the port 2 of the HP48SX and HP48GX.
|
- Add a RAM card generator for the port 2 of the HP48SX and HP48GX.
|
||||||
- Add the possibility to hide the status and/or the navigation bars.
|
- Add the possibility to hide the status and/or the navigation bars.
|
||||||
|
@ -134,7 +134,6 @@ TODO
|
||||||
- Sometimes the "busy" annunciator gets stuck
|
- Sometimes the "busy" annunciator gets stuck
|
||||||
- Add KML script loading dependencies fallback to the inner ROM (and may be KML include?)
|
- Add KML script loading dependencies fallback to the inner ROM (and may be KML include?)
|
||||||
- Add a separation between the pixels (Suggestion from Jaime Meza)
|
- Add a separation between the pixels (Suggestion from Jaime Meza)
|
||||||
- Add a true fullscreen mode under the status bar and the bottom buttons
|
|
||||||
- Improve the access to the menu
|
- Improve the access to the menu
|
||||||
- Change the logo following the template
|
- Change the logo following the template
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ android {
|
||||||
cmake {
|
cmake {
|
||||||
//abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
|
//abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
|
||||||
//abiFilters 'x86_64'
|
//abiFilters 'x86_64'
|
||||||
version "3.10.2"
|
//version "3.10.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ NOT WORKING YET
|
||||||
|
|
||||||
CHANGES
|
CHANGES
|
||||||
|
|
||||||
Version 1.4 (2019-04-xx)
|
Version 1.4 (2019-05-xx)
|
||||||
|
|
||||||
- Add a RAM card generator for the port 2 of the HP48SX and HP48GX.
|
- Add a RAM card generator for the port 2 of the HP48SX and HP48GX.
|
||||||
- Add the possibility to hide the status and/or the navigation bars.
|
- Add the possibility to hide the status and/or the navigation bars.
|
||||||
|
|
|
@ -18,6 +18,7 @@ static jobject viewToUpdate = NULL;
|
||||||
static jobject mainActivity = NULL;
|
static jobject mainActivity = NULL;
|
||||||
jobject bitmapMainScreen;
|
jobject bitmapMainScreen;
|
||||||
AndroidBitmapInfo androidBitmapInfo;
|
AndroidBitmapInfo androidBitmapInfo;
|
||||||
|
enum DialogBoxMode currentDialogBoxMode;
|
||||||
enum ChooseKmlMode chooseCurrentKmlMode;
|
enum ChooseKmlMode chooseCurrentKmlMode;
|
||||||
TCHAR szChosenCurrentKml[MAX_PATH];
|
TCHAR szChosenCurrentKml[MAX_PATH];
|
||||||
TCHAR szKmlLog[10240];
|
TCHAR szKmlLog[10240];
|
||||||
|
@ -905,6 +906,9 @@ JNIEXPORT void JNICALL Java_org_emulator_forty_eight_NativeLib_onBackupSave(JNIE
|
||||||
JNIEXPORT void JNICALL Java_org_emulator_forty_eight_NativeLib_onBackupRestore(JNIEnv *env, jobject thisz) {
|
JNIEXPORT void JNICALL Java_org_emulator_forty_eight_NativeLib_onBackupRestore(JNIEnv *env, jobject thisz) {
|
||||||
SwitchToState(SM_INVALID);
|
SwitchToState(SM_INVALID);
|
||||||
RestoreBackup();
|
RestoreBackup();
|
||||||
|
if(hLcdDC && hLcdDC->selectedBitmap) {
|
||||||
|
hLcdDC->selectedBitmap->bitmapInfoHeader->biHeight = -abs(hLcdDC->selectedBitmap->bitmapInfoHeader->biHeight);
|
||||||
|
}
|
||||||
if (pbyRom) SwitchToState(SM_RUN);
|
if (pbyRom) SwitchToState(SM_RUN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -788,7 +788,18 @@ HGLOBAL WINAPI GlobalFree(HGLOBAL hMem) {
|
||||||
BOOL GetOpenFileName(LPOPENFILENAME openFilename) {
|
BOOL GetOpenFileName(LPOPENFILENAME openFilename) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TCHAR getSaveObjectFilenameResult[MAX_PATH];
|
||||||
BOOL GetSaveFileName(LPOPENFILENAME openFilename) {
|
BOOL GetSaveFileName(LPOPENFILENAME openFilename) {
|
||||||
|
if(openFilename) {
|
||||||
|
if(currentDialogBoxMode == DialogBoxMode_SET_USRPRG32
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_SET_USRPRG42) {
|
||||||
|
openFilename->nMaxFile = MAX_PATH;
|
||||||
|
openFilename->nFileExtension = 1;
|
||||||
|
openFilename->lpstrFile = getSaveObjectFilenameResult;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,14 +808,41 @@ HANDLE LoadImage(HINSTANCE hInst, LPCSTR name, UINT type, int cx, int cy, UINT f
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LPARAM itemData[MAX_ITEMDATA];
|
||||||
|
TCHAR *itemString[MAX_ITEMDATA];
|
||||||
|
int itemDataCount = 0;
|
||||||
|
int selItemDataIndex[MAX_ITEMDATA];
|
||||||
|
int selItemDataCount = 0;
|
||||||
|
TCHAR labels[MAX_LABEL_SIZE];
|
||||||
|
|
||||||
LRESULT SendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
|
LRESULT SendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
|
||||||
//TODO
|
//TODO
|
||||||
|
if(currentDialogBoxMode == DialogBoxMode_GET_USRPRG32
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_GET_USRPRG42
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_SET_USRPRG32
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_SET_USRPRG42) {
|
||||||
|
if (Msg == LB_ADDSTRING && itemDataCount < MAX_ITEMDATA) {
|
||||||
|
itemString[itemDataCount] = (TCHAR *)lParam;
|
||||||
|
return itemDataCount++;
|
||||||
|
} else if (Msg == LB_SETITEMDATA && wParam < MAX_ITEMDATA) {
|
||||||
|
itemData[wParam] = lParam;
|
||||||
|
} else if (Msg == LB_GETITEMDATA && wParam < MAX_ITEMDATA) {
|
||||||
|
return itemData[wParam];
|
||||||
|
} else if (Msg == LB_GETCOUNT) {
|
||||||
|
return itemDataCount;
|
||||||
|
} else if (Msg == LB_GETSELCOUNT) {
|
||||||
|
return selItemDataCount;
|
||||||
|
} else if (Msg == LB_GETSEL && wParam < itemDataCount && wParam < MAX_ITEMDATA) {
|
||||||
|
return selItemDataIndex[wParam];
|
||||||
|
}
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
BOOL PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
|
BOOL PostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
|
||||||
//TODO
|
//TODO
|
||||||
if(hWnd == 0 && Msg == WM_COMMAND) {
|
if(hWnd == 0 && Msg == WM_COMMAND) {
|
||||||
int menuCommand = (wParam & 0xffff) - 40000;
|
int menuCommand = (int) ((wParam & 0xffff) - 40000);
|
||||||
LOGD("Menu Item %d", menuCommand);
|
LOGD("Menu Item %d", menuCommand);
|
||||||
sendMenuItemCommand(menuCommand);
|
sendMenuItemCommand(menuCommand);
|
||||||
}
|
}
|
||||||
|
@ -1714,8 +1752,13 @@ BOOL StretchBlt(HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC hdc
|
||||||
brushColor = hdcDest->selectedBrushColor->brushColor;
|
brushColor = hdcDest->selectedBrushColor->brushColor;
|
||||||
}
|
}
|
||||||
COLORREF backgroundColor = 0xFF000000; // 0xAABBGGRR
|
COLORREF backgroundColor = 0xFF000000; // 0xAABBGGRR
|
||||||
if(hdcDest->isBackgroundColorSet) {
|
if(sourceBitCount > 1 && destinationBitCount == 1 && hdcSrc->isBackgroundColorSet)
|
||||||
brushColor = hdcDest->backgroundColor;
|
{
|
||||||
|
backgroundColor = hdcSrc->backgroundColor;
|
||||||
|
}
|
||||||
|
else if(sourceBitCount == 1 && destinationBitCount > 1 && hdcDest->isBackgroundColorSet)
|
||||||
|
{
|
||||||
|
backgroundColor = hdcDest->backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dst_maxx = xDest + wDest;
|
int dst_maxx = xDest + wDest;
|
||||||
|
@ -1762,13 +1805,15 @@ BOOL StretchBlt(HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC hdc
|
||||||
BYTE * sourcePixel = sourcePixelBase + ((UINT)src_curx >> (UINT)3);
|
BYTE * sourcePixel = sourcePixelBase + ((UINT)src_curx >> (UINT)3);
|
||||||
UINT bitNumber = (UINT) (src_curx % 8);
|
UINT bitNumber = (UINT) (src_curx % 8);
|
||||||
if(*sourcePixel & ((UINT)1 << bitNumber)) {
|
if(*sourcePixel & ((UINT)1 << bitNumber)) {
|
||||||
sourceColorPointer[0] = 0;
|
// Monochrome 1=White
|
||||||
sourceColorPointer[1] = 0;
|
|
||||||
sourceColorPointer[2] = 0;
|
|
||||||
} else {
|
|
||||||
sourceColorPointer[0] = 255;
|
sourceColorPointer[0] = 255;
|
||||||
sourceColorPointer[1] = 255;
|
sourceColorPointer[1] = 255;
|
||||||
sourceColorPointer[2] = 255;
|
sourceColorPointer[2] = 255;
|
||||||
|
} else {
|
||||||
|
// Monochrome 0=Black
|
||||||
|
sourceColorPointer[0] = 0;
|
||||||
|
sourceColorPointer[1] = 0;
|
||||||
|
sourceColorPointer[2] = 0;
|
||||||
}
|
}
|
||||||
sourceColorPointer[3] = 255;
|
sourceColorPointer[3] = 255;
|
||||||
break;
|
break;
|
||||||
|
@ -1833,10 +1878,10 @@ BOOL StretchBlt(HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC hdc
|
||||||
// black pixels on a white background.
|
// black pixels on a white background.
|
||||||
BYTE * destinationPixel = destinationPixelBase + (x >> 3);
|
BYTE * destinationPixel = destinationPixelBase + (x >> 3);
|
||||||
UINT bitNumber = x % 8;
|
UINT bitNumber = x % 8;
|
||||||
if(brushColor == sourceColor) {
|
if(backgroundColor == sourceColor) {
|
||||||
*destinationPixel |= (1 << bitNumber);
|
*destinationPixel |= (1 << bitNumber); // 1 White
|
||||||
} else {
|
} else {
|
||||||
*destinationPixel &= ~(1 << bitNumber);
|
*destinationPixel &= ~(1 << bitNumber); // 0 Black
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2013,6 +2058,12 @@ COLORREF GetPixel(HDC hdc, int x ,int y) {
|
||||||
x -= hdc->windowOriginX;
|
x -= hdc->windowOriginX;
|
||||||
y -= hdc->windowOriginY;
|
y -= hdc->windowOriginY;
|
||||||
|
|
||||||
|
if(!reverseHeight) {
|
||||||
|
// int YY = sourceHeight - y;
|
||||||
|
// y = YY;
|
||||||
|
y = sourceHeight - y;
|
||||||
|
}
|
||||||
|
|
||||||
HPALETTE palette = hdc->realizedPalette;
|
HPALETTE palette = hdc->realizedPalette;
|
||||||
if(!palette)
|
if(!palette)
|
||||||
palette = hdc->selectedPalette;
|
palette = hdc->selectedPalette;
|
||||||
|
@ -2029,7 +2080,7 @@ COLORREF GetPixel(HDC hdc, int x ,int y) {
|
||||||
COLORREF resultColor = CLR_INVALID; // 0xAABBGGRR
|
COLORREF resultColor = CLR_INVALID; // 0xAABBGGRR
|
||||||
|
|
||||||
if(x >= 0 && y >= 0 && x < sourceWidth && y < sourceHeight) {
|
if(x >= 0 && y >= 0 && x < sourceWidth && y < sourceHeight) {
|
||||||
BYTE * sourcePixel = pixelsSource + sourceStride * y + 4 * x;
|
BYTE * sourcePixel = pixelsSource + sourceStride * y;
|
||||||
|
|
||||||
// -> ARGB_8888
|
// -> ARGB_8888
|
||||||
switch (sourceBitCount) {
|
switch (sourceBitCount) {
|
||||||
|
@ -2037,6 +2088,7 @@ COLORREF GetPixel(HDC hdc, int x ,int y) {
|
||||||
//TODO
|
//TODO
|
||||||
break;
|
break;
|
||||||
case 4: {
|
case 4: {
|
||||||
|
sourcePixel += x >> 2;
|
||||||
BYTE colorIndex = (x & 0x1 ? sourcePixel[0] & (BYTE)0x0F : sourcePixel[0] >> 4);
|
BYTE colorIndex = (x & 0x1 ? sourcePixel[0] & (BYTE)0x0F : sourcePixel[0] >> 4);
|
||||||
if (palPalEntry) {
|
if (palPalEntry) {
|
||||||
resultColor = 0xFF000000 | RGB(palPalEntry[colorIndex].peRed, palPalEntry[colorIndex].peGreen, palPalEntry[colorIndex].peBlue);
|
resultColor = 0xFF000000 | RGB(palPalEntry[colorIndex].peRed, palPalEntry[colorIndex].peGreen, palPalEntry[colorIndex].peBlue);
|
||||||
|
@ -2046,6 +2098,7 @@ COLORREF GetPixel(HDC hdc, int x ,int y) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 8: {
|
case 8: {
|
||||||
|
sourcePixel += x;
|
||||||
BYTE colorIndex = sourcePixel[0];
|
BYTE colorIndex = sourcePixel[0];
|
||||||
if (palPalEntry) {
|
if (palPalEntry) {
|
||||||
resultColor = 0xFF000000 | RGB(palPalEntry[colorIndex].peRed, palPalEntry[colorIndex].peGreen, palPalEntry[colorIndex].peBlue);
|
resultColor = 0xFF000000 | RGB(palPalEntry[colorIndex].peRed, palPalEntry[colorIndex].peGreen, palPalEntry[colorIndex].peBlue);
|
||||||
|
@ -2055,9 +2108,11 @@ COLORREF GetPixel(HDC hdc, int x ,int y) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 24:
|
case 24:
|
||||||
|
sourcePixel += 3 * x;
|
||||||
resultColor = 0xFF000000 | RGB(sourcePixel[2], sourcePixel[1], sourcePixel[0]);
|
resultColor = 0xFF000000 | RGB(sourcePixel[2], sourcePixel[1], sourcePixel[0]);
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
|
sourcePixel += 4 * x;
|
||||||
resultColor = 0xFF000000 | RGB(sourcePixel[2], sourcePixel[1], sourcePixel[0]);
|
resultColor = 0xFF000000 | RGB(sourcePixel[2], sourcePixel[1], sourcePixel[0]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2301,6 +2356,13 @@ UINT IsDlgButtonChecked(HWND hDlg, int nIDButton) {
|
||||||
}
|
}
|
||||||
BOOL EndDialog(HWND hDlg, INT_PTR nResult) {
|
BOOL EndDialog(HWND hDlg, INT_PTR nResult) {
|
||||||
//TODO
|
//TODO
|
||||||
|
if(currentDialogBoxMode == DialogBoxMode_GET_USRPRG32
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_GET_USRPRG42
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_SET_USRPRG32
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_SET_USRPRG42) {
|
||||||
|
itemDataCount = 0;
|
||||||
|
selItemDataCount = 0;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) {
|
HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) {
|
||||||
|
@ -2327,6 +2389,9 @@ PIDLIST_ABSOLUTE SHBrowseForFolderA(LPBROWSEINFOA lpbi) {
|
||||||
//TODO
|
//TODO
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#ifndef IDD_USERCODE
|
||||||
|
#define IDD_USERCODE 121
|
||||||
|
#endif
|
||||||
INT_PTR DialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
|
INT_PTR DialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam) {
|
||||||
//TODO
|
//TODO
|
||||||
if(lpTemplateName == MAKEINTRESOURCE(IDD_CHOOSEKML)) {
|
if(lpTemplateName == MAKEINTRESOURCE(IDD_CHOOSEKML)) {
|
||||||
|
@ -2344,6 +2409,27 @@ INT_PTR DialogBoxParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HWND hWndPar
|
||||||
}
|
}
|
||||||
} else if(lpTemplateName == MAKEINTRESOURCE(IDD_KMLLOG)) {
|
} else if(lpTemplateName == MAKEINTRESOURCE(IDD_KMLLOG)) {
|
||||||
lpDialogFunc(NULL, WM_INITDIALOG, 0, 0);
|
lpDialogFunc(NULL, WM_INITDIALOG, 0, 0);
|
||||||
|
} else if(lpTemplateName == MAKEINTRESOURCE(IDD_USERCODE)) {
|
||||||
|
if(currentDialogBoxMode == DialogBoxMode_GET_USRPRG32
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_GET_USRPRG42) {
|
||||||
|
itemDataCount = 0;
|
||||||
|
selItemDataCount = 0;
|
||||||
|
lpDialogFunc(NULL, WM_INITDIALOG, 0, 0);
|
||||||
|
LPTSTR lpLabel = labels;
|
||||||
|
for(int i = 0; i < itemDataCount; i++) {
|
||||||
|
_tcscpy(lpLabel, itemString[i]);
|
||||||
|
lpLabel += _tcslen(itemString[i]) * sizeof(TCHAR);
|
||||||
|
*lpLabel = 9; // Separator (TAB)
|
||||||
|
lpLabel++;
|
||||||
|
}
|
||||||
|
*lpLabel = 0; // End of string
|
||||||
|
lpDialogFunc(NULL, WM_COMMAND, IDCANCEL, 0);
|
||||||
|
} else if(currentDialogBoxMode == DialogBoxMode_SET_USRPRG32
|
||||||
|
|| currentDialogBoxMode == DialogBoxMode_SET_USRPRG42) {
|
||||||
|
itemDataCount = 0;
|
||||||
|
lpDialogFunc(NULL, WM_INITDIALOG, 0, 0);
|
||||||
|
lpDialogFunc(NULL, WM_COMMAND, IDOK, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return IDOK;
|
return IDOK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1231,6 +1231,20 @@ enum ChooseKmlMode {
|
||||||
ChooseKmlMode_CHANGE_KML
|
ChooseKmlMode_CHANGE_KML
|
||||||
};
|
};
|
||||||
extern enum ChooseKmlMode chooseCurrentKmlMode;
|
extern enum ChooseKmlMode chooseCurrentKmlMode;
|
||||||
|
enum DialogBoxMode {
|
||||||
|
DialogBoxMode_UNKNOWN,
|
||||||
|
DialogBoxMode_GET_USRPRG32,
|
||||||
|
DialogBoxMode_SET_USRPRG32,
|
||||||
|
DialogBoxMode_GET_USRPRG42,
|
||||||
|
DialogBoxMode_SET_USRPRG42
|
||||||
|
};
|
||||||
|
extern enum DialogBoxMode currentDialogBoxMode;
|
||||||
|
#define MAX_LABEL_SIZE 5000
|
||||||
|
extern TCHAR labels[MAX_LABEL_SIZE];
|
||||||
|
#define MAX_ITEMDATA 100
|
||||||
|
extern int selItemDataIndex[MAX_ITEMDATA];
|
||||||
|
extern int selItemDataCount;
|
||||||
|
extern TCHAR getSaveObjectFilenameResult[MAX_PATH];
|
||||||
BOOL getFirstKMLFilenameForType(BYTE chipsetType, TCHAR * firstKMLFilename, size_t firstKMLFilenameSize);
|
BOOL getFirstKMLFilenameForType(BYTE chipsetType, TCHAR * firstKMLFilename, size_t firstKMLFilenameSize);
|
||||||
void clipboardCopyText(const TCHAR * text);
|
void clipboardCopyText(const TCHAR * text);
|
||||||
const TCHAR * clipboardPasteText();
|
const TCHAR * clipboardPasteText();
|
||||||
|
|
|
@ -781,11 +781,12 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||||
kmlScriptsForCurrentModel = kmlScripts;
|
kmlScriptsForCurrentModel = kmlScripts;
|
||||||
|
|
||||||
final int lastIndex = kmlScriptsForCurrentModel.size();
|
final int lastIndex = kmlScriptsForCurrentModel.size();
|
||||||
final String[] kmlScriptTitles = new String[lastIndex + 2];
|
final String[] kmlScriptTitles = new String[lastIndex + (lastIndex > 0 ? 2 : 1)];
|
||||||
for (int i = 0; i < kmlScriptsForCurrentModel.size(); i++)
|
for (int i = 0; i < kmlScriptsForCurrentModel.size(); i++)
|
||||||
kmlScriptTitles[i] = kmlScriptsForCurrentModel.get(i).title;
|
kmlScriptTitles[i] = kmlScriptsForCurrentModel.get(i).title;
|
||||||
kmlScriptTitles[lastIndex] = getResources().getString(R.string.load_custom_kml);
|
kmlScriptTitles[lastIndex] = getResources().getString(R.string.load_custom_kml);
|
||||||
kmlScriptTitles[lastIndex + 1] = getResources().getString(R.string.load_default_kml);
|
if(lastIndex > 0)
|
||||||
|
kmlScriptTitles[lastIndex + 1] = getResources().getString(R.string.load_default_kml);
|
||||||
new AlertDialog.Builder(MainActivity.this)
|
new AlertDialog.Builder(MainActivity.this)
|
||||||
.setTitle(getResources().getString(R.string.pick_calculator))
|
.setTitle(getResources().getString(R.string.pick_calculator))
|
||||||
.setItems(kmlScriptTitles, new DialogInterface.OnClickListener() {
|
.setItems(kmlScriptTitles, new DialogInterface.OnClickListener() {
|
||||||
|
@ -798,7 +799,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||||
// Reset to default KML folder
|
// Reset to default KML folder
|
||||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||||
editor.putBoolean("settings_kml_default", true);
|
editor.putBoolean("settings_kml_default", true);
|
||||||
//editor.putString("settings_kml_folder", url);
|
|
||||||
editor.apply();
|
editor.apply();
|
||||||
updateFromPreferences("settings_kml", true);
|
updateFromPreferences("settings_kml", true);
|
||||||
if(changeKML)
|
if(changeKML)
|
||||||
|
|
|
@ -46,8 +46,8 @@
|
||||||
<string name="nav_item_help">Help</string>
|
<string name="nav_item_help">Help</string>
|
||||||
<string name="nav_about">About Emu48...</string>
|
<string name="nav_about">About Emu48...</string>
|
||||||
|
|
||||||
<string name="load_custom_kml">[Custom KML script...]</string>
|
<string name="load_custom_kml">[Select a Custom KML script folder...]</string>
|
||||||
<string name="load_default_kml">[Default KML script]</string>
|
<string name="load_default_kml">[Default KML script folder]</string>
|
||||||
<string name="pick_calculator">Pick a calculator</string>
|
<string name="pick_calculator">Pick a calculator</string>
|
||||||
|
|
||||||
<string name="create_ram_card_title">Create RAM Card</string>
|
<string name="create_ram_card_title">Create RAM Card</string>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
|
|
||||||
<!-- General -->
|
<!-- General -->
|
||||||
<PreferenceCategory android:title="@string/settings_category_general_title">
|
<PreferenceCategory android:title="@string/settings_category_general_title">
|
||||||
|
|
Loading…
Reference in a new issue