WM: remove unnecessary context argument from WM_report, no good reason to have it.
This commit is contained in:
@@ -2417,7 +2417,7 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
|
||||
double value;
|
||||
|
||||
if (ui_but_string_set_eval_num(C, but, str, &value) == false) {
|
||||
WM_report_banner_show(C);
|
||||
WM_report_banner_show();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -2300,7 +2300,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
}
|
||||
else {
|
||||
WM_report(C, RPT_ERROR, "Paste expected 3 numbers, formatted: '[n, n, n]'");
|
||||
WM_report(RPT_ERROR, "Paste expected 3 numbers, formatted: '[n, n, n]'");
|
||||
show_report = true;
|
||||
}
|
||||
}
|
||||
@@ -2345,7 +2345,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
}
|
||||
else {
|
||||
WM_report(C, RPT_ERROR, "Paste expected 4 numbers, formatted: '[n, n, n, n]'");
|
||||
WM_report(RPT_ERROR, "Paste expected 4 numbers, formatted: '[n, n, n, n]'");
|
||||
show_report = true;
|
||||
}
|
||||
}
|
||||
@@ -2444,7 +2444,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
|
||||
}
|
||||
|
||||
if (show_report) {
|
||||
WM_report_banner_show(C);
|
||||
WM_report_banner_show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6993,7 +6993,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
|
||||
/* this should become disabled button .. */
|
||||
if (but->lock == true) {
|
||||
if (but->lockstr) {
|
||||
WM_report(C, RPT_INFO, but->lockstr);
|
||||
WM_report(RPT_INFO, but->lockstr);
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
return WM_UI_HANDLER_BREAK;
|
||||
}
|
||||
@@ -7636,7 +7636,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
|
||||
* No warnings should show for editing driver expressions though!
|
||||
*/
|
||||
if (state != BUTTON_STATE_TEXT_EDITING) {
|
||||
WM_report(C, RPT_INFO, "Can't edit driven number value, see graph editor for the driver setup.");
|
||||
WM_report(RPT_INFO, "Can't edit driven number value, see graph editor for the driver setup.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -194,9 +194,9 @@ void WM_main_remove_notifier_reference(const void *reference);
|
||||
void WM_main_remove_editor_id_reference(const struct ID *id);
|
||||
|
||||
/* reports */
|
||||
void WM_report_banner_show(const struct bContext *C);
|
||||
void WM_report(const struct bContext *C, ReportType type, const char *message);
|
||||
void WM_reportf(const struct bContext *C, ReportType type, const char *format, ...) ATTR_PRINTF_FORMAT(3, 4);
|
||||
void WM_report_banner_show(void);
|
||||
void WM_report(ReportType type, const char *message);
|
||||
void WM_reportf(ReportType type, const char *format, ...) ATTR_PRINTF_FORMAT(2, 3);
|
||||
|
||||
void wm_event_add_ex(
|
||||
struct wmWindow *win, const struct wmEvent *event_to_add,
|
||||
|
||||
@@ -598,17 +598,17 @@ void WM_event_print(const wmEvent *event)
|
||||
/**
|
||||
* Show the report in the info header.
|
||||
*/
|
||||
void WM_report_banner_show(const bContext *C)
|
||||
void WM_report_banner_show()
|
||||
{
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
ReportList *wm_reports = CTX_wm_reports(C);
|
||||
wmWindowManager *wm = G.main->wm.first;
|
||||
ReportList *wm_reports = &wm->reports;
|
||||
ReportTimerInfo *rti;
|
||||
|
||||
/* After adding reports to the global list, reset the report timer. */
|
||||
WM_event_remove_timer(wm, NULL, wm_reports->reporttimer);
|
||||
|
||||
/* Records time since last report was added */
|
||||
wm_reports->reporttimer = WM_event_add_timer(wm, CTX_wm_window(C), TIMERREPORT, 0.05);
|
||||
wm_reports->reporttimer = WM_event_add_timer(wm, wm->winactive, TIMERREPORT, 0.05);
|
||||
|
||||
rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
|
||||
wm_reports->reporttimer->customdata = rti;
|
||||
@@ -624,32 +624,32 @@ void WM_ndof_deadzone_set(float deadzone)
|
||||
GHOST_setNDOFDeadZone(deadzone);
|
||||
}
|
||||
|
||||
static void wm_add_reports(const bContext *C, ReportList *reports)
|
||||
static void wm_add_reports(ReportList *reports)
|
||||
{
|
||||
/* if the caller owns them, handle this */
|
||||
if (reports->list.first && (reports->flag & RPT_OP_HOLD) == 0) {
|
||||
ReportList *wm_reports = CTX_wm_reports(C);
|
||||
wmWindowManager *wm = G.main->wm.first;
|
||||
|
||||
/* add reports to the global list, otherwise they are not seen */
|
||||
BLI_movelisttolist(&wm_reports->list, &reports->list);
|
||||
BLI_movelisttolist(&wm->reports.list, &reports->list);
|
||||
|
||||
WM_report_banner_show(C);
|
||||
WM_report_banner_show();
|
||||
}
|
||||
}
|
||||
|
||||
void WM_report(const bContext *C, ReportType type, const char *message)
|
||||
void WM_report(ReportType type, const char *message)
|
||||
{
|
||||
ReportList reports;
|
||||
|
||||
BKE_reports_init(&reports, RPT_STORE);
|
||||
BKE_report(&reports, type, message);
|
||||
|
||||
wm_add_reports(C, &reports);
|
||||
wm_add_reports(&reports);
|
||||
|
||||
BKE_reports_clear(&reports);
|
||||
}
|
||||
|
||||
void WM_reportf(const bContext *C, ReportType type, const char *format, ...)
|
||||
void WM_reportf(ReportType type, const char *format, ...)
|
||||
{
|
||||
DynStr *ds;
|
||||
va_list args;
|
||||
@@ -659,7 +659,7 @@ void WM_reportf(const bContext *C, ReportType type, const char *format, ...)
|
||||
BLI_dynstr_vappendf(ds, format, args);
|
||||
va_end(args);
|
||||
|
||||
WM_report(C, type, BLI_dynstr_get_cstring(ds));
|
||||
WM_report(type, BLI_dynstr_get_cstring(ds));
|
||||
|
||||
BLI_dynstr_free(ds);
|
||||
}
|
||||
@@ -706,7 +706,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool ca
|
||||
}
|
||||
|
||||
/* if the caller owns them, handle this */
|
||||
wm_add_reports(C, op->reports);
|
||||
wm_add_reports(op->reports);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1867,7 +1867,7 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand
|
||||
BLI_movelisttolist(&CTX_wm_reports(C)->list, &handler->op->reports->list);
|
||||
|
||||
/* more hacks, since we meddle with reports, banner display doesn't happen automatic */
|
||||
WM_report_banner_show(C);
|
||||
WM_report_banner_show();
|
||||
|
||||
CTX_wm_window_set(C, win_prev);
|
||||
CTX_wm_area_set(C, area_prev);
|
||||
|
||||
@@ -429,7 +429,7 @@ void wm_file_read_report(bContext *C)
|
||||
|
||||
if (reports) {
|
||||
if (!G.background) {
|
||||
WM_report_banner_show(C);
|
||||
WM_report_banner_show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user