Skip to content

Commit

Permalink
- update: ask for copy settings to new image
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhofen committed Oct 27, 2017
1 parent d64fdd1 commit 1b5b18c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/locale/deutsch.locale
Expand Up @@ -677,6 +677,7 @@ flashupdate.checkupdate_internet Online-Update
flashupdate.checkupdate_local Lokales Update
flashupdate.choose_partition Partition wählen
flashupdate.copy_image Kopiere Image in den Arbeitsspeicher
flashupdate.copy_settings Einstellungen ins neue Image übernehmen?
flashupdate.createimage Image speichern
flashupdate.createimage_add_env 'env' hinzufügen
flashupdate.createimage_add_kernel 'kernel' hinzufügen
Expand Down
1 change: 1 addition & 0 deletions data/locale/english.locale
Expand Up @@ -676,6 +676,7 @@ flashupdate.checkupdate_internet Online update
flashupdate.checkupdate_local Local update
flashupdate.choose_partition Choose partition
flashupdate.copy_image Copy Image to main memory
flashupdate.copy_settings Copy settings to new image?
flashupdate.createimage Save image
flashupdate.createimage_add_env Add 'env' to image
flashupdate.createimage_add_kernel Add 'kernel' to image
Expand Down
15 changes: 15 additions & 0 deletions src/gui/update.cpp
Expand Up @@ -662,6 +662,21 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
{
showGlobalStatus(100);

// create settings package
int copy_settings = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_COPY_SETTINGS, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE);
if (copy_settings == CMsgBox::mbrYes)
{
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_SETTINGS_BACKUP);
hintBox.paint();
/*
Settings tarball is created in /tmp directory.
ofgwrite will copy this tarball to new rootfs.
It's untared at first start of new image.
*/
my_system(3, "/bin/backup.sh", "/tmp", "backup_flash.tar.gz");
hintBox.hide();
}

// get active partition
char c[2] = {0};
FILE *f;
Expand Down
1 change: 1 addition & 0 deletions src/system/locals.h
Expand Up @@ -703,6 +703,7 @@ typedef enum
LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL,
LOCALE_FLASHUPDATE_CHOOSE_PARTITION,
LOCALE_FLASHUPDATE_COPY_IMAGE,
LOCALE_FLASHUPDATE_COPY_SETTINGS,
LOCALE_FLASHUPDATE_CREATEIMAGE,
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_ENV,
LOCALE_FLASHUPDATE_CREATEIMAGE_ADD_KERNEL,
Expand Down
1 change: 1 addition & 0 deletions src/system/locals_intern.h
Expand Up @@ -703,6 +703,7 @@ const char * locale_real_names[] =
"flashupdate.checkupdate_local",
"flashupdate.choose_partition",
"flashupdate.copy_image",
"flashupdate.copy_settings",
"flashupdate.createimage",
"flashupdate.createimage_add_env",
"flashupdate.createimage_add_kernel",
Expand Down

0 comments on commit 1b5b18c

Please sign in to comment.