Merge branch 'WickedSmoke-kr'
commit
a35b98cf15
|
@ -67,3 +67,14 @@ Here is the snapshot of the command line of one build, you may use different def
|
||||||
$ qmake -qt=5 -makefile
|
$ qmake -qt=5 -makefile
|
||||||
$ make
|
$ make
|
||||||
$ ./dust3d
|
$ ./dust3d
|
||||||
|
|
||||||
|
* Fedora
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
$ sudo dnf install qt5-qtbase-devel CGAL-devel
|
||||||
|
$ git clone https://github.com/huxingyi/dust3d.git
|
||||||
|
$ cd dust3d
|
||||||
|
$ qmake-qt5 -makefile
|
||||||
|
$ make
|
||||||
|
$ ./dust3d
|
||||||
|
|
|
@ -6,6 +6,9 @@ RESOURCES += resources.qrc
|
||||||
|
|
||||||
LANGUAGES = zh_CN
|
LANGUAGES = zh_CN
|
||||||
|
|
||||||
|
OBJECTS_DIR=obj
|
||||||
|
MOC_DIR=moc
|
||||||
|
|
||||||
############## Generate .qm from .ts #######################
|
############## Generate .qm from .ts #######################
|
||||||
|
|
||||||
# parameters: var, prepend, append
|
# parameters: var, prepend, append
|
||||||
|
|
|
@ -506,6 +506,10 @@ DocumentWindow::DocumentWindow() :
|
||||||
|
|
||||||
m_fileMenu->addSeparator();
|
m_fileMenu->addSeparator();
|
||||||
|
|
||||||
|
m_quitAction = m_fileMenu->addAction(tr("&Quit"),
|
||||||
|
this, &DocumentWindow::close,
|
||||||
|
QKeySequence::Quit);
|
||||||
|
|
||||||
connect(m_fileMenu, &QMenu::aboutToShow, [=]() {
|
connect(m_fileMenu, &QMenu::aboutToShow, [=]() {
|
||||||
m_exportAsObjAction->setEnabled(m_graphicsWidget->hasItems());
|
m_exportAsObjAction->setEnabled(m_graphicsWidget->hasItems());
|
||||||
//m_exportAsObjPlusMaterialsAction->setEnabled(m_graphicsWidget->hasItems());
|
//m_exportAsObjPlusMaterialsAction->setEnabled(m_graphicsWidget->hasItems());
|
||||||
|
@ -1174,26 +1178,38 @@ DocumentWindow *DocumentWindow::createDocumentWindow()
|
||||||
{
|
{
|
||||||
DocumentWindow *documentWindow = new DocumentWindow();
|
DocumentWindow *documentWindow = new DocumentWindow();
|
||||||
documentWindow->setAttribute(Qt::WA_DeleteOnClose);
|
documentWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
|
QSize size = Preferences::instance().documentWindowSize();
|
||||||
|
if (size.isValid()) {
|
||||||
|
documentWindow->resize(size);
|
||||||
|
documentWindow->show();
|
||||||
|
} else {
|
||||||
documentWindow->showMaximized();
|
documentWindow->showMaximized();
|
||||||
|
}
|
||||||
|
|
||||||
return documentWindow;
|
return documentWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentWindow::closeEvent(QCloseEvent *event)
|
void DocumentWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
if (m_documentSaved) {
|
if (! m_documentSaved) {
|
||||||
event->accept();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QMessageBox::StandardButton answer = QMessageBox::question(this,
|
QMessageBox::StandardButton answer = QMessageBox::question(this,
|
||||||
APP_NAME,
|
APP_NAME,
|
||||||
tr("Do you really want to close while there are unsaved changes?"),
|
tr("Do you really want to close while there are unsaved changes?"),
|
||||||
QMessageBox::Yes | QMessageBox::No,
|
QMessageBox::Yes | QMessageBox::No,
|
||||||
QMessageBox::No);
|
QMessageBox::No);
|
||||||
if (answer == QMessageBox::Yes)
|
if (answer == QMessageBox::No) {
|
||||||
event->accept();
|
|
||||||
else
|
|
||||||
event->ignore();
|
event->ignore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize saveSize;
|
||||||
|
if (!isMaximized())
|
||||||
|
saveSize = size();
|
||||||
|
Preferences::instance().setDocumentWindowSize(saveSize);
|
||||||
|
|
||||||
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentWindow::setCurrentFilename(const QString &filename)
|
void DocumentWindow::setCurrentFilename(const QString &filename)
|
||||||
|
|
|
@ -118,6 +118,7 @@ private:
|
||||||
QAction *m_showPreferencesAction;
|
QAction *m_showPreferencesAction;
|
||||||
QMenu *m_exportMenu;
|
QMenu *m_exportMenu;
|
||||||
QAction *m_changeTurnaroundAction;
|
QAction *m_changeTurnaroundAction;
|
||||||
|
QAction *m_quitAction;
|
||||||
|
|
||||||
QAction *m_exportAsObjAction;
|
QAction *m_exportAsObjAction;
|
||||||
QAction *m_exportAsObjPlusMaterialsAction;
|
QAction *m_exportAsObjPlusMaterialsAction;
|
||||||
|
|
|
@ -81,6 +81,16 @@ void Preferences::setFlatShading(bool flatShading)
|
||||||
emit flatShadingChanged();
|
emit flatShadingChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize Preferences::documentWindowSize() const
|
||||||
|
{
|
||||||
|
return m_settings.value("documentWindowSize", QSize()).toSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Preferences::setDocumentWindowSize(const QSize& size)
|
||||||
|
{
|
||||||
|
m_settings.setValue("documentWindowSize", size);
|
||||||
|
}
|
||||||
|
|
||||||
void Preferences::reset()
|
void Preferences::reset()
|
||||||
{
|
{
|
||||||
m_settings.clear();
|
m_settings.clear();
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define PREFERENCES_H
|
#define PREFERENCES_H
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
#include <QSize>
|
||||||
#include "combinemode.h"
|
#include "combinemode.h"
|
||||||
|
|
||||||
class Preferences : public QObject
|
class Preferences : public QObject
|
||||||
|
@ -13,6 +14,8 @@ public:
|
||||||
CombineMode componentCombineMode() const;
|
CombineMode componentCombineMode() const;
|
||||||
const QColor &partColor() const;
|
const QColor &partColor() const;
|
||||||
bool flatShading() const;
|
bool flatShading() const;
|
||||||
|
QSize documentWindowSize() const;
|
||||||
|
void setDocumentWindowSize(const QSize&);
|
||||||
signals:
|
signals:
|
||||||
void componentCombineModeChanged();
|
void componentCombineModeChanged();
|
||||||
void partColorChanged();
|
void partColorChanged();
|
||||||
|
|
Loading…
Reference in New Issue