mirror of https://github.com/vitalif/openscad
commit
ef262f62a2
|
@ -144,6 +144,7 @@ void Preferences::init() {
|
|||
Preferences::~Preferences()
|
||||
{
|
||||
removeDefaultSettings();
|
||||
instance = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -501,15 +502,19 @@ void Preferences::apply() const
|
|||
emit syntaxHighlightChanged(getValue("editor/syntaxhighlight").toString());
|
||||
}
|
||||
|
||||
void Preferences::create(QWidget *parent, QStringList colorSchemes)
|
||||
void Preferences::create(QStringList colorSchemes)
|
||||
{
|
||||
if (instance != NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::list<std::string> names = ColorMap::inst()->colorSchemeNames(true);
|
||||
QStringList renderColorSchemes;
|
||||
foreach (std::string name, names) {
|
||||
renderColorSchemes << name.c_str();
|
||||
}
|
||||
|
||||
instance = new Preferences(parent);
|
||||
instance = new Preferences();
|
||||
instance->syntaxHighlight->clear();
|
||||
instance->syntaxHighlight->addItems(colorSchemes);
|
||||
instance->colorSchemeChooser->clear();
|
||||
|
|
|
@ -11,7 +11,7 @@ class Preferences : public QMainWindow, public Ui::Preferences
|
|||
public:
|
||||
~Preferences();
|
||||
|
||||
static void create(QWidget *parent, QStringList colorSchemes);
|
||||
static void create(QStringList colorSchemes);
|
||||
static Preferences *inst();
|
||||
|
||||
QVariant getValue(const QString &key) const;
|
||||
|
|
|
@ -201,7 +201,7 @@ MainWindow::MainWindow(const QString &filename)
|
|||
#endif
|
||||
editor = new LegacyEditor(editorDockContents);
|
||||
|
||||
Preferences::create(this, editor->colorSchemes());
|
||||
Preferences::create(editor->colorSchemes());
|
||||
|
||||
editorDockContents->layout()->addWidget(editor);
|
||||
|
||||
|
|
|
@ -625,13 +625,14 @@ int gui(vector<string> &inputFiles, const fs::path &original_path, int argc, cha
|
|||
}
|
||||
|
||||
MainWindow *mainwin;
|
||||
#ifdef ENABLE_MDI
|
||||
BOOST_FOREACH(const string &infile, inputFiles) {
|
||||
mainwin = new MainWindow(assemblePath(original_path, infile));
|
||||
bool isMdi = settings.value("advanced/mdi", true).toBool();
|
||||
if (isMdi) {
|
||||
BOOST_FOREACH(const string &infile, inputFiles) {
|
||||
mainwin = new MainWindow(assemblePath(original_path, infile));
|
||||
}
|
||||
} else {
|
||||
mainwin = new MainWindow(assemblePath(original_path, inputFiles[0]));
|
||||
}
|
||||
#else
|
||||
mainwin = new MainWindow(assemblePath(original_path, inputFiles[0]));
|
||||
#endif
|
||||
|
||||
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
|
||||
int rc = app.exec();
|
||||
|
@ -782,11 +783,6 @@ int main(int argc, char **argv)
|
|||
if (vm.count("input-file")) {
|
||||
inputFiles = vm["input-file"].as<vector<string> >();
|
||||
}
|
||||
#ifndef ENABLE_MDI
|
||||
if (inputFiles.size() > 1) {
|
||||
help(argv[0]);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (vm.count("colorscheme")) {
|
||||
arg_colorscheme = vm["colorscheme"].as<string>();
|
||||
|
@ -807,6 +803,9 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
if (arg_info || cmdlinemode) {
|
||||
if (inputFiles.size() > 1) {
|
||||
help(argv[0]);
|
||||
}
|
||||
rc = cmdline(deps_output_file, inputFiles[0], camera, output_file, original_path, renderer, argc, argv);
|
||||
}
|
||||
else if (QtUseGUI()) {
|
||||
|
|
Loading…
Reference in New Issue