-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index d47a570..07e581a 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp | |||
@@ -155,257 +155,257 @@ void MainWindow::documentOpen(const DocLnk &lnkDoc) | |||
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | int MainWindow::saveCurrentFile(bool ask) | 158 | int MainWindow::saveCurrentFile(bool ask) |
159 | { | 159 | { |
160 | if (ask) | 160 | if (ask) |
161 | { | 161 | { |
162 | int result=QMessageBox::information(this, tr("Save File"), tr("Do you want to save the current file?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel); | 162 | int result=QMessageBox::information(this, tr("Save File"), tr("Do you want to save the current file?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel); |
163 | if (result!=QMessageBox::Yes) return result; | 163 | if (result!=QMessageBox::Yes) return result; |
164 | } | 164 | } |
165 | 165 | ||
166 | if (!currentDoc->isValid()) | 166 | if (!currentDoc->isValid()) |
167 | { | 167 | { |
168 | TextDialog dialogText(this); | 168 | TextDialog dialogText(this); |
169 | if (dialogText.exec(tr("Save File"), tr("&File Name:"), tr("UnnamedFile"))!=QDialog::Accepted || dialogText.getValue().isEmpty()) return QMessageBox::Cancel; | 169 | if (dialogText.exec(tr("Save File"), tr("&File Name:"), tr("UnnamedFile"))!=QDialog::Accepted || dialogText.getValue().isEmpty()) return QMessageBox::Cancel; |
170 | 170 | ||
171 | currentDoc->setName(dialogText.getValue()); | 171 | currentDoc->setName(dialogText.getValue()); |
172 | currentDoc->setFile(QString::null); | 172 | currentDoc->setFile(QString::null); |
173 | currentDoc->setLinkFile(QString::null); | 173 | currentDoc->setLinkFile(QString::null); |
174 | } | 174 | } |
175 | 175 | ||
176 | documentSave(currentDoc); | 176 | documentSave(currentDoc); |
177 | return QMessageBox::Yes; | 177 | return QMessageBox::Yes; |
178 | } | 178 | } |
179 | 179 | ||
180 | void MainWindow::selectorFileNew(const DocLnk &lnkDoc) | 180 | void MainWindow::selectorFileNew(const DocLnk &lnkDoc) |
181 | { | 181 | { |
182 | selectorHide(); | 182 | selectorHide(); |
183 | 183 | ||
184 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; | 184 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; |
185 | if (currentDoc) delete currentDoc; | 185 | if (currentDoc) delete currentDoc; |
186 | currentDoc = new DocLnk(lnkDoc); | 186 | currentDoc = new DocLnk(lnkDoc); |
187 | editData->clear(); | 187 | editData->clear(); |
188 | listSheets.clear(); | 188 | listSheets.clear(); |
189 | comboSheets->clear(); | 189 | comboSheets->clear(); |
190 | 190 | ||
191 | typeSheet *newSheet=createNewSheet(); | 191 | typeSheet *newSheet=createNewSheet(); |
192 | newSheet->data.setAutoDelete(TRUE); | 192 | newSheet->data.setAutoDelete(TRUE); |
193 | sheet->setName(newSheet->name); | 193 | sheet->setName(newSheet->name); |
194 | sheet->setSheetData(&newSheet->data); | 194 | sheet->setSheetData(&newSheet->data); |
195 | for (int i=1; i<DEFAULT_NUM_SHEETS; ++i) | 195 | for (int i=1; i<DEFAULT_NUM_SHEETS; ++i) |
196 | createNewSheet(); | 196 | createNewSheet(); |
197 | documentModified=FALSE; | 197 | documentModified=FALSE; |
198 | } | 198 | } |
199 | 199 | ||
200 | void MainWindow::closeEvent(QCloseEvent *e) | 200 | void MainWindow::closeEvent(QCloseEvent *e) |
201 | { | 201 | { |
202 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) e->ignore(); | 202 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) e->ignore(); |
203 | else e->accept(); | 203 | else e->accept(); |
204 | } | 204 | } |
205 | 205 | ||
206 | void MainWindow::selectorFileOpen(const DocLnk &lnkDoc) | 206 | void MainWindow::selectorFileOpen(const DocLnk &lnkDoc) |
207 | { | 207 | { |
208 | selectorHide(); | 208 | selectorHide(); |
209 | 209 | ||
210 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; | 210 | if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return; |
211 | if (currentDoc) delete currentDoc; | 211 | if (currentDoc) delete currentDoc; |
212 | currentDoc = new DocLnk(); | 212 | currentDoc = new DocLnk(); |
213 | listSheets.clear(); | 213 | listSheets.clear(); |
214 | comboSheets->clear(); | 214 | comboSheets->clear(); |
215 | 215 | ||
216 | documentOpen(lnkDoc); | 216 | documentOpen(lnkDoc); |
217 | documentModified=FALSE; | 217 | documentModified=FALSE; |
218 | } | 218 | } |
219 | 219 | ||
220 | void MainWindow::selectorShow() | 220 | void MainWindow::selectorShow() |
221 | { | 221 | { |
222 | sheet->hide(); | 222 | sheet->hide(); |
223 | setCentralWidget(fileSelector); | 223 | setCentralWidget(fileSelector); |
224 | fileSelector->show(); | 224 | fileSelector->show(); |
225 | fileSelector->reread(); | 225 | fileSelector->reread(); |
226 | } | 226 | } |
227 | 227 | ||
228 | void MainWindow::selectorHide() | 228 | void MainWindow::selectorHide() |
229 | { | 229 | { |
230 | fileSelector->hide(); | 230 | fileSelector->hide(); |
231 | setCentralWidget(sheet); | 231 | setCentralWidget(sheet); |
232 | sheet->show(); | 232 | sheet->show(); |
233 | } | 233 | } |
234 | 234 | ||
235 | void MainWindow::slotFileNew() | 235 | void MainWindow::slotFileNew() |
236 | { | 236 | { |
237 | selectorFileNew(DocLnk()); | 237 | selectorFileNew(DocLnk()); |
238 | } | 238 | } |
239 | 239 | ||
240 | void MainWindow::slotFileOpen() | 240 | void MainWindow::slotFileOpen() |
241 | { | 241 | { |
242 | selectorShow(); | 242 | selectorShow(); |
243 | } | 243 | } |
244 | 244 | ||
245 | void MainWindow::slotImportExcelOpen() | 245 | void MainWindow::slotImportExcelOpen() |
246 | { | 246 | { |
247 | sheet->hide(); | 247 | sheet->hide(); |
248 | setCentralWidget(ExcelSelector); | 248 | setCentralWidget(ExcelSelector); |
249 | ExcelSelector->show(); | 249 | ExcelSelector->show(); |
250 | ExcelSelector->reread(); | 250 | ExcelSelector->reread(); |
251 | } | 251 | } |
252 | 252 | ||
253 | void MainWindow::ExcelSelectorHide() | 253 | void MainWindow::ExcelSelectorHide() |
254 | { | 254 | { |
255 | ExcelSelector->hide(); | 255 | ExcelSelector->hide(); |
256 | setCentralWidget(sheet); | 256 | setCentralWidget(sheet); |
257 | sheet->show(); | 257 | sheet->show(); |
258 | } | 258 | } |
259 | 259 | ||
260 | void MainWindow::slotFileSave() | 260 | void MainWindow::slotFileSave() |
261 | { | 261 | { |
262 | saveCurrentFile(FALSE); | 262 | saveCurrentFile(FALSE); |
263 | } | 263 | } |
264 | 264 | ||
265 | void MainWindow::setDocument(const QString &applnk_filename) | 265 | void MainWindow::setDocument(const QString &applnk_filename) |
266 | { | 266 | { |
267 | selectorFileOpen(DocLnk(applnk_filename)); | 267 | selectorFileOpen(DocLnk(applnk_filename)); |
268 | } | 268 | } |
269 | 269 | ||
270 | void MainWindow::initActions() | 270 | void MainWindow::initActions() |
271 | { | 271 | { |
272 | fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this); | 272 | fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this); |
273 | connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); | 273 | connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); |
274 | fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this); | 274 | fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this); |
275 | connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); | 275 | connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); |
276 | fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this); | 276 | fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this); |
277 | connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); | 277 | connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); |
278 | fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this); | 278 | fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this); |
279 | connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); | 279 | connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); |
280 | 280 | ||
281 | //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); | 281 | //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); |
282 | //connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); | 282 | //connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); |
283 | fileExcelImport=new QAction(tr("Import Excel file"),Resource::loadPixmap( "/opie-sheet/excel16" ),tr("Import E&xcel file"),0,this); | 283 | fileExcelImport=new QAction(tr("Import Excel file"),Resource::loadPixmap( "opie-sheet/excel16" ),tr("Import E&xcel file"),0,this); |
284 | connect(fileExcelImport, SIGNAL(activated()), this, SLOT(slotImportExcelOpen())); | 284 | connect(fileExcelImport, SIGNAL(activated()), this, SLOT(slotImportExcelOpen())); |
285 | 285 | ||
286 | // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); | 286 | // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); |
287 | //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); | 287 | //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); |
288 | //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); | 288 | //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); |
289 | //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); | 289 | //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); |
290 | 290 | ||
291 | editAccept=new QAction(tr("Accept"),Resource::loadPixmap( "enter" ) , tr("&Accept"), 0, this); | 291 | editAccept=new QAction(tr("Accept"),Resource::loadPixmap( "enter" ) , tr("&Accept"), 0, this); |
292 | connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept())); | 292 | connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept())); |
293 | editCancel=new QAction(tr("Cancel"), Resource::loadPixmap( "close" ), tr("&Cancel"), 0, this); | 293 | editCancel=new QAction(tr("Cancel"), Resource::loadPixmap( "close" ), tr("&Cancel"), 0, this); |
294 | connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel())); | 294 | connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel())); |
295 | editCellSelect=new QAction(tr("Cell Selector"), Resource::loadPixmap( "opie-sheet/cell_select" ), tr("Cell &Selector"), 0, this); | 295 | editCellSelect=new QAction(tr("Cell Selector"), Resource::loadPixmap( "opie-sheet/cell_select" ), tr("Cell &Selector"), 0, this); |
296 | editCellSelect->setToggleAction(TRUE); | 296 | editCellSelect->setToggleAction(TRUE); |
297 | connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool))); | 297 | connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool))); |
298 | editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this); | 298 | editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this); |
299 | editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this); | 299 | editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this); |
300 | editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this); | 300 | editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this); |
301 | connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste())); | 301 | connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste())); |
302 | editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this); | 302 | editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this); |
303 | connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents())); | 303 | connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents())); |
304 | editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this); | 304 | editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this); |
305 | 305 | ||
306 | insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this); | 306 | insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this); |
307 | connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells())); | 307 | connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells())); |
308 | insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this); | 308 | insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this); |
309 | connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows())); | 309 | connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows())); |
310 | insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this); | 310 | insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this); |
311 | connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols())); | 311 | connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols())); |
312 | insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this); | 312 | insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this); |
313 | connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets())); | 313 | connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets())); |
314 | 314 | ||
315 | formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this); | 315 | formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this); |
316 | connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells())); | 316 | connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells())); |
317 | 317 | ||
318 | rowHeight=new QAction(tr("Row Height"), tr("H&eight"), 0, this); | 318 | rowHeight=new QAction(tr("Row Height"), tr("H&eight"), 0, this); |
319 | connect(rowHeight, SIGNAL(activated()), this, SLOT(slotRowHeight())); | 319 | connect(rowHeight, SIGNAL(activated()), this, SLOT(slotRowHeight())); |
320 | rowAdjust=new QAction(tr("Adjust Row"), tr("&Adjust"), 0, this); | 320 | rowAdjust=new QAction(tr("Adjust Row"), tr("&Adjust"), 0, this); |
321 | connect(rowAdjust, SIGNAL(activated()), this, SLOT(slotRowAdjust())); | 321 | connect(rowAdjust, SIGNAL(activated()), this, SLOT(slotRowAdjust())); |
322 | rowShow=new QAction(tr("Show Row"), tr("&Show"), 0, this); | 322 | rowShow=new QAction(tr("Show Row"), tr("&Show"), 0, this); |
323 | connect(rowShow, SIGNAL(activated()), this, SLOT(slotRowShow())); | 323 | connect(rowShow, SIGNAL(activated()), this, SLOT(slotRowShow())); |
324 | rowHide=new QAction(tr("Hide Row"), tr("&Hide"), 0, this); | 324 | rowHide=new QAction(tr("Hide Row"), tr("&Hide"), 0, this); |
325 | connect(rowHide, SIGNAL(activated()), this, SLOT(slotRowHide())); | 325 | connect(rowHide, SIGNAL(activated()), this, SLOT(slotRowHide())); |
326 | 326 | ||
327 | colWidth=new QAction(tr("Column Width"), tr("&Width"), 0, this); | 327 | colWidth=new QAction(tr("Column Width"), tr("&Width"), 0, this); |
328 | connect(colWidth, SIGNAL(activated()), this, SLOT(slotColumnWidth())); | 328 | connect(colWidth, SIGNAL(activated()), this, SLOT(slotColumnWidth())); |
329 | colAdjust=new QAction(tr("Adjust Column"), tr("&Adjust"), 0, this); | 329 | colAdjust=new QAction(tr("Adjust Column"), tr("&Adjust"), 0, this); |
330 | connect(colAdjust, SIGNAL(activated()), this, SLOT(slotColumnAdjust())); | 330 | connect(colAdjust, SIGNAL(activated()), this, SLOT(slotColumnAdjust())); |
331 | colShow=new QAction(tr("Show Column"), tr("&Show"), 0, this); | 331 | colShow=new QAction(tr("Show Column"), tr("&Show"), 0, this); |
332 | connect(colShow, SIGNAL(activated()), this, SLOT(slotColumnShow())); | 332 | connect(colShow, SIGNAL(activated()), this, SLOT(slotColumnShow())); |
333 | colHide=new QAction(tr("Hide Column"), tr("&Hide"), 0, this); | 333 | colHide=new QAction(tr("Hide Column"), tr("&Hide"), 0, this); |
334 | connect(colHide, SIGNAL(activated()), this, SLOT(slotColumnHide())); | 334 | connect(colHide, SIGNAL(activated()), this, SLOT(slotColumnHide())); |
335 | 335 | ||
336 | sheetRename=new QAction(tr("Rename Sheet"), tr("&Rename"), 0, this); | 336 | sheetRename=new QAction(tr("Rename Sheet"), tr("&Rename"), 0, this); |
337 | connect(sheetRename, SIGNAL(activated()), this, SLOT(slotSheetRename())); | 337 | connect(sheetRename, SIGNAL(activated()), this, SLOT(slotSheetRename())); |
338 | sheetRemove=new QAction(tr("Remove Sheet"), tr("R&emove"), 0, this); | 338 | sheetRemove=new QAction(tr("Remove Sheet"), tr("R&emove"), 0, this); |
339 | connect(sheetRemove, SIGNAL(activated()), this, SLOT(slotSheetRemove())); | 339 | connect(sheetRemove, SIGNAL(activated()), this, SLOT(slotSheetRemove())); |
340 | 340 | ||
341 | dataSort=new QAction(tr("Sort Data"), tr("&Sort"), 0, this); | 341 | dataSort=new QAction(tr("Sort Data"), tr("&Sort"), 0, this); |
342 | connect(dataSort, SIGNAL(activated()), this, SLOT(slotDataSort())); | 342 | connect(dataSort, SIGNAL(activated()), this, SLOT(slotDataSort())); |
343 | dataFindReplace=new QAction(tr("Find && Replace"), tr("&Find && Replace"), 0, this); | 343 | dataFindReplace=new QAction(tr("Find && Replace"), tr("&Find && Replace"), 0, this); |
344 | connect(dataFindReplace, SIGNAL(activated()), this, SLOT(slotDataFindReplace())); | 344 | connect(dataFindReplace, SIGNAL(activated()), this, SLOT(slotDataFindReplace())); |
345 | 345 | ||
346 | funcEqual=new QAction(tr("Equal To"), Resource::loadPixmap( "opie-sheet/func_equal" ), tr("&Equal To"), 0, this); | 346 | funcEqual=new QAction(tr("Equal To"), Resource::loadPixmap( "opie-sheet/func_equal" ), tr("&Equal To"), 0, this); |
347 | funcEqual->setToolTip("="); | 347 | funcEqual->setToolTip("="); |
348 | connect(funcEqual, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 348 | connect(funcEqual, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
349 | funcPlus=new QAction(tr("Addition"), Resource::loadPixmap( "opie-sheet/func_plus" ), tr("&Addition"), 0, this); | 349 | funcPlus=new QAction(tr("Addition"), Resource::loadPixmap( "opie-sheet/func_plus" ), tr("&Addition"), 0, this); |
350 | funcPlus->setToolTip("+"); | 350 | funcPlus->setToolTip("+"); |
351 | connect(funcPlus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 351 | connect(funcPlus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
352 | funcMinus=new QAction(tr("Subtraction"), Resource::loadPixmap( "opie-sheet/func_minus" ), tr("&Subtraction"), 0, this); | 352 | funcMinus=new QAction(tr("Subtraction"), Resource::loadPixmap( "opie-sheet/func_minus" ), tr("&Subtraction"), 0, this); |
353 | funcMinus->setToolTip("-"); | 353 | funcMinus->setToolTip("-"); |
354 | connect(funcMinus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 354 | connect(funcMinus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
355 | funcCross=new QAction(tr("Multiplication"), Resource::loadPixmap ("opie-sheet/func_cross" ), tr("&Multiplication"), 0, this); | 355 | funcCross=new QAction(tr("Multiplication"), Resource::loadPixmap ("opie-sheet/func_cross" ), tr("&Multiplication"), 0, this); |
356 | funcCross->setToolTip("*"); | 356 | funcCross->setToolTip("*"); |
357 | connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 357 | connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
358 | funcDivide=new QAction(tr("Division"), Resource::loadPixmap( "opie-sheet/func_divide" ), tr("&Division"), 0, this); | 358 | funcDivide=new QAction(tr("Division"), Resource::loadPixmap( "opie-sheet/func_divide" ), tr("&Division"), 0, this); |
359 | funcDivide->setToolTip("/"); | 359 | funcDivide->setToolTip("/"); |
360 | connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 360 | connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
361 | funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), Resource::loadPixmap( "opie-sheet/func_paran_open" ), tr("&Open Paranthesis"), 0, this); | 361 | funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), Resource::loadPixmap( "opie-sheet/func_paran_open" ), tr("&Open Paranthesis"), 0, this); |
362 | funcParanOpen->setToolTip("("); | 362 | funcParanOpen->setToolTip("("); |
363 | connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 363 | connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
364 | funcParanClose=new QAction(tr("Close Paranthesis"), Resource::loadPixmap( "opie-sheet/func_paran_close" ), tr("&Close Paranthesis"), 0, this); | 364 | funcParanClose=new QAction(tr("Close Paranthesis"), Resource::loadPixmap( "opie-sheet/func_paran_close" ), tr("&Close Paranthesis"), 0, this); |
365 | funcParanClose->setToolTip(")"); | 365 | funcParanClose->setToolTip(")"); |
366 | connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 366 | connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
367 | funcComma=new QAction(tr("Comma"), Resource::loadPixmap( "opie-sheet/func_comma" ), tr("&Comma"), 0, this); | 367 | funcComma=new QAction(tr("Comma"), Resource::loadPixmap( "opie-sheet/func_comma" ), tr("&Comma"), 0, this); |
368 | funcComma->setToolTip(","); | 368 | funcComma->setToolTip(","); |
369 | connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 369 | connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
370 | } | 370 | } |
371 | 371 | ||
372 | void MainWindow::initMenu() | 372 | void MainWindow::initMenu() |
373 | { | 373 | { |
374 | menu=new QMenuBar(this); | 374 | menu=new QMenuBar(this); |
375 | 375 | ||
376 | menuFile=new QPopupMenu; | 376 | menuFile=new QPopupMenu; |
377 | fileNew->addTo(menuFile); | 377 | fileNew->addTo(menuFile); |
378 | fileOpen->addTo(menuFile); | 378 | fileOpen->addTo(menuFile); |
379 | fileSave->addTo(menuFile); | 379 | fileSave->addTo(menuFile); |
380 | fileSaveAs->addTo(menuFile); | 380 | fileSaveAs->addTo(menuFile); |
381 | // menuFile->insertSeparator(); | 381 | // menuFile->insertSeparator(); |
382 | // fileQuit->addTo(menuFile); | 382 | // fileQuit->addTo(menuFile); |
383 | menuFile->insertSeparator(); | 383 | menuFile->insertSeparator(); |
384 | fileExcelImport->addTo(menuFile); | 384 | fileExcelImport->addTo(menuFile); |
385 | menu->insertItem(tr("&File"), menuFile); | 385 | menu->insertItem(tr("&File"), menuFile); |
386 | 386 | ||
387 | menuEdit=new QPopupMenu; | 387 | menuEdit=new QPopupMenu; |
388 | editAccept->addTo(menuEdit); | 388 | editAccept->addTo(menuEdit); |
389 | editCancel->addTo(menuEdit); | 389 | editCancel->addTo(menuEdit); |
390 | editCellSelect->addTo(menuEdit); | 390 | editCellSelect->addTo(menuEdit); |
391 | menuEdit->insertSeparator(); | 391 | menuEdit->insertSeparator(); |
392 | editCut->addTo(menuEdit); | 392 | editCut->addTo(menuEdit); |
393 | editCopy->addTo(menuEdit); | 393 | editCopy->addTo(menuEdit); |
394 | editPaste->addTo(menuEdit); | 394 | editPaste->addTo(menuEdit); |
395 | editPasteContents->addTo(menuEdit); | 395 | editPasteContents->addTo(menuEdit); |
396 | editClear->addTo(menuEdit); | 396 | editClear->addTo(menuEdit); |
397 | menu->insertItem(tr("&Edit"), menuEdit); | 397 | menu->insertItem(tr("&Edit"), menuEdit); |
398 | 398 | ||
399 | menuInsert=new QPopupMenu; | 399 | menuInsert=new QPopupMenu; |
400 | menu->insertItem(tr("&Insert"), menuInsert); | 400 | menu->insertItem(tr("&Insert"), menuInsert); |
401 | 401 | ||
402 | menuFormat=new QPopupMenu; | 402 | menuFormat=new QPopupMenu; |
403 | formatCells->addTo(menuFormat); | 403 | formatCells->addTo(menuFormat); |
404 | menu->insertItem(tr("&Format"), menuFormat); | 404 | menu->insertItem(tr("&Format"), menuFormat); |
405 | 405 | ||
406 | menuData=new QPopupMenu; | 406 | menuData=new QPopupMenu; |
407 | dataSort->addTo(menuData); | 407 | dataSort->addTo(menuData); |
408 | dataFindReplace->addTo(menuData); | 408 | dataFindReplace->addTo(menuData); |
409 | menu->insertItem(tr("&Data"), menuData); | 409 | menu->insertItem(tr("&Data"), menuData); |
410 | 410 | ||
411 | // menuHelp=new QPopupMenu; | 411 | // menuHelp=new QPopupMenu; |