-rw-r--r-- | noncore/apps/opie-sheet/edit-accept.xpm | 30 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/edit-cancel.xpm | 25 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/file-new.xpm | 24 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/file-open.xpm | 25 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/file-save.xpm | 24 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/help-general.xpm | 25 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 56 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.h | 1 |
8 files changed, 21 insertions, 189 deletions
diff --git a/noncore/apps/opie-sheet/edit-accept.xpm b/noncore/apps/opie-sheet/edit-accept.xpm deleted file mode 100644 index 5109281..0000000 --- a/noncore/apps/opie-sheet/edit-accept.xpm +++ b/dev/null @@ -1,30 +0,0 @@ -/* XPM */ -static const char *edit_accept_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 8 1", -" c #000000000000", -". c #000040400000", -"X c #404000000000", -"o c #000080800000", -"O c #0000c0c00000", -"+ c #c0c0ffffc0c0", -"@ c #ffffffffffff", -"# c None", -/* pixels */ -"################", -"################", -"##############+#", -"#############+O#", -"############+Oo#", -"###########+Oo.#", -"##+o######+Oo. #", -"#+OOo####+Oo.X##", -" .oOOo##+Oo. ###", -"# .oOOo+Oo.X####", -"##X.oOOOo.X#####", -"### .oOo. ######", -"#### .o. #######", -"##### X ########", -"################", -"################", -}; diff --git a/noncore/apps/opie-sheet/edit-cancel.xpm b/noncore/apps/opie-sheet/edit-cancel.xpm deleted file mode 100644 index 8e1606e..0000000 --- a/noncore/apps/opie-sheet/edit-cancel.xpm +++ b/dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static const char *edit_cancel_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 3 1", -". c red", -"X c #ffffffffffff", -" c None", -/* pixels */ -" ", -" ", -" ..... ", -" ......... ", -" ........... ", -" ..XX...XX.. ", -" ...XXX.XXX... ", -" ....XXXXX.... ", -" .....XXX..... ", -" ....XXXXX.... ", -" ...XXX.XXX... ", -" ..XX...XX.. ", -" ........... ", -" ......... ", -" ..... ", -" ", -}; diff --git a/noncore/apps/opie-sheet/file-new.xpm b/noncore/apps/opie-sheet/file-new.xpm deleted file mode 100644 index ec8dd63..0000000 --- a/noncore/apps/opie-sheet/file-new.xpm +++ b/dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static const char * file_new_xpm[] = { -"16 16 5 1", -" c None", -". c #808080", -"+ c #FFFFFF", -"@ c #C0C0C0", -"# c #000000", -" .......... ", -" .++++++++@. ", -" .++++++++@+. ", -" .++++++++#### ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .++++++++++@# ", -" .@@@@@@@@@@@# ", -" ############# "}; diff --git a/noncore/apps/opie-sheet/file-open.xpm b/noncore/apps/opie-sheet/file-open.xpm deleted file mode 100644 index 8449d5b..0000000 --- a/noncore/apps/opie-sheet/file-open.xpm +++ b/dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static const char * file_open_xpm[] = { -"16 16 6 1", -" c None", -". c #808080", -"+ c #FFFFFF", -"@ c #C0C0C0", -"# c #FFFF00", -"$ c #000000", -" ", -" ..... ", -" .+++++. ", -" .+@#@#@+...... ", -" .+#@#@#@+++++.$", -" .+@#@#@#@#@#@.$", -".............#.$", -".++++++++++.$@.$", -".+@#@#@#@#@#$..$", -" .+@#@#@#@#@.$.$", -" .+#@#@#@#@#@$.$", -" .+#@#@#@#@#.$$", -" ............$$", -" $$$$$$$$$$$$$", -" ", -" "}; diff --git a/noncore/apps/opie-sheet/file-save.xpm b/noncore/apps/opie-sheet/file-save.xpm deleted file mode 100644 index 039a174..0000000 --- a/noncore/apps/opie-sheet/file-save.xpm +++ b/dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static const char * file_save_xpm[] = { -"16 16 5 1", -" c None", -". c #808080", -"+ c #FFFFFF", -"@ c #000000", -"# c #0000FF", -" ", -" ........ ", -" .++++++.@ ", -" .+....+.+@ #", -" .++++++.@@@ ##", -" .+....++++@ ##@", -" .+++++++++@##@ ", -" .+.......+##@ ", -" .++++++++##@ ", -" .+......@#@ ", -" .++++++@@@@ ", -" .+....@@@+@ ", -" .++++@++++@ ", -" .+++++++++@ ", -" @@@@@@@@@@@ ", -" "}; diff --git a/noncore/apps/opie-sheet/help-general.xpm b/noncore/apps/opie-sheet/help-general.xpm deleted file mode 100644 index 9f10527..0000000 --- a/noncore/apps/opie-sheet/help-general.xpm +++ b/dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static const char * help_general_xpm[] = { -"16 16 6 1", -" c None s None", -". c #000000", -"X c #FF0000", -"o c #FFFF00", -"O c #808080", -"+ c #FFFFFF", -" ", -" .. ", -" .XX. ", -" .XXXX. ", -" .XXXoXX. ", -" .XXXoXoXX. ", -" .XXXXXoXoX. ", -" .XXXXXXXoX.O ", -" ..XXXXXXX.+.O ", -" .+.XXXXX.+.O ", -" .+.XXX.+.O ", -" .+.X.+.O ", -" .+.+.O ", -" .+.O ", -" .O ", -" "}; 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 @@ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* * Opie Sheet (formerly Sheet/Qt) * by Serdar Ozler <sozler@sitebest.com> */ #include "mainwindow.h" #include <qpe/filemanager.h> #include <qpe/qcopenvelope_qws.h> +#include <qpe/resource.h> #include <qmessagebox.h> #include <qfile.h> +#include <qtranslator.h> #include <qradiobutton.h> #include "cellformat.h" #include "numberdlg.h" #include "textdlg.h" #include "sortdlg.h" #include "finddlg.h" -#include "file-new.xpm" -#include "file-open.xpm" -#include "file-save.xpm" -#include "edit-cancel.xpm" -#include "edit-accept.xpm" -#include "help-general.xpm" + #include "func-plus.xpm" #include "func-minus.xpm" #include "func-cross.xpm" #include "func-divide.xpm" #include "func-paran-open.xpm" #include "func-paran-close.xpm" #include "func-comma.xpm" #include "func-func.xpm" #include "func-equal.xpm" #include "cell-select.xpm" #define DEFAULT_NUM_ROWS 199 #define DEFAULT_NUM_COLS (26*3) #define DEFAULT_NUM_SHEETS 3 MainWindow::MainWindow() :QMainWindow() { // initialize variables documentModified=FALSE; // construct objects currentDoc=0; fileSelector=new FileSelector("application/sheet-qt", this, QString::null); @@ -244,67 +241,67 @@ void MainWindow::selectorHide() } void MainWindow::slotFileNew() { selectorFileNew(DocLnk()); } void MainWindow::slotFileOpen() { selectorShow(); } void MainWindow::slotFileSave() { saveCurrentFile(FALSE); } void MainWindow::setDocument(const QString &applnk_filename) { selectorFileOpen(DocLnk(applnk_filename)); } void MainWindow::initActions() { - fileNew=new QAction(tr("New File"), QPixmap(file_new_xpm), tr("&New"), 0, this); + fileNew=new QAction(tr("New File"), Resource::loadPixmap( "new" ), tr("&New"), 0, this); connect(fileNew, SIGNAL(activated()), this, SLOT(slotFileNew())); - fileOpen=new QAction(tr("Open File"), QPixmap(file_open_xpm), tr("&Open"), 0, this); + fileOpen=new QAction(tr("Open File"), Resource::loadPixmap( "fileopen" ), tr("&Open"), 0, this); connect(fileOpen, SIGNAL(activated()), this, SLOT(slotFileOpen())); - fileSave=new QAction(tr("Save File"), QPixmap(file_save_xpm), tr("&Save"), 0, this); + fileSave=new QAction(tr("Save File"),Resource::loadPixmap( "save" ), tr("&Save"), 0, this); connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave())); - fileSaveAs=new QAction(tr("Save File As"), QPixmap(file_save_xpm), tr("Save &As"), 0, this); + fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this); connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs())); - fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); - connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); + //fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this); + //connect(fileQuit, SIGNAL(activated()), this, SLOT(close())); - helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); - connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); - helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); - connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); + // helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this); + //connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral())); + //helpAbout=new QAction(tr("About Opie Sheet"), tr("&About"), 0, this); + //connect(helpAbout, SIGNAL(activated()), this, SLOT(slotHelpAbout())); - editAccept=new QAction(tr("Accept"), QPixmap(edit_accept_xpm), tr("&Accept"), 0, this); + editAccept=new QAction(tr("Accept"),Resource::loadPixmap( "enter" ) , tr("&Accept"), 0, this); connect(editAccept, SIGNAL(activated()), this, SLOT(slotEditAccept())); - editCancel=new QAction(tr("Cancel"), QPixmap(edit_cancel_xpm), tr("&Cancel"), 0, this); + editCancel=new QAction(tr("Cancel"), Resource::loadPixmap( "close" ), tr("&Cancel"), 0, this); connect(editCancel, SIGNAL(activated()), this, SLOT(slotEditCancel())); editCellSelect=new QAction(tr("Cell Selector"), QPixmap(cell_select_xpm), tr("Cell &Selector"), 0, this); editCellSelect->setToggleAction(TRUE); connect(editCellSelect, SIGNAL(toggled(bool)), this, SLOT(slotCellSelect(bool))); editCut=new QAction(tr("Cut Cells"), tr("Cu&t"), 0, this); editCopy=new QAction(tr("Copy Cells"), tr("&Copy"), 0, this); editPaste=new QAction(tr("Paste Cells"), tr("&Paste"), 0, this); connect(editPaste, SIGNAL(activated()), this, SLOT(slotEditPaste())); editPasteContents=new QAction(tr("Paste Contents"), tr("Paste Cont&ents"), 0, this); connect(editPasteContents, SIGNAL(activated()), this, SLOT(slotEditPasteContents())); editClear=new QAction(tr("Clear Cells"), tr("C&lear"), 0, this); insertCells=new QAction(tr("Insert Cells"), tr("C&ells"), 0, this); connect(insertCells, SIGNAL(activated()), this, SLOT(slotInsertCells())); insertRows=new QAction(tr("Insert Rows"), tr("&Rows"), 0, this); connect(insertRows, SIGNAL(activated()), this, SLOT(slotInsertRows())); insertCols=new QAction(tr("Insert Columns"), tr("&Columns"), 0, this); connect(insertCols, SIGNAL(activated()), this, SLOT(slotInsertCols())); insertSheets=new QAction(tr("Add Sheets"), tr("&Sheets"), 0, this); connect(insertSheets, SIGNAL(activated()), this, SLOT(slotInsertSheets())); formatCells=new QAction(tr("Cells"), tr("&Cells"), 0, this); connect(formatCells, SIGNAL(activated()), this, SLOT(slotFormatCells())); @@ -350,80 +347,80 @@ void MainWindow::initActions() connect(funcCross, SIGNAL(activated()), this, SLOT(slotFuncOutput())); funcDivide=new QAction(tr("Division"), QPixmap(func_divide_xpm), tr("&Division"), 0, this); funcDivide->setToolTip("/"); connect(funcDivide, SIGNAL(activated()), this, SLOT(slotFuncOutput())); funcParanOpen=new QAction(tr("Open ParanthesistempCellData->row+row1, tempCellData->col+col1"), QPixmap(func_paran_open_xpm), tr("&Open Paranthesis"), 0, this); funcParanOpen->setToolTip("("); connect(funcParanOpen, SIGNAL(activated()), this, SLOT(slotFuncOutput())); funcParanClose=new QAction(tr("Close Paranthesis"), QPixmap(func_paran_close_xpm), tr("&Close Paranthesis"), 0, this); funcParanClose->setToolTip(")"); connect(funcParanClose, SIGNAL(activated()), this, SLOT(slotFuncOutput())); funcComma=new QAction(tr("Comma"), QPixmap(func_comma_xpm), tr("&Comma"), 0, this); funcComma->setToolTip(","); connect(funcComma, SIGNAL(activated()), this, SLOT(slotFuncOutput())); } void MainWindow::initMenu() { menu=new QPEMenuBar(this); menuFile=new QPopupMenu; fileNew->addTo(menuFile); fileOpen->addTo(menuFile); fileSave->addTo(menuFile); fileSaveAs->addTo(menuFile); - menuFile->insertSeparator(); - fileQuit->addTo(menuFile); +// menuFile->insertSeparator(); +// fileQuit->addTo(menuFile); menu->insertItem(tr("&File"), menuFile); menuEdit=new QPopupMenu; editAccept->addTo(menuEdit); editCancel->addTo(menuEdit); editCellSelect->addTo(menuEdit); menuEdit->insertSeparator(); editCut->addTo(menuEdit); editCopy->addTo(menuEdit); editPaste->addTo(menuEdit); editPasteContents->addTo(menuEdit); editClear->addTo(menuEdit); menu->insertItem(tr("&Edit"), menuEdit); menuInsert=new QPopupMenu; menu->insertItem(tr("&Insert"), menuInsert); menuFormat=new QPopupMenu; formatCells->addTo(menuFormat); menu->insertItem(tr("&Format"), menuFormat); menuData=new QPopupMenu; dataSort->addTo(menuData); dataFindReplace->addTo(menuData); menu->insertItem(tr("&Data"), menuData); - menuHelp=new QPopupMenu; - helpGeneral->addTo(menuHelp); - helpAbout->addTo(menuHelp); - menu->insertItem(tr("&Help"), menuHelp); +// menuHelp=new QPopupMenu; +// helpGeneral->addTo(menuHelp); +// helpAbout->addTo(menuHelp); +// menu->insertItem(tr("&Help"), menuHelp); submenuRow=new QPopupMenu; rowHeight->addTo(submenuRow); rowAdjust->addTo(submenuRow); rowShow->addTo(submenuRow); rowHide->addTo(submenuRow); menuFormat->insertItem(tr("&Row"), submenuRow); submenuCol=new QPopupMenu; colWidth->addTo(submenuCol); colAdjust->addTo(submenuCol); colShow->addTo(submenuCol); colHide->addTo(submenuCol); menuFormat->insertItem(tr("Colum&n"), submenuCol); submenuSheet=new QPopupMenu; sheetRename->addTo(submenuSheet); sheetRemove->addTo(submenuSheet); menuFormat->insertItem(tr("&Sheet"), submenuSheet); submenuFunc=new QPopupMenu; menuInsert->insertItem(tr("&Function"), submenuFunc); submenuFuncStd=new QPopupMenu; @@ -496,59 +493,48 @@ void MainWindow::initFunctionsToolbar() toolFunction=new QToolButton(toolbarFunctions); toolFunction->setPixmap(func_func_xpm); toolFunction->setTextLabel(tr("Functions")); toolFunction->setPopup(submenuFunc); toolFunction->setPopupDelay(0); } void MainWindow::initEditToolbar() { toolbarEdit=new QPEToolBar(this); toolbarEdit->setHorizontalStretchable(TRUE); moveToolBar(toolbarEdit, Bottom); editAccept->addTo(toolbarEdit); editCancel->addTo(toolbarEdit); editData=new QLineEdit(toolbarEdit); toolbarEdit->setStretchableWidget(editData); connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); editCellSelect->addTo(toolbarEdit); } -void MainWindow::slotHelpGeneral() -{ - if (QFile::exists(helpFile)) - { - QCopEnvelope e("QPE/Application/helpbrowser", "showFile(QString)"); - e << helpFile; - } - else - QMessageBox::critical(this, tr("Error"), tr("Help file not found!")); -} - void MainWindow::slotHelpAbout() { QDialog dialogAbout(this, 0, TRUE); dialogAbout.resize(width()-40, height()-80); dialogAbout.setCaption(tr("About Opie Sheet")); 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); label.setGeometry(dialogAbout.rect()); label.setAlignment(Qt::AlignCenter | Qt::WordBreak); dialogAbout.exec(); } void MainWindow::initSheet() { sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); setCentralWidget(sheet); connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); diff --git a/noncore/apps/opie-sheet/mainwindow.h b/noncore/apps/opie-sheet/mainwindow.h index d68e25c..10d6650 100644 --- a/noncore/apps/opie-sheet/mainwindow.h +++ b/noncore/apps/opie-sheet/mainwindow.h @@ -67,49 +67,48 @@ class MainWindow: public QMainWindow bool documentModified; // Private functions void initMenu(); void initActions(); void initFunctionsToolbar(); void initEditToolbar(); void initStandardToolbar(); void initSheet(); void addToData(const QString &data); int saveCurrentFile(bool ask=TRUE); void documentOpen(const DocLnk &lnkDoc); void documentSave(DocLnk *lnkDoc); void closeEvent(QCloseEvent *e); void addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w); typeSheet *createNewSheet(); typeSheet *findSheet(const QString &name); private slots: void slotFileNew(); void slotFileOpen(); void slotFileSave(); void slotFileSaveAs(); void slotHelpAbout(); - void slotHelpGeneral(); void slotEditAccept(); void slotEditCancel(); void slotEditPaste(); void slotEditPasteContents(); void slotFormatCells(); void slotInsertCells(); void slotInsertRows(); void slotInsertCols(); void slotInsertSheets(); void slotDataSort(); void slotDataFindReplace(); void slotRowHeight(); void slotRowAdjust(); void slotRowShow(); void slotRowHide(); void slotColumnWidth(); void slotColumnAdjust(); void slotColumnShow(); void slotColumnHide(); void slotSheetRename(); void slotSheetRemove(); void slotFuncOutput(); void slotCellSelect(bool lock); void slotCellClicked(const QString &cell); |