Changed e_popup_menu_run call to match the new arguments.
2000-08-09 Christopher James Lahey <clahey@helixcode.com> * gui/component/addressbook.c, gui/minicard/e-minicard.c: Changed e_popup_menu_run call to match the new arguments. * gui/component/addressbook.oafinfo: Fixed this file to work properly. * gui/minicard/e-minicard-control.c: Use the correct oafinfo ID here. Also cleaned up the code a bit with the help of Michael Meeks. svn path=/trunk/; revision=4627
This commit is contained in:
committed by
Chris Lahey
parent
37f85438b2
commit
44628427f8
@@ -1,3 +1,15 @@
|
||||
2000-08-09 Christopher James Lahey <clahey@helixcode.com>
|
||||
|
||||
* gui/component/addressbook.c, gui/minicard/e-minicard.c: Changed
|
||||
e_popup_menu_run call to match the new arguments.
|
||||
|
||||
* gui/component/addressbook.oafinfo: Fixed this file to work
|
||||
properly.
|
||||
|
||||
* gui/minicard/e-minicard-control.c: Use the correct oafinfo ID
|
||||
here. Also cleaned up the code a bit with the help of Michael
|
||||
Meeks.
|
||||
|
||||
2000-08-08 Chris Toshok <toshok@helixcode.com>
|
||||
|
||||
* gui/component/e-addressbook-model.c (e_addressbook_model_init):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<oaf_info>
|
||||
|
||||
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
|
||||
<oaf_server iid="OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595"
|
||||
type="exe"
|
||||
location="evolution-addressbook">
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
</oaf_attribute>
|
||||
|
||||
<oaf_attribute name="description" type="string"
|
||||
value="Factory for the sample Addressbook control"/>
|
||||
value="Factory for the Addressbook Minicard control"/>
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:e_minicard_factory:f9542709-fb31-4c6a-bc00-d462ba41e4b9"
|
||||
<oaf_server iid="OAFIID:control:e_minicard:f9542709-fb31-4c6a-bc00-d462ba41e4b9"
|
||||
type="factory"
|
||||
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
|
||||
location="OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595">
|
||||
|
||||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
@@ -32,6 +32,19 @@
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
|
||||
type="exe"
|
||||
location="evolution-addressbook">
|
||||
|
||||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:GNOME/GenericFactory:1.0"/>
|
||||
</oaf_attribute>
|
||||
|
||||
<oaf_attribute name="description" type="string"
|
||||
value="Factory for the sample Addressbook control"/>
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
|
||||
type="factory"
|
||||
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<oaf_info>
|
||||
|
||||
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
|
||||
<oaf_server iid="OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595"
|
||||
type="exe"
|
||||
location="evolution-addressbook">
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
</oaf_attribute>
|
||||
|
||||
<oaf_attribute name="description" type="string"
|
||||
value="Factory for the sample Addressbook control"/>
|
||||
value="Factory for the Addressbook Minicard control"/>
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:e_minicard_factory:f9542709-fb31-4c6a-bc00-d462ba41e4b9"
|
||||
<oaf_server iid="OAFIID:control:e_minicard:f9542709-fb31-4c6a-bc00-d462ba41e4b9"
|
||||
type="factory"
|
||||
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
|
||||
location="OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595">
|
||||
|
||||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
@@ -32,6 +32,19 @@
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
|
||||
type="exe"
|
||||
location="evolution-addressbook">
|
||||
|
||||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:GNOME/GenericFactory:1.0"/>
|
||||
</oaf_attribute>
|
||||
|
||||
<oaf_attribute name="description" type="string"
|
||||
value="Factory for the sample Addressbook control"/>
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
|
||||
type="factory"
|
||||
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
|
||||
|
||||
@@ -945,7 +945,7 @@ table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, Ad
|
||||
ECard *card = e_addressbook_model_get_card(E_ADDRESSBOOK_MODEL(view->model), row);
|
||||
EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0}, {NULL, NULL, NULL, 0} };
|
||||
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, card);
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, card);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<oaf_info>
|
||||
|
||||
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
|
||||
<oaf_server iid="OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595"
|
||||
type="exe"
|
||||
location="evolution-addressbook">
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
</oaf_attribute>
|
||||
|
||||
<oaf_attribute name="description" type="string"
|
||||
value="Factory for the sample Addressbook control"/>
|
||||
value="Factory for the Addressbook Minicard control"/>
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:e_minicard_factory:f9542709-fb31-4c6a-bc00-d462ba41e4b9"
|
||||
<oaf_server iid="OAFIID:control:e_minicard:f9542709-fb31-4c6a-bc00-d462ba41e4b9"
|
||||
type="factory"
|
||||
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
|
||||
location="OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595">
|
||||
|
||||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
@@ -32,6 +32,19 @@
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17"
|
||||
type="exe"
|
||||
location="evolution-addressbook">
|
||||
|
||||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:GNOME/GenericFactory:1.0"/>
|
||||
</oaf_attribute>
|
||||
|
||||
<oaf_attribute name="description" type="string"
|
||||
value="Factory for the sample Addressbook control"/>
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<oaf_server iid="OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49"
|
||||
type="factory"
|
||||
location="OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17">
|
||||
|
||||
@@ -139,7 +139,7 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
|
||||
char *vcard;
|
||||
GtkWidget *minicard = data;
|
||||
|
||||
if (*type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
if (type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
g_strcasecmp (type, "text/x-vCard") != 0) {
|
||||
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
|
||||
ex_Bonobo_Persist_WrongDataType, NULL);
|
||||
@@ -168,53 +168,25 @@ pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
|
||||
Bonobo_Persist_ContentType type, void *data,
|
||||
CORBA_Environment *ev)
|
||||
{
|
||||
Bonobo_Stream_iobuf *buffer;
|
||||
size_t pos;
|
||||
char *vcard;
|
||||
ECard *card;
|
||||
EMinicardWidget *minicard = data;
|
||||
int length;
|
||||
|
||||
if (*type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
if (type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
g_strcasecmp (type, "text/x-vCard") != 0) {
|
||||
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
|
||||
ex_Bonobo_Persist_WrongDataType, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
buffer = Bonobo_Stream_iobuf__alloc ();
|
||||
|
||||
gtk_object_get(GTK_OBJECT(minicard),
|
||||
"card", &card,
|
||||
NULL);
|
||||
gtk_object_get (GTK_OBJECT (minicard),
|
||||
"card", &card,
|
||||
NULL);
|
||||
vcard = e_card_get_vcard(card);
|
||||
length = strlen(vcard);
|
||||
data = CORBA_sequence_CORBA_octet_allocbuf (length);
|
||||
memcpy (data, vcard, length);
|
||||
|
||||
buffer->_buffer = data;
|
||||
buffer->_length = length;
|
||||
|
||||
g_free(vcard);
|
||||
|
||||
pos = 0;
|
||||
|
||||
while (pos < length) {
|
||||
CORBA_long bytes_read;
|
||||
|
||||
bytes_read = Bonobo_Stream_write (stream, buffer, ev);
|
||||
|
||||
if (ev->_major != CORBA_NO_EXCEPTION) {
|
||||
CORBA_free (buffer);
|
||||
CORBA_free (data);
|
||||
return;
|
||||
}
|
||||
|
||||
pos += bytes_read;
|
||||
}
|
||||
|
||||
CORBA_free (buffer);
|
||||
CORBA_free (data);
|
||||
length = strlen (vcard);
|
||||
bonobo_stream_client_write (stream, vcard, length, ev);
|
||||
g_free (vcard);
|
||||
} /* pstream_save */
|
||||
|
||||
static CORBA_long
|
||||
@@ -226,12 +198,11 @@ pstream_get_max_size (BonoboPersistStream *ps, void *data,
|
||||
char *vcard;
|
||||
gint length;
|
||||
|
||||
gtk_object_get(GTK_OBJECT(minicard),
|
||||
"card", &card,
|
||||
NULL);
|
||||
gtk_object_get (GTK_OBJECT (minicard),
|
||||
"card", &card, NULL);
|
||||
vcard = e_card_get_vcard(card);
|
||||
length = strlen(vcard);
|
||||
g_free(vcard);
|
||||
length = strlen (vcard);
|
||||
g_free (vcard);
|
||||
|
||||
return length;
|
||||
}
|
||||
@@ -296,7 +267,7 @@ e_minicard_control_factory_init (void)
|
||||
#if USING_OAF
|
||||
factory =
|
||||
bonobo_generic_factory_new (
|
||||
"OAFIID:e_minicard_factory:f9542709-fb31-4c6a-bc00-d462ba41e4b9",
|
||||
"OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595",
|
||||
e_minicard_control_factory, NULL);
|
||||
#else
|
||||
factory =
|
||||
|
||||
@@ -464,12 +464,12 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
|
||||
{"Print", NULL, GTK_SIGNAL_FUNC(print), 0},
|
||||
{"Delete", NULL, GTK_SIGNAL_FUNC(delete), 0},
|
||||
{NULL, NULL, NULL, 0}};
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, e_minicard);
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, e_minicard);
|
||||
} else {
|
||||
EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0},
|
||||
{"Print", NULL, GTK_SIGNAL_FUNC(print), 0},
|
||||
{NULL, NULL, NULL, 0}};
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, e_minicard);
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, e_minicard);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -139,7 +139,7 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
|
||||
char *vcard;
|
||||
GtkWidget *minicard = data;
|
||||
|
||||
if (*type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
if (type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
g_strcasecmp (type, "text/x-vCard") != 0) {
|
||||
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
|
||||
ex_Bonobo_Persist_WrongDataType, NULL);
|
||||
@@ -168,53 +168,25 @@ pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
|
||||
Bonobo_Persist_ContentType type, void *data,
|
||||
CORBA_Environment *ev)
|
||||
{
|
||||
Bonobo_Stream_iobuf *buffer;
|
||||
size_t pos;
|
||||
char *vcard;
|
||||
ECard *card;
|
||||
EMinicardWidget *minicard = data;
|
||||
int length;
|
||||
|
||||
if (*type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
if (type && g_strcasecmp (type, "text/vCard") != 0 &&
|
||||
g_strcasecmp (type, "text/x-vCard") != 0) {
|
||||
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
|
||||
ex_Bonobo_Persist_WrongDataType, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
buffer = Bonobo_Stream_iobuf__alloc ();
|
||||
|
||||
gtk_object_get(GTK_OBJECT(minicard),
|
||||
"card", &card,
|
||||
NULL);
|
||||
gtk_object_get (GTK_OBJECT (minicard),
|
||||
"card", &card,
|
||||
NULL);
|
||||
vcard = e_card_get_vcard(card);
|
||||
length = strlen(vcard);
|
||||
data = CORBA_sequence_CORBA_octet_allocbuf (length);
|
||||
memcpy (data, vcard, length);
|
||||
|
||||
buffer->_buffer = data;
|
||||
buffer->_length = length;
|
||||
|
||||
g_free(vcard);
|
||||
|
||||
pos = 0;
|
||||
|
||||
while (pos < length) {
|
||||
CORBA_long bytes_read;
|
||||
|
||||
bytes_read = Bonobo_Stream_write (stream, buffer, ev);
|
||||
|
||||
if (ev->_major != CORBA_NO_EXCEPTION) {
|
||||
CORBA_free (buffer);
|
||||
CORBA_free (data);
|
||||
return;
|
||||
}
|
||||
|
||||
pos += bytes_read;
|
||||
}
|
||||
|
||||
CORBA_free (buffer);
|
||||
CORBA_free (data);
|
||||
length = strlen (vcard);
|
||||
bonobo_stream_client_write (stream, vcard, length, ev);
|
||||
g_free (vcard);
|
||||
} /* pstream_save */
|
||||
|
||||
static CORBA_long
|
||||
@@ -226,12 +198,11 @@ pstream_get_max_size (BonoboPersistStream *ps, void *data,
|
||||
char *vcard;
|
||||
gint length;
|
||||
|
||||
gtk_object_get(GTK_OBJECT(minicard),
|
||||
"card", &card,
|
||||
NULL);
|
||||
gtk_object_get (GTK_OBJECT (minicard),
|
||||
"card", &card, NULL);
|
||||
vcard = e_card_get_vcard(card);
|
||||
length = strlen(vcard);
|
||||
g_free(vcard);
|
||||
length = strlen (vcard);
|
||||
g_free (vcard);
|
||||
|
||||
return length;
|
||||
}
|
||||
@@ -296,7 +267,7 @@ e_minicard_control_factory_init (void)
|
||||
#if USING_OAF
|
||||
factory =
|
||||
bonobo_generic_factory_new (
|
||||
"OAFIID:e_minicard_factory:f9542709-fb31-4c6a-bc00-d462ba41e4b9",
|
||||
"OAFIID:control-factory:e_minicard:16bb7c25-c7d2-46dc-a5f0-a0975d0e0595",
|
||||
e_minicard_control_factory, NULL);
|
||||
#else
|
||||
factory =
|
||||
|
||||
@@ -464,12 +464,12 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
|
||||
{"Print", NULL, GTK_SIGNAL_FUNC(print), 0},
|
||||
{"Delete", NULL, GTK_SIGNAL_FUNC(delete), 0},
|
||||
{NULL, NULL, NULL, 0}};
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, e_minicard);
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, e_minicard);
|
||||
} else {
|
||||
EPopupMenu menu[] = { {"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0},
|
||||
{"Print", NULL, GTK_SIGNAL_FUNC(print), 0},
|
||||
{NULL, NULL, NULL, 0}};
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, e_minicard);
|
||||
e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, e_minicard);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user