-rw-r--r-- | noncore/applets/notesapplet/notes.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp index 1142028..9b5e475 100644 --- a/noncore/applets/notesapplet/notes.cpp +++ b/noncore/applets/notesapplet/notes.cpp | |||
@@ -106,52 +106,52 @@ NotesControl::NotesControl( QWidget *, const char * ) | |||
106 | QPEApplication::setStylusOperation( box->viewport(),QPEApplication::RightOnHold); | 106 | QPEApplication::setStylusOperation( box->viewport(),QPEApplication::RightOnHold); |
107 | 107 | ||
108 | box->setFixedHeight(50); | 108 | box->setFixedHeight(50); |
109 | 109 | ||
110 | vbox->setMargin( 6 ); | 110 | vbox->setMargin( 6 ); |
111 | vbox->setSpacing( 3 ); | 111 | vbox->setSpacing( 3 ); |
112 | 112 | ||
113 | 113 | ||
114 | 114 | ||
115 | setFocusPolicy(QWidget::StrongFocus); | 115 | setFocusPolicy(QWidget::StrongFocus); |
116 | 116 | ||
117 | newButton= new QPushButton( hbox, "newButton" ); | 117 | newButton= new QPushButton( hbox, "newButton" ); |
118 | newButton->setText(tr("New")); | 118 | newButton->setText(tr("New")); |
119 | 119 | ||
120 | 120 | ||
121 | saveButton= new QPushButton( hbox, "saveButton" ); | 121 | saveButton= new QPushButton( hbox, "saveButton" ); |
122 | saveButton->setText(tr("Save")); | 122 | saveButton->setText(tr("Save")); |
123 | 123 | ||
124 | 124 | ||
125 | deleteButton= new QPushButton( hbox, "deleteButton" ); | 125 | deleteButton= new QPushButton( hbox, "deleteButton" ); |
126 | deleteButton->setText(tr("Delete")); | 126 | deleteButton->setText(tr("Delete")); |
127 | 127 | ||
128 | 128 | ||
129 | 129 | ||
130 | connect( box, SIGNAL( mouseButtonPressed( int, QListBoxItem *, const QPoint&)), | 130 | connect( box, SIGNAL( mouseButtonPressed(int,QListBoxItem*,const QPoint&)), |
131 | this,SLOT( boxPressed(int, QListBoxItem *, const QPoint&)) ); | 131 | this,SLOT( boxPressed(int,QListBoxItem*,const QPoint&)) ); |
132 | 132 | ||
133 | connect(box, SIGNAL(highlighted(const QString&)), this, SLOT(slotBoxSelected(const QString &))); | 133 | connect(box, SIGNAL(highlighted(const QString&)), this, SLOT(slotBoxSelected(const QString&))); |
134 | 134 | ||
135 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showMenu() ) ); | 135 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showMenu() ) ); |
136 | 136 | ||
137 | connect(view,SIGNAL( textChanged() ), this, SLOT(slotViewEdited() ) ); | 137 | connect(view,SIGNAL( textChanged() ), this, SLOT(slotViewEdited() ) ); |
138 | 138 | ||
139 | connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewButton())); | 139 | connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewButton())); |
140 | connect(saveButton, SIGNAL(clicked()), this, SLOT(slotSaveButton())); | 140 | connect(saveButton, SIGNAL(clicked()), this, SLOT(slotSaveButton())); |
141 | connect(deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButtonClicked())); | 141 | connect(deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButtonClicked())); |
142 | 142 | ||
143 | populateBox(); | 143 | populateBox(); |
144 | load(); | 144 | load(); |
145 | setCaption("Notes"); | 145 | setCaption("Notes"); |
146 | // parent->setFocus(); | 146 | // parent->setFocus(); |
147 | } | 147 | } |
148 | 148 | ||
149 | void NotesControl::slotSaveButton() { | 149 | void NotesControl::slotSaveButton() { |
150 | slotNewButton(); | 150 | slotNewButton(); |
151 | populateBox(); | 151 | populateBox(); |
152 | } | 152 | } |
153 | 153 | ||
154 | void NotesControl::slotDeleteButtonClicked() { | 154 | void NotesControl::slotDeleteButtonClicked() { |
155 | switch ( QMessageBox::warning(this,tr("Delete?") | 155 | switch ( QMessageBox::warning(this,tr("Delete?") |
156 | ,tr("Do you really want to<BR><B> delete</B> this note ?") | 156 | ,tr("Do you really want to<BR><B> delete</B> this note ?") |
157 | ,tr("Yes"),tr("No"),0,1,1) ) { | 157 | ,tr("Yes"),tr("No"),0,1,1) ) { |
@@ -201,49 +201,49 @@ void NotesControl::slotDeleteButton() { | |||
201 | view->clear(); | 201 | view->clear(); |
202 | 202 | ||
203 | populateBox(); | 203 | populateBox(); |
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | void NotesControl::slotNewButton() { | 207 | void NotesControl::slotNewButton() { |
208 | if(edited) save(); | 208 | if(edited) save(); |
209 | view->clear(); | 209 | view->clear(); |
210 | view->setFocus(); | 210 | view->setFocus(); |
211 | edited=false; | 211 | edited=false; |
212 | isNew=false; | 212 | isNew=false; |
213 | } | 213 | } |
214 | 214 | ||
215 | void NotesControl::slotBeamButton() { | 215 | void NotesControl::slotBeamButton() { |
216 | Ir ir; | 216 | Ir ir; |
217 | if(!ir.supported()){ | 217 | if(!ir.supported()){ |
218 | } else { | 218 | } else { |
219 | this->hide(); | 219 | this->hide(); |
220 | QString selectedText = box->currentText(); | 220 | QString selectedText = box->currentText(); |
221 | if( !selectedText.isEmpty()) { | 221 | if( !selectedText.isEmpty()) { |
222 | QString file = QDir::homeDirPath()+"/"+selectedText; | 222 | QString file = QDir::homeDirPath()+"/"+selectedText; |
223 | QFile f(file); | 223 | QFile f(file); |
224 | Ir *irFile = new Ir(this, "IR"); | 224 | Ir *irFile = new Ir(this, "IR"); |
225 | connect( irFile, SIGNAL(done(Ir*)), this, SLOT( slotBeamFinished( Ir * ))); | 225 | connect( irFile, SIGNAL(done(Ir*)), this, SLOT( slotBeamFinished(Ir*))); |
226 | irFile->send( file, "Note", "text/plain" ); | 226 | irFile->send( file, "Note", "text/plain" ); |
227 | } | 227 | } |
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
231 | void NotesControl::slotBeamFinished(Ir *) { | 231 | void NotesControl::slotBeamFinished(Ir *) { |
232 | this->show(); | 232 | this->show(); |
233 | } | 233 | } |
234 | 234 | ||
235 | void NotesControl::boxPressed(int mouse, QListBoxItem *, const QPoint&) { | 235 | void NotesControl::boxPressed(int mouse, QListBoxItem *, const QPoint&) { |
236 | switch (mouse) { | 236 | switch (mouse) { |
237 | case 1:{ | 237 | case 1:{ |
238 | } | 238 | } |
239 | break; | 239 | break; |
240 | case 2: | 240 | case 2: |
241 | menuTimer.start( 500, TRUE ); | 241 | menuTimer.start( 500, TRUE ); |
242 | break; | 242 | break; |
243 | }; | 243 | }; |
244 | } | 244 | } |
245 | 245 | ||
246 | void NotesControl::slotBoxSelected(const QString &itemString) { | 246 | void NotesControl::slotBoxSelected(const QString &itemString) { |
247 | if(edited) { | 247 | if(edited) { |
248 | save(); | 248 | save(); |
249 | } | 249 | } |