Kaydet (Commit) 3d4e8b41 authored tarafından Matthew Brush's avatar Matthew Brush

Merge pull request #25 from techee/project_patches

Project patches
...@@ -156,18 +156,18 @@ signal void (*project_save)(GObject *obj, GKeyFile *config, gpointer user_data); ...@@ -156,18 +156,18 @@ signal void (*project_save)(GObject *obj, GKeyFile *config, gpointer user_data);
*/ */
signal void (*project_close)(GObject *obj, gpointer user_data); signal void (*project_close)(GObject *obj, gpointer user_data);
/** Sent after a project dialog is created but before it is displayed. Plugins /** Sent after a project dialog is opened but before it is displayed. Plugins
* can append their own project settings tabs by using this signal. * can append their own project settings tabs by using this signal.
* @param obj a GeanyObject instance, should be ignored. * @param obj a GeanyObject instance, should be ignored.
* @param notebook a GtkNotebook instance that can be used by plugins to append their * @param notebook a GtkNotebook instance that can be used by plugins to append their
* settings tabs. * settings tabs.
* @param user_data user data. * @param user_data user data.
*/ */
signal void (*project_dialog_create)(GObject *obj, GtkWidget *notebook, gpointer user_data); signal void (*project_dialog_open)(GObject *obj, GtkWidget *notebook, gpointer user_data);
/** Sent when the settings dialog is confirmed by the user. Plugins can use /** Sent when the settings dialog is confirmed by the user. Plugins can use
* this signal to read the settings widgets previously added by using the * this signal to read the settings widgets previously added by using the
* @c project-dialog-create signal. * @c project-dialog-open signal.
* @warning The dialog will still be running afterwards if the user chose 'Apply'. * @warning The dialog will still be running afterwards if the user chose 'Apply'.
* @param obj a GeanyObject instance, should be ignored. * @param obj a GeanyObject instance, should be ignored.
* @param notebook a GtkNotebook instance that can be used by plugins to read their * @param notebook a GtkNotebook instance that can be used by plugins to read their
...@@ -176,6 +176,15 @@ signal void (*project_dialog_create)(GObject *obj, GtkWidget *notebook, gpointer ...@@ -176,6 +176,15 @@ signal void (*project_dialog_create)(GObject *obj, GtkWidget *notebook, gpointer
*/ */
signal void (*project_dialog_confirmed)(GObject *obj, GtkWidget *notebook, gpointer user_data); signal void (*project_dialog_confirmed)(GObject *obj, GtkWidget *notebook, gpointer user_data);
/** Sent before project dialog is closed. By using this signal, plugins can remove
* tabs previously added in project-dialog-open signal handler.
* @param obj a GeanyObject instance, should be ignored.
* @param notebook a GtkNotebook instance that can be used by plugins to remove
* settings tabs previously added in the project-dialog-open signal handler.
* @param user_data user data.
*/
signal void (*project_dialog_close)(GObject *obj, GtkWidget *notebook, gpointer user_data);
/** Sent once Geany has finished all initialization and startup tasks and the GUI has been /** Sent once Geany has finished all initialization and startup tasks and the GUI has been
* realized. This signal is the very last step in the startup process and is sent once * realized. This signal is the very last step in the startup process and is sent once
* the GTK main event loop has been entered. * the GTK main event loop has been entered.
......
...@@ -269,11 +269,11 @@ static void create_signals(GObjectClass *g_object_class) ...@@ -269,11 +269,11 @@ static void create_signals(GObjectClass *g_object_class)
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__VOID, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
geany_object_signals[GCB_PROJECT_DIALOG_CREATE] = g_signal_new ( geany_object_signals[GCB_PROJECT_DIALOG_OPEN] = g_signal_new (
"project-dialog-create", "project-dialog-open",
G_OBJECT_CLASS_TYPE (g_object_class), G_OBJECT_CLASS_TYPE (g_object_class),
G_SIGNAL_RUN_FIRST, G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GeanyObjectClass, project_dialog_create), G_STRUCT_OFFSET (GeanyObjectClass, project_dialog_open),
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__POINTER, g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
...@@ -287,6 +287,15 @@ static void create_signals(GObjectClass *g_object_class) ...@@ -287,6 +287,15 @@ static void create_signals(GObjectClass *g_object_class)
g_cclosure_marshal_VOID__POINTER, g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
G_TYPE_POINTER); G_TYPE_POINTER);
geany_object_signals[GCB_PROJECT_DIALOG_CLOSE] = g_signal_new (
"project-dialog-close",
G_OBJECT_CLASS_TYPE (g_object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GeanyObjectClass, project_dialog_close),
NULL, NULL,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
G_TYPE_POINTER);
/* Editor signals */ /* Editor signals */
geany_object_signals[GCB_UPDATE_EDITOR_MENU] = g_signal_new ( geany_object_signals[GCB_UPDATE_EDITOR_MENU] = g_signal_new (
......
...@@ -41,8 +41,9 @@ typedef enum ...@@ -41,8 +41,9 @@ typedef enum
GCB_PROJECT_OPEN, GCB_PROJECT_OPEN,
GCB_PROJECT_SAVE, GCB_PROJECT_SAVE,
GCB_PROJECT_CLOSE, GCB_PROJECT_CLOSE,
GCB_PROJECT_DIALOG_CREATE, GCB_PROJECT_DIALOG_OPEN,
GCB_PROJECT_DIALOG_CONFIRMED, GCB_PROJECT_DIALOG_CONFIRMED,
GCB_PROJECT_DIALOG_CLOSE,
GCB_UPDATE_EDITOR_MENU, GCB_UPDATE_EDITOR_MENU,
GCB_EDITOR_NOTIFY, GCB_EDITOR_NOTIFY,
GCB_GEANY_STARTUP_COMPLETE, GCB_GEANY_STARTUP_COMPLETE,
...@@ -90,8 +91,9 @@ struct _GeanyObjectClass ...@@ -90,8 +91,9 @@ struct _GeanyObjectClass
void (*project_open)(GKeyFile *keyfile); void (*project_open)(GKeyFile *keyfile);
void (*project_save)(GKeyFile *keyfile); void (*project_save)(GKeyFile *keyfile);
void (*project_close)(void); void (*project_close)(void);
void (*project_dialog_create)(GtkWidget *notebook); void (*project_dialog_open)(GtkWidget *notebook);
void (*project_dialog_confirmed)(GtkWidget *notebook); void (*project_dialog_confirmed)(GtkWidget *notebook);
void (*project_dialog_close)(GtkWidget *notebook);
void (*update_editor_menu)(const gchar *word, gint click_pos, GeanyDocument *doc); void (*update_editor_menu)(const gchar *word, gint click_pos, GeanyDocument *doc);
gboolean (*editor_notify)(GeanyEditor *editor, gpointer scnt); gboolean (*editor_notify)(GeanyEditor *editor, gpointer scnt);
void (*geany_startup_complete)(void); void (*geany_startup_complete)(void);
......
...@@ -53,14 +53,14 @@ ...@@ -53,14 +53,14 @@
* @warning You should not test for values below 200 as previously * @warning You should not test for values below 200 as previously
* @c GEANY_API_VERSION was defined as an enum value, not a macro. * @c GEANY_API_VERSION was defined as an enum value, not a macro.
*/ */
#define GEANY_API_VERSION 213 #define GEANY_API_VERSION 214
/** The Application Binary Interface (ABI) version, incremented whenever /** The Application Binary Interface (ABI) version, incremented whenever
* existing fields in the plugin data types have to be changed or reordered. * existing fields in the plugin data types have to be changed or reordered.
* Changing this forces all plugins to be recompiled before Geany can load them. */ * Changing this forces all plugins to be recompiled before Geany can load them. */
/* This should usually stay the same if fields are only appended, assuming only pointers to /* This should usually stay the same if fields are only appended, assuming only pointers to
* structs and not structs themselves are declared by plugins. */ * structs and not structs themselves are declared by plugins. */
#define GEANY_ABI_VERSION 68 #define GEANY_ABI_VERSION 69
/** Defines a function to check the plugin is safe to load. /** Defines a function to check the plugin is safe to load.
......
...@@ -542,7 +542,7 @@ static void show_project_properties(gboolean show_build) ...@@ -542,7 +542,7 @@ static void show_project_properties(gboolean show_build)
g_free(str); g_free(str);
} }
g_signal_emit_by_name(geany_object, "project-dialog-create", e.notebook); g_signal_emit_by_name(geany_object, "project-dialog-open", e.notebook);
gtk_widget_show_all(e.dialog); gtk_widget_show_all(e.dialog);
/* note: notebook page must be shown before setting current page */ /* note: notebook page must be shown before setting current page */
...@@ -567,6 +567,7 @@ static void show_project_properties(gboolean show_build) ...@@ -567,6 +567,7 @@ static void show_project_properties(gboolean show_build)
} }
build_free_fields(e.build_properties); build_free_fields(e.build_properties);
g_signal_emit_by_name(geany_object, "project-dialog-close", e.notebook);
gtk_notebook_remove_page(GTK_NOTEBOOK(e.notebook), e.build_page_num); gtk_notebook_remove_page(GTK_NOTEBOOK(e.notebook), e.build_page_num);
gtk_widget_hide(e.dialog); gtk_widget_hide(e.dialog);
} }
...@@ -593,7 +594,7 @@ gboolean project_ask_close(void) ...@@ -593,7 +594,7 @@ gboolean project_ask_close(void)
{ {
if (dialogs_show_question_full(NULL, GTK_STOCK_CLOSE, GTK_STOCK_CANCEL, if (dialogs_show_question_full(NULL, GTK_STOCK_CLOSE, GTK_STOCK_CANCEL,
_("Do you want to close it before proceeding?"), _("Do you want to close it before proceeding?"),
_("The '%s' project is already open."), app->project->name)) _("The '%s' project is open."), app->project->name))
{ {
project_close(FALSE); project_close(FALSE);
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment