예제 #1
0
void MainWindow::onActionOpenTriggered()
{
    QString fn = QFileDialog::getOpenFileName( 0, tr("Open OPC Package"), m_recentFilesList.isEmpty() ? "" : m_recentFilesList[0], "Office files (*.xlsx *.docx *.pptx);;All files(*.*)");
    if (fn.isEmpty())
        return;

    openPackage(fn);
}
예제 #2
0
void MainWindow::onActionRecentFileTriggered()
{
    QAction *act = qobject_cast<QAction *>(sender());
    QString fileName = act->data().toString();

    if (!openPackage(fileName)) {
        m_recentFilesList.removeOne(fileName);
        updateRecentFilesMenu();
    }
}
예제 #3
0
파일: NexasPacker.c 프로젝트: mrsshr/zbspac
bool packPackage(const wchar_t* sourceDir, const wchar_t* packagePath, bool isBfeFormat) {
	writeLog(LOG_NORMAL, L"Packing files under directory: %s", sourceDir);
	writeLog(LOG_NORMAL, L"To package: %s", packagePath);
	NexasPackage* package = openPackage(packagePath);
	if (!package) return false;
	bool result = determineEntryCountAndWriteHeader(package, sourceDir, isBfeFormat)
			&& recordAndWriteEntries(package, isBfeFormat)
			&& writeIndexes(package, isBfeFormat);
	closePackage(package);
	writeLog(LOG_NORMAL, (result) ? L"Packing Successful." : L"ERROR: Packing Failed.");
	return result;
}
예제 #4
0
bool unpackPackage(const wchar_t* packagePath, const wchar_t* targetDir) {
	writeLog(LOG_NORMAL, L"Unpacking package: %s", packagePath);
	writeLog(LOG_NORMAL, L"To Directory: %s", targetDir);
	if (!fsEnsureDirectoryExists(targetDir)) {
		writeLog(LOG_QUIET, L"ERROR: Target directory does not exist and cannot be created.", targetDir);
		return false;
	}
	NexasPackage* package = openPackage(packagePath);
	if (!package) return false;
	bool result = validateHeader(package)
			&& readIndex(package)
			&& extractFiles(package, targetDir);
	closePackage(package);
	writeLog(LOG_NORMAL, (result) ? L"Unpacking Successful." : L"ERROR: Unpacking Failed.");
	return result;
}
VisualizeSquareMazeRunner::VisualizeSquareMazeRunner (SquareMaze *_maze)
{
  pauseTimeInSec=0.05; // default

  maze=_maze;
  maze->setChangeListener(this);

  // set up our window
  int windowWidth,windowHeight;
  windowWidth=maze->getWidth()*PixelsPerNode;
  windowHeight=maze->getHeight()*PixelsPerNode;
  openPackage(windowWidth+1,windowHeight+1);

  drawInitialWindow();
  flush(); // flush graphics operations to screen

}