Clouds

package
v0.0.0-...-0caaa62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 10 Imported by: 0

Documentation

Overview

Package Clouds is a weather monitoring applet for Cairo-Dock.

It's almost a clone of the weather app to show weather forecast icons.

Added:

Autodetect location based on IP.
Shortcuts: show dialog today, show tomorrow, open Webpage, recheck, set location.
Editable template.

Possible problem (to confirm):

External applets left and middle clicks disabled when a subdock is set.
  For me, even when the subdock is removed, clicks actions aren't restored.
  This can be tested by disabling the subdock (set forecast days to 0).

Dock issue:

On some systems the right click menu is called twice.

Dropped, because it's impossible to do for an external app:

  (but it could be possible to try in dock mode.
   The problem would be the config file differences between both)

Always visible option and its background color.
Render desklet in 3D
Sub-dock view type.

Index

Constants

View Source
const (
	// IconWork is the name of icon displayed during polling.
	IconWork = "EmblemWork.svg" // file located in applet "img" subdir.

	// IconMissing is the name of the icon displayed when a weather icon is not found.
	IconMissing = "default-icon"

	// EmblemWork is the position of the emblem displayed during polling.
	EmblemWork = cdtype.EmblemTopLeft
)
View Source
const (
	ActionNone = iota
	ActionShowCurrent
	ActionShowTomorrow
	ActionOpenWebpage
	ActionRecheckNow
	ActionSetLocation
)

List of actions defined in this applet. Actions order in this list must match the order in defineActions.

Variables

This section is empty.

Functions

func NewApplet

func NewApplet(base cdtype.AppBase, events *cdtype.Events) cdtype.AppInstance

NewApplet creates a new applet instance.

Types

type Applet

type Applet struct {
	cdtype.AppBase // Applet base and dock connection.
	// contains filtered or unexported fields
}

Applet defines a dock applet.

func (*Applet) AskLocationConfirm

func (app *Applet) AskLocationConfirm(locstr string)

AskLocationConfirm search the list of cities matching the provided name and shows a dialog with the list of locations for the user to choose. When validated, the config file is updated and ...(TODO: need reload, to check). If no data is found, the user is sent back to the AskLocationText dialog with the text he provided.

func (*Applet) AskLocationText

func (app *Applet) AskLocationText(deftxt string)

AskLocationText asks the user his location name.

If confirmed, continues the selection process. A default text may be used as argument.

func (*Applet) Check

func (app *Applet) Check()

Check gets and displays updated weather informations.

func (*Applet) DetectLocation

func (app *Applet) DetectLocation()

DetectLocation tries to detect your location from IP and get the matching code.

func (*Applet) DialogWeatherCurrent

func (app *Applet) DialogWeatherCurrent()

DialogWeatherCurrent shows the current weather details.

func (*Applet) DialogWeatherForecast

func (app *Applet) DialogWeatherForecast(ref string)

DialogWeatherForecast shows the weather details for one of the next days.

func (*Applet) Draw

func (app *Applet) Draw()

Draw new data on icon.

func (*Applet) Init

func (app *Applet) Init(def *cdtype.Defaults, confLoaded bool)

Init load user configuration if needed and initialise applet.

func (*Applet) OpenWebCurrent

func (app *Applet) OpenWebCurrent()

OpenWebCurrent opens a web page on the provider site for the current day.

func (*Applet) OpenWebForecast

func (app *Applet) OpenWebForecast(numDay int)

OpenWebForecast opens a web page on the provider site for the given day.

func (*Applet) SetLocationCode

func (app *Applet) SetLocationCode(locationCode, locationName string)

SetLocationCode updates the config file with the new location and ... (TODO: need reload, to check).

func (*Applet) WeatherIcon

func (app *Applet) WeatherIcon(icon string) string

WeatherIcon returns the full path to the current weather theme icon.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL