]> Dogcows Code - chaz/homebank/blobdiff - src/dsp_mainwindow.c
Merge branch 'master' into ext-perl
[chaz/homebank] / src / dsp_mainwindow.c
index 2cb2ecd2d5e6c47b7ab8eeb3ecef0ddee12a3d19..c733f4cb730be8c3f443f05f2c3bf5fc3a850152 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "dsp_mainwindow.h"
 
+#include "ext.h"
+
 #include "list_account.h"
 #include "list_upcoming.h"
 #include "list_topspending.h"
@@ -117,6 +119,8 @@ static void ui_mainwindow_action_export(void);
 static void ui_mainwindow_action_anonymize(void);
 static void ui_mainwindow_action_file_statistics(void);
 
+static void ui_mainwindow_action_pluginprefs(void);
+
 static void ui_mainwindow_action_help(void);
 void ui_mainwindow_action_help_welcome(void);
 static void ui_mainwindow_action_help_online(void);
@@ -152,6 +156,8 @@ void ui_mainwindow_scheduled_postall(GtkWidget *widget, gpointer user_data);
 
 void ui_mainwindow_recent_add (struct hbfile_data *data, const gchar *path);
 
+static void ui_mainwindow_showprefs(gint page);
+
 static void ui_panel_accounts_setup(struct hbfile_data *data);
 
 extern gchar *CYA_ACC_TYPE[];
@@ -175,6 +181,7 @@ static GtkActionEntry entries[] = {
   { "TxnMenu"    , NULL, N_("_Transactions"), NULL, NULL, NULL },
   { "ReportMenu" , NULL, N_("_Reports"), NULL, NULL, NULL  },
   { "ToolsMenu"  , NULL, N_("_Tools"), NULL, NULL, NULL },
+  { "PluginMenu" , NULL, N_("_Plugins"), NULL, NULL, NULL },
   { "HelpMenu"   , NULL, N_("_Help"), NULL, NULL, NULL },
 
 //  { "Import"       , NULL, N_("Import") },
@@ -229,6 +236,9 @@ static GtkActionEntry entries[] = {
   { "FileStats"   , NULL              , N_("File statistics...")  , NULL, NULL,    G_CALLBACK (ui_mainwindow_action_file_statistics) },
   { "Anonymize"   , NULL              , N_("Anonymize...")  , NULL, NULL,    G_CALLBACK (ui_mainwindow_action_anonymize) },
        
+  /* Plugins */
+  { "PluginPreferences", "prf-plugins", N_("_Plugins..."), "<control>U", N_("Configure plugin preferences"), G_CALLBACK(ui_mainwindow_action_pluginprefs) },
+
   /* HelpMenu */
   { "Contents"    , ICONNAME_HELP     , N_("_Contents")                    , "F1", N_("Documentation about HomeBank"), G_CALLBACK (ui_mainwindow_action_help) },
   { "Online"      , "lpi-help"        , N_("Get Help Online...")           , NULL, N_("Connect to the LaunchPad website for online help"), G_CALLBACK (ui_mainwindow_action_help_online) },
@@ -321,6 +331,11 @@ static const gchar *ui_info =
 "        <separator/>"
 "      <menuitem action='Anonymize'/>"
 "    </menu>"
+"    <menu action='PluginMenu'>"
+"      <separator/>"
+"      <menuitem action='PluginPreferences'/>"
+"      <separator/>"
+"    </menu>"
 "    <menu action='HelpMenu'>"
 "      <menuitem action='Contents'/>"
 "      <menuitem action='Online'/>"
@@ -355,6 +370,7 @@ static const gchar *ui_info =
 "    <toolitem action='RBalance'/>"
 "    <toolitem action='RBudget'/>"
 "    <toolitem action='RVehiculeCost'/>"
+"      <separator/>"
 "  </toolbar>"
 
 "</ui>";
@@ -434,7 +450,8 @@ gchar *version;
   static const gchar *authors[] = {
     "Lead developer:\n" \
     "Maxime DOYEN",
-    "\nContributor:\n" \
+    "\nContributors:\n" \
+    "Charles MCGARVEY (Plugin system, Perl support)\n" \
     "Ga\xc3\xabtan LORIDANT (Maths formulas for charts)\n",
     NULL
   };
@@ -565,6 +582,12 @@ static void ui_mainwindow_action_file_statistics(void)
 }
 
 
+static void ui_mainwindow_action_pluginprefs(void)
+{
+       ui_mainwindow_showprefs(PREF_PLUGINS);
+}
+
+
 static void ui_mainwindow_action_properties(void)
 {
        create_defhbfile_dialog();
@@ -677,10 +700,15 @@ static void ui_mainwindow_action_defassign(void)
 
 
 static void ui_mainwindow_action_preferences(void)
+{
+       ui_mainwindow_showprefs(PREF_GENERAL);
+}
+
+static void ui_mainwindow_showprefs(gint page)
 {
 struct hbfile_data *data = g_object_get_data(G_OBJECT(GLOBALS->mainwindow), "inst_data");
 
-       defpref_dialog_new();
+       defpref_dialog_new(page);
        if(!PREFS->euro_active)
        {
        GtkToggleAction *action = (GtkToggleAction *)gtk_ui_manager_get_action(data->manager, "/MenuBar/ViewMenu/AsMinor");
@@ -2457,6 +2485,9 @@ struct hbfile_data *data = user_data;
 struct WinGeometry *wg;
 gboolean retval = FALSE;
 
+       GValue widget_value = G_VALUE_INIT;
+       ext_hook("main_window_disposal", EXT_OBJECT(&widget_value, widget), NULL);
+
        DB( g_print("\n[ui-mainwindow] delete-event\n") );
 
        //store position and size
This page took 0.023722 seconds and 4 git commands to generate.