[balsa/popover: 3/5] libinit-balsa: Use 'Controller' naming
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/popover: 3/5] libinit-balsa: Use 'Controller' naming
- Date: Wed, 24 Jun 2020 16:33:13 +0000 (UTC)
commit e9f1ed4a1f7fd008e77b2e87aec52f600175e744
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Tue Jun 23 12:52:37 2020 -0400
libinit-balsa: Use 'Controller' naming
Also remove a redundant macro.
libinit_balsa/assistant_helper.c | 12 ++++++------
libinit_balsa/assistant_helper.h | 11 +++++------
libinit_balsa/assistant_page_user.c | 18 +++++++++---------
libinit_balsa/assistant_page_user.h | 2 +-
4 files changed, 21 insertions(+), 22 deletions(-)
---
diff --git a/libinit_balsa/assistant_helper.c b/libinit_balsa/assistant_helper.c
index 3e82bac98..7a98e423c 100644
--- a/libinit_balsa/assistant_helper.c
+++ b/libinit_balsa/assistant_helper.c
@@ -69,13 +69,13 @@ balsa_init_add_grid_entry(GtkGrid * grid, guint num, const gchar * ltext,
if(ed) {
g_signal_connect(e, "changed",
G_CALLBACK(entry_changed_cb), ed);
- ed->num = ed->master->numentries++;
+ ed->num = ed->controller->numentries++;
ed->druid = druid;
ed->page = page;
if (etext && etext[0] != '\0')
- ed->master->setbits |= (1 << num);
+ ed->controller->setbits |= (1 << num);
- ed->master->donemask = (ed->master->donemask << 1) | 1;
+ ed->controller->donemask = (ed->controller->donemask << 1) | 1;
}
gtk_entry_set_text(GTK_ENTRY(e), etext);
return e;
@@ -87,9 +87,9 @@ entry_changed_cb(GtkEntry * entry, EntryData * ed)
g_assert(ed != NULL);
if (gtk_entry_get_text_length(entry)) {
- ed->master->setbits |= (1 << ed->num);
+ ed->controller->setbits |= (1 << ed->num);
} else {
- ed->master->setbits &= ~(1 << ed->num);
+ ed->controller->setbits &= ~(1 << ed->num);
}
/* The stuff below is only when we are displayed... which is not
@@ -100,7 +100,7 @@ entry_changed_cb(GtkEntry * entry, EntryData * ed)
if (GTK_IS_ASSISTANT(ed->druid)) {
/* Don't let them continue unless all entries have something. */
- if (ENTRY_MASTER_P_DONE(ed->master)) {
+ if (ENTRY_CONTROLLER_DONE(ed->controller)) {
gtk_assistant_set_page_complete(ed->druid, ed->page, TRUE);
} else {
gtk_assistant_set_page_complete(ed->druid, ed->page, FALSE);
diff --git a/libinit_balsa/assistant_helper.h b/libinit_balsa/assistant_helper.h
index 3e59a042d..01c29ed5c 100644
--- a/libinit_balsa/assistant_helper.h
+++ b/libinit_balsa/assistant_helper.h
@@ -23,26 +23,25 @@
#include <gtk/gtk.h>
typedef struct EntryData_s EntryData;
-typedef struct EntryMaster_s EntryMaster;
+typedef struct EntryController_s EntryController;
struct EntryData_s {
GtkAssistant *druid;
GtkWidget *page;
guint num;
- EntryMaster *master;
+ EntryController *controller;
};
#define ENTRY_DATA_INIT { NULL, 0 }
-struct EntryMaster_s {
+struct EntryController_s {
guint32 setbits;
guint32 numentries;
guint32 donemask;
};
-#define ENTRY_MASTER_INIT { 0, 0, 0 }
-#define ENTRY_MASTER_P_DONE( ep ) ( ((ep)->setbits & (ep)->donemask) == (ep)->donemask )
-#define ENTRY_MASTER_DONE( e ) ( ((e).setbits & (e).donemask) == (e).donemask )
+#define ENTRY_CONTROLLER_INIT { 0, 0, 0 }
+#define ENTRY_CONTROLLER_DONE( e ) ( ((e)->setbits & (e)->donemask) == (e)->donemask )
GtkWidget *balsa_init_add_grid_entry(GtkGrid * grid, guint num,
const gchar * ltext,
diff --git a/libinit_balsa/assistant_page_user.c b/libinit_balsa/assistant_page_user.c
index e038375fe..c8f3160f2 100644
--- a/libinit_balsa/assistant_page_user.c
+++ b/libinit_balsa/assistant_page_user.c
@@ -77,14 +77,14 @@ balsa_druid_page_user_init(BalsaDruidPageUser * user,
gchar *preset;
int row = 0;
- user->emaster.setbits = 0;
- user->emaster.numentries = 0;
- user->emaster.donemask = 0;
- user->ed0.master = &(user->emaster);
- user->ed1.master = &(user->emaster);
- user->ed2.master = &(user->emaster);
- user->ed3.master = &(user->emaster);
- user->ed4.master = &(user->emaster);
+ user->econtroller.setbits = 0;
+ user->econtroller.numentries = 0;
+ user->econtroller.donemask = 0;
+ user->ed0.controller = &(user->econtroller);
+ user->ed1.controller = &(user->econtroller);
+ user->ed2.controller = &(user->econtroller);
+ user->ed3.controller = &(user->econtroller);
+ user->ed4.controller = &(user->econtroller);
label = GTK_LABEL(gtk_label_new(_(header2)));
gtk_label_set_line_wrap(label, TRUE);
gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(label), FALSE, TRUE, 0);
@@ -186,7 +186,7 @@ balsa_druid_page_user_prepare(GtkAssistant * druid, GtkWidget * page,
/* Don't let them continue unless all entries have something. */
gtk_assistant_set_page_complete(druid, page,
- ENTRY_MASTER_DONE(user->emaster));
+ ENTRY_CONTROLLER_DONE(&user->econtroller));
gtk_widget_grab_focus(user->incoming_srv);
user->need_set = TRUE;
diff --git a/libinit_balsa/assistant_page_user.h b/libinit_balsa/assistant_page_user.h
index 6e974dce2..7681096cb 100644
--- a/libinit_balsa/assistant_page_user.h
+++ b/libinit_balsa/assistant_page_user.h
@@ -46,7 +46,7 @@ G_BEGIN_DECLS
GtkWidget *name;
GtkWidget *email;
GtkWidget *localmaildir;
- EntryMaster emaster;
+ EntryController econtroller;
EntryData ed0;
EntryData ed1;
EntryData ed2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]