|
@@ -1338,12 +1338,25 @@
|
|
|
int item_count = [[sectionjson valueForKey:@"count"] intValue];
|
|
int item_count = [[sectionjson valueForKey:@"count"] intValue];
|
|
|
for(int j=0;j<item_count;j++)
|
|
for(int j=0;j<item_count;j++)
|
|
|
{
|
|
{
|
|
|
|
|
+
|
|
|
NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
|
// NSMutableDictionary * to_itemjson=[[to_sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
// NSMutableDictionary * to_itemjson=[[to_sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
|
|
|
|
|
|
|
|
if([[itemjson valueForKey:@"dirty"] isEqualToString:@"true"])
|
|
if([[itemjson valueForKey:@"dirty"] isEqualToString:@"true"])
|
|
|
{
|
|
{
|
|
|
- [to_sectionjson setObject:itemjson forKey:[NSString stringWithFormat:@"item_%d",j ]];
|
|
|
|
|
|
|
+ int toindex = -1;
|
|
|
|
|
+ for(int l=0;l<[to_sectionjson[@"count"] intValue];l++)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSDictionary* lobject = to_sectionjson[[NSString stringWithFormat:@"item_%d",l]];
|
|
|
|
|
+ if([[lobject[@"name"] stringValue] isEqualToString:[itemjson[@"name"]stringValue]])
|
|
|
|
|
+ {
|
|
|
|
|
+ toindex = l;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [to_sectionjson setObject:itemjson forKey:[NSString stringWithFormat:@"item_%d",toindex ]];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1351,8 +1364,11 @@
|
|
|
}
|
|
}
|
|
|
return to;
|
|
return to;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
--(void) refresh:(NSString*) trigger;
|
|
|
|
|
|
|
+-(void) refresh:(NSString*) trigger
|
|
|
|
|
+{
|
|
|
|
|
+ [self refresh:trigger discardDirty:false];
|
|
|
|
|
+}
|
|
|
|
|
+-(void) refresh:(NSString*) trigger discardDirty:(bool) discardDirty
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
[self.lastedit endEditing:true];
|
|
[self.lastedit endEditing:true];
|
|
@@ -1381,8 +1397,11 @@
|
|
|
[waitalert dismissViewControllerAnimated:YES completion:^{
|
|
[waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
- weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ {
|
|
|
|
|
+ weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
|
|
weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
|
|
|
|
|
|
|
@@ -1956,6 +1975,7 @@
|
|
|
{
|
|
{
|
|
|
NSMutableDictionary* sub_action = [[item_json objectForKey:[NSString stringWithFormat:@"item_%d",subaction_tag]] mutableCopy];
|
|
NSMutableDictionary* sub_action = [[item_json objectForKey:[NSString stringWithFormat:@"item_%d",subaction_tag]] mutableCopy];
|
|
|
int refresh = [[sub_action valueForKey:@"refresh"] intValue];
|
|
int refresh = [[sub_action valueForKey:@"refresh"] intValue];
|
|
|
|
|
+ bool discardDirty = [[sub_action valueForKey:@"discard_dirty"] boolValue];
|
|
|
NSString* refresh_trigger = [sub_action valueForKey:@"name"];
|
|
NSString* refresh_trigger = [sub_action valueForKey:@"name"];
|
|
|
NSDictionary * restore_json=[sub_action objectForKeyedSubscript:@"restore"];
|
|
NSDictionary * restore_json=[sub_action objectForKeyedSubscript:@"restore"];
|
|
|
|
|
|
|
@@ -2134,7 +2154,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- [self refresh:refresh_trigger] ;
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:true];
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2150,6 +2173,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
|
|
+ bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
|
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
|
NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
|
|
NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
|
|
|
|
|
|
|
@@ -2321,7 +2345,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ if(!discardDirty)
|
|
|
[self refresh:refresh_trigger] ;
|
|
[self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:false];
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2519,7 +2546,7 @@
|
|
|
self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
|
|
|
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
-
|
|
|
|
|
|
|
+ bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
|
|
|
NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
|
|
NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
|
|
|
bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
|
|
bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
|
|
|
if(refresh==1)
|
|
if(refresh==1)
|
|
@@ -2558,7 +2585,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- [self refresh:refresh_trigger] ;
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:true];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else if(partial_refresh)
|
|
else if(partial_refresh)
|
|
@@ -2671,7 +2701,7 @@
|
|
|
self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
|
|
|
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
-
|
|
|
|
|
|
|
+ bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
|
|
|
NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
|
|
NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
|
|
|
bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
|
|
bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
|
|
|
if(refresh==1)
|
|
if(refresh==1)
|
|
@@ -2710,7 +2740,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- [self refresh:refresh_trigger] ;
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:true];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else if(partial_refresh)
|
|
else if(partial_refresh)
|
|
@@ -5293,6 +5326,7 @@
|
|
|
NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
|
|
NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
|
|
|
|
|
|
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
|
|
+ bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
|
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
|
|
|
|
|
@@ -5349,7 +5383,10 @@
|
|
|
|
|
|
|
|
if(refresh==1)
|
|
if(refresh==1)
|
|
|
{
|
|
{
|
|
|
- [self refresh:refresh_trigger];
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:true];
|
|
|
}
|
|
}
|
|
|
[self.editorTable reloadData ];
|
|
[self.editorTable reloadData ];
|
|
|
}
|
|
}
|
|
@@ -5366,6 +5403,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
|
|
+ bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
|
|
|
|
|
|
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
@@ -5452,7 +5490,10 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- [self refresh:refresh_trigger] ;
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:true];
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -6195,6 +6236,7 @@
|
|
|
NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
|
|
NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
|
|
|
|
|
|
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
|
|
+ bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
|
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
|
|
|
|
|
@@ -6251,7 +6293,10 @@
|
|
|
|
|
|
|
|
if(refresh==1)
|
|
if(refresh==1)
|
|
|
{
|
|
{
|
|
|
- [self refresh:refresh_trigger];
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:true];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -6279,6 +6324,7 @@
|
|
|
NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
|
|
NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
|
|
|
|
|
|
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
int refresh = [[item_json valueForKey:@"refresh"] intValue];
|
|
|
|
|
+ bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
|
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
NSString* refresh_trigger = [item_json valueForKey:@"name"];
|
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
NSString* subid=[item_json valueForKey:@"subid"];
|
|
|
NSString* check=@"false";
|
|
NSString* check=@"false";
|
|
@@ -6331,7 +6377,10 @@
|
|
|
|
|
|
|
|
if(refresh==1)
|
|
if(refresh==1)
|
|
|
{
|
|
{
|
|
|
- [self refresh:refresh_trigger];
|
|
|
|
|
|
|
+ if(!discardDirty)
|
|
|
|
|
+ [self refresh:refresh_trigger] ;
|
|
|
|
|
+ else
|
|
|
|
|
+ [self refresh:refresh_trigger discardDirty:true];
|
|
|
}
|
|
}
|
|
|
DebugLog(@"switch unlock");
|
|
DebugLog(@"switch unlock");
|
|
|
// [self.switchlock unlock];
|
|
// [self.switchlock unlock];
|