コード例 #1
0
static int UpdateTimerFunc(UIStatusWnd *wnd)
{
	int ret = TRUE;
	int needQuit = TRUE;
	int doing = FALSE;
	int warningEnd = FALSE;
	int statusPossibleChange = ALERTSTAT_ERROR;
	int isReplaceMode = FALSE;
	int buttonEnable = FALSE;
	char *mainStatusString = NULL;
	char *subStatusString = NULL;

	if(wnd != NULL){
		GtkWidget *window = UI_DIALOG(wnd->toner_replacement_dlg)->window;

		if(wnd->toner_replacement_dlg->modeChangeRetCode != RET_NORMAL){
			warningEnd = TRUE;
		}else if((wnd->toner_replacement_dlg->isModeChangeThreadActive == FALSE) &&
					(wnd->toner_replacement_dlg->modeChangeRetCode == RET_NORMAL)){
			doing = TRUE;
		}

		if(doing == TRUE){
			statusPossibleChange = GetPossibleChangeValueAtAlertCode(wnd->pAlertCode);
			isReplaceMode = GetIsReplaceModeValueAtAlertCode(wnd->pAlertCode);
			if(statusPossibleChange != ALERTSTAT_ERROR){
				needQuit = FALSE;

				if(wnd->toner_replacement_dlg->isModeChanged == FALSE){
					if((statusPossibleChange == TRUE) && (isReplaceMode == TRUE)){
						wnd->toner_replacement_dlg->isModeChanged = TRUE;
						UpdateButtonEnable(wnd, TRUE);
					}
				}else{
					if(isReplaceMode != TRUE){
						needQuit = TRUE;
					}
				}
			}else{
				needQuit = TRUE;
			}

			if(needQuit == TRUE){
				HideTonerReplacementDlg(wnd);
				ret = FALSE;
			}else{
				mainStatusString = MessageStr[MAIN_MES_WAIT_MOMENT];

				if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenC")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseC")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerC"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_C];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenM")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseM")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerM"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_M];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenY")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseY")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerY"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_Y];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenK")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerCloseK")) ||
					!(strcmp(wnd->pAlertCode, "CNReadyTonerK"))){
					mainStatusString = MessageStr[MAIN_MES_REPLACEABLE];
					subStatusString = MessageStr[SUB_MES_K];
					buttonEnable = TRUE;

				}else if(!(strcmp(wnd->pAlertCode, "CNRotateTonerOpen")) ||
					!(strcmp(wnd->pAlertCode, "CNRotateTonerClose"))){
					mainStatusString = MessageStr[MAIN_MES_ROTATING];
					subStatusString = MessageStr[SUB_MES_ROTATING];
					buttonEnable = FALSE;
				}

				SetTextToTextView(window, "TonerReplacementDlg_text", _(mainStatusString));
				SetTextToLabel(window, "TonerReplacementDlg_Replaceable_TonerColor_label", _(subStatusString));


				if(GetIsCoverOpenValueAtAlertCode(wnd->pAlertCode) == FALSE){
					UpdateButtonEnable(wnd, buttonEnable);
					if(wnd->toner_replacement_dlg->isCoverOpend == TRUE){
						UpdateJob(REQ_UPDATE_CONSUMABLESINFO_OF_TONERREPLACEMENT);
						wnd->toner_replacement_dlg->isCoverOpend = FALSE;
					}
				}else{
					wnd->toner_replacement_dlg->isCoverOpend = TRUE;
					if(!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenC")) ||
						!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenM")) ||
						!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenY")) ||
						!(strcmp(wnd->pAlertCode, "CNReadyTonerOpenK")) ||
						!(strcmp(wnd->pAlertCode, "CNRotateTonerOpen"))){
						SetWidgetSensitive(window, "TonerReplacementDlg_Cyan_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Magenta_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Yellow_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Black_button", FALSE);
						SetWidgetSensitive(window, "TonerReplacementDlg_Finish_button", TRUE);
						if(wnd->toner_replacement_dlg->buttonEnableOld == TRUE){
							SetFocus(window, "TonerReplacementDlg_text");
						}
						wnd->toner_replacement_dlg->buttonEnableOld = FALSE;
					}
				}
			}
		}else{
			if(warningEnd == TRUE){
				ShowMsgDlg(wnd, MSG_TYPE_COMMUNICATION_ERR_GET);
				ret = FALSE;
			}
		}
	}else{
		HideTonerReplacementDlg(wnd);
		ret = FALSE;
	}
	return ret;
}
コード例 #2
0
void UpdateUserSizeWidgets(UIUserSizeDialog* dialog, gboolean init_flag)
{
	GtkSpinButton* width_spin
		= (GtkSpinButton*)LookupWidget(
			UI_DIALOG(dialog)->window, "user_size_width_spin");
	GtkSpinButton* height_spin
	 	= (GtkSpinButton*)LookupWidget(
			UI_DIALOG(dialog)->window, "user_size_height_spin");

	GtkAdjustment* adjust_w = width_spin->adjustment;
	GtkAdjustment* adjust_h = height_spin->adjustment;

	double min_w, max_w;
	double min_h, max_h;
	double new_w, new_h;
	GtkWidget* label;
	gchar scale_label[64];
	gchar* scale_string;
	gchar width_min_string[12];
	gchar width_max_string[12];
	gchar height_min_string[12];
	gchar height_max_string[12];
	/* Ver.3.00 */
	double min_w_adjust, max_w_adjust;
	double min_h_adjust, max_h_adjust;
	gchar width_min_string_adjust[12];
	gchar width_max_string_adjust[12];
	gchar height_min_string_adjust[12];
	gchar height_max_string_adjust[12];

	// The scale of dialog->width and dialog->height is "mm", 
	// so old_scale must be 0 when showing this dialog.
	int old_scale = (init_flag)? 0 : dialog->old_scale;
	int new_scale
		= GetActiveButtonIndex(
			UI_DIALOG(dialog)->window, user_size_scale_button_name, 0);

	if( init_flag )
	{
		adjust_w->value = dialog->width;
		adjust_h->value = dialog->height;
	}

	if( new_scale )
	{	// inch
		width_spin->climb_rate = height_spin->climb_rate = 0.01;
		width_spin->digits = height_spin->digits = 2;

		if( new_scale != old_scale )
		{	//  mm -> inch
			new_w = Milli2Inch(dialog->min_mm_w, dialog->max_mm_w,
					dialog->min_in_w, dialog->max_in_w, adjust_w->value);
			new_h = Milli2Inch(dialog->min_mm_h, dialog->max_mm_h,
					dialog->min_in_h, dialog->max_in_h, adjust_h->value);
		}
		else
		{
			new_w = adjust_w->value;
			new_h = adjust_h->value;
		}
		min_w = dialog->min_in_w;
		max_w = dialog->max_in_w;
		min_h = dialog->min_in_h;
		max_h = dialog->max_in_h;
	}
	else
	{	// mm
		width_spin->climb_rate = height_spin->climb_rate = 0.1;
		width_spin->digits = height_spin->digits = 1;

		if( new_scale != old_scale )
		{	//  inch -> mm
			new_w = Inch2Milli(dialog->min_in_w, dialog->max_in_w,
					dialog->min_mm_w, dialog->max_mm_w, adjust_w->value);
			new_h = Inch2Milli(dialog->min_in_h, dialog->max_in_h,
					dialog->min_mm_h, dialog->max_mm_h, adjust_h->value);
		}
		else
		{
			new_w = adjust_w->value;
			new_h = adjust_h->value;
		}
		min_w = dialog->min_mm_w;
		max_w = dialog->max_mm_w;
		min_h = dialog->min_mm_h;
		max_h = dialog->max_mm_h;
	}

	// Set adjustment fields.
	adjust_w->step_increment = width_spin->climb_rate;
	adjust_h->step_increment = height_spin->climb_rate;
	adjust_w->page_increment = width_spin->climb_rate * 10;
	adjust_h->page_increment = height_spin->climb_rate * 10;

#if 0
	adjust_w->lower = min_w;
	adjust_w->upper = max_w;
	adjust_h->lower = min_h;
	adjust_h->upper = max_h;
#endif

	/* Ver.3.00 */
	if( new_scale )	//inch
	{
		sprintf( width_min_string_adjust, "%6.0f", (float)min_w * (float)100 );
		sprintf( width_max_string_adjust, "%6.0f", (float)max_w * (float)100 );
		sprintf( height_min_string_adjust, "%6.0f", (float)min_h * (float)100 );
		sprintf( height_max_string_adjust, "%6.0f", (float)max_h * (float)100 );

		min_w_adjust = (double)atoi( width_min_string_adjust ) / (double)100;
		max_w_adjust = (double)atoi( width_max_string_adjust ) / (double)100;
		min_h_adjust = (double)atoi( height_min_string_adjust ) / (double)100;
		max_h_adjust = (double)atoi( height_max_string_adjust ) / (double)100;

	}
	else		//mm
	{
		sprintf( width_min_string_adjust, "%6.0f", (float)min_w * (float)10 );
		sprintf( width_max_string_adjust, "%6.0f", (float)max_w * (float)10 );
		sprintf( height_min_string_adjust, "%6.0f", (float)min_h * (float)10 );
		sprintf( height_max_string_adjust, "%6.0f", (float)max_h * (float)10 );
	
		min_w_adjust = (double)atoi( width_min_string_adjust ) / (double)10;
		max_w_adjust = (double)atoi( width_max_string_adjust ) / (double)10;
		min_h_adjust = (double)atoi( height_min_string_adjust ) / (double)10;
		max_h_adjust = (double)atoi( height_max_string_adjust ) / (double)10;
	}

	adjust_w->lower = min_w_adjust;
	adjust_w->upper = max_w_adjust;
	adjust_h->lower = min_h_adjust;
	adjust_h->upper = max_h_adjust;


#ifdef _PRINTUI_DEBUG_
	fprintf(stderr,"adjust_w->lower = %f\n",adjust_w->lower);
	fprintf(stderr,"min_w = %f\n",min_w);
	fprintf(stderr,"adjust_w->upper = %f\n",adjust_w->upper);
	fprintf(stderr,"max_w = %f\n",max_w);
	fprintf(stderr,"adjust_h->lower = %f\n",adjust_h->lower);
	fprintf(stderr,"min_h = %f\n",min_h);
	fprintf(stderr,"adjust_h->upper = %f\n",adjust_h->upper);
	fprintf(stderr,"max_h = %f\n",max_h);
#endif

	gtk_spin_button_set_value(width_spin, new_w);
	gtk_spin_button_set_value(height_spin, new_h);


	/* Ver.2.80 */
	sprintf( width_min_string, user_size_range_format[new_scale], (float)min_w );
	sprintf( width_max_string, user_size_range_format[new_scale], (float)max_w );
	sprintf( height_min_string, user_size_range_format[new_scale], (float)min_h );
	sprintf( height_max_string, user_size_range_format[new_scale], (float)max_h );

	scale_string = LookupText(g_keytext_list, user_size_scale_format_res[new_scale]);

	// Width scale label.
	label = LookupWidget(UI_DIALOG(dialog)->window, "user_size_width_label");
	snprintf(scale_label, sizeof(scale_label), scale_string, width_min_string, width_max_string );/*Ver.2.90(s)*/
	gtk_label_set_text(GTK_LABEL(label), scale_label);

	// Height scale label.
	label = LookupWidget(UI_DIALOG(dialog)->window, "user_size_height_label");
	snprintf(scale_label,sizeof(scale_label), scale_string, height_min_string, height_max_string );/*Ver.2.90(s)*/
	gtk_label_set_text(GTK_LABEL(label), scale_label);


	dialog->old_scale = new_scale;
}
コード例 #3
0
int UpdateConsumableInfo(UIStatusWnd* const wnd)
{
	GtkWidget *window = UI_DIALOG(wnd->toner_replacement_dlg)->window;
	int res = 0;
	int index = 0;
	int setValue = 0;
	long warning1 = 0;
	long warning2 = 0;
	long warning3 = 0;
	long warning4 = 0;
	long absent = 0;
	long misplas = 0;
	long memerror = 0;
	long mounterror = 0;
	long sealedrror = 0;

	struct consumableBitInfoTable{
		long partsBit;
		char *uiName;
	}const consumableInfo[] = {
		{TONER_K, "TonerReplacementDlg_Black_label"},
		{TONER_Y, "TonerReplacementDlg_Yellow_label"},
		{TONER_M, "TonerReplacementDlg_Magenta_label"},
		{TONER_C, "TonerReplacementDlg_Cyan_label"},
		{-1, NULL}
	};

	if((wnd == NULL) || (wnd->pCnskt == NULL)){
		res = -1;
	}

	if(res == 0){
		res = cnsktSetReqLong(wnd->pCnskt, DATA_LENGTH_LONG);
	}
	if(res == 0){
		res = cnsktSetReqLong(wnd->pCnskt, DREQ_GET_CONSUMABLE);
	}
	if(res == 0){
		res = SendRequest(wnd, CCPD_DEVICE_REQUEST);
	}

	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &warning1, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &warning2, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &warning3, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &warning4, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &absent, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &misplas, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &memerror, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &mounterror, READ_TYPE_LONG, -1);
	}
	if(res == 0){
		res = cnsktGetResData(wnd->pCnskt, &sealedrror, READ_TYPE_LONG, -1);
	}

	if(res < 0){
		for(index = 0; consumableInfo[index].partsBit != -1; index++){
			SetTextToLabel(window, consumableInfo[index].uiName, _(CartridgeStr[CRT_STR_UNKNOWN]));
		}
	}else{
		for(index = 0; consumableInfo[index].partsBit != -1; index++){
			if(absent & consumableInfo[index].partsBit){
				setValue = CRT_STR_INSERT;
			}
			else if(misplas & consumableInfo[index].partsBit){
				setValue = CRT_STR_INSERT;
			}
			else if(warning3 & consumableInfo[index].partsBit){
				setValue = CRT_STR_REPLACE;
			}
			else if(warning2 & consumableInfo[index].partsBit){
				setValue = CRT_STR_REPLACE;
			}
			else if(warning4 & consumableInfo[index].partsBit){
				setValue = CRT_STR_REPLACE;
			}
			else if(memerror & consumableInfo[index].partsBit){
				setValue = CRT_STR_REPLACE;
			}
			else if(mounterror & consumableInfo[index].partsBit){
				setValue = CRT_STR_REPLACE;
			}
			else if(sealedrror & consumableInfo[index].partsBit){
				setValue = CRT_STR_REPLACE;
			}
			else if(warning1 & consumableInfo[index].partsBit){
				setValue = CRT_STR_SOON;
			}
			else{
				setValue = CRT_STR_AVAILABLE;
			}
			SetTextToLabel(window, consumableInfo[index].uiName, _(CartridgeStr[setValue]));
		}
		res = 0;
	}
	return res;
}
コード例 #4
0
ファイル: colordlg.c プロジェクト: Magister/bjcups-2.50
UIColorDialog* CreateColorDialog(UIDialog* parent)
{
	GtkWidget* window;
	GtkAdjustment* adjust;
	// Create dialog.
	UIColorDialog* dialog
		 = (UIColorDialog*)CreateDialog(sizeof(UIColorDialog), parent);

	// Create dialog window.
#ifdef	USE_LIB_GLADE
	UI_DIALOG(dialog)->window = window = LookupWidget(NULL, "color_dialog");
#else
	UI_DIALOG(dialog)->window = window = create_color_dialog();
#endif

	// Cyan scale adjustment.
	adjust = gtk_range_get_adjustment(
		GTK_RANGE(LookupWidget(window, "color_dialog_cyan_scale")));
	gtk_signal_connect(GTK_OBJECT(adjust), "value_changed",
		GTK_SIGNAL_FUNC(on_color_dialog_cyan_adjust_value_changed), window);
	dialog->cyan_balance = CYAN_BALANCE_INIT;
	dialog->cyan_adjust = adjust;

	// Magenta scale adjustment.
	adjust = gtk_range_get_adjustment(
		GTK_RANGE(LookupWidget(window, "color_dialog_magenta_scale")));
	gtk_signal_connect(GTK_OBJECT(adjust), "value_changed",
		GTK_SIGNAL_FUNC(on_color_dialog_magenta_adjust_value_changed), window);
	dialog->magenta_balance = MAGENTA_BALANCE_INIT;
	dialog->magenta_adjust = adjust;

	// Yellow scale adjustment.
	adjust = gtk_range_get_adjustment(
		GTK_RANGE(LookupWidget(window, "color_dialog_yellow_scale")));
	gtk_signal_connect(GTK_OBJECT(adjust), "value_changed",
		GTK_SIGNAL_FUNC(on_color_dialog_yellow_adjust_value_changed), window);
	dialog->yellow_balance = YELLOW_BALANCE_INIT;
	dialog->yellow_adjust = adjust;

	// Black scale adjustment.
	adjust = gtk_range_get_adjustment(
			GTK_RANGE(LookupWidget(window, "color_dialog_black_scale")));
	gtk_signal_connect(GTK_OBJECT(adjust), "value_changed",
		GTK_SIGNAL_FUNC(on_color_dialog_black_adjust_value_changed), window);
	dialog->black_balance = BLACK_BALANCE_INIT;
	dialog->black_adjust = adjust;

	// Density scale adjustment.
	adjust = gtk_range_get_adjustment(
			GTK_RANGE(LookupWidget(window, "color_dialog_density_scale")));
	gtk_signal_connect(GTK_OBJECT(adjust), "value_changed",
		GTK_SIGNAL_FUNC(on_color_dialog_density_adjust_value_changed), window);
	dialog->density_balance = DENSITY_BALANCE_INIT;
	dialog->density_adjust = adjust;

	// Color correct combo.
	dialog->color_correct = SetColorCorrectCombo(dialog, COLOR_CORRECT_INIT);

	// Gamma combo.
	dialog->default_gamma =
	dialog->gamma = SetGammaCombo(dialog, GetDefaultGamma(dialog));

	dialog->vivid = FALSE;

	// Show vivid button if supported.
	if( IsAvailableVivid() )
	{
		gtk_widget_show(LookupWidget(window, "color_dialog_vivid_button"));
	}
	return dialog;
}
コード例 #5
0
ファイル: colordlg.c プロジェクト: Magister/bjcups-2.50
static short GetColorCorrectCombo(UIColorDialog* dialog)
{
	 return GetTextArrayValueFromCombo(UI_DIALOG(dialog)->window,
			 "color_dialog_correct_combo", correct_key, correct_value);
}
コード例 #6
0
ファイル: main.c プロジェクト: dbnicholson/cnijfilter-common
int main(int argc, char *argv[])
{
	int ret = 1;

	g_main_window=NULL;	/* for UpdateMenuLink (check "first call") */
	g_quality_dialog = NULL;	/* for UpdateMenuLink (check "first call") */

	bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR);
	bind_textdomain_codeset( PACKAGE, "UTF-8" );
	textdomain(PACKAGE);

	gtk_set_locale();

	// Set gtk resource file.
	SetGtkResourceFile();

	gtk_init(&argc, &argv);

