author | drw <drw> | 2002-10-26 18:23:34 (UTC) |
---|---|---|
committer | drw <drw> | 2002-10-26 18:23:34 (UTC) |
commit | 3dc25703dbf961f86bc25378113ffafb18ee192e (patch) (side-by-side diff) | |
tree | 75436ace2b4c524ea29de5cbd8ac6cbbbcf7ec4e | |
parent | ec58c37763a97306543a3f18052d37291b1cdf83 (diff) | |
download | opie-3dc25703dbf961f86bc25378113ffafb18ee192e.zip opie-3dc25703dbf961f86bc25378113ffafb18ee192e.tar.gz opie-3dc25703dbf961f86bc25378113ffafb18ee192e.tar.bz2 |
Whats This and a couple fixes
-rw-r--r-- | noncore/apps/checkbook/checkbook.cpp | 26 | ||||
-rw-r--r-- | noncore/apps/checkbook/mainwindow.cpp | 59 | ||||
-rw-r--r-- | noncore/apps/checkbook/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/apps/checkbook/transaction.cpp | 23 |
4 files changed, 74 insertions, 36 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp index 2919927..ee65784 100644 --- a/noncore/apps/checkbook/checkbook.cpp +++ b/noncore/apps/checkbook/checkbook.cpp @@ -45,2 +45,3 @@ #include <qpushbutton.h> +#include <qwhatsthis.h> #include <qwidget.h> @@ -48,3 +49,3 @@ Checkbook::Checkbook( QWidget *parent, const QString &n, const QString &fd, char symbol ) - : QDialog( parent, 0, TRUE, 0 ) + : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) { @@ -112,4 +113,6 @@ QWidget *Checkbook::initInfo() QLabel *label = new QLabel( tr( "Name:" ), container ); + QWhatsThis::add( label, tr( "Enter name of checkbook here." ) ); layout->addWidget( label, 0, 0 ); nameEdit = new QLineEdit( container ); + QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); connect( nameEdit, SIGNAL( textChanged( const QString & ) ), @@ -120,4 +123,6 @@ QWidget *Checkbook::initInfo() label = new QLabel( tr( "Type:" ), container ); + QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); layout->addWidget( label, 1, 0 ); typeList = new QComboBox( container ); + QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) ); typeList->insertItem( tr( "Savings" ) ); // 0 @@ -132,4 +137,6 @@ QWidget *Checkbook::initInfo() label = new QLabel( tr( "Bank:" ), container ); + QWhatsThis::add( label, tr( "Enter name of the bank for this checkbook here." ) ); layout->addWidget( label, 2, 0 ); bankEdit = new QLineEdit( container ); + QWhatsThis::add( bankEdit, tr( "Enter name of the bank for this checkbook here." ) ); layout->addWidget( bankEdit, 2, 1 ); @@ -138,4 +145,6 @@ QWidget *Checkbook::initInfo() label = new QLabel( tr( "Account number:" ), container ); + QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) ); layout->addWidget( label, 3, 0 ); acctNumEdit = new QLineEdit( container ); + QWhatsThis::add( acctNumEdit, tr( "Enter account number for this checkbook here." ) ); layout->addWidget( acctNumEdit, 3, 1 ); @@ -144,4 +153,6 @@ QWidget *Checkbook::initInfo() label = new QLabel( tr( "PIN number:" ), container ); + QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) ); layout->addWidget( label, 4, 0 ); pinNumEdit = new QLineEdit( container ); + QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) ); layout->addWidget( pinNumEdit, 4, 1 ); @@ -150,4 +161,6 @@ QWidget *Checkbook::initInfo() label = new QLabel( tr( "Starting balance:" ), container ); + QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) ); layout->addWidget( label, 5, 0 ); balanceEdit = new QLineEdit( container ); + QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) ); connect( balanceEdit, SIGNAL( textChanged( const QString & ) ), @@ -158,4 +171,6 @@ QWidget *Checkbook::initInfo() label = new QLabel( tr( "Notes:" ), container ); + QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) ); layout->addWidget( label, 6, 0 ); notesEdit = new QMultiLineEdit( container ); + QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) ); notesEdit->setMaximumHeight( 85 ); @@ -176,2 +191,3 @@ QWidget *Checkbook::initTransactions() control ); + QWhatsThis::add( balanceLabel, tr( "This area shows the current balance in this checkbook." ) ); layout->addMultiCellWidget( balanceLabel, 0, 0, 0, 2 ); @@ -179,2 +195,3 @@ QWidget *Checkbook::initTransactions() tranTable = new QListView( control ); + QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) ); tranTable->addColumn( tr( "ID" ) ); @@ -191,2 +208,3 @@ QWidget *Checkbook::initTransactions() QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); + QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); @@ -195,2 +213,3 @@ QWidget *Checkbook::initTransactions() btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); + QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); @@ -198,3 +217,4 @@ QWidget *Checkbook::initTransactions() - btn = new QPushButton( Resource::loadPixmap( "editdelete" ), tr( "Delete" ), control ); + btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control ); + QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) ); connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) ); @@ -225,2 +245,3 @@ QWidget *Checkbook::initCharts() QWidget *graphWidget = new QWidget( control ); + QWhatsThis::add( graphWidget, tr( "Graph not implemented yet." ) ); layout->addMultiCellWidget( graphWidget, 0, 0, 0, 1 ); @@ -229,2 +250,3 @@ QWidget *Checkbook::initCharts() QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Draw" ), control ); + QWhatsThis::add( btn, tr( "Click here to draw the graph." ) ); connect( btn, SIGNAL( clicked() ), this, SLOT( slotDrawGraph() ) ); diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp index 9410536..ead17b4 100644 --- a/noncore/apps/checkbook/mainwindow.cpp +++ b/noncore/apps/checkbook/mainwindow.cpp @@ -43,5 +43,6 @@ #include <qstring.h> +#include <qwhatsthis.h> MainWindow::MainWindow() - : QMainWindow() + : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) { @@ -61,9 +62,4 @@ MainWindow::MainWindow() bar = new QPEToolBar( this ); - actionOpen = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, - 0, this, 0 ); - connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotOpen() ) ); - actionOpen->addTo( popup ); - actionOpen->addTo( bar ); - QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); + a->setWhatsThis( tr( "Click here to create a new checkbook.\n\nYou also can select New from the Checkbook menu." ) ); connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) ); @@ -72,4 +68,12 @@ MainWindow::MainWindow() - actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "editdelete" ), QString::null, + actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, + 0, this, 0 ); + actionOpen->setWhatsThis( tr( "Select a checkbook and then click here to edit it.\n\nYou also can select Edit from the Checkbook menu, or click and hold on a checkbook name." ) ); + connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) ); + actionOpen->addTo( popup ); + actionOpen->addTo( bar ); + + actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 0, this, 0 ); + actionDelete->setWhatsThis( tr( "Select a checkbook and then click here delete it.\n\nYou also can select Delete from the Checkbook menu." ) ); connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) ); @@ -78,8 +82,2 @@ MainWindow::MainWindow() - popup->insertSeparator(); - - a = new QAction( tr( "Exit" ), QString::null, 0, this, 0 ); - connect( a, SIGNAL( activated() ), this, SLOT( close() ) ); - a->addTo( popup ); - mb->insertItem( tr( "Checkbook" ), popup ); @@ -88,5 +86,6 @@ MainWindow::MainWindow() cbList = new QListBox( this ); + QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) ); QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold ); connect( cbList, SIGNAL( rightButtonPressed( QListBoxItem *, const QPoint & ) ), - this, SLOT( slotOpen() ) ); + this, SLOT( slotEdit() ) ); setCentralWidget( cbList ); @@ -115,3 +114,15 @@ MainWindow::~MainWindow() -void MainWindow::slotOpen() +void MainWindow::slotNew() +{ + Checkbook *currcb = new Checkbook( this, "", cbDir, currencySymbol ); + currcb->showMaximized(); + if ( currcb->exec() == QDialog::Accepted ) + { + cbList->insertItem( currcb->getName() ); + cbList->sort(); + delete currcb; + } +} + +void MainWindow::slotEdit() { @@ -138,14 +149,2 @@ void MainWindow::slotOpen() -void MainWindow::slotNew() -{ - Checkbook *currcb = new Checkbook( this, "", cbDir, currencySymbol ); - currcb->showMaximized(); - if ( currcb->exec() == QDialog::Accepted ) - { - cbList->insertItem( currcb->getName() ); - cbList->sort(); - delete currcb; - } -} - void MainWindow::slotDelete() @@ -154,4 +153,2 @@ void MainWindow::slotDelete() { - cbList->removeItem( cbList->currentItem() ); - QString name = cbDir + cbList->currentText() + ".qcb"; @@ -162,2 +159,4 @@ void MainWindow::slotDelete() } + + cbList->removeItem( cbList->currentItem() ); } diff --git a/noncore/apps/checkbook/mainwindow.h b/noncore/apps/checkbook/mainwindow.h index 54fbba6..2c5d93b 100644 --- a/noncore/apps/checkbook/mainwindow.h +++ b/noncore/apps/checkbook/mainwindow.h @@ -54,4 +54,4 @@ class MainWindow : public QMainWindow private slots: - void slotOpen(); void slotNew(); + void slotEdit(); void slotDelete(); diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp index 7d1781b..82baec9 100644 --- a/noncore/apps/checkbook/transaction.cpp +++ b/noncore/apps/checkbook/transaction.cpp @@ -45,4 +45,3 @@ #include <qstring.h> - -#include <stdio.h> +#include <qwhatsthis.h> @@ -50,3 +49,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in char symbol ) - : QDialog( parent, 0, TRUE, 0 ) + : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) { @@ -81,2 +80,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); + QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); layout2->addWidget( withBtn, 0, 0 ); @@ -84,2 +84,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); + QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); layout2->addWidget( depBtn, 0, 1 ); @@ -91,2 +92,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in QLabel *label = new QLabel( tr( "Date:" ), container ); + QWhatsThis::add( label, tr( "Select date of transaction here." ) ); layout->addWidget( label, 1, 0 ); @@ -94,2 +96,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in container ); + QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) ); QPopupMenu *m1 = new QPopupMenu( container ); @@ -104,4 +107,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in label = new QLabel( tr( "Number:" ), container ); + QWhatsThis::add( label, tr( "Enter check number here." ) ); layout->addWidget( label, 1, 2 ); numEdit = new QLineEdit( container ); + QWhatsThis::add( numEdit, tr( "Enter check number here." ) ); numEdit->setMaximumWidth( 40 ); @@ -111,4 +116,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in label = new QLabel( tr( "Description:" ), container ); + QWhatsThis::add( label, tr( "Enter description of transaction here." ) ); layout->addWidget( label, 2, 0 ); descEdit = new QLineEdit( container ); + QWhatsThis::add( descEdit, tr( "Enter description of transaction here." ) ); layout->addMultiCellWidget( descEdit, 2, 2, 1, 3 ); @@ -117,4 +124,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in label = new QLabel( tr( "Category:" ), container ); + QWhatsThis::add( label, tr( "Select transaction category here." ) ); layout->addWidget( label, 3, 0 ); catList = new QComboBox( container ); + QWhatsThis::add( catList, tr( "Select transaction category here." ) ); layout->addMultiCellWidget( catList, 3, 3, 1, 3 ); @@ -123,4 +132,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in label = new QLabel( tr( "Type:" ), container ); + QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); layout->addWidget( label, 4, 0 ); typeList = new QComboBox( container ); + QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); layout->addMultiCellWidget( typeList, 4, 4, 1, 3 ); @@ -129,4 +140,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in label = new QLabel( tr( "Amount:" ), container ); + QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); layout->addWidget( label, 5, 0 ); amtEdit = new QLineEdit( container ); + QWhatsThis::add( amtEdit, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 ); @@ -135,4 +148,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in label = new QLabel( tr( "Fee:" ), container ); + QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); layout->addWidget( label, 6, 0 ); feeEdit = new QLineEdit( container ); + QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 ); @@ -141,4 +156,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in label = new QLabel( tr( "Notes:" ), container ); + QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) ); layout->addWidget( label, 7, 0 ); noteEdit = new QMultiLineEdit( container ); + QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) ); layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 ); |