QString CSaveLoadFileDialog::getSaveFileName(QWidget *parent,
											const QString &caption,
											const QString &dir,
											const QString &filter,
											const QString &strDefaultSuffix,
											QString *selectedFilter,
											QFileDialog::Options options)
{
	if (lastPath().isEmpty()) setLastPath(dir);

	QPointer<QFileDialog> pDlg = new QFileDialog(parent, caption, lastPath(), filter);
	pDlg->setFileMode(QFileDialog::AnyFile);
	pDlg->setAcceptMode(QFileDialog::AcceptSave);
	pDlg->setDefaultSuffix(strDefaultSuffix);
	pDlg->setOptions(options);
	if (selectedFilter) pDlg->selectNameFilter(*selectedFilter);
	if (pDlg->exec() == QDialog::Accepted) {
		if (!pDlg.isNull()) {
			QString strFilename = pDlg->selectedFiles().value(0);
			if (!strFilename.isEmpty()) setLastPath(strFilename);
			return strFilename;
		}
	}
	if (pDlg) delete pDlg;

	return QString();
}
Пример #2
0
//----------------------------------------------------------
void ofPath::moveTo(const ofPoint & p){
	if(mode==PATHS){
		if(lastPath().size()>0) newSubPath();
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::lineTo,p));
		hasChanged = true;
	}else{
		if(lastPolyline().size()>0) newSubPath();
		lastPolyline().addVertex(p);
		bNeedsTessellation = true;
	}
}
QString CSaveLoadFileDialog::getOpenFileName(QWidget *parent,
											const QString &caption,
											const QString &dir,
											const QString &filter,
											QString *selectedFilter,
											QFileDialog::Options options)
{
	if (lastPath().isEmpty()) setLastPath(dir);

	QString strFilename = QFileDialog::getOpenFileName(parent, caption, lastPath(), filter, selectedFilter, options);
	if (!strFilename.isEmpty()) setLastPath(strFilename);
	return strFilename;
}
Пример #4
0
void RheiaPackageManagementDialog::OnInstallPackage( wxCommandEvent& WXUNUSED(event) )
{
    wxString LastOpenPath = RheiaManager::Get()->GetConfigurationManager( wxT("load_save") )->Read( wxT("/last_package_path") , RheiaStandardPaths::HomeDirectory() );

    wxFileDialog dialog( this,
                         wxT("Select the workspace files you want to load..."),
                         LastOpenPath,
                         wxEmptyString,
                         FileExt::PACKAGE_EXT_FILE,
                         wxFD_OPEN | wxFD_MULTIPLE );

    if ( dialog.ShowModal() != wxID_OK )
    {
        return;
    }

    wxArrayString filepaths;
    dialog.GetPaths(filepaths);

    wxFileName lastPath( filepaths[0] );
    RheiaManager::Get()->GetConfigurationManager( wxT("load_save") )->Write( wxT("/last_package_path") , lastPath.GetPath() );
    RheiaPackageManager::Get()->Clear();

    for ( unsigned int i = 0; i < filepaths.size() ; i++ )
        RheiaPackageManager::Get()->AddPackageToList(filepaths[i]);

    if( !RheiaPackageManager::Get()->InstallPackages( false , false , false , true ) )
        wxMessageBox( wxT("Something wrong with your package installation contac your administrator ! ") );

    RheiaPackageDBManager::Get()->Save();
    RheiaPluginManager::Get()->LoadAllPlugins();
    RheiaFramePluginManager::Get(m_parent)->LoadAllPlugins();

    DoUpdatePackageTree();
}
Пример #5
0
//----------------------------------------------------------
void ofPath::arcNegative(const ofPoint & centre, float radiusX, float radiusY, float angleBegin, float angleEnd){
	if(mode==PATHS){
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::arcNegative,centre,radiusX,radiusY,angleBegin,angleEnd));
		hasChanged = true;
	}else{
		lastPolyline().arcNegative(centre,radiusX,radiusY,angleBegin,angleEnd,arcResolution);
		bNeedsTessellation = true;
	}
}
Пример #6
0
//----------------------------------------------------------
void ofPath::quadBezierTo(const ofPoint & cp1, const ofPoint & cp2, const ofPoint & p){
	if(mode==PATHS){
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::quadBezierTo,p,cp1,cp2));
		hasChanged = true;
	}else{
		lastPolyline().quadBezierTo(cp1,cp2,p);
		bNeedsTessellation = true;
	}
}
Пример #7
0
//----------------------------------------------------------
void ofPath::curveTo(const ofPoint & p){
	if(mode==PATHS){
		lastPath().addCommand(ofSubPath::Command(ofSubPath::Command::curveTo,p));
		hasChanged = true;
	}else{
		lastPolyline().curveTo(p);
		bNeedsTessellation = true;
	}
}
Пример #8
0
//----------------------------------------------------------
void ofPath::close(){
	if(mode==PATHS){
		lastPath().close();
		hasChanged = true;
	}else{
		lastPolyline().setClosed(true);
		bNeedsTessellation = true;
	}
	//newPath();
}
Пример #9
0
void PatMainWindow::writeSettings()
{
  QString organizationName = QCoreApplication::organizationName();
  QString applicationName = QCoreApplication::applicationName();
  QSettings settings(organizationName, applicationName);
  settings.setValue("pos", pos());
  settings.setValue("size", size());
  settings.setValue("lastPath", lastPath());
  settings.setValue("geometry", saveGeometry());
  settings.setValue("state", saveState());
}