Re: Feedback: Panel, Applets and volatile preferences files.



On Wed, Aug 02, 2000 at 12:48:04PM +0200, Preben Randhol wrote:
> After installing Debian 2.2 GNU/Linux for my father I installed Helix
> Gnome. Since he has just started to use computers I thought that Gnome
> would be nice. And it is.

Ditto.

> But my point is that if this applet had a preference file that was fixed
> and not just Applet_X_Extern, then it probably would have worked to just
> start the applet up again.

I run into the same problem with other panel applets--most commonly Tom
Gilbert's excellent Screen Shooter.

In my case, the problem isn't crashes (fortunately). It's simply a desire
to save preferences when removing Screen Shooter from the panel, and
restore those preferences when adding it back.

Right now, the only way for me to save Screen Shooter's preferences is to
keep it running all the time. But this is silly--I only use it every few
weeks, and like all panel applets, it consumes a moderately-sized chunk of
RAM.

But it's also obvious that I could (hypothetically) create *two* copies of
Screen Shooter, and configure them differently. So it's not clear what the
Right Thing<tm> to do is in each of these scenarios.

Here's one possible approach. (It presents a relatively simple system
behavior model to the user, FWIW.)

  * When working with more than one instance of an applet, use the default
    settings for each new instance.
  * When adding or deleting a single instance of an applet, make
    preferences persistent.

Here's one possible algorithm which meets these goals:

  func add_applet_to_panel:
    if one or more instances of the applet are already running:
      use default preferences for this instance
    else:
      if we have previously saved preferences for this applet:
        use previously saved preferences for this instance
      else:
        use default preferences for this instance

  func remove_applet_from_panel:
    if this is the last running instance of this applet:
      save preferences for this instance

You'd have to get slightly trickier, of course, if you wanted to treat an
applet crash as an unplanned "removal" (which would solve Preben's
problem).

Am I completely off my rocker, or does this sound vaguely useful? If
there's sufficient interest, I could prepare some patches for examination
by the panel developers.

Cheers,
Eric




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]