Diffstat (limited to 'noncore/apps/qashmoney/memorydialog.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/memorydialog.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/apps/qashmoney/memorydialog.cpp b/noncore/apps/qashmoney/memorydialog.cpp index e9ebd54..ba11540 100755 --- a/noncore/apps/qashmoney/memorydialog.cpp +++ b/noncore/apps/qashmoney/memorydialog.cpp | |||
@@ -1,86 +1,86 @@ | |||
1 | #include "memorydialog.h" | 1 | #include "memorydialog.h" |
2 | #include "memory.h" | 2 | #include "memory.h" |
3 | #include <qmessagebox.h> | 3 | #include <qmessagebox.h> |
4 | 4 | ||
5 | extern Memory *memory; | 5 | extern Memory *memory; |
6 | 6 | ||
7 | MemoryDialog::MemoryDialog () : QDialog ( 0, 0, TRUE ) | 7 | MemoryDialog::MemoryDialog () : QDialog ( 0, 0, TRUE ) |
8 | { | 8 | { |
9 | setCaption ( tr ( "Edit Memory" ) ); | 9 | setCaption ( tr ( "Edit Memory" ) ); |
10 | 10 | ||
11 | listbox = new QListBox ( this, "listbox" ); | 11 | listbox = new QListBox ( this, "listbox" ); |
12 | memory->displayMemoryItems ( listbox ); | 12 | memory->displayMemoryItems ( listbox ); |
13 | listbox->clearSelection(); | 13 | listbox->clearSelection(); |
14 | 14 | ||
15 | secondline = new QHBox ( this ); | 15 | secondline = new QHBox ( this ); |
16 | 16 | ||
17 | newbutton = new QPushButton ( secondline ); | 17 | newbutton = new QPushButton ( secondline ); |
18 | newbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/new.png") ); | 18 | newbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/new.png") ); |
19 | connect ( newbutton, SIGNAL ( released () ), this, SLOT ( addItem () ) ); | 19 | connect ( newbutton, SIGNAL ( released() ), this, SLOT ( addItem() ) ); |
20 | 20 | ||
21 | editbutton = new QPushButton ( secondline ); | 21 | editbutton = new QPushButton ( secondline ); |
22 | editbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); | 22 | editbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); |
23 | connect ( editbutton, SIGNAL ( released () ), this, SLOT ( editItem () ) ); | 23 | connect ( editbutton, SIGNAL ( released() ), this, SLOT ( editItem() ) ); |
24 | 24 | ||
25 | deletebutton = new QPushButton( secondline ); | 25 | deletebutton = new QPushButton( secondline ); |
26 | deletebutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/delete.png") ); | 26 | deletebutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/delete.png") ); |
27 | connect ( deletebutton, SIGNAL ( released () ), this, SLOT ( deleteItem () ) ); | 27 | connect ( deletebutton, SIGNAL ( released() ), this, SLOT ( deleteItem() ) ); |
28 | 28 | ||
29 | lineedit = new QLineEdit ( this ); | 29 | lineedit = new QLineEdit ( this ); |
30 | 30 | ||
31 | layout = new QVBoxLayout ( this, 2, 2 ); | 31 | layout = new QVBoxLayout ( this, 2, 2 ); |
32 | layout->addWidget ( listbox ); | 32 | layout->addWidget ( listbox ); |
33 | layout->addWidget ( secondline ); | 33 | layout->addWidget ( secondline ); |
34 | layout->addWidget ( lineedit ); | 34 | layout->addWidget ( lineedit ); |
35 | } | 35 | } |
36 | 36 | ||
37 | MemoryDialog::~MemoryDialog() | 37 | MemoryDialog::~MemoryDialog() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | 40 | ||
41 | void MemoryDialog::addItem () | 41 | void MemoryDialog::addItem () |
42 | { | 42 | { |
43 | if ( lineedit->text().length() != 0 ) | 43 | if ( lineedit->text().length() != 0 ) |
44 | { | 44 | { |
45 | memory->addMemoryItem ( lineedit->text() ); | 45 | memory->addMemoryItem ( lineedit->text() ); |
46 | listbox->clear (); | 46 | listbox->clear (); |
47 | memory->displayMemoryItems ( listbox ); | 47 | memory->displayMemoryItems ( listbox ); |
48 | listbox->clearFocus(); | 48 | listbox->clearFocus(); |
49 | listbox->clearSelection (); | 49 | listbox->clearSelection (); |
50 | lineedit->clear(); | 50 | lineedit->clear(); |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | void MemoryDialog::editItem () | 54 | void MemoryDialog::editItem () |
55 | { | 55 | { |
56 | if ( listbox->currentItem() != -1 ) | 56 | if ( listbox->currentItem() != -1 ) |
57 | { | 57 | { |
58 | lineedit->setText ( listbox->currentText() ); | 58 | lineedit->setText ( listbox->currentText() ); |
59 | memory->deleteMemoryItem ( listbox->currentText() ); | 59 | memory->deleteMemoryItem ( listbox->currentText() ); |
60 | listbox->clear (); | 60 | listbox->clear (); |
61 | memory->displayMemoryItems ( listbox ); | 61 | memory->displayMemoryItems ( listbox ); |
62 | listbox->clearSelection(); | 62 | listbox->clearSelection(); |
63 | } | 63 | } |
64 | else | 64 | else |
65 | QMessageBox::warning ( this, "QashMoney", "Please select an item to edit." ); | 65 | QMessageBox::warning ( this, "QashMoney", "Please select an item to edit." ); |
66 | } | 66 | } |
67 | 67 | ||
68 | void MemoryDialog::deleteItem () | 68 | void MemoryDialog::deleteItem () |
69 | { | 69 | { |
70 | if ( listbox->currentItem() != -1 ) | 70 | if ( listbox->currentItem() != -1 ) |
71 | { | 71 | { |
72 | memory->deleteMemoryItem ( listbox->currentText() ); | 72 | memory->deleteMemoryItem ( listbox->currentText() ); |
73 | listbox->clear (); | 73 | listbox->clear (); |
74 | memory->displayMemoryItems ( listbox ); | 74 | memory->displayMemoryItems ( listbox ); |
75 | listbox->clearSelection(); | 75 | listbox->clearSelection(); |
76 | } | 76 | } |
77 | else | 77 | else |
78 | QMessageBox::warning ( this, "QashMoney", "Please select an item to delete." ); | 78 | QMessageBox::warning ( this, "QashMoney", "Please select an item to delete." ); |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | 86 | ||