seahorse r2655 - in trunk: . gkr libseahorse pgp pkcs11 po src ssh
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: seahorse r2655 - in trunk: . gkr libseahorse pgp pkcs11 po src ssh
- Date: Sat, 13 Dec 2008 19:29:44 +0000 (UTC)
Author: nnielsen
Date: Sat Dec 13 19:29:44 2008
New Revision: 2655
URL: http://svn.gnome.org/viewvc/seahorse?rev=2655&view=rev
Log:
* gkr/seahorse-gkr-commands.c:
* libseahorse/Makefile.am:
* libseahorse/seahorse-commands.c:
* libseahorse/seahorse-commands.h:
* libseahorse/seahorse-commands.vala: (removed)
* libseahorse/seahorse-view.c:
* libseahorse/seahorse-view.h:
* libseahorse/seahorse-view.vala: (removed)
* pgp/Makefile.am:
* pgp/seahorse-pgp-commands.c:
* pgp/seahorse-pgp-commands.h:
* pgp/seahorse-pgp-commands.vala: (removed)
* pgp/seahorse-pgp-module.c:
* pkcs11/seahorse-pkcs11-commands.c:
* src/seahorse-viewer.c:
* src/seahorse-viewer.h:
* ssh/Makefile.am:
* ssh/seahorse-ssh-commands.c:
* ssh/seahorse-ssh-commands.vala: (removed)
* ssh/seahorse-ssh-module.c: Rework how commands are looked up.
No longer by tag, but by object GType.
Removed:
trunk/libseahorse/seahorse-commands.vala
trunk/pgp/seahorse-pgp-commands.vala
trunk/ssh/seahorse-ssh-commands.vala
Modified:
trunk/ChangeLog
trunk/gkr/seahorse-gkr-commands.c
trunk/libseahorse/Makefile.am
trunk/libseahorse/seahorse-commands.c
trunk/libseahorse/seahorse-commands.h
trunk/libseahorse/seahorse-view.c
trunk/libseahorse/seahorse-view.h
trunk/libseahorse/seahorse-xxx.c
trunk/libseahorse/seahorse-xxx.h
trunk/pgp/Makefile.am
trunk/pgp/seahorse-pgp-commands.c
trunk/pgp/seahorse-pgp-commands.h
trunk/pgp/seahorse-pgp-module.c
trunk/pkcs11/seahorse-pkcs11-commands.c
trunk/pkcs11/vala-build.stamp
trunk/po/POTFILES.in
trunk/po/POTFILES.skip
trunk/src/seahorse-viewer.c
trunk/src/seahorse-viewer.h
trunk/ssh/Makefile.am
trunk/ssh/seahorse-ssh-commands.c
trunk/ssh/seahorse-ssh-commands.h
trunk/ssh/seahorse-ssh-module.c
Modified: trunk/gkr/seahorse-gkr-commands.c
==============================================================================
--- trunk/gkr/seahorse-gkr-commands.c (original)
+++ trunk/gkr/seahorse-gkr-commands.c Sat Dec 13 19:29:44 2008
@@ -35,14 +35,11 @@
#include <glib/gi18n.h>
enum {
- PROP_0,
- PROP_KTYPE,
- PROP_UI_DEFINITION,
- PROP_COMMAND_ACTIONS
+ PROP_0
};
struct _SeahorseGkrCommandsPrivate {
- GtkActionGroup* command_actions;
+ guint dummy;
};
G_DEFINE_TYPE (SeahorseGkrCommands, seahorse_gkr_commands, SEAHORSE_TYPE_COMMANDS);
@@ -108,38 +105,21 @@
return seahorse_source_delete_objects (objects);
}
-static GQuark
-seahorse_gkr_commands_get_ktype (SeahorseCommands* base)
-{
- return SEAHORSE_GKR_TYPE;
-}
-
-
-static const gchar*
-seahorse_gkr_commands_get_ui_definition (SeahorseCommands* base)
-{
- return "";
-}
-
-
-static GtkActionGroup*
-seahorse_gkr_commands_get_command_actions (SeahorseCommands* base)
-{
- SeahorseGkrCommandsPrivate* pv = SEAHORSE_GKR_COMMANDS_GET_PRIVATE(base);
- return pv->command_actions;
-}
-
static GObject*
seahorse_gkr_commands_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
GObject *obj = G_OBJECT_CLASS (seahorse_gkr_commands_parent_class)->constructor (type, n_props, props);
- SeahorseGkrCommands *self = NULL;
- SeahorseGkrCommandsPrivate *pv;
+ SeahorseCommands *base = NULL;
+ SeahorseView *view;
if (obj) {
- pv = SEAHORSE_GKR_COMMANDS_GET_PRIVATE (obj);
- self = SEAHORSE_GKR_COMMANDS (obj);
+ base = SEAHORSE_COMMANDS (obj);
+ view = seahorse_commands_get_view (base);
+ g_return_val_if_fail (view, NULL);
+
+ seahorse_view_register_commands (view, base, SEAHORSE_TYPE_GKR_KEYRING);
+ seahorse_view_register_commands (view, base, SEAHORSE_TYPE_GKR_ITEM);
}
return obj;
@@ -148,31 +128,18 @@
static void
seahorse_gkr_commands_init (SeahorseGkrCommands *self)
{
- SeahorseGkrCommandsPrivate *pv = SEAHORSE_GKR_COMMANDS_GET_PRIVATE (self);
- pv->command_actions = gtk_action_group_new ("gkr");
+
}
static void
seahorse_gkr_commands_dispose (GObject *obj)
{
- SeahorseGkrCommands *self = SEAHORSE_GKR_COMMANDS (obj);
- SeahorseGkrCommandsPrivate *pv = SEAHORSE_GKR_COMMANDS_GET_PRIVATE (self);
-
- if (pv->command_actions)
- g_object_unref (pv->command_actions);
- pv->command_actions = NULL;
-
G_OBJECT_CLASS (seahorse_gkr_commands_parent_class)->dispose (obj);
}
static void
seahorse_gkr_commands_finalize (GObject *obj)
{
- SeahorseGkrCommands *self = SEAHORSE_GKR_COMMANDS (obj);
- SeahorseGkrCommandsPrivate *pv = SEAHORSE_GKR_COMMANDS_GET_PRIVATE (self);
-
- g_assert (!pv->command_actions);
-
G_OBJECT_CLASS (seahorse_gkr_commands_parent_class)->finalize (obj);
}
@@ -189,20 +156,9 @@
static void
seahorse_gkr_commands_get_property (GObject *obj, guint prop_id, GValue *value,
- GParamSpec *pspec)
+ GParamSpec *pspec)
{
- SeahorseCommands *base = SEAHORSE_COMMANDS (obj);
-
switch (prop_id) {
- case PROP_KTYPE:
- g_value_set_uint (value, seahorse_commands_get_ktype (base));
- break;
- case PROP_UI_DEFINITION:
- g_value_set_string (value, seahorse_commands_get_ui_definition (base));
- break;
- case PROP_COMMAND_ACTIONS:
- g_value_set_object (value, seahorse_commands_get_command_actions (base));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -226,13 +182,6 @@
cmd_class->show_properties = seahorse_gkr_commands_show_properties;
cmd_class->delete_objects = seahorse_gkr_commands_delete_objects;
- cmd_class->get_ktype = seahorse_gkr_commands_get_ktype;
- cmd_class->get_ui_definition = seahorse_gkr_commands_get_ui_definition;
- cmd_class->get_command_actions = seahorse_gkr_commands_get_command_actions;
-
- g_object_class_override_property (gobject_class, PROP_KTYPE, "ktype");
- g_object_class_override_property (gobject_class, PROP_UI_DEFINITION, "ui-definition");
- g_object_class_override_property (gobject_class, PROP_COMMAND_ACTIONS, "command-actions");
/* Register this class as a commands */
seahorse_registry_register_type (seahorse_registry_get (), SEAHORSE_TYPE_GKR_COMMANDS,
Modified: trunk/libseahorse/Makefile.am
==============================================================================
--- trunk/libseahorse/Makefile.am (original)
+++ trunk/libseahorse/Makefile.am Sat Dec 13 19:29:44 2008
@@ -16,10 +16,8 @@
-DLIBCRYPTUI_API_SUBJECT_TO_CHANGE
VALA_SRCS = \
- seahorse-commands.vala \
seahorse-generator.vala \
- seahorse-servers.vala \
- seahorse-view.vala
+ seahorse-servers.vala
VALA_PKGS = \
--vapidir . \
@@ -52,6 +50,7 @@
libseahorse_la_SOURCES = \
seahorse-check-button-control.c seahorse-check-button-control.h \
seahorse-combo-keys.c seahorse-combo-keys.h \
+ seahorse-commands.c seahorse-commands.h \
seahorse-context.c seahorse-context.h \
seahorse-dns-sd.c seahorse-dns-sd.h \
seahorse-gconf.c seahorse-gconf.h \
@@ -79,6 +78,7 @@
seahorse-unknown-source.c seahorse-unknown-source.h \
seahorse-util.c seahorse-util.h \
seahorse-validity.c seahorse-validity.h \
+ seahorse-view.c seahorse-view.h \
seahorse-widget.c seahorse-widget.h \
$(MARSHAL_SRCS) \
$(VALA_CFILES) $(VALA_HFILES) \
Modified: trunk/libseahorse/seahorse-commands.c
==============================================================================
--- trunk/libseahorse/seahorse-commands.c (original)
+++ trunk/libseahorse/seahorse-commands.c Sat Dec 13 19:29:44 2008
@@ -19,152 +19,219 @@
* 02111-1307, USA.
*/
-#include <seahorse-commands.h>
-
+#include "config.h"
+#include "seahorse-commands.h"
+enum {
+ PROP_0,
+ PROP_VIEW,
+ PROP_KTYPE,
+ PROP_COMMAND_ACTIONS,
+ PROP_UI_DEFINITION
+};
struct _SeahorseCommandsPrivate {
- SeahorseView* _view;
+ SeahorseView* view;
};
-#define SEAHORSE_COMMANDS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_TYPE_COMMANDS, SeahorseCommandsPrivate))
-enum {
- SEAHORSE_COMMANDS_DUMMY_PROPERTY,
- SEAHORSE_COMMANDS_VIEW,
- SEAHORSE_COMMANDS_KTYPE,
- SEAHORSE_COMMANDS_COMMAND_ACTIONS,
- SEAHORSE_COMMANDS_UI_DEFINITION
-};
-static void seahorse_commands_real_show_properties (SeahorseCommands* self, SeahorseObject* obj);
-static SeahorseOperation* seahorse_commands_real_delete_objects (SeahorseCommands* self, GList* obj);
-static void seahorse_commands_set_view (SeahorseCommands* self, SeahorseView* value);
-static gpointer seahorse_commands_parent_class = NULL;
-static void seahorse_commands_finalize (GObject * obj);
+G_DEFINE_TYPE (SeahorseCommands, seahorse_commands, G_TYPE_OBJECT);
+#define SEAHORSE_COMMANDS_GET_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_TYPE_COMMANDS, SeahorseCommandsPrivate))
+/* -----------------------------------------------------------------------------
+ * OBJECT
+ */
-static void seahorse_commands_real_show_properties (SeahorseCommands* self, SeahorseObject* obj) {
- g_return_if_fail (SEAHORSE_IS_COMMANDS (self));
- g_critical ("Type `%s' does not implement abstract method `seahorse_commands_show_properties'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
+static void
+seahorse_commands_real_show_properties (SeahorseCommands* self, SeahorseObject* obj)
+{
+ g_critical ("Type `%s' does not implement abstract method `seahorse_commands_show_properties'",
+ g_type_name (G_TYPE_FROM_INSTANCE (self)));
return;
}
-
-void seahorse_commands_show_properties (SeahorseCommands* self, SeahorseObject* obj) {
- SEAHORSE_COMMANDS_GET_CLASS (self)->show_properties (self, obj);
-}
-
-
-static SeahorseOperation* seahorse_commands_real_delete_objects (SeahorseCommands* self, GList* obj) {
- g_return_val_if_fail (SEAHORSE_IS_COMMANDS (self), NULL);
- g_critical ("Type `%s' does not implement abstract method `seahorse_commands_delete_objects'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
+static SeahorseOperation*
+seahorse_commands_real_delete_objects (SeahorseCommands* self, GList* obj)
+{
+ g_critical ("Type `%s' does not implement abstract method `seahorse_commands_delete_objects'",
+ g_type_name (G_TYPE_FROM_INSTANCE (self)));
return NULL;
}
-
-SeahorseOperation* seahorse_commands_delete_objects (SeahorseCommands* self, GList* obj) {
- return SEAHORSE_COMMANDS_GET_CLASS (self)->delete_objects (self, obj);
-}
-
-
-SeahorseView* seahorse_commands_get_view (SeahorseCommands* self) {
- g_return_val_if_fail (SEAHORSE_IS_COMMANDS (self), NULL);
- return self->priv->_view;
-}
-
-
-static void seahorse_commands_set_view (SeahorseCommands* self, SeahorseView* value) {
- SeahorseView* _tmp2;
- SeahorseView* _tmp1;
- g_return_if_fail (SEAHORSE_IS_COMMANDS (self));
- _tmp2 = NULL;
- _tmp1 = NULL;
- self->priv->_view = (_tmp2 = (_tmp1 = value, (_tmp1 == NULL ? NULL : g_object_ref (_tmp1))), (self->priv->_view == NULL ? NULL : (self->priv->_view = (g_object_unref (self->priv->_view), NULL))), _tmp2);
- g_object_notify (((GObject *) (self)), "view");
-}
-
-
-GQuark seahorse_commands_get_ktype (SeahorseCommands* self) {
- return SEAHORSE_COMMANDS_GET_CLASS (self)->get_ktype (self);
-}
-
-
-GtkActionGroup* seahorse_commands_get_command_actions (SeahorseCommands* self) {
- return SEAHORSE_COMMANDS_GET_CLASS (self)->get_command_actions (self);
+static GObject*
+seahorse_commands_constructor (GType type, guint n_props, GObjectConstructParam *props)
+{
+ GObject *obj = G_OBJECT_CLASS (seahorse_commands_parent_class)->constructor (type, n_props, props);
+ SeahorseCommands *self = NULL;
+ SeahorseCommandsPrivate *pv;
+
+ if (obj) {
+ pv = SEAHORSE_COMMANDS_GET_PRIVATE (obj);
+ self = SEAHORSE_COMMANDS (obj);
+
+ }
+
+ return obj;
}
+static void
+seahorse_commands_init (SeahorseCommands *self)
+{
+ self->pv = SEAHORSE_COMMANDS_GET_PRIVATE (self);
+}
+
+static void
+seahorse_commands_dispose (GObject *obj)
+{
+ SeahorseCommands *self = SEAHORSE_COMMANDS (obj);
+
+ if (self->pv->view)
+ g_object_remove_weak_pointer (G_OBJECT (self->pv->view), (gpointer*)&self->pv->view);
+ self->pv->view = NULL;
+
+ G_OBJECT_CLASS (seahorse_commands_parent_class)->dispose (obj);
+}
+
+static void
+seahorse_commands_finalize (GObject *obj)
+{
+ SeahorseCommands *self = SEAHORSE_COMMANDS (obj);
-const char* seahorse_commands_get_ui_definition (SeahorseCommands* self) {
- return SEAHORSE_COMMANDS_GET_CLASS (self)->get_ui_definition (self);
+ g_assert (!self->pv->view);
+
+ G_OBJECT_CLASS (seahorse_commands_parent_class)->finalize (obj);
}
-
-static void seahorse_commands_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
- SeahorseCommands * self;
- self = SEAHORSE_COMMANDS (object);
- switch (property_id) {
- case SEAHORSE_COMMANDS_VIEW:
- g_value_set_object (value, seahorse_commands_get_view (self));
+static void
+seahorse_commands_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
+{
+ SeahorseCommands *self = SEAHORSE_COMMANDS (obj);
+
+ switch (prop_id) {
+ case PROP_VIEW:
+ g_return_if_fail (!self->pv->view);
+ self->pv->view = g_value_get_object (value);
+ g_return_if_fail (self->pv->view);
+ g_object_add_weak_pointer (G_OBJECT (self->pv->view), (gpointer*)&self->pv->view);
break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
}
}
-
-static void seahorse_commands_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
- SeahorseCommands * self;
- self = SEAHORSE_COMMANDS (object);
- switch (property_id) {
- case SEAHORSE_COMMANDS_VIEW:
- seahorse_commands_set_view (self, g_value_get_object (value));
+static void
+seahorse_commands_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
+{
+ SeahorseCommands *self = SEAHORSE_COMMANDS (obj);
+
+ switch (prop_id) {
+ case PROP_VIEW:
+ g_value_set_object (value, seahorse_commands_get_view (self));
break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
}
}
-
-static void seahorse_commands_class_init (SeahorseCommandsClass * klass) {
+static void
+seahorse_commands_class_init (SeahorseCommandsClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
seahorse_commands_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (SeahorseCommandsPrivate));
- G_OBJECT_CLASS (klass)->get_property = seahorse_commands_get_property;
- G_OBJECT_CLASS (klass)->set_property = seahorse_commands_set_property;
- G_OBJECT_CLASS (klass)->finalize = seahorse_commands_finalize;
+
+ gobject_class->constructor = seahorse_commands_constructor;
+ gobject_class->dispose = seahorse_commands_dispose;
+ gobject_class->finalize = seahorse_commands_finalize;
+ gobject_class->set_property = seahorse_commands_set_property;
+ gobject_class->get_property = seahorse_commands_get_property;
+
SEAHORSE_COMMANDS_CLASS (klass)->show_properties = seahorse_commands_real_show_properties;
SEAHORSE_COMMANDS_CLASS (klass)->delete_objects = seahorse_commands_real_delete_objects;
- g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_COMMANDS_VIEW, g_param_spec_object ("view", "view", "view", SEAHORSE_TYPE_VIEW, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_COMMANDS_KTYPE, g_param_spec_uint ("ktype", "ktype", "ktype", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
- g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_COMMANDS_COMMAND_ACTIONS, g_param_spec_object ("command-actions", "command-actions", "command-actions", GTK_TYPE_ACTION_GROUP, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
- g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_COMMANDS_UI_DEFINITION, g_param_spec_string ("ui-definition", "ui-definition", "ui-definition", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_VIEW,
+ g_param_spec_object ("view", "view", "view", SEAHORSE_TYPE_VIEW,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_KTYPE,
+ g_param_spec_uint ("ktype", "ktype", "ktype",
+ 0, G_MAXUINT, 0U, G_PARAM_READABLE));
+
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_COMMAND_ACTIONS,
+ g_param_spec_object ("command-actions", "command-actions", "command-actions",
+ GTK_TYPE_ACTION_GROUP, G_PARAM_READABLE));
+
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_UI_DEFINITION,
+ g_param_spec_pointer ("ui-definition", "ui-definition", "ui-definition",
+ G_PARAM_READABLE));
}
+/* -----------------------------------------------------------------------------
+ * PUBLIC
+ */
-static void seahorse_commands_instance_init (SeahorseCommands * self) {
- self->priv = SEAHORSE_COMMANDS_GET_PRIVATE (self);
+void
+seahorse_commands_show_properties (SeahorseCommands* self, SeahorseObject* obj)
+{
+ g_return_if_fail (SEAHORSE_IS_COMMANDS (self));
+ SEAHORSE_COMMANDS_GET_CLASS (self)->show_properties (self, obj);
}
-
-static void seahorse_commands_finalize (GObject * obj) {
- SeahorseCommands * self;
- self = SEAHORSE_COMMANDS (obj);
- (self->priv->_view == NULL ? NULL : (self->priv->_view = (g_object_unref (self->priv->_view), NULL)));
- G_OBJECT_CLASS (seahorse_commands_parent_class)->finalize (obj);
+SeahorseOperation*
+seahorse_commands_delete_objects (SeahorseCommands* self, GList* obj)
+{
+ g_return_val_if_fail (SEAHORSE_IS_COMMANDS (self), NULL);
+ return SEAHORSE_COMMANDS_GET_CLASS (self)->delete_objects (self, obj);
}
-
-GType seahorse_commands_get_type (void) {
- static GType seahorse_commands_type_id = 0;
- if (seahorse_commands_type_id == 0) {
- static const GTypeInfo g_define_type_info = { sizeof (SeahorseCommandsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_commands_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorseCommands), 0, (GInstanceInitFunc) seahorse_commands_instance_init };
- seahorse_commands_type_id = g_type_register_static (G_TYPE_OBJECT, "SeahorseCommands", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
- }
- return seahorse_commands_type_id;
+SeahorseView*
+seahorse_commands_get_view (SeahorseCommands* self)
+{
+ g_return_val_if_fail (SEAHORSE_IS_COMMANDS (self), NULL);
+ return self->pv->view;
}
+GQuark
+seahorse_commands_get_ktype (SeahorseCommands* self)
+{
+ GQuark ktype;
+ g_return_val_if_fail (SEAHORSE_IS_COMMANDS (self), 0);
+ g_object_get (self, "ktype", &ktype, NULL);
+ return ktype;
+}
+
+GtkActionGroup*
+seahorse_commands_get_command_actions (SeahorseCommands* self)
+{
+ GtkActionGroup *actions;
+ g_return_val_if_fail (SEAHORSE_IS_COMMANDS (self), NULL);
+ g_object_get (self, "command-actions", &actions, NULL);
+ if (actions)
+ g_object_unref (actions);
+ return actions;
+}
+const gchar*
+seahorse_commands_get_ui_definition (SeahorseCommands* self)
+{
+ const gchar* ui_definition;
+ g_return_val_if_fail (SEAHORSE_IS_COMMANDS (self), NULL);
+ g_object_get (self, "ui-definition", &ui_definition, NULL);
+ return ui_definition;
+}
+GtkWindow*
+seahorse_commands_get_window (SeahorseCommands* self)
+{
+ SeahorseView *view = seahorse_commands_get_view (self);
+ g_return_val_if_fail (view, NULL);
+ return seahorse_view_get_window (view);
+}
Modified: trunk/libseahorse/seahorse-commands.h
==============================================================================
--- trunk/libseahorse/seahorse-commands.h (original)
+++ trunk/libseahorse/seahorse-commands.h Sat Dec 13 19:29:44 2008
@@ -1,4 +1,4 @@
-/*
+/*
* Seahorse
*
* Copyright (C) 2008 Stefan Walter
@@ -12,7 +12,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -24,51 +24,48 @@
#include <glib.h>
#include <glib-object.h>
-#include <seahorse-operation.h>
-#include <gtk/gtk.h>
-#include <stdlib.h>
-#include <string.h>
-#include <seahorse-object.h>
-#include <seahorse-view.h>
-
-G_BEGIN_DECLS
-
-
-#define SEAHORSE_TYPE_COMMANDS (seahorse_commands_get_type ())
-#define SEAHORSE_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_COMMANDS, SeahorseCommands))
-#define SEAHORSE_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_COMMANDS, SeahorseCommandsClass))
-#define SEAHORSE_IS_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_COMMANDS))
-#define SEAHORSE_IS_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_COMMANDS))
-#define SEAHORSE_COMMANDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_COMMANDS, SeahorseCommandsClass))
-typedef struct _SeahorseCommands SeahorseCommands;
+#include "seahorse-operation.h"
+#include "seahorse-object.h"
+#include "seahorse-view.h"
+
+#define SEAHORSE_TYPE_COMMANDS (seahorse_commands_get_type ())
+#define SEAHORSE_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_COMMANDS, SeahorseCommands))
+#define SEAHORSE_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_COMMANDS, SeahorseCommandsClass))
+#define SEAHORSE_IS_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_COMMANDS))
+#define SEAHORSE_IS_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_COMMANDS))
+#define SEAHORSE_COMMANDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_COMMANDS, SeahorseCommandsClass))
+
typedef struct _SeahorseCommandsClass SeahorseCommandsClass;
typedef struct _SeahorseCommandsPrivate SeahorseCommandsPrivate;
struct _SeahorseCommands {
GObject parent_instance;
- SeahorseCommandsPrivate * priv;
+ SeahorseCommandsPrivate *pv;
};
struct _SeahorseCommandsClass {
GObjectClass parent_class;
- void (*show_properties) (SeahorseCommands* self, SeahorseObject* obj);
- SeahorseOperation* (*delete_objects) (SeahorseCommands* self, GList* obj);
- GQuark (*get_ktype) (SeahorseCommands* self);
- GtkActionGroup* (*get_command_actions) (SeahorseCommands* self);
- const char* (*get_ui_definition) (SeahorseCommands* self);
+
+ /* Virtual methods */
+
+ void (*show_properties) (SeahorseCommands *self, SeahorseObject *obj);
+
+ SeahorseOperation * (*delete_objects) (SeahorseCommands *self, GList *obj);
};
+GType seahorse_commands_get_type (void);
+
+void seahorse_commands_show_properties (SeahorseCommands *self, SeahorseObject *obj);
+
+SeahorseOperation * seahorse_commands_delete_objects (SeahorseCommands *self, GList *obj);
+
+SeahorseView * seahorse_commands_get_view (SeahorseCommands *self);
-void seahorse_commands_show_properties (SeahorseCommands* self, SeahorseObject* obj);
-SeahorseOperation* seahorse_commands_delete_objects (SeahorseCommands* self, GList* obj);
-SeahorseView* seahorse_commands_get_view (SeahorseCommands* self);
-GQuark seahorse_commands_get_ktype (SeahorseCommands* self);
-GtkActionGroup* seahorse_commands_get_command_actions (SeahorseCommands* self);
-const char* seahorse_commands_get_ui_definition (SeahorseCommands* self);
-GType seahorse_commands_get_type (void);
+GtkWindow * seahorse_commands_get_window (SeahorseCommands *self);
+GtkActionGroup * seahorse_commands_get_command_actions (SeahorseCommands *self);
-G_END_DECLS
+const char * seahorse_commands_get_ui_definition (SeahorseCommands *self);
#endif
Modified: trunk/libseahorse/seahorse-view.c
==============================================================================
--- trunk/libseahorse/seahorse-view.c (original)
+++ trunk/libseahorse/seahorse-view.c Sat Dec 13 19:29:44 2008
@@ -19,63 +19,110 @@
* 02111-1307, USA.
*/
-#include <seahorse-view.h>
+#include "seahorse-view.h"
-
-
-
-
-
-
-GList* seahorse_view_get_selected_objects (SeahorseView* self) {
+GList*
+seahorse_view_get_selected_objects (SeahorseView* self)
+{
+ g_return_val_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->get_selected_objects, NULL);
return SEAHORSE_VIEW_GET_INTERFACE (self)->get_selected_objects (self);
}
-void seahorse_view_set_selected_objects (SeahorseView* self, GList* objects) {
+void
+seahorse_view_set_selected_objects (SeahorseView* self, GList* objects)
+{
+ g_return_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->set_selected_objects);
SEAHORSE_VIEW_GET_INTERFACE (self)->set_selected_objects (self, objects);
}
-SeahorseObject* seahorse_view_get_selected (SeahorseView* self) {
+SeahorseObject*
+seahorse_view_get_selected (SeahorseView* self)
+{
+ g_return_val_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->get_selected, NULL);
return SEAHORSE_VIEW_GET_INTERFACE (self)->get_selected (self);
}
-void seahorse_view_set_selected (SeahorseView* self, SeahorseObject* value) {
+void
+seahorse_view_set_selected (SeahorseView* self, SeahorseObject* value)
+{
+ g_return_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->set_selected);
SEAHORSE_VIEW_GET_INTERFACE (self)->set_selected (self, value);
}
-SeahorseSet* seahorse_view_get_current_set (SeahorseView* self) {
+SeahorseSet*
+seahorse_view_get_current_set (SeahorseView* self)
+{
+ g_return_val_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->get_current_set, NULL);
return SEAHORSE_VIEW_GET_INTERFACE (self)->get_current_set (self);
}
-GtkWindow* seahorse_view_get_window (SeahorseView* self) {
+GtkWindow*
+seahorse_view_get_window (SeahorseView* self)
+{
+ g_return_val_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->get_window, NULL);
return SEAHORSE_VIEW_GET_INTERFACE (self)->get_window (self);
}
-
-static void seahorse_view_base_init (SeahorseViewIface * iface) {
+void
+seahorse_view_register_commands (SeahorseView *self, SeahorseCommands *commands,
+ GType for_type)
+{
+ g_return_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->register_commands);
+ return SEAHORSE_VIEW_GET_INTERFACE (self)->register_commands (self, commands, for_type);
+}
+
+void
+seahorse_view_register_ui (SeahorseView *self, const gchar *ui_definition,
+ GtkActionGroup *actions)
+{
+ g_return_if_fail (SEAHORSE_VIEW_GET_INTERFACE (self)->register_ui);
+ return SEAHORSE_VIEW_GET_INTERFACE (self)->register_ui (self, ui_definition, actions);
+}
+
+static void
+seahorse_view_base_init (SeahorseViewIface * iface)
+{
static gboolean initialized = FALSE;
if (!initialized) {
initialized = TRUE;
- g_object_interface_install_property (iface, g_param_spec_object ("selected", "selected", "selected", SEAHORSE_TYPE_OBJECT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
- g_object_interface_install_property (iface, g_param_spec_object ("current-set", "current-set", "current-set", SEAHORSE_TYPE_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
- g_object_interface_install_property (iface, g_param_spec_object ("window", "window", "window", GTK_TYPE_WINDOW, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
- g_signal_new ("selection_changed", SEAHORSE_TYPE_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+ g_object_interface_install_property (iface,
+ g_param_spec_object ("selected", "selected", "selected",
+ SEAHORSE_TYPE_OBJECT, G_PARAM_READWRITE));
+
+ g_object_interface_install_property (iface,
+ g_param_spec_object ("current-set", "current-set", "current-set",
+ SEAHORSE_TYPE_SET, G_PARAM_READABLE));
+
+ g_object_interface_install_property (iface,
+ g_param_spec_object ("window", "window", "window",
+ GTK_TYPE_WINDOW, G_PARAM_READABLE));
+
+ g_signal_new ("selection_changed", SEAHORSE_TYPE_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}
}
-
-GType seahorse_view_get_type (void) {
+GType
+seahorse_view_get_type (void)
+{
static GType seahorse_view_type_id = 0;
+
if (seahorse_view_type_id == 0) {
- static const GTypeInfo g_define_type_info = { sizeof (SeahorseViewIface), (GBaseInitFunc) seahorse_view_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL };
- seahorse_view_type_id = g_type_register_static (G_TYPE_INTERFACE, "SeahorseView", &g_define_type_info, 0);
+ static const GTypeInfo type_info = {
+ sizeof (SeahorseViewIface), (GBaseInitFunc) seahorse_view_base_init,
+ (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL,
+ (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL
+ };
+
+ seahorse_view_type_id = g_type_register_static (G_TYPE_INTERFACE, "SeahorseView", &type_info, 0);
g_type_interface_add_prerequisite (seahorse_view_type_id, G_TYPE_OBJECT);
}
+
return seahorse_view_type_id;
}
Modified: trunk/libseahorse/seahorse-view.h
==============================================================================
--- trunk/libseahorse/seahorse-view.h (original)
+++ trunk/libseahorse/seahorse-view.h Sat Dec 13 19:29:44 2008
@@ -24,41 +24,64 @@
#include <glib.h>
#include <glib-object.h>
-#include <seahorse-set.h>
-#include <gtk/gtk.h>
-#include <seahorse-object.h>
-G_BEGIN_DECLS
+#include "seahorse-set.h"
+#include "seahorse-object.h"
+typedef struct _SeahorseCommands SeahorseCommands;
-#define SEAHORSE_TYPE_VIEW (seahorse_view_get_type ())
-#define SEAHORSE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_VIEW, SeahorseView))
-#define SEAHORSE_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_VIEW))
-#define SEAHORSE_VIEW_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SEAHORSE_TYPE_VIEW, SeahorseViewIface))
+#define SEAHORSE_TYPE_VIEW (seahorse_view_get_type ())
+#define SEAHORSE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_VIEW, SeahorseView))
+#define SEAHORSE_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_VIEW))
+#define SEAHORSE_VIEW_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SEAHORSE_TYPE_VIEW, SeahorseViewIface))
typedef struct _SeahorseView SeahorseView;
typedef struct _SeahorseViewIface SeahorseViewIface;
struct _SeahorseViewIface {
GTypeInterface parent_iface;
- GList* (*get_selected_objects) (SeahorseView* self);
- void (*set_selected_objects) (SeahorseView* self, GList* objects);
- SeahorseObject* (*get_selected) (SeahorseView* self);
- void (*set_selected) (SeahorseView* self, SeahorseObject* value);
- SeahorseSet* (*get_current_set) (SeahorseView* self);
- GtkWindow* (*get_window) (SeahorseView* self);
+
+ /* virtual metdods */
+ GList* (*get_selected_objects) (SeahorseView *self);
+
+ void (*set_selected_objects) (SeahorseView *self, GList *objects);
+
+ SeahorseObject* (*get_selected) (SeahorseView *self);
+
+ void (*set_selected) (SeahorseView *self, SeahorseObject *value);
+
+ SeahorseSet* (*get_current_set) (SeahorseView *self);
+
+ GtkWindow* (*get_window) (SeahorseView *self);
+
+ void (*register_commands) (SeahorseView *self, SeahorseCommands *commands,
+ GType for_type);
+
+ void (*register_ui) (SeahorseView *self, const gchar *ui_definition,
+ GtkActionGroup *actions);
};
-GList* seahorse_view_get_selected_objects (SeahorseView* self);
-void seahorse_view_set_selected_objects (SeahorseView* self, GList* objects);
-SeahorseObject* seahorse_view_get_selected (SeahorseView* self);
-void seahorse_view_set_selected (SeahorseView* self, SeahorseObject* value);
-SeahorseSet* seahorse_view_get_current_set (SeahorseView* self);
-GtkWindow* seahorse_view_get_window (SeahorseView* self);
-GType seahorse_view_get_type (void);
+GType seahorse_view_get_type (void);
+
+GList* seahorse_view_get_selected_objects (SeahorseView *self);
+
+void seahorse_view_set_selected_objects (SeahorseView *self, GList *objects);
+
+SeahorseObject* seahorse_view_get_selected (SeahorseView *self);
+
+void seahorse_view_set_selected (SeahorseView *self, SeahorseObject *value);
+
+SeahorseSet* seahorse_view_get_current_set (SeahorseView *self);
+
+GtkWindow* seahorse_view_get_window (SeahorseView *self);
+void seahorse_view_register_ui (SeahorseView *self,
+ const gchar *ui_definition,
+ GtkActionGroup *actions);
-G_END_DECLS
+void seahorse_view_register_commands (SeahorseView *self,
+ SeahorseCommands *commands,
+ GType for_type);
#endif
Modified: trunk/libseahorse/seahorse-xxx.c
==============================================================================
--- trunk/libseahorse/seahorse-xxx.c (original)
+++ trunk/libseahorse/seahorse-xxx.c Sat Dec 13 19:29:44 2008
@@ -40,9 +40,6 @@
G_DEFINE_TYPE (SeahorseXxx, seahorse_xxx, G_TYPE_OBJECT);
-#define SEAHORSE_XXX_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_TYPE_XXX, SeahorseXxxPrivate))
-
/* -----------------------------------------------------------------------------
* INTERNAL
*/
@@ -55,23 +52,18 @@
static GObject*
seahorse_xxx_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
- GObject *obj = G_OBJECT_CLASS (seahorse_xxx_parent_class)->constructor (type, n_props, props);
- SeahorseXxx *self = NULL;
- SeahorseXxxPrivate *pv;
-
- if (obj) {
- pv = SEAHORSE_XXX_GET_PRIVATE (obj);
- self = SEAHORSE_XXX (obj);
-
- }
+ SeahorseXxx *self = SEAHORSE_XXX (G_OBJECT_CLASS (seahorse_xxx_parent_class)->constructor(type, n_props, props));
+ g_return_val_if_fail (self, NULL);
+
+
- return obj;
+ return G_OBJECT (self);
}
static void
seahorse_xxx_init (SeahorseXxx *self)
{
- SeahorseXxxPrivate *pv = SEAHORSE_XXX_GET_PRIVATE (obj);
+ self->pv = G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_TYPE_XXX, SeahorseXxxPrivate);
}
@@ -79,7 +71,6 @@
seahorse_xxx_dispose (GObject *obj)
{
SeahorseXxx *self = SEAHORSE_XXX (obj);
- SeahorseXxxPrivate *pv = SEAHORSE_XXX_GET_PRIVATE (self);
G_OBJECT_CLASS (seahorse_xxx_parent_class)->dispose (obj);
}
@@ -88,7 +79,6 @@
seahorse_xxx_finalize (GObject *obj)
{
SeahorseXxx *self = SEAHORSE_XXX (obj);
- SeahorseXxxPrivate *pv = SEAHORSE_XXX_GET_PRIVATE (self);
G_OBJECT_CLASS (seahorse_xxx_parent_class)->finalize (obj);
}
@@ -98,7 +88,6 @@
GParamSpec *pspec)
{
SeahorseXxx *self = SEAHORSE_XXX (obj);
- SeahorseXxxPrivate *pv = SEAHORSE_XXX_GET_PRIVATE (self);
switch (prop_id) {
case PROP_XXX:
@@ -114,7 +103,6 @@
GParamSpec *pspec)
{
SeahorseXxx *self = SEAHORSE_XXX (obj);
- SeahorseXxxPrivate *pv = SEAHORSE_XXX_GET_PRIVATE (self);
switch (prop_id) {
case PROP_XXX:
Modified: trunk/libseahorse/seahorse-xxx.h
==============================================================================
--- trunk/libseahorse/seahorse-xxx.h (original)
+++ trunk/libseahorse/seahorse-xxx.h Sat Dec 13 19:29:44 2008
@@ -37,6 +37,7 @@
struct _SeahorseXxx {
GObject parent;
+ SeahorseXxxPrivate *pv;
};
struct _SeahorseXxxClass {
Modified: trunk/pgp/Makefile.am
==============================================================================
--- trunk/pgp/Makefile.am (original)
+++ trunk/pgp/Makefile.am Sat Dec 13 19:29:44 2008
@@ -18,7 +18,6 @@
-DGETTEXT_PACKAGE=\""seahorse\""
VALA_SRCS = \
- seahorse-pgp-commands.vala \
seahorse-pgp-generator.vala
VALA_VAPIS = \
@@ -66,6 +65,7 @@
seahorse-pgp.c seahorse-pgp.h \
seahorse-pgp-add-subkey.c \
seahorse-pgp-add-uid.c \
+ seahorse-pgp-commands.c seahorse-pgp-commands.h \
seahorse-pgp-error.c \
seahorse-pgp-expires.c \
seahorse-pgp-generate.c \
Modified: trunk/pgp/seahorse-pgp-commands.c
==============================================================================
--- trunk/pgp/seahorse-pgp-commands.c (original)
+++ trunk/pgp/seahorse-pgp-commands.c Sat Dec 13 19:29:44 2008
@@ -19,344 +19,303 @@
* 02111-1307, USA.
*/
-#include "seahorse-pgp-commands.h"
-#include <glib/gi18n-lib.h>
-#include <seahorse-pgp.h>
-#include <seahorse-pgp-dialogs.h>
-#include <seahorse-pgp-key.h>
-#include <seahorse-view.h>
-#include <seahorse-util.h>
-#include <seahorse-source.h>
-#include <seahorse-pgp-uid.h>
-#include <config.h>
-#include <common/seahorse-registry.h>
+#include "config.h"
+
+#include <glib/gi18n.h>
+#include "seahorse-pgp.h"
+#include "seahorse-pgp-commands.h"
+#include "seahorse-pgp-dialogs.h"
+#include "common/seahorse-registry.h"
+#include "seahorse-object.h"
+#include "seahorse-util.h"
-struct _SeahorsePGPCommandsPrivate {
- GtkActionGroup* _command_actions;
+enum {
+ PROP_0
};
-#define SEAHORSE_PGP_COMMANDS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_PGP_TYPE_COMMANDS, SeahorsePGPCommandsPrivate))
-enum {
- SEAHORSE_PGP_COMMANDS_DUMMY_PROPERTY,
- SEAHORSE_PGP_COMMANDS_KTYPE,
- SEAHORSE_PGP_COMMANDS_UI_DEFINITION,
- SEAHORSE_PGP_COMMANDS_COMMAND_ACTIONS
+struct _SeahorsePgpCommandsPrivate {
+ GtkActionGroup* command_actions;
};
-static void seahorse_pgp_commands_real_show_properties (SeahorseCommands* base, SeahorseObject* obj);
-static void _g_list_free_g_object_unref (GList* self);
-static SeahorseOperation* seahorse_pgp_commands_real_delete_objects (SeahorseCommands* base, GList* objects);
-static void seahorse_pgp_commands_on_key_sign (SeahorsePGPCommands* self, GtkAction* action);
-static void seahorse_pgp_commands_on_view_selection_changed (SeahorsePGPCommands* self, SeahorseView* view);
-static void _seahorse_pgp_commands_on_key_sign_gtk_action_activate (GtkAction* _sender, gpointer self);
-static void _seahorse_pgp_commands_on_view_selection_changed_seahorse_view_selection_changed (SeahorseView* _sender, gpointer self);
-static GObject * seahorse_pgp_commands_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
-static gpointer seahorse_pgp_commands_parent_class = NULL;
-static void seahorse_pgp_commands_finalize (GObject * obj);
-
-static const GtkActionEntry SEAHORSE_PGP_COMMANDS_COMMAND_ENTRIES[] = {{"key-sign", GTK_STOCK_INDEX, N_ ("_Sign Key..."), "", N_ ("Sign public key"), ((GCallback) (NULL))}};
-static const char* SEAHORSE_PGP_COMMANDS_UI_DEF = "\n\t\t\t<ui>\n\t\t\t\n\t\t\t<menubar>\n\t\t\t\t<menu name='Key' action='key-menu'>\n\t\t\t\t\t<placeholder name=\"KeyCommands\">\n\t\t\t\t\t\t<menuitem action=\"key-sign\"/>\n\t\t\t\t\t</placeholder>\n\t\t\t\t</menu>\n\t\t\t</menubar>\n\t\t\t\n\t\t\t<toolbar name=\"MainToolbar\">\n\t\t\t\t<placeholder name=\"ToolItems\">\n\t\t\t\t\t<toolitem action=\"key-sign\"/>\n\t\t\t\t</placeholder>\n\t\t\t</toolbar>\n\n\t\t\t<popup name=\"KeyPopup\">\n\t\t\t\t<menuitem action=\"key-sign\"/>\n\t\t\t</popup>\n \n\t\t\t</ui>\n\t\t";
-
-
-static void seahorse_pgp_commands_real_show_properties (SeahorseCommands* base, SeahorseObject* obj) {
- SeahorsePGPCommands * self;
- self = SEAHORSE_PGP_COMMANDS (base);
- g_return_if_fail (SEAHORSE_IS_OBJECT (obj));
- g_return_if_fail (seahorse_object_get_tag (obj) == SEAHORSE_PGP_TYPE);
- if (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_UID) {
- obj = seahorse_object_get_parent (obj);
+
+G_DEFINE_TYPE (SeahorsePgpCommands, seahorse_pgp_commands, SEAHORSE_TYPE_COMMANDS);
+
+static const char* UI_DEFINITION = ""\
+"<ui>"\
+" <menubar>"\
+" <menu name='Key' action='key-menu'> "\
+" <placeholder name='KeyCommands'>"\
+" <menuitem action='key-sign'/>"\
+" </placeholder>"\
+" </menu>"\
+" </menubar>"\
+" <toolbar name='MainToolbar'>"\
+" <placeholder name='ToolItems'>"\
+" <toolitem action='key-sign'/>"\
+" </placeholder>"\
+" </toolbar>"\
+" <popup name='KeyPopup'>"\
+" <menuitem action='key-sign'/>"\
+" </popup>"\
+"</ui>";
+
+/* -----------------------------------------------------------------------------
+ * INTERNAL
+ */
+
+static void
+on_key_sign (GtkAction* action, SeahorsePgpCommands* self)
+{
+ SeahorseObject* key;
+
+ g_return_if_fail (SEAHORSE_IS_PGP_COMMANDS (self));
+ g_return_if_fail (GTK_IS_ACTION (action));
+
+ key = seahorse_view_get_selected (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)));
+
+ if (key == NULL)
+ return;
+
+ if (G_TYPE_FROM_INSTANCE (key) == SEAHORSE_TYPE_PGP_KEY) {
+ seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (key), seahorse_commands_get_window (SEAHORSE_COMMANDS (self)));
+ } else if (G_TYPE_FROM_INSTANCE (key) == SEAHORSE_TYPE_PGP_UID) {
+ seahorse_pgp_sign_prompt_uid (SEAHORSE_PGP_UID (key), seahorse_commands_get_window (SEAHORSE_COMMANDS (self)));
}
- g_return_if_fail (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_KEY);
- seahorse_pgp_key_properties_show (SEAHORSE_PGP_KEY (obj), seahorse_view_get_window (seahorse_commands_get_view (SEAHORSE_COMMANDS (self))));
}
+static void
+on_view_selection_changed (SeahorseView* view, SeahorsePgpCommands* self)
+{
+ GList* keys, *l;
+ gboolean enable;
+
+ g_return_if_fail (SEAHORSE_IS_PGP_COMMANDS (self));
+ g_return_if_fail (SEAHORSE_IS_VIEW (view));
+
+ keys = seahorse_view_get_selected_objects (view);
+ enable = (keys != NULL);
+
+ for (l = keys; l; l = g_list_next (l)) {
+ SeahorseObject* key = SEAHORSE_OBJECT (l->data);
+ if (G_OBJECT_TYPE (key) != SEAHORSE_TYPE_PGP_KEY &&
+ G_OBJECT_TYPE (key) != SEAHORSE_TYPE_PGP_UID) {
+ enable = FALSE;
+ break;
+ }
+ }
-static void _g_list_free_g_object_unref (GList* self) {
- g_list_foreach (self, ((GFunc) (g_object_unref)), NULL);
- g_list_free (self);
+ gtk_action_group_set_sensitive (self->pv->command_actions, enable);
+ g_list_free (keys);
}
+static const GtkActionEntry COMMAND_ENTRIES[] = {
+ { "key-sign", GTK_STOCK_INDEX, N_("_Sign Key..."), "", N_("Sign public key"), G_CALLBACK (on_key_sign) }
+};
+
+
+/* -----------------------------------------------------------------------------
+ * OBJECT
+ */
+
+static void
+seahorse_pgp_commands_show_properties (SeahorseCommands* base, SeahorseObject* obj)
+{
+ g_return_if_fail (SEAHORSE_IS_OBJECT (obj));
+ g_return_if_fail (seahorse_object_get_tag (obj) == SEAHORSE_PGP_TYPE);
+
+ if (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_UID)
+ obj = seahorse_object_get_parent (obj);
+
+ g_return_if_fail (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_KEY);
+ seahorse_pgp_key_properties_show (SEAHORSE_PGP_KEY (obj), seahorse_commands_get_window (base));
+}
-static SeahorseOperation* seahorse_pgp_commands_real_delete_objects (SeahorseCommands* base, GList* objects) {
- SeahorsePGPCommands * self;
+static SeahorseOperation*
+seahorse_pgp_commands_delete_objects (SeahorseCommands* base, GList* objects)
+{
guint num;
gint num_keys;
gint num_identities;
char* message;
- GList* to_delete;
+ SeahorseObject *obj;
+ GList* to_delete, *l;
+ SeahorseOperation *op;
guint length;
- guint _tmp9;
- SeahorseOperation* _tmp11;
- self = SEAHORSE_PGP_COMMANDS (base);
- g_return_val_if_fail (objects != NULL, NULL);
+
num = g_list_length (objects);
- if (num == 0) {
+ if (num == 0)
return NULL;
- }
+
num_keys = 0;
num_identities = 0;
message = NULL;
+
/*
* Go through and validate all what we have to delete,
* removing UIDs where the parent Key is also on the
* chopping block.
*/
to_delete = NULL;
- {
- GList* obj_collection;
- GList* obj_it;
- obj_collection = objects;
- for (obj_it = obj_collection; obj_it != NULL; obj_it = obj_it->next) {
- SeahorseObject* _tmp3;
- SeahorseObject* obj;
- _tmp3 = NULL;
- obj = (_tmp3 = ((SeahorseObject*) (obj_it->data)), (_tmp3 == NULL ? NULL : g_object_ref (_tmp3)));
- {
- if (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_UID) {
- if (g_list_find (objects, seahorse_object_get_parent (obj)) == NULL) {
- SeahorseObject* _tmp1;
- _tmp1 = NULL;
- to_delete = g_list_prepend (to_delete, (_tmp1 = obj, (_tmp1 == NULL ? NULL : g_object_ref (_tmp1))));
- num_identities = num_identities + 1;
- }
- } else {
- if (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_PGP_TYPE_KEY) {
- SeahorseObject* _tmp2;
- _tmp2 = NULL;
- to_delete = g_list_prepend (to_delete, (_tmp2 = obj, (_tmp2 == NULL ? NULL : g_object_ref (_tmp2))));
- num_keys = num_keys + 1;
- }
- }
- (obj == NULL ? NULL : (obj = (g_object_unref (obj), NULL)));
+
+ for (l = objects; l; l = g_list_next (l)) {
+ obj = SEAHORSE_OBJECT (l->data);
+ if (G_OBJECT_TYPE (obj) == SEAHORSE_PGP_TYPE_UID) {
+ if (g_list_find (objects, seahorse_object_get_parent (obj)) == NULL) {
+ to_delete = g_list_prepend (to_delete, obj);
+ ++num_identities;
}
+ } else if (G_OBJECT_TYPE (obj) == SEAHORSE_PGP_TYPE_KEY) {
+ to_delete = g_list_prepend (to_delete, obj);
+ ++num_keys;
}
}
+
/* Figure out a good prompt message */
length = g_list_length (to_delete);
- _tmp9 = length;
- if (_tmp9 == 0)
- do {
- SeahorseOperation* _tmp4;
- _tmp4 = NULL;
- return (_tmp4 = NULL, (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp4);
- } while (0); else if (_tmp9 == 1)
- do {
- char* _tmp5;
- _tmp5 = NULL;
- message = (_tmp5 = g_strdup_printf (_ ("Are you sure you want to permanently delete %s?"), seahorse_object_get_label (((SeahorseObject*) (((SeahorseObject*) (to_delete->data)))))), (message = (g_free (message), NULL)), _tmp5);
+ switch (length) {
+ case 0:
+ return NULL;
+ case 1:
+ message = g_strdup_printf (_ ("Are you sure you want to permanently delete %s?"),
+ seahorse_object_get_label (to_delete->data));
break;
- } while (0); else
- do {
+ default:
if (num_keys > 0 && num_identities > 0) {
- char* _tmp6;
- _tmp6 = NULL;
- message = (_tmp6 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d keys and identities?"), length), (message = (g_free (message), NULL)), _tmp6);
+ message = g_strdup_printf (_("Are you sure you want to permanently delete %d keys and identities?"), length);
+ } else if (num_keys > 0) {
+ message = g_strdup_printf (_("Are you sure you want to permanently delete %d keys?"), length);
+ } else if (num_identities > 0){
+ message = g_strdup_printf (_("Are you sure you want to permanently delete %d identities?"), length);
} else {
- if (num_keys > 0) {
- char* _tmp7;
- _tmp7 = NULL;
- message = (_tmp7 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d keys?"), length), (message = (g_free (message), NULL)), _tmp7);
- } else {
- if (num_identities > 0) {
- char* _tmp8;
- _tmp8 = NULL;
- message = (_tmp8 = g_strdup_printf (_ ("Are you sure you want to permanently delete %d identities?"), length), (message = (g_free (message), NULL)), _tmp8);
- } else {
- g_assert_not_reached ();
- }
- }
+ g_assert_not_reached ();
}
break;
- } while (0);
- if (!seahorse_util_prompt_delete (message, GTK_WIDGET (seahorse_view_get_window (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)))))) {
- SeahorseOperation* _tmp10;
- _tmp10 = NULL;
- return (_tmp10 = NULL, (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp10);
}
- _tmp11 = NULL;
- return (_tmp11 = seahorse_source_delete_objects (to_delete), (message = (g_free (message), NULL)), (to_delete == NULL ? NULL : (to_delete = (_g_list_free_g_object_unref (to_delete), NULL))), _tmp11);
-}
-
+
+ if (!seahorse_util_prompt_delete (message, GTK_WIDGET (seahorse_commands_get_window (base)))) {
+ g_free (message);
+ return NULL;
-static void seahorse_pgp_commands_on_key_sign (SeahorsePGPCommands* self, GtkAction* action) {
- SeahorseObject* _tmp0;
- SeahorseObject* key;
- g_return_if_fail (SEAHORSE_PGP_IS_COMMANDS (self));
- g_return_if_fail (GTK_IS_ACTION (action));
- _tmp0 = NULL;
- key = (_tmp0 = seahorse_view_get_selected (seahorse_commands_get_view (SEAHORSE_COMMANDS (self))), (_tmp0 == NULL ? NULL : g_object_ref (_tmp0)));
- if (key == NULL) {
- (key == NULL ? NULL : (key = (g_object_unref (key), NULL)));
- return;
- } else {
- if (G_TYPE_FROM_INSTANCE (G_OBJECT (key)) == SEAHORSE_PGP_TYPE_KEY) {
- seahorse_pgp_sign_prompt (SEAHORSE_PGP_KEY (key), seahorse_view_get_window (seahorse_commands_get_view (SEAHORSE_COMMANDS (self))));
- } else {
- if (G_TYPE_FROM_INSTANCE (G_OBJECT (key)) == SEAHORSE_PGP_TYPE_UID) {
- seahorse_pgp_sign_prompt_uid (SEAHORSE_PGP_UID (key), seahorse_view_get_window (seahorse_commands_get_view (SEAHORSE_COMMANDS (self))));
- }
- }
}
- (key == NULL ? NULL : (key = (g_object_unref (key), NULL)));
-}
+
+ op = seahorse_source_delete_objects (to_delete);
-
-static void seahorse_pgp_commands_on_view_selection_changed (SeahorsePGPCommands* self, SeahorseView* view) {
- GList* keys;
- gboolean enable;
- g_return_if_fail (SEAHORSE_PGP_IS_COMMANDS (self));
- g_return_if_fail (SEAHORSE_IS_VIEW (view));
- keys = seahorse_view_get_selected_objects (view);
- enable = (keys != NULL);
- {
- GList* key_collection;
- GList* key_it;
- key_collection = keys;
- for (key_it = key_collection; key_it != NULL; key_it = key_it->next) {
- SeahorseObject* key;
- key = ((SeahorseObject*) (key_it->data));
- {
- if (seahorse_object_get_tag (key) != SEAHORSE_PGP_TYPE) {
- enable = FALSE;
- break;
- }
- }
- }
+ g_free (message);
+ g_list_free (to_delete);
+
+ return op;
+}
+
+static GObject*
+seahorse_pgp_commands_constructor (GType type, guint n_props, GObjectConstructParam *props)
+{
+ GObject *obj = G_OBJECT_CLASS (seahorse_pgp_commands_parent_class)->constructor (type, n_props, props);
+ SeahorsePgpCommands *self = NULL;
+ SeahorseCommands *base;
+ SeahorseView *view;
+
+ if (obj) {
+ self = SEAHORSE_PGP_COMMANDS (obj);
+ base = SEAHORSE_COMMANDS (self);
+
+ view = seahorse_commands_get_view (base);
+ g_return_val_if_fail (view, NULL);
+ g_signal_connect (view, "selection-changed", G_CALLBACK (on_view_selection_changed), self);
+
+ self->pv->command_actions = gtk_action_group_new ("pgp");
+ gtk_action_group_set_translation_domain (self->pv->command_actions, GETTEXT_PACKAGE);
+ gtk_action_group_add_actions (self->pv->command_actions, COMMAND_ENTRIES,
+ G_N_ELEMENTS (COMMAND_ENTRIES), self);
+
+ seahorse_view_register_commands (view, base, SEAHORSE_TYPE_PGP_KEY);
+ seahorse_view_register_commands (view, base, SEAHORSE_TYPE_PGP_UID);
+ seahorse_view_register_ui (view, UI_DEFINITION, self->pv->command_actions);
}
- gtk_action_group_set_sensitive (self->priv->_command_actions, enable);
- (keys == NULL ? NULL : (keys = (g_list_free (keys), NULL)));
-}
-
-
-SeahorsePGPCommands* seahorse_pgp_commands_new (void) {
- SeahorsePGPCommands * self;
- self = g_object_newv (SEAHORSE_PGP_TYPE_COMMANDS, 0, NULL);
- return self;
-}
-
-
-static GQuark seahorse_pgp_commands_real_get_ktype (SeahorseCommands* base) {
- SeahorsePGPCommands* self;
- self = SEAHORSE_PGP_COMMANDS (base);
- return SEAHORSE_PGP_TYPE;
-}
-
-
-static const char* seahorse_pgp_commands_real_get_ui_definition (SeahorseCommands* base) {
- SeahorsePGPCommands* self;
- self = SEAHORSE_PGP_COMMANDS (base);
- return SEAHORSE_PGP_COMMANDS_UI_DEF;
-}
-
-
-static void _seahorse_pgp_commands_on_key_sign_gtk_action_activate (GtkAction* _sender, gpointer self) {
- seahorse_pgp_commands_on_key_sign (self, _sender);
+
+ return obj;
}
+static void
+seahorse_pgp_commands_init (SeahorsePgpCommands *self)
+{
+ self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SEAHORSE_TYPE_PGP_COMMANDS, SeahorsePgpCommandsPrivate);
-static GtkActionGroup* seahorse_pgp_commands_real_get_command_actions (SeahorseCommands* base) {
- SeahorsePGPCommands* self;
- self = SEAHORSE_PGP_COMMANDS (base);
- if (self->priv->_command_actions == NULL) {
- GtkActionGroup* _tmp0;
- _tmp0 = NULL;
- self->priv->_command_actions = (_tmp0 = gtk_action_group_new ("pgp"), (self->priv->_command_actions == NULL ? NULL : (self->priv->_command_actions = (g_object_unref (self->priv->_command_actions), NULL))), _tmp0);
- gtk_action_group_set_translation_domain (self->priv->_command_actions, GETTEXT_PACKAGE);
- gtk_action_group_add_actions (self->priv->_command_actions, SEAHORSE_PGP_COMMANDS_COMMAND_ENTRIES, G_N_ELEMENTS (SEAHORSE_PGP_COMMANDS_COMMAND_ENTRIES), self);
- g_signal_connect_object (gtk_action_group_get_action (self->priv->_command_actions, "key-sign"), "activate", ((GCallback) (_seahorse_pgp_commands_on_key_sign_gtk_action_activate)), self, 0);
- }
- return self->priv->_command_actions;
}
+static void
+seahorse_pgp_commands_dispose (GObject *obj)
+{
+ SeahorsePgpCommands *self = SEAHORSE_PGP_COMMANDS (obj);
+
+ if (self->pv->command_actions)
+ g_object_unref (self->pv->command_actions);
+ self->pv->command_actions = NULL;
+
+ G_OBJECT_CLASS (seahorse_pgp_commands_parent_class)->dispose (obj);
+}
+
+static void
+seahorse_pgp_commands_finalize (GObject *obj)
+{
+ SeahorsePgpCommands *self = SEAHORSE_PGP_COMMANDS (obj);
-static void _seahorse_pgp_commands_on_view_selection_changed_seahorse_view_selection_changed (SeahorseView* _sender, gpointer self) {
- seahorse_pgp_commands_on_view_selection_changed (self, _sender);
+ g_assert (!self->pv->command_actions);
+
+ G_OBJECT_CLASS (seahorse_pgp_commands_parent_class)->finalize (obj);
}
-
-static GObject * seahorse_pgp_commands_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
- GObject * obj;
- SeahorsePGPCommandsClass * klass;
- GObjectClass * parent_class;
- SeahorsePGPCommands * self;
- klass = SEAHORSE_PGP_COMMANDS_CLASS (g_type_class_peek (SEAHORSE_PGP_TYPE_COMMANDS));
- parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
- obj = parent_class->constructor (type, n_construct_properties, construct_properties);
- self = SEAHORSE_PGP_COMMANDS (obj);
- {
- g_assert (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)) != NULL);
- g_signal_connect_object (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)), "selection-changed", ((GCallback) (_seahorse_pgp_commands_on_view_selection_changed_seahorse_view_selection_changed)), self, 0);
+static void
+seahorse_pgp_commands_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
}
- return obj;
}
-
-static void seahorse_pgp_commands_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
- SeahorsePGPCommands * self;
- self = SEAHORSE_PGP_COMMANDS (object);
- switch (property_id) {
- case SEAHORSE_PGP_COMMANDS_KTYPE:
- g_value_set_uint (value, seahorse_commands_get_ktype (SEAHORSE_COMMANDS (self)));
- break;
- case SEAHORSE_PGP_COMMANDS_UI_DEFINITION:
- g_value_set_string (value, seahorse_commands_get_ui_definition (SEAHORSE_COMMANDS (self)));
- break;
- case SEAHORSE_PGP_COMMANDS_COMMAND_ACTIONS:
- g_value_set_object (value, seahorse_commands_get_command_actions (SEAHORSE_COMMANDS (self)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+static void
+seahorse_pgp_commands_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
}
}
-
-static void seahorse_pgp_commands_class_init (SeahorsePGPCommandsClass * klass) {
+static void
+seahorse_pgp_commands_class_init (SeahorsePgpCommandsClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
seahorse_pgp_commands_parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (SeahorsePGPCommandsPrivate));
- G_OBJECT_CLASS (klass)->get_property = seahorse_pgp_commands_get_property;
- G_OBJECT_CLASS (klass)->constructor = seahorse_pgp_commands_constructor;
- G_OBJECT_CLASS (klass)->finalize = seahorse_pgp_commands_finalize;
- SEAHORSE_COMMANDS_CLASS (klass)->show_properties = seahorse_pgp_commands_real_show_properties;
- SEAHORSE_COMMANDS_CLASS (klass)->delete_objects = seahorse_pgp_commands_real_delete_objects;
- SEAHORSE_COMMANDS_CLASS (klass)->get_ktype = seahorse_pgp_commands_real_get_ktype;
- SEAHORSE_COMMANDS_CLASS (klass)->get_ui_definition = seahorse_pgp_commands_real_get_ui_definition;
- SEAHORSE_COMMANDS_CLASS (klass)->get_command_actions = seahorse_pgp_commands_real_get_command_actions;
- g_object_class_override_property (G_OBJECT_CLASS (klass), SEAHORSE_PGP_COMMANDS_KTYPE, "ktype");
- g_object_class_override_property (G_OBJECT_CLASS (klass), SEAHORSE_PGP_COMMANDS_UI_DEFINITION, "ui-definition");
- g_object_class_override_property (G_OBJECT_CLASS (klass), SEAHORSE_PGP_COMMANDS_COMMAND_ACTIONS, "command-actions");
- {
- /* Register this class as a commands */
- seahorse_registry_register_type (seahorse_registry_get (), SEAHORSE_PGP_TYPE_COMMANDS, SEAHORSE_PGP_TYPE_STR, "commands", NULL, NULL);
- }
-}
+ g_type_class_add_private (klass, sizeof (SeahorsePgpCommandsPrivate));
-
-static void seahorse_pgp_commands_instance_init (SeahorsePGPCommands * self) {
- self->priv = SEAHORSE_PGP_COMMANDS_GET_PRIVATE (self);
- self->priv->_command_actions = NULL;
+ gobject_class->constructor = seahorse_pgp_commands_constructor;
+ gobject_class->dispose = seahorse_pgp_commands_dispose;
+ gobject_class->finalize = seahorse_pgp_commands_finalize;
+ gobject_class->set_property = seahorse_pgp_commands_set_property;
+ gobject_class->get_property = seahorse_pgp_commands_get_property;
+
+ SEAHORSE_COMMANDS_CLASS (klass)->show_properties = seahorse_pgp_commands_show_properties;
+ SEAHORSE_COMMANDS_CLASS (klass)->delete_objects = seahorse_pgp_commands_delete_objects;
+
+ /* Register this class as a commands */
+ seahorse_registry_register_type (seahorse_registry_get (), SEAHORSE_TYPE_PGP_COMMANDS,
+ SEAHORSE_PGP_TYPE_STR, "commands", NULL, NULL);
}
+/* -----------------------------------------------------------------------------
+ * PUBLIC
+ */
-static void seahorse_pgp_commands_finalize (GObject * obj) {
- SeahorsePGPCommands * self;
- self = SEAHORSE_PGP_COMMANDS (obj);
- (self->priv->_command_actions == NULL ? NULL : (self->priv->_command_actions = (g_object_unref (self->priv->_command_actions), NULL)));
- G_OBJECT_CLASS (seahorse_pgp_commands_parent_class)->finalize (obj);
+SeahorsePgpCommands*
+seahorse_pgp_commands_new (void)
+{
+ return g_object_new (SEAHORSE_TYPE_PGP_COMMANDS, NULL);
}
-
-
-GType seahorse_pgp_commands_get_type (void) {
- static GType seahorse_pgp_commands_type_id = 0;
- if (seahorse_pgp_commands_type_id == 0) {
- static const GTypeInfo g_define_type_info = { sizeof (SeahorsePGPCommandsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_pgp_commands_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorsePGPCommands), 0, (GInstanceInitFunc) seahorse_pgp_commands_instance_init };
- seahorse_pgp_commands_type_id = g_type_register_static (SEAHORSE_TYPE_COMMANDS, "SeahorsePGPCommands", &g_define_type_info, 0);
- }
- return seahorse_pgp_commands_type_id;
-}
-
-
-
-
Modified: trunk/pgp/seahorse-pgp-commands.h
==============================================================================
--- trunk/pgp/seahorse-pgp-commands.h (original)
+++ trunk/pgp/seahorse-pgp-commands.h Sat Dec 13 19:29:44 2008
@@ -24,41 +24,35 @@
#include <glib.h>
#include <glib-object.h>
-#include <seahorse-commands.h>
-#include <seahorse-object.h>
-#include <seahorse-operation.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
+#include "seahorse-commands.h"
+#include "seahorse-object.h"
+#include <seahorse-operation.h>
-#define SEAHORSE_PGP_TYPE_COMMANDS (seahorse_pgp_commands_get_type ())
-#define SEAHORSE_PGP_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_PGP_TYPE_COMMANDS, SeahorsePGPCommands))
-#define SEAHORSE_PGP_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_PGP_TYPE_COMMANDS, SeahorsePGPCommandsClass))
-#define SEAHORSE_PGP_IS_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_PGP_TYPE_COMMANDS))
-#define SEAHORSE_PGP_IS_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_PGP_TYPE_COMMANDS))
-#define SEAHORSE_PGP_COMMANDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_PGP_TYPE_COMMANDS, SeahorsePGPCommandsClass))
-typedef struct _SeahorsePGPCommands SeahorsePGPCommands;
-typedef struct _SeahorsePGPCommandsClass SeahorsePGPCommandsClass;
-typedef struct _SeahorsePGPCommandsPrivate SeahorsePGPCommandsPrivate;
+#define SEAHORSE_TYPE_PGP_COMMANDS (seahorse_pgp_commands_get_type ())
+#define SEAHORSE_PGP_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_PGP_COMMANDS, SeahorsePgpCommands))
+#define SEAHORSE_PGP_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_PGP_COMMANDS, SeahorsePgpCommandsClass))
+#define SEAHORSE_IS_PGP_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_PGP_COMMANDS))
+#define SEAHORSE_IS_PGP_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_PGP_COMMANDS))
+#define SEAHORSE_PGP_COMMANDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_PGP_COMMANDS, SeahorsePgpCommandsClass))
+
+typedef struct _SeahorsePgpCommands SeahorsePgpCommands;
+typedef struct _SeahorsePgpCommandsClass SeahorsePgpCommandsClass;
+typedef struct _SeahorsePgpCommandsPrivate SeahorsePgpCommandsPrivate;
-struct _SeahorsePGPCommands {
+struct _SeahorsePgpCommands {
SeahorseCommands parent_instance;
- SeahorsePGPCommandsPrivate * priv;
+ SeahorsePgpCommandsPrivate *pv;
};
-struct _SeahorsePGPCommandsClass {
+struct _SeahorsePgpCommandsClass {
SeahorseCommandsClass parent_class;
};
+GType seahorse_pgp_commands_get_type (void);
-SeahorsePGPCommands* seahorse_pgp_commands_new (void);
-GType seahorse_pgp_commands_get_type (void);
-
+SeahorsePgpCommands* seahorse_pgp_commands_new (void);
-G_END_DECLS
#endif
Modified: trunk/pgp/seahorse-pgp-module.c
==============================================================================
--- trunk/pgp/seahorse-pgp-module.c (original)
+++ trunk/pgp/seahorse-pgp-module.c Sat Dec 13 19:29:44 2008
@@ -46,7 +46,7 @@
seahorse_context_take_source (NULL, source);
g_type_class_unref (g_type_class_ref (SEAHORSE_TYPE_PGP_SOURCE));
- g_type_class_unref (g_type_class_ref (SEAHORSE_PGP_TYPE_COMMANDS));
+ g_type_class_unref (g_type_class_ref (SEAHORSE_TYPE_PGP_COMMANDS));
g_type_class_unref (g_type_class_ref (SEAHORSE_PGP_TYPE_GENERATOR));
#ifdef WITH_LDAP
g_type_class_unref (g_type_class_ref (SEAHORSE_TYPE_LDAP_SOURCE));
Modified: trunk/pkcs11/seahorse-pkcs11-commands.c
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-commands.c (original)
+++ trunk/pkcs11/seahorse-pkcs11-commands.c Sat Dec 13 19:29:44 2008
@@ -33,10 +33,7 @@
#include "libcryptui/crui-x509-cert-dialog.h"
enum {
- PROP_0,
- PROP_KTYPE,
- PROP_UI_DEFINITION,
- PROP_COMMAND_ACTIONS
+ PROP_0
};
struct _SeahorsePkcs11CommandsPrivate {
@@ -97,7 +94,7 @@
seahorse_pkcs11_commands_delete_objects (SeahorseCommands *cmds, GList *objects)
{
gchar *prompt;
- gchar *display;
+ const gchar *display;
gboolean ret;
guint num;
@@ -108,7 +105,6 @@
if (num == 1) {
display = seahorse_object_get_label (SEAHORSE_OBJECT (objects->data));
prompt = g_strdup_printf (_("Are you sure you want to delete the certificate '%s'?"), display);
- g_free (display);
} else {
prompt = g_strdup_printf (_("Are you sure you want to delete %d secure shell keys?"), num);
}
@@ -122,24 +118,28 @@
return NULL;
}
-static GQuark
-seahorse_pkcs11_commands_get_ktype (SeahorseCommands *base)
+static GObject*
+seahorse_pkcs11_commands_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
- return SEAHORSE_PKCS11_TYPE;
-}
-
-static const char*
-seahorse_pkcs11_commands_get_ui_definition (SeahorseCommands *base)
-{
- return "";
-}
-
-static GtkActionGroup*
-seahorse_pkcs11_commands_get_command_actions (SeahorseCommands *base)
-{
- SeahorsePkcs11Commands *self = SEAHORSE_PKCS11_COMMANDS (base);
- SeahorsePkcs11CommandsPrivate *pv = SEAHORSE_PKCS11_COMMANDS_GET_PRIVATE (self);
- return pv->action_group;
+ GObject *obj = G_OBJECT_CLASS (seahorse_pkcs11_commands_parent_class)->constructor (type, n_props, props);
+ SeahorsePkcs11CommandsPrivate *pv;
+ SeahorsePkcs11Commands *self = NULL;
+ SeahorseCommands *base;
+ SeahorseView *view;
+
+ if (obj) {
+ pv = SEAHORSE_PKCS11_COMMANDS_GET_PRIVATE (self);
+ self = SEAHORSE_PKCS11_COMMANDS (obj);
+ base = SEAHORSE_COMMANDS (self);
+
+ view = seahorse_commands_get_view (base);
+ g_return_val_if_fail (view, NULL);
+
+ seahorse_view_register_commands (view, base, SEAHORSE_PKCS11_TYPE_CERTIFICATE);
+ seahorse_view_register_ui (view, "", pv->action_group);
+ }
+
+ return obj;
}
static void
@@ -188,18 +188,7 @@
seahorse_pkcs11_commands_get_property (GObject *obj, guint prop_id, GValue *value,
GParamSpec *pspec)
{
- SeahorseCommands *base = SEAHORSE_COMMANDS (obj);
-
switch (prop_id) {
- case PROP_KTYPE:
- g_value_set_uint (value, seahorse_pkcs11_commands_get_ktype (base));
- break;
- case PROP_UI_DEFINITION:
- g_value_set_string (value, seahorse_pkcs11_commands_get_ui_definition (base));
- break;
- case PROP_COMMAND_ACTIONS:
- g_value_set_object (value, seahorse_pkcs11_commands_get_command_actions (base));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -222,13 +211,6 @@
cmd_class->show_properties = seahorse_pkcs11_commands_show_properties;
cmd_class->delete_objects = seahorse_pkcs11_commands_delete_objects;
- cmd_class->get_ktype = seahorse_pkcs11_commands_get_ktype;
- cmd_class->get_ui_definition = seahorse_pkcs11_commands_get_ui_definition;
- cmd_class->get_command_actions = seahorse_pkcs11_commands_get_command_actions;
-
- g_object_class_override_property (gobject_class, PROP_KTYPE, "ktype");
- g_object_class_override_property (gobject_class, PROP_UI_DEFINITION, "ui-definition");
- g_object_class_override_property (gobject_class, PROP_COMMAND_ACTIONS, "command-actions");
slot_certificate_window = g_quark_from_static_string ("seahorse-pkcs11-commands-window");
Modified: trunk/pkcs11/vala-build.stamp
==============================================================================
--- trunk/pkcs11/vala-build.stamp (original)
+++ trunk/pkcs11/vala-build.stamp Sat Dec 13 19:29:44 2008
@@ -1 +1 @@
-1228006941
+1229196582
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Sat Dec 13 19:29:44 2008
@@ -53,7 +53,7 @@
pgp/seahorse-ldap-source.c
pgp/seahorse-pgp-add-subkey.c
pgp/seahorse-pgp-add-uid.c
-pgp/seahorse-pgp-commands.vala
+pgp/seahorse-pgp-commands.c
pgp/seahorse-pgp-expires.c
pgp/seahorse-pgp-generate.c
pgp/seahorse-pgp-generate.glade
@@ -89,7 +89,7 @@
src/seahorse-keyserver-sync.glade
src/seahorse-viewer.c
ssh/seahorse-ssh-askpass.c
-ssh/seahorse-ssh-commands.vala
+ssh/seahorse-ssh-commands.c
ssh/seahorse-ssh-generate.c
ssh/seahorse-ssh-generate.glade
ssh/seahorse-ssh-generator.vala
Modified: trunk/po/POTFILES.skip
==============================================================================
--- trunk/po/POTFILES.skip (original)
+++ trunk/po/POTFILES.skip Sat Dec 13 19:29:44 2008
@@ -1,10 +1,8 @@
daemon/seahorse-daemon.desktop.in
libcryptui/crui-x509-cert-basics.ui
pkcs11/seahorse-pkcs11-source.c
-pgp/seahorse-pgp-commands.c
pgp/seahorse-pgp-generator.c
src/seahorse.desktop.in
src/seahorse-key-manager.c
src/seahorse-keyserver-results.c
-ssh/seahorse-ssh-commands.c
ssh/seahorse-ssh-generator.c
Modified: trunk/src/seahorse-viewer.c
==============================================================================
--- trunk/src/seahorse-viewer.c (original)
+++ trunk/src/seahorse-viewer.c Sat Dec 13 19:29:44 2008
@@ -29,6 +29,7 @@
#include "seahorse-view.h"
#include "seahorse-viewer.h"
+#include "common/seahorse-object-list.h"
#include "common/seahorse-registry.h"
#include <glib/gi18n-lib.h>
@@ -45,6 +46,7 @@
GtkUIManager *ui_manager;
GtkActionGroup *object_actions;
GtkActionGroup *export_actions;
+ GList *all_commands;
GHashTable *commands;
};
@@ -350,7 +352,7 @@
g_return_if_fail (objects != NULL);
g_assert (objects != NULL);
- commands = g_hash_table_lookup (pv->commands, GINT_TO_POINTER (seahorse_object_get_tag (objects->data)));
+ commands = g_hash_table_lookup (pv->commands, GINT_TO_POINTER (G_OBJECT_TYPE (objects->data)));
if (commands == NULL)
return;
@@ -558,27 +560,10 @@
for (l = types; l; l = g_list_next (l)) {
GType typ = GPOINTER_TO_INT (l->data);
SeahorseCommands *commands;
- GtkActionGroup *actions;
- const gchar *uidef;
- /* Add each commands to our hash table */
commands = g_object_new (typ, "view", self, NULL);
- g_hash_table_insert (pv->commands, GINT_TO_POINTER (seahorse_commands_get_ktype (commands)), commands);
-
- actions = seahorse_commands_get_command_actions (commands);
- if (actions != NULL)
- seahorse_viewer_include_actions (self, actions);
- g_object_unref (actions);
-
- uidef = seahorse_commands_get_ui_definition (commands);
- if (uidef && uidef[0]) {
- if (!gtk_ui_manager_add_ui_from_string (pv->ui_manager, uidef, -1, &error)) {
- g_warning ("couldn't load UI description from commands: %s: %s", G_OBJECT_TYPE_NAME(commands), error->message);
- g_clear_error (&error);
- }
- }
-
-
+ pv->all_commands = seahorse_object_list_prepend (pv->all_commands, commands);
+ g_object_unref (commands);
}
}
@@ -594,9 +579,7 @@
pv->ui_manager = gtk_ui_manager_new ();
g_signal_connect (pv->ui_manager, "add-widget", G_CALLBACK (on_add_widget), self);
- pv->commands = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
-
-
+ pv->commands = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
}
static void
@@ -617,9 +600,12 @@
pv->export_actions = NULL;
if (pv->commands)
- g_hash_table_unref (pv->commands);
+ g_hash_table_destroy (pv->commands);
pv->commands = NULL;
+ seahorse_object_list_free (pv->all_commands);
+ pv->all_commands = NULL;
+
G_OBJECT_CLASS (seahorse_viewer_parent_class)->dispose (obj);
}
@@ -710,6 +696,8 @@
iface->set_selected = (gpointer)seahorse_viewer_set_selected;
iface->get_current_set = (gpointer)seahorse_viewer_get_current_set;
iface->get_window = (gpointer)seahorse_viewer_get_window;
+ iface->register_ui = (gpointer)seahorse_viewer_register_ui;
+ iface->register_commands = (gpointer)seahorse_viewer_register_commands;
}
/* -----------------------------------------------------------------------------
@@ -786,7 +774,7 @@
g_return_if_fail (SEAHORSE_IS_VIEWER (self));
g_return_if_fail (SEAHORSE_IS_OBJECT (obj));
- commands = SEAHORSE_COMMANDS (g_hash_table_lookup (pv->commands, GINT_TO_POINTER (seahorse_object_get_tag (obj))));
+ commands = SEAHORSE_COMMANDS (g_hash_table_lookup (pv->commands, GINT_TO_POINTER (G_OBJECT_TYPE (obj))));
if (commands != NULL)
seahorse_commands_show_properties (commands, obj);
}
@@ -854,3 +842,31 @@
g_return_val_if_fail (SEAHORSE_IS_VIEWER (self), NULL);
return GTK_WINDOW (seahorse_widget_get_toplevel (SEAHORSE_WIDGET (self)));
}
+
+void
+seahorse_viewer_register_ui (SeahorseViewer *self, const gchar *uidef, GtkActionGroup *actions)
+{
+ SeahorseViewerPrivate *pv = SEAHORSE_VIEWER_GET_PRIVATE (self);
+ GError *error = NULL;
+
+ g_return_if_fail (SEAHORSE_IS_VIEWER (self));
+
+ if (actions != NULL)
+ seahorse_viewer_include_actions (self, actions);
+
+ if (uidef && uidef[0]) {
+ if (!gtk_ui_manager_add_ui_from_string (pv->ui_manager, uidef, -1, &error)) {
+ g_warning ("couldn't load UI description: %s", error->message);
+ g_clear_error (&error);
+ }
+ }
+}
+
+void
+seahorse_viewer_register_commands (SeahorseViewer *self, SeahorseCommands *commands, GType for_type)
+{
+ SeahorseViewerPrivate *pv = SEAHORSE_VIEWER_GET_PRIVATE (self);
+ g_return_if_fail (SEAHORSE_IS_VIEWER (self));
+ g_return_if_fail (SEAHORSE_IS_COMMANDS (commands));
+ g_hash_table_insert (pv->commands, GUINT_TO_POINTER (for_type), g_object_ref (commands));
+}
Modified: trunk/src/seahorse-viewer.h
==============================================================================
--- trunk/src/seahorse-viewer.h (original)
+++ trunk/src/seahorse-viewer.h Sat Dec 13 19:29:44 2008
@@ -104,4 +104,12 @@
GtkWindow* seahorse_viewer_get_window (SeahorseViewer* self);
+void seahorse_viewer_register_ui (SeahorseViewer *self,
+ const gchar *uidef,
+ GtkActionGroup *actions);
+
+void seahorse_viewer_register_commands (SeahorseViewer *self,
+ SeahorseCommands *commands,
+ GType for_type);
+
#endif /* __SEAHORSE_VIEWER_H__ */
Modified: trunk/ssh/Makefile.am
==============================================================================
--- trunk/ssh/Makefile.am (original)
+++ trunk/ssh/Makefile.am Sat Dec 13 19:29:44 2008
@@ -19,7 +19,6 @@
VALA_SRCS = \
seahorse-ssh.vala \
- seahorse-ssh-commands.vala \
seahorse-ssh-generator.vala
VALA_VAPIS = \
@@ -45,6 +44,7 @@
libseahorse_ssh_la_SOURCES = \
seahorse-ssh-module.c seahorse-ssh-module.h \
seahorse-algo.c seahorse-algo.h \
+ seahorse-ssh-commands.c seahorse-ssh-commands.h \
seahorse-ssh-dialogs.h \
seahorse-ssh-generate.c \
seahorse-ssh-key-data.c seahorse-ssh-key-data.h \
Modified: trunk/ssh/seahorse-ssh-commands.c
==============================================================================
--- trunk/ssh/seahorse-ssh-commands.c (original)
+++ trunk/ssh/seahorse-ssh-commands.c Sat Dec 13 19:29:44 2008
@@ -19,267 +19,245 @@
* 02111-1307, USA.
*/
-#include "seahorse-ssh-commands.h"
-#include <glib/gi18n-lib.h>
-#include <seahorse-ssh-dialogs.h>
-#include <seahorse-ssh-key.h>
-#include <seahorse-view.h>
-#include <seahorse-util.h>
-#include <seahorse-source.h>
-#include <seahorse-types.h>
-#include <config.h>
-#include <common/seahorse-registry.h>
-#include "seahorse-ssh.h"
+#include "config.h"
+#include <glib/gi18n.h>
+
+#include "seahorse-ssh.h"
+#include "seahorse-ssh-commands.h"
+#include "seahorse-ssh-dialogs.h"
+#include "common/seahorse-registry.h"
+#include "seahorse-object.h"
+#include "seahorse-util.h"
-struct _SeahorseSSHCommandsPrivate {
- GtkActionGroup* _command_actions;
+enum {
+ PROP_0
};
-#define SEAHORSE_SSH_COMMANDS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SEAHORSE_SSH_TYPE_COMMANDS, SeahorseSSHCommandsPrivate))
-enum {
- SEAHORSE_SSH_COMMANDS_DUMMY_PROPERTY,
- SEAHORSE_SSH_COMMANDS_KTYPE,
- SEAHORSE_SSH_COMMANDS_UI_DEFINITION,
- SEAHORSE_SSH_COMMANDS_COMMAND_ACTIONS
+struct _SeahorseSshCommandsPrivate {
+ GtkActionGroup* command_actions;
};
-static void seahorse_ssh_commands_real_show_properties (SeahorseCommands* base, SeahorseObject* key);
-static SeahorseOperation* seahorse_ssh_commands_real_delete_objects (SeahorseCommands* base, GList* keys);
-static void seahorse_ssh_commands_on_ssh_upload (SeahorseSSHCommands* self, GtkAction* action);
-static void seahorse_ssh_commands_on_view_selection_changed (SeahorseSSHCommands* self, SeahorseView* view);
-static void _seahorse_ssh_commands_on_ssh_upload_gtk_action_activate (GtkAction* _sender, gpointer self);
-static void _seahorse_ssh_commands_on_view_selection_changed_seahorse_view_selection_changed (SeahorseView* _sender, gpointer self);
-static GObject * seahorse_ssh_commands_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
-static gpointer seahorse_ssh_commands_parent_class = NULL;
-static void seahorse_ssh_commands_finalize (GObject * obj);
-
-static const GtkActionEntry SEAHORSE_SSH_COMMANDS_COMMAND_ENTRIES[] = {{"remote-ssh-upload", NULL, N_ ("Configure Key for _Secure Shell..."), "", N_ ("Send public Secure Shell key to another machine, and enable logins using that key."), ((GCallback) (NULL))}};
-static const char* SEAHORSE_SSH_COMMANDS_UI_DEF = "\n\t\t\t<ui>\n\t\t\t\n\t\t\t<menubar>\n\t\t\t\t<menu name='Remote' action='remote-menu'>\n\t\t\t\t\t<menuitem action='remote-ssh-upload'/>\n\t\t\t\t</menu>\n\t\t\t</menubar>\n\t\t\t\n\t\t\t<popup name=\"KeyPopup\">\n\t\t\t\t<menuitem action=\"remote-ssh-upload\"/>\n\t\t\t</popup>\n\t\t\t\n\t\t\t</ui>\n\t\t";
-
-
-static void seahorse_ssh_commands_real_show_properties (SeahorseCommands* base, SeahorseObject* key) {
- SeahorseSSHCommands * self;
- self = SEAHORSE_SSH_COMMANDS (base);
- g_return_if_fail (SEAHORSE_IS_OBJECT (key));
- g_return_if_fail (seahorse_object_get_tag (key) == SEAHORSE_SSH_TYPE);
- seahorse_ssh_key_properties_show (SEAHORSE_SSH_KEY (key), seahorse_view_get_window (seahorse_commands_get_view (SEAHORSE_COMMANDS (self))));
-}
+G_DEFINE_TYPE (SeahorseSshCommands, seahorse_ssh_commands, SEAHORSE_TYPE_COMMANDS);
+
+static const char* UI_DEFINITION = ""\
+"<ui>"\
+" <menubar>"\
+" <menu name='Remote' action='remote-menu'>"\
+" <menuitem action='remote-ssh-upload'/>"\
+" </menu>"\
+" </menubar>"\
+" <popup name='KeyPopup'>"\
+" <menuitem action='remote-ssh-upload'/>"\
+" </popup>"\
+"</ui>";
-static SeahorseOperation* seahorse_ssh_commands_real_delete_objects (SeahorseCommands* base, GList* keys) {
- SeahorseSSHCommands * self;
- guint num;
- char* prompt;
- SeahorseOperation* _tmp4;
- self = SEAHORSE_SSH_COMMANDS (base);
- g_return_val_if_fail (keys != NULL, NULL);
- num = g_list_length (keys);
- if (num == 0) {
- return NULL;
- }
- prompt = NULL;
- if (num == 1) {
- char* _tmp1;
- _tmp1 = NULL;
- prompt = (_tmp1 = g_strdup_printf (_ ("Are you sure you want to delete the secure shell key '%s'?"), seahorse_object_get_label (((SeahorseObject*) (((SeahorseObject*) (keys->data)))))), (prompt = (g_free (prompt), NULL)), _tmp1);
- } else {
- char* _tmp2;
- _tmp2 = NULL;
- prompt = (_tmp2 = g_strdup_printf (_ ("Are you sure you want to delete %d secure shell keys?"), num), (prompt = (g_free (prompt), NULL)), _tmp2);
- }
- if (!seahorse_util_prompt_delete (prompt, NULL)) {
- SeahorseOperation* _tmp3;
- _tmp3 = NULL;
- return (_tmp3 = NULL, (prompt = (g_free (prompt), NULL)), _tmp3);
- }
- _tmp4 = NULL;
- return (_tmp4 = seahorse_source_delete_objects (keys), (prompt = (g_free (prompt), NULL)), _tmp4);
-}
+/* -----------------------------------------------------------------------------
+ * INTERNAL
+ */
-static void seahorse_ssh_commands_on_ssh_upload (SeahorseSSHCommands* self, GtkAction* action) {
+static void
+on_ssh_upload (GtkAction* action, SeahorseSshCommands* self)
+{
GList* ssh_keys;
- GList* keys;
- g_return_if_fail (SEAHORSE_SSH_IS_COMMANDS (self));
+ GList* keys, *l;
+
+ g_return_if_fail (SEAHORSE_IS_SSH_COMMANDS (self));
g_return_if_fail (GTK_IS_ACTION (action));
+
ssh_keys = NULL;
keys = seahorse_view_get_selected_objects (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)));
- {
- GList* key_collection;
- GList* key_it;
- key_collection = keys;
- for (key_it = key_collection; key_it != NULL; key_it = key_it->next) {
- SeahorseObject* key;
- key = ((SeahorseObject*) (key_it->data));
- {
- if (seahorse_object_get_tag (key) == SEAHORSE_SSH_TYPE && seahorse_object_get_usage (key) == SEAHORSE_USAGE_PRIVATE_KEY) {
- ssh_keys = g_list_append (ssh_keys, SEAHORSE_SSH_KEY (key));
- }
- }
- }
- }
- seahorse_ssh_upload_prompt (keys, seahorse_view_get_window (seahorse_commands_get_view (SEAHORSE_COMMANDS (self))));
- (ssh_keys == NULL ? NULL : (ssh_keys = (g_list_free (ssh_keys), NULL)));
- (keys == NULL ? NULL : (keys = (g_list_free (keys), NULL)));
-}
-
-
-static void seahorse_ssh_commands_on_view_selection_changed (SeahorseSSHCommands* self, SeahorseView* view) {
- GList* keys;
+
+ for (l = keys; l; l = g_list_next (l)) {
+ SeahorseObject* key = SEAHORSE_OBJECT (l->data);
+ if (seahorse_object_get_tag (key) == SEAHORSE_SSH_TYPE &&
+ seahorse_object_get_usage (key) == SEAHORSE_USAGE_PRIVATE_KEY)
+ ssh_keys = g_list_append (ssh_keys, SEAHORSE_SSH_KEY (key));
+ }
+
+ seahorse_ssh_upload_prompt (ssh_keys, seahorse_commands_get_window (SEAHORSE_COMMANDS (self)));
+ g_list_free (keys);
+}
+
+static void
+on_view_selection_changed (SeahorseView* view, SeahorseSshCommands* self)
+{
+ GList* keys, *l;
gboolean enable;
- g_return_if_fail (SEAHORSE_SSH_IS_COMMANDS (self));
+
+ g_return_if_fail (SEAHORSE_IS_SSH_COMMANDS (self));
g_return_if_fail (SEAHORSE_IS_VIEW (view));
+
keys = seahorse_view_get_selected_objects (view);
enable = (keys != NULL);
- {
- GList* key_collection;
- GList* key_it;
- key_collection = keys;
- for (key_it = key_collection; key_it != NULL; key_it = key_it->next) {
- SeahorseObject* key;
- key = ((SeahorseObject*) (key_it->data));
- {
- if (seahorse_object_get_tag (key) != SEAHORSE_SSH_TYPE || seahorse_object_get_usage (key) != SEAHORSE_USAGE_PRIVATE_KEY) {
- enable = FALSE;
- break;
- }
- }
+
+ for (l = keys; l; l = g_list_next (l)) {
+ SeahorseObject* key = SEAHORSE_OBJECT (l->data);
+ if (seahorse_object_get_tag (key) != SEAHORSE_SSH_TYPE ||
+ seahorse_object_get_usage (key) != SEAHORSE_USAGE_PRIVATE_KEY) {
+ enable = FALSE;
+ break;
}
}
- gtk_action_group_set_sensitive (self->priv->_command_actions, enable);
- (keys == NULL ? NULL : (keys = (g_list_free (keys), NULL)));
-}
-
-SeahorseSSHCommands* seahorse_ssh_commands_new (void) {
- SeahorseSSHCommands * self;
- self = g_object_newv (SEAHORSE_SSH_TYPE_COMMANDS, 0, NULL);
- return self;
+ gtk_action_group_set_sensitive (self->pv->command_actions, enable);
+ g_list_free (keys);
}
+static const GtkActionEntry COMMAND_ENTRIES[] = {
+ { "remote-ssh-upload", NULL, N_ ("Configure Key for _Secure Shell..."), "",
+ N_ ("Send public Secure Shell key to another machine, and enable logins using that key."),
+ G_CALLBACK (on_ssh_upload) }
+};
-static GQuark seahorse_ssh_commands_real_get_ktype (SeahorseCommands* base) {
- SeahorseSSHCommands* self;
- self = SEAHORSE_SSH_COMMANDS (base);
- return SEAHORSE_SSH_TYPE;
-}
-
-
-static const char* seahorse_ssh_commands_real_get_ui_definition (SeahorseCommands* base) {
- SeahorseSSHCommands* self;
- self = SEAHORSE_SSH_COMMANDS (base);
- return SEAHORSE_SSH_COMMANDS_UI_DEF;
-}
-
+/* -----------------------------------------------------------------------------
+ * OBJECT
+ */
-static void _seahorse_ssh_commands_on_ssh_upload_gtk_action_activate (GtkAction* _sender, gpointer self) {
- seahorse_ssh_commands_on_ssh_upload (self, _sender);
+static void
+seahorse_ssh_commands_show_properties (SeahorseCommands* base, SeahorseObject* obj)
+{
+ g_return_if_fail (SEAHORSE_IS_OBJECT (obj));
+ g_return_if_fail (seahorse_object_get_tag (obj) == SEAHORSE_SSH_TYPE);
+ g_return_if_fail (G_TYPE_FROM_INSTANCE (G_OBJECT (obj)) == SEAHORSE_SSH_TYPE_KEY);
+
+ seahorse_ssh_key_properties_show (SEAHORSE_SSH_KEY (obj), seahorse_commands_get_window (base));
}
+static SeahorseOperation*
+seahorse_ssh_commands_delete_objects (SeahorseCommands* base, GList* objects)
+{
+ SeahorseOperation* op = NULL;
+ guint num;
+ gchar* prompt;
-static GtkActionGroup* seahorse_ssh_commands_real_get_command_actions (SeahorseCommands* base) {
- SeahorseSSHCommands* self;
- self = SEAHORSE_SSH_COMMANDS (base);
- if (self->priv->_command_actions == NULL) {
- GtkActionGroup* _tmp0;
- _tmp0 = NULL;
- self->priv->_command_actions = (_tmp0 = gtk_action_group_new ("ssh"), (self->priv->_command_actions == NULL ? NULL : (self->priv->_command_actions = (g_object_unref (self->priv->_command_actions), NULL))), _tmp0);
- gtk_action_group_set_translation_domain (self->priv->_command_actions, GETTEXT_PACKAGE);
- gtk_action_group_add_actions (self->priv->_command_actions, SEAHORSE_SSH_COMMANDS_COMMAND_ENTRIES, G_N_ELEMENTS (SEAHORSE_SSH_COMMANDS_COMMAND_ENTRIES), self);
- g_signal_connect_object (gtk_action_group_get_action (self->priv->_command_actions, "remote-ssh-upload"), "activate", ((GCallback) (_seahorse_ssh_commands_on_ssh_upload_gtk_action_activate)), self, 0);
+ num = g_list_length (objects);
+ if (num == 0) {
+ return NULL;
+ } else if (num == 1) {
+ prompt = g_strdup_printf (_("Are you sure you want to delete the secure shell key '%s'?"),
+ seahorse_object_get_label (objects->data));
+ } else {
+ prompt = g_strdup_printf (_("Are you sure you want to delete %d secure shell keys?"), num);
}
- return self->priv->_command_actions;
+
+ if (seahorse_util_prompt_delete (prompt, NULL))
+ op = seahorse_source_delete_objects (objects);
+
+ g_free (prompt);
+ return op;
+}
+
+static GObject*
+seahorse_ssh_commands_constructor (GType type, guint n_props, GObjectConstructParam *props)
+{
+ GObject *obj = G_OBJECT_CLASS (seahorse_ssh_commands_parent_class)->constructor (type, n_props, props);
+ SeahorseSshCommands *self = NULL;
+ SeahorseCommands *base;
+ SeahorseView *view;
+
+ if (obj) {
+ self = SEAHORSE_SSH_COMMANDS (obj);
+ base = SEAHORSE_COMMANDS (obj);
+
+ view = seahorse_commands_get_view (SEAHORSE_COMMANDS (self));
+ g_return_val_if_fail (view, NULL);
+ g_signal_connect (view, "selection-changed", G_CALLBACK (on_view_selection_changed), self);
+
+ self->pv->command_actions = gtk_action_group_new ("ssh");
+ gtk_action_group_set_translation_domain (self->pv->command_actions, GETTEXT_PACKAGE);
+ gtk_action_group_add_actions (self->pv->command_actions, COMMAND_ENTRIES,
+ G_N_ELEMENTS (COMMAND_ENTRIES), self);
+
+ seahorse_view_register_commands (view, base, SEAHORSE_TYPE_SSH_KEY);
+ seahorse_view_register_ui (view, UI_DEFINITION, self->pv->command_actions);
+ }
+
+ return obj;
}
+static void
+seahorse_ssh_commands_init (SeahorseSshCommands *self)
+{
+ self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SEAHORSE_TYPE_SSH_COMMANDS, SeahorseSshCommandsPrivate);
-static void _seahorse_ssh_commands_on_view_selection_changed_seahorse_view_selection_changed (SeahorseView* _sender, gpointer self) {
- seahorse_ssh_commands_on_view_selection_changed (self, _sender);
}
+static void
+seahorse_ssh_commands_dispose (GObject *obj)
+{
+ SeahorseSshCommands *self = SEAHORSE_SSH_COMMANDS (obj);
+
+ if (self->pv->command_actions)
+ g_object_unref (self->pv->command_actions);
+ self->pv->command_actions = NULL;
+
+ G_OBJECT_CLASS (seahorse_ssh_commands_parent_class)->dispose (obj);
+}
+
+static void
+seahorse_ssh_commands_finalize (GObject *obj)
+{
+ SeahorseSshCommands *self = SEAHORSE_SSH_COMMANDS (obj);
-static GObject * seahorse_ssh_commands_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
- GObject * obj;
- SeahorseSSHCommandsClass * klass;
- GObjectClass * parent_class;
- SeahorseSSHCommands * self;
- klass = SEAHORSE_SSH_COMMANDS_CLASS (g_type_class_peek (SEAHORSE_SSH_TYPE_COMMANDS));
- parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
- obj = parent_class->constructor (type, n_construct_properties, construct_properties);
- self = SEAHORSE_SSH_COMMANDS (obj);
- {
- g_assert (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)) != NULL);
- g_signal_connect_object (seahorse_commands_get_view (SEAHORSE_COMMANDS (self)), "selection-changed", ((GCallback) (_seahorse_ssh_commands_on_view_selection_changed_seahorse_view_selection_changed)), self, 0);
- }
- return obj;
+ g_assert (!self->pv->command_actions);
+
+ G_OBJECT_CLASS (seahorse_ssh_commands_parent_class)->finalize (obj);
}
-
-static void seahorse_ssh_commands_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
- SeahorseSSHCommands * self;
- self = SEAHORSE_SSH_COMMANDS (object);
- switch (property_id) {
- case SEAHORSE_SSH_COMMANDS_KTYPE:
- g_value_set_uint (value, seahorse_commands_get_ktype (SEAHORSE_COMMANDS (self)));
- break;
- case SEAHORSE_SSH_COMMANDS_UI_DEFINITION:
- g_value_set_string (value, seahorse_commands_get_ui_definition (SEAHORSE_COMMANDS (self)));
- break;
- case SEAHORSE_SSH_COMMANDS_COMMAND_ACTIONS:
- g_value_set_object (value, seahorse_commands_get_command_actions (SEAHORSE_COMMANDS (self)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+static void
+seahorse_ssh_commands_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
}
}
-
-static void seahorse_ssh_commands_class_init (SeahorseSSHCommandsClass * klass) {
- seahorse_ssh_commands_parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (SeahorseSSHCommandsPrivate));
- G_OBJECT_CLASS (klass)->get_property = seahorse_ssh_commands_get_property;
- G_OBJECT_CLASS (klass)->constructor = seahorse_ssh_commands_constructor;
- G_OBJECT_CLASS (klass)->finalize = seahorse_ssh_commands_finalize;
- SEAHORSE_COMMANDS_CLASS (klass)->show_properties = seahorse_ssh_commands_real_show_properties;
- SEAHORSE_COMMANDS_CLASS (klass)->delete_objects = seahorse_ssh_commands_real_delete_objects;
- SEAHORSE_COMMANDS_CLASS (klass)->get_ktype = seahorse_ssh_commands_real_get_ktype;
- SEAHORSE_COMMANDS_CLASS (klass)->get_ui_definition = seahorse_ssh_commands_real_get_ui_definition;
- SEAHORSE_COMMANDS_CLASS (klass)->get_command_actions = seahorse_ssh_commands_real_get_command_actions;
- g_object_class_override_property (G_OBJECT_CLASS (klass), SEAHORSE_SSH_COMMANDS_KTYPE, "ktype");
- g_object_class_override_property (G_OBJECT_CLASS (klass), SEAHORSE_SSH_COMMANDS_UI_DEFINITION, "ui-definition");
- g_object_class_override_property (G_OBJECT_CLASS (klass), SEAHORSE_SSH_COMMANDS_COMMAND_ACTIONS, "command-actions");
- {
- /* Register this class as a commands */
- seahorse_registry_register_type (seahorse_registry_get (), SEAHORSE_SSH_TYPE_COMMANDS, SEAHORSE_SSH_TYPE_STR, "commands", NULL, NULL);
+static void
+seahorse_ssh_commands_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+ break;
}
}
+static void
+seahorse_ssh_commands_class_init (SeahorseSshCommandsClass *klass)
+{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ seahorse_ssh_commands_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (SeahorseSshCommandsPrivate));
-static void seahorse_ssh_commands_instance_init (SeahorseSSHCommands * self) {
- self->priv = SEAHORSE_SSH_COMMANDS_GET_PRIVATE (self);
- self->priv->_command_actions = NULL;
-}
-
-
-static void seahorse_ssh_commands_finalize (GObject * obj) {
- SeahorseSSHCommands * self;
- self = SEAHORSE_SSH_COMMANDS (obj);
- (self->priv->_command_actions == NULL ? NULL : (self->priv->_command_actions = (g_object_unref (self->priv->_command_actions), NULL)));
- G_OBJECT_CLASS (seahorse_ssh_commands_parent_class)->finalize (obj);
+ gobject_class->constructor = seahorse_ssh_commands_constructor;
+ gobject_class->dispose = seahorse_ssh_commands_dispose;
+ gobject_class->finalize = seahorse_ssh_commands_finalize;
+ gobject_class->set_property = seahorse_ssh_commands_set_property;
+ gobject_class->get_property = seahorse_ssh_commands_get_property;
+
+ SEAHORSE_COMMANDS_CLASS (klass)->show_properties = seahorse_ssh_commands_show_properties;
+ SEAHORSE_COMMANDS_CLASS (klass)->delete_objects = seahorse_ssh_commands_delete_objects;
+
+ /* Register this class as a commands */
+ seahorse_registry_register_type (seahorse_registry_get (), SEAHORSE_TYPE_SSH_COMMANDS,
+ SEAHORSE_SSH_TYPE_STR, "commands", NULL, NULL);
}
+/* -----------------------------------------------------------------------------
+ * PUBLIC
+ */
-GType seahorse_ssh_commands_get_type (void) {
- static GType seahorse_ssh_commands_type_id = 0;
- if (seahorse_ssh_commands_type_id == 0) {
- static const GTypeInfo g_define_type_info = { sizeof (SeahorseSSHCommandsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seahorse_ssh_commands_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeahorseSSHCommands), 0, (GInstanceInitFunc) seahorse_ssh_commands_instance_init };
- seahorse_ssh_commands_type_id = g_type_register_static (SEAHORSE_TYPE_COMMANDS, "SeahorseSSHCommands", &g_define_type_info, 0);
- }
- return seahorse_ssh_commands_type_id;
+SeahorseSshCommands*
+seahorse_ssh_commands_new (void)
+{
+ return g_object_new (SEAHORSE_TYPE_SSH_COMMANDS, NULL);
}
-
-
-
-
Modified: trunk/ssh/seahorse-ssh-commands.h
==============================================================================
--- trunk/ssh/seahorse-ssh-commands.h (original)
+++ trunk/ssh/seahorse-ssh-commands.h Sat Dec 13 19:29:44 2008
@@ -24,41 +24,35 @@
#include <glib.h>
#include <glib-object.h>
-#include <seahorse-commands.h>
-#include <seahorse-object.h>
-#include <seahorse-operation.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
+#include "seahorse-commands.h"
+#include "seahorse-object.h"
+#include <seahorse-operation.h>
-#define SEAHORSE_SSH_TYPE_COMMANDS (seahorse_ssh_commands_get_type ())
-#define SEAHORSE_SSH_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_SSH_TYPE_COMMANDS, SeahorseSSHCommands))
-#define SEAHORSE_SSH_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_SSH_TYPE_COMMANDS, SeahorseSSHCommandsClass))
-#define SEAHORSE_SSH_IS_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_SSH_TYPE_COMMANDS))
-#define SEAHORSE_SSH_IS_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_SSH_TYPE_COMMANDS))
-#define SEAHORSE_SSH_COMMANDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_SSH_TYPE_COMMANDS, SeahorseSSHCommandsClass))
-typedef struct _SeahorseSSHCommands SeahorseSSHCommands;
-typedef struct _SeahorseSSHCommandsClass SeahorseSSHCommandsClass;
-typedef struct _SeahorseSSHCommandsPrivate SeahorseSSHCommandsPrivate;
+#define SEAHORSE_TYPE_SSH_COMMANDS (seahorse_ssh_commands_get_type ())
+#define SEAHORSE_SSH_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_SSH_COMMANDS, SeahorseSshCommands))
+#define SEAHORSE_SSH_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_SSH_COMMANDS, SeahorseSshCommandsClass))
+#define SEAHORSE_IS_SSH_COMMANDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_SSH_COMMANDS))
+#define SEAHORSE_IS_SSH_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_SSH_COMMANDS))
+#define SEAHORSE_SSH_COMMANDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_SSH_COMMANDS, SeahorseSshCommandsClass))
+
+typedef struct _SeahorseSshCommands SeahorseSshCommands;
+typedef struct _SeahorseSshCommandsClass SeahorseSshCommandsClass;
+typedef struct _SeahorseSshCommandsPrivate SeahorseSshCommandsPrivate;
-struct _SeahorseSSHCommands {
+struct _SeahorseSshCommands {
SeahorseCommands parent_instance;
- SeahorseSSHCommandsPrivate * priv;
+ SeahorseSshCommandsPrivate *pv;
};
-struct _SeahorseSSHCommandsClass {
+struct _SeahorseSshCommandsClass {
SeahorseCommandsClass parent_class;
};
+GType seahorse_ssh_commands_get_type (void);
-SeahorseSSHCommands* seahorse_ssh_commands_new (void);
-GType seahorse_ssh_commands_get_type (void);
-
+SeahorseSshCommands* seahorse_ssh_commands_new (void);
-G_END_DECLS
#endif
Modified: trunk/ssh/seahorse-ssh-module.c
==============================================================================
--- trunk/ssh/seahorse-ssh-module.c (original)
+++ trunk/ssh/seahorse-ssh-module.c Sat Dec 13 19:29:44 2008
@@ -39,6 +39,6 @@
seahorse_context_take_source (NULL, source);
g_type_class_unref (g_type_class_ref (SEAHORSE_TYPE_SSH_SOURCE));
- g_type_class_unref (g_type_class_ref (SEAHORSE_SSH_TYPE_COMMANDS));
+ g_type_class_unref (g_type_class_ref (SEAHORSE_TYPE_SSH_COMMANDS));
g_type_class_unref (g_type_class_ref (SEAHORSE_SSH_TYPE_GENERATOR));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]