Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/21bbda23fa27561e8f52daff1adb2403c4e86019
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/21bbda23fa27561e8f52daff1adb2403c4e86019
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/21bbda23fa27561e8f52daff1adb2403c4e86019

The branch, master has been updated
       via  21bbda23fa27561e8f52daff1adb2403c4e86019 (commit)
       via  214f436b072e035aa6a53f3c4d62028cd56753fc (commit)
       via  34e61df8ebe237d6862e1c63772a1aae40d81320 (commit)
      from  a59646cbf84d1bb463c4b9526dacdf40075851c2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=21bbda23fa27561e8f52daff1adb2403c4e86019
commit 21bbda23fa27561e8f52daff1adb2403c4e86019
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Browser window: Set the search string on show cookies.
    
    We still need to tell the front end to open the cookies
    window.

diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index bdf48b3..9d8e276 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -57,6 +57,7 @@
 #include "html/box.h"
 #include "javascript/js.h"
 
+#include "desktop/cookie_manager.h"
 #include "desktop/browser_history.h"
 #include "desktop/browser_private.h"
 #include "desktop/download.h"
@@ -4745,8 +4746,19 @@ int browser_window_get_cookie_count(
 nserror browser_window_show_cookies(
                const struct browser_window *bw)
 {
-       /** \todo Implement show cookies */
-       return NSERROR_OK;
+       nserror err;
+       nsurl *url = browser_window_access_url(bw);
+       lwc_string *host = nsurl_get_component(url, NSURL_HOST);
+       const char *string = (host != NULL) ? lwc_string_data(host) : NULL;
+
+       /** \todo Ensure cookie manager is open.  (Ask front end.) */
+
+       err = cookie_manager_set_search_string(string);
+
+       if (host != NULL) {
+               lwc_string_unref(host);
+       }
+       return err;
 }
 
 /* Exported interface, documented in browser_window.h */


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=214f436b072e035aa6a53f3c4d62028cd56753fc
commit 214f436b072e035aa6a53f3c4d62028cd56753fc
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Cookie manager: Add API to set the search string.

diff --git a/desktop/cookie_manager.c b/desktop/cookie_manager.c
index a2aab8e..3e0417f 100644
--- a/desktop/cookie_manager.c
+++ b/desktop/cookie_manager.c
@@ -545,6 +545,19 @@ void cookie_manager_remove(const struct cookie_data *data)
 }
 
 
+/* exported interface documented in cookie_manager.h */
+nserror cookie_manager_set_search_string(
+               const char *string)
+{
+       /* If we don't have a cookie manager at the moment, just return */
+       if (cm_ctx.tree == NULL) {
+               return NSERROR_NOT_FOUND;
+       }
+
+       return treeview_set_search_string(cm_ctx.tree, string);
+}
+
+
 /**
  * Initialise the treeview entry feilds
  *
diff --git a/desktop/cookie_manager.h b/desktop/cookie_manager.h
index 4ae74a2..11d0325 100644
--- a/desktop/cookie_manager.h
+++ b/desktop/cookie_manager.h
@@ -76,6 +76,15 @@ bool cookie_manager_add(const struct cookie_data *data);
 void cookie_manager_remove(const struct cookie_data *data);
 
 /**
+ * Set the cookie manager search string.
+ *
+ * \param string  Sering to set as search string.
+ * \return NSERROR_OK on success, appropriate error otherwise
+ */
+nserror cookie_manager_set_search_string(
+               const char *string);
+
+/**
  * Redraw the cookies manager.
  *
  * \param x    X coordinate to render treeview at


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=34e61df8ebe237d6862e1c63772a1aae40d81320
commit 34e61df8ebe237d6862e1c63772a1aae40d81320
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Treeview: Add API for setting the search string.

diff --git a/desktop/treeview.c b/desktop/treeview.c
index 3e23fbe..3dcc2c3 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -4839,6 +4839,29 @@ int treeview_get_height(treeview *tree)
        return height + search_height;
 }
 
+/* Exported interface, documented in treeview.h */
+nserror treeview_set_search_string(
+               treeview *tree,
+               const char *string)
+{
+       if (!(tree->flags & TREEVIEW_SEARCHABLE)) {
+               return NSERROR_BAD_PARAMETER;
+       }
+
+       if (string == NULL || strlen(string) == 0) {
+               tree->search.active = false;
+               tree->search.search = false;
+               return treeview__search(tree, "", 0);
+       }
+
+       tree->search.active = true;
+       tree->search.search = true;
+       if (!textarea_set_text(tree->search.textarea, string)) {
+               return NSERROR_UNKNOWN;
+       }
+
+       return NSERROR_OK;
+}
 
 /**
  * Initialise the plot styles from CSS system colour values.
diff --git a/desktop/treeview.h b/desktop/treeview.h
index a8cf29a..df9b4fb 100644
--- a/desktop/treeview.h
+++ b/desktop/treeview.h
@@ -495,4 +495,15 @@ void treeview_edit_selection(treeview *tree);
  */
 int treeview_get_height(treeview *tree);
 
