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 | |||
@@ -28,4 +28,5 @@ | |||
28 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
29 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
30 | #include <qwhatsthis.h> | ||
30 | 31 | ||
31 | #define THUMBNAIL_SIZE 48 | 32 | #define THUMBNAIL_SIZE 48 |
@@ -57,8 +58,9 @@ PageListBoxItem::PageListBoxItem(Page* page, QListBox* parent) | |||
57 | m_thumbnail.convertFromImage(thumbnailImage); | 58 | m_thumbnail.convertFromImage(thumbnailImage); |
58 | 59 | ||
59 | m_titleText = QObject::tr("Title:") + " " + m_pPage->title(); | 60 | m_titleText = QObject::tr( "Title: %1" ).arg( m_pPage->title() ); |
60 | m_dimensionText = QObject::tr("Dimension:") + " " + QString::number(m_pPage->pixmap()->width()) | 61 | m_dimensionText = QObject::tr( "Dimension: %1x%2" ). |
61 | + "x" + QString::number(m_pPage->pixmap()->height()); | 62 | arg( m_pPage->pixmap()->width() ). |
62 | m_dateText = QObject::tr("Date:") + " " + dateTimeString(m_pPage->lastModified()); | 63 | arg( m_pPage->pixmap()->height() ); |
64 | m_dateText = QObject::tr( "Date: %1" ).arg( dateTimeString(m_pPage->lastModified()) ); | ||
63 | 65 | ||
64 | QColor baseColor = parent->colorGroup().base(); | 66 | QColor baseColor = parent->colorGroup().base(); |
@@ -145,11 +147,11 @@ QString PageListBoxItem::dateTimeString(QDateTime dateTime) | |||
145 | switch((shortOrder >> (i * 3)) & 0x0007) { | 147 | switch((shortOrder >> (i * 3)) & 0x0007) { |
146 | case 0x0001: | 148 | case 0x0001: |
147 | result += QString().sprintf("%02d", dateTime.date().day()); | 149 | result.append( QString().sprintf("%02d", dateTime.date().day()) ); |
148 | break; | 150 | break; |
149 | case 0x0002: | 151 | case 0x0002: |
150 | result += QString().sprintf("%02d", dateTime.date().month()); | 152 | result.append( QString().sprintf("%02d", dateTime.date().month()) ); |
151 | break; | 153 | break; |
152 | case 0x0004: | 154 | case 0x0004: |
153 | result += QString().sprintf("%04d", dateTime.date().year()); | 155 | result.append( QString().sprintf("%04d", dateTime.date().year()) ); |
154 | break; | 156 | break; |
155 | default: | 157 | default: |
@@ -158,9 +160,9 @@ QString PageListBoxItem::dateTimeString(QDateTime dateTime) | |||
158 | 160 | ||
159 | if (i < 2) { | 161 | if (i < 2) { |
160 | result += separator; | 162 | result.append( separator ); |
161 | } | 163 | } |
162 | } | 164 | } |
163 | 165 | ||
164 | result += QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()); | 166 | result.append( QString().sprintf(" %02d:%02d", dateTime.time().hour(), dateTime.time().minute()) ); |
165 | 167 | ||
166 | return result; | 168 | return result; |
@@ -230,5 +232,5 @@ Page* PageListBox::selected() const | |||
230 | 232 | ||
231 | ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) | 233 | ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) |
232 | : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel) | 234 | : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel | Qt::WStyle_ContextHelp) |
233 | { | 235 | { |
234 | inLoop = false; | 236 | inLoop = false; |
@@ -243,4 +245,5 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi | |||
243 | newPageButton->setAutoRaise(true); | 245 | newPageButton->setAutoRaise(true); |
244 | connect(newPageButton, SIGNAL(clicked()), this, SLOT(newPage())); | 246 | connect(newPageButton, SIGNAL(clicked()), this, SLOT(newPage())); |
247 | QWhatsThis::add( newPageButton, tr( "Click here to add a new sheet." ) ); | ||
245 | 248 | ||
246 | QToolButton* clearPageButton = new QToolButton(this); | 249 | QToolButton* clearPageButton = new QToolButton(this); |
@@ -248,4 +251,5 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi | |||
248 | clearPageButton->setAutoRaise(true); | 251 | clearPageButton->setAutoRaise(true); |
249 | connect(clearPageButton, SIGNAL(clicked()), this, SLOT(clearPage())); | 252 | connect(clearPageButton, SIGNAL(clicked()), this, SLOT(clearPage())); |
253 | QWhatsThis::add( clearPageButton, tr( "Click here to erase the current sheet." ) ); | ||
250 | 254 | ||
251 | QToolButton* deletePageButton = new QToolButton(this); | 255 | QToolButton* deletePageButton = new QToolButton(this); |
@@ -253,4 +257,5 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi | |||
253 | deletePageButton->setAutoRaise(true); | 257 | deletePageButton->setAutoRaise(true); |
254 | connect(deletePageButton, SIGNAL(clicked()), this, SLOT(deletePage())); | 258 | connect(deletePageButton, SIGNAL(clicked()), this, SLOT(deletePage())); |
259 | QWhatsThis::add( deletePageButton, tr( "Click here to remove the current sheet." ) ); | ||
255 | 260 | ||
256 | m_pMovePageUpButton = new QToolButton(this); | 261 | m_pMovePageUpButton = new QToolButton(this); |
@@ -258,9 +263,11 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi | |||
258 | m_pMovePageUpButton->setAutoRaise(true); | 263 | m_pMovePageUpButton->setAutoRaise(true); |
259 | connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp())); | 264 | connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp())); |
260 | 265 | QWhatsThis::add( m_pMovePageUpButton, tr( "Click here to move the current sheet up one position in the list." ) ); | |
266 | |||
261 | m_pMovePageDownButton = new QToolButton(this); | 267 | m_pMovePageDownButton = new QToolButton(this); |
262 | m_pMovePageDownButton->setIconSet(Resource::loadIconSet("down")); | 268 | m_pMovePageDownButton->setIconSet(Resource::loadIconSet("down")); |
263 | m_pMovePageDownButton->setAutoRaise(true); | 269 | m_pMovePageDownButton->setAutoRaise(true); |
264 | connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown())); | 270 | connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown())); |
271 | QWhatsThis::add( m_pMovePageDownButton, tr( "Click here to move the current sheet down one position in the list." ) ); | ||
265 | 272 | ||
266 | m_pPageListBox = new PageListBox(m_pDrawPadCanvas, this); | 273 | m_pPageListBox = new PageListBox(m_pDrawPadCanvas, this); |