From 90f574f945d1efc5864f2c337bb24070793a24a4 Mon Sep 17 00:00:00 2001 From: Lukáš Lalinský Date: Fri, 10 Jul 2009 11:42:25 +0200 Subject: Page setup --- src/mainwindow.cpp | 16 ++++++ src/mainwindow.h | 1 + translations/dbmodel_en.ts | 121 +++++++++++++++++++++++--------------------- translations/dbmodel_sk.ts | 123 +++++++++++++++++++++++---------------------- 4 files changed, 144 insertions(+), 117 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1eb136e..451e94a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ public: QAction *printAction; QAction *printPreviewAction; + QAction *pageSetupAction; QActionGroup *notationActionGroup; QMenu *notationMenu; @@ -226,6 +228,10 @@ MainWindow::setupActions() m_actionExportPNG->setText(tr("E&xport...")); connect(m_actionExportPNG, SIGNAL(triggered(bool)), SLOT(exportDocument())); + d->pageSetupAction = new QAction(this); + d->pageSetupAction->setText(tr("Page Set&up...")); + connect(d->pageSetupAction, SIGNAL(triggered(bool)), SLOT(pageSetup())); + d->printAction = new QAction(this); d->printAction->setText(tr("&Print...")); d->printAction->setIcon(loadIcon("document-print")); @@ -398,6 +404,7 @@ MainWindow::setupMenuBar() menu->addAction(m_actionExportPNG); menu->addSeparator(); + menu->addAction(d->pageSetupAction); menu->addAction(d->printPreviewAction); menu->addAction(d->printAction); m_actionRecentFilesSeparator = menu->addSeparator(); @@ -535,6 +542,7 @@ MainWindow::print() void MainWindow::printPreview() { + initPrinter(); QPrintPreviewDialog printPreviewDialog(d->printer, this); connect(&printPreviewDialog, SIGNAL(paintRequested(QPrinter*)), SLOT(printPreview(QPrinter*))); @@ -550,6 +558,14 @@ MainWindow::printPreview(QPrinter *printer) m_model->setPrinting(false); } +void +MainWindow::pageSetup() +{ + initPrinter(); + QPageSetupDialog pageSetupDialog(d->printer, this); + pageSetupDialog.exec(); +} + void MainWindow::newModel(DiagramDocument *newModel) { diff --git a/src/mainwindow.h b/src/mainwindow.h index 7a77b8e..a1b7723 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -56,6 +56,7 @@ public slots: bool saveAs(); void exportDocument(); void print(); + void pageSetup(); void printPreview(); void printPreview(QPrinter *); void setViewScale(const QString &scale); diff --git a/translations/dbmodel_en.ts b/translations/dbmodel_en.ts index 817524a..ba60315 100644 --- a/translations/dbmodel_en.ts +++ b/translations/dbmodel_en.ts @@ -191,280 +191,285 @@ MainWindow - + &Properties - + &New - + Ctrl+N - + &Open... - + Ctrl+O - + &Save - + Ctrl+S - + Save &As... - + E&xport... - + + Page Set&up... + + + + &Print... - + Ctrl+P - + Print Previe&w... - + Ctrl+Shift+P - + Select - + Add new table - + Add new relation - + &Undo - + Ctrl+Z - + Re&do - + Ctrl+Shift+Z - + Cu&t - + Ctrl+X - + &Copy - + Ctrl+C - + &Paste - + Ctrl+V - + &Delete - + Del - + &About... - + &Close - + Ctrl+W - + &Quit - + Ctrl+Q - + Show &Grid - + &Notation - + &Relational - + &Crow's Foot - - + + &File - + &Mode - + 50% - + 70% - + 85% - + 100% - + 125% - + 150% - - + + &View - + &Edit - + &Diagram - + &Help - + The document has been modified. Do you want to save your changes? - + Error - + Unknown format. - + &%1. %2 - + About - + <p> <b>Database Modeller @@ -479,7 +484,7 @@ Copyright (C) 2008 Lukas Lalinsky <p><b>Database Modeller</b><br /><a href="http://oxygene.sk/lukas/dbmodel/">http://oxygene.sk/lukas/dbmodel/</a><br />Copyright (C) 2008 Lukáš Lalinský</p> - + Untitled diff --git a/translations/dbmodel_sk.ts b/translations/dbmodel_sk.ts index 121b2b9..16b71e8 100644 --- a/translations/dbmodel_sk.ts +++ b/translations/dbmodel_sk.ts @@ -199,38 +199,38 @@ MainWindow - + &New &Nový - + Ctrl+N - + &Open... &Otvoriť... - + Ctrl+O - + &Save &Uložiť - + Ctrl+S - + Save &As... Uložiť &ako... @@ -239,251 +239,256 @@ Exportovať... - + Select Výber - + Add new table Pridať novú tabuľku - + Add new relation Pridať nový vzťah - + &Undo Vrátit &späť - + Ctrl+Z - + Re&do &Opakovať vrátené - + Ctrl+Shift+Z - - + + &File &Súbor - + &Mode &Mód - + 50% - + 70% - + 85% - + 100% - + 125% - + 150% - + &Quit &Koniec - + Ctrl+Q - + &Delete &Odstrániť - + Del - + Error Chyba - + Unknown format. Neznámy formát. - + &Edit &Upraviť - + E&xport... E&xportovať... - + + Page Set&up... + Nasta&venie stránky... + + + &Print... &Tlačiť... - + Ctrl+P - + Print Previe&w... - &Náhľad tlače... + Ukážka pr&ed tlačou... - + Ctrl+Shift+P - + Cu&t Vystri&hnúť - + Ctrl+X - + &Copy &Kopírovať - + Ctrl+C - + &Paste &Vložiť - + Ctrl+V - - + + &View &Zobraziť - + The document has been modified. Do you want to save your changes? Dokument bol zmenený. Chcete uložiť Vaše zmeny? - + &%1. %2 - + &About... &O aplikácii... - + &Help &Pomocník - + About O aplikácii - + &Properties &Vlastnosti - + &Close Za&vrieť - + Ctrl+W - + Show &Grid Zobraziť m&riežku - + <p> <b>Database Modeller - + Untitled Nepomenované - + &Notation &Notácia - + &Relational &Relačná - + &Crow's Foot - + &Diagram -- cgit v1.2.3-54-g00ecf