mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Show indicator when form has unsaved changes
This commit is contained in:
parent
ef8b8e637d
commit
16acb52ca3
@ -103,14 +103,7 @@ create_status_bar(void)
|
|||||||
void
|
void
|
||||||
status_bar_update_virtual(void)
|
status_bar_update_virtual(void)
|
||||||
{
|
{
|
||||||
GDateTime *now_time = g_date_time_new_now_local();
|
_status_bar_draw();
|
||||||
GTimeSpan elapsed = g_date_time_difference(now_time, last_time);
|
|
||||||
|
|
||||||
if (elapsed >= TIME_CHECK) {
|
|
||||||
_status_bar_draw();
|
|
||||||
}
|
|
||||||
|
|
||||||
g_date_time_unref(now_time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -86,10 +86,10 @@ title_bar_update_virtual(void)
|
|||||||
g_timer_destroy(typing_elapsed);
|
g_timer_destroy(typing_elapsed);
|
||||||
typing_elapsed = NULL;
|
typing_elapsed = NULL;
|
||||||
|
|
||||||
_title_bar_draw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_title_bar_draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -241,6 +241,14 @@ _title_bar_draw(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
// show contact typing
|
||||||
if (typing) {
|
if (typing) {
|
||||||
wprintw(win, " (typing...)");
|
wprintw(win, " (typing...)");
|
||||||
|
@ -81,7 +81,11 @@ wins_get_console(void)
|
|||||||
ProfWin *
|
ProfWin *
|
||||||
wins_get_current(void)
|
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 *
|
GList *
|
||||||
|
Loading…
Reference in New Issue
Block a user