Added missing files, refactored ui_switch_win to check win exists
This commit is contained in:
@@ -530,12 +530,10 @@ gboolean
|
||||
cmd_win(gchar **args, struct cmd_help_t help)
|
||||
{
|
||||
int num = atoi(args[0]);
|
||||
if (ui_win_exists(num)) {
|
||||
ui_switch_win(num);
|
||||
} else {
|
||||
gboolean switched = ui_switch_win(num);
|
||||
if (switched == FALSE) {
|
||||
cons_show("Window %d does not exist.", num);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -531,12 +531,12 @@ _get_recipient_string(ProfWin *window)
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
_ui_switch_win(const int i)
|
||||
{
|
||||
ui_current_page_off();
|
||||
ProfWin *new_current = wins_get_by_num(i);
|
||||
if (new_current != NULL) {
|
||||
if (ui_win_exists(i)) {
|
||||
ui_current_page_off();
|
||||
ProfWin *new_current = wins_get_by_num(i);
|
||||
wins_set_current_by_num(i);
|
||||
ui_current_page_off();
|
||||
|
||||
@@ -554,6 +554,9 @@ _ui_switch_win(const int i)
|
||||
status_bar_active(i);
|
||||
}
|
||||
wins_update_virtual_current();
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ void (*ui_resize)(const int ch, const char * const input,
|
||||
GSList* (*ui_get_recipients)(void);
|
||||
void (*ui_handle_special_keys)(const wint_t * const ch, const char * const inp,
|
||||
const int size);
|
||||
void (*ui_switch_win)(const int i);
|
||||
gboolean (*ui_switch_win)(const int i);
|
||||
void (*ui_next_win)(void);
|
||||
void (*ui_previous_win)(void);
|
||||
void (*ui_gone_secure)(const char * const recipient, gboolean trusted);
|
||||
|
||||
Reference in New Issue
Block a user