Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KMyMoney2App Class Reference

Main application class. More...

#include <kmymoney2.h>

Inheritance diagram for KMyMoney2App:

KMainWindow DCOPObject Collaboration diagram for KMyMoney2App:

Collaboration graph
[legend]
List of all members.

Public Slots

void slotFileInfoDialog (void)
void slotFileNew (void)
void slotFileNewWindow (void)
void slotFileOpen (void)
void slotFileOpenRecent (const KURL &url)
void slotOpenDatabase (void)
bool slotFileSave (void)
bool slotFileSaveAs (void)
bool slotSaveAsDatabase (void)
void slotFileCloseWindow (void)
void slotFileClose (void)
void slotFileQuit (void)
void slotFileConsitencyCheck (void)
void slotPriceDialog (void)
void slotCurrencyDialog (void)
void slotHideReconciledTransactions (void)
void slotHideUnusedCategories (void)
void slotShowAllAccounts (void)
const QString slotStatusMsg (const QString &text)
void slotStatusProgressBar (int current, int total=0)
void slotProcessExited (void)
void slotEquityPriceUpdate (void)
bool slotStatementImport (const MyMoneyStatement &s)
bool slotStatementImport (const QString &url)
void slotAccountReconcileStart (void)
void slotAccountReconcileFinish (void)
void slotAccountReconcilePostpone (void)
void slotAccountDelete (void)
void slotAccountEdit (void)
void slotAccountOpen (const MyMoneyObject &=MyMoneyAccount())
void slotAccountClose (void)
void slotAccountReopen (void)
void slotReparentAccount (const MyMoneyAccount &src, const MyMoneyAccount &dest)
void slotReparentAccount (const MyMoneyAccount &src, const MyMoneyInstitution &dest)
void slotAccountTransactionReport (void)
void slotShowAccountContextMenu (const MyMoneyObject &)
void slotShowScheduleContextMenu (void)
void slotShowInstitutionContextMenu (const MyMoneyObject &)
void slotShowInvestmentContextMenu (void)
void slotShowPayeeContextMenu (void)
void slotShowBudgetContextMenu (void)
void slotShowTransactionContextMenu (void)
void slotShowCurrencyContextMenu (void)
void slotScheduleNew (void)
void slotScheduleEdit (void)
void slotScheduleDelete (void)
void slotScheduleEnter (void)
void slotScheduleSkip (void)
void slotToolsStartKCalc (void)
void slotToolsPluginDlg (void)
void slotResetSelections (void)
void slotSelectAccount (const MyMoneyObject &account=MyMoneyAccount())
void slotSelectInstitution (const MyMoneyObject &institution=MyMoneyInstitution())
void slotSelectInvestment (const MyMoneyObject &account=MyMoneyAccount())
void slotSelectSchedule (const MyMoneySchedule &schedule=MyMoneySchedule())
void slotSelectPayees (const QValueList< MyMoneyPayee > &list)
void slotSelectBudget (const QValueList< MyMoneyBudget > &list)
void slotSelectTransactions (const KMyMoneyRegister::SelectedTransactions &list)
void slotSelectCurrency (const MyMoneySecurity &currency=MyMoneySecurity())
void slotTransactionMatch (void)
void slotAccountNew (void)
void slotAccountNew (MyMoneyAccount &)
void slotCategoryNew (void)
void slotCategoryNew (MyMoneyAccount &account, const MyMoneyAccount &parent=MyMoneyAccount())
void slotUpdateActions (void)
void slotInstitutionNew (void)
void slotInstitutionNew (MyMoneyInstitution &institution)

Signals

