2001-05-01 Dave Peticolas <dave@krondo.com>

* src/gnome/window-acct-tree.c: add popup menu to account tree

	* src/gnome/mainwindow-account-tree.c
	(gnc_mainwin_account_tree_attach_popup): add user_data argument
	for popup menu

	* src/gnome/window-register.c: same as below

	* src/gnome/window-main.c: same as below

	* src/gnome/window-register.c: obey gnome preferences for
	menubar & toolbar detachability


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4096 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-05-01 08:42:18 +00:00
parent 60ab02516b
commit efb07a072a
8 changed files with 107 additions and 45 deletions

View File

@ -1,3 +1,18 @@
2001-05-01 Dave Peticolas <dave@krondo.com>
* src/gnome/window-acct-tree.c: add popup menu to account tree
* src/gnome/mainwindow-account-tree.c
(gnc_mainwin_account_tree_attach_popup): add user_data argument
for popup menu
* src/gnome/window-register.c: same as below
* src/gnome/window-main.c: same as below
* src/gnome/window-register.c: obey gnome preferences for
menubar & toolbar detachability
2001-05-01 Christian Stimming <stimming@tuhh.de>
* src/scm/report/average-balance.scm: moved from

View File

@ -200,10 +200,12 @@ gnc_mainwin_account_tree_get_type ()
\*******************************************************************************/
void
gnc_mainwin_account_tree_attach_popup(GNCMainWinAccountTree *mwac_tree, GnomeUIInfo *popup_info)
gnc_mainwin_account_tree_attach_popup(GNCMainWinAccountTree *mwac_tree,
GnomeUIInfo *popup_info,
gpointer user_data)
{
GtkWidget *popup = gnome_popup_menu_new(popup_info);
gnome_popup_menu_attach(popup, GTK_WIDGET(mwac_tree->acc_tree), NULL);
gnome_popup_menu_attach(popup, GTK_WIDGET(mwac_tree->acc_tree), user_data);
return;
}

View File

@ -63,15 +63,20 @@ guint gnc_mainwin_account_tree_get_type(void);
GtkWidget* gnc_mainwin_account_tree_new(void);
void
gnc_mainwin_account_tree_attach_popup(GNCMainWinAccountTree *tree, GnomeUIInfo *popup_info);
gnc_mainwin_account_tree_attach_popup(GNCMainWinAccountTree *tree,
GnomeUIInfo *popup_info,
gpointer user_data);
void
gnc_mainwin_account_tree_set_view_info(GNCMainWinAccountTree *tree, AccountViewInfo new_info);
gnc_mainwin_account_tree_set_view_info(GNCMainWinAccountTree *tree,
AccountViewInfo new_info);
Account *
gnc_mainwin_account_tree_get_current_account(GNCMainWinAccountTree *tree);
GList *
gnc_mainwin_account_tree_get_current_accounts(GNCMainWinAccountTree *tree);
void gnc_mainwin_account_tree_toggle_account_expansion(GNCMainWinAccountTree *tree, Account *account);
void
gnc_mainwin_account_tree_toggle_account_expansion (GNCMainWinAccountTree *tree,
Account *account);
#endif /* __GNC_MAINWINDOW_ACCOUNT_TREE_H */

View File

