Thanks a lot for your patch! This looks good - it makes me wonder if
we should switch to the gtk3 branch entirely, what do you think? Have
you had a chance to play with it? There is some potential for
regression with that move of course, but it seems like its not worth
it as this needs to be done in the future anyway.
On Tue, Nov 13, 2012 at 08:30:35AM -0000, Robert Roth wrote: developers) /bugs.launchpad .net/ubuntu/ +source/ synaptic/ +bug/1033517 /code.launchpad .net/~evfool/ synaptic/ lp1033517/ +merge/ 134046
> Robert Roth has proposed merging lp:~evfool/synaptic/lp1033517 into lp:synaptic.
>
> Requested reviews:
> synaptic-developers (synaptic-
> Related bugs:
> Bug #1033517 in synaptic (Ubuntu): "Gtk-WARNING **: Cannot add an object of type GtkMenu to a container of type GtkOptionMenu"
> https:/
>
> For more details, see:
> https:/
>
> Changed the deprecated GtkOptionMenu used on the force version dialog to a GtkComboBoxText (available in gtk since gtk 2.24) to fix bug #1033517.
Thanks a lot for your patch! This looks good - it makes me wonder if
we should switch to the gtk3 branch entirely, what do you think? Have
you had a chance to play with it? There is some potential for
regression with that move of course, but it seems like its not worth
it as this needs to be done in the future anyway.
Cheers,
Michael
> -- /code.launchpad .net/~evfool/ synaptic/ lp1033517/ +merge/ 134046
> https:/
> You are subscribed to branch lp:synaptic.
> === modified file 'gtk/gtkbuilder /dialog_ change_ version. ui' dialog_ change_ version. ui 2012-02-17 07:17:41 +0000 dialog_ change_ version. ui 2012-11-13 08:29:23 +0000 GtkOptionMenu" id="optionmenu_ available_ versions" > GtkComboBoxText " id="combobox_ available_ versions" > >True</ property> focus"> True</property> >-1</property> >0</property> ow.cc' gtk_builder_ get_object gtk_builder_ get_object der(), available_ versions" )); available_ versions" )); leVersions( ); i].first. c_str() , i].second. c_str() ); item_new_ with_label( str); ersion( ); show(item) ; shell_append( GTK_MENU_ SHELL(menu) , item); box_text_ append_ text(GTK_ COMBO_BOX_ TEXT(comboBox) , str); menu_set_ menu(GTK_ OPTION_ MENU(optionMenu ), menu); menu_set_ history( GTK_OPTION_ MENU(optionMenu ), canidateNr); box_set_ active( GTK_COMBO_ BOX(comboBox) , canidateNr); menu_get_ history( GTK_OPTION_ MENU(optionMenu )); box_get_ active( GTK_COMBO_ BOX(comboBox) ); false);
> --- gtk/gtkbuilder/
> +++ gtk/gtkbuilder/
> @@ -122,14 +122,9 @@
> </packing>
> </child>
> <child>
> - <object class="
> + <object class="
> <property name="visible"
> <property name="can_
> - <property name="history"
> - <child>
> - <object class="GtkMenu" id="menu1">
> - </object>
> - </child>
> </object>
> <packing>
> <property name="padding"
>
> === modified file 'gtk/rgmainwind
> --- gtk/rgmainwindow.cc 2012-11-12 22:05:33 +0000
> +++ gtk/rgmainwindow.cc 2012-11-13 08:29:23 +0000
> @@ -560,12 +560,9 @@
> g_free(str_name);
> g_free(str);
>
> - GtkWidget *optionMenu = GTK_WIDGET(
> + GtkWidget *comboBox = GTK_WIDGET(
> (dia.getGtkBuil
> - "optionmenu_
> -
> - GtkWidget *menu = gtk_menu_new();
> - GtkWidget *item;
> + "combobox_
>
> int canidateNr = 0;
> vector<pair<string, string> > versions = pkg->getAvailab
> @@ -573,23 +570,20 @@
> gchar *str = g_strdup_printf("%s (%s)",
> versions[
> versions[
> - item = gtk_menu_
> const char *verStr = pkg->availableV
> if(verStr && versions[i].first == string(verStr))
> - canidateNr = i;
> - gtk_widget_
> - gtk_menu_
> + canidateNr = i;
> + gtk_combo_
> //cout << "got: " << str << endl;
> g_free(str);
> }
> - gtk_option_
> - gtk_option_
> + gtk_combo_
> if(!dia.run()) {
> //cout << "cancel" << endl;
> return; // user clicked cancel
> }
>
> - int nr = gtk_option_
> + int nr = gtk_combo_
>
> pkg->setNotify(
> // nr-1 here as we add a "do not override" to the option menu
>