+/*
+ * Dolda Connect - Modular multiuser Direct Connect-style client
+ * Copyright (C) 2005 Fredrik Tolf (fredrik@dolda2000.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
static char *ctxtmenu =
"<popup name='button3'>"
-" <menuitem name='Preferences' verb='dca_pref' _label='Preferences' pixtype='stock' pixname='gtk-properties'>"
-" </menuitem>"
+" <menuitem name='Preferences' verb='dca_pref' _label='Preferences' pixtype='stock' pixname='gtk-properties' />"
+" <menuitem name='Cancel transfer' verb='dca_cancel' _label='Cancel transfer' pixtype='stock' pixname='gtk-cancel' />"
"</popup>";
static void run_pref_dialog(BonoboUIComponent *uic, gpointer data, const char *cname)
{
}
+static void cancel_transfer(BonoboUIComponent *uic, struct appletdata *data, const char *cname)
+{
+ if(data->conduit->iface->cancel != NULL)
+ data->conduit->iface->cancel(data->conduit, data->curdisplay);
+}
+
static BonoboUIVerb ctxtmenuverbs[] =
{
BONOBO_UI_VERB("dca_pref", run_pref_dialog),
+ BONOBO_UI_VERB("dca_cancel", cancel_transfer),
BONOBO_UI_VERB_END
};
if(strcmp(iid, "OAFIID:Dolcon_Transferapplet"))
return(FALSE);
- panel_applet_setup_menu(applet, ctxtmenu, ctxtmenuverbs, NULL);
-
hbox = gtk_hbox_new(FALSE, 0);
label = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
data->tiptimeout = g_timeout_add(500, (gboolean (*)(gpointer))updatetip, data);
data->label = GTK_LABEL(label);
+ panel_applet_setup_menu(applet, ctxtmenu, ctxtmenuverbs, data);
+
g_signal_connect(applet, "button-press-event", (GCallback)trview_applet_button_press, data);
g_signal_connect(applet, "destroy", (GCallback)trview_applet_destroy, data);