Skip to content

Commit

Permalink
Merge pull request #2580 from janezd/replace-string-with-text
Browse files Browse the repository at this point in the history
Replace string with text as variable type (in GUI only)
  • Loading branch information
janezd authored Oct 16, 2017
2 parents 11cea9f + 908dde3 commit 2d08fc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Orange/widgets/data/tests/test_owfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_domain_changes_are_stored(self):

self.open_dataset("iris")
idx = self.widget.domain_editor.model().createIndex(4, 1)
self.widget.domain_editor.model().setData(idx, "string", Qt.EditRole)
self.widget.domain_editor.model().setData(idx, "text", Qt.EditRole)
self.widget.apply_button.click()
data = self.get_output(self.widget.Outputs.data)
self.assertIsInstance(data.domain["iris"], StringVariable)
Expand Down Expand Up @@ -361,7 +361,7 @@ def test_domain_editor_conversions(self):
self.assertEqual(str(a), model.data(model.createIndex(i, 0), Qt.DisplayRole))
# make conversions
model.setData(model.createIndex(0, 1), "categorical", Qt.EditRole)
model.setData(model.createIndex(1, 1), "string", Qt.EditRole)
model.setData(model.createIndex(1, 1), "text", Qt.EditRole)
model.setData(model.createIndex(2, 1), "numeric", Qt.EditRole)
model.setData(model.createIndex(3, 1), "numeric", Qt.EditRole)
model.setData(model.createIndex(6, 1), "numeric", Qt.EditRole)
Expand Down
2 changes: 1 addition & 1 deletion Orange/widgets/utils/domaineditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class VarTableModel(QAbstractTableModel):
DISCRETE_VALUE_DISPLAY_LIMIT = 20

places = "feature", "target", "meta", "skip"
typenames = "categorical", "numeric", "string", "datetime"
typenames = "categorical", "numeric", "text", "datetime"
vartypes = DiscreteVariable, ContinuousVariable, StringVariable, TimeVariable
name2type = dict(zip(typenames, vartypes))
type2name = dict(zip(vartypes, typenames))
Expand Down
2 changes: 1 addition & 1 deletion Orange/widgets/utils/itemmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def continuous_variable_toltip(self, var):
return text

def string_variable_tooltip(self, var):
text = "<b>%s</b><br/>String" % safe_text(var.name)
text = "<b>%s</b><br/>Text" % safe_text(var.name)
text += self.variable_labels_tooltip(var)
return text

Expand Down

0 comments on commit 2d08fc6

Please sign in to comment.