summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show 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
@@ -34,7 +34,7 @@
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 */
@@ -289,18 +289,28 @@ void MainWindow::setDocument(const QString &applnk_filename)
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);
@@ -308,11 +318,17 @@ void MainWindow::initActions()
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);
@@ -363,28 +379,44 @@ void MainWindow::initActions()
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}
@@ -620,7 +652,8 @@ void MainWindow::initFunctionsToolbar()
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);