void fileLoaded (const KURL &url)
void payeesSelected (const QValueList< MyMoneyPayee > &payees)
void transactionsSelected (const KMyMoneyRegister::SelectedTransactions &transactions)
void selectAllTransactions (void)
void budgetSelected (const QValueList< MyMoneyBudget > &budget)
void budgetRename (void)
void accountSelected (const MyMoneyAccount &account)
void investmentSelected (const MyMoneyAccount &account)
void institutionSelected (const MyMoneyInstitution &institution)
void scheduleSelected (const MyMoneySchedule &schedule)
void currencySelected (const MyMoneySecurity &currency)
void payeeRename (void)
void payeeCreated (const QCString &id)
void currencyRename (void)
void currencyCreated (const QCString &id)
void startMatchTransaction (const MyMoneyTransaction &t)
void cancelMatchTransaction (void)
void accountReconciled (const MyMoneyAccount &account, const QDate &date, const MyMoneyMoney &startingBalance, const MyMoneyMoney &endingBalance, const QValueList< QPair< MyMoneyTransaction, MyMoneySplit > > &transactionList)

DCOP Member Functions

const QString filename () const
void webConnect (const QString &, const QCString &asn_id)
bool okToWriteFile (const KURL &url)

Public Member Functions

void createInitialAccount (void)
const KURL lastOpenedURL (void)
 KMyMoney2App (QWidget *parent=0, const char *name=0)
 ~KMyMoney2App ()
bool initWizard (void)
void writeLastUsedDir (const QString &directory)
QString readLastUsedDir (void) const
void writeLastUsedFile (const QString &fileName)
QString readLastUsedFile (void) const
bool isImportableFile (const KURL &url)
void updateCaption (bool skipActions=false)
const QCStringList instanceList (void) const
void dumpActions (void) const
void showContextMenu (const QString &containerName)
void createCategory (MyMoneyAccount &account, const MyMoneyAccount &parent)
const MyMoneyAccountaccount (const QString &key, const QString &value) const
void setAccountOnlineParameters (const MyMoneyAccount &acc, const MyMoneyKeyValueContainer &kvps)
KURL selectFile (const QString &title, const QString &path, const QString &mask, KFile::Mode mode)
KAction * action (const QString &actionName) const
KToggleAction * toggleAction (const QString &actionName) const

Static Public Member Functions

static void progressCallback (int current, int total, const QString &)

Protected Slots

void slotFileSaveAsFilterChanged (const QString &filter)
void slotAutoSave (void)
void slotEnableMessages (void)
void slotFileFileInfo (void)
void slotPerformanceTest (void)
void slotToggleTraces (void)
void slotToggleTimers (void)
void slotFileViewPersonal (void)
void slotQifImport (void)
void slotQifImportFinished (void)
void slotGncImport (void)
void slotAccountChart (void)
void slotStatementImport (void)
void slotLoadAccountTemplates (void)
void slotSaveAccountTemplates (void)
void slotQifExport (void)
void slotSettings (void)
void slotFileBackup (void)
void slotShowTipOfTheDay (void)
void slotQifProfileEditor (void)
void slotShowPreviousView (void)
void slotShowNextView (void)
void slotSecurityEditor (void)
void slotFindTransaction (void)
void slotCloseSearchDialog (void)
void slotInstitutionEdit (const MyMoneyObject &obj=MyMoneyInstitution())
void slotInstitutionDelete (void)
void slotCategoryNew (const QString &name, QCString &id)
void slotPrintView (void)
void slotInvestmentNew (void)
void slotInvestmentNew (MyMoneyAccount &account, const MyMoneyAccount &parent)
void slotInvestmentEdit (void)
void slotInvestmentDelete (void)
void slotOnlinePriceUpdate (void)
void slotManualPriceUpdate (void)
void slotUpdateConfiguration (void)
void slotPayeeNew (const QString &newnameBase, QCString &id)
void slotPayeeNew (void)
void slotPayeeDelete (void)
void slotBudgetNew (void)
void slotBudgetDelete (void)
void slotBudgetCopy (void)
void slotBudgetChangeYear (void)
void slotBudgetForecast (void)
void slotCurrencyNew (void)
void slotCurrencyRename (QListViewItem *item, int, const QString &txt)
void slotCurrencyDelete (void)
void slotCurrencySetBase (void)
void slotNewFeature (void)
void slotTransactionsNew (void)
void slotTransactionsEdit (void)
void slotTransactionsEditSplits (void)
void slotTransactionsDelete (void)
void slotTransactionsEnter (void)
void slotTransactionsCancel (void)
void slotTransactionsCancelOrEnter (bool &okToSelect)
void slotTransactionDuplicate (void)
void slotToggleReconciliationFlag (void)
void slotMarkTransactionCleared (void)
void slotMarkTransactionReconciled (void)
void slotMarkTransactionNotReconciled (void)
void slotTransactionGotoAccount (void)
void slotTransactionGotoPayee (void)
void slotTransactionCreateSchedule (void)
void slotTransactionAssignNumber (void)
void slotTransactionCombine (void)
void slotTransactionsAccept (void)
void slotDateChanged (void)
void slotDataChanged (void)
void slotMoveToAccount (const QCString &id)
void slotUpdateMoveToAccountMenu (void)
void slotScheduleNew (const MyMoneyTransaction &t, MyMoneySchedule::occurenceE occurence=MyMoneySchedule::OCCUR_MONTHLY)
void slotScheduleDuplicate (void)
void slotKDELanguageSettings (void)
void slotAccountMapOnline (void)
void slotAccountUnmapOnline (void)
void slotAccountUpdateOnline (void)
void slotManageGpgKeys (void)
void slotKeySelected (int idx)

