subscribe-control.[ch] -> subscribe_dialog.[ch]

2000-10-02  Chris Toshok  <toshok@helixcode.com>

	* Makefile.am (evolution_mail_SOURCES): subscribe-control.[ch] -> subscribe_dialog.[ch]

	* mail-callbacks.c (manage_subscriptions): subscribe_control ->
	subscribe_dialog.  Also, pass the shell to subscribe_dialog_new.

	* mail-types.h: SubscribeControl -> SubscribeDialog.

	* subscribe-dialog.c, subscribe-dialog.h: rename from subscribe-control.[ch].

	* subscribe-dialog.c (subscribe_dialog_construct): pass
	Evolution_Shell in.
	(subscribe_dialog_new): takes Evolution_Shell argument now.

svn path=/trunk/; revision=5668
This commit is contained in:
Chris Toshok
2000-10-02 20:06:11 +00:00
committed by Chris Toshok
parent 26973c935a
commit bfe2227dd0
7 changed files with 95 additions and 78 deletions

View File

@ -1,3 +1,18 @@
2000-10-02 Chris Toshok <toshok@helixcode.com>
* Makefile.am (evolution_mail_SOURCES): subscribe-control.[ch] -> subscribe_dialog.[ch]
* mail-callbacks.c (manage_subscriptions): subscribe_control ->
subscribe_dialog. Also, pass the shell to subscribe_dialog_new.
* mail-types.h: SubscribeControl -> SubscribeDialog.
* subscribe-dialog.c, subscribe-dialog.h: rename from subscribe-control.[ch].
* subscribe-dialog.c (subscribe_dialog_construct): pass
Evolution_Shell in.
(subscribe_dialog_new): takes Evolution_Shell argument now.
2000-10-02 Chris Toshok <toshok@helixcode.com>
* message-list.c (message_list_init_renderers): remove the 2 tree

View File

@ -78,8 +78,8 @@ evolution_mail_SOURCES = \
message-thread.c \
message-thread.h \
session.c \
subscribe-control.c \
subscribe-control.h \
subscribe-dialog.c \
subscribe-dialog.h \
mail.h
evolution_mail_LDADD = \

View File

@ -37,7 +37,7 @@
#include "mail-ops.h"
#include "mail-local.h"
#include "folder-browser.h"
#include "subscribe-control.h"
#include "subscribe-dialog.h"
#include "filter/filter-editor.h"
#include "filter/filter-driver.h"
#include <gal/e-table/e-table.h>
@ -827,7 +827,7 @@ void
manage_subscriptions (BonoboUIHandler *uih, void *user_data, const char *path)
{
/* XXX pass in the selected storage */
GtkWidget *subscribe = subscribe_control_new ();
GtkWidget *subscribe = subscribe_dialog_new ((FOLDER_BROWSER (user_data))->shell);
gtk_widget_show (subscribe);
}

View File

