60 #include <OpenFlipper/common/RecentFiles.hh> 65 void Core::writeObjFile(QString _filename,
bool _relativePaths,
bool _targetOnly, std::map<int,QString>& _fileMapping)
68 std::string fname = _filename.toStdString();
69 std::fstream out(fname.c_str(), std::ios_base::out);
72 emit
log(
LOGERR,tr(
"Cannot open to obj file") + _filename);
77 if ( OpenFlipper::Options::gui() )
79 coreWidget_->statusMessage( tr(
"Saving obj File ") + _filename +
" ...");
93 std::map<int,QString>::iterator f = _fileMapping.find(o_it->id());
94 if(f == _fileMapping.end()) {
95 file = o_it->path() + OpenFlipper::Options::dirSeparator() + o_it->name();
100 if (QFile(file).exists())
105 int prefixLen = _filename.section(OpenFlipper::Options::dirSeparator(),0,-2).length();
106 file.remove(0, prefixLen);
111 out <<
"call " << file.toStdString() <<
"\n";
117 if ( OpenFlipper::Options::gui() )
119 coreWidget_->statusMessage( tr(
"Saving obj File ") + _filename + tr(
" ... done"), 4000);
Status is ready (green light)
const QStringList ALL_OBJECTS
Iterable object range.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
CoreWidget * coreWidget_
The main applications widget ( only created in gui mode )
QStringList IteratorRestriction
Iterable object range.
const QStringList TARGET_OBJECTS("target")
Iterable object range.
ObjectRange objects(IteratorRestriction _restriction, DataType _dataType)
Iterable object range.
Status is processing and blocked system will not allow interaction (red light)
void writeObjFile(QString _filename, bool _relativePaths, bool _targetOnly, std::map< int, QString > &_fileMapping)
Write current status to obj file (Application and File Options)