예제 #1
0
void Application::setup(){
	if(!loadXmlSettings(PIMAPPER_USER_SURFACES_XML_FILE)){
		ofLogWarning("Application::setup()") << "Failed to load user settings" << endl;
		if(!loadXmlSettings(PIMAPPER_DEF_SURFACES_XML_FILE)){
			ofLogWarning("Application::setup()") << "Failed to load default settings" << endl;
		}
	}
}
예제 #2
0
void Application::setup(){
	if(!loadXmlSettings(PIMAPPER_USER_SURFACES_XML_FILE)){
		ofLogWarning("Application::setup()") << "Failed to load user settings" << endl;
		if(!loadXmlSettings(PIMAPPER_DEF_SURFACES_XML_FILE)){
			ofLogWarning("Application::setup()") << "Failed to load default settings" << endl;
		}
	}
	
    if(_isSSHConnection){
        consoleListener.setup(this);
    }
}
예제 #3
0
void Application::setup(){
	if(!loadXmlSettings(PIMAPPER_USER_SURFACES_XML_FILE)){
		ofLogWarning("Application::setup()") << "Failed to load user settings. Populated default one" << endl;
	}
	ofSetBackgroundColor(ofColor::black);
	ofEnableAntiAliasing();
	ofSetFrameRate(25);
	ofHideCursor();
	consoleListener.setup(this);
	_osc.setup(5250);
	ofAddListener(ofxOscEvent::packetIn, this, &Application::onPacketIn);
}
예제 #4
0
// #########################################################################
// Loads the settings file and stores the settings.
bool loadSettings (void)
{
  bool result = true;

  QFile file(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/filterrc"));
  if(!file.open(QIODevice::ReadOnly))
    result = false; // settings file doesn't exist
  else {
    Q3TextStream stream(&file);
    QString Line, Setting;
    while(!stream.atEnd()) {
      Line = stream.readLine();
      if (Line.left(9) == "<!DOCTYPE") {
	file.close ();
	result = loadXmlSettings ();
	break;
      }
      Setting = Line.section('=',0,0);
      Line = Line.section('=',1,1);
      if(Setting == "FilterWindow") {
	QucsSettings.x = Line.section(",",0,0).toInt();
	QucsSettings.y = Line.section(",",1,1).toInt();
	break;
      }
    }
    file.close();
  }  

  file.setName(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/qucsrc"));
  if(!file.open(QIODevice::ReadOnly))
    result = true; // qucs settings not necessary
  else {
    Q3TextStream stream(&file);
    QString Line, Setting;
    while(!stream.atEnd()) {
      Line = stream.readLine();
      Setting = Line.section('=',0,0);
      Line = Line.section('=',1,1).stripWhiteSpace();
      if(Setting == "Font")
	QucsSettings.font.fromString(Line);
      else if(Setting == "Language")
	QucsSettings.Language = Line;
    }
    file.close();
  }
  return result;
}