~maxolasersquad/ubuntu/precise/epiphany-browser/add_quicklist

« back to all changes in this revision

Viewing changes to src/pdm-dialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2010-10-14 12:45:29 UTC
  • mfrom: (98.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20101014124529-57hi6lecoo68e3sq
Tags: 2.30.6-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Update the search URL:
    + add debian/patches/80_ubuntu_search_url.patch
    + update debian/epiphany-browser-data.gconf-defaults
  - Set branding to Ubuntu.
  - debian/patches/81_ubuntu_force_update_bookmarks_menu.patch:
    + Update the bookmarks menu every time the internal structure
      is changed (needed for the UNE application menu to work correctly).
  - Support appindicator.
  - debian/control.in:
    + Temporary bump for gir dependencies to ensure we rebuild against
      the correct version.
  - debian/patches/13_clearing_temp.patch:
    + Fix crashing epiphany-browser while clearing temp files.
      This patch can be dropped with new upstream 2.32 release.
* debian/control.in:
  - Bump Build-Depends on network-manager-dev to avoid FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
}
225
225
 
226
226
static void
227
 
pdm_dialog_password_remove_cb (GnomeKeyringResult result,
 
227
get_info_full_cb (GnomeKeyringResult result,
 
228
                  GnomeKeyringItemInfo *info,
 
229
                  gpointer data)
 
230
{
 
231
        if (result != GNOME_KEYRING_RESULT_OK)
 
232
                return;
 
233
 
 
234
        if (gnome_keyring_item_info_get_type (info) == GNOME_KEYRING_ITEM_NETWORK_PASSWORD)
 
235
                gnome_keyring_item_delete (GNOME_KEYRING_DEFAULT,
 
236
                                           GPOINTER_TO_UINT (data),
 
237
                                           NULL, NULL, NULL);
 
238
}
 
239
 
 
240
static void
 
241
got_network_passwords_list_cb (GnomeKeyringResult result,
 
242
                               GList *list,
228
243
                               gpointer data)
229
244
{
230
 
        GtkTreeRowReference *rowref = (GtkTreeRowReference *)data;
231
 
 
232
 
        if (result == GNOME_KEYRING_RESULT_OK) {
233
 
                GtkTreeIter iter;
234
 
                GtkTreePath *path;
235
 
                GtkTreeModel *model;
236
 
 
237
 
                if (!gtk_tree_row_reference_valid (rowref))
238
 
                        return;
239
 
 
240
 
                path = gtk_tree_row_reference_get_path (rowref);
241
 
                model = gtk_tree_row_reference_get_model (rowref);
242
 
 
243
 
                if (path != NULL && gtk_tree_model_get_iter (model, &iter, path)) {
244
 
                        gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
245
 
                        gtk_tree_path_free (path);
246
 
                }
247
 
        }
 
245
        GList *l;
 
246
 
 
247
        if (result != GNOME_KEYRING_RESULT_OK)
 
248
                return;
 
249
 
 
250
        for (l = list; l != NULL; l = l->next)
 
251
                gnome_keyring_item_get_info_full (GNOME_KEYRING_DEFAULT,
 
252
                                                  GPOINTER_TO_UINT (l->data),
 
253
                                                  GNOME_KEYRING_ITEM_INFO_BASICS,
 
254
                                                  (GnomeKeyringOperationGetItemInfoCallback) get_info_full_cb,
 
255
                                                  l->data,
 
256
                                                  NULL);
 
257
}
 
258
 
 
259
static void
 
260
_ephy_pdm_delete_all_passwords ()
 
261
{
 
262
        gnome_keyring_list_item_ids (GNOME_KEYRING_DEFAULT,
 
263
                                     got_network_passwords_list_cb,
 
264
                                     NULL, NULL);
248
265
}
249
266
 
250
267
static void
282
299
                if (gtk_toggle_button_get_active
283
300
                        (GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_passwords)))
284
301
                {
285
 
                        GtkTreeIter iter;
286
 
                        PdmDialog *pdialog = EPHY_PDM_DIALOG (checkbuttons->dialog);
287
 
                        PdmActionInfo *pinfo = pdialog->priv->passwords;
288
 
 
289
 
                        gboolean valid = gtk_tree_model_get_iter_first (pinfo->model, &iter);
290
 
 
291
 
                        while (valid) {
292
 
                                GtkTreePath *path;
293
 
                                EphyPasswordInfo *info;
294
 
                                GtkTreeRowReference *row;
295
 
 
296
 
                                path = gtk_tree_model_get_path (pinfo->model, &iter);
297
 
                                row = gtk_tree_row_reference_new (pinfo->model, path);
298
 
 
299
 
                                gtk_tree_model_get (pinfo->model, &iter,
300
 
                                                    COL_PASSWORDS_DATA, &info,
301
 
                                                    -1);
302
 
 
303
 
                                gnome_keyring_item_delete (GNOME_KEYRING_DEFAULT,
304
 
                                                           info->keyring_id,
305
 
                                                           (GnomeKeyringOperationDoneCallback) pdm_dialog_password_remove_cb,
306
 
                                                           row,
307
 
                                                           (GDestroyNotify) gtk_tree_row_reference_free);
308
 
 
309
 
                                valid = gtk_tree_model_iter_next (pinfo->model, &iter);
310
 
 
311
 
                                g_slice_free (EphyPasswordInfo, info);
312
 
                                gtk_tree_path_free (path);
 
302
                        /* Clear UI if we are the PDM dialog */
 
303
                        if (EPHY_IS_PDM_DIALOG (checkbuttons->dialog))
 
304
                        {
 
305
                                PdmDialog *pdialog = EPHY_PDM_DIALOG (checkbuttons->dialog);
 
306
                                PdmActionInfo *pinfo = pdialog->priv->passwords;
 
307
                                gtk_list_store_clear (GTK_LIST_STORE (pinfo->model));
313
308
                        }
 
309
 
 
310
                        _ephy_pdm_delete_all_passwords ();
314
311
                }
315
312
                if (gtk_toggle_button_get_active
316
313
                        (GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_cache)))
1488
1485
 
1489
1486
static void
1490
1487
sync_notebook_tab (GtkWidget *notebook,
1491
 
                   GtkNotebookPage *page,
 
1488
                   GtkWidget *page,
1492
1489
                   int page_num,
1493
1490
                   PdmDialog *dialog)
1494
1491
{