author | drw <drw> | 2002-10-26 18:23:34 (UTC) |
---|---|---|
committer | drw <drw> | 2002-10-26 18:23:34 (UTC) |
commit | 3dc25703dbf961f86bc25378113ffafb18ee192e (patch) (unidiff) | |
tree | 75436ace2b4c524ea29de5cbd8ac6cbbbcf7ec4e /noncore/apps/checkbook/mainwindow.cpp | |
parent | ec58c37763a97306543a3f18052d37291b1cdf83 (diff) | |
download | opie-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.cpp | 59 |
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 @@ | |||
43 | #include <qstring.h> | 43 | #include <qstring.h> |
44 | #include <qwhatsthis.h> | ||
44 | 45 | ||
45 | MainWindow::MainWindow() | 46 | MainWindow::MainWindow() |
46 | : QMainWindow() | 47 | : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) |
47 | { | 48 | { |
@@ -61,9 +62,4 @@ MainWindow::MainWindow() | |||
61 | bar = new QPEToolBar( this ); | 62 | bar = new QPEToolBar( this ); |
62 | actionOpen = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, | ||
63 | 0, this, 0 ); | ||
64 | connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotOpen() ) ); | ||
65 | actionOpen->addTo( popup ); | ||
66 | actionOpen->addTo( bar ); | ||
67 | |||
68 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); | 63 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); |
64 | a->setWhatsThis( tr( "Click here to create a new checkbook.\n\nYou also can select New from the Checkbook menu." ) ); | ||
69 | connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) ); | 65 | connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) ); |
@@ -72,4 +68,12 @@ MainWindow::MainWindow() | |||
72 | 68 | ||
73 | actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "editdelete" ), QString::null, | 69 | actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, |
70 | 0, this, 0 ); | ||
71 | 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." ) ); | ||
72 | connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) ); | ||
73 | actionOpen->addTo( popup ); | ||
74 | actionOpen->addTo( bar ); | ||
75 | |||
76 | actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, | ||
74 | 0, this, 0 ); | 77 | 0, this, 0 ); |
78 | actionDelete->setWhatsThis( tr( "Select a checkbook and then click here delete it.\n\nYou also can select Delete from the Checkbook menu." ) ); | ||
75 | connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) ); | 79 | connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) ); |
@@ -78,8 +82,2 @@ MainWindow::MainWindow() | |||
78 | 82 | ||
79 | popup->insertSeparator(); | ||
80 | |||
81 | a = new QAction( tr( "Exit" ), QString::null, 0, this, 0 ); | ||
82 | connect( a, SIGNAL( activated() ), this, SLOT( close() ) ); | ||
83 | a->addTo( popup ); | ||
84 | |||
85 | mb->insertItem( tr( "Checkbook" ), popup ); | 83 | mb->insertItem( tr( "Checkbook" ), popup ); |
@@ -88,5 +86,6 @@ MainWindow::MainWindow() | |||
88 | cbList = new QListBox( this ); | 86 | cbList = new QListBox( this ); |
87 | QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) ); | ||
89 | QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold ); | 88 | QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold ); |
90 | connect( cbList, SIGNAL( rightButtonPressed( QListBoxItem *, const QPoint & ) ), | 89 | connect( cbList, SIGNAL( rightButtonPressed( QListBoxItem *, const QPoint & ) ), |
91 | this, SLOT( slotOpen() ) ); | 90 | this, SLOT( slotEdit() ) ); |
92 | setCentralWidget( cbList ); | 91 | setCentralWidget( cbList ); |
@@ -115,3 +114,15 @@ MainWindow::~MainWindow() | |||
115 | 114 | ||
116 | void MainWindow::slotOpen() | 115 | void MainWindow::slotNew() |
116 | { | ||
117 | Checkbook *currcb = new Checkbook( this, "", cbDir, currencySymbol ); | ||
118 | currcb->showMaximized(); | ||
119 | if ( currcb->exec() == QDialog::Accepted ) | ||
120 | { | ||
121 | cbList->insertItem( currcb->getName() ); | ||
122 | cbList->sort(); | ||
123 | delete currcb; | ||
124 | } | ||
125 | } | ||
126 | |||
127 | void MainWindow::slotEdit() | ||
117 | { | 128 | { |
@@ -138,14 +149,2 @@ void MainWindow::slotOpen() | |||
138 | 149 | ||
139 | void MainWindow::slotNew() | ||
140 | { | ||
141 | Checkbook *currcb = new Checkbook( this, "", cbDir, currencySymbol ); | ||
142 | currcb->showMaximized(); | ||
143 | if ( currcb->exec() == QDialog::Accepted ) | ||
144 | { | ||
145 | cbList->insertItem( currcb->getName() ); | ||
146 | cbList->sort(); | ||
147 | delete currcb; | ||
148 | } | ||
149 | } | ||
150 | |||
151 | void MainWindow::slotDelete() | 150 | void MainWindow::slotDelete() |
@@ -154,4 +153,2 @@ void MainWindow::slotDelete() | |||
154 | { | 153 | { |
155 | cbList->removeItem( cbList->currentItem() ); | ||
156 | |||
157 | QString name = cbDir + cbList->currentText() + ".qcb"; | 154 | QString name = cbDir + cbList->currentText() + ".qcb"; |
@@ -162,2 +159,4 @@ void MainWindow::slotDelete() | |||
162 | } | 159 | } |
160 | |||
161 | cbList->removeItem( cbList->currentItem() ); | ||
163 | } | 162 | } |