[Kmymoney-devel] Re: [Bug 253271] New: [scheduled transactions] input is lost, when encountering "Invalid payment type for bills"

Thomas Baumgart thb at net-bembel.de
Tue Oct 5 08:15:31 CEST 2010


Hi,

on Tuesday 05 October 2010 02:54:33 Alvaro Soliverez wrote:

> Hello all,
> I have gone over this bug before (it was reported in a mail but not
> filed in BKO).
> 
> The problem to solve it is that the transaction editor does not emit a
> signal when the tab (and thus, the type of the operation) changes.
> That would allow to enable or disable the payment types in the combo.
> The StdTransactionEditor has a suitable spot to add the signal, but
> the schedule editor instantiates the super class, TransactionEditor.

Not looking further into the details, I can tell you that this is not true 
because TransactionEditor is pure virtual.

thb at localhost:~/devel/kmymoney4/kmymoney/dialogs> grep "= 0" 
transactioneditor.h
  virtual bool createTransaction(MyMoneyTransaction& t, const 
MyMoneyTransaction& torig, const MyMoneySplit& sorig, bool skipPriceDialog = 
false) = 0;
  virtual bool isComplete(QString& reason) const = 0;
  virtual QWidget* firstWidget(void) const = 0;
  virtual void createEditWidgets(void) = 0;
  virtual void setupFinalWidgets(void) = 0;
  virtual void loadEditWidgets(KMyMoneyRegister::Action action = 
KMyMoneyRegister::ActionNone) = 0;
  MyMoneyMoney amountFromWidget(bool* update = 0) const;


The editor itself is created early in KEditScheduleDlg::startEdit(void) using 
a factory method. Just declare the signal as part of the base class and you 
can connect it using a base class pointer and only emit it in specific derived 
classes.

> As a workaround, we can disable the ok button if the combination of
> operation and payment types are not valid. But, that's the account
> opening date debacle all over again...

You might want to look into the signal emission again.


-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
'I think there is a world market for maybe five computers.'
 -Thomas Watson, Chairman of IBM, 1943
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20101005/b0b35447/attachment.sig 


More information about the KMyMoney-devel mailing list