Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 10th, 2011  |  syntax: None  |  size: 2.55 KB  |  views: 48  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git a/src/encoding-dialog.c b/src/encoding-dialog.c
  2. index d71271e..2c7cb68 100644
  3. --- a/src/encoding-dialog.c
  4. +++ b/src/encoding-dialog.c
  5. @@ -85,10 +85,12 @@ static char*
  6.  encoding_dialog_get_encoding(GtkDialog* dialog)
  7.  {
  8.      GtkComboBox* combobox;
  9. +    GtkEntry* entry;
  10.  
  11.      combobox = g_object_get_data(G_OBJECT(dialog), "encoding_entry");
  12. +    entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combobox)));
  13.  
  14. -    return gtk_combo_box_get_active_text(combobox);
  15. +    return g_strdup(gtk_entry_get_text(entry));
  16.  }
  17.  
  18.  GtkDialog*
  19. @@ -97,7 +99,7 @@ encoding_dialog_new(GtkWindow* parent)
  20.      GtkBuilder* builder;
  21.      GObject* object;
  22.      GtkDialog* dialog;
  23. -    GtkComboBoxEntry* entry;
  24. +    GtkComboBox* entry;
  25.      GtkTreeModel* model;
  26.  
  27.      builder = gtk_builder_new();
  28. @@ -117,9 +119,9 @@ encoding_dialog_new(GtkWindow* parent)
  29.      }
  30.  
  31.      model = GTK_TREE_MODEL(get_encoding_list_model());
  32. -    entry = GTK_COMBO_BOX_ENTRY(object);
  33. +    entry = GTK_COMBO_BOX(object);
  34.      gtk_combo_box_set_model(GTK_COMBO_BOX(entry), model);
  35. -    gtk_combo_box_entry_set_text_column(entry, ENCODING_COLUMN_ENCODING);
  36. +    gtk_combo_box_set_entry_text_column(entry, ENCODING_COLUMN_ENCODING);
  37.      g_object_set_data(G_OBJECT(dialog), "encoding_entry", entry);
  38.  
  39.      g_object_unref(builder);
  40. diff --git a/src/encoding-dialog.ui b/src/encoding-dialog.ui
  41. index 0e7257e..2919ee8 100644
  42. --- a/src/encoding-dialog.ui
  43. +++ b/src/encoding-dialog.ui
  44. @@ -1,7 +1,6 @@
  45. -<?xml version="1.0"?>
  46. +<?xml version="1.0" encoding="UTF-8"?>
  47.  <interface>
  48. -  <!-- interface-requires gtk+ 2.12 -->
  49. -  <!-- interface-naming-policy project-wide -->
  50. +  <requires lib="gtk+" version="2.20"/>
  51.    <object class="GtkDialog" id="encoding_dialog">
  52.      <property name="border_width">5</property>
  53.      <property name="title" translatable="yes">Select an encoding name to use</property>
  54. @@ -29,9 +28,14 @@
  55.                </packing>
  56.              </child>
  57.              <child>
  58. -              <object class="GtkComboBoxEntry" id="encoding_name_entry">
  59. +              <object class="GtkComboBox" id="encoding_name_entry">
  60.                  <property name="visible">True</property>
  61.                  <property name="has_entry">True</property>
  62. +                <child internal-child="entry">
  63. +                  <object class="GtkEntry" id="combobox-entry">
  64. +                    <property name="can_focus">True</property>
  65. +                  </object>
  66. +                </child>
  67.                </object>
  68.                <packing>
  69.                  <property name="position">1</property>
clone this paste RAW Paste Data