+ fixes #0001689: Show name of the drawing page in the tab of the drawing
This commit is contained in:
parent
8808b82371
commit
6556bc776a
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QFileInfo>
|
||||
# include <QIcon>
|
||||
# include <QImage>
|
||||
# include <sstream>
|
||||
|
@ -61,7 +62,8 @@ open(PyObject *self, PyObject *args)
|
|||
DrawingView* view = new DrawingView(0, Gui::getMainWindow());
|
||||
view->load(fileName);
|
||||
view->setWindowIcon(Gui::BitmapFactory().pixmap("actions/drawing-landscape"));
|
||||
view->setWindowTitle(QObject::tr("Drawing viewer"));
|
||||
QFileInfo fi(fileName);
|
||||
view->setWindowTitle(fi.fileName());
|
||||
view->resize( 400, 300 );
|
||||
Gui::getMainWindow()->addWindow(view);
|
||||
}
|
||||
|
@ -91,7 +93,8 @@ importer(PyObject *self, PyObject *args)
|
|||
DrawingView* view = new DrawingView(0, Gui::getMainWindow());
|
||||
view->load(fileName);
|
||||
view->setWindowIcon(Gui::BitmapFactory().pixmap("actions/drawing-landscape"));
|
||||
view->setWindowTitle(QObject::tr("Drawing viewer"));
|
||||
QFileInfo fi(fileName);
|
||||
view->setWindowTitle(fi.fileName());
|
||||
view->resize( 400, 300 );
|
||||
Gui::getMainWindow()->addWindow(view);
|
||||
} else {
|
||||
|
|
|
@ -347,6 +347,15 @@ bool DrawingView::onHasMsg(const char* pMsg) const
|
|||
return false;
|
||||
}
|
||||
|
||||
void DrawingView::onRelabel(Gui::Document *pDoc)
|
||||
{
|
||||
const char* name = pDoc->getDocument()->Label.getValue();
|
||||
QString title = QString::fromAscii("%1 : %2[*]")
|
||||
.arg(QString::fromUtf8(name))
|
||||
.arg(tr("Drawing"));
|
||||
this->setWindowTitle(title);
|
||||
}
|
||||
|
||||
void DrawingView::printPdf()
|
||||
{
|
||||
Gui::FileOptionsDialog dlg(this, 0);
|
||||
|
|
|
@ -89,6 +89,7 @@ public Q_SLOTS:
|
|||
public:
|
||||
bool onMsg(const char* pMsg,const char** ppReturn);
|
||||
bool onHasMsg(const char* pMsg) const;
|
||||
void onRelabel(Gui::Document *pDoc);
|
||||
void print();
|
||||
void printPdf();
|
||||
void printPreview();
|
||||
|
|
|
@ -136,7 +136,7 @@ DrawingView* ViewProviderDrawingPage::showDrawingView()
|
|||
(this->pcObject->getDocument());
|
||||
view = new DrawingView(doc, Gui::getMainWindow());
|
||||
view->setWindowIcon(Gui::BitmapFactory().pixmap("actions/drawing-landscape"));
|
||||
view->setWindowTitle(QObject::tr("Drawing viewer") + QString::fromAscii("[*]"));
|
||||
view->onRelabel(doc);
|
||||
Gui::getMainWindow()->addWindow(view);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user