Skip to content
Commits on Source (8)
......@@ -30,6 +30,7 @@ check-code-style:
flatpak:
extends: '.flatpak'
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:42"
variables:
CONFIG_OPTS: '-Dprofile=Devel -Dunit_tests=enabled -Dgsb_api_key=${GSB_API_KEY} -Denable_gsb=true --werror'
except:
......@@ -38,6 +39,7 @@ flatpak:
flatpak stable:
extends: '.flatpak'
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:42"
variables:
CONFIG_OPTS: '-Dprofile=Devel -Dunit_tests=enabled -Dgsb_api_key=${GSB_API_KEY} -Denable_gsb=true -Dsoup2=enabled'
only:
......@@ -45,14 +47,16 @@ flatpak stable:
flatpak master:
extends: '.flatpak'
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:42"
variables:
CONFIG_OPTS: '-Dtech_preview=true -Dprofile=Devel -Dunit_tests=enabled -Dgsb_api_key=${GSB_API_KEY} -Denable_gsb=true'
only:
- master
- gnome-42
scanbuild:
extends: '.flatpak'
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
image: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:42"
variables:
CONFIG_OPTS: '-Dprofile=Devel -Dunit_tests=enabled'
script:
......@@ -69,7 +73,7 @@ nightly:
dependencies: ['flatpak master']
canary:
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
stage: 'test'
interruptible: true
tags:
......
42.4 - August 5, 2022
=====================
* Fix crashes and misbehavior when importing bookmarks (#1800)
* Fix desktop notification priority (!1179)
42.3 - July 8, 2022
===================
......
......@@ -47,6 +47,7 @@
<value key="Purism::form_factor">mobile</value>
</custom>
<releases>
<release date="2022-08-05" version="42.4"/>
<release date="2022-07-08" version="42.3"/>
<release date="2022-04-21" version="42.2"/>
<release date="2022-04-12" version="42.1"/>
......
project('epiphany', 'c',
license: 'GPL3+',
version: '42.3',
version: '42.4',
meson_version: '>= 0.51.0',
default_options: ['c_std=gnu11',
'warning_level=2']
......
{
"app-id" : "org.gnome.Epiphany.Devel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"runtime-version" : "42",
"sdk" : "org.gnome.Sdk",
"command" : "epiphany",
"tags" : [
......
......@@ -992,7 +992,6 @@ show_notification_cb (WebKitWebView *web_view,
notify = g_notification_new (webkit_notification_get_title (notification));
g_notification_set_body (notify, webkit_notification_get_body (notification));
g_notification_set_priority (notify, G_NOTIFICATION_PRIORITY_LOW);
g_notification_set_default_action_and_target (notify, "app.notification-clicked", "t", webkit_notification_get_id (notification));
g_hash_table_insert (shell->notifications, GINT_TO_POINTER (webkit_notification_get_id (notification)), notification);
......
......@@ -93,15 +93,21 @@ window_cmd_new_incognito_window (GSimpleAction *action,
ephy_open_incognito_window (NULL);
}
#define IMPORT_FROM_GVDB_ID "gvdb"
#define IMPORT_FROM_HTML_ID "html"
#define IMPORT_FROM_FIREFOX_ID "firefox"
#define IMPORT_FROM_CHROME_ID "chrome"
#define IMPORT_FROM_CHROMIUM_ID "chromium"
typedef enum {
IMPORT_TYPE_CHOOSE,
IMPORT_TYPE_IMPORT
} ImportTypes;
struct import_option {
const char *name;
ImportTypes type;
const char *id;
gboolean (*exists)(void);
};
......@@ -110,11 +116,11 @@ static gboolean chrome_exists (void);
static gboolean chromium_exists (void);
static struct import_option import_options[] = {
{ N_("GVDB File"), IMPORT_TYPE_CHOOSE, NULL },
{ N_("HTML File"), IMPORT_TYPE_CHOOSE, NULL },
{ N_("Firefox"), IMPORT_TYPE_IMPORT, firefox_exists },
{ N_("Chrome"), IMPORT_TYPE_IMPORT, chrome_exists },
{ N_("Chromium"), IMPORT_TYPE_IMPORT, chromium_exists }
{ N_("GVDB File"), IMPORT_TYPE_CHOOSE, IMPORT_FROM_GVDB_ID, NULL },
{ N_("HTML File"), IMPORT_TYPE_CHOOSE, IMPORT_FROM_HTML_ID, NULL },
{ N_("Firefox"), IMPORT_TYPE_IMPORT, IMPORT_FROM_FIREFOX_ID, firefox_exists },
{ N_("Chrome"), IMPORT_TYPE_IMPORT, IMPORT_FROM_CHROME_ID, chrome_exists },
{ N_("Chromium"), IMPORT_TYPE_IMPORT, IMPORT_FROM_CHROMIUM_ID, chromium_exists }
};
static void
......@@ -149,7 +155,7 @@ get_firefox_profiles (void)
NULL);
keyfile = g_key_file_new ();
g_key_file_load_from_file (keyfile, filename, G_KEY_FILE_NONE, &error);
if (error) {
if (error && !g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
g_warning ("Failed to load %s: %s", filename, error->message);
return NULL;
......@@ -211,16 +217,19 @@ chromium_exists (void)
}
static GtkTreeModel *
create_tree_model (void)
create_tree_model (int *out_id_column)
{
enum {
TEXT_COL
TEXT_COL,
ID_COL
};
GtkListStore *list_store;
GtkTreeIter iter;
int i;
list_store = gtk_list_store_new (1, G_TYPE_STRING);
*out_id_column = ID_COL;
list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
for (i = G_N_ELEMENTS (import_options) - 1; i >= 0; i--) {
if (import_options[i].exists && !import_options[i].exists ())
continue;
......@@ -228,6 +237,7 @@ create_tree_model (void)
gtk_list_store_prepend (list_store, &iter);
gtk_list_store_set (list_store, &iter,
TEXT_COL, _(import_options[i].name),
ID_COL, import_options[i].id,
-1);
}
......@@ -289,7 +299,7 @@ show_firefox_profile_selector_cb (GtkDialog *selector,
g_autoptr (GError) error = NULL;
gboolean imported = ephy_bookmarks_import_from_firefox (manager, selected_profile, &error);
show_import_export_result (parent, imported, imported, error,
show_import_export_result (parent, FALSE, imported, error,
_("Bookmarks successfully imported!"));
}
}
......@@ -362,7 +372,7 @@ dialog_bookmarks_import_file_chooser_cb (GtkNativeDialog *file_chooser_dialog,
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser_dialog));
imported = ephy_bookmarks_import (manager, filename, &error);
show_import_export_result (parent, imported, imported, error,
show_import_export_result (parent, FALSE, imported, error,
_("Bookmarks successfully imported!"));
}
......@@ -407,7 +417,7 @@ dialog_bookmarks_import_from_html_file_chooser_cb (GtkNativeDialog *file_chooser
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser_dialog));
imported = ephy_bookmarks_import_from_html (manager, filename, &error);
show_import_export_result (parent, imported, imported, error,
show_import_export_result (parent, FALSE, imported, error,
_("Bookmarks successfully imported!"));
}
......@@ -450,7 +460,7 @@ dialog_bookmarks_import_from_firefox (GtkWindow *parent)
if (num_profiles == 1) {
imported = ephy_bookmarks_import_from_firefox (manager, profiles->data, &error);
show_import_export_result (parent, imported, imported, error,
show_import_export_result (parent, FALSE, imported, error,
_("Bookmarks successfully imported!"));
} else if (num_profiles > 1) {
show_firefox_profile_selector (parent, profiles);
......@@ -473,7 +483,7 @@ dialog_bookmarks_import_from_chrome (GtkWindow *parent)
imported = ephy_bookmarks_import_from_chrome (manager, filename, &error);
show_import_export_result (parent, imported, imported, error,
show_import_export_result (parent, FALSE, imported, error,
_("Bookmarks successfully imported!"));
}
......@@ -489,41 +499,35 @@ dialog_bookmarks_import_from_chromium (GtkWindow *parent)
imported = ephy_bookmarks_import_from_chrome (manager, filename, &error);
show_import_export_result (parent, imported, imported, error,
show_import_export_result (parent, FALSE, imported, error,
_("Bookmarks successfully imported!"));
}
static void
dialog_bookmarks_import_cb (GtkWindow *parent,
dialog_bookmarks_import_cb (GtkDialog *dialog,
GtkResponseType response,
GtkComboBox *combo_box)
{
int active;
GtkWindow *window = gtk_window_get_transient_for (GTK_WINDOW (dialog));
const char *active;
if (response == GTK_RESPONSE_OK) {
active = gtk_combo_box_get_active (combo_box);
switch (active) {
case 0:
dialog_bookmarks_import (parent);
break;
case 1:
dialog_bookmarks_import_from_html (parent);
break;
case 2:
dialog_bookmarks_import_from_firefox (parent);
break;
case 3:
dialog_bookmarks_import_from_chrome (parent);
break;
case 4:
dialog_bookmarks_import_from_chromium (parent);
break;
default:
g_assert_not_reached ();
}
} else if (response == GTK_RESPONSE_CANCEL) {
gtk_widget_destroy (GTK_WIDGET (parent));
active = gtk_combo_box_get_active_id (combo_box);
if (strcmp (active, IMPORT_FROM_GVDB_ID) == 0)
dialog_bookmarks_import (window);
else if (strcmp (active, IMPORT_FROM_HTML_ID) == 0)
dialog_bookmarks_import_from_html (window);
else if (strcmp (active, IMPORT_FROM_FIREFOX_ID) == 0)
dialog_bookmarks_import_from_firefox (window);
else if (strcmp (active, IMPORT_FROM_CHROME_ID) == 0)
dialog_bookmarks_import_from_chrome (window);
else if (strcmp (active, IMPORT_FROM_CHROMIUM_ID) == 0)
dialog_bookmarks_import_from_chromium (window);
else
g_assert_not_reached ();
}
gtk_widget_destroy (GTK_WIDGET (dialog));
}
void
......@@ -539,6 +543,7 @@ window_cmd_import_bookmarks (GSimpleAction *action,
GtkWidget *combo_box;
GtkTreeModel *tree_model;
GtkCellRenderer *cell_renderer;
int id_column = 0;
dialog = g_object_new (GTK_TYPE_DIALOG,
"use-header-bar", TRUE,
......@@ -566,10 +571,11 @@ window_cmd_import_bookmarks (GSimpleAction *action,
label = gtk_label_new (_("From:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
tree_model = create_tree_model ();
tree_model = create_tree_model (&id_column);
combo_box = gtk_combo_box_new_with_model (GTK_TREE_MODEL (tree_model));
gtk_widget_set_hexpand (combo_box, TRUE);
g_object_unref (tree_model);
gtk_combo_box_set_id_column (GTK_COMBO_BOX (combo_box), id_column);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
g_signal_connect (GTK_COMBO_BOX (combo_box), "changed",
......@@ -684,21 +690,24 @@ chromium_passwords_exists (void)
}
static struct import_option import_passwords_options[] = {
{ N_("Chrome"), IMPORT_TYPE_IMPORT, chrome_passwords_exists },
{ N_("Chromium"), IMPORT_TYPE_IMPORT, chromium_passwords_exists }
{ N_("Chrome"), IMPORT_TYPE_IMPORT, IMPORT_FROM_CHROME_ID, chrome_passwords_exists },
{ N_("Chromium"), IMPORT_TYPE_IMPORT, IMPORT_FROM_CHROMIUM_ID, chromium_passwords_exists }
};
static GtkTreeModel *
create_import_passwords_tree_model (void)
create_import_passwords_tree_model (int *out_id_column)
{
enum {
TEXT_COL
TEXT_COL,
ID_COL
};
GtkListStore *list_store;
GtkTreeIter iter;
int i;
list_store = gtk_list_store_new (1, G_TYPE_STRING);
*out_id_column = ID_COL;
list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
for (i = G_N_ELEMENTS (import_passwords_options) - 1; i >= 0; i--) {
if (import_passwords_options[i].exists && !import_passwords_options[i].exists ())
continue;
......@@ -706,6 +715,7 @@ create_import_passwords_tree_model (void)
gtk_list_store_prepend (list_store, &iter);
gtk_list_store_set (list_store, &iter,
TEXT_COL, _(import_passwords_options[i].name),
ID_COL, import_passwords_options[i].id,
-1);
}
......@@ -732,21 +742,17 @@ dialog_passwords_import_cb (GtkDialog *dialog,
{
if (response == GTK_RESPONSE_OK) {
EphyPasswordManager *manager;
int active;
const char *active;
manager = ephy_embed_shell_get_password_manager (EPHY_EMBED_SHELL (ephy_shell_get_default ()));
active = gtk_combo_box_get_active (combo_box);
switch (active) {
case 0:
ephy_password_import_from_chrome_async (manager, CHROME, dialog_password_import_cb, dialog);
break;
case 1:
ephy_password_import_from_chrome_async (manager, CHROMIUM, dialog_password_import_cb, dialog);
break;
default:
g_assert_not_reached ();
}
active = gtk_combo_box_get_active_id (combo_box);
if (strcmp (active, IMPORT_FROM_CHROME_ID) == 0)
ephy_password_import_from_chrome_async (manager, CHROME, dialog_password_import_cb, dialog);
else if (strcmp (active, IMPORT_FROM_CHROMIUM_ID) == 0)
ephy_password_import_from_chrome_async (manager, CHROMIUM, dialog_password_import_cb, dialog);
else
g_assert_not_reached ();
} else {
gtk_widget_destroy (GTK_WIDGET (dialog));
}
......@@ -781,6 +787,7 @@ window_cmd_import_passwords (GSimpleAction *action,
GtkWidget *combo_box;
GtkTreeModel *tree_model;
GtkCellRenderer *cell_renderer;
int id_column = 0;
dialog = g_object_new (GTK_TYPE_DIALOG,
"use-header-bar", TRUE,
......@@ -808,7 +815,7 @@ window_cmd_import_passwords (GSimpleAction *action,
label = gtk_label_new (_("From:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
tree_model = create_import_passwords_tree_model ();
tree_model = create_import_passwords_tree_model (&id_column);
if (gtk_tree_model_iter_n_children (tree_model, NULL))
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE);
......@@ -823,6 +830,7 @@ window_cmd_import_passwords (GSimpleAction *action,
G_CALLBACK (passwords_combo_box_changed_cb),
gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK));
gtk_combo_box_set_id_column (GTK_COMBO_BOX (combo_box), id_column);
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
cell_renderer = gtk_cell_renderer_text_new ();
......