static void
palette_import_image_changed (GimpContext  *context,
                              GimpImage    *image,
                              ImportDialog *dialog)
{
  if (dialog->image)
    {
      g_signal_handlers_disconnect_by_func (dialog->image,
                                            palette_import_layer_changed,
                                            dialog);
      g_signal_handlers_disconnect_by_func (dialog->image,
                                            palette_import_mask_changed,
                                            dialog);
    }

  dialog->image = image;

  if (dialog->import_type == IMAGE_IMPORT)
    {
      gboolean sensitive = FALSE;

      if (image)
        {
          gchar *label;

          label = g_strdup_printf ("%s-%d",
				   gimp_image_get_display_name (image),
				   gimp_image_get_ID (image));

          gtk_entry_set_text (GTK_ENTRY (dialog->entry), label);
          g_free (label);

          palette_import_make_palette (dialog);

          if (gimp_image_get_base_type (image) != GIMP_INDEXED)
            sensitive = TRUE;
        }

      gtk_widget_set_sensitive (dialog->sample_merged_toggle, sensitive);
      gtk_widget_set_sensitive (dialog->selection_only_toggle, sensitive);
      gimp_scale_entry_set_sensitive (GTK_OBJECT (dialog->threshold),
                                      sensitive);
      gimp_scale_entry_set_sensitive (GTK_OBJECT (dialog->num_colors),
                                      sensitive);
    }

  if (dialog->image)
    {
      g_signal_connect (dialog->image, "active-layer-changed",
                        G_CALLBACK (palette_import_layer_changed),
                        dialog);
      g_signal_connect (dialog->image, "mask-changed",
                        G_CALLBACK (palette_import_mask_changed),
                        dialog);
    }
}
static void
palette_import_set_sensitive (ImportDialog *dialog)
{
  gboolean gradient = (dialog->import_type == GRADIENT_IMPORT);
  gboolean image    = (dialog->import_type == IMAGE_IMPORT);
  gboolean file     = (dialog->import_type == FILE_IMPORT);

  gtk_widget_set_sensitive (dialog->gradient_combo,        gradient);
  gtk_widget_set_sensitive (dialog->image_combo,           image);
  gtk_widget_set_sensitive (dialog->sample_merged_toggle,  image);
  gtk_widget_set_sensitive (dialog->selection_only_toggle, image);
  gtk_widget_set_sensitive (dialog->file_chooser,          file);

  gimp_scale_entry_set_sensitive (GTK_OBJECT (dialog->num_colors), ! file);
  gimp_scale_entry_set_sensitive (GTK_OBJECT (dialog->columns),    ! file);
  gimp_scale_entry_set_sensitive (GTK_OBJECT (dialog->threshold),  image);
}
예제 #3
0
파일: mblur.c 프로젝트: Amerekanets/gimp
static void
mblur_set_sensitivity (void)
{
  if (!length || !angle || !center || !dir_button)
    return;                     /* Not initialized yet */

  switch (mbvals.mblur_type)
    {
    case MBLUR_LINEAR:
      gimp_scale_entry_set_sensitive (length, TRUE);
      gimp_scale_entry_set_sensitive (angle, TRUE);
      gtk_widget_set_sensitive (center, FALSE);
      gtk_widget_set_sensitive (dir_button, FALSE);
      break;

    case MBLUR_RADIAL:
      gimp_scale_entry_set_sensitive (length, FALSE);
      gimp_scale_entry_set_sensitive (angle, TRUE);
      gtk_widget_set_sensitive (center, TRUE);
      gtk_widget_set_sensitive (dir_button, FALSE);
      break;

    case MBLUR_ZOOM:
      gimp_scale_entry_set_sensitive (length, TRUE);
      gimp_scale_entry_set_sensitive (angle, FALSE);
      gtk_widget_set_sensitive (center, TRUE);
      gtk_widget_set_sensitive (dir_button, TRUE);
      break;

    default:
      break;
    }
}
예제 #4
0
static void
alienmap2_set_sensitive (void)
{
  gimp_scale_entry_set_sensitive (entry_freq_rh,  wvals.redmode);
  gimp_scale_entry_set_sensitive (entry_phase_rh, wvals.redmode);
  gimp_scale_entry_set_sensitive (entry_freq_gs,  wvals.greenmode);
  gimp_scale_entry_set_sensitive (entry_phase_gs, wvals.greenmode);
  gimp_scale_entry_set_sensitive (entry_freq_bl,  wvals.bluemode);
  gimp_scale_entry_set_sensitive (entry_phase_bl, wvals.bluemode);
}
예제 #5
0
파일: jpeg-save.c 프로젝트: frne/gimp
static void
subsampling_changed (GtkWidget *combo,
                     GtkObject *entry)
{
  gint value;

  gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (combo), &value);

  jsvals.subsmp = value;

  /*  smoothing is not supported with nonstandard sampling ratios  */
  gimp_scale_entry_set_sensitive (entry,
                                  jsvals.subsmp != JPEG_SUBSAMPLING_2x1_1x1_1x1 &&
                                  jsvals.subsmp != JPEG_SUBSAMPLING_1x2_1x1_1x1);

  make_preview ();
}