author | drw <drw> | 2003-01-01 20:24:31 (UTC) |
---|---|---|
committer | drw <drw> | 2003-01-01 20:24:31 (UTC) |
commit | 0d5a0d775acbee43ac417e63c64126a4efc50d64 (patch) (side-by-side diff) | |
tree | 0457679736ba2e72539b7538dde63c93a942f797 /noncore/graphics/drawpad/drawpad.cpp | |
parent | 2736ce30d565270495050cec2831d3f31b5c90a0 (diff) | |
download | opie-0d5a0d775acbee43ac417e63c64126a4efc50d64.zip opie-0d5a0d775acbee43ac417e63c64126a4efc50d64.tar.gz opie-0d5a0d775acbee43ac417e63c64126a4efc50d64.tar.bz2 |
Added QWhatsThis and some code optimizations to reduce executable size.
Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index b0a414e..53db993 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp @@ -49,5 +49,6 @@ #include <qtooltip.h> +#include <qwhatsthis.h> DrawPad::DrawPad(QWidget* parent, const char* name) - : QMainWindow(parent, name) + : QMainWindow(parent, name, WStyle_ContextHelp) { @@ -106,13 +107,16 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); + QAction* newPageAction = new QAction(tr("New Page"), Resource::loadPixmap("new"), QString::null, 0, this); connect(newPageAction, SIGNAL(activated()), this, SLOT(newPage())); newPageAction->addTo(pageToolBar); + newPageAction->setWhatsThis( tr( "Click here to add a new sheet." ) ); - QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); + QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadPixmap("drawpad/clear"), QString::null, 0, this); connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); clearPageAction->addTo(pageToolBar); + clearPageAction->setWhatsThis( tr( "Click here to erase the current sheet." ) ); - QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); + QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadPixmap("trash"), QString::null, 0, this); connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); deletePageAction->addTo(pageToolBar); + deletePageAction->setWhatsThis( tr( "Click here to remove the current sheet." ) ); @@ -128,2 +132,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pUndoAction->addTo(navigationToolBar); + m_pUndoAction->setWhatsThis( tr( "Click here to undo the last action." ) ); @@ -132,2 +137,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pRedoAction->addTo(navigationToolBar); + m_pRedoAction->setWhatsThis( tr( "Click here to re-perform the last action." ) ); @@ -136,2 +142,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pFirstPageAction->addTo(navigationToolBar); + m_pFirstPageAction->setWhatsThis( tr( "Click here to view the first page." ) ); @@ -140,2 +147,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pPreviousPageAction->addTo(navigationToolBar); + m_pPreviousPageAction->setWhatsThis( tr( "Click here to view the previous page." ) ); @@ -144,2 +152,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pNextPageAction->addTo(navigationToolBar); + m_pNextPageAction->setWhatsThis( tr( "Click here to view the next page." ) ); @@ -148,2 +157,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pLastPageAction->addTo(navigationToolBar); + m_pLastPageAction->setWhatsThis( tr( "Click here to view the last page." ) ); @@ -155,2 +165,4 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pLineToolButton->setToggleButton(true); + QWhatsThis::add( m_pLineToolButton, tr( "Click here to select one of the available tools to draw lines." ) ); + @@ -158,3 +170,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - m_pPointToolAction = new QAction(tr("Draw Point"), Resource::loadIconSet("drawpad/point.png"), "", 0, this); + m_pPointToolAction = new QAction(tr("Draw Point"), Resource::loadPixmap("drawpad/point"), "", 0, this); connect(m_pPointToolAction, SIGNAL(activated()), this, SLOT(setPointTool())); @@ -162,3 +174,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - m_pLineToolAction = new QAction(tr("Draw Line"), Resource::loadIconSet("drawpad/line.png"), "", 0, this); + m_pLineToolAction = new QAction(tr("Draw Line"), Resource::loadPixmap("drawpad/line"), "", 0, this); connect(m_pLineToolAction, SIGNAL(activated()), this, SLOT(setLineTool())); @@ -171,2 +183,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pRectangleToolButton->setToggleButton(true); + QWhatsThis::add( m_pRectangleToolButton, tr( "Click here to select one of the available tools to draw rectangles." ) ); @@ -174,3 +187,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - m_pRectangleToolAction = new QAction(tr("Draw Rectangle"), Resource::loadIconSet("drawpad/rectangle.png"), "", 0, this); + m_pRectangleToolAction = new QAction(tr("Draw Rectangle"), Resource::loadPixmap("drawpad/rectangle"), "", 0, this); connect(m_pRectangleToolAction, SIGNAL(activated()), this, SLOT(setRectangleTool())); @@ -178,3 +191,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - m_pFilledRectangleToolAction = new QAction(tr("Draw Filled Rectangle"), Resource::loadIconSet("drawpad/filledrectangle.png"), "", 0, this); + m_pFilledRectangleToolAction = new QAction(tr("Draw Filled Rectangle"), Resource::loadPixmap("drawpad/filledrectangle"), "", 0, this); connect(m_pFilledRectangleToolAction, SIGNAL(activated()), this, SLOT(setFilledRectangleTool())); @@ -187,2 +200,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pEllipseToolButton->setToggleButton(true); + QWhatsThis::add( m_pEllipseToolButton, tr( "Click here to select one of the available tools to draw ellipses." ) ); @@ -190,3 +204,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - m_pEllipseToolAction = new QAction(tr("Draw Ellipse"), Resource::loadIconSet("drawpad/ellipse.png"), "", 0, this); + m_pEllipseToolAction = new QAction(tr("Draw Ellipse"), Resource::loadPixmap("drawpad/ellipse"), "", 0, this); connect(m_pEllipseToolAction, SIGNAL(activated()), this, SLOT(setEllipseTool())); @@ -194,3 +208,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - m_pFilledEllipseToolAction = new QAction(tr("Draw Filled Ellipse"), Resource::loadIconSet("drawpad/filledellipse.png"), "", 0, this); + m_pFilledEllipseToolAction = new QAction(tr("Draw Filled Ellipse"), Resource::loadPixmap("drawpad/filledellipse"), "", 0, this); connect(m_pFilledEllipseToolAction, SIGNAL(activated()), this, SLOT(setFilledEllipseTool())); @@ -201,3 +215,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) - m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadIconSet("drawpad/text.png"), QString::null, 0, this); + m_pTextToolAction = new QAction(tr("Insert Text"), Resource::loadPixmap("drawpad/text"), QString::null, 0, this); m_pTextToolAction->setToggleAction(true); @@ -205,4 +219,5 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pTextToolAction->addTo(drawModeToolBar); + m_pTextToolAction->setWhatsThis( tr( "Click here to select the text drawing tool." ) ); - m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadIconSet("drawpad/fill.png"), QString::null, 0, this); + m_pFillToolAction = new QAction(tr("Fill Region"), Resource::loadPixmap("drawpad/fill"), QString::null, 0, this); m_pFillToolAction->setToggleAction(true); @@ -210,4 +225,5 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pFillToolAction->addTo(drawModeToolBar); + m_pFillToolAction->setWhatsThis( tr( "Click here to select the fill tool." ) ); - m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadIconSet("drawpad/erase.png"), QString::null, 0, this); + m_pEraseToolAction = new QAction(tr("Erase Point"), Resource::loadPixmap("drawpad/erase"), QString::null, 0, this); m_pEraseToolAction->setToggleAction(true); @@ -215,2 +231,3 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pEraseToolAction->addTo(drawModeToolBar); + m_pEraseToolAction->setWhatsThis( tr( "Click here to select the eraser tool." ) ); @@ -235,5 +252,7 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pPenWidthSpinBox->setFocusPolicy(QWidget::NoFocus); + QWhatsThis::add( m_pPenWidthSpinBox, tr( "Click here to select the width of the drawing pen." ) ); m_pPenColorToolButton = new QToolButton(drawParametersToolBar); - m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor.png")); + m_pPenColorToolButton->setPixmap(Resource::loadPixmap("drawpad/pencolor")); + QWhatsThis::add( m_pPenColorToolButton, tr( "Click here to select the color used when drawing." ) ); @@ -249,3 +268,4 @@ DrawPad::DrawPad(QWidget* parent, const char* name) m_pBrushColorToolButton = new QToolButton(drawParametersToolBar); - m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor.png")); + m_pBrushColorToolButton->setPixmap(Resource::loadPixmap("drawpad/brushcolor")); + QWhatsThis::add( m_pBrushColorToolButton, tr( "Click here to select the color used when filling in areas." ) ); @@ -547,4 +567,3 @@ void DrawPad::updateView() - setCaption(tr("DrawPad") + " - " + tr("Page") + " " - + QString::number(pagePosition) + "/" + QString::number(pageCount)); + setCaption( tr( "DrawPad - Page %1/%2" ).arg( pagePosition ).arg( pageCount ) ); |