示例#1
0
文件: appgldi.go 项目: sqp/godock
// RemoveSubIcon only need the ID to remove the SubIcon. See cdtype.AppIcon.
//
func (o *AppGldi) RemoveSubIcon(id string) error {
	subicon, ok := o.icons[id]
	if !ok && id != "any" {
		return errors.New("RemoveSubIcon Icon missing: " + id)
	}

	if ok { // should allow the user to use the "any" key anyway.
		delete(o.icons, id)

		gldi.ObjectUnref(subicon.Icon)
		o.Icon.RemoveSubdockEmpty() // special hack, needs to be confirmed.
		return nil
	}

	o.icons = make(map[string]*IconBase)
	o.mi.RemoveAllIcons()
	return nil
}
示例#2
0
文件: mgrgldi.go 项目: sqp/godock
// StopApplet close the applet instance.
//
func (o *AppManager) stopApplet(mi *gldi.ModuleInstance) {
	icon := mi.Icon()
	o.sendApp(icon, "on_stop_module")

	if subdock := icon.GetSubDock(); subdock != nil {
		gldi.ObjectUnref(subdock)
		// mi.Icon().pSubDock = nil
	}

	icon.RemoveDataRenderer()

	desklet := mi.Desklet()
	if desklet != nil && desklet.HasIcons() {
		desklet.RemoveIcons()
	}

	o.log.Debug("Applet stopped", mi.Module().VisitCard().GetName())

	delete(o.actives, unsafe.Pointer(icon.ToNative()))
}
示例#3
0
文件: dialog.go 项目: sqp/godock
func removeDialog() {
	if dialogPtr != nil { // Only one dialog allowed. Triggered when opening a dialog on another icon.
		gldi.ObjectUnref(dialogPtr)
		dialogPtr = nil
	}
}