drop gtk2 support

When opening pavucontrol.glade with Glade 3.22.1, this message was
shown:

    pavucontrol.glade targets Gtk+ 2.16

    But this version of Glade is for GTK+ 3 only.
    Make sure you can run this project with Glade 3.8 with no deprecated
    widgets first.

I think it's best to just drop the gtk2 support.
This commit is contained in:
Tanu Kaskinen 2018-11-21 12:31:56 +02:00
parent 577246f15a
commit dfeabf086c
5 changed files with 2 additions and 34 deletions

View File

@ -41,26 +41,7 @@ AC_TYPE_SIGNAL
AC_HEADER_STDC
AX_CXX_COMPILE_STDCXX_11
AC_ARG_ENABLE(gtk3,
[AS_HELP_STRING([--disable-gtk3],
[Whether to build or not against gtk3 [default=yes]])],
[enable_gtk3=$enableval],
[enable_gtk3="yes"])
if test "x$enable_gtk3" = "xyes"; then
gtkmm_ver="3.0"
gtkmm_min_ver="2.99"
canberra_ver="3"
AC_DEFINE([HAVE_GTK3], [1], [Define if we are building against gtk3])
echo "***"
echo "*** Attempting build in GTK3 mode. Use --disable-gtk3 to build for GTK2"
echo "***"
else
gtkmm_ver="2.4"
gtkmm_min_ver="2.16"
canberra_ver=""
fi
PKG_CHECK_MODULES(GUILIBS, [ gtkmm-$gtkmm_ver >= $gtkmm_min_ver sigc++-2.0 libcanberra-gtk$canberra_ver >= 0.16 ])
PKG_CHECK_MODULES(GUILIBS, [ gtkmm-3.0 >= 3.0 sigc++-2.0 libcanberra-gtk3 >= 0.16 ])
AC_SUBST(GUILIBS_CFLAGS)
AC_SUBST(GUILIBS_LIBS)

View File

@ -70,13 +70,8 @@ DeviceWidget::DeviceWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Buil
for (unsigned i = 0; i < PA_CHANNELS_MAX; i++)
channelWidgets[i] = NULL;
#ifdef HAVE_GTK3
offsetAdjustment = Gtk::Adjustment::create(0.0, -2000.0, 5000.0, 10.0, 50.0, 0.0);
offsetButton->configure(offsetAdjustment, 0, 2);
#else
offsetAdjustment = new Gtk::Adjustment(0.0, -2000.0, 5000.0, 10.0, 50.0, 0.0);
offsetButton->configure(*offsetAdjustment, 0.0, 2);
#endif /* HAVE_GTK3 */
}
void DeviceWidget::init(MainWindow* mainWindow, Glib::ustring deviceType) {

View File

@ -101,11 +101,7 @@ protected:
Gtk::HBox *portSelect, *offsetSelect;
Gtk::ComboBox *portList;
Glib::RefPtr<Gtk::ListStore> treeModel;
#ifdef HAVE_GTK3
Glib::RefPtr<Gtk::Adjustment> offsetAdjustment;
#else
Gtk::Adjustment *offsetAdjustment;
#endif /* HAVE_GTK3 */
private:
Glib::ustring mDeviceType;

View File

@ -196,11 +196,7 @@ MainWindow* MainWindow::create(bool maximize) {
void MainWindow::on_realize() {
Gtk::Window::on_realize();
#ifdef HAVE_GTK3
get_window()->set_cursor(Gdk::Cursor::create(Gdk::WATCH));
#else
get_window()->set_cursor(Gdk::Cursor(Gdk::WATCH));
#endif /* HAVE_GTK3 */
}
bool MainWindow::on_key_press_event(GdkEventKey* event) {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="value">44.2408370972</property>