+
+/**
+ * Set the search string for a treeview with \ref TREEVIEW_SEARCHABLE
+ *
+ * \param tree  Tree to set the search string for.
+ * \return NSERROR_OK on success, appropriate error otherwise
+ */
+nserror treeview_set_search_string(
+               treeview *tree,
+               const char *string);
+
 #endif


-----------------------------------------------------------------------

Summary of changes:
 desktop/browser_window.c |   16 ++++++++++++++--
 desktop/cookie_manager.c |   13 +++++++++++++
 desktop/cookie_manager.h |    9 +++++++++
 desktop/treeview.c       |   23 +++++++++++++++++++++++
 desktop/treeview.h       |   11 +++++++++++
 5 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index bdf48b3..9d8e276 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -57,6 +57,7 @@
 #include "html/box.h"
 #include "javascript/js.h"
 
+#include "desktop/cookie_manager.h"
 #include "desktop/browser_history.h"
 #include "desktop/browser_private.h"
 #include "desktop/download.h"
@@ -4745,8 +4746,19 @@ int browser_window_get_cookie_count(
 nserror browser_window_show_cookies(
                const struct browser_window *bw)
 {
-       /** \todo Implement show cookies */
-       return NSERROR_OK;
+       nserror err;
+       nsurl *url = browser_window_access_url(bw);
+       lwc_string *host = nsurl_get_component(url, NSURL_HOST);
+       const char *string = (host != NULL) ? lwc_string_data(host) : NULL;
+
+       /** \todo Ensure cookie manager is open.  (Ask front end.) */
+
+       err = cookie_manager_set_search_string(string);
+
+       if (host != NULL) {
+               lwc_string_unref(host);
+       }
+       return err;
 }
 
 /* Exported interface, documented in browser_window.h */
diff --git a/desktop/cookie_manager.c b/desktop/cookie_manager.c
index a2aab8e..3e0417f 100644
--- a/desktop/cookie_manager.c
+++ b/desktop/cookie_manager.c
@@ -545,6 +545,19 @@ void cookie_manager_remove(const struct cookie_data *data)
 }
 
 
+/* exported interface documented in cookie_manager.h */
+nserror cookie_manager_set_search_string(
+               const char *string)
+{
+       /* If we don't have a cookie manager at the moment, just return */
+       if (cm_ctx.tree == NULL) {
+               return NSERROR_NOT_FOUND;
+       }
+
+       return treeview_set_search_string(cm_ctx.tree, string);
+}
+
+
 /**
  * Initialise the treeview entry feilds
  *
diff --git a/desktop/cookie_manager.h b/desktop/cookie_manager.h
index 4ae74a2..11d0325 100644
--- a/desktop/cookie_manager.h
+++ b/desktop/cookie_manager.h
@@ -76,6 +76,15 @@ bool cookie_manager_add(const struct cookie_data *data);
 void cookie_manager_remove(const struct cookie_data *data);
 
 /**
+ * Set the cookie manager search string.
+ *
+ * \param string  Sering to set as search string.
+ * \return NSERROR_OK on success, appropriate error otherwise
+ */
+nserror cookie_manager_set_search_string(
+               const char *string);
+
+/**
  * Redraw the cookies manager.
  *
  * \param x    X coordinate to render treeview at
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 3e23fbe..3dcc2c3 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -4839,6 +4839,29 @@ int treeview_get_height(treeview *tree)
        return height + search_height;
 }
 
+/* Exported interface, documented in treeview.h */
+nserror treeview_set_search_string(
+               treeview *tree,
+               const char *string)
+{
+       if (!(tree->flags & TREEVIEW_SEARCHABLE)) {
+               return NSERROR_BAD_PARAMETER;
+       }
+
+       if (string == NULL || strlen(string) == 0) {
+               tree->search.active = false;
+               tree->search.search = false;
+               return treeview__search(tree, "", 0);
+       }
+
+       tree->search.active = true;
+       tree->search.search = true;
+       if (!textarea_set_text(tree->search.textarea, string)) {
+               return NSERROR_UNKNOWN;
+       }
+
+       return NSERROR_OK;
+}
 
 /**
  * Initialise the plot styles from CSS system colour values.
diff --git a/desktop/treeview.h b/desktop/treeview.h
index a8cf29a..df9b4fb 100644
--- a/desktop/treeview.h
+++ b/desktop/treeview.h
@@ -495,4 +495,15 @@ void treeview_edit_selection(treeview *tree);
  */
 int treeview_get_height(treeview *tree);
 
+
+/**
+ * Set the search string for a treeview with \ref TREEVIEW_SEARCHABLE
+ *
+ * \param tree  Tree to set the search string for.
+ * \return NSERROR_OK on success, appropriate error otherwise
+ */
+nserror treeview_set_search_string(
+               treeview *tree,
+               const char *string);
+
 #endif


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to