Exemplo n.º 1
0
  private boolean saveFile(String fileFormat) {
    String initialPath = QDir.currentPath() + "/untitled." + fileFormat;

    String fileName =
        QFileDialog.getSaveFileName(
            this,
            tr("Save As"),
            initialPath,
            new QFileDialog.Filter(
                fileFormat.toUpperCase() + " Files (*." + fileFormat + ");;All Files (*)"));
    if (fileName.length() == 0) {
      return false;
    } else {
      return scribbleArea.saveImage(fileName, fileFormat);
    }
  }
Exemplo n.º 2
0
 private void open() {
   if (maybeSave()) {
     String fileName = QFileDialog.getOpenFileName(this, tr("Open File"), QDir.currentPath());
     if (fileName.length() != 0) scribbleArea.openImage(fileName);
   }
 }