Пример #1
0
char* cngplpSetValue(cngplpData *data, char *key, char *value)
{
	if(data == NULL)
		return NULL;

	InitUpdateOption(data);
	UpdateUIValue(data, key, value);
	return ExitUpdateOption(data);
}
Пример #2
0
void HideDialog(const char *dlg_name, const gboolean flag)
{
	GtkWidget *widget;
	GtkWidget *top;
	char *text;
	SpecialInfo* special = NULL;

	if(g_config_file_data != NULL){
		special = g_config_file_data->special_list;
	}
	while(special != NULL){
		if(0 == strcasecmp(special->name, dlg_name)){
			break;
		}
		special = special->next;
	}
	widget = glade_xml_get_widget(g_cngplp_xml, dlg_name);
	if(NULL == widget){
		return;
	}
	InitUpdateOption(g_cngplp_data);
	if(FALSE == flag){
		special->print = 0;
		RestoreTopWidgetData(dlg_name);
	}else{
		if(special->print == 1){
			if(0 == strcasecmp(dlg_name, "IdPassWdDlg")){
				const char *ps = NULL;
				const char *usr = NULL;

				ps = GetTextEntry("PassWd_entry");
				usr = GetTextEntry("ID_entry");
				if((0 == (strlen(ps))) || (0 == (strlen(usr)))){
					return;
				}
			}
			if(0 == strcasecmp(dlg_name, "JobAccountDlg")){
				const char *jobusr = NULL;
				jobusr = GetTextEntry("JobAccountID_entry");
				if(0 == strlen(jobusr)){
					return;
				}
			}
		}
	}
	FreeTopWidgetSaveData(dlg_name);
	text = ExitUpdateOption(g_cngplp_data);
	UpdateWidget(ID_CNSKIPBLANK, text);

	top = gtk_widget_get_toplevel(widget);
	gtk_widget_hide(top);
	gtk_main_quit();
}
Пример #3
0
char* cngplpSetData(cngplpData *data, int id, char *value)
{
UI_DEBUG("-----------------------------------------------------\n");
UI_DEBUG("<-cngplpSetData id=[%d] value=[%s]\n", id, value);
	InitUpdateOption(data);
	if(id < ID_COMMON_OPTION){
		SetDataPPD(data, id, value);
	}else if(id < ID_IMAGE_OPTION){
		SetDataCommon(data, id, value);
	}else if(id < ID_TEXT_OPTION){
		SetDataImage(data, id, value);
	}else if(id < ID_HPGL_OPTION){
		SetDataText(data, id, value);
	}else if(id < ID_BOTTON_EVENT){
		SetDataHPGL(data, id, value);
	}else{
		BottomEvent(data, id, value);
	}
	return ExitUpdateOption(data);
}