git-svn-id: svn://db.shs.com.ru/libs@275 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -57,6 +57,7 @@ void BlockEditor::loadFile(QString path) {
|
||||
if (f.open(QIODevice::ReadOnly)) {
|
||||
cur_file = path;
|
||||
loadModel(f.readAll());
|
||||
QDir::setCurrent(QFileInfo(path).dir().path());
|
||||
}
|
||||
setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(path).baseName()));
|
||||
}
|
||||
@@ -159,6 +160,19 @@ void BlockEditor::on_actionRemove_items_triggered() {
|
||||
|
||||
|
||||
void BlockEditor::on_buttonSave_clicked() {
|
||||
if (cur_file.isEmpty()) {
|
||||
on_buttonSaveAs_clicked();
|
||||
return;
|
||||
}
|
||||
QFile f(cur_file);
|
||||
if (f.open(QIODevice::WriteOnly)) {
|
||||
f.write(saveModel());
|
||||
//setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(c).baseName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BlockEditor::on_buttonSaveAs_clicked() {
|
||||
QString c = QFileDialog::getSaveFileName(this, "Save block model to file", cur_file, "*.blockmodel");
|
||||
if (!c.isEmpty()) {
|
||||
QFile f(c);
|
||||
|
||||
Reference in New Issue
Block a user