Protected Member Functions

void saveOptions (void)
void createInterfaces (void)
void loadPlugins (void)
void readOptions (void)
void initActions (void)
void initDynamicMenus (void)
void initStatusBar (void)
virtual bool queryClose (void)
virtual bool queryExit (void)
void slotCheckSchedules (void)
virtual void resizeEvent (QResizeEvent *)
void createSchedule (MyMoneySchedule newSchedule, MyMoneyAccount &newAccount)
void createAccount (MyMoneyAccount &newAccount, MyMoneyAccount &parentAccount, MyMoneyAccount &brokerageAccount, MyMoneyMoney openingBal)
bool canCloseAccount (const MyMoneyAccount &acc) const
bool payeeInList (const QValueList< MyMoneyPayee > &list, const QCString &id) const
void markTransaction (MyMoneySplit::reconcileFlagE flag)
bool enterSchedule (MyMoneySchedule &s, bool autoEnter=false)
void createInstitution (MyMoneyInstitution &institution)
void transactionUnmatch (void)
void transactionMatch (void)

Private Types

enum  backupStateE { BACKUP_IDLE = 0, BACKUP_MOUNTING, BACKUP_COPYING, BACKUP_UNMOUNTING }

Private Member Functions

void ready (void)
bool isReady (void)
void deleteTransactionEditor (void)
void doDeleteTransactions (void)
bool exchangeAccountInTransaction (MyMoneyTransaction &_t, const QCString &fromId, const QCString &toId)

Private Attributes

KMyMoneyPrivate * d
KConfig * config
QMap< QString, KMyMoneyPlugin::ImporterPlugin * > m_importerPlugins
QMap< QString, KMyMoneyPlugin::OnlinePlugin * > m_onlinePlugins
backupStateE m_backupState
int m_backupResult
bool m_backupMount
KProcess proc
KMyMoneyViewmyMoneyView
 A pointer to the view holding the tabs.
KURL m_fileName
 The URL of the file currently being edited when open.
