mirror of
				https://github.com/nkanaev/yarr.git
				synced 2025-10-30 06:31:07 +00:00 
			
		
		
		
	rename Errorf -> Printf
This commit is contained in:
		| @@ -763,12 +763,12 @@ func (t *winTray) iconToBitmap(hIcon windows.Handle) (windows.Handle, error) { | |||||||
|  |  | ||||||
| func registerSystray() { | func registerSystray() { | ||||||
| 	if err := wt.initInstance(); err != nil { | 	if err := wt.initInstance(); err != nil { | ||||||
| 		log.Errorf("Unable to init instance: %v", err) | 		log.Printf("Unable to init instance: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if err := wt.createMenu(); err != nil { | 	if err := wt.createMenu(); err != nil { | ||||||
| 		log.Errorf("Unable to create menu: %v", err) | 		log.Printf("Unable to create menu: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -793,7 +793,7 @@ func nativeLoop() { | |||||||
| 		// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644936(v=vs.85).aspx | 		// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644936(v=vs.85).aspx | ||||||
| 		switch int32(ret) { | 		switch int32(ret) { | ||||||
| 		case -1: | 		case -1: | ||||||
| 			log.Errorf("Error at message loop: %v", err) | 			log.Printf("Error at message loop: %v", err) | ||||||
| 			return | 			return | ||||||
| 		case 0: | 		case 0: | ||||||
| 			return | 			return | ||||||
| @@ -834,11 +834,11 @@ func iconBytesToFilePath(iconBytes []byte) (string, error) { | |||||||
| func SetIcon(iconBytes []byte) { | func SetIcon(iconBytes []byte) { | ||||||
| 	iconFilePath, err := iconBytesToFilePath(iconBytes) | 	iconFilePath, err := iconBytesToFilePath(iconBytes) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to write icon data to temp file: %v", err) | 		log.Printf("Unable to write icon data to temp file: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 	if err := wt.setIcon(iconFilePath); err != nil { | 	if err := wt.setIcon(iconFilePath); err != nil { | ||||||
| 		log.Errorf("Unable to set icon: %v", err) | 		log.Printf("Unable to set icon: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -868,19 +868,19 @@ func (item *MenuItem) parentId() uint32 { | |||||||
| func (item *MenuItem) SetIcon(iconBytes []byte) { | func (item *MenuItem) SetIcon(iconBytes []byte) { | ||||||
| 	iconFilePath, err := iconBytesToFilePath(iconBytes) | 	iconFilePath, err := iconBytesToFilePath(iconBytes) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to write icon data to temp file: %v", err) | 		log.Printf("Unable to write icon data to temp file: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	h, err := wt.loadIconFrom(iconFilePath) | 	h, err := wt.loadIconFrom(iconFilePath) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to load icon from temp file: %v", err) | 		log.Printf("Unable to load icon from temp file: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	h, err = wt.iconToBitmap(h) | 	h, err = wt.iconToBitmap(h) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to convert icon to bitmap: %v", err) | 		log.Printf("Unable to convert icon to bitmap: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 	wt.muMenuItemIcons.Lock() | 	wt.muMenuItemIcons.Lock() | ||||||
| @@ -889,7 +889,7 @@ func (item *MenuItem) SetIcon(iconBytes []byte) { | |||||||
|  |  | ||||||
| 	err = wt.addOrUpdateMenuItem(uint32(item.id), item.parentId(), item.title, item.disabled, item.checked) | 	err = wt.addOrUpdateMenuItem(uint32(item.id), item.parentId(), item.title, item.disabled, item.checked) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to addOrUpdateMenuItem: %v", err) | 		log.Printf("Unable to addOrUpdateMenuItem: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -898,7 +898,7 @@ func (item *MenuItem) SetIcon(iconBytes []byte) { | |||||||
| // only available on Mac and Windows. | // only available on Mac and Windows. | ||||||
| func SetTooltip(tooltip string) { | func SetTooltip(tooltip string) { | ||||||
| 	if err := wt.setTooltip(tooltip); err != nil { | 	if err := wt.setTooltip(tooltip); err != nil { | ||||||
| 		log.Errorf("Unable to set tooltip: %v", err) | 		log.Printf("Unable to set tooltip: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -906,7 +906,7 @@ func SetTooltip(tooltip string) { | |||||||
| func addOrUpdateMenuItem(item *MenuItem) { | func addOrUpdateMenuItem(item *MenuItem) { | ||||||
| 	err := wt.addOrUpdateMenuItem(uint32(item.id), item.parentId(), item.title, item.disabled, item.checked) | 	err := wt.addOrUpdateMenuItem(uint32(item.id), item.parentId(), item.title, item.disabled, item.checked) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to addOrUpdateMenuItem: %v", err) | 		log.Printf("Unable to addOrUpdateMenuItem: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -922,7 +922,7 @@ func (item *MenuItem) SetTemplateIcon(templateIconBytes []byte, regularIconBytes | |||||||
| func addSeparator(id uint32) { | func addSeparator(id uint32) { | ||||||
| 	err := wt.addSeparatorMenuItem(id, 0) | 	err := wt.addSeparatorMenuItem(id, 0) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to addSeparator: %v", err) | 		log.Printf("Unable to addSeparator: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| @@ -930,7 +930,7 @@ func addSeparator(id uint32) { | |||||||
| func hideMenuItem(item *MenuItem) { | func hideMenuItem(item *MenuItem) { | ||||||
| 	err := wt.hideMenuItem(uint32(item.id), item.parentId()) | 	err := wt.hideMenuItem(uint32(item.id), item.parentId()) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Errorf("Unable to hideMenuItem: %v", err) | 		log.Printf("Unable to hideMenuItem: %v", err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user