mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-06-11 17:49:15 +08:00
Add option to mark installed TitleDB entry as updated.
This commit is contained in:
parent
d9e12f8fdd
commit
1fe458a57c
@ -58,4 +58,5 @@ void action_install_url(const char* confirmMessage, const char* urls, const char
|
||||
void (*drawTop)(ui_view* view, void* data, float x1, float y1, float x2, float y2, u32 index));
|
||||
|
||||
void action_install_titledb(linked_list* items, list_item* selected, bool cia);
|
||||
void action_mark_titledb_updated(linked_list* items, list_item* selected, bool cia);
|
||||
void action_update_titledb(linked_list* items, list_item* selected);
|
27
source/fbi/action/marktitledbupdated.c
Normal file
27
source/fbi/action/marktitledbupdated.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <3ds.h>
|
||||
|
||||
#include "action.h"
|
||||
#include "../task/uitask.h"
|
||||
#include "../../core/core.h"
|
||||
|
||||
void action_mark_titledb_updated(linked_list* items, list_item* selected, bool cia) {
|
||||
titledb_info* info = (titledb_info*) selected->data;
|
||||
|
||||
if((cia && info->cia.installed) || (!cia && info->tdsx.installed)) {
|
||||
titledb_cache_entry entry;
|
||||
if(cia) {
|
||||
entry.id = info->cia.id;
|
||||
strncpy(entry.mtime, info->cia.mtime, sizeof(entry.mtime));
|
||||
strncpy(entry.version, info->cia.version, sizeof(entry.version));
|
||||
} else {
|
||||
entry.id = info->tdsx.id;
|
||||
strncpy(entry.mtime, info->tdsx.mtime, sizeof(entry.mtime));
|
||||
strncpy(entry.version, info->tdsx.version, sizeof(entry.version));
|
||||
}
|
||||
|
||||
task_populate_titledb_cache_set(info->id, cia, &entry);
|
||||
task_populate_titledb_update_status(selected);
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@
|
||||
#include "../core/core.h"
|
||||
|
||||
static list_item install = {"Install", COLOR_TEXT, action_install_titledb};
|
||||
static list_item mark_updated = {"Mark Updated", COLOR_TEXT, action_mark_titledb_updated};
|
||||
|
||||
typedef struct {
|
||||
populate_titledb_data populateData;
|
||||
@ -76,6 +77,7 @@ static void titledb_action_update(ui_view* view, void* data, linked_list* items,
|
||||
|
||||
if(linked_list_size(items) == 0) {
|
||||
linked_list_add(items, &install);
|
||||
linked_list_add(items, &mark_updated);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user