summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/mainwindow.cpp
authordrw <drw>2002-10-26 18:23:34 (UTC)
committer drw <drw>2002-10-26 18:23:34 (UTC)
commit3dc25703dbf961f86bc25378113ffafb18ee192e (patch) (side-by-side diff)
tree75436ace2b4c524ea29de5cbd8ac6cbbbcf7ec4e /noncore/apps/checkbook/mainwindow.cpp
parentec58c37763a97306543a3f18052d37291b1cdf83 (diff)
downloadopie-3dc25703dbf961f86bc25378113ffafb18ee192e.zip
opie-3dc25703dbf961f86bc25378113ffafb18ee192e.tar.gz
opie-3dc25703dbf961f86bc25378113ffafb18ee192e.tar.bz2
Whats This and a couple fixes
Diffstat (limited to 'noncore/apps/checkbook/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp59
1 files changed, 29 insertions, 30 deletions
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() );
}