1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Show indicator when form has unsaved changes

This commit is contained in:
James Booth 2014-09-16 22:23:59 +01:00
parent ef8b8e637d
commit 16acb52ca3
3 changed files with 15 additions and 10 deletions

View File

@ -103,14 +103,7 @@ create_status_bar(void)
void
status_bar_update_virtual(void)
{
GDateTime *now_time = g_date_time_new_now_local();
GTimeSpan elapsed = g_date_time_difference(now_time, last_time);
if (elapsed >= TIME_CHECK) {
_status_bar_draw();
}
g_date_time_unref(now_time);
_status_bar_draw();
}
void

View File

@ -86,10 +86,10 @@ title_bar_update_virtual(void)
g_timer_destroy(typing_elapsed);
typing_elapsed = NULL;
_title_bar_draw();
}
}
}
_title_bar_draw();
}
void
@ -241,6 +241,14 @@ _title_bar_draw(void)
}
#endif
// show indicator for unsaved forms
ProfWin *current = wins_get_current();
if ((current != NULL ) && (current->type == WIN_MUC_CONFIG)) {
if ((current->form != NULL) && (current->form->modified)) {
wprintw(win, " *");
}
}
// show contact typing
if (typing) {
wprintw(win, " (typing...)");

View File

@ -81,7 +81,11 @@ wins_get_console(void)
ProfWin *
wins_get_current(void)
{
return g_hash_table_lookup(windows, GINT_TO_POINTER(current));
if (windows != NULL) {
return g_hash_table_lookup(windows, GINT_TO_POINTER(current));
} else {
return NULL;
}
}
GList *