summaryrefslogtreecommitdiff
authordrw <drw>2005-05-16 17:09:58 (UTC)
committer drw <drw>2005-05-16 17:09:58 (UTC)
commite90364376c77a2f218b2fb291bb97eda7f18c3cb (patch) (unidiff)
tree48f75cfebe8e5f3004810533f8e2dca4105d0c23
parent1de015fb8f267f2451dd26d992cc713e6e02af79 (diff)
downloadopie-e90364376c77a2f218b2fb291bb97eda7f18c3cb.zip
opie-e90364376c77a2f218b2fb291bb97eda7f18c3cb.tar.gz
opie-e90364376c77a2f218b2fb291bb97eda7f18c3cb.tar.bz2
Resource -> OResource
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/mainwindow.cpp69
1 files changed, 51 insertions, 18 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp
index 3095142..4938ea8 100644
--- a/noncore/apps/opie-sheet/mainwindow.cpp
+++ b/noncore/apps/opie-sheet/mainwindow.cpp
@@ -13,49 +13,49 @@
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of 14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more 17..}^=.= = ; Library General Public License for more
18++= -. .` .: details. 18++= -. .` .: details.
19 : = ...= . :.=- 19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU 20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with 21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB. 22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29/* 29/*
30 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
31 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
32 */ 32 */
33 33
34#include "mainwindow.h" 34#include "mainwindow.h"
35 35
36/* OPIE */ 36/* OPIE */
37#include <qpe/resource.h> 37#include <opie2/oresource.h>
38#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
39 39
40/* QT */ 40/* QT */
41#include <qmessagebox.h> 41#include <qmessagebox.h>
42#include <qradiobutton.h> 42#include <qradiobutton.h>
43 43
44/* STD */ 44/* STD */
45#include "cellformat.h" 45#include "cellformat.h"
46#include "numberdlg.h" 46#include "numberdlg.h"
47#include "textdlg.h" 47#include "textdlg.h"
48#include "sortdlg.h" 48#include "sortdlg.h"
49#include "finddlg.h" 49#include "finddlg.h"
50 50
51#define DEFAULT_NUM_ROWS 300 51#define DEFAULT_NUM_ROWS 300
52#define DEFAULT_NUM_COLS (26*3) 52#define DEFAULT_NUM_COLS (26*3)
53#define DEFAULT_NUM_SHEETS 3 53#define DEFAULT_NUM_SHEETS 3
54 54
55MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) 55MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
56 :QMainWindow(parent, n, fl) 56 :QMainWindow(parent, n, fl)
57{ 57{
58 // initialize variables 58 // initialize variables
59 documentModified=FALSE; 59 documentModified=FALSE;
60 60
61 // construct objects 61 // construct objects
@@ -268,72 +268,88 @@ void MainWindow::slotImportExcelOpen()
268 setCentralWidget(ExcelSelector); 268 setCentralWidget(ExcelSelector);
269 ExcelSelector->show(); 269 ExcelSelector->show();
270 ExcelSelector->reread(); 270 ExcelSelector->reread();
271} 271}
272 272
273void MainWindow::ExcelSelectorHide() 273void MainWindow::ExcelSelectorHide()
274{ 274{
275 ExcelSelector->hide(); 275 ExcelSelector->hide();
276 setCentralWidget(sheet); 276 setCentralWidget(sheet);
277 sheet->show(); 277 sheet->show();
278} 278}
279 279
280void MainWindow::slotFileSave() 280void MainWindow::slotFileSave()
281{ 281{
282 saveCurrentFile(FALSE); 282 saveCurrentFile(FALSE);
283} 283}
284 284
285void MainWindow::setDocument(const QString &applnk_filename) 285void MainWindow::setDocument(const QString &applnk_filename)
286{ 286{
287 selectorFileOpen(DocLnk(applnk_filename)); 287 selectorFileOpen(DocLnk(applnk_filename));
288} 288}
289 289
290void MainWindow::initActions() 290void MainWindow::initActions()
291{ 291{
292 fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this); 292 fileNew=new QAction(tr("New File"),
293 Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ),
294 tr("&New"), 0, this);
293 connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); 295 connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew()));
294 fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this); 296 fileOpen=new QAction(tr("Open File"),
297 Opie::Core::OResource::loadPixmap( "fileopen", Opie::Core::OResource::SmallIcon ),
298 tr("&Open"), 0, this);
295 connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); 299 connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen()));
296 fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this); 300 fileSave=new QAction(tr("Save File"),
301 Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ),
302 tr("&Save"), 0, this);
297 connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); 303 connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave()));
298 fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this); 304 fileSaveAs=new QAction(tr("Save File As"),
305 Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ),
306 tr("Save &As"), 0, this);
299 connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); 307 connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs()));
300 308
301 //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); 309 //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this);
302 //connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); 310 //connect(fileQuit, SIGNAL(activated()), this, SLOT(close()));
303 fileExcelImport=new QAction(tr("Import Excel file"),Resource::loadPixmap( "opie-sheet/excel16" ),tr("Import E&xcel file"),0,this); 311 fileExcelImport=new QAction(tr("Import Excel file"),
312 Opie::Core::OResource::loadPixmap( "opie-sheet/excel16", Opie::Core::OResource::SmallIcon ),
313 tr("Import E&xcel file"),0,this);
304 connect(fileExcelImport, SIGNAL(activated()), this, SLOT(slotImportExcelOpen())); 314 connect(fileExcelImport, SIGNAL(activated()), this, SLOT(slotImportExcelOpen()));
305 315
306 // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); 316 // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this);
307 //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); 317 //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral()));
308 //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); 318 //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this);
309 //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); 319 //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout()));
310 320
311 editAccept=new QAction(tr("Accept"),Resource::loadPixmap( "enter" ) , tr("&Accept"), 0, this); 321 editAccept=new QAction(tr("Accept"),
322 Opie::Core::OResource::loadPixmap( "enter", Opie::Core::OResource::SmallIcon ),
323 tr("&Accept"), 0, this);
312 connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept())); 324 connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept()));
313 editCancel=new QAction(tr("Cancel"), Resource::loadPixmap( "close" ), tr("&Cancel"), 0, this); 325 editCancel=new QAction(tr("Cancel"),
326 Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ),
327 tr("&Cancel"), 0, this);
314 connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel())); 328 connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel()));
315 editCellSelect=new QAction(tr("Cell Selector"), Resource::loadPixmap( "opie-sheet/cell-select" ), tr("Cell &Selector"), 0, this); 329 editCellSelect=new QAction(tr("Cell Selector"),
330 Opie::Core::OResource::loadPixmap( "opie-sheet/cell-select", Opie::Core::OResource::SmallIcon ),
331 tr("Cell &Selector"), 0, this);
316 editCellSelect->setToggleAction(TRUE); 332 editCellSelect->setToggleAction(TRUE);
317 connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool))); 333 connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool)));
318 editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this); 334 editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this);
319 editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this); 335 editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this);
320 editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this); 336 editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this);
321 connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste())); 337 connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste()));
322 editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this); 338 editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this);
323 connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents())); 339 connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents()));
324 editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this); 340 editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this);
325 341
326 insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this); 342 insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this);
327 connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells())); 343 connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells()));
328 insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this); 344 insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this);
329 connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows())); 345 connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows()));
330 insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this); 346 insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this);
331 connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols())); 347 connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols()));
332 insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this); 348 insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this);
333 connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets())); 349 connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets()));
334 350
335 formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this); 351 formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this);
336 connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells())); 352 connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells()));
337 353
338 rowHeight=new QAction(tr("Row Height"), tr("H&eight"), 0, this); 354 rowHeight=new QAction(tr("Row Height"), tr("H&eight"), 0, this);
339 connect(rowHeight, SIGNAL(activated()), this, SLOT(slotRowHeight())); 355 connect(rowHeight, SIGNAL(activated()), this, SLOT(slotRowHeight()));
@@ -342,70 +358,86 @@ void MainWindow::initActions()
342 rowShow=new QAction(tr("Show Row"), tr("&Show"), 0, this); 358 rowShow=new QAction(tr("Show Row"), tr("&Show"), 0, this);
343 connect(rowShow, SIGNAL(activated()), this, SLOT(slotRowShow())); 359 connect(rowShow, SIGNAL(activated()), this, SLOT(slotRowShow()));
344 rowHide=new QAction(tr("Hide Row"), tr("&Hide"), 0, this); 360 rowHide=new QAction(tr("Hide Row"), tr("&Hide"), 0, this);
345 connect(rowHide, SIGNAL(activated()), this, SLOT(slotRowHide())); 361 connect(rowHide, SIGNAL(activated()), this, SLOT(slotRowHide()));
346 362
347 colWidth=new QAction(tr("Column Width"), tr("&Width"), 0, this); 363 colWidth=new QAction(tr("Column Width"), tr("&Width"), 0, this);
348 connect(colWidth, SIGNAL(activated()), this, SLOT(slotColumnWidth())); 364 connect(colWidth, SIGNAL(activated()), this, SLOT(slotColumnWidth()));
349 colAdjust=new QAction(tr("Adjust Column"), tr("&Adjust"), 0, this); 365 colAdjust=new QAction(tr("Adjust Column"), tr("&Adjust"), 0, this);
350 connect(colAdjust, SIGNAL(activated()), this, SLOT(slotColumnAdjust())); 366 connect(colAdjust, SIGNAL(activated()), this, SLOT(slotColumnAdjust()));
351 colShow=new QAction(tr("Show Column"), tr("&Show"), 0, this); 367 colShow=new QAction(tr("Show Column"), tr("&Show"), 0, this);
352 connect(colShow, SIGNAL(activated()), this, SLOT(slotColumnShow())); 368 connect(colShow, SIGNAL(activated()), this, SLOT(slotColumnShow()));
353 colHide=new QAction(tr("Hide Column"), tr("&Hide"), 0, this); 369 colHide=new QAction(tr("Hide Column"), tr("&Hide"), 0, this);
354 connect(colHide, SIGNAL(activated()), this, SLOT(slotColumnHide())); 370 connect(colHide, SIGNAL(activated()), this, SLOT(slotColumnHide()));
355 371
356 sheetRename=new QAction(tr("Rename Sheet"), tr("&Rename"), 0, this); 372 sheetRename=new QAction(tr("Rename Sheet"), tr("&Rename"), 0, this);
357 connect(sheetRename, SIGNAL(activated()), this, SLOT(slotSheetRename())); 373 connect(sheetRename, SIGNAL(activated()), this, SLOT(slotSheetRename()));
358 sheetRemove=new QAction(tr("Remove Sheet"), tr("R&emove"), 0, this); 374 sheetRemove=new QAction(tr("Remove Sheet"), tr("R&emove"), 0, this);
359 connect(sheetRemove, SIGNAL(activated()), this, SLOT(slotSheetRemove())); 375 connect(sheetRemove, SIGNAL(activated()), this, SLOT(slotSheetRemove()));
360 376
361 dataSort=new QAction(tr("Sort Data"), tr("&Sort"), 0, this); 377 dataSort=new QAction(tr("Sort Data"), tr("&Sort"), 0, this);
362 connect(dataSort, SIGNAL(activated()), this, SLOT(slotDataSort())); 378 connect(dataSort, SIGNAL(activated()), this, SLOT(slotDataSort()));
363 dataFindReplace=new QAction(tr("Find && Replace"), tr("&Find && Replace"), 0, this); 379 dataFindReplace=new QAction(tr("Find && Replace"), tr("&Find && Replace"), 0, this);
364 connect(dataFindReplace, SIGNAL(activated()), this, SLOT(slotDataFindReplace())); 380 connect(dataFindReplace, SIGNAL(activated()), this, SLOT(slotDataFindReplace()));
365 381
366 funcEqual=new QAction(tr("Equal To"), Resource::loadPixmap( "opie-sheet/func-equal" ), tr("&Equal To"), 0, this); 382 funcEqual=new QAction(tr("Equal To"),
383 Opie::Core::OResource::loadPixmap( "opie-sheet/func-equal", Opie::Core::OResource::SmallIcon ),
384 tr("&Equal To"), 0, this);
367 funcEqual->setToolTip("="); 385 funcEqual->setToolTip("=");
368 connect(funcEqual, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 386 connect(funcEqual, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
369 funcPlus=new QAction(tr("Addition"), Resource::loadPixmap( "opie-sheet/func-plus" ), tr("&Addition"), 0, this); 387 funcPlus=new QAction(tr("Addition"),
388 Opie::Core::OResource::loadPixmap( "opie-sheet/func-plus", Opie::Core::OResource::SmallIcon ),
389 tr("&Addition"), 0, this);
370 funcPlus->setToolTip("+"); 390 funcPlus->setToolTip("+");
371 connect(funcPlus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 391 connect(funcPlus, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
372 funcMinus=new QAction(tr("Subtraction"), Resource::loadPixmap( "opie-sheet/func-minus" ), tr("&Subtraction"), 0, this); 392 funcMinus=new QAction(tr("Subtraction"),
393 Opie::Core::OResource::loadPixmap( "opie-sheet/func-minus", Opie::Core::OResource::SmallIcon ),
394 tr("&Subtraction"), 0, this);
373 funcMinus->setToolTip("-"); 395 funcMinus->setToolTip("-");
374 connect(funcMinus, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 396 connect(funcMinus, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
375 funcCross=new QAction(tr("Multiplication"), Resource::loadPixmap ("opie-sheet/func-cross" ), tr("&Multiplication"), 0, this); 397 funcCross=new QAction(tr("Multiplication"),
398 Opie::Core::OResource::loadPixmap ("opie-sheet/func-cross", Opie::Core::OResource::SmallIcon ),
399 tr("&Multiplication"), 0, this);
376 funcCross->setToolTip("*"); 400 funcCross->setToolTip("*");
377 connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 401 connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
378 funcDivide=new QAction(tr("Division"), Resource::loadPixmap( "opie-sheet/func-divide" ), tr("&Division"), 0, this); 402 funcDivide=new QAction(tr("Division"),
403 Opie::Core::OResource::loadPixmap( "opie-sheet/func-divide", Opie::Core::OResource::SmallIcon ),
404 tr("&Division"), 0, this);
379 funcDivide->setToolTip("/"); 405 funcDivide->setToolTip("/");
380 connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 406 connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
381 funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), Resource::loadPixmap( "opie-sheet/func-paran-open" ), tr("&Open Paranthesis"), 0, this); 407 funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"),
408 Opie::Core::OResource::loadPixmap( "opie-sheet/func-paran-open", Opie::Core::OResource::SmallIcon ),
409 tr("&Open Paranthesis"), 0, this);
382 funcParanOpen->setToolTip("("); 410 funcParanOpen->setToolTip("(");
383 connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 411 connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
384 funcParanClose=new QAction(tr("Close Paranthesis"), Resource::loadPixmap( "opie-sheet/func-paran-close" ), tr("&Close Paranthesis"), 0, this); 412 funcParanClose=new QAction(tr("Close Paranthesis"),
413 Opie::Core::OResource::loadPixmap( "opie-sheet/func-paran-close", Opie::Core::OResource::SmallIcon ),
414 tr("&Close Paranthesis"), 0, this);
385 funcParanClose->setToolTip(")"); 415 funcParanClose->setToolTip(")");
386 connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 416 connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
387 funcComma=new QAction(tr("Comma"), Resource::loadPixmap( "opie-sheet/func-comma" ), tr("&Comma"), 0, this); 417 funcComma=new QAction(tr("Comma"),
418 Opie::Core::OResource::loadPixmap( "opie-sheet/func-comma", Opie::Core::OResource::SmallIcon ),
419 tr("&Comma"), 0, this);
388 funcComma->setToolTip(","); 420 funcComma->setToolTip(",");
389 connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput())); 421 connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput()));
390} 422}
391 423
392void MainWindow::initMenu() 424void MainWindow::initMenu()
393{ 425{
394 menu=new QMenuBar(this); 426 menu=new QMenuBar(this);
395 427
396 menuFile=new QPopupMenu; 428 menuFile=new QPopupMenu;
397 fileNew->addTo(menuFile); 429 fileNew->addTo(menuFile);
398 fileOpen->addTo(menuFile); 430 fileOpen->addTo(menuFile);
399 fileSave->addTo(menuFile); 431 fileSave->addTo(menuFile);
400 fileSaveAs->addTo(menuFile); 432 fileSaveAs->addTo(menuFile);
401 // menuFile->insertSeparator(); 433 // menuFile->insertSeparator();
402 // fileQuit->addTo(menuFile); 434 // fileQuit->addTo(menuFile);
403 menuFile->insertSeparator(); 435 menuFile->insertSeparator();
404 fileExcelImport->addTo(menuFile); 436 fileExcelImport->addTo(menuFile);
405 menu->insertItem(tr("&File"), menuFile); 437 menu->insertItem(tr("&File"), menuFile);
406 438
407 menuEdit=new QPopupMenu; 439 menuEdit=new QPopupMenu;
408 editAccept->addTo(menuEdit); 440 editAccept->addTo(menuEdit);
409 editCancel->addTo(menuEdit); 441 editCancel->addTo(menuEdit);
410 editCellSelect->addTo(menuEdit); 442 editCellSelect->addTo(menuEdit);
411 menuEdit->insertSeparator(); 443 menuEdit->insertSeparator();
@@ -599,49 +631,50 @@ void MainWindow::initStandardToolbar()
599 fileOpen->addTo(toolbarStandard); 631 fileOpen->addTo(toolbarStandard);
600 fileSave->addTo(toolbarStandard); 632 fileSave->addTo(toolbarStandard);
601 633
602 comboSheets=new QComboBox(toolbarStandard); 634 comboSheets=new QComboBox(toolbarStandard);
603 toolbarStandard->setStretchableWidget(comboSheets); 635 toolbarStandard->setStretchableWidget(comboSheets);
604 connect(comboSheets, SIGNAL(activated(const QString&)), this, SLOT(slotSheetChanged(const QString&))); 636 connect(comboSheets, SIGNAL(activated(const QString&)), this, SLOT(slotSheetChanged(const QString&)));
605} 637}
606 638
607void MainWindow::initFunctionsToolbar() 639void MainWindow::initFunctionsToolbar()
608{ 640{
609 toolbarFunctions=new QToolBar(this); 641 toolbarFunctions=new QToolBar(this);
610 toolbarFunctions->setHorizontalStretchable(TRUE); 642 toolbarFunctions->setHorizontalStretchable(TRUE);
611 moveToolBar(toolbarFunctions, Bottom); 643 moveToolBar(toolbarFunctions, Bottom);
612 644
613 funcEqual->addTo(toolbarFunctions); 645 funcEqual->addTo(toolbarFunctions);
614 funcPlus->addTo(toolbarFunctions); 646 funcPlus->addTo(toolbarFunctions);
615 funcMinus->addTo(toolbarFunctions); 647 funcMinus->addTo(toolbarFunctions);
616 funcCross->addTo(toolbarFunctions); 648 funcCross->addTo(toolbarFunctions);
617 funcDivide->addTo(toolbarFunctions); 649 funcDivide->addTo(toolbarFunctions);
618 funcParanOpen->addTo(toolbarFunctions); 650 funcParanOpen->addTo(toolbarFunctions);
619 funcParanClose->addTo(toolbarFunctions); 651 funcParanClose->addTo(toolbarFunctions);
620 funcComma->addTo(toolbarFunctions); 652 funcComma->addTo(toolbarFunctions);
621 653
622 toolFunction=new QToolButton(toolbarFunctions); 654 toolFunction=new QToolButton(toolbarFunctions);
623 toolFunction->setPixmap(Resource::loadPixmap( "opie-sheet/func-func" )); 655 toolFunction->setUsesBigPixmap( qApp->desktop()->size().width() > 330 );
656 toolFunction->setPixmap(Opie::Core::OResource::loadPixmap( "opie-sheet/func-func", Opie::Core::OResource::SmallIcon ));
624 toolFunction->setTextLabel(tr("Functions")); 657 toolFunction->setTextLabel(tr("Functions"));
625 toolFunction->setPopup(submenuFunc); 658 toolFunction->setPopup(submenuFunc);
626 toolFunction->setPopupDelay(0); 659 toolFunction->setPopupDelay(0);
627} 660}
628 661
629void MainWindow::initEditToolbar() 662void MainWindow::initEditToolbar()
630{ 663{
631 toolbarEdit=new QToolBar(this); 664 toolbarEdit=new QToolBar(this);
632 toolbarEdit->setHorizontalStretchable(TRUE); 665 toolbarEdit->setHorizontalStretchable(TRUE);
633 moveToolBar(toolbarEdit, Bottom); 666 moveToolBar(toolbarEdit, Bottom);
634 667
635 editAccept->addTo(toolbarEdit); 668 editAccept->addTo(toolbarEdit);
636 editCancel->addTo(toolbarEdit); 669 editCancel->addTo(toolbarEdit);
637 670
638 editData=new QLineEdit(toolbarEdit); 671 editData=new QLineEdit(toolbarEdit);
639 toolbarEdit->setStretchableWidget(editData); 672 toolbarEdit->setStretchableWidget(editData);
640 connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); 673 connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept()));
641 674
642 editCellSelect->addTo(toolbarEdit); 675 editCellSelect->addTo(toolbarEdit);
643} 676}
644 677
645void MainWindow::slotHelpAbout() 678void MainWindow::slotHelpAbout()
646{ 679{
647 QDialog dialogAbout(this, 0, TRUE); 680 QDialog dialogAbout(this, 0, TRUE);