UI: set the waiting cursor from pack/unpack operators
Remove the guimode argument which used to set the cursor back in v2.4x.
This commit is contained in:
@@ -103,8 +103,7 @@ int BKE_packedfile_unpack_all_libraries(struct Main *bmain, struct ReportList *r
|
||||
int BKE_packedfile_write_to_file(struct ReportList *reports,
|
||||
const char *ref_file_name,
|
||||
const char *filepath,
|
||||
struct PackedFile *pf,
|
||||
bool guimode);
|
||||
struct PackedFile *pf);
|
||||
|
||||
/* Free. */
|
||||
|
||||
|
||||
@@ -286,8 +286,7 @@ void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose)
|
||||
int BKE_packedfile_write_to_file(ReportList *reports,
|
||||
const char *ref_file_name,
|
||||
const char *filepath_rel,
|
||||
PackedFile *pf,
|
||||
const bool guimode)
|
||||
PackedFile *pf)
|
||||
{
|
||||
int file, number;
|
||||
int ret_value = RET_OK;
|
||||
@@ -296,9 +295,6 @@ int BKE_packedfile_write_to_file(ReportList *reports,
|
||||
char filepath_temp[FILE_MAX];
|
||||
/* void *data; */
|
||||
|
||||
if (guimode) {
|
||||
} // XXX waitcursor(1);
|
||||
|
||||
STRNCPY(filepath, filepath_rel);
|
||||
BLI_path_abs(filepath, ref_file_name);
|
||||
|
||||
@@ -350,9 +346,6 @@ int BKE_packedfile_write_to_file(ReportList *reports,
|
||||
}
|
||||
}
|
||||
|
||||
if (guimode) {
|
||||
} // XXX waitcursor(0);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
@@ -441,7 +434,7 @@ char *BKE_packedfile_unpack_to_file(ReportList *reports,
|
||||
ATTR_FALLTHROUGH;
|
||||
}
|
||||
case PF_WRITE_LOCAL:
|
||||
if (BKE_packedfile_write_to_file(reports, ref_file_name, local_name, pf, 1) == RET_OK) {
|
||||
if (BKE_packedfile_write_to_file(reports, ref_file_name, local_name, pf) == RET_OK) {
|
||||
temp = local_name;
|
||||
}
|
||||
break;
|
||||
@@ -461,7 +454,7 @@ char *BKE_packedfile_unpack_to_file(ReportList *reports,
|
||||
ATTR_FALLTHROUGH;
|
||||
}
|
||||
case PF_WRITE_ORIGINAL:
|
||||
if (BKE_packedfile_write_to_file(reports, ref_file_name, abs_name, pf, 1) == RET_OK) {
|
||||
if (BKE_packedfile_write_to_file(reports, ref_file_name, abs_name, pf) == RET_OK) {
|
||||
temp = abs_name;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -73,7 +73,9 @@ static int unpack_libraries_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
|
||||
WM_cursor_wait(true);
|
||||
BKE_packedfile_unpack_all_libraries(bmain, op->reports);
|
||||
WM_cursor_wait(false);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@@ -225,7 +227,9 @@ static int unpack_all_exec(bContext *C, wmOperator *op)
|
||||
int method = RNA_enum_get(op->ptr, "method");
|
||||
|
||||
if (method != PF_KEEP) {
|
||||
WM_cursor_wait(true);
|
||||
BKE_packedfile_unpack_all(bmain, op->reports, method); /* XXX PF_ASK can't work here */
|
||||
WM_cursor_wait(false);
|
||||
}
|
||||
G.fileflags &= ~G_FILE_AUTOPACK;
|
||||
|
||||
@@ -329,7 +333,9 @@ static int unpack_item_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
if (method != PF_KEEP) {
|
||||
WM_cursor_wait(true);
|
||||
BKE_packedfile_id_unpack(bmain, id, op->reports, method); /* XXX PF_ASK can't work here */
|
||||
WM_cursor_wait(false);
|
||||
}
|
||||
|
||||
G.fileflags &= ~G_FILE_AUTOPACK;
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
static void rna_ImagePackedFile_save(ImagePackedFile *imapf, Main *bmain, ReportList *reports)
|
||||
{
|
||||
if (BKE_packedfile_write_to_file(
|
||||
reports, BKE_main_blendfile_path(bmain), imapf->filepath, imapf->packedfile, 0) !=
|
||||
RET_OK)
|
||||
reports, BKE_main_blendfile_path(bmain), imapf->filepath, imapf->packedfile) != RET_OK)
|
||||
{
|
||||
BKE_reportf(reports, RPT_ERROR, "Could not save packed file to disk as '%s'", imapf->filepath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user