bool m_startDialog
QString m_mountpoint
KProgress * progressBar
QString m_statusMsg
int m_progressUpdate
int m_nextUpdate
MyMoneyQifReaderm_qifReader
MyMoneyStatementReaderm_smtReader
KFindTransactionDlgm_searchDlg
bool m_bCheckSchedules
KToolBarPopupAction * m_previousViewButton
KToolBarPopupAction * m_nextViewButton
QObjectm_pluginInterface
MyMoneyAccount m_selectedAccount
MyMoneyAccount m_reconciliationAccount
MyMoneyAccount m_selectedInvestment
MyMoneyInstitution m_selectedInstitution
MyMoneySchedule m_selectedSchedule
MyMoneySecurity m_selectedCurrency
QValueList< MyMoneyPayeem_selectedPayees
QValueList< MyMoneyBudgetm_selectedBudgets
KMyMoneyRegister::SelectedTransactions m_selectedTransactions
bool m_autoSaveEnabled
QTimer * m_autoSaveTimer
int m_autoSavePeriod
bool m_inAutoSaving
KComboBoxm_saveEncrypted
TransactionEditorm_transactionEditor
KEndingBalanceDlgm_endingBalanceDlg
QCString m_accountGoto
QCString m_payeeGoto
QStringList m_additionalGpgKeys
QLabelm_additionalKeyLabel
KPushButton * m_additionalKeyButton

Detailed Description

The base class for KMyMoney application windows. It sets up the main window and reads the config file as well as providing a menubar, toolbar and statusbar.

See also:
KMyMoneyView
Author:
Michael Edwardes 2000-2001

Thomas Baumgart 2006-2008


Member Enumeration Documentation

enum KMyMoney2App::backupStateE [private]
 

Enumeration values:
BACKUP_IDLE 
BACKUP_MOUNTING 
BACKUP_COPYING 
BACKUP_UNMOUNTING 


Constructor & Destructor Documentation

KMyMoney2App::KMyMoney2App QWidget parent = 0,
const char *  name = 0
 

construtor of KMyMoney2App, calls all init functions to create the application.

KMyMoney2App::~KMyMoney2App  ) 
 

Destructor


Member Function Documentation

const MyMoneyAccount& KMyMoney2App::account const QString &  key,
const QString &  value
const
 

This method returns the account for a given key - value pair. If the account is not found in the list of accounts, MyMoneyAccount() is returned.

void KMyMoney2App::accountReconciled const MyMoneyAccount account,
const QDate &  date,
const MyMoneyMoney startingBalance,
const MyMoneyMoney endingBalance,
const QValueList< QPair< MyMoneyTransaction, MyMoneySplit > > &  transactionList
[signal]
 

This signal is emitted when an account has been successfully reconciled and all transactions are updated in the engine. It can be used by plugins to create reconciliation reports.

Parameters:
account the account data
date the reconciliation date as provided through the dialog
startingBalance the starting balance as provided through the dialog
endingBalance the ending balance as provided through the dialog
transactionList reference to QValueList of QPair containing all transaction/split pairs processed by the reconciliation.

void KMyMoney2App::accountSelected const MyMoneyAccount account  )  [signal]
 

This signal is emitted when a new account has been selected by the GUI. If no account is selected or the selection is removed, account is identical to MyMoneyAccount(). This signal is used by plugins to get information about changes.

KAction* KMyMoney2App::action const QString &  actionName  )  const
 

This method retrieves a pointer to a KAction object from actionCollection(). If the action with the name actionName is not found, a pointer to a static non-configured KAction object is returned and a warning is printed to stderr.

Parameters:
actionName name of the action to be retrieved
Returns:
pointer to KAction object (or derivative)

void KMyMoney2App::budgetRename void   )  [signal]
 

void KMyMoney2App::budgetSelected const QValueList< MyMoneyBudget > &  budget  )  [signal]
 

This signal is emitted when a list of budgets has been selected by the GUI. If no budget is selected or the selection is removed, budget is identical to an empty QValueList. This signal is used by plugins to get information about changes.

void KMyMoney2App::cancelMatchTransaction void   )  [signal]
 

bool KMyMoney2App::canCloseAccount const MyMoneyAccount acc  )  const [protected]
 

This method checks, if an account can be closed or not. An account can be closed if:

  • the balance is zero and
  • all children are already closed and
  • there is no unfinished schedule referencing the account

