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/thumbnailview.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/thumbnailview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/thumbnailview.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/noncore/graphics/drawpad/thumbnailview.cpp b/noncore/graphics/drawpad/thumbnailview.cpp index 9b08ca2..90ba39c 100644 --- a/noncore/graphics/drawpad/thumbnailview.cpp +++ b/noncore/graphics/drawpad/thumbnailview.cpp @@ -29,2 +29,3 @@ #include <qtoolbutton.h> +#include <qwhatsthis.h> @@ -58,6 +59,7 @@ PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) - m_titleText = QObject::tr("Title:") + " " + m_pPage->title(); - m_dimensionText = QObject::tr("Dimension:") + " " + QString::number(m_pPage->pixmap()->width()) - + "x" + QString::number(m_pPage->pixmap()->height()); - m_dateText = QObject::tr("Date:") + " " + dateTimeString(m_pPage->lastModified()); + m_titleText = QObject::tr( "Title: %1" ).arg( m_pPage->title() ); + m_dimensionText = QObject::tr( "Dimension: %1x%2" ). + arg( m_pPage->pixmap()->width() ). + arg( m_pPage->pixmap()->height() ); + m_dateText = QObject::tr( "Date: %1" ).arg( dateTimeString(m_pPage->lastModified()) ); @@ -146,9 +148,9 @@ QString PageListBoxItem::dateTimeString(QDateTime dateTime) case 0x0001: - result += QString().sprintf("%02d", dateTime.date().day()); + result.append( QString().sprintf("%02d", dateTime.date().day()) ); break; case 0x0002: - result += QString().sprintf("%02d", dateTime.date().month()); + result.append( QString().sprintf("%02d", dateTime.date().month()) ); break; case 0x0004: - result += QString().sprintf("%04d", dateTime.date().year()); + result.append( QString().sprintf("%04d", dateTime.date().year()) ); break; @@ -159,3 +161,3 @@ QString PageListBoxItem::dateTimeString(QDateTime dateTime) if (i < 2) { - result += separator; + result.append( separator ); } @@ -163,3 +165,3 @@ QString PageListBoxItem::dateTimeString(QDateTime dateTime) - result += QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()); + result.append( QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()) ); @@ -231,3 +233,3 @@ Page* PageListBox::selected() const ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) - : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel) + : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel | Qt::WStyle_ContextHelp) { @@ -244,2 +246,3 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi connect(newPageButton, SIGNAL(clicked()), this, SLOT(newPage())); + QWhatsThis::add( newPageButton, tr( "Click here to add a new sheet." ) ); @@ -249,2 +252,3 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi connect(clearPageButton, SIGNAL(clicked()), this, SLOT(clearPage())); + QWhatsThis::add( clearPageButton, tr( "Click here to erase the current sheet." ) ); @@ -254,2 +258,3 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi connect(deletePageButton, SIGNAL(clicked()), this, SLOT(deletePage())); + QWhatsThis::add( deletePageButton, tr( "Click here to remove the current sheet." ) ); @@ -259,3 +264,4 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp())); - + QWhatsThis::add( m_pMovePageUpButton, tr( "Click here to move the current sheet up one position in the list." ) ); + m_pMovePageDownButton = new QToolButton(this); @@ -264,2 +270,3 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown())); + QWhatsThis::add( m_pMovePageDownButton, tr( "Click here to move the current sheet down one position in the list." ) ); |