Add function ag_window_is_usable()
This function can decide if a given window is usable for opening a new chart.
This commit is contained in:
parent
721edf582d
commit
6fe03c5a52
@ -2767,3 +2767,20 @@ ag_window_load_chart_list(AgWindow *window)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* ag_window_is_usable:
|
||||
* @window: an #AgWindow to test
|
||||
*
|
||||
* Checks if the given window is usable for new charts. Usability is
|
||||
* currently means that it has no charts open.
|
||||
*
|
||||
* Returns: TRUE if @window is usable, FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
ag_window_is_usable(AgWindow *window)
|
||||
{
|
||||
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
||||
|
||||
return (priv->current_tab == priv->tab_list);
|
||||
}
|
||||
|
@ -59,6 +59,8 @@ void ag_window_change_tab(AgWindow *window, const gchar *tab_name);
|
||||
|
||||
gboolean ag_window_load_chart_list(AgWindow *window);
|
||||
|
||||
gboolean ag_window_is_usable(AgWindow *window);
|
||||
|
||||
#define AG_WINDOW_ERROR (ag_window_error_quark())
|
||||
|
||||
GQuark ag_window_error_quark(void);
|
||||
|
Loading…
Reference in New Issue
Block a user