Diffstat (limited to 'noncore/apps/opie-sheet/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index b9f8e57..43e5131 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp | |||
@@ -1,57 +1,54 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Opie Sheet (formerly Sheet/Qt) | 11 | * Opie Sheet (formerly Sheet/Qt) |
12 | * by Serdar Ozler <sozler@sitebest.com> | 12 | * by Serdar Ozler <sozler@sitebest.com> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "mainwindow.h" | 15 | #include "mainwindow.h" |
16 | 16 | ||
17 | #include <qpe/filemanager.h> | 17 | #include <qpe/filemanager.h> |
18 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
19 | #include <qpe/resource.h> | ||
19 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
20 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qtranslator.h> | ||
21 | #include <qradiobutton.h> | 23 | #include <qradiobutton.h> |
22 | #include "cellformat.h" | 24 | #include "cellformat.h" |
23 | #include "numberdlg.h" | 25 | #include "numberdlg.h" |
24 | #include "textdlg.h" | 26 | #include "textdlg.h" |
25 | #include "sortdlg.h" | 27 | #include "sortdlg.h" |
26 | #include "finddlg.h" | 28 | #include "finddlg.h" |
27 | 29 | ||
28 | #include "file-new.xpm" | 30 | |
29 | #include "file-open.xpm" | ||
30 | #include "file-save.xpm" | ||
31 | #include "edit-cancel.xpm" | ||
32 | #include "edit-accept.xpm" | ||
33 | #include "help-general.xpm" | ||
34 | #include "func-plus.xpm" | 31 | #include "func-plus.xpm" |
35 | #include "func-minus.xpm" | 32 | #include "func-minus.xpm" |
36 | #include "func-cross.xpm" | 33 | #include "func-cross.xpm" |
37 | #include "func-divide.xpm" | 34 | #include "func-divide.xpm" |
38 | #include "func-paran-open.xpm" | 35 | #include "func-paran-open.xpm" |
39 | #include "func-paran-close.xpm" | 36 | #include "func-paran-close.xpm" |
40 | #include "func-comma.xpm" | 37 | #include "func-comma.xpm" |
41 | #include "func-func.xpm" | 38 | #include "func-func.xpm" |
42 | #include "func-equal.xpm" | 39 | #include "func-equal.xpm" |
43 | #include "cell-select.xpm" | 40 | #include "cell-select.xpm" |
44 | 41 | ||
45 | #define DEFAULT_NUM_ROWS 199 | 42 | #define DEFAULT_NUM_ROWS 199 |
46 | #define DEFAULT_NUM_COLS (26*3) | 43 | #define DEFAULT_NUM_COLS (26*3) |
47 | #define DEFAULT_NUM_SHEETS 3 | 44 | #define DEFAULT_NUM_SHEETS 3 |
48 | 45 | ||
49 | MainWindow::MainWindow() | 46 | MainWindow::MainWindow() |
50 | :QMainWindow() | 47 | :QMainWindow() |
51 | { | 48 | { |
52 | // initialize variables | 49 | // initialize variables |
53 | documentModified=FALSE; | 50 | documentModified=FALSE; |
54 | 51 | ||
55 | // construct objects | 52 | // construct objects |
56 | currentDoc=0; | 53 | currentDoc=0; |
57 | fileSelector=new FileSelector("application/sheet-qt", this, QString::null); | 54 | fileSelector=new FileSelector("application/sheet-qt", this, QString::null); |
@@ -244,67 +241,67 @@ void MainWindow::selectorHide() | |||
244 | } | 241 | } |
245 | 242 | ||
246 | void MainWindow::slotFileNew() | 243 | void MainWindow::slotFileNew() |
247 | { | 244 | { |
248 | selectorFileNew(DocLnk()); | 245 | selectorFileNew(DocLnk()); |
249 | } | 246 | } |
250 | 247 | ||
251 | void MainWindow::slotFileOpen() | 248 | void MainWindow::slotFileOpen() |
252 | { | 249 | { |
253 | selectorShow(); | 250 | selectorShow(); |
254 | } | 251 | } |
255 | 252 | ||
256 | void MainWindow::slotFileSave() | 253 | void MainWindow::slotFileSave() |
257 | { | 254 | { |
258 | saveCurrentFile(FALSE); | 255 | saveCurrentFile(FALSE); |
259 | } | 256 | } |
260 | 257 | ||
261 | void MainWindow::setDocument(const QString &applnk_filename) | 258 | void MainWindow::setDocument(const QString &applnk_filename) |
262 | { | 259 | { |
263 | selectorFileOpen(DocLnk(applnk_filename)); | 260 | selectorFileOpen(DocLnk(applnk_filename)); |
264 | } | 261 | } |
265 | 262 | ||
266 | void MainWindow::initActions() | 263 | void MainWindow::initActions() |
267 | { | 264 | { |
268 | fileNew=new QAction(tr("New File"), QPixmap(file_new_xpm), tr("&New"), 0, this); | 265 | fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this); |
269 | connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); | 266 | connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); |
270 | fileOpen=new QAction(tr("Open File"), QPixmap(file_open_xpm), tr("&Open"), 0, this); | 267 | fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this); |
271 | connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); | 268 | connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); |
272 | fileSave=new QAction(tr("Save File"), QPixmap(file_save_xpm), tr("&Save"), 0, this); | 269 | fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this); |
273 | connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); | 270 | connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); |
274 | fileSaveAs=new QAction(tr("Save File As"), QPixmap(file_save_xpm), tr("Save &As"), 0, this); | 271 | fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this); |
275 | connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); | 272 | connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); |
276 | fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); | 273 | //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); |
277 | connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); | 274 | //connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); |
278 | 275 | ||
279 | helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); | 276 | // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); |
280 | connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); | 277 | //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); |
281 | helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); | 278 | //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); |
282 | connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); | 279 | //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); |
283 | 280 | ||
284 | editAccept=new QAction(tr("Accept"), QPixmap(edit_accept_xpm), tr("&Accept"), 0, this); | 281 | editAccept=new QAction(tr("Accept"),Resource::loadPixmap( "enter" ) , tr("&Accept"), 0, this); |
285 | connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept())); | 282 | connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept())); |
286 | editCancel=new QAction(tr("Cancel"), QPixmap(edit_cancel_xpm), tr("&Cancel"), 0, this); | 283 | editCancel=new QAction(tr("Cancel"), Resource::loadPixmap( "close" ), tr("&Cancel"), 0, this); |
287 | connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel())); | 284 | connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel())); |
288 | editCellSelect=new QAction(tr("Cell Selector"), QPixmap(cell_select_xpm), tr("Cell &Selector"), 0, this); | 285 | editCellSelect=new QAction(tr("Cell Selector"), QPixmap(cell_select_xpm), tr("Cell &Selector"), 0, this); |
289 | editCellSelect->setToggleAction(TRUE); | 286 | editCellSelect->setToggleAction(TRUE); |
290 | connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool))); | 287 | connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool))); |
291 | editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this); | 288 | editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this); |
292 | editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this); | 289 | editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this); |
293 | editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this); | 290 | editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this); |
294 | connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste())); | 291 | connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste())); |
295 | editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this); | 292 | editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this); |
296 | connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents())); | 293 | connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents())); |
297 | editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this); | 294 | editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this); |
298 | 295 | ||
299 | insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this); | 296 | insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this); |
300 | connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells())); | 297 | connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells())); |
301 | insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this); | 298 | insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this); |
302 | connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows())); | 299 | connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows())); |
303 | insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this); | 300 | insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this); |
304 | connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols())); | 301 | connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols())); |
305 | insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this); | 302 | insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this); |
306 | connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets())); | 303 | connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets())); |
307 | 304 | ||
308 | formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this); | 305 | formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this); |
309 | connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells())); | 306 | connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells())); |
310 | 307 | ||
@@ -350,80 +347,80 @@ void MainWindow::initActions() | |||
350 | connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 347 | connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
351 | funcDivide=new QAction(tr("Division"), QPixmap(func_divide_xpm), tr("&Division"), 0, this); | 348 | funcDivide=new QAction(tr("Division"), QPixmap(func_divide_xpm), tr("&Division"), 0, this); |
352 | funcDivide->setToolTip("/"); | 349 | funcDivide->setToolTip("/"); |
353 | connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 350 | connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
354 | funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), QPixmap(func_paran_open_xpm), tr("&Open Paranthesis"), 0, this); | 351 | funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), QPixmap(func_paran_open_xpm), tr("&Open Paranthesis"), 0, this); |
355 | funcParanOpen->setToolTip("("); | 352 | funcParanOpen->setToolTip("("); |
356 | connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 353 | connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
357 | funcParanClose=new QAction(tr("Close Paranthesis"), QPixmap(func_paran_close_xpm), tr("&Close Paranthesis"), 0, this); | 354 | funcParanClose=new QAction(tr("Close Paranthesis"), QPixmap(func_paran_close_xpm), tr("&Close Paranthesis"), 0, this); |
358 | funcParanClose->setToolTip(")"); | 355 | funcParanClose->setToolTip(")"); |
359 | connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 356 | connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
360 | funcComma=new QAction(tr("Comma"), QPixmap(func_comma_xpm), tr("&Comma"), 0, this); | 357 | funcComma=new QAction(tr("Comma"), QPixmap(func_comma_xpm), tr("&Comma"), 0, this); |
361 | funcComma->setToolTip(","); | 358 | funcComma->setToolTip(","); |
362 | connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput())); | 359 | connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput())); |
363 | } | 360 | } |
364 | 361 | ||
365 | void MainWindow::initMenu() | 362 | void MainWindow::initMenu() |
366 | { | 363 | { |
367 | menu=new QPEMenuBar(this); | 364 | menu=new QPEMenuBar(this); |
368 | 365 | ||
369 | menuFile=new QPopupMenu; | 366 | menuFile=new QPopupMenu; |
370 | fileNew->addTo(menuFile); | 367 | fileNew->addTo(menuFile); |
371 | fileOpen->addTo(menuFile); | 368 | fileOpen->addTo(menuFile); |
372 | fileSave->addTo(menuFile); | 369 | fileSave->addTo(menuFile); |
373 | fileSaveAs->addTo(menuFile); | 370 | fileSaveAs->addTo(menuFile); |
374 | menuFile->insertSeparator(); | 371 | // menuFile->insertSeparator(); |
375 | fileQuit->addTo(menuFile); | 372 | // fileQuit->addTo(menuFile); |
376 | menu->insertItem(tr("&File"), menuFile); | 373 | menu->insertItem(tr("&File"), menuFile); |
377 | 374 | ||
378 | menuEdit=new QPopupMenu; | 375 | menuEdit=new QPopupMenu; |
379 | editAccept->addTo(menuEdit); | 376 | editAccept->addTo(menuEdit); |
380 | editCancel->addTo(menuEdit); | 377 | editCancel->addTo(menuEdit); |
381 | editCellSelect->addTo(menuEdit); | 378 | editCellSelect->addTo(menuEdit); |
382 | menuEdit->insertSeparator(); | 379 | menuEdit->insertSeparator(); |
383 | editCut->addTo(menuEdit); | 380 | editCut->addTo(menuEdit); |
384 | editCopy->addTo(menuEdit); | 381 | editCopy->addTo(menuEdit); |
385 | editPaste->addTo(menuEdit); | 382 | editPaste->addTo(menuEdit); |
386 | editPasteContents->addTo(menuEdit); | 383 | editPasteContents->addTo(menuEdit); |
387 | editClear->addTo(menuEdit); | 384 | editClear->addTo(menuEdit); |
388 | menu->insertItem(tr("&Edit"), menuEdit); | 385 | menu->insertItem(tr("&Edit"), menuEdit); |
389 | 386 | ||
390 | menuInsert=new QPopupMenu; | 387 | menuInsert=new QPopupMenu; |
391 | menu->insertItem(tr("&Insert"), menuInsert); | 388 | menu->insertItem(tr("&Insert"), menuInsert); |
392 | 389 | ||
393 | menuFormat=new QPopupMenu; | 390 | menuFormat=new QPopupMenu; |
394 | formatCells->addTo(menuFormat); | 391 | formatCells->addTo(menuFormat); |
395 | menu->insertItem(tr("&Format"), menuFormat); | 392 | menu->insertItem(tr("&Format"), menuFormat); |
396 | 393 | ||
397 | menuData=new QPopupMenu; | 394 | menuData=new QPopupMenu; |
398 | dataSort->addTo(menuData); | 395 | dataSort->addTo(menuData); |
399 | dataFindReplace->addTo(menuData); | 396 | dataFindReplace->addTo(menuData); |
400 | menu->insertItem(tr("&Data"), menuData); | 397 | menu->insertItem(tr("&Data"), menuData); |
401 | 398 | ||
402 | menuHelp=new QPopupMenu; | 399 | // menuHelp=new QPopupMenu; |
403 | helpGeneral->addTo(menuHelp); | 400 | // helpGeneral->addTo(menuHelp); |
404 | helpAbout->addTo(menuHelp); | 401 | // helpAbout->addTo(menuHelp); |
405 | menu->insertItem(tr("&Help"), menuHelp); | 402 | // menu->insertItem(tr("&Help"), menuHelp); |
406 | 403 | ||
407 | submenuRow=new QPopupMenu; | 404 | submenuRow=new QPopupMenu; |
408 | rowHeight->addTo(submenuRow); | 405 | rowHeight->addTo(submenuRow); |
409 | rowAdjust->addTo(submenuRow); | 406 | rowAdjust->addTo(submenuRow); |
410 | rowShow->addTo(submenuRow); | 407 | rowShow->addTo(submenuRow); |
411 | rowHide->addTo(submenuRow); | 408 | rowHide->addTo(submenuRow); |
412 | menuFormat->insertItem(tr("&Row"), submenuRow); | 409 | menuFormat->insertItem(tr("&Row"), submenuRow); |
413 | 410 | ||
414 | submenuCol=new QPopupMenu; | 411 | submenuCol=new QPopupMenu; |
415 | colWidth->addTo(submenuCol); | 412 | colWidth->addTo(submenuCol); |
416 | colAdjust->addTo(submenuCol); | 413 | colAdjust->addTo(submenuCol); |
417 | colShow->addTo(submenuCol); | 414 | colShow->addTo(submenuCol); |
418 | colHide->addTo(submenuCol); | 415 | colHide->addTo(submenuCol); |
419 | menuFormat->insertItem(tr("Colum&n"), submenuCol); | 416 | menuFormat->insertItem(tr("Colum&n"), submenuCol); |
420 | 417 | ||
421 | submenuSheet=new QPopupMenu; | 418 | submenuSheet=new QPopupMenu; |
422 | sheetRename->addTo(submenuSheet); | 419 | sheetRename->addTo(submenuSheet); |
423 | sheetRemove->addTo(submenuSheet); | 420 | sheetRemove->addTo(submenuSheet); |
424 | menuFormat->insertItem(tr("&Sheet"), submenuSheet); | 421 | menuFormat->insertItem(tr("&Sheet"), submenuSheet); |
425 | 422 | ||
426 | submenuFunc=new QPopupMenu; | 423 | submenuFunc=new QPopupMenu; |
427 | menuInsert->insertItem(tr("&Function"), submenuFunc); | 424 | menuInsert->insertItem(tr("&Function"), submenuFunc); |
428 | 425 | ||
429 | submenuFuncStd=new QPopupMenu; | 426 | submenuFuncStd=new QPopupMenu; |
@@ -496,59 +493,48 @@ void MainWindow::initFunctionsToolbar() | |||
496 | 493 | ||
497 | toolFunction=new QToolButton(toolbarFunctions); | 494 | toolFunction=new QToolButton(toolbarFunctions); |
498 | toolFunction->setPixmap(func_func_xpm); | 495 | toolFunction->setPixmap(func_func_xpm); |
499 | toolFunction->setTextLabel(tr("Functions")); | 496 | toolFunction->setTextLabel(tr("Functions")); |
500 | toolFunction->setPopup(submenuFunc); | 497 | toolFunction->setPopup(submenuFunc); |
501 | toolFunction->setPopupDelay(0); | 498 | toolFunction->setPopupDelay(0); |
502 | } | 499 | } |
503 | 500 | ||
504 | void MainWindow::initEditToolbar() | 501 | void MainWindow::initEditToolbar() |
505 | { | 502 | { |
506 | toolbarEdit=new QPEToolBar(this); | 503 | toolbarEdit=new QPEToolBar(this); |
507 | toolbarEdit->setHorizontalStretchable(TRUE); | 504 | toolbarEdit->setHorizontalStretchable(TRUE); |
508 | moveToolBar(toolbarEdit, Bottom); | 505 | moveToolBar(toolbarEdit, Bottom); |
509 | 506 | ||
510 | editAccept->addTo(toolbarEdit); | 507 | editAccept->addTo(toolbarEdit); |
511 | editCancel->addTo(toolbarEdit); | 508 | editCancel->addTo(toolbarEdit); |
512 | 509 | ||
513 | editData=new QLineEdit(toolbarEdit); | 510 | editData=new QLineEdit(toolbarEdit); |
514 | toolbarEdit->setStretchableWidget(editData); | 511 | toolbarEdit->setStretchableWidget(editData); |
515 | connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); | 512 | connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); |
516 | 513 | ||
517 | editCellSelect->addTo(toolbarEdit); | 514 | editCellSelect->addTo(toolbarEdit); |
518 | } | 515 | } |
519 | 516 | ||
520 | void MainWindow::slotHelpGeneral() | ||
521 | { | ||
522 | if (QFile::exists(helpFile)) | ||
523 | { | ||
524 | QCopEnvelope e("QPE/Application/helpbrowser", "showFile(QString)"); | ||
525 | e << helpFile; | ||
526 | } | ||
527 | else | ||
528 | QMessageBox::critical(this, tr("Error"), tr("Help file not found!")); | ||
529 | } | ||
530 | |||
531 | void MainWindow::slotHelpAbout() | 517 | void MainWindow::slotHelpAbout() |
532 | { | 518 | { |
533 | QDialog dialogAbout(this, 0, TRUE); | 519 | QDialog dialogAbout(this, 0, TRUE); |
534 | dialogAbout.resize(width()-40, height()-80); | 520 | dialogAbout.resize(width()-40, height()-80); |
535 | dialogAbout.setCaption(tr("About Opie Sheet")); | 521 | dialogAbout.setCaption(tr("About Opie Sheet")); |
536 | 522 | ||
537 | QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.2\nRelease Date: October 08, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); | 523 | QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.2\nRelease Date: October 08, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); |
538 | label.setGeometry(dialogAbout.rect()); | 524 | label.setGeometry(dialogAbout.rect()); |
539 | label.setAlignment(Qt::AlignCenter | Qt::WordBreak); | 525 | label.setAlignment(Qt::AlignCenter | Qt::WordBreak); |
540 | 526 | ||
541 | dialogAbout.exec(); | 527 | dialogAbout.exec(); |
542 | } | 528 | } |
543 | 529 | ||
544 | void MainWindow::initSheet() | 530 | void MainWindow::initSheet() |
545 | { | 531 | { |
546 | sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); | 532 | sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); |
547 | setCentralWidget(sheet); | 533 | setCentralWidget(sheet); |
548 | 534 | ||
549 | connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); | 535 | connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); |
550 | connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); | 536 | connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); |
551 | connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); | 537 | connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); |
552 | 538 | ||
553 | connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); | 539 | connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); |
554 | connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); | 540 | connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); |