From 90d20f6d02a773804438acfd099a110bed96fa65 Mon Sep 17 00:00:00 2001 From: aizenbit Date: Mon, 13 Jun 2016 13:45:34 +0300 Subject: [PATCH] translation improved; unused code removed; version changed --- fontdialog.cpp | 3 --- main.cpp | 6 +++++- mainwindow.cpp | 1 - mainwindow.h | 2 +- preferencesdialog.cpp | 3 --- svgview.cpp | 26 -------------------------- svgview.h | 1 - 7 files changed, 6 insertions(+), 36 deletions(-) diff --git a/fontdialog.cpp b/fontdialog.cpp index 506d1d4..c952570 100644 --- a/fontdialog.cpp +++ b/fontdialog.cpp @@ -62,9 +62,6 @@ FontDialog::FontDialog(QWidget *parent) : ui->treeWidget->sortByColumn(0, Qt::AscendingOrder); ui->splitter->setSizes(QList () << 200 << 350); lastItem = nullptr; - - ui->buttonBox->button(QDialogButtonBox::Save)->setText(tr("Save")); - ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel")); } FontDialog::~FontDialog() diff --git a/main.cpp b/main.cpp index a6f8aba..7c9fb5d 100644 --- a/main.cpp +++ b/main.cpp @@ -10,9 +10,13 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); QTranslator myTranslator; - myTranslator.load("Scribbler-" + QLocale::system().name()); + myTranslator.load("Scribbler-" + QLocale::system().name(), "translations"); a.installTranslator(&myTranslator); + QTranslator qtTranslator; + qtTranslator.load("qt_" + QLocale::system().name(), "translations"); + a.installTranslator(&qtTranslator); + qApp->addLibraryPath("./plugins"); MainWindow w; w.show(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 93ecc6e..8f12f4f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -424,7 +424,6 @@ void MainWindow::printAllSheets(QPrinter *printer) { //i.e. while printing all sheets renderNextSheet(); ui->svgView->hideBorders(true); - int to = printer->toPage(), from = printer->fromPage(); if (printer->fromPage() != 0 && printer->fromPage() > currentSheetNumber + 1) continue; diff --git a/mainwindow.h b/mainwindow.h index f3e040f..fbd3243 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -46,7 +46,7 @@ class MainWindow : public QMainWindow QLabel *sheetNumberLabel; QVector sheetPointers; //pointers to the beginning of the sheets int currentSheetNumber; //number of sheet that is displaying or rendering now - const QString version = "0.8.1 beta"; + const QString version = "0.8.2 beta"; void saveAllSheetsToImages(const QString &fileName, const int indexOfExtension); void saveAllSheetsToPDF(const QString &fileName); void preparePrinter(QPrinter *printer); diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp index a88bd0c..9e72dcf 100644 --- a/preferencesdialog.cpp +++ b/preferencesdialog.cpp @@ -38,9 +38,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) : ui->seedSpinBox->setMaximum(std::numeric_limits::max()); ui->seedSpinBox->setMinimum(std::numeric_limits::min()); - - ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK")); - ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel")); } PreferencesDialog::~PreferencesDialog() diff --git a/svgview.cpp b/svgview.cpp index 6f79af1..22d072a 100644 --- a/svgview.cpp +++ b/svgview.cpp @@ -362,32 +362,6 @@ void SvgView::connectLetters() } } -void SvgView::connectLastLetterToCurrent() -{ - QSizeF lastLetterBoundingRect; - lastLetterBoundingRect.setWidth(lastLetter->boundingRect().width() * lastLetter->scale()); - lastLetterBoundingRect.setHeight(lastLetter->boundingRect().height() * lastLetter->scale()); - - QPointF inPoint, outPoint; - outPoint.rx() = previousSymbolCursor.x() + - previousSymbolData.outPoint.x() * lastLetterBoundingRect.width(); - outPoint.ry() = previousSymbolCursor.y() + - previousSymbolData.outPoint.y() * lastLetterBoundingRect.height() - - lastLetterBoundingRect.height() * previousSymbolData.limits.topLeft().y(); - - inPoint.rx() = cursor.x() + - symbolData.inPoint.x() * symbolBoundingSize.width(); - inPoint.ry() = cursor.y() + - symbolData.inPoint.y() * symbolBoundingSize.height() - - symbolBoundingSize.height() * symbolData.limits.topLeft().y(); - - QPen pen(fontColor); - pen.setWidth(penWidth * dpmm); - pen.setCapStyle(Qt::RoundCap); - - scene->addLine(outPoint.x(), outPoint.y(), inPoint.x(), inPoint.y(), pen); -} - void SvgView::processUnknownSymbol(const QChar &symbol) { switch (symbol.toLatin1()) diff --git a/svgview.h b/svgview.h index 84156f7..24f717d 100644 --- a/svgview.h +++ b/svgview.h @@ -72,7 +72,6 @@ public slots: void limitScale(qreal factor); //limited view zoom void prepareSceneToRender(); bool preventGoingBeyondRightMargin(qreal letterWidth, QStringRef text, int currentSymbolIndex); - void connectLastLetterToCurrent(); void connectLetters(); void processUnknownSymbol(const QChar &symbol); void insertSymbol(QChar key, SymbolData &symbolData);