From 62a36598c2e686145bc281cc92f644cfda1e3bda Mon Sep 17 00:00:00 2001 From: Konstantin Isakov Date: Sun, 24 May 2009 18:51:45 +0000 Subject: [PATCH] +! Check printer validity before entering Page Setup - this fixes fault when no printer is installed. --- src/locale/ru.ts | 20 +++++++++++++++----- src/mainwindow.cc | 10 ++++++++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/locale/ru.ts b/src/locale/ru.ts index 73d8f072..cc3c8fca 100644 --- a/src/locale/ru.ts +++ b/src/locale/ru.ts @@ -2221,27 +2221,37 @@ Пропустить данную версию - + + Page Setup + Параметры страницы + + + + No printer is available. Please install one first. + В системе не установлено ни одного принтера. + + + Print Article Печать статьи - + Save Article As Сохранить статью как - + Html files (*.html *.htm) Файлы Html (*.html *.htm) - + Error Ошибка - + Can't save article: %1 Невозможно сохранить статью: %1 diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 7e4bb6a8..6f95b9a2 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -1357,9 +1357,15 @@ void MainWindow::on_actionCloseToTray_activated() void MainWindow::on_pageSetup_activated() { - QPageSetupDialog dialog( &printer, this ); + if ( printer.isValid() ) + { + QPageSetupDialog dialog( &printer, this ); - dialog.exec(); + dialog.exec(); + } + else + QMessageBox::critical( this, tr( "Page Setup" ), + tr( "No printer is available. Please install one first." ) ); } void MainWindow::on_printPreview_activated()