Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Z-Bolt/OctoScreen.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffB42 <10328858+JeffB42@users.noreply.github.com>2021-04-17 20:18:45 +0300
committerJeffB42 <10328858+JeffB42@users.noreply.github.com>2021-04-17 20:18:45 +0300
commit4b0effd141f53a57b94a50ba3eb1e8fa46bd2c68 (patch)
tree9a64b2c7ab26e7c514a6202c1b1701127118c2d4
parenteae34f6edfc3a81f5a6a8e95271f89ba209d30d9 (diff)
added name parameter and removed parentPanel parameter
-rwxr-xr-xoctoprintApis/ZOffsetRequest.go2
-rwxr-xr-xui/BedLevelPanel.go7
-rwxr-xr-xui/ConfigurationPanel.go13
-rwxr-xr-xui/ConnectionPanel.go9
-rwxr-xr-xui/CustomItemsPanel.go6
-rwxr-xr-xui/FanPanel.go6
-rwxr-xr-xui/FilamentPanel.go9
-rwxr-xr-xui/FilesPanel.go6
-rwxr-xr-xui/HomePanel.go7
-rwxr-xr-xui/IdleStatusPanel.go4
-rwxr-xr-xui/MovePanel.go4
-rwxr-xr-xui/NetworkPanel.go9
-rwxr-xr-xui/PrintMenuPanel.go18
-rwxr-xr-xui/PrintStatusPanel.go5
-rwxr-xr-xui/SplashPanel.go7
-rwxr-xr-xui/SystemPanel.go5
-rwxr-xr-xui/TemperaturePanel.go8
-rwxr-xr-xui/TemperaturePresetsPanel.go5
-rwxr-xr-xui/menu.go36
-rwxr-xr-xui/tool_changer_panel.go8
-rwxr-xr-xui/z_offset_calibration_panel.go6
21 files changed, 98 insertions, 82 deletions
diff --git a/octoprintApis/ZOffsetRequest.go b/octoprintApis/ZOffsetRequest.go
index eb73e31..972ee1c 100755
--- a/octoprintApis/ZOffsetRequest.go
+++ b/octoprintApis/ZOffsetRequest.go
@@ -24,7 +24,7 @@ func (this *ZOffsetRequest) Do(client *Client) (*dataModels.ZOffsetResponse, err
return nil, err
}
- // bytes, err := client.doJsonRequest("POST", URIZBoltRequest, params, ConnectionErrors)
+ // bytes, err := client.doJsonRequest("POST", UriZBoltRequest, params, ConnectionErrors)
bytes, err := client.doJsonRequest("GET", PluginZBoltApiUri, params, ConnectionErrors, true)
if err != nil {
logger.LogError("ZOffsetRequest.Do()", "client.doJsonRequest()", err)
diff --git a/ui/BedLevelPanel.go b/ui/BedLevelPanel.go
index b96290f..d9fcf20 100755
--- a/ui/BedLevelPanel.go
+++ b/ui/BedLevelPanel.go
@@ -4,13 +4,15 @@ import (
"fmt"
"github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/logger"
"github.com/Z-Bolt/OctoScreen/octoprintApis"
// "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var bedLevelPanelInstance *bedLevelPanel
type bedLevelPanel struct {
@@ -23,11 +25,10 @@ type bedLevelPanel struct {
func BedLevelPanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *bedLevelPanel {
if bedLevelPanelInstance == nil {
instance := &bedLevelPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel(ui),
}
instance.initialize()
bedLevelPanelInstance = instance
diff --git a/ui/ConfigurationPanel.go b/ui/ConfigurationPanel.go
index a67a28d..636a315 100755
--- a/ui/ConfigurationPanel.go
+++ b/ui/ConfigurationPanel.go
@@ -1,10 +1,11 @@
package ui
import (
- "github.com/Z-Bolt/OctoScreen/interfaces"
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var configurationPanelInstance *configurationPanel
type configurationPanel struct {
@@ -17,7 +18,7 @@ func ConfigurationPanel(
) *configurationPanel {
if configurationPanelInstance == nil {
instance := &configurationPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("ConfigurationPanel", ui),
}
instance.initialize()
configurationPanelInstance = instance
@@ -67,17 +68,17 @@ func (this *configurationPanel) initialize() {
}
func (this *configurationPanel) showBedLevelPanel() {
- this.UI.GoToPanel(BedLevelPanel(this.UI, this))
+ this.UI.GoToPanel(BedLevelPanel(this.UI))
}
func (this *configurationPanel) showZOffsetCalibrationPanel() {
- this.UI.GoToPanel(ZOffsetCalibrationPanel(this.UI, this))
+ this.UI.GoToPanel(ZOffsetCalibrationPanel(this.UI))
}
func (this *configurationPanel) showNetworkPanel() {
- this.UI.GoToPanel(NetworkPanel(this.UI, this))
+ this.UI.GoToPanel(NetworkPanel(this.UI))
}
func (this *configurationPanel) showSystemPanel() {
- this.UI.GoToPanel(SystemPanel(this.UI, this))
+ this.UI.GoToPanel(SystemPanel(this.UI))
}
diff --git a/ui/ConnectionPanel.go b/ui/ConnectionPanel.go
index 5ec3d43..e7e86ae 100755
--- a/ui/ConnectionPanel.go
+++ b/ui/ConnectionPanel.go
@@ -5,13 +5,15 @@ import (
"fmt"
"time"
- "github.com/gotk3/gotk3/gtk"
"pifke.org/wpasupplicant"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+ "github.com/gotk3/gotk3/gtk"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
// "github.com/Z-Bolt/OctoScreen/uiWidgets"
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var connectionPanelInstance *connectionPanel
var keyBoardChars = []byte{
@@ -35,12 +37,11 @@ type connectionPanel struct {
func ConnectionPanel(
ui *UI,
- parentPanel interfaces.IPanel,
SSID string,
) *connectionPanel {
if connectionPanelInstance == nil {
instance := &connectionPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("ConnectionPanel", ui),
cursorPosition: 0,
}
instance.initialize()
diff --git a/ui/CustomItemsPanel.go b/ui/CustomItemsPanel.go
index fb39399..98ab875 100755
--- a/ui/CustomItemsPanel.go
+++ b/ui/CustomItemsPanel.go
@@ -1,12 +1,13 @@
package ui
import (
- "github.com/Z-Bolt/OctoScreen/interfaces"
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
// "github.com/Z-Bolt/OctoScreen/octoprintApis"
"github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
// "github.com/Z-Bolt/OctoScreen/uiWidgets"
)
+
type customItemsPanel struct {
CommonPanel
items []dataModels.MenuItem
@@ -14,11 +15,10 @@ type customItemsPanel struct {
func CustomItemsPanel(
ui *UI,
- parentPanel interfaces.IPanel,
items []dataModels.MenuItem,
) *customItemsPanel {
instance := &customItemsPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("CustomItemsPanel", ui),
items: items,
}
instance.initialize()
diff --git a/ui/FanPanel.go b/ui/FanPanel.go
index ea02e5c..83b7ea5 100755
--- a/ui/FanPanel.go
+++ b/ui/FanPanel.go
@@ -4,11 +4,12 @@ import (
// "fmt"
// "github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/uiWidgets"
// "github.com/Z-Bolt/OctoScreen/utils"
)
+
var fanPanelInstance *fanPanel
type fanPanel struct {
@@ -17,11 +18,10 @@ type fanPanel struct {
func FanPanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *fanPanel {
if fanPanelInstance == nil {
instance := &fanPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("FanPanel", ui),
}
instance.initialize()
fanPanelInstance = instance
diff --git a/ui/FilamentPanel.go b/ui/FilamentPanel.go
index df7e313..9b6e0ca 100755
--- a/ui/FilamentPanel.go
+++ b/ui/FilamentPanel.go
@@ -6,11 +6,13 @@ import (
// "time"
"github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/uiWidgets"
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var filamentPanelInstance *filamentPanel
type filamentPanel struct {
@@ -34,11 +36,10 @@ type filamentPanel struct {
func FilamentPanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *filamentPanel {
if filamentPanelInstance == nil {
instance := &filamentPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("FilamentPanel", ui),
}
instance.initialize()
filamentPanelInstance = instance
@@ -120,5 +121,5 @@ func (this *filamentPanel) initialize() {
}
func (this *filamentPanel) showTemperaturePanel() {
- this.UI.GoToPanel(TemperaturePanel(this.UI, this))
+ this.UI.GoToPanel(TemperaturePanel(this.UI))
}
diff --git a/ui/FilesPanel.go b/ui/FilesPanel.go
index 3d749f0..74d88e2 100755
--- a/ui/FilesPanel.go
+++ b/ui/FilesPanel.go
@@ -10,7 +10,8 @@ import (
"github.com/coreos/go-systemd/daemon"
"github.com/dustin/go-humanize"
"github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/logger"
"github.com/Z-Bolt/OctoScreen/octoprintApis"
"github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
@@ -32,7 +33,6 @@ type filesPanel struct {
func FilesPanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *filesPanel {
if filesPanelInstance == nil {
locationHistory := utils.LocationHistory {
@@ -40,7 +40,7 @@ func FilesPanel(
}
instance := &filesPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("FilesPanel", ui),
locationHistory: locationHistory,
}
instance.initialize()
diff --git a/ui/HomePanel.go b/ui/HomePanel.go
index 5b26473..58cc326 100755
--- a/ui/HomePanel.go
+++ b/ui/HomePanel.go
@@ -2,13 +2,15 @@ package ui
import (
// "github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
// "github.com/Z-Bolt/OctoScreen/octoprintApis"
"github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
"github.com/Z-Bolt/OctoScreen/uiWidgets"
// "github.com/Z-Bolt/OctoScreen/utils"
)
+
var homePanelInstance *homePanel
type homePanel struct {
@@ -17,11 +19,10 @@ type homePanel struct {
func HomePanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *homePanel {
if homePanelInstance == nil {
instance := &homePanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("HomePanel", ui),
}
instance.initialize()
homePanelInstance = instance
diff --git a/ui/IdleStatusPanel.go b/ui/IdleStatusPanel.go
index a9bf56f..0535e46 100755
--- a/ui/IdleStatusPanel.go
+++ b/ui/IdleStatusPanel.go
@@ -29,7 +29,7 @@ type idleStatusPanel struct {
func IdleStatusPanel(ui *UI) *idleStatusPanel {
if idleStatusPanelInstance == nil {
instance := &idleStatusPanel{
- CommonPanel: NewTopLevelCommonPanel(ui, nil),
+ CommonPanel: NewTopLevelCommonPanel("IdleStatusPanel", ui),
}
instance.backgroundTask = utils.CreateBackgroundTask(time.Second * 2, instance.update)
instance.initialize()
@@ -88,7 +88,7 @@ func (this *idleStatusPanel) initialize() {
func (this *idleStatusPanel) showFiles() {
logger.TraceEnter("IdleStatusPanel.showFiles()")
- this.UI.GoToPanel(FilesPanel(this.UI, this))
+ this.UI.GoToPanel(FilesPanel(this.UI))
logger.TraceLeave("IdleStatusPanel.showFiles()")
}
diff --git a/ui/MovePanel.go b/ui/MovePanel.go
index f4398d8..afd36b0 100755
--- a/ui/MovePanel.go
+++ b/ui/MovePanel.go
@@ -2,6 +2,7 @@ package ui
import (
// "github.com/gotk3/gotk3/gtk"
+
"github.com/Z-Bolt/OctoScreen/interfaces"
// "github.com/Z-Bolt/OctoScreen/octoprintApis"
"github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
@@ -18,11 +19,10 @@ type movePanel struct {
func MovePanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *movePanel {
if movePanelInstance == nil {
instance := &movePanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("MovePanel", ui),
}
instance.initialize()
movePanelInstance = instance
diff --git a/ui/NetworkPanel.go b/ui/NetworkPanel.go
index ffeb016..4d1f661 100755
--- a/ui/NetworkPanel.go
+++ b/ui/NetworkPanel.go
@@ -5,14 +5,16 @@ import (
"net"
"time"
+ "pifke.org/wpasupplicant"
"github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/logger"
// "github.com/Z-Bolt/OctoScreen/uiWidgets"
"github.com/Z-Bolt/OctoScreen/utils"
- "pifke.org/wpasupplicant"
)
+
var networkPanelInstance *networkPanel
type networkPanel struct {
@@ -25,11 +27,10 @@ type networkPanel struct {
func NetworkPanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *networkPanel {
if networkPanelInstance == nil {
instance := &networkPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("NetworkPanel", ui),
}
instance.initialize()
instance.backgroundTask = utils.CreateBackgroundTask(time.Second * 3, instance.update)
diff --git a/ui/PrintMenuPanel.go b/ui/PrintMenuPanel.go
index da7d8eb..f3a21d3 100755
--- a/ui/PrintMenuPanel.go
+++ b/ui/PrintMenuPanel.go
@@ -1,10 +1,11 @@
package ui
import (
- "github.com/Z-Bolt/OctoScreen/interfaces"
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var printMenuPanelInstance *printMenuPanel
type printMenuPanel struct {
@@ -13,11 +14,10 @@ type printMenuPanel struct {
func PrintMenuPanel(
ui *UI,
- parentPanel interfaces.IPanel,
) *printMenuPanel {
if printMenuPanelInstance == nil {
instance := &printMenuPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("PrintMenuPanel", ui),
}
instance.initialize()
printMenuPanelInstance = instance
@@ -49,25 +49,25 @@ func (this *printMenuPanel) initialize() {
}
func (this *printMenuPanel) showMove() {
- this.UI.GoToPanel(MovePanel(this.UI, this))
+ this.UI.GoToPanel(MovePanel(this.UI))
}
func (this *printMenuPanel) showFilament() {
- this.UI.GoToPanel(FilamentPanel(this.UI, this))
+ this.UI.GoToPanel(FilamentPanel(this.UI))
}
func (this *printMenuPanel) showTemperature() {
- this.UI.GoToPanel(TemperaturePanel(this.UI, this))
+ this.UI.GoToPanel(TemperaturePanel(this.UI))
}
func (this *printMenuPanel) showFan() {
- this.UI.GoToPanel(FanPanel(this.UI, this))
+ this.UI.GoToPanel(FanPanel(this.UI))
}
func (this *printMenuPanel) showNetwork() {
- this.UI.GoToPanel(NetworkPanel(this.UI, this))
+ this.UI.GoToPanel(NetworkPanel(this.UI))
}
func (this *printMenuPanel) showSystem() {
- this.UI.GoToPanel(SystemPanel(this.UI, this))
+ this.UI.GoToPanel(SystemPanel(this.UI))
}
diff --git a/ui/PrintStatusPanel.go b/ui/PrintStatusPanel.go
index 8a82bcb..cb39cc3 100755
--- a/ui/PrintStatusPanel.go
+++ b/ui/PrintStatusPanel.go
@@ -6,6 +6,7 @@ import (
"time"
"github.com/gotk3/gotk3/gtk"
+
"github.com/Z-Bolt/OctoScreen/logger"
"github.com/Z-Bolt/OctoScreen/octoprintApis"
"github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
@@ -39,7 +40,7 @@ type printStatusPanel struct {
func PrintStatusPanel(ui *UI) *printStatusPanel {
if printStatusPanelInstance == nil {
instance := &printStatusPanel{
- CommonPanel: NewTopLevelCommonPanel(ui, nil),
+ CommonPanel: NewTopLevelCommonPanel("PrintStatusPanel", ui),
}
// TODO: revisit... some set the background task and then initialize
@@ -192,7 +193,7 @@ func (this *printStatusPanel) createControlButton() gtk.IWidget {
"printing-control.svg",
"color3",
func() {
- this.UI.GoToPanel(PrintMenuPanel(this.UI, this))
+ this.UI.GoToPanel(PrintMenuPanel(this.UI))
},
)
return this.menuButton
diff --git a/ui/SplashPanel.go b/ui/SplashPanel.go
index 2e3e80e..cb2cd6a 100755
--- a/ui/SplashPanel.go
+++ b/ui/SplashPanel.go
@@ -3,6 +3,7 @@ package ui
import (
"github.com/gotk3/gotk3/gtk"
+
"github.com/Z-Bolt/OctoScreen/logger"
"github.com/Z-Bolt/OctoScreen/utils"
)
@@ -15,7 +16,7 @@ type SplashPanel struct {
func NewSplashPanel(ui *UI) *SplashPanel {
instane := &SplashPanel {
- CommonPanel: NewCommonPanel(ui, nil),
+ CommonPanel: NewCommonPanel("SplashPanel", ui),
}
instane.initialize()
@@ -108,7 +109,7 @@ func (this *SplashPanel) releaseFromHold() {
func (this *SplashPanel) showNetwork() {
logger.TraceEnter("SplashPanel.showNetwork()")
- this.UI.GoToPanel(NetworkPanel(this.UI, this))
+ this.UI.GoToPanel(NetworkPanel(this.UI))
logger.TraceLeave("SplashPanel.showNetwork()")
}
@@ -116,7 +117,7 @@ func (this *SplashPanel) showNetwork() {
func (this *SplashPanel) showSystem() {
logger.TraceEnter("SplashPanel.showSystem()")
- this.UI.GoToPanel(SystemPanel(this.UI, this))
+ this.UI.GoToPanel(SystemPanel(this.UI))
logger.TraceLeave("SplashPanel.showSystem()")
}
diff --git a/ui/SystemPanel.go b/ui/SystemPanel.go
index bae1e00..37f3cbc 100755
--- a/ui/SystemPanel.go
+++ b/ui/SystemPanel.go
@@ -3,11 +3,12 @@ package ui
import (
// "time"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/uiWidgets"
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var systemPanelInstance *systemPanel = nil
type systemPanel struct {
@@ -33,7 +34,7 @@ func SystemPanel(
) *systemPanel {
if systemPanelInstance == nil {
instance := &systemPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("SystemPanel", ui),
}
instance.initialize()
instance.preShowCallback = instance.refreshSystemInformationInfoBox
diff --git a/ui/TemperaturePanel.go b/ui/TemperaturePanel.go
index a772079..0640706 100755
--- a/ui/TemperaturePanel.go
+++ b/ui/TemperaturePanel.go
@@ -2,11 +2,13 @@ package ui
import (
"github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/uiWidgets"
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var temperaturePanelInstance *temperaturePanel
type temperaturePanel struct {
@@ -32,7 +34,7 @@ func TemperaturePanel(
) *temperaturePanel {
if temperaturePanelInstance == nil {
temperaturePanelInstance = &temperaturePanel{
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("TemperaturePanel", ui),
}
temperaturePanelInstance.initialize()
}
@@ -84,6 +86,6 @@ func (this *temperaturePanel) initialize() {
}
func (this *temperaturePanel) showTemperaturePresetsPanel() {
- temperaturePresetsPanel := TemperaturePresetsPanel(this.UI, this, this.selectHotendStepButton)
+ temperaturePresetsPanel := TemperaturePresetsPanel(this.UI, this.selectHotendStepButton)
this.UI.GoToPanel(temperaturePresetsPanel)
}
diff --git a/ui/TemperaturePresetsPanel.go b/ui/TemperaturePresetsPanel.go
index 47b6df2..a960033 100755
--- a/ui/TemperaturePresetsPanel.go
+++ b/ui/TemperaturePresetsPanel.go
@@ -1,7 +1,7 @@
package ui
import (
- "github.com/Z-Bolt/OctoScreen/interfaces"
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/logger"
"github.com/Z-Bolt/OctoScreen/octoprintApis"
// "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
@@ -9,6 +9,7 @@ import (
// "github.com/Z-Bolt/OctoScreen/utils"
)
+
var temperaturePresetsPanelInstance *temperaturePresetsPanel
type temperaturePresetsPanel struct {
@@ -25,7 +26,7 @@ func TemperaturePresetsPanel(
) *temperaturePresetsPanel {
if temperaturePresetsPanelInstance == nil {
instance := &temperaturePresetsPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("temperaturePresetsPanel", ui),
selectHotendStepButton: selectHotendStepButton,
}
instance.initialize()
diff --git a/ui/menu.go b/ui/menu.go
index 7e53555..500c14f 100755
--- a/ui/menu.go
+++ b/ui/menu.go
@@ -19,53 +19,53 @@ func getPanel(
switch menuItem.Panel {
// The standard "top four" panels that are in the idleStatus panel
case "home":
- return HomePanel(ui, parentPanel)
+ return HomePanel(ui)
case "menu":
fallthrough
case "custom_items":
- return CustomItemsPanel(ui, parentPanel, menuItem.Items)
+ return CustomItemsPanel(ui, menuItem.Items)
case "filament":
- return FilamentPanel(ui, parentPanel)
+ return FilamentPanel(ui)
case "configuration":
- return ConfigurationPanel(ui, parentPanel)
+ return ConfigurationPanel(ui)
case "files":
- return FilesPanel(ui, parentPanel)
+ return FilesPanel(ui)
case "temperature":
- return TemperaturePanel(ui, parentPanel)
+ return TemperaturePanel(ui)
case "control":
- return ControlPanel(ui, parentPanel)
+ return ControlPanel(ui)
case "network":
- return NetworkPanel(ui, parentPanel)
+ return NetworkPanel(ui)
case "move":
- return MovePanel(ui, parentPanel)
+ return MovePanel(ui)
case "tool-changer":
- return ToolChangerPanel(ui, parentPanel)
+ return ToolChangerPanel(ui)
case "system":
- return SystemPanel(ui, parentPanel)
+ return SystemPanel(ui)
case "fan":
- return FanPanel(ui, parentPanel)
+ return FanPanel(ui)
case "bed-level":
- return BedLevelPanel(ui, parentPanel)
+ return BedLevelPanel(ui)
case "z-offset-calibration":
- return ZOffsetCalibrationPanel(ui, parentPanel)
+ return ZOffsetCalibrationPanel(ui)
case "print-menu":
- return PrintMenuPanel(ui, parentPanel)
+ return PrintMenuPanel(ui)
case "filament_multitool":
@@ -76,19 +76,19 @@ func getPanel(
logger.Warnf("WARNING! the '%s' panel has been deprecated. Please use the 'filament' panel instead.", menuItem.Panel)
logger.Warnf("Support for the %s panel remains in this release, but will be removed in a future.", menuItem.Panel)
logger.Warn("Please update the custom menu structure in your OctoScreen settings in OctoPrint.")
- return FilamentPanel(ui, parentPanel)
+ return FilamentPanel(ui)
case "toolchanger":
logger.Warn("WARNING! the 'toolchanger' panel has been renamed to 'tool-changer'. Please use the 'tool-changer' panel instead.")
logger.Warnf("Support for the %s panel remains in this release, but will be removed in a future.", menuItem.Panel)
logger.Warn("Please update the custom menu structure in your OctoScreen settings in OctoPrint.")
- return ToolChangerPanel(ui, parentPanel)
+ return ToolChangerPanel(ui)
case "nozzle-calibration":
logger.Warn("WARNING! the 'nozzle-calibration' panel has been deprecated. Please use the 'z-offset-calibration' panel instead.")
logger.Warn("Support for the nozzle-calibration panel remains in this release, but will be removed in a future.")
logger.Warn("Please update the custom menu structure in your OctoScreen settings in OctoPrint.")
- return ZOffsetCalibrationPanel(ui, parentPanel)
+ return ZOffsetCalibrationPanel(ui)
default:
logLevel := logger.LogLevel()
diff --git a/ui/tool_changer_panel.go b/ui/tool_changer_panel.go
index dc29fcb..b4c0723 100755
--- a/ui/tool_changer_panel.go
+++ b/ui/tool_changer_panel.go
@@ -4,7 +4,8 @@ import (
"fmt"
"github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/logger"
"github.com/Z-Bolt/OctoScreen/octoprintApis"
// "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
@@ -12,6 +13,7 @@ import (
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var toolChangerPanelInstance *toolChangerPanel
type toolChangerPanel struct {
@@ -25,7 +27,7 @@ func ToolChangerPanel(
) *toolChangerPanel {
if toolChangerPanelInstance == nil {
this := &toolChangerPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("ToolChangerPanel", ui),
}
this.initialize()
toolChangerPanelInstance = this
@@ -49,7 +51,7 @@ func (this *toolChangerPanel) initialize() {
func (this *toolChangerPanel) createZCalibrationButton() gtk.IWidget {
button := utils.MustButtonImageStyle("Z Offsets", "z-calibration.svg", "color2", func() {
- this.UI.GoToPanel(ZOffsetCalibrationPanel(this.UI, this))
+ this.UI.GoToPanel(ZOffsetCalibrationPanel(this.UI))
})
return button
diff --git a/ui/z_offset_calibration_panel.go b/ui/z_offset_calibration_panel.go
index e0ab17c..c61e6b6 100755
--- a/ui/z_offset_calibration_panel.go
+++ b/ui/z_offset_calibration_panel.go
@@ -6,7 +6,8 @@ import (
"time"
"github.com/gotk3/gotk3/gtk"
- "github.com/Z-Bolt/OctoScreen/interfaces"
+
+ // "github.com/Z-Bolt/OctoScreen/interfaces"
"github.com/Z-Bolt/OctoScreen/logger"
"github.com/Z-Bolt/OctoScreen/octoprintApis"
// "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels"
@@ -14,6 +15,7 @@ import (
"github.com/Z-Bolt/OctoScreen/utils"
)
+
var zOffsetCalibrationPanelInstance *zOffsetCalibrationPanel
type pointCoordinates struct {
@@ -47,7 +49,7 @@ func ZOffsetCalibrationPanel(
) *zOffsetCalibrationPanel {
if zOffsetCalibrationPanelInstance == nil {
instane := &zOffsetCalibrationPanel {
- CommonPanel: NewCommonPanel(ui, parentPanel),
+ CommonPanel: NewCommonPanel("ZOffsetCalibrationPanel", ui),
}
instane.cPoint = pointCoordinates {
x: 20,