Skip to content

Commit 94b1199

Browse files
committed
ensured that draft mode is set for new drawings; LibreCAD#749
1 parent 6fe51b6 commit 94b1199

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

librecad/src/main/qc_applicationwindow.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,15 @@ QC_MDIWindow* QC_ApplicationWindow::slotFileNew(RS_Document* doc) {
11171117
}
11181118

11191119
//check for draft mode
1120-
updateWindowTitle(w);
1120+
1121+
if (settings.value("Appearance/DraftMode", 0).toBool())
1122+
{
1123+
QString draft_string = " ["+tr("Draft Mode")+"]";
1124+
w->getGraphicView()->setDraftMode(true);
1125+
QString title = w->windowTitle();
1126+
w->setWindowTitle(title + draft_string);
1127+
}
1128+
11211129
w->setWindowIcon(QIcon(":/main/document.png"));
11221130

11231131
// only graphics offer block lists, blocks don't
@@ -1385,6 +1393,8 @@ void QC_ApplicationWindow::
13851393
{
13861394
RS_DEBUG->print("QC_ApplicationWindow::slotFileOpen(..)");
13871395

1396+
QSettings settings;
1397+
13881398
QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
13891399

13901400
if ( QFileInfo(fileName).exists())
@@ -1483,7 +1493,14 @@ void QC_ApplicationWindow::
14831493
/* Format and set caption.
14841494
* ----------------------- */
14851495
w->setWindowTitle(format_filename_caption(fileName));
1486-
updateWindowTitle(w);
1496+
if (settings.value("Appearance/DraftMode", 0).toBool())
1497+
{
1498+
QString draft_string = " ["+tr("Draft Mode")+"]";
1499+
w->getGraphicView()->setDraftMode(true);
1500+
w->getGraphicView()->redraw();
1501+
QString title = w->windowTitle();
1502+
w->setWindowTitle(title + draft_string);
1503+
}
14871504

14881505
RS_DEBUG->print("QC_ApplicationWindow::slotFileOpen: set caption: OK");
14891506

0 commit comments

Comments
 (0)