@ -150,7 +150,7 @@ gnc_acct_tree_view_destroy(GtkObject * obj, gpointer user_data) {
********************************************************************/
static GtkWidget *
gnc_acct_tree_view_new(GnomeMDIChild * child, gpointer user_data) {
gnc_acct_tree_view_new(GnomeMDIChild * child, gpointer user_data) {
GNCMainInfo * maininfo = user_data;
GNCMainChildInfo * mc = g_new0(GNCMainChildInfo, 1);
GNCAcctTreeWin * win = gnc_acct_tree_window_new(child->name);
@ -184,14 +184,18 @@ gnc_acct_tree_view_new(GnomeMDIChild * child, gpointer user_data) {
N_("Name of account view"));
scm_protect_object(win->name_change_callback_id);
gnc_acct_tree_window_create_menu(win, mc);
gnc_acct_tree_window_create_menu(win, mc);
gnc_acct_tree_window_create_toolbar(win, mc);
gnc_main_window_create_child_toolbar(maininfo, mc);
gnc_mainwin_account_tree_attach_popup
(GNC_MAINWIN_ACCOUNT_TREE (win->account_tree),
mc->menu_info->moreinfo, child);
if(mc->menu_info) {
gnome_mdi_child_set_menu_template(child, mc->menu_info);
}
return mc->contents;
}

View File

@ -124,32 +124,37 @@ gnc_main_window_app_created_cb(GnomeMDI * mdi, GnomeApp * app,
summarybar = gnc_main_window_summary_new();
{
/* This is essentially gnome_app_add_docked, but without using
* gnome_app_add_dock_item because it emits the layout_changed
* signal which creates a new layout and writes it over the saved
* layout config before we've had a chance to read it.
*/
GnomeDockItemBehavior behavior;
GtkWidget *item;
GtkWidget *item;
item = gnome_dock_item_new("Summary Bar",
GNOME_DOCK_ITEM_BEH_EXCLUSIVE |
GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL);
gtk_container_add( GTK_CONTAINER (item), summarybar );
/* This is essentially gnome_app_add_docked, but without using
* gnome_app_add_dock_item because it emits the layout_changed
* signal which creates a new layout and writes it over the saved
* layout config before we've had a chance to read it.
*/
if( app->layout )
{
gnome_dock_layout_add_item( app->layout,
GNOME_DOCK_ITEM(item),
GNOME_DOCK_TOP,
2, 0, 0 );
}
else
{
gnome_dock_add_item( GNOME_DOCK(app->dock),
GNOME_DOCK_ITEM(item),
GNOME_DOCK_TOP,
2, 0, 0, FALSE );
}
behavior = (GNOME_DOCK_ITEM_BEH_EXCLUSIVE |
GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL);
if (!gnome_preferences_get_toolbar_detachable ())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
item = gnome_dock_item_new("Summary Bar", behavior);
gtk_container_add( GTK_CONTAINER (item), summarybar );
if (app->layout)
{
gnome_dock_layout_add_item( app->layout,
GNOME_DOCK_ITEM(item),
GNOME_DOCK_TOP,
2, 0, 0 );
}
else
{
gnome_dock_add_item( GNOME_DOCK(app->dock),
GNOME_DOCK_ITEM(item),
GNOME_DOCK_TOP,
2, 0, 0, FALSE );
}
}
/* add the statusbar */
@ -266,12 +271,17 @@ gnc_main_window_child_changed_cb(GnomeMDI * mdi, GnomeMDIChild * not_used,
GnomeUIInfo * hintinfo;
GtkWidget * oldbar;
GnomeApp * new_app = NULL;
GnomeDockItemBehavior behavior;
if(mdi && mdi->active_child) {
childwin = gtk_object_get_user_data(GTK_OBJECT(mdi->active_child));
new_app = gnome_mdi_get_app_from_view(childwin->contents);
}
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE;
if (!gnome_preferences_get_toolbar_detachable ())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
if(childwin && childwin->toolbar) {
if(childwin->app && (childwin->app == new_app)) {
oldbar = gtk_object_get_user_data(GTK_OBJECT(new_app));
@ -298,7 +308,7 @@ gnc_main_window_child_changed_cb(GnomeMDI * mdi, GnomeMDIChild * not_used,
childwin->app = new_app;
gnome_app_add_toolbar(GNOME_APP(childwin->app),
GTK_TOOLBAR(childwin->toolbar),
"Toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
"Toolbar", behavior,
GNOME_DOCK_TOP, 1, 0, 0);
gtk_toolbar_set_style(GTK_TOOLBAR(childwin->toolbar),
gnc_get_toolbar_style());
@ -312,7 +322,7 @@ gnc_main_window_child_changed_cb(GnomeMDI * mdi, GnomeMDIChild * not_used,
childwin->app = new_app;
gnome_app_add_toolbar(GNOME_APP(childwin->app),
GTK_TOOLBAR(childwin->toolbar),
"Toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
"Toolbar", behavior,
GNOME_DOCK_TOP, 1, 0, 0);
gtk_toolbar_set_style(GTK_TOOLBAR(childwin->toolbar),
gnc_get_toolbar_style());

View File

@ -1542,7 +1542,8 @@ recnWindow (GtkWidget *parent, Account *account)
recn_set_watches (recnData);
type = xaccAccountGetType(account);
recnData->use_shares = ((type == STOCK) || (type == MUTUAL) ||
recnData->use_shares = ((type == STOCK) ||
(type == MUTUAL) ||
(type == CURRENCY));
/* The last time reconciliation was attempted during the current
@ -1555,7 +1556,8 @@ recnWindow (GtkWidget *parent, Account *account)
else
statement_date = last_statement_date;
gnc_get_reconcile_info (account, recnData->use_shares, &new_ending, &statement_date);
gnc_get_reconcile_info (account, recnData->use_shares,
&new_ending, &statement_date);
/* Popup a little window to prompt the user to enter the
* ending balance for his/her bank statement */
@ -1591,10 +1593,15 @@ recnWindow (GtkWidget *parent, Account *account)
/* The menu bar */
{
GnomeDockItemBehavior behavior;
GtkWidget *dock_item;
GtkWidget *menubar;
dock_item = gnome_dock_item_new("menu", GNOME_DOCK_ITEM_BEH_EXCLUSIVE);
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE;
if (!gnome_preferences_get_menubar_detachable ())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
dock_item = gnome_dock_item_new("menu", behavior);
menubar = gnc_recn_create_menu_bar(recnData, statusbar);
gtk_container_set_border_width(GTK_CONTAINER(menubar), 2);
@ -1606,11 +1613,16 @@ recnWindow (GtkWidget *parent, Account *account)
/* The tool bar */
{
GnomeDockItemBehavior behavior;
GtkWidget *dock_item;
GtkWidget *toolbar;
SCM id;
dock_item = gnome_dock_item_new("toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE);
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE;
if (!gnome_preferences_get_toolbar_detachable ())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
dock_item = gnome_dock_item_new("toolbar", behavior);
toolbar = gnc_recn_create_tool_bar(recnData);
gtk_container_set_border_width(GTK_CONTAINER(toolbar), 2);

View File

@ -2037,10 +2037,15 @@ regWindowLedger (xaccLedgerDisplay *ledger)
/* The menu bar */
{
GnomeDockItemBehavior behavior;
GtkWidget *dock_item;
GtkWidget *menubar;
dock_item = gnome_dock_item_new("menu", GNOME_DOCK_ITEM_BEH_EXCLUSIVE);
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE;
if (!gnome_preferences_get_menubar_detachable ())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
dock_item = gnome_dock_item_new("menu", behavior);
menubar = gnc_register_create_menu_bar(regData, statusbar);
gtk_container_set_border_width(GTK_CONTAINER(menubar), 2);
@ -2052,11 +2057,16 @@ regWindowLedger (xaccLedgerDisplay *ledger)
/* The tool bar */
{
GnomeDockItemBehavior behavior;
GtkWidget *dock_item;
GtkWidget *toolbar;
SCM id;
dock_item = gnome_dock_item_new("toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE);
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE;
if (!gnome_preferences_get_toolbar_detachable ())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
dock_item = gnome_dock_item_new("toolbar", behavior);
toolbar = gnc_register_create_tool_bar(regData);
gtk_container_set_border_width(GTK_CONTAINER(toolbar), 2);
@ -2077,10 +2087,14 @@ regWindowLedger (xaccLedgerDisplay *ledger)
summarybar = gnc_register_create_summary_bar (regData);
if (summarybar)
{
GnomeDockItemBehavior behavior;
GtkWidget *dock_item;
dock_item = gnome_dock_item_new ("summarybar",
GNOME_DOCK_ITEM_BEH_EXCLUSIVE);
behavior = GNOME_DOCK_ITEM_BEH_EXCLUSIVE;
if (!gnome_preferences_get_toolbar_detachable ())
behavior |= GNOME_DOCK_ITEM_BEH_LOCKED;
dock_item = gnome_dock_item_new ("summarybar", behavior);
gtk_container_set_border_width (GTK_CONTAINER (summarybar), 2);
gtk_container_add (GTK_CONTAINER (dock_item), summarybar);

View File

@ -515,8 +515,8 @@
(list (N_ "Use Full Account Name?") "f"
(N_ "Display the full account name") #t)
(list (N_ "Other Account")"g"
(N_ "Display the other account?
(if this is a split transaction, this parameter is guessed).") #f)
(N_ "Display the other account? \
(if this is a split transaction, this parameter is guessed).") #f)
(list (N_ "Shares") "h" (N_ "Display the number of shares?") #f)
(list (N_ "Price") "i" "Display the shares price?" #f)
;; note the "Amount" multichoice option in between here