• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ settings_save函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中settings_save函数的典型用法代码示例。如果您正苦于以下问题:C++ settings_save函数的具体用法?C++ settings_save怎么用?C++ settings_save使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了settings_save函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sig_autosave

static int sig_autosave(void)
{
	char *fname, *str;

	if (!settings_get_bool("settings_autosave") ||
	    config_last_modifycounter == mainconfig->modifycounter)
		return 1;

	if (!irssi_config_is_changed(NULL))
		settings_save(NULL, TRUE);
	else {
		fname = g_strconcat(mainconfig->fname, ".autosave", NULL);
		str = g_strdup_printf("Configuration file was modified "
				      "while irssi was running. Saving "
				      "configuration to file '%s' instead. "
				      "Use /SAVE or /RELOAD to get rid of "
				      "this message.", fname);
		signal_emit("gui dialog", 2, "warning", str);
		g_free(str);

                settings_save(fname, TRUE);
		g_free(fname);
	}

        return 1;
}
开发者ID:ailin-nemui,项目名称:irssi,代码行数:26,代码来源:settings.c


示例2: settings_default

void settings_default()
{
    timer.setDefault();
    strcpy((char*)conf.sysName, "           ");
    conf.warnTime = 2;
    conf.mirrorTime = 2;
    conf.lcdColor = 0;
    conf.settingsVersion = SETTINGS_VERSION;
    conf.shutterVersion = SHUTTER_VERSION;
    conf.lcdBacklightTime = 3;
    conf.sysOffTime = 12;
    conf.flashlightOffTime = 3;
    conf.devMode = 0;
    conf.auxPort = AUX_MODE_DISABLED;
    conf.btMode = BT_MODE_SLEEP;
    conf.brampMode = BRAMP_MODE_BULB_ISO;
    conf.autoRun = AUTO_RUN_OFF;
    conf.dollyPulse = 100;
    conf.dollyPulse2 = 100;
    conf.lcdContrast = 3;
    conf.lcdCoefficent = 0x7;
    conf.lcdBias = 0x3;
    conf.isoMax = 10;
    conf.apertureMax = 31;
    conf.apertureMin = 2;
    conf.debugEnabled = 0;
    conf.arbitraryBulb = 0;
    conf.menuWrap = 1;
    conf.extendedRamp = 0;
    strcpy((char*)conf.test, "Test       ");
    conf.lightIntegrationMinutes = 5;
    conf.pFactor = 10;
    conf.iFactor = 12;
    conf.dFactor = 12;
    conf.errorAlert = 0;
    conf.lightThreshold = 20;
    conf.linearInterpolation = 0;

    conf.camera.cameraFPS = 33;
    conf.camera.nikonUSB = 0;
    conf.camera.bulbEndOffset = 8;
    conf.camera.bulbMin = 56;
    conf.camera.bulbOffset = 75;
    conf.camera.negBulbOffset = 0;
    conf.camera.interface = INTERFACE_AUTO;
    conf.camera.cameraMake = CANON;
    conf.camera.bulbMode = 0;
    conf.camera.halfPress = HALF_PRESS_ENABLED;
    conf.camera.modeSwitch = USB_CHANGE_MODE_DISABLED;
    conf.camera.brampGap = 6;

    for(uint8_t i = 0; i < MAX_CAMERAS_SETTINGS; i++)
    {
        camera_settings_t cs;
        memset((void*)&cs, 0, sizeof(camera_settings_t));
        eeprom_write_block((const void*)&cs, &camera_settings_eep[i], sizeof(camera_settings_t));
    }
    settings_save();
    settings_load();
}
开发者ID:jreinholm,项目名称:TimelapsePlus-Firmware,代码行数:60,代码来源:settings.cpp


示例3: settings_default

