Re-indentation of source code.

This re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20163 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-01-24 14:10:09 +00:00
parent bd17b5fa41
commit c8f1244fff
35 changed files with 1308 additions and 1258 deletions

View File

@ -153,7 +153,7 @@ static void
gnc_table_slist_free( GSList *table_list ) gnc_table_slist_free( GSList *table_list )
{ {
GSList *list; GSList *list;
for ( list = table_list; list !=NULL; list = g_slist_next( list )) for ( list = table_list; list != NULL; list = g_slist_next( list ))
{ {
g_free( list->data ); g_free( list->data );
} }
@ -314,11 +314,13 @@ gnc_dbi_sqlite3_session_begin( QofBackend *qbe, QofSession *session,
goto exit; goto exit;
} }
if ( !conn_test_dbi_library( be->conn ) ) { if ( !conn_test_dbi_library( be->conn ) )
{
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI ); qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe, "DBI library fails large number test" ); qof_backend_set_message( qbe, "DBI library fails large number test" );
if ( create && !file_exists ) /* File didn't exist before, but it */ if ( create && !file_exists ) /* File didn't exist before, but it */
{ /* does now, and we don't want to */ {
/* does now, and we don't want to */
dbi_conn_close( be->conn );/* leave it lying around. */ dbi_conn_close( be->conn );/* leave it lying around. */
be->conn = NULL; be->conn = NULL;
g_unlink( filepath ); g_unlink( filepath );
@ -761,7 +763,8 @@ gnc_dbi_mysql_session_begin( QofBackend* qbe, QofSession *session,
result = dbi_conn_connect( be->conn ); result = dbi_conn_connect( be->conn );
if ( result == 0 ) if ( result == 0 )
{ {
if ( !conn_test_dbi_library( be->conn ) ) { if ( !conn_test_dbi_library( be->conn ) )
{
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI ); qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe, qof_backend_set_message( qbe,
"DBI library fails large number test" ); "DBI library fails large number test" );
@ -833,7 +836,8 @@ gnc_dbi_mysql_session_begin( QofBackend* qbe, QofSession *session,
qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR ); qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
goto exit; goto exit;
} }
if ( !conn_test_dbi_library( be->conn ) ) { if ( !conn_test_dbi_library( be->conn ) )
{
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI ); qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe, qof_backend_set_message( qbe,
"DBI library fails large number test" ); "DBI library fails large number test" );
@ -1027,7 +1031,8 @@ gnc_dbi_postgres_session_begin( QofBackend *qbe, QofSession *session,
result = dbi_conn_connect( be->conn ); result = dbi_conn_connect( be->conn );
if ( result == 0 ) if ( result == 0 )
{ {
if ( !conn_test_dbi_library( be->conn ) ) { if ( !conn_test_dbi_library( be->conn ) )
{
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI ); qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe, qof_backend_set_message( qbe,
"DBI library fails large number test" ); "DBI library fails large number test" );
@ -1100,7 +1105,8 @@ gnc_dbi_postgres_session_begin( QofBackend *qbe, QofSession *session,
qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR ); qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
goto exit; goto exit;
} }
if ( !conn_test_dbi_library( be->conn ) ) { if ( !conn_test_dbi_library( be->conn ) )
{
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI ); qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe, qof_backend_set_message( qbe,
"DBI library fails large number test" ); "DBI library fails large number test" );
@ -1345,7 +1351,8 @@ conn_table_operation( GncSqlConnection *sql_conn, GSList *table_name_list,
do do
{ {
gnc_dbi_init_error( conn ); gnc_dbi_init_error( conn );
switch( op ) { switch ( op )
{
case rollback: case rollback:
if (g_slist_find(full_table_name_list, table_name)) if (g_slist_find(full_table_name_list, table_name))
{ {

View File

@ -494,9 +494,9 @@ gnc_entry_ledger_auto_completion (GncEntryLedger *ledger,
auto_entry = auto_entry =
/* Use this for book-wide auto-completion of the invoice entries */ /* Use this for book-wide auto-completion of the invoice entries */
find_entry_in_book_by_desc(ledger, desc); find_entry_in_book_by_desc(ledger, desc);
/* #else */ /* #else */
/* gnc_find_entry_in_reg_by_desc(ledger, desc); */ /* gnc_find_entry_in_reg_by_desc(ledger, desc); */
/* #endif */ /* #endif */
if (auto_entry == NULL) if (auto_entry == NULL)
return FALSE; return FALSE;

View File

@ -55,8 +55,8 @@ listen_for_gncentry_events(QofInstance *entity, QofEventId event_type,
if (0 == (event_type & (QOF_EVENT_MODIFY | QOF_EVENT_DESTROY))) if (0 == (event_type & (QOF_EVENT_MODIFY | QOF_EVENT_DESTROY)))
return; return;
/* g_warning("entity %p, entity type %s, event type %s, user data %p, ecent data %p", */ /* g_warning("entity %p, entity type %s, event type %s, user data %p, ecent data %p", */
/* entity, entity->e_type, qofeventid_to_string(event_type), user_data, event_data); */ /* entity, entity->e_type, qofeventid_to_string(event_type), user_data, event_data); */
desc = gncEntryGetDescription(GNC_ENTRY(entity)); desc = gncEntryGetDescription(GNC_ENTRY(entity));
if (event_type & QOF_EVENT_MODIFY) if (event_type & QOF_EVENT_MODIFY)
@ -124,7 +124,7 @@ static EntryQF* build_shared_quickfill (QofBook *book, const char * key, gboolea
QofQuery *query = new_query_for_entrys(book); QofQuery *query = new_query_for_entrys(book);
GList *entries = qof_query_run(query); GList *entries = qof_query_run(query);
/* g_warning("Found %d GncEntry items", g_list_length (entries)); */ /* g_warning("Found %d GncEntry items", g_list_length (entries)); */
result = g_new0(EntryQF, 1); result = g_new0(EntryQF, 1);

View File

@ -328,12 +328,12 @@ gnc_plugin_ab_account_selected(GncPluginPage *plugin_page, Account *account,
(account && bankcode && *bankcode (account && bankcode && *bankcode
&& accountid && *accountid)); && accountid && *accountid));
gnc_plugin_update_actions(action_group, need_account_actions, gnc_plugin_update_actions(action_group, need_account_actions,
"visible",TRUE); "visible", TRUE);
} }
else else
{ {
gnc_plugin_update_actions(action_group, need_account_actions, gnc_plugin_update_actions(action_group, need_account_actions,
"sensitive",FALSE); "sensitive", FALSE);
gnc_plugin_update_actions(action_group, need_account_actions, gnc_plugin_update_actions(action_group, need_account_actions,
"visible", FALSE); "visible", FALSE);
} }

View File

@ -3246,11 +3246,14 @@ get_preferences(QIFImportWindow *wind)
g_error_free(err); g_error_free(err);
g_warning("QIF import: Couldn't get %s setting from gconf.", g_warning("QIF import: Couldn't get %s setting from gconf.",
GCONF_NAME_DEFAULT_TRANSACTION_STATUS); GCONF_NAME_DEFAULT_TRANSACTION_STATUS);
} else { }
else
{
if (g_strcmp0(status_pref, "cleared") == 0) if (g_strcmp0(status_pref, "cleared") == 0)
{ {
tmp_transaction_status = 'c'; tmp_transaction_status = 'c';
} else if (g_strcmp0(status_pref, "reconciled") == 0) }
else if (g_strcmp0(status_pref, "reconciled") == 0)
{ {
tmp_transaction_status = 'y'; tmp_transaction_status = 'y';
} }

View File

@ -655,7 +655,7 @@ floordiv(int a, int b)
} }
else else
{ {
return - ((-a-1) / b) - 1; return - ((-a - 1) / b) - 1;
} }
} }

View File

@ -621,7 +621,9 @@ qof_book_validate_counter_format(const gchar *p)
if (tmp == NULL) if (tmp == NULL)
{ {
return g_strdup_printf("Invalid length modifier and/or conversion specifier ('%.2s'), it should be: " G_GINT64_FORMAT, p); return g_strdup_printf("Invalid length modifier and/or conversion specifier ('%.2s'), it should be: " G_GINT64_FORMAT, p);
} else if (tmp != p) { }
else if (tmp != p)
{
return g_strdup_printf("Garbage before length modifier and/or conversion specifier: '%*s'", (int)(tmp - p), p); return g_strdup_printf("Garbage before length modifier and/or conversion specifier: '%*s'", (int)(tmp - p), p);
} }

View File

@ -65,7 +65,7 @@ static void
test_session_safe_save( Fixture *fixture, gconstpointer pData ) test_session_safe_save( Fixture *fixture, gconstpointer pData )
{ {
qof_session_safe_save( fixture->session, percentage_fn ); qof_session_safe_save( fixture->session, percentage_fn );
g_assert_cmpint( ERR_BACKEND_DATA_CORRUPT, ==, g_assert_cmpint( ERR_BACKEND_DATA_CORRUPT, == ,
qof_session_get_error( fixture->session )); qof_session_get_error( fixture->session ));
g_assert( NULL == qof_session_get_url( fixture->session )); g_assert( NULL == qof_session_get_url( fixture->session ));
} }

View File

@ -485,7 +485,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
gnc_numeric n; gnc_numeric n;
GncOwner *owner; GncOwner *owner;
Account *acc; Account *acc;
enum update{YES = GTK_RESPONSE_YES, NO = GTK_RESPONSE_NO}update; enum update {YES = GTK_RESPONSE_YES, NO = GTK_RESPONSE_NO} update;
GtkWidget *dialog; GtkWidget *dialog;
Timespec today; Timespec today;
@ -599,13 +599,30 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
update = gtk_dialog_run (GTK_DIALOG (dialog)); update = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
if (update == NO) if (update == NO)
{ // Cleanup and leave {
g_free (id); g_free (date_opened); g_free (owner_id); g_free (biing_id); // Cleanup and leave
g_free (notes); g_free (date); g_free (desc); g_free (action); g_free (id);
g_free (account); g_free (quantity); g_free (price); g_free (disc_type); g_free (date_opened);
g_free (disc_how); g_free (discount); g_free (taxable); g_free (taxincluded); g_free (owner_id);
g_free (tax_table); g_free (date_posted); g_free (due_date); g_free (account_posted); g_free (biing_id);
g_free (memo_posted); g_free (accumulatesplits); g_free (notes);
g_free (date);
g_free (desc);
g_free (action);
g_free (account);
g_free (quantity);
g_free (price);
g_free (disc_type);
g_free (disc_how);
g_free (discount);
g_free (taxable);
g_free (taxincluded);
g_free (tax_table);
g_free (date_posted);
g_free (due_date);
g_free (account_posted);
g_free (memo_posted);
g_free (accumulatesplits);
return; return;
} }
} }

View File

@ -37,21 +37,24 @@
G_BEGIN_DECLS G_BEGIN_DECLS
// model // model
enum bi_import_model_columns { enum bi_import_model_columns
{
ID, DATE_OPENED, OWNER_ID, BILLING_ID, NOTES, // invoice settings ID, DATE_OPENED, OWNER_ID, BILLING_ID, NOTES, // invoice settings
DATE, DESC, ACTION, ACCOUNT, QUANTITY, PRICE, DISC_TYPE, DISC_HOW, DISCOUNT, TAXABLE, TAXINCLUDED, TAX_TABLE, // entry settings DATE, DESC, ACTION, ACCOUNT, QUANTITY, PRICE, DISC_TYPE, DISC_HOW, DISCOUNT, TAXABLE, TAXINCLUDED, TAX_TABLE, // entry settings
DATE_POSTED, DUE_DATE, ACCOUNT_POSTED, MEMO_POSTED, ACCU_SPLITS, // autopost settings DATE_POSTED, DUE_DATE, ACCOUNT_POSTED, MEMO_POSTED, ACCU_SPLITS, // autopost settings
N_COLUMNS N_COLUMNS
}; };
enum _bi_import_result { enum _bi_import_result
{
RESULT_OK, RESULT_OK,
RESULT_OPEN_FAILED, RESULT_OPEN_FAILED,
RESULT_ERROR_IN_REGEXP, RESULT_ERROR_IN_REGEXP,
}; };
typedef enum _bi_import_result bi_import_result; typedef enum _bi_import_result bi_import_result;
struct _bi_import_stats { struct _bi_import_stats
{
int n_imported, n_ignored; int n_imported, n_ignored;
GString *ignored_lines; GString *ignored_lines;
}; };

View File

@ -51,7 +51,8 @@ static void gnc_plugin_bi_import_cmd_test (GtkAction *action, GncMainWindowActio
#define PLUGIN_ACTIONS_NAME "gnc-plugin-bi_import-actions" #define PLUGIN_ACTIONS_NAME "gnc-plugin-bi_import-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-bi_import-ui.xml" #define PLUGIN_UI_FILENAME "gnc-plugin-bi_import-ui.xml"
static GtkActionEntry gnc_plugin_actions [] = { static GtkActionEntry gnc_plugin_actions [] =
{
/* Menu Items */ /* Menu Items */
{ "ImportMenuAction", NULL, N_("_Import"), NULL, NULL, NULL }, { "ImportMenuAction", NULL, N_("_Import"), NULL, NULL, NULL },
{ "bi_importAction", NULL, N_("Import Bills & Invoices..."), NULL, N_("bi_import tooltip"), G_CALLBACK(gnc_plugin_bi_import_cmd_test) }, { "bi_importAction", NULL, N_("Import Bills & Invoices..."), NULL, N_("bi_import tooltip"), G_CALLBACK(gnc_plugin_bi_import_cmd_test) },

View File

@ -47,11 +47,13 @@ G_BEGIN_DECLS
#define GNC_PLUGIN_bi_import_NAME "gnc-plugin-bi_import" #define GNC_PLUGIN_bi_import_NAME "gnc-plugin-bi_import"
/* typedefs & structures */ /* typedefs & structures */
typedef struct { typedef struct
{
GncPlugin gnc_plugin; GncPlugin gnc_plugin;
} GncPluginbi_import; } GncPluginbi_import;
typedef struct { typedef struct
{
GncPluginClass gnc_plugin; GncPluginClass gnc_plugin;
} GncPluginbi_importClass; } GncPluginbi_importClass;

View File

@ -66,20 +66,25 @@ libgncmod_bi_import_gnc_module_description (void)
int int
libgncmod_bi_import_gnc_module_init (int refcount) libgncmod_bi_import_gnc_module_init (int refcount)
{ {
if (!gnc_module_load ("gnucash/app-utils", 0)) { if (!gnc_module_load ("gnucash/app-utils", 0))
{
return FALSE; return FALSE;
} }
if (!gnc_module_load ("gnucash/gnome-utils", 0)) { if (!gnc_module_load ("gnucash/gnome-utils", 0))
{
return FALSE; return FALSE;
} }
if (!gnc_module_load ("gnucash/business-core", 0)) { if (!gnc_module_load ("gnucash/business-core", 0))
{
return FALSE; return FALSE;
} }
if (!gnc_module_load ("gnucash/engine", 0)) { if (!gnc_module_load ("gnucash/engine", 0))
{
return FALSE; return FALSE;
} }
if (refcount == 0) { if (refcount == 0)
{
/* this is the first time the module is loaded */ /* this is the first time the module is loaded */
gnc_plugin_manager_add_plugin ( gnc_plugin_manager_get (), gnc_plugin_manager_add_plugin ( gnc_plugin_manager_get (),
@ -92,7 +97,8 @@ libgncmod_bi_import_gnc_module_init (int refcount)
int int
libgncmod_bi_import_gnc_module_end (int refcount) libgncmod_bi_import_gnc_module_end (int refcount)
{ {
if (refcount == 0) { if (refcount == 0)
{
/* this is the last time the module is unloaded */ /* this is the last time the module is unloaded */
} }

View File

@ -43,7 +43,8 @@
#include "bi_import.h" #include "bi_import.h"
#include "gui.h" #include "gui.h"
struct _bi_import_gui { struct _bi_import_gui
{
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *tree_view; GtkWidget *tree_view;
GtkWidget *entryFilename; GtkWidget *entryFilename;
@ -92,9 +93,10 @@ gnc_plugin_bi_import_showGUI(void)
// if window exists already, activate it // if window exists already, activate it
glist = gnc_find_gui_components ("dialog-bi_import_gui", NULL, NULL); glist = gnc_find_gui_components ("dialog-bi_import_gui", NULL, NULL);
if (glist) { if (glist)
{
// window found // window found
gui = g_list_nth_data (glist,0); gui = g_list_nth_data (glist, 0);
g_list_free (glist); g_list_free (glist);
gtk_window_present (GTK_WINDOW(gui->dialog)); gtk_window_present (GTK_WINDOW(gui->dialog));
return gui; return gui;
@ -196,7 +198,8 @@ gnc_bi_import_gui_ok_cb (GtkWidget *widget, gpointer data)
gtk_list_store_clear (gui->store); gtk_list_store_clear (gui->store);
res = gnc_bi_import_read_file (filename, gui->regexp->str, gui->store, 0, &stats); res = gnc_bi_import_read_file (filename, gui->regexp->str, gui->store, 0, &stats);
if (res == RESULT_OK) { if (res == RESULT_OK)
{
gnc_bi_import_fix_bis (gui->store, &n_fixed, &n_deleted, info); gnc_bi_import_fix_bis (gui->store, &n_fixed, &n_deleted, info);
if (info->len > 0) if (info->len > 0)
gnc_info_dialog (gui->dialog, "%s", info->str); gnc_info_dialog (gui->dialog, "%s", info->str);
@ -207,13 +210,15 @@ gnc_bi_import_gui_ok_cb (GtkWidget *widget, gpointer data)
if (stats.n_ignored > 0) if (stats.n_ignored > 0)
gnc_info2_dialog (gui->dialog, _("These lines were ignored during import"), stats.ignored_lines->str); gnc_info2_dialog (gui->dialog, _("These lines were ignored during import"), stats.ignored_lines->str);
g_string_free (stats.ignored_lines,TRUE); g_string_free (stats.ignored_lines, TRUE);
gnc_close_gui_component (gui->component_id); gnc_close_gui_component (gui->component_id);
} else }
if (res == RESULT_OPEN_FAILED) { else if (res == RESULT_OPEN_FAILED)
{
gnc_error_dialog (gui->dialog, _("The input file can not be opened.")); gnc_error_dialog (gui->dialog, _("The input file can not be opened."));
} else }
if (res == RESULT_ERROR_IN_REGEXP) { else if (res == RESULT_ERROR_IN_REGEXP)
{
//gnc_error_dialog (gui->dialog, "The regular expression is faulty:\n\n%s", stats.err->str); //gnc_error_dialog (gui->dialog, "The regular expression is faulty:\n\n%s", stats.err->str);
} }
} }
@ -262,7 +267,8 @@ void gnc_bi_import_gui_buttonOpen_cb (GtkWidget *widget, gpointer data)
BillImportGui *gui = data; BillImportGui *gui = data;
filename = gnc_plugin_bi_import_getFilename(); filename = gnc_plugin_bi_import_getFilename();
if (filename) { if (filename)
{
//printf("Setting filename"); // debug //printf("Setting filename"); // debug
gtk_entry_set_text( GTK_ENTRY(gui->entryFilename), filename ); gtk_entry_set_text( GTK_ENTRY(gui->entryFilename), filename );
//printf("Set filename"); // debug //printf("Set filename"); // debug
@ -321,8 +327,9 @@ void gnc_bi_import_gui_option5_cb (GtkWidget *widget, gpointer data)
if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) )) if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ))
return; return;
temp = gnc_input_dialog (0, _("Adjust regular expression used for import"), _("This regular expression is used to parse the import file. Modify according to your needs.\n"), gui->regexp->str); temp = gnc_input_dialog (0, _("Adjust regular expression used for import"), _("This regular expression is used to parse the import file. Modify according to your needs.\n"), gui->regexp->str);
if (temp) { if (temp)
g_string_assign (gui->regexp,temp); {
g_string_assign (gui->regexp, temp);
g_free (temp); g_free (temp);
gnc_bi_import_gui_filenameChanged_cb (gui->entryFilename, gui); gnc_bi_import_gui_filenameChanged_cb (gui->entryFilename, gui);
} }
@ -336,8 +343,8 @@ void gnc_import_gui_type(GtkWidget *widget, gpointer data)
BillImportGui *gui = data; BillImportGui *gui = data;
if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) )) if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ))
return; return;
if (g_ascii_strcasecmp(widget->name,"radiobuttonInvoice") == 0)gui->type="INVOICE"; if (g_ascii_strcasecmp(widget->name, "radiobuttonInvoice") == 0)gui->type = "INVOICE";
else if (g_ascii_strcasecmp(widget->name,"radiobuttonBill") == 0)gui->type="BILL"; else if (g_ascii_strcasecmp(widget->name, "radiobuttonBill") == 0)gui->type = "BILL";
//printf ("TYPE set to, %s\n",gui->type); //printf ("TYPE set to, %s\n",gui->type);
} }
@ -403,7 +410,8 @@ gnc_input_dialog (GtkWidget *parent, const gchar *title, const gchar *msg, const
if (result == GTK_RESPONSE_REJECT) if (result == GTK_RESPONSE_REJECT)
user_input = 0; user_input = 0;
else { else
{
gtk_text_buffer_get_start_iter (buffer, &start); gtk_text_buffer_get_start_iter (buffer, &start);
gtk_text_buffer_get_end_iter (buffer, &end); gtk_text_buffer_get_end_iter (buffer, &end);
user_input = gtk_text_buffer_get_text (buffer, user_input = gtk_text_buffer_get_text (buffer,
@ -435,7 +443,7 @@ gnc_info2_dialog (GtkWidget *parent, const gchar *title, const gchar *msg)
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
gchar *user_input; gchar *user_input;
GtkTextIter start, end; GtkTextIter start, end;
gint width,height; gint width, height;
/* Create the widgets */ /* Create the widgets */
dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (parent), dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (parent),
@ -449,7 +457,7 @@ gnc_info2_dialog (GtkWidget *parent, const gchar *title, const gchar *msg)
#endif #endif
// add a scroll area // add a scroll area
scrolledwindow = gtk_scrolled_window_new (NULL,NULL); scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (content_area), scrolledwindow); gtk_container_add (GTK_CONTAINER (content_area), scrolledwindow);
// add a textview // add a textview
@ -461,7 +469,8 @@ gnc_info2_dialog (GtkWidget *parent, const gchar *title, const gchar *msg)
gtk_container_add (GTK_CONTAINER (scrolledwindow), view); gtk_container_add (GTK_CONTAINER (scrolledwindow), view);
// run the dialog // run the dialog
if (parent) { if (parent)
{
gtk_window_get_size (GTK_WINDOW(parent), &width, &height); gtk_window_get_size (GTK_WINDOW(parent), &width, &height);
gtk_window_set_default_size (GTK_WINDOW(dialog), width, height); gtk_window_set_default_size (GTK_WINDOW(dialog), width, height);
} }