399 self.setWindowTitle(self.__getDiagramTitel(self.__diagramType)) |
399 self.setWindowTitle(self.__getDiagramTitel(self.__diagramType)) |
400 self.__fileName = filename |
400 self.__fileName = filename |
401 |
401 |
402 return True |
402 return True |
403 |
403 |
404 ## def __writeLineBasedGraphicsFile(self, filename): |
|
405 ## """ |
|
406 ## Private method to write an eric graphics file using the old line |
|
407 ## based file format. |
|
408 ## |
|
409 ## @param filename name of the file to write to |
|
410 ## @type str |
|
411 ## @return flag indicating a successful write |
|
412 ## @rtype bool |
|
413 ## """ |
|
414 ## lines = [ |
|
415 ## "version: 1.0", |
|
416 ## "diagram_type: {0} ({1})".format( |
|
417 ## self.__diagramType.value, |
|
418 ## self.__getDiagramTitel(self.__diagramType)), |
|
419 ## "scene_size: {0};{1}".format(self.scene.width(), |
|
420 ## self.scene.height()), |
|
421 ## ] |
|
422 ## persistenceData = self.builder.getPersistenceData() |
|
423 ## if persistenceData: |
|
424 ## lines.append("builder_data: {0}".format(persistenceData)) |
|
425 ## lines.extend(self.umlView.getPersistenceData()) |
|
426 ## |
|
427 ## try: |
|
428 ## with open(filename, "w", encoding="utf-8") as f: |
|
429 ## f.write("\n".join(lines)) |
|
430 ## return True |
|
431 ## except OSError as err: |
|
432 ## EricMessageBox.critical( |
|
433 ## self, |
|
434 ## self.tr("Save Diagram"), |
|
435 ## self.tr( |
|
436 ## """<p>The file <b>{0}</b> could not be saved.</p>""" |
|
437 ## """<p>Reason: {1}</p>""").format(filename, str(err))) |
|
438 ## return False |
|
439 ## |
|
440 def __showInvalidDataMessage(self, filename, linenum=-1): |
404 def __showInvalidDataMessage(self, filename, linenum=-1): |
441 """ |
405 """ |
442 Private slot to show a message dialog indicating an invalid data file. |
406 Private slot to show a message dialog indicating an invalid data file. |
443 |
407 |
444 @param filename name of the file containing the invalid data |
408 @param filename name of the file containing the invalid data |