Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add message window when print.

  • Loading branch information...
commit 4836bfb1765554723c1103323b559b451fb36738 1 parent a122e55
@SokoloffA SokoloffA authored
View
50 gui/mainwindow.cpp
@@ -40,7 +40,7 @@
#include <QDir>
#include <QProcess>
#include <QDebug>
-
+#include <QTimer>
/************************************************
@@ -438,10 +438,19 @@ QTemporaryFile *MainWindow::getTmpFile()
/************************************************
************************************************/
-void MainWindow::print()
+void MainWindow::print(bool close)
{
+ QMessageBox *infoDialog = new QMessageBox(this);
+ infoDialog->setWindowTitle(this->windowTitle() + " ");
+ infoDialog->setIconPixmap(QPixmap(":/images/print-48x48"));
+ infoDialog->setStandardButtons(QMessageBox::NoButton);
+
if (mProject->printer()->duplex())
{
+ infoDialog->setText(tr("I print the all pages on %1.").arg(mProject->printer()->printerName()));
+ infoDialog->show();
+ qApp->processEvents();
+
QTemporaryFile *file = getTmpFile();
if (!file)
return;
@@ -472,25 +481,30 @@ void MainWindow::print()
}
// Show dialog ....................................
- QMessageBox dialog(this);
- dialog.setWindowTitle(this->windowTitle() + " ");
- dialog.setIconPixmap(QPixmap(":/images/print-48x48"));
-
- dialog.setText(tr("I print the odd pages.<p>"
- "When finished, turn the pages, insert them into the printer<br>"
- "and click the Continue button."));
+ {
+ QMessageBox dialog(this);
+ dialog.setWindowTitle(this->windowTitle() + " ");
+ dialog.setIconPixmap(QPixmap(":/images/print-48x48"));
- dialog.addButton(QMessageBox::Abort);
+ dialog.setText(tr("I print the odd pages on %1.<p>"
+ "When finished, turn the pages, insert them into the printer<br>"
+ "and click the Continue button.").arg(mProject->printer()->printerName()));
- QPushButton *btn = dialog.addButton(QMessageBox::Ok);
- btn->setText(tr("Continue"));
+ dialog.addButton(QMessageBox::Abort);
+ QPushButton *btn = dialog.addButton(QMessageBox::Ok);
+ btn->setText(tr("Continue"));
- if (dialog.exec() != QMessageBox::Ok)
- return;
+ if (dialog.exec() != QMessageBox::Ok)
+ return;
+ }
// ................................................
// Print even pages ...............................
{
+ infoDialog->setText(tr("I print the even pages on %1.").arg(mProject->printer()->printerName()));
+ infoDialog->show();
+ qApp->processEvents();
+
QTemporaryFile *file = getTmpFile();
if (!file)
return;
@@ -503,6 +517,11 @@ void MainWindow::print()
delete file;
}
}
+
+ if (close)
+ QTimer::singleShot(200, this, SLOT(close()));
+ else
+ QTimer::singleShot(200, infoDialog, SLOT(deleteLater()));
}
@@ -511,8 +530,7 @@ void MainWindow::print()
************************************************/
void MainWindow::printAndClose()
{
- print();
- close();
+ print(true);
}
View
2  gui/mainwindow.h
@@ -58,7 +58,7 @@ private slots:
void switchToFile(PsFile *file);
- void print();
+ void print(bool close = false);
void printAndClose();
void updateCurrentSheet();
View
4 gui/psview.cpp
@@ -101,12 +101,12 @@ void PsView::paintEvent(QPaintEvent *event)
if (!mSheet)
return;
- QImage img = mImage.scaled(event->rect().width() - 20, event->rect().height() - 20, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ QImage img = mImage.scaled(this->geometry().width() - 20, this->geometry().height() - 20, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QRect dRect = img.rect();
QRect sRect = img.rect();
- dRect.moveCenter(event->rect().center());
+ dRect.moveCenter(this->geometry().center());
QPoint foldStart, foldEnd;
if (mSheet->hints().testFlag(PsSheet::HintDrawFold))
View
79 gui/translations/boomaga_ru.ts
@@ -27,47 +27,47 @@
<translation>Переводы</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="84"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="81"/>
<source>Version: %1</source>
<translation>Версия: %1</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="95"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="92"/>
<source>Boomaga provides a virtual printer for CUPS. This can be used for print preview or for print booklets.</source>
<translation>Boomaga это виртуальный принтер для CUPS. Программа можно использовать для предпросмотра или для печати буклетов.</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="96"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="93"/>
<source>Copyright: %1-%2 %3</source>
<translation>Авторские права: %1-%2 %3</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="98"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="95"/>
<source>Homepage: %1</source>
<translation>Домашняя страница: %1</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="99"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="96"/>
<source>License: %1</source>
<translation>Лицензия: %1</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="113"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="110"/>
<source>Boomaga is developed by the &lt;a %1&gt;Boomaga Team and contributors&lt;/a&gt; on Github.</source>
- <translation>Boomaga разрабатывается &lt;a %1&gt;командой Razor-qt и помощниками &lt;/a&gt; на Github.</translation>
+ <translation>Boomaga разрабатывается &lt;a %1&gt;командой Boomaga и помощниками &lt;/a&gt; на Github.</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="115"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="112"/>
<source>If you are interested in working with our development team, &lt;a %1&gt;join us&lt;/a&gt;.</source>
<translation>Если есть желание работать вместе с нашей командой разработчиков - &lt;a %1&gt;присоединяйтесь&lt;/a&gt;.</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="130"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="127"/>
<source>Special thanks to:</source>
<translation>Отдельное спасибо:</translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="141"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="138"/>
<source>If you want to help translate we will be glad to see you in our translation team on &lt;a %1&gt;Transifex server&lt;/a&gt;.</source>
<translation>Если Вы хотите помочь с переводом мы будем рады видеть вас в нашей команде переводчиков на &lt;a %1&gt;Transifex server&lt;/a&gt;.</translation>
</message>
@@ -130,52 +130,52 @@
<translation>Задания</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="179"/>
+ <location filename="../mainwindow.ui" line="191"/>
<source>Printer</source>
<translation>Принтер</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="191"/>
+ <location filename="../mainwindow.ui" line="203"/>
<source>Configure ...</source>
<translation>Настроить ...</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="216"/>
+ <location filename="../mainwindow.ui" line="228"/>
<source>toolBar</source>
<translation>тулбар</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="235"/>
+ <location filename="../mainwindow.ui" line="247"/>
<source>&amp;Print</source>
<translation>&amp;Печать</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="240"/>
+ <location filename="../mainwindow.ui" line="252"/>
<source>E&amp;xit</source>
<translation&amp;ыход</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="245"/>
+ <location filename="../mainwindow.ui" line="257"/>
<source>Print and Close</source>
<translation>Печать и выход</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="248"/>
+ <location filename="../mainwindow.ui" line="260"/>
<source>Ctrl+P</source>
<translation>Ctrl+P</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="253"/>
+ <location filename="../mainwindow.ui" line="265"/>
<source>Next sheet</source>
<translation>Следующий</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="258"/>
+ <location filename="../mainwindow.ui" line="270"/>
<source>Previous sheet</source>
<translation>Предыдущий</translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="263"/>
+ <location filename="../mainwindow.ui" line="275"/>
<source>About Boomaga</source>
<translation>О программе</translation>
</message>
@@ -185,37 +185,47 @@
<translation>Boomaga</translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="267"/>
+ <location filename="../mainwindow.cpp" line="270"/>
<source>%1 pages</source>
<translation>%1 страниц</translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="267"/>
+ <location filename="../mainwindow.cpp" line="270"/>
<source>%1 page</source>
<translation>%1 страница</translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="268"/>
+ <location filename="../mainwindow.cpp" line="271"/>
<source>%1 sheets</source>
<translation>%1 листов</translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="268"/>
+ <location filename="../mainwindow.cpp" line="271"/>
<source>%1 sheet</source>
<translation>%1 лист</translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="275"/>
+ <location filename="../mainwindow.cpp" line="278"/>
<source>Sheet %1 of %2</source>
<translation>Стр. %1 из %2</translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="474"/>
- <source>I print the odd pages.&lt;p&gt;When finished, turn the pages, insert them into the printer&lt;br&gt;and click the Continue button.</source>
- <translation>Сейчас печатаются нечетные страницы.&lt;p&gt;После окончания переверните страницы, вставьте их в принтер&lt;br&gt;и нажмите кнопку &quot;Продолжить&quot;.</translation>
+ <location filename="../mainwindow.cpp" line="450"/>
+ <source>I print the all pages on %1.</source>
+ <translation>Сейчас печатаются все страницы на %1.</translation>
+ </message>
+ <message>
+ <location filename="../mainwindow.cpp" line="489"/>
+ <source>I print the odd pages on %1.&lt;p&gt;When finished, turn the pages, insert them into the printer&lt;br&gt;and click the Continue button.</source>
+ <translation>Сейчас печатаются нечетные страницы на %1.&lt;p&gt;После окончания переверните страницы, вставьте их в принтер&lt;br&gt;и нажмите кнопку &quot;Продолжить&quot;.</translation>
+ </message>
+ <message>
+ <location filename="../mainwindow.cpp" line="504"/>
+ <source>I print the even pages on %1.</source>
+ <translation>Сейчас печатаются четные страницы на %1.</translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="481"/>
+ <location filename="../mainwindow.cpp" line="495"/>
<source>Continue</source>
<translation>Продолжить</translation>
</message>
@@ -263,6 +273,11 @@
<translation>Печатать рамку</translation>
</message>
<message>
+ <location filename="../printersettings/printersettings.ui" line="137"/>
+ <source>Print in reverse order</source>
+ <translation>Печатать в обратном порядке</translation>
+ </message>
+ <message>
<location filename="../printersettings/printersettings.cpp" line="98"/>
<source>Prefferences of &quot;%1&quot;</source>
<translation>Настройки &quot;%1&quot;</translation>
@@ -271,17 +286,17 @@
<context>
<name>PsFilesListView</name>
<message>
- <location filename="../widgets.cpp" line="152"/>
+ <location filename="../widgets.cpp" line="153"/>
<source>( %1 pages ) </source>
<translation>( %1 стр.) </translation>
</message>
<message>
- <location filename="../widgets.cpp" line="153"/>
+ <location filename="../widgets.cpp" line="154"/>
<source>Untitled</source>
<translation>Без имени</translation>
</message>
<message>
- <location filename="../widgets.cpp" line="170"/>
+ <location filename="../widgets.cpp" line="171"/>
<source>Delete job</source>
<translation>Удалить</translation>
</message>
View
75 gui/translations/src.boomaga.ts
@@ -29,47 +29,47 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="84"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="81"/>
<source>Version: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="95"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="92"/>
<source>Boomaga provides a virtual printer for CUPS. This can be used for print preview or for print booklets.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="96"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="93"/>
<source>Copyright: %1-%2 %3</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="98"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="95"/>
<source>Homepage: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="99"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="96"/>
<source>License: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="113"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="110"/>
<source>Boomaga is developed by the &lt;a %1&gt;Boomaga Team and contributors&lt;/a&gt; on Github.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="115"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="112"/>
<source>If you are interested in working with our development team, &lt;a %1&gt;join us&lt;/a&gt;.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="130"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="127"/>
<source>Special thanks to:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../aboutdialog/aboutdialog.cpp" line="141"/>
+ <location filename="../aboutdialog/aboutdialog.cpp" line="138"/>
<source>If you want to help translate we will be glad to see you in our translation team on &lt;a %1&gt;Transifex server&lt;/a&gt;.</source>
<translation type="unfinished"></translation>
</message>
@@ -132,52 +132,52 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="179"/>
+ <location filename="../mainwindow.ui" line="191"/>
<source>Printer</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="191"/>
+ <location filename="../mainwindow.ui" line="203"/>
<source>Configure ...</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="216"/>
+ <location filename="../mainwindow.ui" line="228"/>
<source>toolBar</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="235"/>
+ <location filename="../mainwindow.ui" line="247"/>
<source>&amp;Print</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="240"/>
+ <location filename="../mainwindow.ui" line="252"/>
<source>E&amp;xit</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="245"/>
+ <location filename="../mainwindow.ui" line="257"/>
<source>Print and Close</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="248"/>
+ <location filename="../mainwindow.ui" line="260"/>
<source>Ctrl+P</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="253"/>
+ <location filename="../mainwindow.ui" line="265"/>
<source>Next sheet</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="258"/>
+ <location filename="../mainwindow.ui" line="270"/>
<source>Previous sheet</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.ui" line="263"/>
+ <location filename="../mainwindow.ui" line="275"/>
<source>About Boomaga</source>
<translation type="unfinished"></translation>
</message>
@@ -187,37 +187,47 @@
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="267"/>
+ <location filename="../mainwindow.cpp" line="270"/>
<source>%1 pages</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="267"/>
+ <location filename="../mainwindow.cpp" line="270"/>
<source>%1 page</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="268"/>
+ <location filename="../mainwindow.cpp" line="271"/>
<source>%1 sheets</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="268"/>
+ <location filename="../mainwindow.cpp" line="271"/>
<source>%1 sheet</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="275"/>
+ <location filename="../mainwindow.cpp" line="278"/>
<source>Sheet %1 of %2</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="474"/>
- <source>I print the odd pages.&lt;p&gt;When finished, turn the pages, insert them into the printer&lt;br&gt;and click the Continue button.</source>
+ <location filename="../mainwindow.cpp" line="450"/>
+ <source>I print the all pages on %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../mainwindow.cpp" line="489"/>
+ <source>I print the odd pages on %1.&lt;p&gt;When finished, turn the pages, insert them into the printer&lt;br&gt;and click the Continue button.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../mainwindow.cpp" line="481"/>
+ <location filename="../mainwindow.cpp" line="504"/>
+ <source>I print the even pages on %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../mainwindow.cpp" line="495"/>
<source>Continue</source>
<translation type="unfinished"></translation>
</message>
@@ -265,6 +275,11 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <location filename="../printersettings/printersettings.ui" line="137"/>
+ <source>Print in reverse order</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<location filename="../printersettings/printersettings.cpp" line="98"/>
<source>Prefferences of &quot;%1&quot;</source>
<translation type="unfinished"></translation>
@@ -273,17 +288,17 @@
<context>
<name>PsFilesListView</name>
<message>
- <location filename="../widgets.cpp" line="152"/>
+ <location filename="../widgets.cpp" line="153"/>
<source>( %1 pages ) </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../widgets.cpp" line="153"/>
+ <location filename="../widgets.cpp" line="154"/>
<source>Untitled</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../widgets.cpp" line="170"/>
+ <location filename="../widgets.cpp" line="171"/>
<source>Delete job</source>
<translation type="unfinished"></translation>
</message>
Please sign in to comment.
Something went wrong with that request. Please try again.