void settings_default()
{
    timer.setDefault();
    strcpy((char*)conf.sysName, "           ");
    conf.warnTime = 2;
    conf.mirrorTime = 2;
    conf.cameraFPS = 33;
    conf.bulbMode = 0;
    conf.lcdColor = 0;
    conf.cameraMake = CANON;
    conf.settingsVersion = SETTINGS_VERSION;
    conf.shutterVersion = SHUTTER_VERSION;
    conf.lcdBacklightTime = 3;
    conf.sysOffTime = 12;
    conf.flashlightOffTime = 3;
    conf.devMode = 0;
    conf.auxPort = AUX_MODE_DISABLED;
    conf.btMode = BT_MODE_SLEEP;
    conf.halfPress = HALF_PRESS_ENABLED;
    conf.bulbOffset = 75;
    conf.interface = INTERFACE_AUTO;
    conf.brampMode = BRAMP_MODE_BULB_ISO;
    conf.autoRun = AUTO_RUN_OFF;
    conf.modeSwitch = USB_CHANGE_MODE_DISABLED;
    conf.dollyPulse = 100;
    conf.lcdContrast = 0xf;
    conf.lcdCoefficent = 0x7;
    conf.lcdBias = 0x4;
    conf.bulbMin = 56;
    conf.isoMax = 10;
    conf.apertureMax = 31;
    conf.apertureMin = 2;
    settings_save();
    settings_load();
}
开发者ID:dizzydev,项目名称:TimelapsePlus-Firmware,代码行数:35,代码来源:settings.cpp


示例4: callback_apply

static gboolean callback_apply(GtkWidget *widget, gpointer data)
{
	new_settings.gravity = gtk_toggle_button_get_active(
			GTK_TOGGLE_BUTTON(wg_gravity));
	new_settings.n_blobs = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_n_blobs));

	new_settings.blob_size = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_blob_size));
	new_settings.blob_falloff = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_blob_falloff));
	new_settings.blob_presence = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_blob_presence));

	new_settings.border_size = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_border_size));
	new_settings.border_falloff = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_border_falloff));
	new_settings.border_presence = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_border_presence));

	new_settings.multiplication = gtk_spin_button_get_value_as_int(
			GTK_SPIN_BUTTON(wg_multiplication));

	/* the color informations are already in new_settings */

	apply_settings(&new_settings);
	settings_save();

	return(TRUE);
}
开发者ID:bbidulock,项目名称:wmblob,代码行数:31,代码来源:dialog.c


示例5: clear_start_directory

static int clear_start_directory(void)
{
    strcpy(global_settings.start_directory, "/");
    settings_save();
    splash(HZ, ID2P(LANG_RESET_DONE_CLEAR));
    return false;
}
开发者ID:kugel-,项目名称:rockbox,代码行数:7,代码来源:settings_menu.c


示例6: state_changed

void
state_changed()
{
    hotkey_t hk;
    REFRESH_KEY_SETTING(trigger);
    settings_set(TRIGGER_KEY, &hk);

    REFRESH_KEY_SETTING(english);
    settings_set(ENG_KEY, &hk);

    varchar colorstr;
    REFRESH_COLOR_SETTING(background_color_btn);
    settings_set(PREEDIT_COLOR, colorstr);

    REFRESH_COLOR_SETTING(font_color_btn);
    settings_set(PREEDIT_FONT_COLOR, colorstr);

    /* font and size information */
    settings_set(PREEDIT_FONT, (void*) gtk_font_button_get_font_name(font_btn));

    /* font color information */
    double scale = gtk_adjustment_get_value(opacity_value);
    settings_set(PREEDIT_OPACITY, &scale);

    int ncandi = gtk_adjustment_get_value(ncandidates);
    settings_set(CANDIDATES_SIZE, &ncandi);
    
    settings_save();

    /* notify all running xsunpinyin with this user */
    char cmd[256];
    snprintf(cmd, 256, "/usr/bin/pkill -10 '^xsunpinyin$' -u %d", getuid());
    system(cmd);
}
开发者ID:iksky,项目名称:sunpinyin,代码行数:34,代码来源:preferences.c


示例7: _event