Parameters:
acc reference to MyMoneyAccount object in question
Return values:
true account can be closed
false account cannot be closed

void KMyMoney2App::createAccount MyMoneyAccount newAccount,
MyMoneyAccount parentAccount,
MyMoneyAccount brokerageAccount,
MyMoneyMoney  openingBal
[protected]
 

void KMyMoney2App::createCategory MyMoneyAccount account,
const MyMoneyAccount parent
 

This method opens the category editor with the data found in account. The parent account is preset to parent but can be modified. If the user acknowledges, the category is created.

void KMyMoney2App::createInitialAccount void   ) 
 

This method checks if there is at least one asset or liability account in the current storage object. If not, it starts the new account wizard.

void KMyMoney2App::createInstitution MyMoneyInstitution institution  )  [protected]
 

Creates a new institution entry in the MyMoneyFile engine

Parameters:
institution MyMoneyInstitution object containing the data of the institution to be created.

void KMyMoney2App::createInterfaces void   )  [protected]
 

Creates the interfaces necessary for the plugins to work. Therefore, this method must be called prior to loadPlugins().

void KMyMoney2App::createSchedule MyMoneySchedule  newSchedule,
MyMoneyAccount newAccount
[protected]
 

void KMyMoney2App::currencyCreated const QCString &  id  )  [signal]
 

void KMyMoney2App::currencyRename void   )  [signal]
 

void KMyMoney2App::currencySelected const MyMoneySecurity currency  )  [signal]
 

This signal is emitted when a new currency has been selected by the GUI. If no currency is selected or the selection is removed, currency is identical to MyMoneySecurity(). This signal is used by plugins to get information about changes.

void KMyMoney2App::deleteTransactionEditor void   )  [private]
 

Delete a possibly existing transaction editor but make sure to remove any reference to it so that we avoid using a half-dead object

void KMyMoney2App::doDeleteTransactions void   )  [private]
 

delete all selected transactions w/o further questions

void KMyMoney2App::dumpActions void   )  const
 

Dump a list of the names of all defined KActions to stdout.

bool KMyMoney2App::enterSchedule MyMoneySchedule s,
bool  autoEnter = false
[protected]
 

This slot allows to enter the next scheduled transaction of the given schedule

bool KMyMoney2App::exchangeAccountInTransaction MyMoneyTransaction _t,
const QCString &  fromId,
const QCString &  toId
[private]
 

Exchanges all references in transaction _t to account fromId into references to account toId. Returns true if at least one split has been changed, false otherwise.

void KMyMoney2App::fileLoaded const KURL &  url  )  [signal]
 

This signal is emitted when a new file is loaded. In the case file is closed, this signal is also emitted with an empty url.

const QString KMyMoney2App::filename  )  const
 

void KMyMoney2App::initActions void   )  [protected]
 

initializes the KActions of the application

void KMyMoney2App::initDynamicMenus void   )  [protected]
 

initializes the dynamic menus (account selectors)

void KMyMoney2App::initStatusBar void   )  [protected]
 

sets up the statusbar for the main window by initialzing a statuslabel.

bool KMyMoney2App::initWizard void   ) 
 

Init wizard dialog

const QCStringList KMyMoney2App::instanceList void   )  const
 

This method returns a list of all 'other' dcop registered kmymoney processes. It's a subset of the return of DCOPclient()->registeredApplications().

Return values:
QCStringList of process ids

void KMyMoney2App::institutionSelected const MyMoneyInstitution institution  )  [signal]
 

This signal is emitted when a new institution has been selected by the GUI. If no institution is selected or the selection is removed, institution is identical to MyMoneyInstitution(). This signal is used by plugins to get information about changes.

void KMyMoney2App::investmentSelected const MyMoneyAccount account  )  [signal]
 

bool KMyMoney2App::isImportableFile const KURL &  url  ) 
 

Returns whether there is an importer available that can handle this file

bool KMyMoney2App::isReady void   )  [private]
 

