diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | data/glade/epiphany.glade | 56 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 9 | ||||
-rwxr-xr-x | src/pdm-dialog.c | 57 |
4 files changed, 108 insertions, 22 deletions
@@ -1,3 +1,11 @@ +2005-10-22 Jean-François Rameau <jframeau@cvs.gnome.org> + + * embed/mozilla/mozilla-embed-single.cpp: (impl_list_passwords): + * src/pdm-dialog.c: + * data/glade/epiphany.glade: + + Add a way to view stored password. Fix bug 316821. + 2005-10-22 Christian Persch <chpe@cvs.gnome.org> * data/mime-types-permissions.xml: diff --git a/data/glade/epiphany.glade b/data/glade/epiphany.glade index 96599865b..ac54976bd 100644 --- a/data/glade/epiphany.glade +++ b/data/glade/epiphany.glade @@ -18,6 +18,7 @@ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> <signal name="delete_event" handler="download_dialog_delete_cb"/> <child> @@ -129,6 +130,7 @@ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> <property name="has_separator">False</property> <signal name="response" handler="pdm_dialog_response_cb" last_modification_time="Tue, 17 Jun 2003 22:37:44 GMT"/> @@ -332,34 +334,67 @@ </child> <child> - <widget class="GtkVButtonBox" id="vbuttonbox2"> + <widget class="GtkVBox" id="vbox149"> <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_START</property> - <property name="spacing">6</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> <child> - <widget class="GtkButton" id="passwords_remove_button"> + <widget class="GtkVButtonBox" id="vbuttonbox2"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_START</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkButton" id="passwords_remove_button"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-remove</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="passwords_show_button"> <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_default">True</property> <property name="can_focus">True</property> - <property name="label">gtk-remove</property> - <property name="use_stock">True</property> + <property name="label" translatable="yes">_Show password</property> + <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="pdm_dialog_passwords_show_cb" last_modification_time="Sat, 22 Oct 2005 20:04:26 GMT"/> </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> </child> </widget> <packing> <property name="padding">0</property> <property name="expand">False</property> - <property name="fill">False</property> + <property name="fill">True</property> </packing> </child> </widget> <packing> <property name="tab_expand">False</property> - <property name="tab_fill">True</property> + <property name="tab_fill">False</property> </packing> </child> @@ -412,6 +447,7 @@ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> <property name="has_separator">False</property> <signal name="response" handler="ephy_encoding_dialog_response_cb" last_modification_time="Thu, 16 Oct 2003 17:19:06 GMT"/> diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index da5272b96..2c1ac191a 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -810,11 +810,18 @@ impl_list_passwords (EphyPasswordManager *manager) NS_UTF16ToCString (unicodeName, NS_CSTRING_ENCODING_UTF8, userName); + rv = nsPassword->GetPassword (unicodeName); + if (NS_FAILED (rv)) continue; + + nsEmbedCString userPassword; + NS_UTF16ToCString (unicodeName, + NS_CSTRING_ENCODING_UTF8, userPassword); + EphyPasswordInfo *p = g_new0 (EphyPasswordInfo, 1); p->host = g_strdup (host.get()); p->username = g_strdup (userName.get()); - p->password = NULL; + p->password = g_strdup (userPassword.get()); passwords = g_list_prepend (passwords, p); } diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index b25c819c9..a71cc7411 100755 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -41,6 +41,7 @@ #include <gtk/gtkliststore.h> #include <gtk/gtkcellrenderertext.h> #include <gtk/gtknotebook.h> +#include <gtk/gtktogglebutton.h> #include <glib/gi18n.h> #include <time.h> @@ -90,6 +91,7 @@ enum { COL_PASSWORDS_HOST, COL_PASSWORDS_USER, + COL_PASSWORDS_PASSWORD, COL_PASSWORDS_DATA }; @@ -101,7 +103,8 @@ enum PROP_COOKIES_REMOVE, PROP_COOKIES_PROPERTIES, PROP_PASSWORDS_TREEVIEW, - PROP_PASSWORDS_REMOVE + PROP_PASSWORDS_REMOVE, + PROP_PASSWORDS_SHOW }; static const @@ -110,11 +113,12 @@ EphyDialogProperty properties [] = { "pdm_dialog", NULL, PT_NORMAL, 0 }, { "pdm_notebook", NULL, PT_NORMAL, 0 }, - { "cookies_treeview", NULL, PT_NORMAL, 0 }, - { "cookies_remove_button", NULL, PT_NORMAL, 0 }, - { "cookies_properties_button", NULL, PT_NORMAL, 0 }, - { "passwords_treeview", NULL, PT_NORMAL, 0 }, - { "passwords_remove_button", NULL, PT_NORMAL, 0 }, + { "cookies_treeview", NULL, PT_NORMAL, 0 }, + { "cookies_remove_button", NULL, PT_NORMAL, 0 }, + { "cookies_properties_button", NULL, PT_NORMAL, 0 }, + { "passwords_treeview", NULL, PT_NORMAL, 0 }, + { "passwords_remove_button", NULL, PT_NORMAL, 0 }, + { "passwords_show_button", NULL, PT_NORMAL, 0 }, { NULL } }; @@ -124,13 +128,11 @@ static void pdm_dialog_init (PdmDialog *dialog); static void pdm_dialog_finalize (GObject *object); /* Glade callbacks */ -void pdm_dialog_close_button_clicked_cb (GtkWidget *button, +void pdm_dialog_close_button_clicked_cb (GtkWidget *button, PdmDialog *dialog); void pdm_dialog_cookies_properties_button_clicked_cb (GtkWidget *button, PdmDialog *dialog); -void pdm_dialog_cookies_treeview_selection_changed_cb (GtkTreeSelection *selection, - PdmDialog *dialog); -void pdm_dialog_passwords_treeview_selection_changed_cb (GtkTreeSelection *selection, +void pdm_dialog_passwords_show_cb (GtkWidget *checkbox, PdmDialog *dialog); void pdm_dialog_response_cb (GtkDialog *widget, int response, @@ -637,7 +639,8 @@ pdm_dialog_passwords_construct (PdmActionInfo *info) (EPHY_DIALOG(dialog), properties[PROP_PASSWORDS_TREEVIEW].id)); /* set tree model */ - liststore = gtk_list_store_new (3, + liststore = gtk_list_store_new (4, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, EPHY_TYPE_PASSWORD_INFO); @@ -677,6 +680,20 @@ pdm_dialog_passwords_construct (PdmActionInfo *info) gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_column_set_sort_column_id (column, COL_PASSWORDS_USER); + gtk_tree_view_insert_column_with_attributes (treeview, + COL_PASSWORDS_PASSWORD, + _("User Password"), + renderer, + "text", COL_PASSWORDS_PASSWORD, + NULL); + column = gtk_tree_view_get_column (treeview, COL_PASSWORDS_PASSWORD); + /* Hide this info by default */ + gtk_tree_view_column_set_visible (column, FALSE); + gtk_tree_view_column_set_resizable (column, TRUE); + gtk_tree_view_column_set_reorderable (column, TRUE); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_sort_column_id (column, COL_PASSWORDS_PASSWORD); + info->treeview = treeview; setup_action (info); @@ -746,6 +763,7 @@ pdm_dialog_password_add (PdmActionInfo *info, &iter, COL_PASSWORDS_HOST, pinfo->host, COL_PASSWORDS_USER, pinfo->username, + COL_PASSWORDS_PASSWORD, pinfo->password, -1); g_value_init (&value, EPHY_TYPE_PASSWORD_INFO); @@ -1035,6 +1053,23 @@ pdm_dialog_cookies_properties_button_clicked_cb (GtkWidget *button, } void +pdm_dialog_passwords_show_cb (GtkWidget *button, + PdmDialog *dialog) +{ + GtkTreeView *treeview; + GtkTreeViewColumn *column; + gboolean active; + + treeview = GTK_TREE_VIEW (ephy_dialog_get_control + (EPHY_DIALOG(dialog), properties[PROP_PASSWORDS_TREEVIEW].id)); + column = gtk_tree_view_get_column (treeview, COL_PASSWORDS_PASSWORD); + + active = gtk_toggle_button_get_active ((GTK_TOGGLE_BUTTON (button))); + + gtk_tree_view_column_set_visible (column, active); +} + +void pdm_dialog_response_cb (GtkDialog *widget, gint response, PdmDialog *dialog) |