mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Some gnome_dialog to gtk_dialog updates. Move signal information into
glade. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gnucash-gnome2-dev@9275 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,14 @@
|
||||
2003-09-09 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome-search/dialog-search.c:
|
||||
* src/gnome-search/gnc-general-search.c:
|
||||
* src/business/business-gnome/dialog-xxx.c:
|
||||
* src/business/business-gnome/glade/xxx.glade:
|
||||
* src/business/dialog-tax-table/dialog-tax-table.c:
|
||||
* src/business/dialog-tax-table/tax-tables.glade: Some
|
||||
gnome_dialog to gtk_dialog updates. Move signal information into
|
||||
glade.
|
||||
|
||||
2003-09-07 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome/gnc-plugin.c: Make the plugin widget destructor
|
||||
|
||||
@@ -85,6 +85,10 @@ Find - MINIMALLY FUNCTIONAL
|
||||
|
||||
View Toolbar/Summarybar/Statusbar - NEEDS WORK
|
||||
|
||||
Business functions - Somewhat Functional
|
||||
- Everything works but the New Invoice/Bill code. The dialog
|
||||
seems to function properly but then gnucash crashes when the
|
||||
dialog is closed.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,14 @@
|
||||
|
||||
#define DIALOG_BILLTERMS_CM_CLASS "billterms-dialog"
|
||||
|
||||
void billterms_row_selected (GtkCList *clist, gint row, gint column,
|
||||
GdkEventButton *event, gpointer user_data);
|
||||
void billterms_new_term_cb (GtkButton *button, BillTermsWindow *btw);
|
||||
void billterms_delete_term_cb (GtkButton *button, BillTermsWindow *btw);
|
||||
void billterms_edit_term_cb (GtkButton *button, BillTermsWindow *btw);
|
||||
void billterms_window_close (GtkWidget *widget, gpointer data);
|
||||
void billterms_window_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
typedef struct _billterm_notebook {
|
||||
GtkTooltips * tooltips;
|
||||
GtkWidget * notebook;
|
||||
@@ -84,7 +92,7 @@ read_widget (GladeXML *xml, char *name, gboolean read_only)
|
||||
/* NOTE: The caller needs to unref once they attach */
|
||||
static void
|
||||
init_notebook_widgets (BillTermNB *notebook, gboolean read_only,
|
||||
GnomeDialog *dialog, gpointer user_data)
|
||||
GtkDialog *dialog, gpointer user_data)
|
||||
{
|
||||
GladeXML *xml;
|
||||
GtkWidget *parent;
|
||||
@@ -240,15 +248,14 @@ verify_term_ok (NewBillTerm *nbt)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
new_billterm_ok_cb (GtkWidget *widget, gpointer data)
|
||||
static gboolean
|
||||
new_billterm_ok_cb (NewBillTerm *nbt)
|
||||
{
|
||||
NewBillTerm *nbt = data;
|
||||
BillTermsWindow *btw;
|
||||
const char *name = NULL;
|
||||
char *message;
|
||||
|
||||
g_return_if_fail (nbt);
|
||||
g_return_val_if_fail (nbt, FALSE);
|
||||
btw = nbt->btw;
|
||||
|
||||
/* Verify that we've got real, valid data */
|
||||
@@ -259,7 +266,7 @@ new_billterm_ok_cb (GtkWidget *widget, gpointer data)
|
||||
if (name == NULL || *name == '\0') {
|
||||
message = _("You must provide a name for this Billing Term.");
|
||||
gnc_error_dialog (nbt->dialog, message);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
if (gncBillTermLookupByName (btw->book, name)) {
|
||||
message = g_strdup_printf(_(
|
||||
@@ -267,13 +274,13 @@ new_billterm_ok_cb (GtkWidget *widget, gpointer data)
|
||||
"Your choice \"%s\" is already in use."), name);
|
||||
gnc_error_dialog (nbt->dialog, "%s", message);
|
||||
g_free (message);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Verify the actual data */
|
||||
if (!verify_term_ok (nbt))
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
gnc_suspend_gui_refresh ();
|
||||
|
||||
@@ -295,26 +302,7 @@ new_billterm_ok_cb (GtkWidget *widget, gpointer data)
|
||||
gncBillTermCommitEdit (btw->current_term);
|
||||
|
||||
gnc_resume_gui_refresh();
|
||||
|
||||
/* Then close/refresh the dialog/window */
|
||||
gnome_dialog_close (GNOME_DIALOG (nbt->dialog));
|
||||
}
|
||||
|
||||
static void
|
||||
new_billterm_cancel_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
NewBillTerm *nbt = data;
|
||||
g_return_if_fail (nbt);
|
||||
gnome_dialog_close (GNOME_DIALOG (nbt->dialog));
|
||||
}
|
||||
|
||||
static void
|
||||
new_billterm_dialog_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
NewBillTerm *nbt = data;
|
||||
|
||||
if (!nbt) return;
|
||||
g_free (nbt);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -385,12 +373,16 @@ make_menu (GtkWidget *omenu, NewBillTerm *nbt)
|
||||
nbt->notebook.type - 1);
|
||||
}
|
||||
|
||||
static NewBillTerm *
|
||||
new_billterm_dialog (BillTermsWindow *btw, GncBillTerm *term)
|
||||
static GncBillTerm *
|
||||
new_billterm_dialog (BillTermsWindow *btw, GncBillTerm *term,
|
||||
const char *name)
|
||||
{
|
||||
GncBillTerm *created_term = NULL;
|
||||
NewBillTerm *nbt;
|
||||
GladeXML *xml;
|
||||
GtkWidget *box, *widget;
|
||||
gint response;
|
||||
gboolean done;
|
||||
|
||||
if (!btw) return NULL;
|
||||
|
||||
@@ -403,10 +395,12 @@ new_billterm_dialog (BillTermsWindow *btw, GncBillTerm *term)
|
||||
nbt->dialog = glade_xml_get_widget (xml, "New Term Dialog");
|
||||
nbt->name_entry = glade_xml_get_widget (xml, "name_entry");
|
||||
nbt->desc_entry = glade_xml_get_widget (xml, "desc_entry");
|
||||
if (name)
|
||||
gtk_entry_set_text (GTK_ENTRY (nbt->name_entry), name);
|
||||
|
||||
/* Initialize the notebook widgets */
|
||||
init_notebook_widgets (&nbt->notebook, FALSE,
|
||||
GNOME_DIALOG (nbt->dialog), nbt);
|
||||
GTK_DIALOG (nbt->dialog), nbt);
|
||||
|
||||
/* Attach the notebook */
|
||||
box = glade_xml_get_widget (xml, "notebook_box");
|
||||
@@ -425,24 +419,13 @@ new_billterm_dialog (BillTermsWindow *btw, GncBillTerm *term)
|
||||
/* Show the right notebook page */
|
||||
show_notebook (&nbt->notebook);
|
||||
|
||||
/* Make 'enter' do the right thing */
|
||||
gnome_dialog_set_default (GNOME_DIALOG (nbt->dialog), 0);
|
||||
|
||||
/* Connect the dialog buttons */
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (nbt->dialog), 0,
|
||||
G_CALLBACK (new_billterm_ok_cb), nbt);
|
||||
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (nbt->dialog), 1,
|
||||
G_CALLBACK (new_billterm_cancel_cb), nbt);
|
||||
|
||||
/* Set our modality */
|
||||
gnome_dialog_set_parent (GNOME_DIALOG (nbt->dialog),
|
||||
GTK_WINDOW (btw->dialog));
|
||||
gtk_window_set_modal (GTK_WINDOW (nbt->dialog), TRUE);
|
||||
|
||||
g_signal_connect (G_OBJECT (nbt->dialog), "destroy",
|
||||
G_CALLBACK (new_billterm_dialog_destroy_cb), nbt);
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
nbt);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW(nbt->dialog),
|
||||
GTK_WINDOW(btw->dialog));
|
||||
|
||||
/* Show what we should */
|
||||
gtk_widget_show_all (nbt->dialog);
|
||||
@@ -453,7 +436,26 @@ new_billterm_dialog (BillTermsWindow *btw, GncBillTerm *term)
|
||||
} else
|
||||
gtk_widget_grab_focus (nbt->name_entry);
|
||||
|
||||
return nbt;
|
||||
done = FALSE;
|
||||
while (!done) {
|
||||
response = gtk_dialog_run (GTK_DIALOG (nbt->dialog));
|
||||
switch (response) {
|
||||
case GTK_RESPONSE_OK:
|
||||
if (new_billterm_ok_cb (nbt)) {
|
||||
created_term = nbt->this_term;
|
||||
done = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
done = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy(nbt->dialog);
|
||||
g_free(nbt);
|
||||
|
||||
return created_term;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
@@ -565,7 +567,7 @@ billterms_window_refresh (BillTermsWindow *btw)
|
||||
/* select_row() above will refresh the term display */
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
billterms_row_selected (GtkCList *clist, gint row, gint column,
|
||||
GdkEventButton *event, gpointer user_data)
|
||||
{
|
||||
@@ -584,17 +586,17 @@ billterms_row_selected (GtkCList *clist, gint row, gint column,
|
||||
|
||||
/* If the user double-clicked on the item, pop up the edit window */
|
||||
if (event && event->type == GDK_2BUTTON_PRESS)
|
||||
new_billterm_dialog (btw, term);
|
||||
new_billterm_dialog (btw, term, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
billterms_new_term_cb (GtkButton *button, BillTermsWindow *btw)
|
||||
{
|
||||
g_return_if_fail (btw);
|
||||
new_billterm_dialog (btw, NULL);
|
||||
new_billterm_dialog (btw, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
billterms_delete_term_cb (GtkButton *button, BillTermsWindow *btw)
|
||||
{
|
||||
g_return_if_fail (btw);
|
||||
@@ -621,13 +623,13 @@ billterms_delete_term_cb (GtkButton *button, BillTermsWindow *btw)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
billterms_edit_term_cb (GtkButton *button, BillTermsWindow *btw)
|
||||
{
|
||||
g_return_if_fail (btw);
|
||||
if (!btw->current_term)
|
||||
return;
|
||||
new_billterm_dialog (btw, btw->current_term);
|
||||
new_billterm_dialog (btw, btw->current_term, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -644,10 +646,11 @@ billterms_window_close_handler (gpointer data)
|
||||
{
|
||||
BillTermsWindow *btw = data;
|
||||
g_return_if_fail (btw);
|
||||
gnome_dialog_close (GNOME_DIALOG (btw->dialog));
|
||||
|
||||
gtk_widget_destroy (btw->dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
billterms_window_close (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
BillTermsWindow *btw = data;
|
||||
@@ -655,7 +658,7 @@ billterms_window_close (GtkWidget *widget, gpointer data)
|
||||
gnc_ui_billterms_window_destroy (btw);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
billterms_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
BillTermsWindow *btw = data;
|
||||
@@ -682,7 +685,7 @@ gnc_ui_billterms_window_new (GNCBook *book)
|
||||
{
|
||||
BillTermsWindow *btw;
|
||||
GladeXML *xml;
|
||||
GtkWidget *button, *widget;
|
||||
GtkWidget *widget;
|
||||
|
||||
if (!book) return NULL;
|
||||
|
||||
@@ -712,7 +715,7 @@ gnc_ui_billterms_window_new (GNCBook *book)
|
||||
|
||||
/* Initialize the notebook widgets */
|
||||
init_notebook_widgets (&btw->notebook, TRUE,
|
||||
GNOME_DIALOG (btw->dialog), btw);
|
||||
GTK_DIALOG (btw->dialog), btw);
|
||||
|
||||
/* Attach the notebook */
|
||||
widget = glade_xml_get_widget (xml, "notebook_box");
|
||||
@@ -720,27 +723,10 @@ gnc_ui_billterms_window_new (GNCBook *book)
|
||||
TRUE, TRUE, 0);
|
||||
g_object_unref (btw->notebook.notebook);
|
||||
|
||||
/* Connect all the buttons */
|
||||
button = glade_xml_get_widget (xml, "new_term_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (billterms_new_term_cb), btw);
|
||||
button = glade_xml_get_widget (xml, "delete_term_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (billterms_delete_term_cb), btw);
|
||||
button = glade_xml_get_widget (xml, "edit_term_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (billterms_edit_term_cb), btw);
|
||||
|
||||
/* Set the row-select callbacks */
|
||||
g_signal_connect (G_OBJECT (btw->terms_clist), "select-row",
|
||||
G_CALLBACK (billterms_row_selected), btw);
|
||||
|
||||
/* Connect the dialog buttons */
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (btw->dialog), 0,
|
||||
G_CALLBACK (billterms_window_close), btw);
|
||||
|
||||
g_signal_connect (G_OBJECT (btw->dialog), "destroy",
|
||||
G_CALLBACK (billterms_window_destroy_cb), btw);
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
btw);
|
||||
|
||||
/* register with component manager */
|
||||
btw->component_id =
|
||||
@@ -766,50 +752,17 @@ gnc_ui_billterms_window_destroy (BillTermsWindow *btw)
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
from_name_close_cb (GnomeDialog *dialog, gpointer data)
|
||||
{
|
||||
NewBillTerm *nbt;
|
||||
GncBillTerm **created_term = data;
|
||||
|
||||
nbt = gtk_object_get_data (GTK_OBJECT (dialog), "dialog_info");
|
||||
|
||||
*created_term = nbt->created_term;
|
||||
|
||||
gtk_main_quit ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Create a new billterms by name */
|
||||
GncBillTerm *
|
||||
gnc_ui_billterms_new_from_name (GNCBook *book, const char *name)
|
||||
{
|
||||
GncBillTerm *created_term = NULL;
|
||||
BillTermsWindow *btw;
|
||||
NewBillTerm *nbt;
|
||||
|
||||
if (!book) return NULL;
|
||||
|
||||
btw = gnc_ui_billterms_window_new (book);
|
||||
if (!btw) return NULL;
|
||||
|
||||
nbt = new_billterm_dialog (btw, NULL);
|
||||
if (!nbt) return NULL;
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (nbt->dialog), "dialog_info", nbt);
|
||||
gtk_signal_connect (GTK_OBJECT (nbt->dialog), "close",
|
||||
GTK_SIGNAL_FUNC (from_name_close_cb), &created_term);
|
||||
|
||||
/* Preset the name in the new dialog */
|
||||
if (name)
|
||||
gtk_entry_set_text (GTK_ENTRY (nbt->name_entry), name);
|
||||
|
||||
/* I know that NBT is already modal, no need to reset it here */
|
||||
|
||||
/* Now run the dialog -- wait for it to close */
|
||||
gtk_main ();
|
||||
|
||||
return created_term;
|
||||
return new_billterm_dialog (btw, NULL, name);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
@@ -36,6 +36,9 @@
|
||||
#define DIALOG_NEW_CUSTOMER_CM_CLASS "dialog-new-customer"
|
||||
#define DIALOG_EDIT_CUSTOMER_CM_CLASS "dialog-edit-customer"
|
||||
|
||||
void gnc_customer_taxtable_check_cb (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void gnc_customer_window_ok_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_customer_window_cancel_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_customer_window_help_cb (GtkWidget *widget, gpointer data);
|
||||
@@ -100,7 +103,7 @@ struct _customer_window {
|
||||
GncTaxTable * taxtable;
|
||||
};
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_customer_taxtable_check_cb (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -123,6 +126,9 @@ cw_get_customer (CustomerWindow *cw)
|
||||
|
||||
static void gnc_ui_to_customer (CustomerWindow *cw, GncCustomer *cust)
|
||||
{
|
||||
GtkTextBuffer* text_buffer;
|
||||
GtkTextIter start, end;
|
||||
gchar *text;
|
||||
GncAddress *addr, *shipaddr;
|
||||
|
||||
addr = gncCustomerGetAddr (cust);
|
||||
@@ -174,8 +180,11 @@ static void gnc_ui_to_customer (CustomerWindow *cw, GncCustomer *cust)
|
||||
gncCustomerSetActive (cust, gtk_toggle_button_get_active
|
||||
(GTK_TOGGLE_BUTTON (cw->active_check)));
|
||||
gncCustomerSetTaxIncluded (cust, cw->taxincluded);
|
||||
gncCustomerSetNotes (cust, gtk_editable_get_chars
|
||||
(GTK_EDITABLE (cw->notes_text), 0, -1));
|
||||
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(cw->notes_text));
|
||||
gtk_text_buffer_get_bounds (text_buffer, &start, &end);
|
||||
text = gtk_text_buffer_get_text (text_buffer, &start, &end, FALSE);
|
||||
gncCustomerSetNotes (cust, text);
|
||||
|
||||
/* Parse and set the currency, terms, discount, and credit amounts */
|
||||
gncCustomerSetCurrency (cust,
|
||||
@@ -355,7 +364,8 @@ gnc_customer_window_close_handler (gpointer user_data)
|
||||
{
|
||||
CustomerWindow *cw = user_data;
|
||||
|
||||
gnome_dialog_close (GNOME_DIALOG (cw->dialog));
|
||||
gtk_widget_destroy (cw->dialog);
|
||||
cw->dialog = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -396,7 +406,6 @@ gnc_customer_new_window (GNCBook *bookp, GncCustomer *cust)
|
||||
CustomerWindow *cw;
|
||||
GladeXML *xml;
|
||||
GtkWidget *hbox, *edit;
|
||||
GnomeDialog *cwd;
|
||||
gnc_commodity *currency;
|
||||
GNCPrintAmountInfo print_info;
|
||||
|
||||
@@ -432,13 +441,9 @@ gnc_customer_new_window (GNCBook *bookp, GncCustomer *cust)
|
||||
/* Find the dialog */
|
||||
xml = gnc_glade_xml_new ("customer.glade", "Customer Dialog");
|
||||
cw->dialog = glade_xml_get_widget (xml, "Customer Dialog");
|
||||
cwd = GNOME_DIALOG (cw->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (cw->dialog), "dialog_info", cw);
|
||||
|
||||
/* default to ok */
|
||||
gnome_dialog_set_default (cwd, 0);
|
||||
|
||||
/* Get entry points */
|
||||
cw->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
cw->company_entry = glade_xml_get_widget (xml, "company_entry");
|
||||
@@ -511,9 +516,9 @@ gnc_customer_new_window (GNCBook *bookp, GncCustomer *cust)
|
||||
|
||||
/* Setup initial values */
|
||||
if (cust != NULL) {
|
||||
GtkTextBuffer* text_buffer;
|
||||
GncAddress *addr, *shipaddr;
|
||||
const char *string;
|
||||
gint pos = 0;
|
||||
|
||||
cw->dialog_type = EDIT_CUSTOMER;
|
||||
cw->customer_guid = *gncCustomerGetGUID (cust);
|
||||
@@ -549,9 +554,8 @@ gnc_customer_new_window (GNCBook *bookp, GncCustomer *cust)
|
||||
gncCustomerGetActive (cust));
|
||||
|
||||
string = gncCustomerGetNotes (cust);
|
||||
gtk_editable_delete_text (GTK_EDITABLE (cw->notes_text), 0, -1);
|
||||
gtk_editable_insert_text (GTK_EDITABLE (cw->notes_text), string,
|
||||
strlen(string), &pos);
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(cw->notes_text));
|
||||
gtk_text_buffer_set_text (text_buffer, string, -1);
|
||||
|
||||
cw->component_id =
|
||||
gnc_register_gui_component (DIALOG_EDIT_CUSTOMER_CM_CLASS,
|
||||
|
||||
@@ -34,7 +34,10 @@ typedef struct _dialog_date_close_window {
|
||||
gboolean retval;
|
||||
} DialogDateClose;
|
||||
|
||||
static void
|
||||
void gnc_dialog_date_close_ok_cb (GtkWidget *widget, gpointer user_data);
|
||||
|
||||
|
||||
void
|
||||
gnc_dialog_date_close_ok_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
DialogDateClose *ddc = user_data;
|
||||
@@ -68,22 +71,6 @@ gnc_dialog_date_close_ok_cb (GtkWidget *widget, gpointer user_data)
|
||||
0, -1);
|
||||
|
||||
ddc->retval = TRUE;
|
||||
gnome_dialog_close (GNOME_DIALOG (ddc->dialog));
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_dialog_date_close_cancel_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
DialogDateClose *ddc = user_data;
|
||||
ddc->retval = FALSE;
|
||||
gnome_dialog_close (GNOME_DIALOG (ddc->dialog));
|
||||
}
|
||||
|
||||
static gint
|
||||
gnc_dialog_date_close_cb (GnomeDialog *dialog, gpointer data)
|
||||
{
|
||||
gtk_main_quit ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -168,27 +155,28 @@ gnc_dialog_date_close_parented (GtkWidget *parent, const char *message,
|
||||
gtk_box_pack_start (GTK_BOX(date_box), ddc->date, TRUE, TRUE, 0);
|
||||
|
||||
if (parent)
|
||||
gnome_dialog_set_parent (GNOME_DIALOG(ddc->dialog), GTK_WINDOW(parent));
|
||||
gtk_window_set_transient_for (GTK_WINDOW(ddc->dialog), GTK_WINDOW(parent));
|
||||
|
||||
build_date_close_window (hbox, message);
|
||||
|
||||
gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->date), *ts);
|
||||
gtk_label_set_text (GTK_LABEL (label), label_message);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(GNOME_DIALOG(ddc->dialog), 0,
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_ok_cb), ddc);
|
||||
gnome_dialog_button_connect
|
||||
(GNOME_DIALOG(ddc->dialog), 1,
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_cancel_cb), ddc);
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
ddc);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(ddc->dialog), "close",
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_cb), ddc);
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (ddc->dialog), TRUE);
|
||||
gtk_widget_show_all (ddc->dialog);
|
||||
gtk_main ();
|
||||
|
||||
ddc->retval = FALSE;
|
||||
while (gtk_dialog_run (GTK_DIALOG (ddc->dialog)) == GTK_RESPONSE_OK) {
|
||||
/* If reponse is OK but flag is not set, try again */
|
||||
if (ddc->retval)
|
||||
break;
|
||||
}
|
||||
|
||||
gtk_widget_destroy(ddc->dialog);
|
||||
retval = ddc->retval;
|
||||
g_list_free (ddc->acct_types);
|
||||
g_free (ddc);
|
||||
@@ -258,7 +246,7 @@ gnc_dialog_dates_acct_parented (GtkWidget *parent, const char *message,
|
||||
gtk_box_pack_start (GTK_BOX(date_box), ddc->post_date, TRUE, TRUE, 0);
|
||||
|
||||
if (parent)
|
||||
gnome_dialog_set_parent (GNOME_DIALOG(ddc->dialog), GTK_WINDOW(parent));
|
||||
gtk_window_set_transient_for (GTK_WINDOW(ddc->dialog), GTK_WINDOW(parent));
|
||||
|
||||
build_date_close_window (hbox, message);
|
||||
|
||||
@@ -285,21 +273,21 @@ gnc_dialog_dates_acct_parented (GtkWidget *parent, const char *message,
|
||||
/* Setup the account widget */
|
||||
fill_in_acct_info (ddc);
|
||||
|
||||
/* Connect the buttons */
|
||||
gnome_dialog_button_connect
|
||||
(GNOME_DIALOG(ddc->dialog), 0,
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_ok_cb), ddc);
|
||||
gnome_dialog_button_connect
|
||||
(GNOME_DIALOG(ddc->dialog), 1,
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_cancel_cb), ddc);
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
ddc);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(ddc->dialog), "close",
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_cb), ddc);
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (ddc->dialog), TRUE);
|
||||
gtk_widget_show_all (ddc->dialog);
|
||||
gtk_main ();
|
||||
|
||||
ddc->retval = FALSE;
|
||||
while (gtk_dialog_run (GTK_DIALOG (ddc->dialog)) == GTK_RESPONSE_OK) {
|
||||
/* If reponse is OK but flag is not set, try again */
|
||||
if (ddc->retval)
|
||||
break;
|
||||
}
|
||||
|
||||
gtk_widget_destroy(ddc->dialog);
|
||||
retval = ddc->retval;
|
||||
*acct = ddc->acct;
|
||||
g_free (ddc);
|
||||
@@ -346,7 +334,7 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
|
||||
gtk_box_pack_start (GTK_BOX(date_box), ddc->date, TRUE, TRUE, 0);
|
||||
|
||||
if (parent)
|
||||
gnome_dialog_set_parent (GNOME_DIALOG(ddc->dialog), GTK_WINDOW(parent));
|
||||
gtk_window_set_transient_for (GTK_WINDOW(ddc->dialog), GTK_WINDOW(parent));
|
||||
|
||||
build_date_close_window (hbox, message);
|
||||
|
||||
@@ -362,18 +350,11 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
|
||||
/* Setup the account widget */
|
||||
fill_in_acct_info (ddc);
|
||||
|
||||
/* Connect the buttons */
|
||||
gnome_dialog_button_connect
|
||||
(GNOME_DIALOG(ddc->dialog), 0,
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_ok_cb), ddc);
|
||||
gnome_dialog_button_connect
|
||||
(GNOME_DIALOG(ddc->dialog), 1,
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_cancel_cb), ddc);
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
ddc);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(ddc->dialog), "close",
|
||||
GTK_SIGNAL_FUNC(gnc_dialog_date_close_cb), ddc);
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (ddc->dialog), TRUE);
|
||||
gtk_widget_show_all (ddc->dialog);
|
||||
|
||||
gtk_widget_hide_all (glade_xml_get_widget (xml, "postdate_label"));
|
||||
@@ -381,8 +362,14 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
|
||||
gtk_widget_hide_all (glade_xml_get_widget (xml, "memo_entry"));
|
||||
gtk_widget_hide_all (glade_xml_get_widget (xml, "memo_label"));
|
||||
|
||||
gtk_main ();
|
||||
ddc->retval = FALSE;
|
||||
while (gtk_dialog_run (GTK_DIALOG (ddc->dialog)) == GTK_RESPONSE_OK) {
|
||||
/* If reponse is OK but flag is not set, try again */
|
||||
if (ddc->retval)
|
||||
break;
|
||||
}
|
||||
|
||||
gtk_widget_destroy(ddc->dialog);
|
||||
retval = ddc->retval;
|
||||
*acct = ddc->acct;
|
||||
g_free (ddc);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
@@ -317,7 +317,7 @@ gnc_employee_window_close_handler (gpointer user_data)
|
||||
{
|
||||
EmployeeWindow *ew = user_data;
|
||||
|
||||
gnome_dialog_close (GNOME_DIALOG (ew->dialog));
|
||||
gtk_widget_destroy (ew->dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -359,7 +359,6 @@ gnc_employee_new_window (GNCBook *bookp,
|
||||
EmployeeWindow *ew;
|
||||
GladeXML *xml;
|
||||
GtkWidget *hbox, *edit;
|
||||
GnomeDialog *ewd;
|
||||
gnc_commodity *currency;
|
||||
GNCPrintAmountInfo print_info;
|
||||
GList *acct_types;
|
||||
@@ -397,13 +396,9 @@ gnc_employee_new_window (GNCBook *bookp,
|
||||
/* Find the dialog */
|
||||
xml = gnc_glade_xml_new ("employee.glade", "Employee Dialog");
|
||||
ew->dialog = glade_xml_get_widget (xml, "Employee Dialog");
|
||||
ewd = GNOME_DIALOG (ew->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (ew->dialog), "dialog_info", ew);
|
||||
|
||||
/* default to ok */
|
||||
gnome_dialog_set_default (ewd, 0);
|
||||
|
||||
/* Get entry points */
|
||||
ew->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
ew->username_entry = glade_xml_get_widget (xml, "username_entry");
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
void gnc_invoice_window_ok_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_cancel_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_help_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_window_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_invoice_id_changed_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -220,43 +222,22 @@ static InvoiceWindow * gnc_ui_invoice_modify (GncInvoice *invoice);
|
||||
/*******************************************************************************/
|
||||
/* FUNCTIONS FOR UNPOSTING */
|
||||
|
||||
static void
|
||||
on_yes_tt_reset_toggled (GtkToggleButton *button, InvoiceWindow *iw)
|
||||
{
|
||||
if (!iw) return;
|
||||
if (gtk_toggle_button_get_active(button))
|
||||
iw->reset_tax_tables = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_no_tt_reset_toggled (GtkToggleButton *button, InvoiceWindow *iw)
|
||||
{
|
||||
if (!iw) return;
|
||||
if (gtk_toggle_button_get_active(button))
|
||||
iw->reset_tax_tables = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
iw_ask_unpost (InvoiceWindow *iw)
|
||||
{
|
||||
GtkWidget *dialog, *toggle, *pixmap;
|
||||
GladeXML *xml;
|
||||
gint response;
|
||||
char *s;
|
||||
|
||||
xml = gnc_glade_xml_new ("invoice.glade", "Unpost Message Dialog");
|
||||
dialog = glade_xml_get_widget (xml, "Unpost Message Dialog");
|
||||
toggle = glade_xml_get_widget (xml, "no_tt_reset");
|
||||
toggle = glade_xml_get_widget (xml, "yes_tt_reset");
|
||||
pixmap = glade_xml_get_widget (xml, "q_pixmap");
|
||||
|
||||
gnome_dialog_set_parent(GNOME_DIALOG(dialog), GTK_WINDOW(iw->dialog));
|
||||
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(iw->dialog));
|
||||
|
||||
glade_xml_signal_connect_data (xml, "on_yes_tt_reset_toggled",
|
||||
GTK_SIGNAL_FUNC (on_yes_tt_reset_toggled), iw);
|
||||
glade_xml_signal_connect_data (xml, "on_no_tt_reset_toggled",
|
||||
GTK_SIGNAL_FUNC (on_no_tt_reset_toggled), iw);
|
||||
|
||||
iw->reset_tax_tables = FALSE;
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), TRUE);
|
||||
|
||||
s = gnome_unconditional_pixmap_file("gnome-question.png");
|
||||
if (s) {
|
||||
@@ -266,7 +247,13 @@ iw_ask_unpost (InvoiceWindow *iw)
|
||||
|
||||
gtk_widget_show_all(dialog);
|
||||
|
||||
return (gnome_dialog_run_and_close(GNOME_DIALOG(dialog)) == 0);
|
||||
response = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
if (response == GTK_RESPONSE_OK)
|
||||
iw->reset_tax_tables =
|
||||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle));
|
||||
|
||||
gtk_widget_destroy(dialog);
|
||||
return (response == GTK_RESPONSE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
@@ -283,6 +270,9 @@ iw_get_invoice (InvoiceWindow *iw)
|
||||
|
||||
static void gnc_ui_to_invoice (InvoiceWindow *iw, GncInvoice *invoice)
|
||||
{
|
||||
GtkTextBuffer* text_buffer;
|
||||
GtkTextIter start, end;
|
||||
gchar *text;
|
||||
Timespec ts;
|
||||
|
||||
if (iw->dialog_type == VIEW_INVOICE)
|
||||
@@ -296,8 +286,10 @@ static void gnc_ui_to_invoice (InvoiceWindow *iw, GncInvoice *invoice)
|
||||
gncInvoiceSetActive (invoice, gtk_toggle_button_get_active
|
||||
(GTK_TOGGLE_BUTTON (iw->active_check)));
|
||||
|
||||
gncInvoiceSetNotes (invoice, gtk_editable_get_chars
|
||||
(GTK_EDITABLE (iw->notes_text), 0, -1));
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(iw->notes_text));
|
||||
gtk_text_buffer_get_bounds (text_buffer, &start, &end);
|
||||
text = gtk_text_buffer_get_text (text_buffer, &start, &end, FALSE);
|
||||
gncInvoiceSetNotes (invoice, text);
|
||||
|
||||
if (iw->to_charge_edit)
|
||||
gncInvoiceSetToChargeAmount (invoice,
|
||||
@@ -424,7 +416,7 @@ gnc_invoice_window_help_cb (GtkWidget *widget, gpointer data)
|
||||
helpWindow(NULL, NULL, HH_INVOICE);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_invoice_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
@@ -1368,8 +1360,11 @@ gnc_invoice_dialog_close_handler (gpointer user_data)
|
||||
{
|
||||
InvoiceWindow *iw = user_data;
|
||||
|
||||
if (iw)
|
||||
gnome_dialog_close (GNOME_DIALOG (iw->dialog));
|
||||
if (iw) {
|
||||
gtk_widget_hide (iw->dialog);
|
||||
gtk_widget_destroy (iw->dialog);
|
||||
iw->dialog = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1629,10 +1624,10 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
|
||||
/* We know that "invoice" (and "owner") exist now */
|
||||
do {
|
||||
GtkTextBuffer* text_buffer;
|
||||
const char *string;
|
||||
Timespec ts, ts_zero = {0,0};
|
||||
Account *acct;
|
||||
gint pos = 0;
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (iw->id_entry), gncInvoiceGetID (invoice));
|
||||
|
||||
@@ -1640,9 +1635,8 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
gncInvoiceGetBillingID (invoice));
|
||||
|
||||
string = gncInvoiceGetNotes (invoice);
|
||||
gtk_editable_delete_text (GTK_EDITABLE (iw->notes_text), 0, -1);
|
||||
gtk_editable_insert_text (GTK_EDITABLE (iw->notes_text), string,
|
||||
strlen (string), &pos);
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(iw->notes_text));
|
||||
gtk_text_buffer_set_text (text_buffer, string, -1);
|
||||
|
||||
if (iw->active_check)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (iw->active_check),
|
||||
@@ -1768,7 +1762,7 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_invoice_id_changed_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
InvoiceWindow *iw = data;
|
||||
@@ -1898,8 +1892,6 @@ gnc_invoice_new_window (GNCBook *bookp, InvoiceDialogType type,
|
||||
iw->xml = xml = gnc_glade_xml_new ("invoice.glade", "Invoice Entry Window");
|
||||
iw->dialog = glade_xml_get_widget (xml, "Invoice Entry Window");
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (iw->dialog), "dialog_info", iw);
|
||||
|
||||
/* Autoconnect all the signals */
|
||||
glade_xml_signal_autoconnect_full (xml, gnc_glade_autoconnect_full_func, iw);
|
||||
|
||||
@@ -2112,7 +2104,6 @@ gnc_invoice_window_new_invoice (GNCBook *bookp, GncOwner *owner,
|
||||
{
|
||||
InvoiceWindow *iw;
|
||||
GladeXML *xml;
|
||||
GnomeDialog *iwd;
|
||||
GtkWidget *hbox;
|
||||
GncOwner *billto;
|
||||
|
||||
@@ -2160,7 +2151,6 @@ gnc_invoice_window_new_invoice (GNCBook *bookp, GncOwner *owner,
|
||||
/* Find the dialog */
|
||||
iw->xml = xml = gnc_glade_xml_new ("invoice.glade", "New Invoice Dialog");
|
||||
iw->dialog = glade_xml_get_widget (xml, "New Invoice Dialog");
|
||||
iwd = GNOME_DIALOG (iw->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (iw->dialog), "dialog_info", iw);
|
||||
|
||||
@@ -2185,7 +2175,7 @@ gnc_invoice_window_new_invoice (GNCBook *bookp, GncOwner *owner,
|
||||
|
||||
/* If this is a New Invoice, reset the Notes file to read/write */
|
||||
if (iw->dialog_type == NEW_INVOICE)
|
||||
gtk_editable_set_editable (GTK_EDITABLE (iw->notes_text), TRUE);
|
||||
gtk_text_view_set_editable (GTK_TEXT_VIEW (iw->notes_text), TRUE);
|
||||
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-component-manager.h"
|
||||
@@ -33,6 +33,7 @@ void gnc_job_window_ok_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_job_window_cancel_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_job_window_help_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_job_window_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_job_name_changed_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -192,7 +193,7 @@ gnc_job_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
g_free (jw);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_job_name_changed_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
JobWindow *jw = data;
|
||||
@@ -226,7 +227,8 @@ gnc_job_window_close_handler (gpointer user_data)
|
||||
{
|
||||
JobWindow *jw = user_data;
|
||||
|
||||
gnome_dialog_close (GNOME_DIALOG (jw->dialog));
|
||||
gtk_widget_destroy (jw->dialog);
|
||||
jw->dialog = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -267,7 +269,6 @@ gnc_job_new_window (GNCBook *bookp, GncOwner *owner, GncJob *job)
|
||||
JobWindow *jw;
|
||||
GladeXML *xml;
|
||||
GtkWidget *owner_box, *owner_label;
|
||||
GnomeDialog *jwd;
|
||||
GtkObject *jwo;
|
||||
|
||||
/*
|
||||
@@ -299,13 +300,9 @@ gnc_job_new_window (GNCBook *bookp, GncOwner *owner, GncJob *job)
|
||||
/* Find the dialog */
|
||||
jw->dialog = glade_xml_get_widget (xml, "Job Dialog");
|
||||
jwo = GTK_OBJECT (jw->dialog);
|
||||
jwd = GNOME_DIALOG (jwo);
|
||||
|
||||
gtk_object_set_data (jwo, "dialog_info", jw);
|
||||
|
||||
/* default to ok XXX */
|
||||
gnome_dialog_set_default (jwd, 0);
|
||||
|
||||
/* Get entry points */
|
||||
jw->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
jw->name_entry = glade_xml_get_widget (xml, "name_entry");
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
@@ -37,6 +37,9 @@
|
||||
void gnc_order_window_ok_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_order_window_cancel_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_order_window_help_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_order_window_invoice_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_order_window_close_order_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_order_window_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -93,6 +96,9 @@ ow_get_order (OrderWindow *ow)
|
||||
|
||||
static void gnc_ui_to_order (OrderWindow *ow, GncOrder *order)
|
||||
{
|
||||
GtkTextBuffer* text_buffer;
|
||||
GtkTextIter start, end;
|
||||
gchar *text;
|
||||
Timespec ts;
|
||||
time_t tt;
|
||||
|
||||
@@ -105,8 +111,12 @@ static void gnc_ui_to_order (OrderWindow *ow, GncOrder *order)
|
||||
|
||||
gncOrderSetID (order, gtk_editable_get_chars
|
||||
(GTK_EDITABLE (ow->id_entry), 0, -1));
|
||||
gncOrderSetNotes (order, gtk_editable_get_chars
|
||||
(GTK_EDITABLE (ow->notes_text), 0, -1));
|
||||
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(ow->notes_text));
|
||||
gtk_text_buffer_get_bounds (text_buffer, &start, &end);
|
||||
text = gtk_text_buffer_get_text (text_buffer, &start, &end, FALSE);
|
||||
gncOrderSetNotes (order, text);
|
||||
|
||||
gncOrderSetReference (order, gtk_editable_get_chars
|
||||
(GTK_EDITABLE (ow->ref_entry), 0, -1));
|
||||
|
||||
@@ -199,7 +209,7 @@ gnc_order_window_help_cb (GtkWidget *widget, gpointer data)
|
||||
helpWindow(NULL, NULL, HH_ORDER);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_order_window_invoice_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
OrderWindow *ow = data;
|
||||
@@ -215,7 +225,7 @@ gnc_order_window_invoice_cb (GtkWidget *widget, gpointer data)
|
||||
gnc_order_update_window (ow);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_order_window_close_order_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
OrderWindow *ow = data;
|
||||
@@ -285,7 +295,7 @@ gnc_order_window_close_order_cb (GtkWidget *widget, gpointer data)
|
||||
gnc_order_update_window (ow);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_order_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
OrderWindow *ow = data;
|
||||
@@ -349,7 +359,7 @@ gnc_order_window_close_handler (gpointer user_data)
|
||||
{
|
||||
OrderWindow *ow = user_data;
|
||||
|
||||
gnome_dialog_close (GNOME_DIALOG (ow->dialog));
|
||||
gtk_widget_destroy (ow->dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -444,18 +454,17 @@ gnc_order_update_window (OrderWindow *ow)
|
||||
gtk_widget_show_all (ow->dialog);
|
||||
|
||||
{
|
||||
GtkTextBuffer* text_buffer;
|
||||
const char *string;
|
||||
Timespec ts, ts_zero = {0,0};
|
||||
time_t tt;
|
||||
gint pos = 0;
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (ow->ref_entry),
|
||||
gncOrderGetReference (order));
|
||||
|
||||
string = gncOrderGetNotes (order);
|
||||
gtk_editable_delete_text (GTK_EDITABLE (ow->notes_text), 0, -1);
|
||||
gtk_editable_insert_text (GTK_EDITABLE (ow->notes_text), string,
|
||||
strlen (string), &pos);
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(ow->notes_text));
|
||||
gtk_text_buffer_set_text (text_buffer, string, -1);
|
||||
|
||||
ts = gncOrderGetDateOpened (order);
|
||||
if (timespec_equal (&ts, &ts_zero)) {
|
||||
@@ -535,7 +544,6 @@ gnc_order_new_window (GNCBook *bookp, OrderDialogType type,
|
||||
GladeXML *xml;
|
||||
GtkWidget *vbox, *regWidget;
|
||||
GncEntryLedger *entry_ledger = NULL;
|
||||
GnomeDialog *owd;
|
||||
const char * class_name;
|
||||
|
||||
switch (type) {
|
||||
@@ -579,9 +587,6 @@ gnc_order_new_window (GNCBook *bookp, OrderDialogType type,
|
||||
/* Find the dialog */
|
||||
ow->xml = xml = gnc_glade_xml_new ("order.glade", "Order Entry Dialog");
|
||||
ow->dialog = glade_xml_get_widget (xml, "Order Entry Dialog");
|
||||
owd = GNOME_DIALOG (ow->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (ow->dialog), "dialog_info", ow);
|
||||
|
||||
/* Grab the widgets */
|
||||
ow->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
@@ -593,9 +598,6 @@ gnc_order_new_window (GNCBook *bookp, OrderDialogType type,
|
||||
ow->owner_box = glade_xml_get_widget (xml, "owner_hbox");
|
||||
ow->owner_label = glade_xml_get_widget (xml, "owner_label");
|
||||
|
||||
/* default to ok */
|
||||
gnome_dialog_set_default (owd, 0);
|
||||
|
||||
/* Build the ledger */
|
||||
switch (type) {
|
||||
case EDIT_ORDER:
|
||||
@@ -629,20 +631,10 @@ gnc_order_new_window (GNCBook *bookp, OrderDialogType type,
|
||||
// gtk_box_pack_start (GTK_BOX(vbox), toolbar, FALSE, FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), regWidget, TRUE, TRUE, 2);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (ow->dialog), "destroy",
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_destroy_cb), ow);
|
||||
|
||||
gnome_dialog_button_connect (owd, 0,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_ok_cb), ow);
|
||||
gnome_dialog_button_connect (owd, 1,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_help_cb), ow);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(owd, 2, GTK_SIGNAL_FUNC(gnc_order_window_invoice_cb), ow);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(owd, 3, GTK_SIGNAL_FUNC(gnc_order_window_close_order_cb), ow);
|
||||
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
ow);
|
||||
/* Setup initial values */
|
||||
ow->order_guid = *gncOrderGetGUID (order);
|
||||
|
||||
@@ -670,7 +662,6 @@ gnc_order_window_new_order (GNCBook *bookp, GncOwner *owner)
|
||||
{
|
||||
OrderWindow *ow;
|
||||
GladeXML *xml;
|
||||
GnomeDialog *owd;
|
||||
GncOrder *order;
|
||||
|
||||
ow = g_new0 (OrderWindow, 1);
|
||||
@@ -686,7 +677,6 @@ gnc_order_window_new_order (GNCBook *bookp, GncOwner *owner)
|
||||
/* Find the dialog */
|
||||
xml = gnc_glade_xml_new ("order.glade", "New Order Dialog");
|
||||
ow->dialog = glade_xml_get_widget (xml, "New Order Dialog");
|
||||
owd = GNOME_DIALOG (ow->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (ow->dialog), "dialog_info", ow);
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ struct _payment_window {
|
||||
};
|
||||
|
||||
|
||||
void gnc_payment_ok_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_payment_cancel_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_payment_window_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
|
||||
static void
|
||||
gnc_payment_window_refresh_handler (GHashTable *changes, gpointer data)
|
||||
{
|
||||
@@ -62,7 +67,7 @@ gnc_payment_window_close_handler (gpointer data)
|
||||
PaymentWindow *pw = data;
|
||||
|
||||
if (pw)
|
||||
gnome_dialog_close (GNOME_DIALOG (pw->dialog));
|
||||
gtk_widget_destroy (pw->dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -71,7 +76,7 @@ gnc_payment_set_owner (PaymentWindow *pw, GncOwner *owner)
|
||||
gnc_owner_set_owner (pw->owner_choice, owner);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_payment_ok_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
PaymentWindow *pw = data;
|
||||
@@ -146,14 +151,14 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data)
|
||||
gnc_ui_payment_window_destroy (pw);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_payment_cancel_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
PaymentWindow *pw = data;
|
||||
gnc_ui_payment_window_destroy (pw);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_payment_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
PaymentWindow *pw = data;
|
||||
@@ -264,15 +269,10 @@ new_payment_window (GncOwner *owner, GNCBook *book, gnc_numeric initial_payment)
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(pw->acct_tree), FALSE);
|
||||
gnc_payment_set_account_types (GNC_TREE_VIEW_ACCOUNT (pw->acct_tree));
|
||||
|
||||
/* Connect the dialog buttons */
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (pw->dialog), 0,
|
||||
G_CALLBACK (gnc_payment_ok_cb), pw);
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (pw->dialog), 1,
|
||||
G_CALLBACK (gnc_payment_cancel_cb), pw);
|
||||
|
||||
/* Setup various signal handlers */
|
||||
g_signal_connect (G_OBJECT (pw->dialog), "destroy",
|
||||
G_CALLBACK (gnc_payment_window_destroy_cb), pw);
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
pw);
|
||||
|
||||
/* Register with the component manager */
|
||||
pw->component_id =
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
@@ -110,6 +110,9 @@ vw_get_vendor (VendorWindow *vw)
|
||||
|
||||
static void gnc_ui_to_vendor (VendorWindow *vw, GncVendor *vendor)
|
||||
{
|
||||
GtkTextBuffer* text_buffer;
|
||||
GtkTextIter start, end;
|
||||
gchar *text;
|
||||
GncAddress *addr;
|
||||
|
||||
addr = gncVendorGetAddr (vendor);
|
||||
@@ -142,8 +145,12 @@ static void gnc_ui_to_vendor (VendorWindow *vw, GncVendor *vendor)
|
||||
gncVendorSetActive (vendor, gtk_toggle_button_get_active
|
||||
(GTK_TOGGLE_BUTTON (vw->active_check)));
|
||||
gncVendorSetTaxIncluded (vendor, vw->taxincluded);
|
||||
gncVendorSetNotes (vendor, gtk_editable_get_chars
|
||||
(GTK_EDITABLE (vw->notes_text), 0, -1));
|
||||
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(vw->notes_text));
|
||||
gtk_text_buffer_get_bounds (text_buffer, &start, &end);
|
||||
text = gtk_text_buffer_get_text (text_buffer, &start, &end, FALSE);
|
||||
gncVendorSetNotes (vendor, text);
|
||||
|
||||
gncVendorSetTerms (vendor, vw->terms);
|
||||
gncVendorSetCurrency (vendor,
|
||||
gnc_currency_edit_get_currency (GNC_CURRENCY_EDIT
|
||||
@@ -280,7 +287,7 @@ gnc_vendor_window_close_handler (gpointer user_data)
|
||||
{
|
||||
VendorWindow *vw = user_data;
|
||||
|
||||
gnome_dialog_close (GNOME_DIALOG (vw->dialog));
|
||||
gtk_widget_destroy (vw->dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -320,7 +327,6 @@ gnc_vendor_new_window (GNCBook *bookp, GncVendor *vendor)
|
||||
{
|
||||
VendorWindow *vw;
|
||||
GladeXML *xml;
|
||||
GnomeDialog *vwd;
|
||||
GtkWidget *edit, *hbox;
|
||||
gnc_commodity *currency;
|
||||
|
||||
@@ -356,12 +362,6 @@ gnc_vendor_new_window (GNCBook *bookp, GncVendor *vendor)
|
||||
/* Find the dialog */
|
||||
xml = gnc_glade_xml_new ("vendor.glade", "Vendor Dialog");
|
||||
vw->dialog = glade_xml_get_widget (xml, "Vendor Dialog");
|
||||
vwd = GNOME_DIALOG (vw->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (vw->dialog), "dialog_info", vw);
|
||||
|
||||
/* default to ok */
|
||||
gnome_dialog_set_default (vwd, 0);
|
||||
|
||||
/* Get entry points */
|
||||
vw->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
@@ -399,9 +399,9 @@ gnc_vendor_new_window (GNCBook *bookp, GncVendor *vendor)
|
||||
|
||||
/* Setup initial values */
|
||||
if (vendor != NULL) {
|
||||
GtkTextBuffer* text_buffer;
|
||||
GncAddress *addr;
|
||||
const char *string;
|
||||
gint pos = 0;
|
||||
|
||||
vw->dialog_type = EDIT_VENDOR;
|
||||
vw->vendor_guid = *gncVendorGetGUID (vendor);
|
||||
@@ -426,9 +426,8 @@ gnc_vendor_new_window (GNCBook *bookp, GncVendor *vendor)
|
||||
gncVendorGetActive (vendor));
|
||||
|
||||
string = gncVendorGetNotes (vendor);
|
||||
gtk_editable_delete_text (GTK_EDITABLE (vw->notes_text), 0, -1);
|
||||
gtk_editable_insert_text (GTK_EDITABLE (vw->notes_text), string,
|
||||
strlen(string), &pos);
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(vw->notes_text));
|
||||
gtk_text_buffer_set_text (text_buffer, string, -1);
|
||||
|
||||
vw->component_id =
|
||||
gnc_register_gui_component (DIALOG_EDIT_VENDOR_CM_CLASS,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Terms Window">
|
||||
<property name="visible">True</property>
|
||||
@@ -13,6 +12,7 @@
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="destroy" handler="billterms_window_destroy_cb" last_modification_time="Mon, 08 Sep 2003 02:00:27 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
@@ -34,7 +34,8 @@
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="response_id">-7</property>
|
||||
<signal name="clicked" handler="billterms_window_close" last_modification_time="Mon, 08 Sep 2003 02:00:40 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -76,13 +77,30 @@
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="terms_clist">
|
||||
<widget class="GtkCList" id="terms_clist">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">True</property>
|
||||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="n_columns">1</property>
|
||||
<property name="column_widths">80</property>
|
||||
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
|
||||
<property name="show_titles">False</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<signal name="select_row" handler="billterms_row_selected" last_modification_time="Mon, 08 Sep 2003 02:00:56 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label23">
|
||||
<property name="label" translatable="yes"></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.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -107,6 +125,7 @@
|
||||
<property name="label" translatable="yes">New...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="billterms_new_term_cb" last_modification_time="Mon, 08 Sep 2003 02:01:29 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -123,6 +142,7 @@
|
||||
<property name="label" translatable="yes">Delete</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="billterms_delete_term_cb" last_modification_time="Mon, 08 Sep 2003 02:01:18 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -349,6 +369,7 @@
|
||||
<property name="label" translatable="yes">Edit...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="billterms_edit_term_cb" last_modification_time="Mon, 08 Sep 2003 02:01:07 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -408,7 +429,7 @@
|
||||
<property name="title" translatable="yes"></property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
@@ -433,7 +454,7 @@
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="response_id">-6</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -446,7 +467,7 @@
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="response_id">-5</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -543,7 +564,7 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Customer Dialog">
|
||||
<property name="visible">True</property>
|
||||
@@ -277,8 +276,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Date Close Dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">Question</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
@@ -34,6 +33,7 @@
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="gnc_dialog_date_close_cancel_cb" last_modification_time="Mon, 08 Sep 2003 02:04:34 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="gnc_dialog_date_close_ok_cb" last_modification_time="Mon, 08 Sep 2003 02:04:23 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -191,7 +192,7 @@
|
||||
<property name="title" translatable="yes">Question</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
@@ -215,7 +216,7 @@
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="response_id">-6</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -228,7 +229,8 @@
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="response_id">-5</property>
|
||||
<signal name="clicked" handler="gnc_dialog_date_close_ok_cb" last_modification_time="Mon, 08 Sep 2003 02:23:45 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Employee Dialog">
|
||||
<property name="visible">True</property>
|
||||
@@ -277,8 +276,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -667,8 +666,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -763,8 +762,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -1029,8 +1028,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
@@ -226,8 +226,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -460,8 +460,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -606,8 +606,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -1318,7 +1318,6 @@
|
||||
<child>
|
||||
<widget class="GtkVSeparator" id="vseparator1">
|
||||
<property name="visible">True</property>
|
||||
<property name="new_group">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="new_group">True</property>
|
||||
@@ -1361,7 +1360,6 @@
|
||||
<child>
|
||||
<widget class="GtkVSeparator" id="vseparator2">
|
||||
<property name="visible">True</property>
|
||||
<property name="new_group">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="new_group">True</property>
|
||||
@@ -1393,7 +1391,6 @@
|
||||
<child>
|
||||
<widget class="GtkVSeparator" id="vseparator3">
|
||||
<property name="visible">True</property>
|
||||
<property name="new_group">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="new_group">True</property>
|
||||
@@ -2439,7 +2436,7 @@
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkDialog" id="post Message Dialog">
|
||||
<widget class="GtkDialog" id="Unpost Message Dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes"></property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Job Dialog">
|
||||
<property name="visible">True</property>
|
||||
@@ -10,7 +9,7 @@
|
||||
<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="resizable">False</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="destroy" handler="gnc_job_window_destroy_cb" last_modification_time="Sat, 19 Jul 2003 23:00:18 GMT"/>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="destroy" handler="gnc_order_window_destroy_cb" last_modification_time="Mon, 08 Sep 2003 01:36:38 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
@@ -35,6 +36,7 @@
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">-11</property>
|
||||
<signal name="clicked" handler="gnc_order_window_help_cb" last_modification_time="Mon, 08 Sep 2003 01:34:48 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -47,6 +49,7 @@
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="gnc_order_window_ok_cb" last_modification_time="Mon, 08 Sep 2003 01:33:56 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -59,6 +62,7 @@
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="gnc_order_window_invoice_cb" last_modification_time="Mon, 08 Sep 2003 01:34:14 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -71,6 +75,7 @@
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="gnc_order_window_close_order_cb" last_modification_time="Mon, 08 Sep 2003 01:34:33 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Payment Dialog">
|
||||
<property name="visible">True</property>
|
||||
@@ -13,6 +12,7 @@
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="destroy" handler="gnc_payment_window_destroy_cb" last_modification_time="Mon, 08 Sep 2003 02:39:12 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
@@ -33,7 +33,8 @@
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="response_id">-6</property>
|
||||
<signal name="clicked" handler="gnc_payment_cancel_cb" last_modification_time="Mon, 08 Sep 2003 02:40:12 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -45,7 +46,8 @@
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<property name="response_id">-5</property>
|
||||
<signal name="clicked" handler="gnc_payment_ok_cb" last_modification_time="Mon, 08 Sep 2003 02:40:03 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Vendor Dialog">
|
||||
<property name="visible">True</property>
|
||||
@@ -278,8 +277,8 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
|
||||
@@ -24,9 +24,18 @@
|
||||
|
||||
#define DIALOG_TAX_TABLE_CM_CLASS "tax-table-dialog"
|
||||
|
||||
void new_tax_table_ok_cb (GtkWidget *widget, gpointer data);
|
||||
void new_tax_table_cancel_cb (GtkWidget *widget, gpointer data);
|
||||
void new_tax_table_dialog_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
void tax_table_new_table_cb (GtkButton *button, TaxTableWindow *ttw);
|
||||
void tax_table_delete_table_cb (GtkButton *button, TaxTableWindow *ttw);
|
||||
void tax_table_new_entry_cb (GtkButton *button, TaxTableWindow *ttw);
|
||||
void tax_table_edit_entry_cb (GtkButton *button, TaxTableWindow *ttw);
|
||||
void tax_table_delete_entry_cb (GtkButton *button, TaxTableWindow *ttw);
|
||||
void tax_table_row_selected (GtkCList *clist, gint row, gint column,
|
||||
GdkEventButton *event, gpointer user_data);
|
||||
void tax_table_entry_row_selected (GtkCList *clist, gint row, gint column,
|
||||
GdkEventButton *event, gpointer user_data);
|
||||
void tax_table_window_close (GtkWidget *widget, gpointer data);
|
||||
void tax_table_window_destroy_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
|
||||
struct _taxtable_window {
|
||||
GtkWidget * dialog;
|
||||
@@ -53,17 +62,16 @@ typedef struct _new_taxtable {
|
||||
} NewTaxTable;
|
||||
|
||||
|
||||
void
|
||||
new_tax_table_ok_cb (GtkWidget *widget, gpointer data)
|
||||
static gboolean
|
||||
new_tax_table_ok_cb (NewTaxTable *ntt)
|
||||
{
|
||||
NewTaxTable *ntt = data;
|
||||
TaxTableWindow *ttw;
|
||||
const char *name = NULL;
|
||||
char *message;
|
||||
Account *acc;
|
||||
gnc_numeric amount;
|
||||
|
||||
g_return_if_fail (ntt);
|
||||
g_return_val_if_fail (ntt, FALSE);
|
||||
ttw = ntt->ttw;
|
||||
|
||||
/* Verify that we've got real, valid data */
|
||||
@@ -74,7 +82,7 @@ new_tax_table_ok_cb (GtkWidget *widget, gpointer data)
|
||||
if (name == NULL || *name == '\0') {
|
||||
message = _("You must provide a name for this Tax Table.");
|
||||
gnc_error_dialog (ntt->dialog, message);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
if (gncTaxTableLookupByName (ttw->book, name)) {
|
||||
message = g_strdup_printf(_(
|
||||
@@ -82,7 +90,7 @@ new_tax_table_ok_cb (GtkWidget *widget, gpointer data)
|
||||
"Your choice \"%s\" is already in use."), name);
|
||||
gnc_error_dialog (ntt->dialog, "%s", message);
|
||||
g_free (message);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,14 +99,14 @@ new_tax_table_ok_cb (GtkWidget *widget, gpointer data)
|
||||
if (gnc_numeric_negative_p (amount)) {
|
||||
message = _("Negative amounts are not allowed.");
|
||||
gnc_error_dialog (ntt->dialog, message);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
if (ntt->type == GNC_AMT_TYPE_PERCENT &&
|
||||
gnc_numeric_compare (amount,
|
||||
gnc_numeric_create (100, 1)) > 0) {
|
||||
message = _("Percentage amount must be between 0 and 100.");
|
||||
gnc_error_dialog (ntt->dialog, message);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* verify the account */
|
||||
@@ -106,7 +114,7 @@ new_tax_table_ok_cb (GtkWidget *widget, gpointer data)
|
||||
if (acc == NULL) {
|
||||
message = _("You must choose a Tax Account.");
|
||||
gnc_error_dialog (ntt->dialog, message);
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gnc_suspend_gui_refresh ();
|
||||
@@ -144,26 +152,7 @@ new_tax_table_ok_cb (GtkWidget *widget, gpointer data)
|
||||
gncTaxTableCommitEdit (ttw->current_table);
|
||||
|
||||
gnc_resume_gui_refresh();
|
||||
|
||||
/* Then close/refresh the dialog/window */
|
||||
gnome_dialog_close (GNOME_DIALOG (ntt->dialog));
|
||||
}
|
||||
|
||||
void
|
||||
new_tax_table_cancel_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
NewTaxTable *ntt = data;
|
||||
g_return_if_fail (ntt);
|
||||
gnome_dialog_close (GNOME_DIALOG (ntt->dialog));
|
||||
}
|
||||
|
||||
void
|
||||
new_tax_table_dialog_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
NewTaxTable *ntt = data;
|
||||
|
||||
if (!ntt) return;
|
||||
g_free (ntt);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -207,13 +196,16 @@ make_menu (GtkWidget *omenu, NewTaxTable *ntt)
|
||||
return menu;
|
||||
}
|
||||
|
||||
static NewTaxTable *
|
||||
static GncTaxTable *
|
||||
new_tax_table_dialog (TaxTableWindow *ttw, gboolean new_table,
|
||||
GncTaxTableEntry *entry)
|
||||
GncTaxTableEntry *entry, const char *name)
|
||||
{
|
||||
GncTaxTable *created_table = NULL;
|
||||
NewTaxTable *ntt;
|
||||
GladeXML *xml;
|
||||
GtkWidget *box, *widget;
|
||||
gboolean done;
|
||||
gint response;
|
||||
|
||||
if (!ttw) return NULL;
|
||||
if (new_table && entry) return NULL;
|
||||
@@ -232,6 +224,8 @@ new_tax_table_dialog (TaxTableWindow *ttw, gboolean new_table,
|
||||
xml = gnc_glade_xml_new ("tax-tables.glade", "New Tax Table Dialog");
|
||||
ntt->dialog = glade_xml_get_widget (xml, "New Tax Table Dialog");
|
||||
ntt->name_entry = glade_xml_get_widget (xml, "name_entry");
|
||||
if (name)
|
||||
gtk_entry_set_text (GTK_ENTRY (ntt->name_entry), name);
|
||||
|
||||
/* Create the menu */
|
||||
make_menu (glade_xml_get_widget (xml, "type_menu"), ntt);
|
||||
@@ -261,9 +255,8 @@ new_tax_table_dialog (TaxTableWindow *ttw, gboolean new_table,
|
||||
gncTaxTableEntryGetAccount (entry));
|
||||
}
|
||||
|
||||
/* Set our modality */
|
||||
gnome_dialog_set_parent (GNOME_DIALOG (ntt->dialog),
|
||||
GTK_WINDOW (ttw->dialog));
|
||||
/* Set our parent */
|
||||
gtk_window_set_transient_for (GTK_WINDOW(ntt->dialog), GTK_WINDOW(ttw->dialog));
|
||||
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
@@ -280,7 +273,26 @@ new_tax_table_dialog (TaxTableWindow *ttw, gboolean new_table,
|
||||
} else
|
||||
gtk_widget_grab_focus (ntt->name_entry);
|
||||
|
||||
return ntt;
|
||||
done = FALSE;
|
||||
while (!done) {
|
||||
response = gtk_dialog_run (GTK_DIALOG (ntt->dialog));
|
||||
switch (response) {
|
||||
case GTK_RESPONSE_OK:
|
||||
if (new_tax_table_ok_cb (ntt)) {
|
||||
created_table = ntt->created_table;
|
||||
done = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
done = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy(ntt->dialog);
|
||||
g_free(ntt);
|
||||
|
||||
return created_table;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
@@ -446,7 +458,7 @@ tax_table_window_refresh (TaxTableWindow *ttw)
|
||||
/* select_row() above will refresh the entries window */
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_row_selected (GtkCList *clist, gint row, gint column,
|
||||
GdkEventButton *event, gpointer user_data)
|
||||
{
|
||||
@@ -465,7 +477,7 @@ tax_table_row_selected (GtkCList *clist, gint row, gint column,
|
||||
tax_table_entries_refresh (ttw, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_entry_row_selected (GtkCList *clist, gint row, gint column,
|
||||
GdkEventButton *event, gpointer user_data)
|
||||
{
|
||||
@@ -479,17 +491,17 @@ tax_table_entry_row_selected (GtkCList *clist, gint row, gint column,
|
||||
|
||||
/* If we double-click an item, then pop up an 'edit' window */
|
||||
if (event && event->type == GDK_2BUTTON_PRESS)
|
||||
new_tax_table_dialog (ttw, FALSE, entry);
|
||||
new_tax_table_dialog (ttw, FALSE, entry, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_new_table_cb (GtkButton *button, TaxTableWindow *ttw)
|
||||
{
|
||||
g_return_if_fail (ttw);
|
||||
new_tax_table_dialog (ttw, TRUE, NULL);
|
||||
new_tax_table_dialog (ttw, TRUE, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_delete_table_cb (GtkButton *button, TaxTableWindow *ttw)
|
||||
{
|
||||
g_return_if_fail (ttw);
|
||||
@@ -518,25 +530,25 @@ tax_table_delete_table_cb (GtkButton *button, TaxTableWindow *ttw)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_new_entry_cb (GtkButton *button, TaxTableWindow *ttw)
|
||||
{
|
||||
g_return_if_fail (ttw);
|
||||
if (!ttw->current_table)
|
||||
return;
|
||||
new_tax_table_dialog (ttw, FALSE, NULL);
|
||||
new_tax_table_dialog (ttw, FALSE, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_edit_entry_cb (GtkButton *button, TaxTableWindow *ttw)
|
||||
{
|
||||
g_return_if_fail (ttw);
|
||||
if (!ttw->current_entry)
|
||||
return;
|
||||
new_tax_table_dialog (ttw, FALSE, ttw->current_entry);
|
||||
new_tax_table_dialog (ttw, FALSE, ttw->current_entry, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_delete_entry_cb (GtkButton *button, TaxTableWindow *ttw)
|
||||
{
|
||||
g_return_if_fail (ttw);
|
||||
@@ -578,10 +590,11 @@ tax_table_window_close_handler (gpointer data)
|
||||
{
|
||||
TaxTableWindow *ttw = data;
|
||||
g_return_if_fail (ttw);
|
||||
gnome_dialog_close (GNOME_DIALOG (ttw->dialog));
|
||||
|
||||
gtk_widget_destroy (ttw->dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_window_close (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
TaxTableWindow *ttw = data;
|
||||
@@ -589,7 +602,7 @@ tax_table_window_close (GtkWidget *widget, gpointer data)
|
||||
gnc_ui_tax_table_window_destroy (ttw);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
tax_table_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
TaxTableWindow *ttw = data;
|
||||
@@ -616,7 +629,6 @@ gnc_ui_tax_table_window_new (GNCBook *book)
|
||||
{
|
||||
TaxTableWindow *ttw;
|
||||
GladeXML *xml;
|
||||
GtkWidget *button;
|
||||
|
||||
if (!book) return NULL;
|
||||
|
||||
@@ -642,35 +654,10 @@ gnc_ui_tax_table_window_new (GNCBook *book)
|
||||
ttw->names_clist = glade_xml_get_widget (xml, "tax_tables_clist");
|
||||
ttw->entries_clist = glade_xml_get_widget (xml, "tax_table_entries");
|
||||
|
||||
/* Connect all the buttons */
|
||||
button = glade_xml_get_widget (xml, "new_table_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (tax_table_new_table_cb), ttw);
|
||||
button = glade_xml_get_widget (xml, "delete_table_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (tax_table_delete_table_cb), ttw);
|
||||
button = glade_xml_get_widget (xml, "new_entry_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (tax_table_new_entry_cb), ttw);
|
||||
button = glade_xml_get_widget (xml, "edit_entry_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (tax_table_edit_entry_cb), ttw);
|
||||
button = glade_xml_get_widget (xml, "delete_entry_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (tax_table_delete_entry_cb), ttw);
|
||||
|
||||
/* Set the row-select callbacks */
|
||||
g_signal_connect (G_OBJECT (ttw->names_clist), "select-row",
|
||||
G_CALLBACK (tax_table_row_selected), ttw);
|
||||
g_signal_connect (G_OBJECT (ttw->entries_clist), "select-row",
|
||||
G_CALLBACK (tax_table_entry_row_selected), ttw);
|
||||
|
||||
/* Connect the dialog buttons */
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (ttw->dialog), 0,
|
||||
G_CALLBACK (tax_table_window_close), ttw);
|
||||
|
||||
g_signal_connect (G_OBJECT (ttw->dialog), "destroy",
|
||||
G_CALLBACK (tax_table_window_destroy_cb), ttw);
|
||||
/* Setup signals */
|
||||
glade_xml_signal_autoconnect_full( xml,
|
||||
gnc_glade_autoconnect_full_func,
|
||||
ttw);
|
||||
|
||||
/* register with component manager */
|
||||
ttw->component_id =
|
||||
@@ -694,49 +681,16 @@ gnc_ui_tax_table_window_destroy (TaxTableWindow *ttw)
|
||||
gnc_close_gui_component (ttw->component_id);
|
||||
}
|
||||
|
||||
static int
|
||||
from_name_close_cb (GnomeDialog *dialog, gpointer data)
|
||||
{
|
||||
NewTaxTable *ntt;
|
||||
GncTaxTable **created_table = data;
|
||||
|
||||
ntt = gtk_object_get_data (GTK_OBJECT (dialog), "dialog_info");
|
||||
|
||||
*created_table = ntt->created_table;
|
||||
|
||||
gtk_main_quit ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Create a new tax-table by name */
|
||||
GncTaxTable *
|
||||
gnc_ui_tax_table_new_from_name (GNCBook *book, const char *name)
|
||||
{
|
||||
GncTaxTable *created_table = NULL;
|
||||
TaxTableWindow *ttw;
|
||||
NewTaxTable *ntt;
|
||||
|
||||
if (!book) return NULL;
|
||||
|
||||
ttw = gnc_ui_tax_table_window_new (book);
|
||||
if (!ttw) return NULL;
|
||||
|
||||
ntt = new_tax_table_dialog (ttw, TRUE, NULL);
|
||||
if (!ntt) return NULL;
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (ntt->dialog), "dialog_info", ntt);
|
||||
gtk_signal_connect (GTK_OBJECT (ntt->dialog), "close",
|
||||
GTK_SIGNAL_FUNC (from_name_close_cb), &created_table);
|
||||
|
||||
/* Preset the name in the new dialog */
|
||||
if (name)
|
||||
gtk_entry_set_text (GTK_ENTRY (ntt->name_entry), name);
|
||||
|
||||
/* I know that NTT is already modal, no need to reset it here */
|
||||
|
||||
/* Now run the dialog -- wait for it to close */
|
||||
gtk_main ();
|
||||
|
||||
return created_table;
|
||||
return new_tax_table_dialog (ttw, TRUE, NULL, name);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Tax Table Window">
|
||||
<property name="visible">True</property>
|
||||
@@ -13,6 +12,7 @@
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="destroy" handler="tax_table_window_destroy_cb" last_modification_time="Mon, 08 Sep 2003 03:25:07 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
@@ -34,6 +34,7 @@
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="tax_table_window_close" last_modification_time="Mon, 08 Sep 2003 03:24:35 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -46,10 +47,9 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<widget class="GtkHPaned" id="hpaned1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame1">
|
||||
@@ -75,13 +75,30 @@
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="tax_tables_clist">
|
||||
<widget class="GtkCList" id="tax_tables_clist">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">True</property>
|
||||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="n_columns">1</property>
|
||||
<property name="column_widths">80</property>
|
||||
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
|
||||
<property name="show_titles">False</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<signal name="select_row" handler="tax_table_row_selected" last_modification_time="Mon, 08 Sep 2003 03:31:16 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label23">
|
||||
<property name="label" translatable="yes"></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.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -105,6 +122,7 @@
|
||||
<property name="label" translatable="yes">New...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="tax_table_new_table_cb" last_modification_time="Mon, 08 Sep 2003 03:32:06 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -120,6 +138,7 @@
|
||||
<property name="label" translatable="yes">Delete</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="tax_table_delete_table_cb" last_modification_time="Mon, 08 Sep 2003 03:31:56 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -157,9 +176,8 @@
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -187,13 +205,30 @@
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="tax_table_entries">
|
||||
<widget class="GtkCList" id="tax_table_entries">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">True</property>
|
||||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
<property name="n_columns">1</property>
|
||||
<property name="column_widths">80</property>
|
||||
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
|
||||
<property name="show_titles">False</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
<signal name="select_row" handler="tax_table_entry_row_selected" last_modification_time="Mon, 08 Sep 2003 03:31:06 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label23">
|
||||
<property name="label" translatable="yes"></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.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -217,6 +252,7 @@
|
||||
<property name="label" translatable="yes">New...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="tax_table_new_entry_cb" last_modification_time="Mon, 08 Sep 2003 03:31:47 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -232,6 +268,7 @@
|
||||
<property name="label" translatable="yes">Edit...</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="tax_table_edit_entry_cb" last_modification_time="Mon, 08 Sep 2003 03:31:36 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -247,6 +284,7 @@
|
||||
<property name="label" translatable="yes">Delete</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<signal name="clicked" handler="tax_table_delete_entry_cb" last_modification_time="Mon, 08 Sep 2003 03:31:26 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@@ -284,9 +322,8 @@
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -309,7 +346,6 @@
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
<signal name="destroy" handler="new_tax_table_dialog_destroy_cb" last_modification_time="Sat, 19 Jul 2003 23:22:27 GMT"/>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox2">
|
||||
@@ -331,7 +367,6 @@
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">-6</property>
|
||||
<signal name="clicked" handler="new_tax_table_cancel_cb" last_modification_time="Sat, 19 Jul 2003 23:21:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
@@ -345,7 +380,6 @@
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">-5</property>
|
||||
<signal name="clicked" handler="new_tax_table_ok_cb" last_modification_time="Sat, 19 Jul 2003 23:21:26 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -441,7 +475,7 @@
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -848,7 +848,7 @@ gnc_search_dialog_init_widgets (GNCSearchWindow *sw)
|
||||
close_handler, sw);
|
||||
|
||||
/* And setup the close callback */
|
||||
g_signal_connect (G_OBJECT (sw->dialog), "close",
|
||||
g_signal_connect (G_OBJECT (sw->dialog), "destroy",
|
||||
G_CALLBACK (gnc_search_dialog_close_cb), sw);
|
||||
|
||||
gnc_search_dialog_reset_widgets (sw);
|
||||
@@ -927,7 +927,7 @@ guint gnc_search_dialog_connect_on_close (GNCSearchWindow *sw,
|
||||
g_return_val_if_fail (func, 0);
|
||||
g_return_val_if_fail (user_data, 0);
|
||||
|
||||
return g_signal_connect (G_OBJECT (sw->dialog), "close",
|
||||
return g_signal_connect (G_OBJECT (sw->dialog), "destroy",
|
||||
func, user_data);
|
||||
|
||||
}
|
||||
|
||||
@@ -169,20 +169,23 @@ gnc_general_search_destroy (GtkObject *object)
|
||||
gsl->entry = NULL;
|
||||
gsl->button = NULL;
|
||||
|
||||
if (gsl->priv->sw) {
|
||||
if (gsl->priv) {
|
||||
/* Clear the callbacks */
|
||||
gnc_search_dialog_set_select_cb (gsl->priv->sw, NULL,
|
||||
NULL, FALSE);
|
||||
gnc_search_dialog_disconnect (gsl->priv->sw, gsl);
|
||||
gsl->priv->sw = NULL;
|
||||
if (gsl->priv->sw) {
|
||||
gnc_search_dialog_set_select_cb (gsl->priv->sw, NULL,
|
||||
NULL, FALSE);
|
||||
gnc_search_dialog_disconnect (gsl->priv->sw, gsl);
|
||||
gsl->priv->sw = NULL;
|
||||
}
|
||||
|
||||
/* Unregister ourselves */
|
||||
gnc_unregister_gui_component (gsl->priv->component_id);
|
||||
|
||||
/* And let go */
|
||||
g_free (gsl->priv);
|
||||
gsl->priv = NULL;
|
||||
}
|
||||
|
||||
/* Unregister ourselves */
|
||||
gnc_unregister_gui_component (gsl->priv->component_id);
|
||||
|
||||
/* And let go */
|
||||
g_free (gsl->priv);
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user