2009-09-29 21:21:36 +02:00
|
|
|
#ifndef _SYNC_CONFIG_WIDGET
|
|
|
|
#define _SYNC_CONFIG_WIDGET
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2009-11-17 14:46:58 +01:00
|
|
|
#include "syncevo-server.h"
|
2009-09-29 21:21:36 +02:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define SYNC_TYPE_CONFIG_WIDGET sync_config_widget_get_type()
|
|
|
|
|
|
|
|
#define SYNC_CONFIG_WIDGET(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNC_TYPE_CONFIG_WIDGET, SyncConfigWidget))
|
|
|
|
|
|
|
|
#define SYNC_CONFIG_WIDGET_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST ((klass), SYNC_TYPE_CONFIG_WIDGET, SyncConfigWidgetClass))
|
|
|
|
|
|
|
|
#define SYNC_IS_CONFIG_WIDGET(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNC_TYPE_CONFIG_WIDGET))
|
|
|
|
|
|
|
|
#define SYNC_IS_CONFIG_WIDGET_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE ((klass), SYNC_TYPE_CONFIG_WIDGET))
|
|
|
|
|
|
|
|
#define SYNC_CONFIG_WIDGET_GET_CLASS(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_CLASS ((obj), SYNC_TYPE_CONFIG_WIDGET, SyncConfigWidgetClass))
|
|
|
|
|
2009-12-11 11:09:21 +01:00
|
|
|
|
2009-09-29 21:21:36 +02:00
|
|
|
typedef struct {
|
2009-11-25 17:19:57 +01:00
|
|
|
GtkContainer parent;
|
|
|
|
GtkWidget *expando_box;
|
|
|
|
GtkWidget *label_box;
|
2009-09-29 21:21:36 +02:00
|
|
|
|
2010-02-03 16:43:13 +01:00
|
|
|
GtkWidget *device_selector_box;
|
2010-03-06 16:01:48 +01:00
|
|
|
GtkWidget *device_text;
|
2010-02-03 16:43:13 +01:00
|
|
|
GtkWidget *combo;
|
2010-03-06 16:18:53 +01:00
|
|
|
GtkWidget *device_select_btn;
|
2010-02-03 16:43:13 +01:00
|
|
|
|
|
|
|
GtkWidget *settings_box;
|
|
|
|
|
2009-09-30 22:36:01 +02:00
|
|
|
gboolean current; /* is this currently used config */
|
2009-12-12 23:00:23 +01:00
|
|
|
char *current_service_name; /* name of the current service */
|
2009-11-19 14:20:27 +01:00
|
|
|
gboolean configured; /* actual service configuration exists on server */
|
2010-02-03 16:43:13 +01:00
|
|
|
gboolean device_template_selected;
|
2009-11-19 14:20:27 +01:00
|
|
|
gboolean has_template; /* this service configuration has a matching template */
|
2009-11-25 17:19:57 +01:00
|
|
|
gboolean expanded;
|
2009-09-29 21:21:36 +02:00
|
|
|
|
|
|
|
SyncevoServer *server;
|
2010-02-02 14:34:43 +01:00
|
|
|
SyncevoConfig *config;
|
2010-02-08 11:23:30 +01:00
|
|
|
GHashTable *configs; /* possible configs. config above is one of these */
|
2010-02-03 16:43:13 +01:00
|
|
|
|
2010-02-02 14:34:43 +01:00
|
|
|
char *config_name;
|
|
|
|
char *pretty_name;
|
|
|
|
|
2009-11-19 09:52:41 +01:00
|
|
|
char *running_session;
|
2009-09-30 13:54:49 +02:00
|
|
|
|
2010-01-26 16:37:21 +01:00
|
|
|
char *expand_id;
|
|
|
|
|
2009-09-29 21:21:36 +02:00
|
|
|
/* label */
|
|
|
|
GtkWidget *image;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *entry;
|
|
|
|
GtkWidget *link;
|
|
|
|
GtkWidget *button;
|
|
|
|
|
|
|
|
/* content */
|
|
|
|
GtkWidget *description_label;
|
2010-02-02 15:52:19 +01:00
|
|
|
GtkWidget *userinfo_table;
|
2009-09-29 21:21:36 +02:00
|
|
|
GtkWidget *name_label;
|
|
|
|
GtkWidget *name_entry;
|
2009-12-11 11:09:21 +01:00
|
|
|
GtkWidget *complex_config_info_bar;
|
2009-12-12 01:52:05 +01:00
|
|
|
GtkWidget *mode_table;
|
2009-12-11 11:09:21 +01:00
|
|
|
GtkWidget *send_check;
|
|
|
|
GtkWidget *receive_check;
|
2009-09-29 21:21:36 +02:00
|
|
|
GtkWidget *username_entry;
|
|
|
|
GtkWidget *password_entry;
|
2009-12-11 11:09:21 +01:00
|
|
|
GtkWidget *source_toggle_label;
|
2009-09-30 11:42:30 +02:00
|
|
|
GtkWidget *baseurl_entry;
|
2009-09-29 21:21:36 +02:00
|
|
|
GtkWidget *expander;
|
2009-12-13 14:34:36 +01:00
|
|
|
GtkWidget *fake_expander;
|
2009-09-29 21:21:36 +02:00
|
|
|
GtkWidget *server_settings_table;
|
|
|
|
GtkWidget *reset_delete_button;
|
2009-09-30 13:54:49 +02:00
|
|
|
GtkWidget *stop_button;
|
2009-09-29 21:21:36 +02:00
|
|
|
GtkWidget *use_button;
|
2009-12-11 11:09:21 +01:00
|
|
|
|
|
|
|
GHashTable *sources; /* key is source name, value is source_widgets */
|
|
|
|
|
|
|
|
gboolean mode_changed;
|
2010-01-24 22:37:33 +01:00
|
|
|
|
|
|
|
gboolean no_source_toggles;
|
2009-09-29 21:21:36 +02:00
|
|
|
} SyncConfigWidget;
|
|
|
|
|
|
|
|
typedef struct {
|
2009-11-25 17:19:57 +01:00
|
|
|
GtkContainerClass parent_class;
|
2009-09-30 11:42:30 +02:00
|
|
|
|
2009-09-30 14:38:00 +02:00
|
|
|
void (*changed) (SyncConfigWidget *widget);
|
2009-09-29 21:21:36 +02:00
|
|
|
} SyncConfigWidgetClass;
|
|
|
|
|
|
|
|
GType sync_config_widget_get_type (void);
|
|
|
|
|
2009-09-30 22:36:01 +02:00
|
|
|
GtkWidget *sync_config_widget_new (SyncevoServer *server,
|
2009-11-18 11:58:08 +01:00
|
|
|
const char *name,
|
2010-02-02 14:34:43 +01:00
|
|
|
SyncevoConfig *config,
|
2009-09-30 22:36:01 +02:00
|
|
|
gboolean current,
|
2009-12-12 23:00:23 +01:00
|
|
|
const char *current_service_name,
|
2009-11-19 14:20:27 +01:00
|
|
|
gboolean configured,
|
|
|
|
gboolean has_template);
|
2009-09-30 11:42:30 +02:00
|
|
|
|
|
|
|
void sync_config_widget_set_expanded (SyncConfigWidget *widget, gboolean expanded);
|
2009-11-25 17:19:57 +01:00
|
|
|
gboolean sync_config_widget_get_expanded (SyncConfigWidget *widget);
|
2009-09-29 21:21:36 +02:00
|
|
|
|
2009-09-30 11:42:30 +02:00
|
|
|
gboolean sync_config_widget_get_current (SyncConfigWidget *widget);
|
2009-09-30 13:54:49 +02:00
|
|
|
void sync_config_widget_set_current (SyncConfigWidget *self, gboolean current);
|
2009-09-29 21:21:36 +02:00
|
|
|
|
2009-11-19 14:20:27 +01:00
|
|
|
void sync_config_widget_set_has_template (SyncConfigWidget *self, gboolean has_template);
|
|
|
|
gboolean sync_config_widget_get_has_template (SyncConfigWidget *self);
|
|
|
|
|
|
|
|
void sync_config_widget_set_configured (SyncConfigWidget *self, gboolean configured);
|
|
|
|
gboolean sync_config_widget_get_configured (SyncConfigWidget *self);
|
|
|
|
|
2009-09-30 14:38:00 +02:00
|
|
|
const char *sync_config_widget_get_name (SyncConfigWidget *widget);
|
2010-02-02 14:34:43 +01:00
|
|
|
|
|
|
|
void sync_config_widget_expand_id (SyncConfigWidget *self, const char *id);
|
2010-02-08 11:23:30 +01:00
|
|
|
void sync_config_widget_add_alternative_config (SyncConfigWidget *self, const char *name, SyncevoConfig *config, gboolean configured);
|
2009-09-29 21:21:36 +02:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|