@ -29,7 +29,7 @@ extern "C" {
typedef struct _FolderBrowser FolderBrowser;
typedef struct _SubscribeControl SubscribeControl;
typedef struct _SubscribeDialog SubscribeDialog;
typedef struct _MessageList MessageList;
typedef struct _MailDisplay MailDisplay;

View File

@ -1,45 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _SUBSCRIBE_CONTROL_H_
#define _SUBSCRIBE_CONTROL_H_
#include "mail-types.h"
#include <gtk/gtktable.h>
#include <gal/e-table/e-tree-model.h>
#include <bonobo/bonobo-ui-compat.h>
#include <bonobo/bonobo-property-bag.h>
#include "shell/Evolution.h"
#define SUBSCRIBE_CONTROL_TYPE (subscribe_control_get_type ())
#define SUBSCRIBE_CONTROL(o) (GTK_CHECK_CAST ((o), SUBSCRIBE_CONTROL_TYPE, SubscribeControl))
#define SUBSCRIBE_CONTROL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SUBSCRIBE_CONTROL_TYPE, SubscribeControlClass))
#define IS_SUBSCRIBE_CONTROL(o) (GTK_CHECK_TYPE ((o), SUBSCRIBE_CONTROL_TYPE))
#define IS_SUBSCRIBE_CONTROL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), SUBSCRIBE_CONTROL_TYPE))
struct _SubscribeControl {
GtkObject parent;
BonoboUIHandler *uih;
GtkWidget *app;
GtkWidget *storage_set_view;
GtkWidget *hpaned;
GtkWidget *table;
GtkWidget *description;
GtkWidget *etable;
ETreeModel *model;
ETreePath *root;
};
typedef struct {
GtkObjectClass parent_class;
} SubscribeControlClass;
GtkType subscribe_control_get_type (void);
GtkWidget *subscribe_control_new (void);
#endif /* _SUBSCRIBE_CONTROL_H_ */

View File

@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* subscribe-control.c: Subscribe control top level component
* subscribe-dialog.c: Subscribe dialog
*
* Author:
* Chris Toshok (toshok@helixcode.com)
@ -9,7 +9,7 @@
*/
#include <config.h>
#include <gnome.h>
#include "subscribe-control.h"
#include "subscribe-dialog.h"
#include "e-util/e-html-utils.h"
#include <gtkhtml/gtkhtml.h>
#include <gal/util/e-util.h>
@ -70,7 +70,7 @@ typedef struct {
} SubscribeData;
static GtkObjectClass *subscribe_control_parent_class;
static GtkObjectClass *subscribe_dialog_parent_class;
static void subscribe_close (BonoboUIHandler *uih, void *user_data, const char *path);
static void subscribe_select_all (BonoboUIHandler *uih, void *user_data, const char *path);
@ -155,7 +155,7 @@ static void
subscribe_close (BonoboUIHandler *uih,
void *user_data, const char *path)
{
SubscribeControl *sc = (SubscribeControl*)user_data;
SubscribeDialog *sc = (SubscribeDialog*)user_data;
gtk_widget_destroy (sc->app);
}
@ -175,7 +175,7 @@ subscribe_unselect_all (BonoboUIHandler *uih,
static void
subscribe_folder_foreach (int model_row, gpointer closure)
{
SubscribeControl *sc = SUBSCRIBE_CONTROL (closure);
SubscribeDialog *sc = SUBSCRIBE_DIALOG (closure);
ETreePath *node = e_tree_model_node_at_row (sc->model, model_row);
SubscribeData *data = e_tree_model_node_get_data (sc->model, node);
@ -190,7 +190,7 @@ subscribe_folder_foreach (int model_row, gpointer closure)
static void
subscribe_folder (GtkWidget *widget, gpointer user_data)
{
SubscribeControl *sc = SUBSCRIBE_CONTROL (user_data);
SubscribeDialog *sc = SUBSCRIBE_DIALOG (user_data);
e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->etable)->table,
subscribe_folder_foreach, sc);
@ -199,7 +199,7 @@ subscribe_folder (GtkWidget *widget, gpointer user_data)
static void
unsubscribe_folder_foreach (int model_row, gpointer closure)
{
SubscribeControl *sc = SUBSCRIBE_CONTROL (closure);
SubscribeDialog *sc = SUBSCRIBE_DIALOG (closure);
ETreePath *node = e_tree_model_node_at_row (sc->model, model_row);
SubscribeData *data = e_tree_model_node_get_data (sc->model, node);
@ -215,7 +215,7 @@ unsubscribe_folder_foreach (int model_row, gpointer closure)
static void
unsubscribe_folder (GtkWidget *widget, gpointer user_data)
{
SubscribeControl *sc = SUBSCRIBE_CONTROL (user_data);
SubscribeDialog *sc = SUBSCRIBE_DIALOG (user_data);
e_table_selected_row_foreach (E_TABLE_SCROLLED(sc->etable)->table,
unsubscribe_folder_foreach, sc);
@ -381,7 +381,7 @@ etree_is_editable (ETreeModel *etree, ETreePath *path, int col, void *model_data
" from The Book of Mozilla, 12:10"
static void
subscribe_control_gui_init (SubscribeControl *sc)
subscribe_dialog_gui_init (SubscribeDialog *sc)
{
int i;
ECell *cells[3];
@ -411,7 +411,7 @@ subscribe_control_gui_init (SubscribeControl *sc)
/* Build the menu and toolbar */
sc->uih = bonobo_ui_handler_new ();
if (!sc->uih) {
g_message ("subscribe_control_gui_init(): eeeeek, could not create the UI handler!");
g_message ("subscribe_dialog_gui_init(): eeeeek, could not create the UI handler!");
return;
}
@ -490,7 +490,6 @@ subscribe_control_gui_init (SubscribeControl *sc)
cells[1] = e_cell_toggle_new (0, 2, toggles);
cells[0] = e_cell_tree_new (E_TABLE_MODEL(sc->model),
NULL, NULL,
/*tree_expanded_pixbuf, tree_unexpanded_pixbuf,*/
TRUE, cells[2]);
for (i = 0; i < COL_LAST; i++) {
@ -536,51 +535,52 @@ subscribe_control_gui_init (SubscribeControl *sc)
}
static void
subscribe_control_destroy (GtkObject *object)
subscribe_dialog_destroy (GtkObject *object)
{
SubscribeControl *subscribe_control;
SubscribeDialog *subscribe_dialog;
subscribe_control = SUBSCRIBE_CONTROL (object);
subscribe_dialog = SUBSCRIBE_DIALOG (object);
subscribe_control_parent_class->destroy (object);
subscribe_dialog_parent_class->destroy (object);
}
static void
subscribe_control_class_init (GtkObjectClass *object_class)
subscribe_dialog_class_init (GtkObjectClass *object_class)
{
object_class->destroy = subscribe_control_destroy;
object_class->destroy = subscribe_dialog_destroy;
subscribe_control_parent_class = gtk_type_class (PARENT_TYPE);
subscribe_dialog_parent_class = gtk_type_class (PARENT_TYPE);
}
static void
subscribe_control_init (GtkObject *object)
subscribe_dialog_init (GtkObject *object)
{
}
static void
subscribe_control_construct (GtkObject *object)
subscribe_dialog_construct (GtkObject *object, Evolution_Shell shell)
{
SubscribeControl *sc = SUBSCRIBE_CONTROL (object);
SubscribeDialog *sc = SUBSCRIBE_DIALOG (object);
/*
* Our instance data
*/
sc->shell = shell;
subscribe_control_gui_init (sc);
subscribe_dialog_gui_init (sc);
}
GtkWidget *
subscribe_control_new ()
subscribe_dialog_new (Evolution_Shell shell)
{
SubscribeControl *subscribe_control;
SubscribeDialog *subscribe_dialog;
subscribe_control = gtk_type_new (subscribe_control_get_type ());
subscribe_dialog = gtk_type_new (subscribe_dialog_get_type ());
subscribe_control_construct (GTK_OBJECT (subscribe_control));
subscribe_dialog_construct (GTK_OBJECT (subscribe_dialog), shell);
return GTK_WIDGET (subscribe_control->app);
return GTK_WIDGET (subscribe_dialog->app);
}
E_MAKE_TYPE (subscribe_control, "SubscribeControl", SubscribeControl, subscribe_control_class_init, subscribe_control_init, PARENT_TYPE);
E_MAKE_TYPE (subscribe_dialog, "SubscribeDialog", SubscribeDialog, subscribe_dialog_class_init, subscribe_dialog_init, PARENT_TYPE);

47
mail/subscribe-dialog.h Normal file
View File

@ -0,0 +1,47 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _SUBSCRIBE_DIALOG_H_
#define _SUBSCRIBE_DIALOG_H_
#include "mail-types.h"
#include <gtk/gtktable.h>
#include <gal/e-table/e-tree-model.h>
#include <bonobo/bonobo-ui-compat.h>
#include <bonobo/bonobo-property-bag.h>
#include "shell/Evolution.h"
#define SUBSCRIBE_DIALOG_TYPE (subscribe_dialog_get_type ())
#define SUBSCRIBE_DIALOG(o) (GTK_CHECK_CAST ((o), SUBSCRIBE_DIALOG_TYPE, SubscribeDialog))
#define SUBSCRIBE_DIALOG_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SUBSCRIBE_DIALOG_TYPE, SubscribeDialogClass))
#define IS_SUBSCRIBE_DIALOG(o) (GTK_CHECK_TYPE ((o), SUBSCRIBE_DIALOG_TYPE))
#define IS_SUBSCRIBE_DIALOG_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), SUBSCRIBE_DIALOG_TYPE))
struct _SubscribeDialog {
GtkObject parent;
Evolution_Shell shell;
BonoboUIHandler *uih;
GtkWidget *app;
GtkWidget *storage_set_view;
GtkWidget *hpaned;
GtkWidget *table;
GtkWidget *description;
GtkWidget *etable;
ETreeModel *model;
ETreePath *root;
};
typedef struct {
GtkObjectClass parent_class;
} SubscribeDialogClass;
GtkType subscribe_dialog_get_type (void);
GtkWidget *subscribe_dialog_new (Evolution_Shell shell);
#endif /* _SUBSCRIBE_DIALOG_H_ */