Skip to content

Commit

Permalink
Add a hard reset option to Danger area
Browse files Browse the repository at this point in the history
  • Loading branch information
vaskas committed Jan 1, 2023
1 parent fc0dd25 commit ea80c91
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 21 deletions.
40 changes: 21 additions & 19 deletions Rsc/PIMSync_Rsc.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
/* pilrc generated file. Do not edit!*/
#define AboutVersionLabel 1024
#define AboutDescriptionLabel 1023
#define AboutOKButton 1022
#define AboutForm 1021
#define DEBUG_ALERT 1020
#define WIPE_ALERT 1019
#define DELETE_ALERT 1018
#define MainHelpButton 1017
#define MainFromSDSubtitleLabel 1016
#define MainFromSDTitleLabel 1015
#define MainFromSDButton 1014
#define MainToSDSubtitleLabel 1013
#define MainToSDTitleLabel 1012
#define MainToSDButton 1011
#define MainSubtitleLabel 1010
#define MainTitleLabel 1009
#define MainForm 1008
#define RomIncompatibleAlert 1007
#define OptionsAbout 1006
#define AboutVersionLabel 1027
#define AboutDescriptionLabel 1026
#define AboutOKButton 1025
#define AboutForm 1024
#define DEBUG_ALERT 1023
#define RESET_ALERT 1022
#define WIPE_ALERT 1021
#define DELETE_ALERT 1020
#define MainHelpButton 1019
#define MainFromSDSubtitleLabel 1018
#define MainFromSDTitleLabel 1017
#define MainFromSDButton 1016
#define MainToSDSubtitleLabel 1015
#define MainToSDTitleLabel 1014
#define MainToSDButton 1013
#define MainSubtitleLabel 1012
#define MainTitleLabel 1011
#define MainForm 1010
#define RomIncompatibleAlert 1009
#define OptionsAbout 1008
#define OptionsHardReset 1007
#define OptionsWipe 1005
#define MainMenuBar 1004
#define ToSDBitmapFamily 1003
Expand Down
14 changes: 12 additions & 2 deletions Rsc/PIMSync_Rsc.rcp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DATA "code" ID 1 "code0001.bin"
GENERATEHEADER "Rsc/PIMSync_Rsc.h"

APPLICATIONICONNAME ID 1000 "PIMSync"
VERSION ID 1 "0.4"
VERSION ID 1 "0.5"

RESETAUTOID 1000

Expand All @@ -33,6 +33,8 @@ BEGIN
PULLDOWN "Danger"
BEGIN
MENUITEM "Wipe PIM in RAM" ID OptionsWipe
MENUITEM SEPARATOR
MENUITEM "HARD RESET" ID OptionsHardReset
END

PULLDOWN "About"
Expand Down Expand Up @@ -85,6 +87,14 @@ BEGIN
BUTTONS "Yes, continue" "No, cancel"
END

ALERT ID RESET_ALERT
WARNING
BEGIN
TITLE "Confirm"
MESSAGE "You will now be asked if a Hard (UP) or Soft (other keys) reset is needed."
BUTTONS "Continue" "Cancel"
END

ALERT ID DEBUG_ALERT
CONFIRMATION
BEGIN
Expand All @@ -101,6 +111,6 @@ BEGIN
BUTTON "OK" ID AboutOKButton AT (55 142 40 12)
FORMBITMAP AT (50 86) BITMAP PIMSyncBitmapFamily
LABEL "PIMSync allows you to use the SD\rcard to transfer the memo, address\rbook, todo and datebook databases\rfrom your Palm OS device and back.\rYou can use this workflow with\rprograms like J-Pilot on the PC." ID AboutDescriptionLabel AT (5 16)
LABEL "V: 0.4" ID AboutVersionLabel AT (132 145)
LABEL "V: 0.5" ID AboutVersionLabel AT (132 145)
END

17 changes: 17 additions & 0 deletions Src/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ static Boolean MainFormDoCommand(UInt16 command)
break;
}

case OptionsHardReset:
{
HandleHardReset();
handled = true;
break;
}

case MainFromSDButton:
{
HandleFromSD();
Expand Down Expand Up @@ -431,3 +438,13 @@ void HandleWipe()
}
}

void HandleHardReset()
{
UInt8 selection;

selection = FrmAlert( RESET_ALERT );
if ( selection == 0 ) {
SysColdBoot (0, 0, 0, 0, 0);
}
}

1 change: 1 addition & 0 deletions Src/PIMSync.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ void DeleteDB( Char* dbName, Boolean* missingP );
void HandleFromSD();
void HandleToSD();
void HandleWipe();
void HandleHardReset();

0 comments on commit ea80c91

Please sign in to comment.