void _event(state_stack* stack, SDL_Event *sdlEvent) {
	state_desc *top = (state_desc*) table_ind(stack, stack->m_len-1);
	_settings_menu *data = (_settings_menu*) top->m_pData;
	menu *pMenu = (menu*) data->m_menu;
	settings *pSettings = (settings*) data->m_settings;
	
	if (sdlEvent->type == SDL_QUIT) {
		state_stack_kill(stack);
		return;
	}
	
	switch (menu_input(pMenu, sdlEvent)) {
	case 0:
		// Controls
		top->m_fnPushChild = &_controls_push;
		break;
	case 1:
		// (empty)
		break;
	case 2:
		// < Save Settings
		settings_save(pSettings, settings_file_path);
		top->m_isDead = true;
		break;
	case 3:
		// < Discard Settings
		settings_load(pSettings, settings_file_path);
		top->m_isDead = true;
		break;
	default:
		break;
	}
}
开发者ID:LordKaT,项目名称:Wyrmwick,代码行数:33,代码来源:settings_menu.cpp


示例8: set_recdir

static bool set_recdir(void)
{
    strlcpy(global_settings.rec_directory, selected_file,
            sizeof(global_settings.rec_directory));
    settings_save();
    return false;
}
开发者ID:realtsiry,项目名称:rockbox4linux,代码行数:7,代码来源:onplay.c


示例9: bookmark_menu_callback

static int bookmark_menu_callback(int action,
                                  const struct menu_item_ex *this_item)
{
    switch (action)
    {
        case ACTION_REQUEST_MENUITEM:
            if (this_item == &bookmark_load_menu_item)
            {
                if (!bookmark_exists())
                    return ACTION_EXIT_MENUITEM;
            }
            /* hide the bookmark menu if there is no playback */
            else if ((audio_status() & AUDIO_STATUS_PLAY) == 0)
                return ACTION_EXIT_MENUITEM;
            break;
#ifdef HAVE_LCD_CHARCELLS
        case ACTION_ENTER_MENUITEM:
            status_set_param(true);
            break;
#endif
        case ACTION_EXIT_MENUITEM:
#ifdef HAVE_LCD_CHARCELLS
            status_set_param(false);
#endif
            settings_save();
            break;
    }
    return action;
}
开发者ID:realtsiry,项目名称:rockbox4linux,代码行数:29,代码来源:onplay.c


示例10: OS_quit

void OS_quit()
{
	SceneManager_destroy();
	SceneManager_eventsDestroy(evts);
	hasQuit = 1;

	if (audioInitialized)
	{
		if (Mix_PlayingMusic())
			Mix_FadeOutMusic(200);

		if (music_theme)
			Mix_FreeMusic(music_theme);

		if (music_success)
			Mix_FreeMusic(music_success);

		if (music_failure)
			Mix_FreeMusic(music_failure);

		Mix_CloseAudio();
	}

	SDL_Quit();
	settings_save();
	settings_clear();
}
开发者ID:a-sf-mirror,项目名称:phlipple,代码行数:27,代码来源:osinterface_sdl.c


示例11: settings_save_fe

static void settings_save_fe(const char *fname)
{
	if (settings_save(fname, FALSE /* not autosaved */)) {
		printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
			    TXT_CONFIG_SAVED, fname);
	}
}
开发者ID:svn2github,项目名称:irssi,代码行数:7,代码来源:fe-settings.c


示例12: sound

void TB_SaveSelect::Run_Input()
{
int start;

	if (justpushed(DOWNKEY))
	{
		start = fCurSel;
		for(;;)
		{
			fCurSel++;
			if (fCurSel >= fNumFiles) fCurSel = 0;
			
			if (fSaving) break;
			if (fHaveProfile[fCurSel]) break;
			if (fCurSel == start) break;
		}
		
		sound(SND_MENU_MOVE);
		fPicXOffset = -24;
	}
	
	if (justpushed(UPKEY))
	{
		start = fCurSel;
		for(;;)
		{
			fCurSel--;
			if (fCurSel < 0) fCurSel = fNumFiles - 1;
			
			if (fSaving) break;
			if (fHaveProfile[fCurSel]) break;
			if (fCurSel == start) break;
		}
		
		sound(SND_MENU_MOVE);
		fPicXOffset = -24;
	}
	
	if (buttonjustpushed())
	{
		// when shown in a replay, the box is shown and everything just like what was done
		// originally, but we won't actually overwrite any save files.
		if (!Replay::IsPlaying())
		{
			if (fSaving)
				game_save(fCurSel);
			
			settings->last_save_slot = fCurSel;
			settings_save();		// record new save/load slot
		}
		
		SetVisible(false);
		
		// when the script hit the <SVP, it froze itself in an artifical <WAI9999
		// waiting for us to complete. Now unfreeze it so can say "Game saved.",
		// or for loading, just end.
		ScriptInstance *s = GetCurrentScriptInstance();
		if (s) s->delaytimer = 0;
	}
}
开发者ID:EXL,项目名称:NXEngine,代码行数:60,代码来源:SaveSelect.cpp


