[Gnucash-changes] r13793 - gnucash/trunk - Add new files to make
the string freeze that define the
Derek Atkins
warlord at cvs.gnucash.org
Sun Apr 16 18:25:40 EDT 2006
Author: warlord
Date: 2006-04-16 18:25:39 -0400 (Sun, 16 Apr 2006)
New Revision: 13793
Trac: http://svn.gnucash.org/trac/changeset/13793
Added:
gnucash/trunk/src/business/business-gnome/dialog-choose-owner.c
gnucash/trunk/src/business/business-gnome/dialog-choose-owner.h
gnucash/trunk/src/business/business-gnome/glade/choose-owner.glade
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/business/business-gnome/Makefile.am
gnucash/trunk/src/business/business-gnome/glade/Makefile.am
Log:
Add new files to make the string freeze that define the
interface to choose a customer or vendor for a hand-entered
transaction. Hopefully we can simplify the input by allowing
users to enter a transaction directly and assigning it to a
customer/vendor by hand (rather than going through the business
interfaces).
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-04-16 21:19:06 UTC (rev 13792)
+++ gnucash/trunk/ChangeLog 2006-04-16 22:25:39 UTC (rev 13793)
@@ -1,3 +1,14 @@
+2006-04-16 Derek Atkins <derek at ihtfp.com>
+
+ * src/business/business-gnome/glade/choose-owner.glade:
+ * src/business/business-gnome/dialog-choose-owner.[ch]:
+ Add new files to make the string freeze that define the
+ interface to choose a customer or vendor for a hand-entered
+ transaction. Hopefully we can simplify the input by allowing
+ users to enter a transaction directly and assigning it to a
+ customer/vendor by hand (rather than going through the business
+ interfaces).
+
2006-04-15 Derek Atkins <derek at ihtfp.com>
* src/gnome-utils/druid-gnc-xml-import.c:
Modified: gnucash/trunk/src/business/business-gnome/Makefile.am
===================================================================
--- gnucash/trunk/src/business/business-gnome/Makefile.am 2006-04-16 21:19:06 UTC (rev 13792)
+++ gnucash/trunk/src/business/business-gnome/Makefile.am 2006-04-16 22:25:39 UTC (rev 13793)
@@ -36,6 +36,7 @@
business-urls.c \
business-gnome-utils.c \
dialog-billterms.c \
+ dialog-choose-owner.c \
dialog-customer.c \
dialog-date-close.c \
dialog-employee.c \
@@ -53,6 +54,7 @@
business-urls.h \
business-gnome-utils.h \
dialog-billterms.h \
+ dialog-choose-owner.h \
dialog-customer.h \
dialog-date-close.h \
dialog-employee.h \
Added: gnucash/trunk/src/business/business-gnome/dialog-choose-owner.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-choose-owner.c 2006-04-16 21:19:06 UTC (rev 13792)
+++ gnucash/trunk/src/business/business-gnome/dialog-choose-owner.c 2006-04-16 22:25:39 UTC (rev 13793)
@@ -0,0 +1,104 @@
+/*
+ * dialog-choose-owner.c -- Dialog to choose an owner for a business Split
+ * Copyright (C) 2006 Derek Atkins
+ * Author: Derek Atkins <warlord at MIT.EDU>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation Voice: +1-617-542-5942
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
+ * Boston, MA 02110-1301, USA gnu at gnu.org
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <qof.h>
+
+#include "Transaction.h"
+#include "dialog-utils.h"
+#include "gncOwner.h"
+
+#include "dialog-choose-owner.h"
+#include "business-gnome-utils.h"
+
+struct _choose_owner_dialog {
+ GtkWidget * dialog;
+ GtkWidget * owner_choice;
+ QofBook * book;
+ GncOwner owner;
+ Split * split;
+};
+
+static DialogChooseOwner *
+gcoi_create_dialog(Split* split)
+{
+ DialogChooseOwner* dco;
+ GladeXML *xml;
+ GtkWidget *widget, *box;
+
+ g_return_val_if_fail(split, NULL);
+
+ dco = g_new0(DialogChooseOwner, 1);
+ g_assert(dco);
+ dco->book = qof_instance_get_book(QOF_INSTANCE(split));
+ dco->split = split;
+
+ /* Open the Glade file */
+ xml = gnc_glade_xml_new("choose-owner.glade", "Choose Owner Dialog");
+ g_assert(xml);
+
+ /* Get the dialog handle */
+ dco->dialog = glade_xml_get_widget(xml, "Choose Owner Dialog");
+ g_assert(dco->dialog);
+
+ /* Get the title widget and set the title */
+ widget = glade_xml_get_widget(xml, "title_label");
+ if (1 == 1) {
+ gncOwnerInitCustomer(&(dco->owner), NULL);
+ gtk_label_set_text(GTK_LABEL(widget),
+ _("This transaction needs to be assigned to a Customer."
+ " Please choose the Customer below."));
+ } else {
+ gncOwnerInitVendor(&(dco->owner), NULL);
+ gtk_label_set_text(GTK_LABEL(widget),
+ _("This transaction needs to be assigned to a Vendor."
+ " Please choose the Vendor below."));
+ }
+
+ /* Get the transaction description and set it */
+ widget = glade_xml_get_widget(xml, "desc_label");
+ gtk_label_set_text(GTK_LABEL(widget),
+ xaccTransGetDescription(xaccSplitGetParent(split)));
+
+ /* Get the owner label and the owner box */
+ widget = glade_xml_get_widget(xml, "owner_label");
+ box = glade_xml_get_widget(xml, "owner_box");
+ dco->owner_choice = gnc_owner_select_create(widget, box, dco->book,
+ &(dco->owner));
+
+ gtk_widget_show_all(dco->dialog);
+ return dco;
+}
+
+
+gboolean
+gnc_split_assign_owner(GtkWidget* window, Split* split)
+{
+ if (1 == 0)
+ gcoi_create_dialog(split);
+
+ return FALSE;
+}
Property changes on: gnucash/trunk/src/business/business-gnome/dialog-choose-owner.c
___________________________________________________________________
Name: svn:keywords
+ "Author Date Id Revision"
Name: svn:eol-style
+ native
Added: gnucash/trunk/src/business/business-gnome/dialog-choose-owner.h
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-choose-owner.h 2006-04-16 21:19:06 UTC (rev 13792)
+++ gnucash/trunk/src/business/business-gnome/dialog-choose-owner.h 2006-04-16 22:25:39 UTC (rev 13793)
@@ -0,0 +1,38 @@
+/*
+ * dialog-choose-owner.h -- Dialog to choose an owner for a business Split
+ * Copyright (C) 2006 Derek Atkins
+ * Author: Derek Atkins <warlord at MIT.EDU>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation Voice: +1-617-542-5942
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
+ * Boston, MA 02110-1301, USA gnu at gnu.org
+ */
+
+
+#ifndef GNC_DIALOG_CHOOSE_OWNER_H_
+#define GNC_DIALOG_CHOOSE_OWNER_H_
+
+#include "Split.h"
+
+typedef struct _choose_owner_dialog DialogChooseOwner;
+
+/**
+ * This split was added to an A/R or A/P account. Make sure it
+ * has an owner attached to it so the business reports work.
+ */
+gboolean gnc_split_assign_owner(GtkWidget* window, Split* split);
+
+#endif /* GNC_DIALOG_CHOOSE_OWNER_H_ */
Property changes on: gnucash/trunk/src/business/business-gnome/dialog-choose-owner.h
___________________________________________________________________
Name: svn:keywords
+ "Author Date Id Revision"
Name: svn:eol-style
+ native
Modified: gnucash/trunk/src/business/business-gnome/glade/Makefile.am
===================================================================
--- gnucash/trunk/src/business/business-gnome/glade/Makefile.am 2006-04-16 21:19:06 UTC (rev 13792)
+++ gnucash/trunk/src/business/business-gnome/glade/Makefile.am 2006-04-16 22:25:39 UTC (rev 13793)
@@ -2,6 +2,7 @@
glade_DATA = \
billterms.glade \
businessprefs.glade \
+ choose-owner.glade \
customer.glade \
date-close.glade \
employee.glade \
Added: gnucash/trunk/src/business/business-gnome/glade/choose-owner.glade
===================================================================
--- gnucash/trunk/src/business/business-gnome/glade/choose-owner.glade 2006-04-16 21:19:06 UTC (rev 13792)
+++ gnucash/trunk/src/business/business-gnome/glade/choose-owner.glade 2006-04-16 22:25:39 UTC (rev 13793)
@@ -0,0 +1,233 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkDialog" id="Choose Owner Dialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Choose Owner Dialog</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="cancelbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="okbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="title_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="no">(docs)</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHSeparator" id="hseparator1">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">True</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Description</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="owner_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="no">(owner)</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">True</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="desc_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="no">(desc)</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="owner_box">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
More information about the gnucash-changes
mailing list