Michael Orlitzky [Tue, 29 Oct 2019 23:47:20 +0000 (19:47 -0400)]
xfce4-hdaps-dialogs.c: consolidate the URI launcher.
Now that the signal handler for the "about" dialog works, let's
consolidate the two identical URI launcher routines. The new
factored-out launch_uri() function tries all three approaches
in succession:
1. whatever gtk_show_uri_on_window() does,
2. exo-open, and
3. xdg-open.
If those all fail, it fails. We had to twiddle some things to allow us
to pass a GtkWindow pointer into the launch_uri() function because
gtk_show_uri_on_window() needs one, but that wasn't a big deal.
Michael Orlitzky [Tue, 29 Oct 2019 23:43:22 +0000 (19:43 -0400)]
xfce4-hdaps-dialogs.c: construct "about" dialog by hand.
The way we were constructing our "about" dialog made it impossible to
hook up the "activate-link" signal handler to it. It pretended to
work, but attempting to add the signal handler to an XfcePanelPlugin
silently failed, and the only way to get a real GTK object (to make it
work) is to build up the "about" dialog ourselves.
There was a fallback condition in one of our URI handlers that fell
back to the same thing that just failed. Instead of that genius idea,
it now reports an error, which is what the other URI handler within
the plugin does too.
Michael Orlitzky [Sat, 26 Oct 2019 15:16:10 +0000 (11:16 -0400)]
xfce4-hdaps-dialogs.c: prefer xdg-open to exo-open.
There are two places we handle URLs in the plugin, and they were using
different programs to open a URL. This commit makes them both use
"xdg-open" instead of "exo-open". I have no idea if it lives up to the
promise, but xdg-open is supposed to intelligently determine your
desktop environment and then do The Right Thing; whereas exo-open
is specific to XFCE.
Michael Orlitzky [Thu, 24 Oct 2019 14:33:52 +0000 (10:33 -0400)]
configure.ac.in: set the version to 1.0.0.
This plugin is feature-complete, and has been stable for many years.
After the update to gtk+-3.x settles, I don't expect there to be any
more changes until somebody breaks our APIs again.
Michael Orlitzky [Thu, 24 Oct 2019 14:31:38 +0000 (10:31 -0400)]
.gitignore: remove it.
I've become used to seeing the auto-generated files in my repositories,
and I think I'm past the point in my life where I would accidentally
add them to the repository.
Michael Orlitzky [Thu, 24 Oct 2019 14:27:03 +0000 (10:27 -0400)]
icons: add various other sizes of PNG icons.
For whatever reason, after updating to xfce-4.14, my SVG icon isn't
being used in contexts where it should. For example, I'm seeing a
"missing icon" image on the plugin's "about" dialog, where the
scalable icon would be a perfect choice.
The SVG icon is still there, and should be used as a last resort, but
maybe other people would experience this problem as well. To work
around it, I've manually created a bunch of PNG icons in various
sizes. This fixes my problem, and can't hurt anything (ha ha).
Michael Orlitzky [Wed, 23 Oct 2019 14:58:09 +0000 (10:58 -0400)]
xfce4-hdaps-dialogs.c: replace email/url hooks with a signal handler.
The old gtk_about_dialog_set_{email,url}_hook() functions that we used
for our custom http(s):// and mailto:// handlers are gone. To achieve
the same goal, they've been replaced by an "activate-link" signal
handler, and both implementation (that is, the hooks) have been
combined into a single call to xdg-open.
Michael Orlitzky [Wed, 23 Oct 2019 14:14:53 +0000 (10:14 -0400)]
xfce4-hdaps-dialogs.c: replace GTK_STOCK macros with their values.
The GTK_STOCK_* macros are all deprecated and are throwing warnings in
gtk+-3.x. But apparently, hard-coding the value of the macro is fine?
This is what the examples in libxfce4ui do at least. On the other
hand, the "stock items migration guide" suggests that we should use
newer icon names from the freedesktop.org specification.
Having tried the new names, I am happy to say that they don't work at
all, leaving me with the obviously-correct solution in this commit: to
replace the deprecated macros with their hard-coded values verbatim.
Michael Orlitzky [Wed, 23 Oct 2019 13:11:28 +0000 (09:11 -0400)]
xfce4-hdaps-dialogs.c: switch from hbox/vbox to generic box.
The gtk_vbox_new() and gtk_hbox_new() functions have been deprecated
as of gtk+-3.2. Instead, we're supposed to use the generic gtk_box_new()
function and pass in an orientation like GTK_ORIENTATION_VERTICAL. Ok,
no problem. That change is somewhat trivial.
But, in a related change, a GtkDialog no longer exposes its content
vbox via a member variable in gtk+-3.x. So, we have to get it with the
gtk_dialog_get_content_area() accessor function. This change is also
trivial, once you have figured out that the vbox it accesses is the
same one that was removed from the public API of GtkDialog. I sure
hope it is.
The gtk_misc_set_alignment() function has been deprecated since
gtk+-3.14. Instead, we are prodded to use the gtk_widget_set_halign()
and gtk_widget_set_valign() functions. This is a trivial change,
replacing two calls to gtk_misc_set_alignment() by four calls to
the new functions.
Michael Orlitzky [Wed, 23 Oct 2019 02:59:40 +0000 (22:59 -0400)]
xfce4-hdaps-dialogs.c: update to newer combo box API.
The gtk_combo_box_get_active_text() and gtk_combo_box_append_text()
functions have apparently been deprecated since gtk+-2.24. Instead
of calling those functions on a GtkComboBox pointer, we're instead
supposed to call e.g. gtk_combo_box_text_get_active_text() on a
GtkComboBoxText pointer.
Since our "cb_device_name" member was only ever declared as a GtkWidget,
all we have to do is switch everything to the new functions so that they
create, access, and modify the GtkComboBoxText referred to by cb_device_name
instead of a GtkComboBox in the same place.
Michael Orlitzky [Wed, 23 Oct 2019 02:58:35 +0000 (22:58 -0400)]
xfce4-hdaps-dialogs.c: drop obsolete GTK_DIALOG_NO_SEPARATOR flag.
While creating our main dialog box, we used to pass in the
GTK_DIALOG_NO_SEPARATOR flag to omit the separator between the main
vbox and the action area. I no longer remember what real impact this
had, which is good I guess because that flag doesn't exist in gtk+-3.x.
Other XFCE panel plugins have fixed this by deleting the flag, and that
seems like a fine solution to me.
Michael Orlitzky [Wed, 23 Oct 2019 02:28:46 +0000 (22:28 -0400)]
panel-plugin: replace XFCE_HVBOX with new GtkBox API.
The XFCE_HVBOX stuff is gone in the new version of the panel library
because its functionality has been superseded by GtkBox in gtk+-3.x.
First we drop the header include for libxfce4panel/xfce-hvbox.h that no
longer exists, and then we change xfce_hvbox_new() to gtk_box_new() and
xfce_hvbox_set_orientation() to gtk_orientable_set_orientation().
For us, this is pretty straightforward: instead of declaring a GtkTooltips
member and doing stuff to it, we just call the gtk_widget_set_tooltip_text()
function on our plugin's eventbox instead.
These are detected by the configure script which then does whatever it
needs to do to ensure that they get linked in the right places. Instead
of requesting gtk+-2.20.0 and the xfce-4.8.0 versions of the libraries, we
now request gtk+-3.0 and the xfce-4.14.0versions. This should immediately
break the build and give me a nice long list of tasks that need to be
completed to finish the migration.
Michael Orlitzky [Sun, 20 Oct 2019 12:59:14 +0000 (08:59 -0400)]
COPYING: update license to AGPL-3.
This also touches the comment headers in all of the source files,
since they mention the license by name. The text displayed on the
plugin's info dialog has also been updated.
Michael Orlitzky [Sun, 20 Oct 2019 12:43:58 +0000 (08:43 -0400)]
panel-plugin/Makefile.am: rename INCLUDES to AM_CPPFLAGS.
Upstream changed the name of the variable and now INCLUDES is
deprecated. See, for example, the "Variables used when building a
program" section of the automake manual.
Michael Orlitzky [Thu, 25 Mar 2010 01:28:11 +0000 (21:28 -0400)]
Bumped the version to 0.0.6.
Bumped the required versions of GTK+, libxfce4panel, and libxfce4util.
Replaced the libxfcegui4 requirement with libxfce4ui.
Michael Orlitzky [Thu, 19 Feb 2009 07:06:03 +0000 (02:06 -0500)]
Fixed build with --enable-debug=full thanks to Evgeni Golov.
Added declaration of hdaps_reset_timeout in xfce4-hdaps.h.
Rearranged some header #includes.
Michael Orlitzky [Wed, 11 Feb 2009 00:01:39 +0000 (19:01 -0500)]
Fixed a status update bug thanks to Evgeni Golov.
Added a new state constant, HDAPS_ON.
Changed hdaps_update_status to use the new constant when determining whether or not HDAPS has changed states from "on" to "off."
Michael Orlitzky [Sat, 24 Jan 2009 03:59:11 +0000 (22:59 -0500)]
Added tooltip support for the three states.
Changed the "error" icon to emblem-noread.
Updated the hdaps slurp/parse functions to always return HDAPS_ERROR when there is an error.
Altered hdaps_set_icon to check for (status == HDAPS_ERROR) rather than (status < HDAPS_OFF) as a result of the previous modification.