Add a built-in query string editor using KVEditor.

This commit is contained in:
Aldo Cortesi 2012-02-09 16:47:32 +13:00
parent 2709441d5b
commit 00d3395359

View File

@ -368,6 +368,9 @@ class ConnectionView(common.WWrap):
def set_headers(self, lst, conn):
conn.headers = flow.Headers(lst)
def set_query(self, lst, conn):
conn.set_query(lst)
def edit(self, part):
if self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
conn = self.flow.request
@ -382,6 +385,8 @@ class ConnectionView(common.WWrap):
conn.content = c.rstrip("\n")
elif part == "h":
self.master.view_kveditor("Editing headers", conn.headers.lst, self.set_headers, conn)
elif part == "q":
self.master.view_kveditor("Editing query", conn.get_query(), self.set_query, conn)
elif part == "u" and self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
self.master.prompt_edit("URL", conn.get_url(), self.set_url)
elif part == "m" and self.state.view_flow_mode == common.VIEW_FLOW_REQUEST:
@ -444,9 +449,10 @@ class ConnectionView(common.WWrap):
self.master.prompt_onekey(
"Edit request",
(
("query", "q"),
("url", "u"),
("header", "h"),
("raw body", "r"),
("url", "u"),
("method", "m"),
),
self.edit