gva-main

gva-main — Main Window

Synopsis




void                gva_main_init                       (void);
gboolean            gva_main_build_database             (GError **error);
void                gva_main_connect_proxy_cb           (GtkUIManager *manager,
                                                         GtkAction *action,
                                                         GtkWidget *proxy);
guint               gva_main_statusbar_get_context_id   (const gchar *context_description);
guint               gva_main_statusbar_push             (guint context_id,
                                                         const gchar *format,
                                                         ...);
void                gva_main_statusbar_pop              (guint context_id);
void                gva_main_statusbar_remove           (guint context_id,
                                                         guint message_id);
void                gva_main_window_destroy_cb          (GtkWindow *window);

Description

These functions manipulate the main window, excluding the tree view. The tree view functions are documented separately in the gva-tree-view section.

Details

gva_main_init ()

void                gva_main_init                       (void);

Initializes the main window.

This function should be called once when the application starts.


gva_main_build_database ()

gboolean            gva_main_build_database             (GError **error);

Executes the lengthy process of constructing the games database. The function displays a progress bar in the main status bar that tracks the database construction. The function is synchronous; it blocks until database construction is complete or aborted.

error :

return location for a GError, or NULL

Returns :

TRUE if the database construction was successful, FALSE if construction failed or was aborted

gva_main_connect_proxy_cb ()

void                gva_main_connect_proxy_cb           (GtkUIManager *manager,
                                                         GtkAction *action,
                                                         GtkWidget *proxy);

Callback for manager's "connect-proxy" signal. The function configures main menu items to display the appropriate tooltip in the status bar when the mouse hovers over them. action supplies the tooltip.

manager :

a GtkUIManager

action :

a GtkAction

proxy :

a GtkWidget

gva_main_statusbar_get_context_id ()

guint               gva_main_statusbar_get_context_id   (const gchar *context_description);

Thin wrapper for gtk_statusbar_get_context_id() that uses the main window's status bar.

Returns a new context identifier, given a description of the actual context. Note that the description is not shown in the UI.

context_description :

textual description of what context the new message is being used in

Returns :

a context identifier

gva_main_statusbar_push ()

guint               gva_main_statusbar_push             (guint context_id,
                                                         const gchar *format,
                                                         ...);

Thin wrapper for gtk_statusbar_push() that uses the main window's status bar.

Pushes a new message onto the status bar's stack. As a convenience, the function takes a printf()-style format string and variable length argument list.

context_id :

a context identifier

format :

a standard printf() format string

... :

the arguments to insert into the format string

Returns :

a message identifier that can be used with gva_main_statusbar_remove()

gva_main_statusbar_pop ()

void                gva_main_statusbar_pop              (guint context_id);

Thin wrapper for gtk_statusbar_pop() that uses the main window's status bar.

Removes the first message in the status bar's stack with the given context id.

Note that this may not change the displayed message, if the message at the top of the stack has a different context id.

context_id :

a context identifier

gva_main_statusbar_remove ()

void                gva_main_statusbar_remove           (guint context_id,
                                                         guint message_id);

Thin wrapper for gtk_statusbar_remove() that uses the main window's status bar.

Forces the removal of a message from a status bar's stack. The exact context_id and message_id must be specified.

context_id :

a context identifier

message_id :

a message identifier

gva_main_window_destroy_cb ()

void                gva_main_window_destroy_cb          (GtkWindow *window);

Handler for "destroy" signals to the main window.

Activates the GVA_ACTION_QUIT action.

window :

the main window