本文整理汇总了C++中saveConfiguration函数的典型用法代码示例。如果您正苦于以下问题:C++ saveConfiguration函数的具体用法?C++ saveConfiguration怎么用?C++ saveConfiguration使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了saveConfiguration函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CharmWindow
TasksWindow::TasksWindow( QWidget* parent )
: CharmWindow( tr( "Tasks Editor" ), parent )
, m_tasksView( new TasksView( toolBar(), this ) )
{
setWindowNumber( 1 );
setWindowIdentifier( QLatin1String( "window_tasks" ) );
setCentralWidget( m_tasksView );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
connect( m_tasksView, SIGNAL(emitCommand(CharmCommand*)),
SIGNAL(emitCommand(CharmCommand*)) );
connect( m_tasksView, SIGNAL(emitCommandRollback(CharmCommand*)),
SIGNAL(emitCommandRollback(CharmCommand*)) );
connect( m_tasksView, SIGNAL(saveConfiguration()),
SIGNAL(saveConfiguration()) );
}
开发者ID:MichaelRyanWebber,项目名称:Charm,代码行数:15,代码来源:TasksWindow.cpp
示例2: HandleConfig
// Handles HTTP GET & POST /config.html requests
void HandleConfig()
{
// Warning: uses global data
ControllerData *gd = &GD;
// NETWORK_UPDATE
if (gd->switchServer->hasArg("NETWORK_UPDATE"))
{
gd->switchServer->arg("SSID").toCharArray(config.ssid, SSID_LEN);
gd->switchServer->arg("PASS").toCharArray(config.secret, SECRET_LEN);
gd->switchServer->arg("MDNS").toCharArray(config.MDNSHost, MDNS_HOST_LEN);
saveConfiguration(&config, sizeof(ConfigurationData));
// redirect to the same page without arguments
gd->switchServer->sendHeader("Location", String("/config"), true);
gd->switchServer->send(302, TEXT_PLAIN, "");
// Try connecting with new credentials
WiFi.disconnect();
WiFiManager::handleWiFiConnectivity();
}
// Reboot
if (gd->switchServer->hasArg("REBOOT"))
{
gd->switchServer->send(200, TEXT_PLAIN, "Restarting...");
ESP.restart();
}
// GENERAL_UPDATE
if (gd->switchServer->hasArg("GENERAL_UPDATE"))
{
gd->switchServer->arg("OTA_URL").toCharArray(config.OTA_URL, OTA_URL_LEN);
saveConfiguration(&config, sizeof(ConfigurationData));
}
// CHECK_UPDATE_NOW
if (gd->switchServer->hasArg("CHECK_UPDATE_NOW"))
{
Serial.println("Checking software updates available.");
checkSoftwareUpdates();
}
ESPTemplateProcessor(*gd->switchServer).send(
String("/config.html"),
mapConfigParameters);
}
开发者ID:Shden,项目名称:ShHarbor,代码行数:49,代码来源:switch-2ch.cpp
示例3: qDebug
void Core::requestFriendship(const QString& friendAddress, const QString& message)
{
qDebug() << "Core: requesting friendship of "+friendAddress;
CString cMessage(message);
int friendId = tox_add_friend(tox, CFriendAddress(friendAddress).data(), cMessage.data(), cMessage.size());
const QString userId = friendAddress.mid(0, TOX_CLIENT_ID_SIZE * 2);
if (friendId < 0) {
emit failedToAddFriend(userId);
} else {
// Update our friendAddresses
bool found=false;
QList<QString>& friendAddresses = Settings::getInstance().friendAddresses;
for (QString& addr : friendAddresses)
{
if (addr.toUpper().contains(friendAddress))
{
addr = friendAddress;
found = true;
}
}
if (!found)
friendAddresses.append(friendAddress);
emit friendAdded(friendId, userId);
}
saveConfiguration();
}
开发者ID:tr37ion,项目名称:qTox,代码行数:27,代码来源:core.cpp
示例4: return
void Core::saveConfiguration()
{
if (QThread::currentThread() != coreThread)
return (void) QMetaObject::invokeMethod(this, "saveConfiguration");
if (!isReady())
return;
ProfileLocker::assertLock();
QString dir = Settings::getSettingsDirPath();
QDir directory(dir);
if (!directory.exists() && !directory.mkpath(directory.absolutePath()))
{
qCritical() << "Error while creating directory " << dir;
return;
}
QString profile = Settings::getInstance().getCurrentProfile();
if (profile == "")
{ // no profile active; this should only happen on startup, if at all
profile = sanitize(getUsername());
if (profile == "") // happens on creation of a new Tox ID
profile = getIDString();
Settings::getInstance().switchProfile(profile);
}
QString path = directory.filePath(profile + TOX_EXT);
saveConfiguration(path);
}
开发者ID:rohilsurana,项目名称:qTox,代码行数:34,代码来源:core.cpp
示例5: switch
void Core::setStatus(Status status)
{
TOX_USERSTATUS userstatus;
switch (status) {
case Status::Online:
userstatus = TOX_USERSTATUS_NONE;
break;
case Status::Away:
userstatus = TOX_USERSTATUS_AWAY;
break;
case Status::Busy:
userstatus = TOX_USERSTATUS_BUSY;
break;
default:
userstatus = TOX_USERSTATUS_INVALID;
break;
}
if (tox_set_user_status(tox, userstatus) == 0) {
saveConfiguration();
emit statusSet(status);
} else {
emit failedToSetStatus(status);
}
}
开发者ID:ReDetection,项目名称:qTox,代码行数:25,代码来源:core.cpp
示例6: getConfiguration
void CanIO::loadConfiguration()
{
CanIOConfiguration *config = (CanIOConfiguration *) getConfiguration();
if (!config) { // as lowest sub-class make sure we have a config object
config = new CanIOConfiguration();
setConfiguration(config);
}
Device::loadConfiguration(); // call parent
Logger::info(this, "CAN I/O configuration:");
#ifdef USE_HARD_CODED
if (false) {
#else
if (prefsHandler->checksumValid()) { //checksum is good, read in the values stored in EEPROM
#endif
// prefsHandler->read(EESYS_, &config->);
} else {
// config-> = 0;
saveConfiguration();
}
// Logger::info(getId(), "xyz: %d", config->);
}
void CanIO::saveConfiguration()
{
// prefsHandler->write(EESYS_, config->);
prefsHandler->saveChecksum();
}
开发者ID:neuweiler,项目名称:GEVCU,代码行数:30,代码来源:CanIO.cpp
示例7: deleteAllTelescopes
void TelescopeControl::deinit()
{
//Destroy all clients first in order to avoid displaying a TCP error
deleteAllTelescopes();
QHash<int, QProcess*>::const_iterator iterator = telescopeServerProcess.constBegin();
while(iterator != telescopeServerProcess.constEnd())
{
int slotNumber = iterator.key();
#ifdef Q_OS_WIN
telescopeServerProcess[slotNumber]->close();
#else
telescopeServerProcess[slotNumber]->terminate();
#endif
telescopeServerProcess[slotNumber]->waitForFinished();
delete telescopeServerProcess[slotNumber];
qDebug() << "[TelescopeControl] deinit(): Server process at slot" << slotNumber << "terminated successfully.";
++iterator;
}
//TODO: Decide if it should be saved on change
//Save the configuration on exit
saveConfiguration();
}
开发者ID:PhiTheta,项目名称:stellarium,代码行数:25,代码来源:TelescopeControl.cpp
示例8: getConfigurationDirectory
bool ScopeSync::saveConfigurationAs()
{
File configurationFileDirectory = getConfigurationDirectory();
FileChooser fileChooser("Save Configuration File As...",
configurationFileDirectory,
"*.configuration");
if (fileChooser.browseForFileToSave(true))
{
String fileName = fileChooser.getResult().getFullPathName();
if (File::isAbsolutePath(fileName))
{
configuration->setLastFailedFile(configuration->getFile());
configuration->setFile(File(fileName));
getConfigurationRoot().setProperty(Ids::ID, createAlphaNumericUID(), nullptr);
saveConfiguration();
}
applyConfiguration();
UserSettings::getInstance()->addActionListener(this);
UserSettings::getInstance()->rebuildFileLibrary(true, false, false);
return true;
}
else
return false;
}
开发者ID:nimmen,项目名称:scopesync,代码行数:30,代码来源:ScopeSync.cpp
示例9: createDefaultConfiguration
void Input::loadConfiguration()
{
Gorgon::Core::Log::get().writeFormatted("C++ -> Input::loadConfiguration()\n");
std::fstream* file;
file = new std::fstream("data/input.cfg",std::ios::in|std::ios::binary);
if(!file->is_open())
{
Gorgon::Core::Log::get().writeFormatted("C++ -> Input::loadConfiguration(): data/input.cfg ... Error\n");
createDefaultConfiguration();
saveConfiguration();
}
else
{
file->read( (char*)&mKey_start , sizeof(int) );
file->read( (char*)&mKey_up , sizeof(int) );
file->read( (char*)&mKey_down , sizeof(int) );
file->read( (char*)&mKey_left , sizeof(int) );
file->read( (char*)&mKey_right , sizeof(int) );
file->read( (char*)&mKey_button1 , sizeof(int) );
file->read( (char*)&mKey_button2 , sizeof(int) );
file->read( (char*)&mKey_button3 , sizeof(int) );
file->read( (char*)&mKey_button4 , sizeof(int) );
file->read( (char*)&mKey_button5 , sizeof(int) );
file->read( (char*)&mKey_button6 , sizeof(int) );
file->read( (char*)&mKey_button7 , sizeof(int) );
file->read( (char*)&mKey_button8 , sizeof(int) );
Gorgon::Core::Log::get().writeFormatted("C++ -> Input::loadConfiguration(): data/input.cfg ... Done\n");
}
file->close();
delete file;
}
开发者ID:cantidio,项目名称:gge,代码行数:32,代码来源:input.cpp
示例10: T
bool CConfiguration::setSensorValue(const int8_t idSensor, T (CSensorConfiguration::*getter)() const,
void (CSensorConfiguration::*setter)(const T), const T& newValue)
{
std::vector<DSensorConfiguration>::iterator it = std::find_if(
sensors.begin(), sensors.end(),
[&](DSensorConfiguration& s){return s->getSensorId() == idSensor;});
if (it == sensors.end())
{
// nie znaleziono czujnika
return false;
}
std::shared_ptr<CSensorConfiguration> s = std::dynamic_pointer_cast<CSensorConfiguration>(*it);
T currentValue = (*s.*getter)();
mutex.lock();
T oldValue = currentValue;
(*s.*setter)(newValue);
bool result = saveConfiguration();
if (!result)
{
// nie udal sie zapis - przywroc stare wartosci
(*s.*setter)(oldValue);
}
else
{
readConfiguration();
}
mutex.unlock();
return result;
}
开发者ID:rafalo235,项目名称:monitoring_hal,代码行数:30,代码来源:Configuration.cpp
示例11: saveConfiguration
Core::~Core()
{
if (tox) {
saveConfiguration();
tox_kill(tox);
}
}
开发者ID:Ricardo666666,项目名称:ProjectTox-Qt-GUI,代码行数:7,代码来源:core.cpp
示例12: saveConfiguration
void KviTalApplication::commitData(QSessionManager & manager)
{
saveConfiguration();
#if defined(COMPILE_KDE4_SUPPORT)
KApplication::commitData(manager);
#endif //defined(COMPILE_KDE4_SUPPORT)
}
开发者ID:DINKIN,项目名称:KVIrc,代码行数:7,代码来源:KviTalApplication.cpp
示例13: LOG_DEBUG
CConfigurationMock::CConfigurationMock()
{
LOG_DEBUG("CConfigurationMock - constructor.");
idConcentrator = 1;
sendingPeriod = 8;
checkingSensorPeriod = 4;
saveSDCardIfOnlineEnable = false;
dataPath = ".";
int warningValue = 25;
int alarmValue = 35;
CData warning(EValueType::INT_32, &warningValue);
CData alarm(EValueType::INT_32, &alarmValue);
std::string sensorAddr = "127.0.0.1";
int port = 1502;
for (int8_t i = 0; i < 2; ++i)
{
uint8_t idSensor1 = i;
bool turnOn = true;
DSensorConfiguration s(
new CSensorConfigurationMock(idSensor1, turnOn, warning, alarm, sensorAddr, port));
this->sensors.push_back(s);
port = port + 1;
}
serverUrl = "http://localhost:8080/HallMonitorServer/rest/concentrator/post";
saveConfiguration();
}
开发者ID:rafalo235,项目名称:monitoring_hal,代码行数:33,代码来源:ConfigurationMock.cpp
示例14: saveConfiguration
ExportNative::~ExportNative(void)
{
saveConfiguration();
while (!m_archiveList.isEmpty())
delete m_archiveList.takeFirst();
m_archiveList.clear();
}
开发者ID:lazerdye,项目名称:mythtv,代码行数:8,代码来源:exportnative.cpp
示例15: lock
void Cursynth::processMidi(std::vector<unsigned char>* message) {
if (message->size() < 3)
return;
lock();
int midi_port = message->at(0);
int midi_id = message->at(1);
int midi_val = message->at(2);
std::string selected_control_name = gui_.getCurrentControl();
Control* selected_control = controls_.at(selected_control_name);
if (midi_port >= 144 && midi_port < 160) {
// A MIDI keyboard key was pressed. Play a note.
int midi_note = midi_id;
int midi_velocity = midi_val;
if (midi_velocity)
synth_.noteOn(midi_note, (1.0 * midi_velocity) / MIDI_SIZE);
else
synth_.noteOff(midi_note);
}
else if (midi_port >= 128 && midi_port < 144) {
// A MIDI keyboard key was released. Release that note.
int midi_note = midi_id;
synth_.noteOff(midi_note);
}
else if (midi_port == PITCH_BEND_PORT)
synth_.setPitchWheel((2.0 * midi_val) / (MIDI_SIZE - 1) - 1);
else if (midi_port == SUSTAIN_PORT && midi_id == SUSTAIN_ID) {
if (midi_val)
synth_.sustainOn();
else
synth_.sustainOff();
}
else if (midi_port < 254) {
// Must have gotten MIDI from some knob or other control.
if (state_ == MIDI_LEARN && midi_port < 254) {
// MIDI learn is armed so map this MIDI signal to the current control.
eraseMidiLearn(selected_control);
midi_learn_[midi_id] = selected_control_name;
selected_control->midi_learn(midi_id);
state_ = STANDARD;
gui_.drawControlStatus(selected_control, false);
saveConfiguration();
}
else if (midi_learn_.find(midi_id) != midi_learn_.end()) {
// MIDI learn is enabled for this control. Change the paired control.
Control* midi_control = controls_.at(midi_learn_[midi_id]);
midi_control->setMidi(midi_val);
gui_.drawControl(midi_control, selected_control == midi_control);
gui_.drawControlStatus(midi_control, false);
}
if (midi_id == MOD_WHEEL_ID)
synth_.setModWheel(midi_val);
}
unlock();
}
开发者ID:Lemm,项目名称:cursynth,代码行数:58,代码来源:cursynth.cpp
示例16: failedToRemoveFriend
void Core::removeFriend(int friendId)
{
if (tox_del_friend(tox, friendId) == -1) {
emit failedToRemoveFriend(friendId);
} else {
saveConfiguration();
emit friendRemoved(friendId);
}
}
开发者ID:ReDetection,项目名称:qTox,代码行数:9,代码来源:core.cpp
示例17: loadConfiguration
void NavStars::restoreDefaultConfiguration(void)
{
// Remove the whole section from the configuration file
conf->remove("NavigationalStars");
// Load the default values...
loadConfiguration();
// ... then save them.
saveConfiguration();
}
开发者ID:Stellarium,项目名称:stellarium,代码行数:9,代码来源:NavStars.cpp
示例18: typeIdentifier
QDomElement QgsAttributeEditorElement::toDomElement( QDomDocument& doc ) const
{
QDomElement elem = doc.createElement( typeIdentifier() );
elem.setAttribute( "name", mName );
elem.setAttribute( "showLabel", mShowLabel );
saveConfiguration( elem );
return elem;
}
开发者ID:fritsvanveen,项目名称:QGIS,代码行数:9,代码来源:qgsattributeeditorelement.cpp
示例19: QObject
MainObject::MainObject(QObject *parent)
: QObject(parent)
{
host_player_process=NULL;
host_formatter_process=NULL;
WHCmdSwitch *cmd=
new WHCmdSwitch(qApp->argc(),qApp->argv(),"glassplayerhost",VERSION,
GLASSPLAYERHOST_USAGE);
for(unsigned i=0;i<(cmd->keys());i++) {
if(!cmd->processed(i)) {
fprintf(stderr,"glassplayerhost: unknown option\n");
exit(256);
}
}
//
// Configuration
//
host_config=new Config();
host_config->load();
//
// UDP Interface
//
host_udp_control=new UdpControl(this);
connect(host_udp_control,SIGNAL(changeStreamUrl(const QString &)),
this,SLOT(changeStreamUrlData(const QString &)));
connect(host_udp_control,SIGNAL(changeReceiverName(const QString &)),
this,SLOT(changeReceiverNameData(const QString &)));
connect(host_udp_control,SIGNAL(saveConfiguration()),
this,SLOT(saveConfigurationData()));
//
// Timer
//
host_restart_timer=new QTimer(this);
host_restart_timer->setSingleShot(true);
connect(host_restart_timer,SIGNAL(timeout()),this,SLOT(restartData()));
host_exit_timer=new QTimer(this);
connect(host_exit_timer,SIGNAL(timeout()),this,SLOT(exitData()));
host_watchdog_timer=new QTimer(this);
host_watchdog_timer->setSingleShot(true);
connect(host_watchdog_timer,SIGNAL(timeout()),this,SLOT(watchdogData()));
//
// Configure Signals
//
::signal(SIGHUP,SigHandler);
::signal(SIGINT,SigHandler);
::signal(SIGTERM,SigHandler);
host_restart_timer->start(0);
host_exit_timer->start(1000);
}
开发者ID:RadioFreeAsia,项目名称:GlassPlayerHost,代码行数:56,代码来源:glassplayerhost.cpp
示例20: tox_add_friend_norequest
void Core::acceptFriendRequest(const QString& userId)
{
int friendId = tox_add_friend_norequest(tox, CUserId(userId).data());
if (friendId == -1) {
emit failedToAddFriend(userId);
} else {
saveConfiguration();
emit friendAdded(friendId, userId);
}
}
开发者ID:ReDetection,项目名称:qTox,代码行数:10,代码来源:core.cpp
注:本文中的saveConfiguration函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论