[gnucash-de] Re: Aktien: AusführlicherInfozeile

Joerg Sommer joerg at alea.gnuu.de
Don Sep 4 16:21:41 CDT 2003


begin  Christian Stimming <stimming at tuhh.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> On Samstag, 2. August 2003 14:27, Joerg Sommer wrote:
>> begin  Christian Stimming <stimming at tuhh.de> wrote:
>> > -----BEGIN PGP SIGNED MESSAGE-----
>> >
>> > On Freitag, 1. August 2003 23:56, Joerg Sommer wrote:
>> >> Hi,
>> >>
>> >> die Zeile mit der Zusammenfassung ist mir nicht informativ genug. Kann
>> >> ich die mit guile erweitern oder geht das nur in den Quellen? Ich würde
>> >> hier gern noch den Gewinn sehen.
>> >
>> > Welche "Zeile mit der Zusammenfassung" meinst du?
>>
>> Na die über der Anzeige. Klick mal "View->Summayr Bar" und das was du
>> dann nicht mehr siehst, meine ich.
> 
> Ach so, ok. Diese zu ändern ist (leider) *sehr* schwierig. Du müsstest direkt 
> im C code in src/gnome/window-main-summarybar.c rumbasteln.

Nur mal so eine prinzipelle Frage: Ihr habt so ein halbes C++ in C
nachgebaut? Macht das Sinn?

Hier ist mein pre-patch. Ist das schonmal richtig oder ist es die falsche
Stelle? Wie bekomme ich die gesamten Buchungen in einem Konto heraus? Ich
wollte jetzt die ganzen Buchungen abklappern und die dortigen Werte
zusammen addieren und von amount in Zeile 839 (in der leeren if(){})
einfach dann abziehen. Wird das was?

#v+
diff -urb gnucash-1.8.5/src/gnome/gnc-split-reg.c /home/Sources/gnucash-1.8.5/src/gnome/gnc-split-reg.c
--- gnucash-1.8.5/src/gnome/gnc-split-reg.c	2003-06-25 06:27:48.000000000 +0200
+++ /home/Sources/gnucash-1.8.5/src/gnome/gnc-split-reg.c	2003-09-04 17:12:43.000000000 +0200
@@ -735,7 +735,7 @@
       }
 
     /* Print the summary share value */
-    if (gsr->value_label != NULL)
+    if (gsr->value_label != NULL || gsr->profit_label != NULL)
       {
         GNCPrice *price;
 
@@ -754,11 +754,27 @@
 
                  xaccSPrintAmount (string, amount, print_info);
 
+		 if (gsr->value_label != NULL)
+		   {
                  gnc_set_label_color (gsr->value_label, amount);
                  gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
               }
+		 if (gsr->profit_label != NULL)
+		   {
+		      gnc_set_label_color (gsr->profit_label, amount);
+		      gtk_label_set_text (GTK_LABEL (gsr->profit_label), string);
+		   }
+		 
+              }
             else
               {
+		 if (gsr->profit_label != NULL)
+		   {
+		      gnc_set_label_color (gsr->profit_label, gnc_numeric_zero ());
+		      gtk_label_set_text (GTK_LABEL (gsr->profit_label),
+					  _("<No information>"));
+		   }
+		 if (gsr->value_label != NULL) {
                 /* else try to do a double-price-conversion :-( */
                 price = account_latest_price_any_currency (leader);
                 if(!price)
@@ -800,6 +816,7 @@
                   }
               }
           }
+          }
         else
           {
             gnc_commodity *currency = gnc_price_get_currency (price);
@@ -810,10 +827,17 @@
                                       gnc_commodity_get_fraction (currency),
                                       GNC_RND_ROUND);
 
+	    if (gsr->value_label != NULL)
+	       {
             xaccSPrintAmount (string, amount, print_info);
 
             gnc_set_label_color (gsr->value_label, amount);
             gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
+	       }
+	    if (gsr->profit_label != NULL)
+	       {
+		  
+	       }
 
             gnc_price_unref (price);
           }
@@ -1871,6 +1895,7 @@
   gsr->projectedminimum_label  = NULL;
   gsr->shares_label     = NULL;
   gsr->value_label      = NULL;
+  gsr->profit_labal       = NULL;
 
   if ( gnc_ledger_display_type(gsr->ledger) >= LD_SUBACCOUNT ) {
     gsr->summarybar = NULL;
@@ -1911,6 +1936,7 @@
   {
     gsr->shares_label     = add_summary_label (summarybar, _("Shares:"));
     gsr->value_label      = add_summary_label (summarybar, _("Current Value:"));
+    gsr->profit_label       = add_summary_label (summarybar, _("Profit:"));
   }
 
   gsr->summarybar = summarybar;
diff -urb gnucash-1.8.5/src/gnome/gnc-split-reg.h /home/Sources/gnucash-1.8.5/src/gnome/gnc-split-reg.h
--- gnucash-1.8.5/src/gnome/gnc-split-reg.h	2003-06-25 06:27:49.000000000 +0200
+++ /home/Sources/gnucash-1.8.5/src/gnome/gnc-split-reg.h	2003-09-04 16:34:24.000000000 +0200
@@ -115,6 +115,7 @@
   GtkWidget *projectedminimum_label;
   GtkWidget *shares_label;
   GtkWidget *value_label;
+  GtkWidget *profit_label;
 
   /** The current ledger display. **/
   GNCLedgerDisplay *ledger;
#v-

Bye, Jörg.

> 
> Christian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
> 
> iQCVAwUBPyxO/2XAi+BfhivFAQEf6AP+KmXRAnmq88LNlGhPZsy9ty6LAZsoxzo8
> N/a3n5IjDo1Ss2WXhVaS14o8CU9cgUpSkuaBRlPA1US2nr/fF4tS46rpcemxdPN0
> U8EGaemJbce+ugVwgV855+FKpZcICsMSghjfk4nAQvXDD0GD43ZOwpCdERxqR1zb
> fzdF+hU7xSI=
> =nQu7
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> gnucash-de mailing list
> gnucash-de at lists.gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-de
> 

end.
-- 
Objektivität ist die Wahnvorstellung, Beobachtungen könnten ohne
Beobachter gemacht werden - Heinz v. Foerster