r23563 - gnucash/trunk/src/gnome - BUG 336843 (Attach images/files/urls to transactions):

John Ralls jralls at code.gnucash.org
Sun Dec 15 12:14:48 EST 2013


Author: jralls
Date: 2013-12-15 12:14:47 -0500 (Sun, 15 Dec 2013)
New Revision: 23563
Trac: http://svn.gnucash.org/trac/changeset/23563

Modified:
   gnucash/trunk/src/gnome/gnc-plugin-page-register.c
   gnucash/trunk/src/gnome/gnc-split-reg.c
Log:
BUG 336843 (Attach images/files/urls to transactions):

    - Added conditional to grey-out/disable 'Open File/Link' when association is unset
    - Converted 'Open Location' dialog to gtk_dialog_new_with_buttons
    - fixed invalid options from last submitted patch
    - made dialog modal



Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-12-15 05:47:23 UTC (rev 23562)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-12-15 17:14:47 UTC (rev 23563)
@@ -906,6 +906,7 @@
     GtkAction *action;
     gboolean expanded, voided;
     Transaction *trans;
+    const char *uri;
 
     /* Set 'Split Transaction' */
     priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
@@ -931,6 +932,12 @@
                                          "UnvoidTransactionAction");
     gtk_action_set_sensitive (GTK_ACTION(action), voided);
 
+    /* Set 'ExecAssociated' */
+    uri = xaccTransGetAssociation(trans);
+    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(page),
+                                         "ExecAssociatedTransactionAction");
+    gtk_action_set_sensitive (GTK_ACTION(action), uri ? TRUE:FALSE);
+
     /* If we are in a readonly book, make any modifying action inactive */
     if (qof_book_is_readonly(gnc_get_current_book()))
     {
@@ -3456,6 +3463,7 @@
 
     priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
     gsr_default_associate_handler_file(priv->gsr, NULL);
+    gnc_plugin_page_register_ui_update (NULL, plugin_page);
     LEAVE(" ");
 
 }
@@ -3472,6 +3480,7 @@
 
     priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
     gsr_default_associate_handler_location(priv->gsr, NULL);
+    gnc_plugin_page_register_ui_update (NULL, plugin_page);
     LEAVE(" ");
 
 }

Modified: gnucash/trunk/src/gnome/gnc-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg.c	2013-12-15 05:47:23 UTC (rev 23562)
+++ gnucash/trunk/src/gnome/gnc-split-reg.c	2013-12-15 17:14:47 UTC (rev 23563)
@@ -1096,9 +1096,9 @@
     if (is_trans_readonly_and_warn(trans))
         return;
 
-    dialog = gtk_file_chooser_dialog_new ("Associate Location with Transaction",
+    dialog = gtk_dialog_new_with_buttons ("Associate Location with Transaction",
                                      GTK_WINDOW(gsr->window),
-                                     GTK_FILE_CHOOSER_ACTION_OPEN,
+                                     GTK_DIALOG_MODAL,
                                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
                                      NULL);



More information about the gnucash-changes mailing list