示例13: set_file

/*
 * Takes filename, removes the directory and the extension,
 * and then copies the basename into setting, unless the basename exceeds maxlen
 **/
void set_file(const char* filename, char* setting, const int maxlen)
{
    const char* fptr = strrchr(filename,'/');
    const char* extptr;
    int len;
    int extlen = 0;

    if (!fptr)
        return;

    fptr++;

    extptr = strrchr(fptr, '.');

    if (!extptr || extptr < fptr)
        extlen = 0;
    else
        extlen = strlen(extptr);

    len = strlen(fptr) - extlen + 1;

    /* error if filename isn't in ROCKBOX_DIR */
    if (len > maxlen)
        return;

    strlcpy(setting, fptr, len);
    settings_save();
}
开发者ID:Brandon7357,项目名称:rockbox,代码行数:32,代码来源:settings.c


示例14: reset_settings

static int reset_settings(void)
{
    static const char *lines[]= {ID2P(LANG_RESET_ASK)};
    static const char *yes_lines[]= {
        ID2P(LANG_SETTINGS),
        ID2P(LANG_RESET_DONE_CLEAR)
    };
    static const char *no_lines[]= {
        ID2P(LANG_SETTINGS),
        ID2P(LANG_CANCEL)
    };
    static const struct text_message message= {lines, 1};
    static const struct text_message yes_message= {yes_lines, 2};
    static const struct text_message no_message= {no_lines, 2};

    switch(gui_syncyesno_run(&message, &yes_message, &no_message))
    {
    case YESNO_YES:
        settings_reset();
        settings_save();
        settings_apply(true);
        settings_apply_skins();
        break;
    case YESNO_NO:
        break;
    case YESNO_USB:
        return 1;
    }
    return 0;
}
开发者ID:ntj,项目名称:rockbox,代码行数:30,代码来源:main_menu.c


示例15: settings_update

char * settings_update(const char *name, const char *value)
{
    int ii;
    for (ii = 0;
	 settings_display_list[ii].fmt != NULL;
	 ii++)
    {
	struct settings_display *disp = &settings_display_list[ii];

	if (strcmp(name, disp->name) == 0)
	{
	    if (disp->type == FLOAT)
	    {
		*((float *)disp->value) = atof(value);
		sprintf(update_message, disp->fmt, *((float *)disp->value));
	    }
	    else if (disp->type == UINT8)
	    {
		*((uint8_t *)disp->value) = atoi(value);
		sprintf(update_message, disp->fmt, *((uint8_t *)disp->value));
	    }
	    settings_save();
	    return update_message;
	}
    }
    return "Setting not found.";
}
开发者ID:Zizzle,项目名称:FreeRTOS-brewbot-rx62n,代码行数:27,代码来源:settings.c


示例16: set_file

