-rw-r--r-- | gammu/emb/gammu/gammu.c | 4 | ||||
-rw-r--r-- | gammu/gammu.tar.bz2 | bin | 612042 -> 0 bytes |
2 files changed, 2 insertions, 2 deletions
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c index f49ae36..c436b90 100644 --- a/gammu/emb/gammu/gammu.c +++ b/gammu/emb/gammu/gammu.c | |||
@@ -4730,97 +4730,97 @@ static void Restore(int argc, char *argv[]) | |||
4730 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { | 4730 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { |
4731 | Pbk.MemoryType = MEM_SM; | 4731 | Pbk.MemoryType = MEM_SM; |
4732 | Pbk.Location= i + 1; | 4732 | Pbk.Location= i + 1; |
4733 | Pbk.EntriesNum= 0; | 4733 | Pbk.EntriesNum= 0; |
4734 | if (used<max) { | 4734 | if (used<max) { |
4735 | if (Backup.SIMPhonebook[used]->Location == Pbk.Location) { | 4735 | if (Backup.SIMPhonebook[used]->Location == Pbk.Location) { |
4736 | Pbk = *Backup.SIMPhonebook[used]; | 4736 | Pbk = *Backup.SIMPhonebook[used]; |
4737 | used++; | 4737 | used++; |
4738 | dbgprintf("Location %i\n",Pbk.Location); | 4738 | dbgprintf("Location %i\n",Pbk.Location); |
4739 | if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); | 4739 | if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); |
4740 | } | 4740 | } |
4741 | } | 4741 | } |
4742 | if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); | 4742 | if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); |
4743 | Print_Error(error); | 4743 | Print_Error(error); |
4744 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); | 4744 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); |
4745 | if (gshutdown) { | 4745 | if (gshutdown) { |
4746 | GSM_Terminate(); | 4746 | GSM_Terminate(); |
4747 | exit(0); | 4747 | exit(0); |
4748 | } | 4748 | } |
4749 | } | 4749 | } |
4750 | printmsgerr("\n"); | 4750 | printmsgerr("\n"); |
4751 | } | 4751 | } |
4752 | 4752 | ||
4753 | DoRestore = false; | 4753 | DoRestore = false; |
4754 | if (Backup.CallerLogos[0] != NULL) { | 4754 | if (Backup.CallerLogos[0] != NULL) { |
4755 | Bitmap.Type = GSM_CallerGroupLogo; | 4755 | Bitmap.Type = GSM_CallerGroupLogo; |
4756 | Bitmap.Location = 1; | 4756 | Bitmap.Location = 1; |
4757 | error=Phone->GetBitmap(&s,&Bitmap); | 4757 | error=Phone->GetBitmap(&s,&Bitmap); |
4758 | if (error == ERR_NONE) { | 4758 | if (error == ERR_NONE) { |
4759 | if (answer_yes("Restore caller groups and logos")) DoRestore = true; | 4759 | if (answer_yes("Restore caller groups and logos")) DoRestore = true; |
4760 | } | 4760 | } |
4761 | } | 4761 | } |
4762 | if (DoRestore) { | 4762 | if (DoRestore) { |
4763 | max = 0; | 4763 | max = 0; |
4764 | while (Backup.CallerLogos[max]!=NULL) max++; | 4764 | while (Backup.CallerLogos[max]!=NULL) max++; |
4765 | for (i=0;i<max;i++) { | 4765 | for (i=0;i<max;i++) { |
4766 | error=Phone->SetBitmap(&s,Backup.CallerLogos[i]); | 4766 | error=Phone->SetBitmap(&s,Backup.CallerLogos[i]); |
4767 | Print_Error(error); | 4767 | Print_Error(error); |
4768 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4768 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4769 | if (gshutdown) { | 4769 | if (gshutdown) { |
4770 | GSM_Terminate(); | 4770 | GSM_Terminate(); |
4771 | exit(0); | 4771 | exit(0); |
4772 | } | 4772 | } |
4773 | } | 4773 | } |
4774 | printmsgerr("\n"); | 4774 | printmsgerr("\n"); |
4775 | } | 4775 | } |
4776 | 4776 | ||
4777 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { | 4777 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { |
4778 | if (answer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")) { | 4778 | if ( true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) { |
4779 | GSM_GetCurrentDateTime(&date_time); | 4779 | GSM_GetCurrentDateTime(&date_time); |
4780 | 4780 | ||
4781 | error=Phone->SetDateTime(&s, &date_time); | 4781 | error=Phone->SetDateTime(&s, &date_time); |
4782 | Print_Error(error); | 4782 | Print_Error(error); |
4783 | } | 4783 | } |
4784 | } | 4784 | } |
4785 | DoRestore = false; | 4785 | DoRestore = false; |
4786 | if (Backup.Calendar[0] != NULL) { | 4786 | if (Backup.Calendar[0] != NULL) { |
4787 | /* N6110 doesn't support getting calendar status */ | 4787 | /* N6110 doesn't support getting calendar status */ |
4788 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 4788 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
4789 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { | 4789 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { |
4790 | max = 0; | 4790 | max = 0; |
4791 | while (Backup.Calendar[max] != NULL) max++; | 4791 | while (Backup.Calendar[max] != NULL) max++; |
4792 | printmsgerr("%i entries in backup file\n",max); | 4792 | printmsgerr("%i entries in backup file\n",max); |
4793 | // LR | 4793 | // LR |
4794 | //if (answer_yes("Restore calendar notes")) { | 4794 | //if (answer_yes("Restore calendar notes")) { |
4795 | //Past = answer_yes("Restore notes from the past"); | 4795 | //Past = answer_yes("Restore notes from the past"); |
4796 | DoRestore = true; | 4796 | DoRestore = true; |
4797 | //} | 4797 | //} |
4798 | } | 4798 | } |
4799 | } | 4799 | } |
4800 | if (DoRestore) { | 4800 | if (DoRestore) { |
4801 | printmsgerr("Deleting old notes: "); | 4801 | printmsgerr("Deleting old notes: "); |
4802 | error = Phone->DeleteAllCalendar(&s); | 4802 | error = Phone->DeleteAllCalendar(&s); |
4803 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { | 4803 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { |
4804 | while (1) { | 4804 | while (1) { |
4805 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 4805 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
4806 | if (error != ERR_NONE) break; | 4806 | if (error != ERR_NONE) break; |
4807 | error = Phone->DeleteCalendar(&s,&Calendar); | 4807 | error = Phone->DeleteCalendar(&s,&Calendar); |
4808 | Print_Error(error); | 4808 | Print_Error(error); |
4809 | printmsgerr("*"); | 4809 | printmsgerr("*"); |
4810 | } | 4810 | } |
4811 | printmsgerr("\n"); | 4811 | printmsgerr("\n"); |
4812 | } else { | 4812 | } else { |
4813 | printmsgerr("Done\n"); | 4813 | printmsgerr("Done\n"); |
4814 | Print_Error(error); | 4814 | Print_Error(error); |
4815 | } | 4815 | } |
4816 | 4816 | ||
4817 | for (i=0;i<max;i++) { | 4817 | for (i=0;i<max;i++) { |
4818 | if (!Past && IsCalendarNoteFromThePast(Backup.Calendar[i])) continue; | 4818 | if (!Past && IsCalendarNoteFromThePast(Backup.Calendar[i])) continue; |
4819 | 4819 | ||
4820 | Calendar = *Backup.Calendar[i]; | 4820 | Calendar = *Backup.Calendar[i]; |
4821 | error=Phone->AddCalendar(&s,&Calendar); | 4821 | error=Phone->AddCalendar(&s,&Calendar); |
4822 | Print_Error(error); | 4822 | Print_Error(error); |
4823 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4823 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4824 | if (gshutdown) { | 4824 | if (gshutdown) { |
4825 | GSM_Terminate(); | 4825 | GSM_Terminate(); |
4826 | exit(0); | 4826 | exit(0); |
@@ -5161,97 +5161,97 @@ static void AddNew(int argc, char *argv[]) | |||
5161 | while (Backup.PhonePhonebook[max]!=NULL) max++; | 5161 | while (Backup.PhonePhonebook[max]!=NULL) max++; |
5162 | printmsgerr("%i entries in backup file\n",max); | 5162 | printmsgerr("%i entries in backup file\n",max); |
5163 | if (MemStatus.MemoryFree < max) { | 5163 | if (MemStatus.MemoryFree < max) { |
5164 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); | 5164 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); |
5165 | } else if (answer_yes("Add phone phonebook entries")) { | 5165 | } else if (answer_yes("Add phone phonebook entries")) { |
5166 | for (i=0;i<max;i++) { | 5166 | for (i=0;i<max;i++) { |
5167 | Pbk = *Backup.PhonePhonebook[i]; | 5167 | Pbk = *Backup.PhonePhonebook[i]; |
5168 | Pbk.MemoryType = MEM_ME; | 5168 | Pbk.MemoryType = MEM_ME; |
5169 | error=Phone->AddMemory(&s, &Pbk); | 5169 | error=Phone->AddMemory(&s, &Pbk); |
5170 | Print_Error(error); | 5170 | Print_Error(error); |
5171 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5171 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5172 | if (gshutdown) { | 5172 | if (gshutdown) { |
5173 | GSM_Terminate(); | 5173 | GSM_Terminate(); |
5174 | exit(0); | 5174 | exit(0); |
5175 | } | 5175 | } |
5176 | } | 5176 | } |
5177 | printmsgerr("\n"); | 5177 | printmsgerr("\n"); |
5178 | } | 5178 | } |
5179 | } | 5179 | } |
5180 | } | 5180 | } |
5181 | if (Backup.SIMPhonebook[0] != NULL) { | 5181 | if (Backup.SIMPhonebook[0] != NULL) { |
5182 | MemStatus.MemoryType = MEM_SM; | 5182 | MemStatus.MemoryType = MEM_SM; |
5183 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 5183 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
5184 | if (error==ERR_NONE) { | 5184 | if (error==ERR_NONE) { |
5185 | max = 0; | 5185 | max = 0; |
5186 | while (Backup.SIMPhonebook[max]!=NULL) max++; | 5186 | while (Backup.SIMPhonebook[max]!=NULL) max++; |
5187 | printmsgerr("%i entries in backup file\n",max); | 5187 | printmsgerr("%i entries in backup file\n",max); |
5188 | if (MemStatus.MemoryFree < max) { | 5188 | if (MemStatus.MemoryFree < max) { |
5189 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); | 5189 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); |
5190 | } else if (answer_yes("Add SIM phonebook entries")) { | 5190 | } else if (answer_yes("Add SIM phonebook entries")) { |
5191 | j = 1; | 5191 | j = 1; |
5192 | for (i=0;i<max;i++) { | 5192 | for (i=0;i<max;i++) { |
5193 | Pbk = *Backup.SIMPhonebook[i]; | 5193 | Pbk = *Backup.SIMPhonebook[i]; |
5194 | Pbk.MemoryType = MEM_SM; | 5194 | Pbk.MemoryType = MEM_SM; |
5195 | error=Phone->AddMemory(&s, &Pbk); | 5195 | error=Phone->AddMemory(&s, &Pbk); |
5196 | Print_Error(error); | 5196 | Print_Error(error); |
5197 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5197 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5198 | if (gshutdown) { | 5198 | if (gshutdown) { |
5199 | GSM_Terminate(); | 5199 | GSM_Terminate(); |
5200 | exit(0); | 5200 | exit(0); |
5201 | } | 5201 | } |
5202 | } | 5202 | } |
5203 | printmsgerr("\n"); | 5203 | printmsgerr("\n"); |
5204 | } | 5204 | } |
5205 | } | 5205 | } |
5206 | } | 5206 | } |
5207 | 5207 | ||
5208 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { | 5208 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { |
5209 | if (answer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")) { | 5209 | if (true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) { |
5210 | GSM_GetCurrentDateTime(&date_time); | 5210 | GSM_GetCurrentDateTime(&date_time); |
5211 | 5211 | ||
5212 | error=Phone->SetDateTime(&s, &date_time); | 5212 | error=Phone->SetDateTime(&s, &date_time); |
5213 | Print_Error(error); | 5213 | Print_Error(error); |
5214 | } | 5214 | } |
5215 | } | 5215 | } |
5216 | if (Backup.Calendar[0] != NULL) { | 5216 | if (Backup.Calendar[0] != NULL) { |
5217 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 5217 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
5218 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { | 5218 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { |
5219 | if (answer_yes("Add calendar notes")) { | 5219 | if (answer_yes("Add calendar notes")) { |
5220 | max = 0; | 5220 | max = 0; |
5221 | while (Backup.Calendar[max]!=NULL) max++; | 5221 | while (Backup.Calendar[max]!=NULL) max++; |
5222 | for (i=0;i<max;i++) { | 5222 | for (i=0;i<max;i++) { |
5223 | Calendar = *Backup.Calendar[i]; | 5223 | Calendar = *Backup.Calendar[i]; |
5224 | error=Phone->AddCalendar(&s,&Calendar); | 5224 | error=Phone->AddCalendar(&s,&Calendar); |
5225 | Print_Error(error); | 5225 | Print_Error(error); |
5226 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5226 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5227 | if (gshutdown) { | 5227 | if (gshutdown) { |
5228 | GSM_Terminate(); | 5228 | GSM_Terminate(); |
5229 | exit(0); | 5229 | exit(0); |
5230 | } | 5230 | } |
5231 | } | 5231 | } |
5232 | printmsgerr("\n"); | 5232 | printmsgerr("\n"); |
5233 | } | 5233 | } |
5234 | } | 5234 | } |
5235 | } | 5235 | } |
5236 | if (Backup.ToDo[0] != NULL) { | 5236 | if (Backup.ToDo[0] != NULL) { |
5237 | ToDo.Location = 1; | 5237 | ToDo.Location = 1; |
5238 | error=Phone->GetToDoStatus(&s,&ToDoStatus); | 5238 | error=Phone->GetToDoStatus(&s,&ToDoStatus); |
5239 | if (error == ERR_NONE) { | 5239 | if (error == ERR_NONE) { |
5240 | if (answer_yes("Add ToDo")) { | 5240 | if (answer_yes("Add ToDo")) { |
5241 | max = 0; | 5241 | max = 0; |
5242 | while (Backup.ToDo[max]!=NULL) max++; | 5242 | while (Backup.ToDo[max]!=NULL) max++; |
5243 | for (i=0;i<max;i++) { | 5243 | for (i=0;i<max;i++) { |
5244 | ToDo = *Backup.ToDo[i]; | 5244 | ToDo = *Backup.ToDo[i]; |
5245 | error = Phone->AddToDo(&s,&ToDo); | 5245 | error = Phone->AddToDo(&s,&ToDo); |
5246 | Print_Error(error); | 5246 | Print_Error(error); |
5247 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5247 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5248 | if (gshutdown) { | 5248 | if (gshutdown) { |
5249 | GSM_Terminate(); | 5249 | GSM_Terminate(); |
5250 | exit(0); | 5250 | exit(0); |
5251 | } | 5251 | } |
5252 | } | 5252 | } |
5253 | printmsgerr("\n"); | 5253 | printmsgerr("\n"); |
5254 | } | 5254 | } |
5255 | } | 5255 | } |
5256 | } | 5256 | } |
5257 | if (Backup.WAPBookmark[0] != NULL) { | 5257 | if (Backup.WAPBookmark[0] != NULL) { |
diff --git a/gammu/gammu.tar.bz2 b/gammu/gammu.tar.bz2 deleted file mode 100644 index 7c921a7..0000000 --- a/gammu/gammu.tar.bz2 +++ b/dev/null | |||
Binary files differ | |||