#ifdef	USE_LIB_GLADE
	// Initialize the glade library.
	glade_init();
#endif

	// Parse options.
	InitOption(argc, argv);

	// Set the directory name for storing keytext files.
	SetKeyTextDir(PACKAGE_DATA_DIR);

#ifndef	USE_LIB_GLADE
	// Set the directory name for storing xpm files.
	SetPixmapDir(PACKAGE_DATA_DIR);
#endif

	// Load fontset.
	//g_main_font = LoadFontSet();
	g_main_font = NULL;

	// Initialize signal control level.
	InitSignal();

	// Load the glade and keytext file.
	if( LoadResources() )
	{
		// Initialize databases.
		InitDataBase(g_model_name);

		// Initialize printint type table.
		InitPrintingType();

		// Create main dialog, and realize it.
		g_main_window = CreateMainWindow();
		gtk_widget_realize(UI_DIALOG(g_main_window)->window);

		// Create dialogs.
		CreateDialogs();

		// Connect signal handlers.
		ConnectSignalHandlers();

		// Update widgets.
		DisableSignal();
		UpdateWidgets(UI_DIALOG(g_main_window)->window, NULL);
		EnableSignal();

		// Set window title.
		snprintf(g_window_title, sizeof(g_window_title), "Canon %s", GetDispModelName());	//Ver.2.90(s)

		gtk_window_set_title(
			GTK_WINDOW(UI_DIALOG(g_main_window)->window), g_window_title);

		// Show widgets depend on model.
		ShowModelDependWidgets(g_main_window);

		gtk_widget_show(UI_DIALOG(g_main_window)->window);
		gtk_main();

		ret = 0;

		// Dispose dialogs.
		DisposeDialogs();

		// Dispose main dialog.
		DisposeDialog(UI_DIALOG(g_main_window));

		// Free databases.
		FreeDataBase();

		// Free resources.
		FreeResources();
	}
	// Free Gdk resource.
	if( g_main_font )
		gdk_font_unref(g_main_font);

	// Free option strings.
	FreeOption();

	return ret;
}
コード例 #7
0
/*--------------------------------------*/
void ShowColorDialog2(UIColorDialog2* dialog)
{
	/* Ver.2.80 */
	DisableSignal();

	GtkWidget* window = UI_DIALOG(dialog)->window;

	gtk_range_set_value( GTK_RANGE(LookupWidget(window, "color_dialog_cyan_scale2")) , (gdouble)dialog->cyan_balance );
	gtk_range_set_value( GTK_RANGE(LookupWidget(window, "color_dialog_magenta_scale2")) , (gdouble)dialog->magenta_balance );
	gtk_range_set_value( GTK_RANGE(LookupWidget(window, "color_dialog_yellow_scale2")) , (gdouble)dialog->yellow_balance );
	gtk_range_set_value( GTK_RANGE(LookupWidget(window, "color_dialog_density_scale2")) ,(gdouble)dialog->density_balance );
	gtk_range_set_value( GTK_RANGE(LookupWidget(window, "color_dialog_contrast_scale2")) , (gdouble)dialog->contrast_balance );
	gtk_range_set_value( GTK_RANGE(LookupWidget(window, "color_dialog_tone_scale2")) , (gdouble)dialog->tone_balance ); /* Ver.3.40 */

	/* Ver.2.90 */
	gtk_spin_button_set_value( GTK_SPIN_BUTTON(LookupWidget(window, "c_dlg_c_value_spin2")) , (gdouble)dialog->cyan_balance );
	gtk_spin_button_set_value( GTK_SPIN_BUTTON(LookupWidget(window, "c_dlg_m_value_spin2")) , (gdouble)dialog->magenta_balance );
	gtk_spin_button_set_value( GTK_SPIN_BUTTON(LookupWidget(window, "c_dlg_y_value_spin2")) , (gdouble)dialog->yellow_balance );
	gtk_spin_button_set_value( GTK_SPIN_BUTTON(LookupWidget(window, "c_dlg_density_value_spin2")) , (gdouble)dialog->density_balance );
	gtk_spin_button_set_value( GTK_SPIN_BUTTON(LookupWidget(window, "c_dlg_contrast_value_spin2")) , (gdouble)dialog->contrast_balance );
	gtk_spin_button_set_value( GTK_SPIN_BUTTON(LookupWidget(window, "c_dlg_tone_value_spin2")) , (gdouble)dialog->tone_balance ); /* Ver.3.40 */

	// Vivid button.
	gtk_toggle_button_set_active(
		GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(dialog)->window,
		"color_dialog_vivid_button2")), dialog->vivid);

	// Gamma combo.
	dialog->gamma = SetGammaCombo(dialog, dialog->gamma);

	// Color correct combo.
	dialog->color_correct = SetColorCorrectCombo2(dialog, dialog->color_correct);
	SensitiveColorCorrectCombo(dialog, !dialog->vivid);

	{
		short print_bw = IsGrayPrint(g_main_window);
		int i;

		for( i = 0 ; bw_sensitive_name[i] != NULL ; i++ )
		{
			gboolean sensitive;

			if( !strcmp(bw_sensitive_name[i], "color_dialog_correct_combo2") )
				sensitive = !(print_bw | dialog->vivid);
			else
				sensitive = !print_bw;

			gtk_widget_set_sensitive(
				LookupWidget(UI_DIALOG(dialog)->window,
				 			bw_sensitive_name[i]), sensitive);
		}
	}

	/* If more than one intent exist , show "color_dialog_intent_table". */
	{
		/* Ver.3.10 */
		GtkWidget* label_tmp = LookupWidget(UI_DIALOG(dialog)->window, "color_dialog_correct_label2");
		GtkWidget* combo_tmp = LookupWidget(UI_DIALOG(dialog)->window, "color_dialog_correct_combo2");

		/* Ver.280 */
		if( dialog->intent_num > 1 ){
			gtk_widget_show(label_tmp);
			gtk_widget_show(combo_tmp);
		}

#if 0
		GtkWidget* table = LookupWidget(UI_DIALOG(dialog)->window, "color_dialog_intent_table");

		/* Ver.280 */
		if( dialog->intent_num > 1 ) gtk_widget_show(table);
#endif
	}

	/* Ver.3.40 */
	if ( IsAvailableBlackAdjustment() ){
		gboolean sensitive;
		int i;

		/* Confirm black adjustment media */
		if ( IsAvailableBlackAdjustmentMode() ){
			sensitive = TRUE;
		}
		else {
			sensitive = FALSE;
		}
		
		for ( i=0; bw_sensitive_name_black_adjustment[i] != NULL; i++ ){
			gtk_widget_set_sensitive( LookupWidget(UI_DIALOG(dialog)->window, 
				bw_sensitive_name_black_adjustment[i]), sensitive  );
		}
	}

	/* Ver.2.80 */
	EnableSignal();

	ShowDialog((UIDialog*)dialog, "color_dialog_ok_button2"); 
}