void set_file(const char* filename, char* setting, int maxlen)
{
    const char* fptr = strrchr(filename,'/');
    int len;
    int extlen = 0;
    const char* ptr;

    if (!fptr)
        return;

    fptr++;

    len = strlen(fptr);
    ptr = fptr + len;
    while ((*ptr != '.') && (ptr != fptr)) {
        extlen++;
        ptr--;
    }
    if(ptr == fptr) extlen = 0;

    if (strncasecmp(ROCKBOX_DIR, filename, strlen(ROCKBOX_DIR)) ||
        (len-extlen > maxlen))
        return;

    strlcpy(setting, fptr, len-extlen+1);

    settings_save();
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:28,代码来源:settings.c


示例17: set_backdrop

static bool set_backdrop(void)
{
    strlcpy(global_settings.backdrop_file, selected_file,
            sizeof(global_settings.backdrop_file));
    settings_save();
    skin_backdrop_load_setting();
    return true;
}
开发者ID:IlVerz,项目名称:rockbox,代码行数:8,代码来源:onplay.c


示例18: set_startdir

static bool set_startdir(void)
{
    snprintf(global_settings.start_directory, 
             sizeof(global_settings.start_directory),
             "%s/", selected_file);
    settings_save();
    return false;
}
开发者ID:realtsiry,项目名称:rockbox4linux,代码行数:8,代码来源:onplay.c


示例19: set

//------------------------------------------------------------------------------
int set(int argc, char** argv)
{
    int ret;

    // Check we're running from a Clink session.
    extern int g_in_clink_context;
    if (!g_in_clink_context)
    {
        puts("ERROR: The 'set' verb must be run from a process with Clink present");
        return 1;
    }

    // Get the path where Clink's storing its settings.
    get_config_dir(g_settings_path, sizeof_array(g_settings_path));
    str_cat(g_settings_path, "/settings", sizeof_array(g_settings_path));

    // Load Clink's settings.
    g_settings = initialise_clink_settings();
    if (g_settings == NULL)
    {
        printf("ERROR: Failed to load Clink's settings from '%s'.", g_settings_path);
        return 1;
    }

    // List or set Clink's settings.
    ret = 0;
    switch (argc)
    {
    case 0:
    case 1:
        ret = print_keys();
        break;

    case 2:
        if (_stricmp(argv[1], "--help") == 0 ||
            _stricmp(argv[1], "-h") == 0)
        {
            ret = 1;
            print_usage();
        }
        else
        {
            ret = print_value(argv[1]);
        }
        break;

    default:
        ret = set_value(argv[1], argv[2]);
        if (!ret)
        {
            settings_save(g_settings, g_settings_path);
        }
        break;
    }

    settings_shutdown(g_settings);
    return ret;
}
开发者ID:NextGenIntelligence,项目名称:clink,代码行数:59,代码来源:set.c


示例20: setup_code

unsigned int setup_code(void){
	switch(setup_code_state){
		case 0: setup_code_code_1=ui_input_code();
				if(setup_code_code_1==-1){//code insert canceled
					setup_code_state=0;
					return 0;
				}
				if(setup_code_code_1==-2){//code still entered
				}else if(setup_code_code_1>=0){//code entered
					setup_code_state=1;
				}
				break;
		case 1: setup_code_code_2=ui_input_code();
				if(setup_code_code_2==-1){//code insert canceled
					setup_code_state=0;
					return 0;
				}
				if(setup_code_code_2==-2){//code still entered
				}else if(setup_code_code_2>=0){//code entered
					if(setup_code_code_1==setup_code_code_2){
						if(setup_code_code_1==0){
							setup_code_code_1=-1;
						}
						ui_menues_set_code(setup_code_code_1);
						settings_save(SETTINGS_UI_MENUES_CODE_32,ui_menues_get_code()>>8);
						settings_save(SETTINGS_UI_MENUES_CODE_10,ui_menues_get_code()&0xFF);
						if(ui_menues_get_code()<0){
							setup_code_state=3;
						}else{
							setup_code_state=4;
						}
						clock_stop_stop_watch();clock_start_stop_watch();
					}else{
						setup_code_state=2;clock_stop_stop_watch();clock_start_stop_watch();
					}
				}
				break;
		case 2:if(clock_get_stop_watch()*4>2000){//2seconds waiting
					setup_code_state=0;
					return 0;
				}
				display_set_text("Err ");
				break;
		case 3:if(clock_get_stop_watch()*4>2000){//2seconds waiting
					setup_code_state=0;
					return 0;
				}
				display_set_text("off ");
				break;
		case 4:if(clock_get_stop_watch()*4>2000){//2seconds waiting
					setup_code_state=0;
					return 0;
				}
				display_set_text("ok  ");
				break;
	}
开发者ID:lanmarc77,项目名称:KaunisKello,代码行数:56,代码来源:ui_menus.c



注:本文中的settings_save函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setuid函数代码示例发布时间:2022-05-30
下一篇:
C++ settings_init函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap