Commit b61f7a36 authored by Stefan Walter's avatar Stefan Walter

Simplify and cleanup the operation code

    * libseahorse/seahorse-hkp-source.c:
    * libseahorse/seahorse-ldap-source.c:
    * libseahorse/seahorse-operation.c:
    * libseahorse/seahorse-operation.h:
    * libseahorse/seahorse-pgp-source.c:
    * libseahorse/seahorse-progress.c:
    * libseahorse/seahorse-server-source.c:
    * libseahorse/seahorse-ssh-operation.c:
    * src/seahorse-generate-adv.c:
    * src/seahorse-generate-druid.c:
    * src/seahorse-keyserver-results.c:
    * src/seahorse-keyserver-sync.c:
    * src/seahorse-ssh-generate.c:
    * src/seahorse-ssh-key-properties.c:
    * src/seahorse-ssh-upload.c: Simplify and cleanup the
    operation code
parent 6a4a298b
2006-04-17 Nate Nielsen <nielsen@memberwebs.com>
* libseahorse/seahorse-hkp-source.c:
* libseahorse/seahorse-ldap-source.c:
* libseahorse/seahorse-operation.c:
* libseahorse/seahorse-operation.h:
* libseahorse/seahorse-pgp-source.c:
* libseahorse/seahorse-progress.c:
* libseahorse/seahorse-server-source.c:
* libseahorse/seahorse-ssh-operation.c:
* src/seahorse-generate-adv.c:
* src/seahorse-generate-druid.c:
* src/seahorse-keyserver-results.c:
* src/seahorse-keyserver-sync.c:
* src/seahorse-ssh-generate.c:
* src/seahorse-ssh-key-properties.c:
* src/seahorse-ssh-upload.c: Simplify and cleanup the
operation code
2006-04-17 Nate Nielsen <nielsen@memberwebs.com>
* libseahorse/seahorse-context.c: Fix how
......
......@@ -550,8 +550,8 @@ refresh_callback (SoupMessage *msg, SeahorseHKPOperation *hop)
if (--hop->requests <= 0)
seahorse_operation_mark_done (SEAHORSE_OPERATION (hop), FALSE, NULL);
else
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), _("Searching for keys..."),
hop->requests, hop->total);
seahorse_operation_mark_progress_full (SEAHORSE_OPERATION (hop), _("Searching for keys..."),
hop->requests, hop->total);
}
static gchar*
......@@ -620,8 +620,8 @@ send_callback (SoupMessage *msg, SeahorseHKPOperation *hop)
if (--hop->requests <= 0)
seahorse_operation_mark_done (SEAHORSE_OPERATION (hop), FALSE, NULL);
else
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), _("Uploading keys..."),
hop->requests, hop->total);
seahorse_operation_mark_progress_full (SEAHORSE_OPERATION (hop), _("Uploading keys..."),
hop->requests, hop->total);
}
gboolean
......@@ -690,8 +690,8 @@ get_callback (SoupMessage *msg, SeahorseHKPOperation *hop)
if (--hop->requests <= 0)
seahorse_operation_mark_done (SEAHORSE_OPERATION (hop), FALSE, NULL);
else
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), _("Retrieving keys..."),
hop->requests, hop->total);
seahorse_operation_mark_progress_full (SEAHORSE_OPERATION (hop), _("Retrieving keys..."),
hop->requests, hop->total);
}
/* -----------------------------------------------------------------------------
......@@ -799,7 +799,7 @@ seahorse_hkp_source_load (SeahorseKeySource *src, SeahorseKeySourceLoad load,
hop->total = hop->requests = 1;
t = g_strdup_printf (_("Searching for keys on: %s"), server);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), t, 0, hop->total);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), t, 0.0);
g_free (t);
g_free (server);
......@@ -872,7 +872,7 @@ seahorse_hkp_source_import (SeahorseKeySource *sksrc, gpgme_data_t data)
hop->total = hop->requests;
t = g_strdup_printf (_("Connecting to: %s"), server);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), t, 0, hop->total);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), t, 0.0);
g_free (t);
g_free (server);
......@@ -944,7 +944,7 @@ seahorse_hkp_source_export (SeahorseKeySource *sksrc, GList *keys,
hop->total = hop->requests;
t = g_strdup_printf (_("Connecting to: %s"), server);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), t, 0, hop->total);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (hop), t, 0.0);
g_free (t);
g_free (server);
......
......@@ -437,7 +437,7 @@ result_callback (SeahorseLDAPOperation *lop)
g_assert (lop->ldap_cb);
/* Should not be marked as done. */
g_assert (!seahorse_operation_is_done (SEAHORSE_OPERATION (lop)));
g_assert (seahorse_operation_is_running (SEAHORSE_OPERATION (lop)));
}
return ret;
......@@ -568,7 +568,7 @@ seahorse_ldap_operation_start (SeahorseLDAPSource *lsrc, OpLDAPCallback cb,
seahorse_operation_mark_start (SEAHORSE_OPERATION (lop));
t = g_strdup_printf (_("Connecting to: %s"), server);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), t, 0, total);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), t, 0.0);
g_free (t);
g_free (server);
......@@ -707,7 +707,7 @@ start_search (SeahorseOperation *op, LDAPMessage *result)
g_return_val_if_fail (filter != NULL, FALSE);
t = (gchar*)g_object_get_data (G_OBJECT (lop), "details");
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), t, 0, 0);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), t, 0.0);
sinfo = get_ldap_server_info (lop->lsrc, TRUE);
lop->ldap_op = ldap_search (lop->ldap, sinfo->base_dn, LDAP_SCOPE_SUBTREE,
......@@ -862,9 +862,9 @@ get_key_from_ldap (SeahorseOperation *op, LDAPMessage *result)
fprfull = (GSList*)g_object_get_data (G_OBJECT (lop), "fingerprints-full");
l = g_slist_length (fprfull);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop),
_("Retrieving remote keys..."),
l - g_slist_length (fingerprints), l);
seahorse_operation_mark_progress_full (SEAHORSE_OPERATION (lop),
_("Retrieving remote keys..."),
l - g_slist_length (fingerprints), l);
if (fingerprints) {
......@@ -996,9 +996,9 @@ send_key_to_ldap (SeahorseOperation *op, LDAPMessage *result)
keysfull = (GSList*)g_object_get_data (G_OBJECT (lop), "key-data-full");
l = g_slist_length (keysfull);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop),
_("Sending keys to key server..."),
l - g_slist_length (keys), l);
seahorse_operation_mark_progress_full (SEAHORSE_OPERATION (lop),
_("Sending keys to key server..."),
l - g_slist_length (keys), l);
if (keys) {
......
This diff is collapsed.
......@@ -58,18 +58,17 @@
struct _SeahorseOperation;
typedef void (*SeahorseOperationDone) (struct _SeahorseOperation *operation,
gboolean cancelled,
gpointer userdata);
typedef struct _SeahorseOperation {
GObject parent;
/*< public >*/
gchar *message; /* Progress status details ie: "foobar.jpg" */
gint current; /* The current progress position, or -1 for not started */
gint total; /* The total range of progress, or -1 for complete */
gboolean cancelled;
gdouble progress; /* The current progress position, -1 for indeterminate */
guint is_running : 1; /* If the operation is running or not */
guint is_done : 1; /* Operation is done or not */
guint is_cancelled : 1; /* Operation is cancelled or not */;
GError *error;
/*< private> */
......@@ -105,11 +104,11 @@ SeahorseOperation* seahorse_operation_new_complete (GError *err);
void seahorse_operation_cancel (SeahorseOperation *operation);
#define seahorse_operation_is_done(operation) \
((operation)->cancelled || ((operation)->total != 0 && ((operation)->total == (operation)->current)))
#define seahorse_operation_is_running(operation) \
((operation)->is_running)
#define seahorse_operation_is_cancelled(operation) \
((operation)->cancelled)
((operation)->is_cancelled)
#define seahorse_operation_is_successful(operation) \
((operation)->error == NULL)
......@@ -124,7 +123,8 @@ const GError* seahorse_operation_get_error (SeahorseOperation *operation
void seahorse_operation_wait (SeahorseOperation *operation);
gdouble seahorse_operation_get_progress(SeahorseOperation *operation);
#define seahorse_operation_get_progress(op) \
((op)->progress)
#define seahorse_operation_get_message(operation) \
((const gchar*)((operation)->message))
......@@ -290,16 +290,22 @@ seahorse_xx_operation_cancel (SeahorseOperation *operation)
/* Helpers for Derived ----------------------------------------------- */
void seahorse_operation_mark_start (SeahorseOperation *operation);
#define SEAHORSE_CALC_PROGRESS(cur, tot)
void seahorse_operation_mark_start (SeahorseOperation *operation);
void seahorse_operation_mark_done (SeahorseOperation *operation,
gboolean cancelled, GError *error);
void seahorse_operation_mark_done (SeahorseOperation *operation,
gboolean cancelled, GError *error);
void seahorse_operation_mark_progress (SeahorseOperation *operation,
const gchar *message,
gdouble progress);
void seahorse_operation_mark_progress (SeahorseOperation *operation,
const gchar *message,
gint current, gint total);
void seahorse_operation_mark_progress_full (SeahorseOperation *operation,
const gchar *message,
gdouble current, gdouble total);
void seahorse_operation_mark_result (SeahorseOperation *operation,
gpointer result, GDestroyNotify notify_func);
void seahorse_operation_mark_result (SeahorseOperation *operation,
gpointer result, GDestroyNotify notify_func);
#endif /* __SEAHORSE_OPERATION_H__ */
......@@ -152,12 +152,10 @@ progress_cb (void *data, const char *what, int type,
DEBUG_OPERATION (("PGPOP: got progress: %s %d/%d\n", what, current, total));
if (current > total)
current = total;
if (!seahorse_operation_is_done (SEAHORSE_OPERATION (pop)))
seahorse_operation_mark_progress (SEAHORSE_OPERATION (pop),
pv->message ? pv->message : what, current, total);
if (seahorse_operation_is_running (SEAHORSE_OPERATION (pop)))
seahorse_operation_mark_progress_full (SEAHORSE_OPERATION (pop),
pv->message ? pv->message : what,
current, total);
}
/* Register a callback. */
......@@ -252,7 +250,7 @@ event_cb (void *data, gpgme_event_io_t type, void *type_data)
gpgme_set_progress_cb (pop->gctx, NULL, NULL);
/* And try to figure out a good response */
if (!seahorse_operation_is_done (SEAHORSE_OPERATION (pop))) {
if (seahorse_operation_is_running (SEAHORSE_OPERATION (pop))) {
/* Cancelled */
if (gpgme_err_code (*gerr) == GPG_ERR_CANCELED) {
......@@ -377,7 +375,7 @@ seahorse_pgp_operation_cancel (SeahorseOperation *operation)
SeahorsePGPOperation *pop = SEAHORSE_PGP_OPERATION (operation);
SeahorsePGPOperationPrivate *pv = SEAHORSE_PGP_OPERATION_GET_PRIVATE (pop);
g_return_if_fail (!seahorse_operation_is_done (operation));
g_return_if_fail (seahorse_operation_is_running (operation));
g_return_if_fail (pop->gctx != NULL);
/* This should call in through event_cb and cancel us */
......
......@@ -259,7 +259,7 @@ seahorse_pgp_source_dispose (GObject *gobject)
/* Clear out all operations */
if (psrc->pv->operations) {
if(!seahorse_operation_is_done (SEAHORSE_OPERATION (psrc->pv->operations)))
if(seahorse_operation_is_running (SEAHORSE_OPERATION (psrc->pv->operations)))
seahorse_operation_cancel (SEAHORSE_OPERATION (psrc->pv->operations));
g_object_unref (psrc->pv->operations);
psrc->pv->operations = NULL;
......@@ -672,7 +672,7 @@ keyload_handler (SeahorseLoadOperation *lop)
/* TODO: We can use the GPGME progress to make this more accurate */
t = g_strdup_printf (ngettext("Loaded %d key", "Loaded %d keys", lop->loaded), lop->loaded);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), t, 0, 0);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), t, 0.0);
g_free (t);
return TRUE;
......@@ -731,7 +731,7 @@ seahorse_load_operation_start (SeahorsePGPSource *psrc, const gchar **pattern, g
}
seahorse_operation_mark_start (SEAHORSE_OPERATION (lop));
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), _("Loading Keys..."), 0, 0);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (lop), _("Loading Keys..."), 0.0);
if (all && !refresh) {
/* Load keys at idle time */
......@@ -806,7 +806,7 @@ seahorse_pgp_source_stop (SeahorseKeySource *src)
g_assert (SEAHORSE_IS_KEY_SOURCE (src));
psrc = SEAHORSE_PGP_SOURCE (src);
if(!seahorse_operation_is_done (SEAHORSE_OPERATION (psrc->pv->operations)))
if(seahorse_operation_is_running (SEAHORSE_OPERATION (psrc->pv->operations)))
seahorse_operation_cancel (SEAHORSE_OPERATION (psrc->pv->operations));
}
......@@ -818,8 +818,8 @@ seahorse_pgp_source_get_state (SeahorseKeySource *src)
g_assert (SEAHORSE_IS_KEY_SOURCE (src));
psrc = SEAHORSE_PGP_SOURCE (src);
return seahorse_operation_is_done (SEAHORSE_OPERATION (psrc->pv->operations)) ?
SKSRC_LOADING : 0;
return seahorse_operation_is_running (SEAHORSE_OPERATION (psrc->pv->operations)) ?
SKSRC_LOADING : 0;
}
static SeahorseOperation*
......
......@@ -117,7 +117,7 @@ seahorse_progress_appbar_set_operation (GtkWidget* appbar, SeahorseOperation *op
g_return_if_fail (GNOME_IS_APPBAR (appbar));
g_return_if_fail (SEAHORSE_IS_OPERATION (operation));
if (seahorse_operation_is_done (operation)) {
if (!seahorse_operation_is_running (operation)) {
operation_done (operation, appbar);
return;
}
......@@ -163,7 +163,7 @@ progress_operation_update (SeahorseOperation *operation, const gchar *message,
static void
progress_operation_cancel (GtkButton *button, SeahorseOperation *operation)
{
if (!seahorse_operation_is_done (operation))
if (seahorse_operation_is_running (operation))
seahorse_operation_cancel (operation);
}
......@@ -204,7 +204,7 @@ progress_show (SeahorseOperation *operation)
const gchar *title;
gchar *t;
if (seahorse_operation_is_done (operation)) {
if (!seahorse_operation_is_running (operation)) {
/* Matches the ref in seahorse_progress_show */
g_object_unref (operation);
return FALSE;
......
......@@ -139,7 +139,7 @@ seahorse_server_source_dispose (GObject *gobject)
/* Clear out all the operations */
if (ssrc->priv->mop) {
if(!seahorse_operation_is_done (SEAHORSE_OPERATION (ssrc->priv->mop)))
if(seahorse_operation_is_running (SEAHORSE_OPERATION (ssrc->priv->mop)))
seahorse_operation_cancel (SEAHORSE_OPERATION (ssrc->priv->mop));
g_object_unref (ssrc->priv->mop);
ssrc->priv->mop = NULL;
......@@ -337,7 +337,7 @@ seahorse_server_source_stop (SeahorseKeySource *src)
g_assert (SEAHORSE_IS_KEY_SOURCE (src));
ssrc = SEAHORSE_SERVER_SOURCE (src);
if(!seahorse_operation_is_done(SEAHORSE_OPERATION (ssrc->priv->mop)))
if(seahorse_operation_is_running (SEAHORSE_OPERATION (ssrc->priv->mop)))
seahorse_operation_cancel (SEAHORSE_OPERATION (ssrc->priv->mop));
}
......@@ -350,7 +350,7 @@ seahorse_server_source_get_state (SeahorseKeySource *src)
ssrc = SEAHORSE_SERVER_SOURCE (src);
guint state = SKSRC_REMOTE;
if (!seahorse_operation_is_done (SEAHORSE_OPERATION (ssrc->priv->mop)))
if (seahorse_operation_is_running (SEAHORSE_OPERATION (ssrc->priv->mop)))
state |= SKSRC_LOADING;
return state;
}
......
......@@ -99,7 +99,7 @@ watch_ssh_process (GPid pid, gint status, SeahorseSSHOperation *sop)
DEBUG_OPERATION (("SSHOP: SSH process done\n"));
if (!seahorse_operation_is_done (SEAHORSE_OPERATION (sop))) {
if (seahorse_operation_is_running (SEAHORSE_OPERATION (sop))) {
/* Was killed */
if (!WIFEXITED (status)) {
......@@ -146,7 +146,7 @@ io_ssh_write (GIOChannel *source, GIOCondition condition, SeahorseSSHOperation *
GIOStatus status;
gsize written = 0;
if (!seahorse_operation_is_done (SEAHORSE_OPERATION (sop)) && pv->sin) {
if (seahorse_operation_is_running (SEAHORSE_OPERATION (sop)) && pv->sin) {
DEBUG_OPERATION (("SSHOP: SSH ready for input\n"));
status = g_io_channel_write_chars (pv->iin, pv->sin->str, pv->sin->len,
......@@ -170,7 +170,7 @@ io_ssh_write (GIOChannel *source, GIOCondition condition, SeahorseSSHOperation *
pv->sin = NULL;
}
if (seahorse_operation_is_done (SEAHORSE_OPERATION (sop)) || !pv->sin) {
if (!seahorse_operation_is_running (SEAHORSE_OPERATION (sop)) || !pv->sin) {
DEBUG_OPERATION (("SSHOP: Closing SSH input channel\n"));
g_io_channel_unref (pv->iin);
pv->iin = NULL;
......@@ -192,7 +192,7 @@ io_ssh_read (GIOChannel *source, GIOCondition condition, SeahorseSSHOperation *s
gsize read = 0;
GString *str;
if (seahorse_operation_is_done (SEAHORSE_OPERATION (sop)))
if (!seahorse_operation_is_running (SEAHORSE_OPERATION (sop)))
return TRUE;
/* Figure out which buffer we're writing into */
......@@ -388,7 +388,7 @@ static void
seahorse_ssh_operation_dispose (GObject *gobject)
{
SeahorseOperation *op = SEAHORSE_OPERATION (gobject);
if (!seahorse_operation_is_done (op))
if (seahorse_operation_is_running (op))
seahorse_ssh_operation_cancel (op);
G_OBJECT_CLASS (operation_parent_class)->dispose (gobject);
}
......@@ -509,7 +509,7 @@ seahorse_ssh_operation_new (SeahorseSSHSource *ssrc, const gchar *command,
pv->message = g_strdup (progress);
seahorse_operation_mark_start (SEAHORSE_OPERATION (sop));
seahorse_operation_mark_progress (SEAHORSE_OPERATION (sop), progress, 0, 0);
seahorse_operation_mark_progress (SEAHORSE_OPERATION (sop), progress, 0.0);
return SEAHORSE_OPERATION (sop);
}
......@@ -596,7 +596,7 @@ seahorse_ssh_operation_upload (SeahorseSSHSource *ssrc, GList *keys,
* completed operations, so we don't need to factor that in. If this
* ever changes, then we need to recode this bit
*/
g_return_val_if_fail (seahorse_operation_is_done (op), NULL);
g_return_val_if_fail (!seahorse_operation_is_running (op), NULL);
/* Return any errors */
if (!seahorse_operation_is_successful (op)) {
......
......@@ -138,17 +138,17 @@ ok_clicked (GtkButton *button, SeahorseWidget *swidget)
/* When we update to support S/MIME this will need to change */
sksrc = seahorse_context_find_key_source (SCTX_APP (), SKEY_PGP, SKEY_LOC_LOCAL);
g_return_if_fail (sksrc && SEAHORSE_IS_PGP_SOURCE (sksrc));
op = seahorse_pgp_key_op_generate (SEAHORSE_PGP_SOURCE (sksrc), name, email, comment,
pass, type, length, expires, &err);
if (GPG_IS_OK (err))
seahorse_progress_show (op, _("Generating key"), TRUE);
else
seahorse_util_handle_gpgme (err, _("Couldn't generate key"));
op = seahorse_pgp_key_op_generate (SEAHORSE_PGP_SOURCE (sksrc), name, email, comment,
pass, type, length, expires, &err);
seahorse_widget_destroy (swidget);
gtk_widget_destroy (widget);
seahorse_widget_destroy (swidget);
if (GPG_IS_OK (err)) {
seahorse_progress_show (op, _("Generating key"), TRUE);
g_object_unref (op);
} else
seahorse_util_handle_gpgme (err, _("Couldn't generate key"));
}
void
......
......@@ -162,15 +162,17 @@ on_druid_finish (GnomeDruidPage *gnomedruidpage, GtkWidget *widget, SeahorseWidg
/* When we update to support S/MIME this will need to change */
sksrc = seahorse_context_find_key_source (SCTX_APP(), SKEY_PGP, SKEY_LOC_LOCAL);
g_return_if_fail (sksrc && SEAHORSE_IS_PGP_SOURCE (sksrc));
op = seahorse_pgp_key_op_generate (SEAHORSE_PGP_SOURCE (sksrc), name, email, comment,
pass, type, length, expires, &err);
op = seahorse_pgp_key_op_generate (SEAHORSE_PGP_SOURCE (sksrc), name, email, comment,
pass, type, length, expires, &err);
if (GPG_IS_OK (err))
seahorse_progress_show (op, _("Generating Key"), TRUE);
else
seahorse_util_handle_gpgme (err, _("Couldn't generate key"));
gtk_widget_destroy (widget2);
seahorse_widget_destroy (swidget);
if (GPG_IS_OK (err)) {
seahorse_progress_show (op, _("Generating key"), TRUE);
g_object_unref (op);
} else
seahorse_util_handle_gpgme (err, _("Couldn't generate key"));
}
gboolean
......
......@@ -272,7 +272,7 @@ window_destroyed (GtkWindow *window, SeahorseWidget *swidget)
SeahorseOperation *op =
SEAHORSE_OPERATION (g_object_get_data (G_OBJECT (swidget), "operation"));
if (op && !seahorse_operation_is_done (op))
if (op && seahorse_operation_is_running (op))
seahorse_operation_cancel (op);
}
......
......@@ -108,8 +108,8 @@ ok_clicked (GtkButton *button, SeahorseWidget *swidget)
/* And now syncing keys from the servers */
ks = seahorse_gconf_get_string_list (KEYSERVER_KEY);
ks = seahorse_server_source_purge_keyservers (ks);
ks = seahorse_server_source_purge_keyservers (ks);
for (l = ks; l; l = g_slist_next (l)) {
sksrc = seahorse_context_remote_key_source (SCTX_APP(), (const gchar*)(l->data));
......@@ -158,8 +158,8 @@ ok_clicked (GtkButton *button, SeahorseWidget *swidget)
g_free (keyserver);
/* Show the progress window if necessary */
if (!seahorse_operation_is_done (SEAHORSE_OPERATION (mop)))
seahorse_progress_show (SEAHORSE_OPERATION (mop), _("Syncing keys..."), FALSE);
seahorse_progress_show (SEAHORSE_OPERATION (mop), _("Syncing keys..."), FALSE);
g_object_unref (mop);
}
static void
......
......@@ -126,6 +126,7 @@ on_response (GtkDialog *dialog, guint response, SeahorseWidget *swidget)
g_signal_connect (op, "done", G_CALLBACK (upload_handler), NULL);
seahorse_progress_show (op, _("Creating SSH Key"), TRUE);
g_object_unref (op);
}
void
......
......@@ -85,10 +85,10 @@ passphrase_button_clicked (GtkWidget *widget, SeahorseWidget *swidget)
gtk_widget_set_sensitive (w, FALSE);
op = seahorse_ssh_operation_change_passphrase (SEAHORSE_SSH_KEY (skey));
if (seahorse_operation_is_done (op))
passphrase_done (op, swidget);
else
if (seahorse_operation_is_running (op))
g_signal_connect (op, "done", G_CALLBACK (passphrase_done), swidget);
else
passphrase_done (op, swidget);
/* Running operations ref themselves */
g_object_unref (op);
......
......@@ -145,9 +145,7 @@ upload_keys (SeahorseWidget *swidget)
g_signal_connect (op, "done", G_CALLBACK (upload_complete), NULL);
/* Show the progress window if necessary */
if (!seahorse_operation_is_done (op))
seahorse_progress_show (op, _("Configuring SSH Keys..."), FALSE);
seahorse_progress_show (op, _("Configuring SSH Keys..."), FALSE);
g_object_unref (op);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment