Commit 0d308138 authored by Franziska Koehn's avatar Franziska Koehn
Browse files

signals for dis-/enabling Download- and Comparison-Button deleted. Methods in...

signals for dis-/enabling Download- and Comparison-Button deleted. Methods in question will be called when query was send
parent a31500d5
......@@ -138,6 +138,20 @@ class QueryController(gobject.GObject):
self.statusbar.push(0, "%s Results"%len(self.results))
self.chartview.update_chart_view(self.results, root_type)
if self.results == []:
self.menuview.disable_download_button(False, "No Results for downloading")
self.menuview.disable_adddata_button(False, "No Results for comparison")
return
else:
try:
type_reader.get_rest(root_type)
self.menuview.disable_download_button(True, "Download selected items from result-table")
except xsa.errors.NoRestApiError as e:
self.menuview.disable_download_button(False, str(e))
self.menuview.disable_adddata_button(True, "Define the Comparison-Table")
self.root=self.queryview.get_root_type()
self.query=self.queryview.get_query()
self.labels=self.queryview.get_fields()
......@@ -293,12 +307,6 @@ class QueryController(gobject.GObject):
)
dialog.destroy()
def disable_download_button(_, is_enable, text):
self.menuview.disable_download_button(is_enable, text)
def disable_adddata_button(_, is_enable, text):
self.menuview.disable_adddata_button(is_enable, text)
root_key = 'root'
query_key = 'query'
labels_key = 'labels'
......@@ -359,6 +367,3 @@ class QueryController(gobject.GObject):
self.menuview.connect("save-query", save_query)
self.menuview.connect("load-query", load_query)
self.menuview.connect("spawn-comparison-dialog",callback_define_comparison)
self.queryview.connect("rest-api", disable_download_button)
#self.queryview.connect("adddata", disable_adddata_button)
......@@ -134,4 +134,4 @@ class MenuView(gtk.Toolbar):
self.insert(self.tb_adddata, 8)
self.disable_download_button(False, "No Results")
#self.disable_adddata_button(False, "No Results")
self.disable_adddata_button(False, "No Results")
......@@ -13,7 +13,7 @@ class QueryView(gtk.VBox):
"""Contains all widgets for creating the query"""
def __init__(self, *args, **kwargs):
"""Creates signal "rest-api". Creates all query-view-widgets.
"""Creates all query-view-widgets.
**Parameters**
:\*args: same as gtk.VBox
......@@ -22,13 +22,6 @@ class QueryView(gtk.VBox):
super(QueryView, self).__init__(*args, **kwargs)
import gobject
gobject.signal_new( "rest-api",
QueryView,
gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
(bool,str))
# root-type
hBox_root_type = gtk.HBox()
......@@ -42,13 +35,6 @@ class QueryView(gtk.VBox):
import xsa.datatypereader as type_reader
import xsa.errors
selected = combobox.get_active_text()
try:
type_reader.get_rest(selected)
self.emit("rest-api", True, "Download selected items from result-table")
except xsa.errors.NoRestApiError as e:
self.emit("rest-api", False, e)
self.treeView_search.set_root_type(selected)
self.treeView_fields.reset_fields(selected)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment