Skip to content

Commit

Permalink
reset numbering when using gui
Browse files Browse the repository at this point in the history
  • Loading branch information
keenanlang committed Sep 16, 2024
1 parent 4aa6f8d commit 8d2e8f9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion gestalt/convert/phoebus/CSSGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from phoebusgen import screen

from gestalt.convert.phoebus.CSSWidget import CSSWidget
from gestalt.convert.phoebus.CSSWidget import CSSWidget, reset_numbering
from gestalt.convert.phoebus.CSSGroup import CSSGroup
from gestalt.convert.phoebus.CSSDisplay import CSSDisplay
from gestalt.convert.phoebus.CSSTabbedGroup import CSSTabbedGroup
Expand Down Expand Up @@ -241,6 +241,8 @@ def generateScale(self, node, macros={}):


def generateCSSFile(template, data, outputfile=""):
reset_numbering()

a_display = CSSDisplay()
the_generator = CSSGenerator()

Expand Down
3 changes: 3 additions & 0 deletions gestalt/convert/phoebus/CSSWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

name_numbering = {}

def reset_numbering():
name_numbering = {}

class CSSWidget(GroupNode):
def __init__(self, classname, node=None, name=None, layout={}, macros={}):
super(CSSWidget, self).__init__(classname, name=name, node=node, layout=layout)
Expand Down
4 changes: 3 additions & 1 deletion gestalt/convert/qt/QtGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from gestalt.Type import *
from gestalt.Generator import GestaltGenerator

from gestalt.convert.qt.QtWidget import QtWidget
from gestalt.convert.qt.QtWidget import QtWidget, reset_numbering
from gestalt.convert.qt.QtGroup import QtGroup
from gestalt.convert.qt.QtDisplay import QtDisplay
from gestalt.convert.qt.QtTabbedGroup import QtTabbedGroup
Expand Down Expand Up @@ -280,6 +280,8 @@ def generateScale(self, node, macros={}):


def generateQtFile(template, data, outputfile=""):
reset_numbering()

a_display = QtDisplay()
the_generator = QtGenerator()

Expand Down
7 changes: 5 additions & 2 deletions gestalt/convert/qt/QtWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

name_numbering = {}

def reset_numbering():
name_numbering = {}

class QtWidget(GroupNode):
def __init__(self, classname, node=None, name=None, layout={}, macros={}, loc=None):
def __init__(self, classname, node=None, name=None, layout={}, macros={}, loc=None):
super(QtWidget, self).__init__(classname, name=name, node=node, layout=layout, loc=loc)
QtWidget.updateProperties(self, macros)

if "alignment" in self and not isinstance(self["alignment"], Set):
data = str(Alignment(self.pop("alignment")))

Expand Down

0 comments on commit 8d2e8f9

Please sign in to comment.