Check if the status bar contains the 'ready' message. The return value is used e.g. to detect if a quit operation is allowed or not.

Return values:
true application is idle
false application is active working on a longer operation

const KURL KMyMoney2App::lastOpenedURL void   ) 
 

This method returns the last URL used or an empty URL depending on the option setting if the last file should be opened during startup or the open file dialog should be displayed.

Returns:
URL of last opened file or empty if the program should start with the open file dialog

void KMyMoney2App::loadPlugins void   )  [protected]
 

load all available plugins. Make sure you have called createInterfaces() before you call this one.

void KMyMoney2App::markTransaction MyMoneySplit::reconcileFlagE  flag  )  [protected]
 

Mark the selected transactions as provided by flag. If flag is MyMoneySplit::Unknown, the future state depends on the current stat of the split's flag accoring to the following table:

  • NotReconciled --> Cleared
  • Cleared --> Reconciled
  • Reconciled --> NotReconciled

bool KMyMoney2App::okToWriteFile const KURL &  url  ) 
 

Checks if the file with the url already exists. If so, the user is asked if he/she wants to override the file. If the user's answer is negative, false will be returned. true will be returned in all other cases.

void KMyMoney2App::payeeCreated const QCString &  id  )  [signal]
 

bool KMyMoney2App::payeeInList const QValueList< MyMoneyPayee > &  list,
const QCString &  id
const [protected]
 

Check if a list contains a payee with a given id

Parameters:
list const reference to value list
id const reference to id
Return values:
true object has been found
false object is not in list

void KMyMoney2App::payeeRename void   )  [signal]
 

void KMyMoney2App::payeesSelected const QValueList< MyMoneyPayee > &  payees  )  [signal]
 

This signal is emitted when a payee/list of payees has been selected by the GUI. If no payee is selected or the selection is removed, payees is identical to an empty QValueList. This signal is used by plugins to get information about changes.

static void KMyMoney2App::progressCallback int  current,
int  total,
const QString & 
[static]
 

virtual bool KMyMoney2App::queryClose void   )  [protected, virtual]
 

queryClose is called by KTMainWindow on each closeEvent of a window. Against the default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall be saved if Modified; on cancel the closeEvent is rejected.

See also:
KTMainWindow#queryClose

KTMainWindow#closeEvent

virtual bool KMyMoney2App::queryExit void   )  [protected, virtual]
 

queryExit is called by KTMainWindow when the last window of the application is going to be closed during the closeEvent(). Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's properties.

See also:
KTMainWindow#queryExit

KTMainWindow#closeEvent

QString KMyMoney2App::readLastUsedDir void   )  const
 

QString KMyMoney2App::readLastUsedFile void   )  const
 

void KMyMoney2App::readOptions void   )  [protected]
 

read general Options again and initialize all variables like the recent file list

void KMyMoney2App::ready void   )  [private]
 

Load the status bar with the 'ready' message. This is hold in a single place, so that is consistent with isReady().

virtual void KMyMoney2App::resizeEvent QResizeEvent *   )  [protected, virtual]
 

void KMyMoney2App::saveOptions void   )  [protected]
 

save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration file

void KMyMoney2App::scheduleSelected const MyMoneySchedule schedule  )  [signal]
 

This signal is emitted when a new schedule has been selected by the GUI. If no schedule is selected or the selection is removed, schedule is identical to MyMoneySchedule(). This signal is used by plugins to get information about changes.

void KMyMoney2App::selectAllTransactions void   )  [signal]
 

This signal is sent out, when the user presses Ctrl+A or activates the Select all transactions action.

KURL KMyMoney2App::selectFile const QString &  title,
const QString &  path,
const QString &  mask,
KFile::Mode  mode
 

void KMyMoney2App::setAccountOnlineParameters const MyMoneyAccount acc,
const MyMoneyKeyValueContainer kvps
 

This method set the online parameters stored in kvps with the account referenced by acc.