]> saetta.ns0.it Git - solipa/libsolipa/commitdiff
Aggiunte le proprieta' SolipaMailUI::*-editable.
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 6 May 2011 07:25:53 +0000 (09:25 +0200)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 6 May 2011 07:25:53 +0000 (09:25 +0200)
src/mailui.c
tests/mailui.c

index 2390c15121de814bef0a464d493a46a2453f5981..049ee7f548b44dc71c6cab829b874160ab24abb3 100644 (file)
@@ -28,11 +28,17 @@ enum
        PROP_0,
        PROP_SMTP_URI,
        PROP_FROM,
+       PROP_FROM_EDITABLE,
        PROP_TO,
+       PROP_TO_EDITABLE,
        PROP_CC,
+       PROP_CC_EDITABLE,
        PROP_BCC,
+       PROP_BCC_EDITABLE,
        PROP_SUBJECT,
-       PROP_BODY
+       PROP_SUBJECT_EDITABLE,
+       PROP_BODY,
+       PROP_BODY_EDITABLE
 };
 
 static void solipa_mail_ui_class_init (SolipaMailUIClass *klass);
@@ -97,6 +103,13 @@ solipa_mail_ui_class_init (SolipaMailUIClass *klass)
                                                              "",
                                                              G_PARAM_READWRITE));
 
+       g_object_class_install_property (object_class, PROP_FROM_EDITABLE,
+                                        g_param_spec_boolean ("from-editable",
+                                                              "From field editable",
+                                                              "From field editable",
+                                                              TRUE,
+                                                              G_PARAM_READWRITE));
+
        g_object_class_install_property (object_class, PROP_TO,
                                         g_param_spec_string ("to",
                                                              "To",
@@ -104,6 +117,13 @@ solipa_mail_ui_class_init (SolipaMailUIClass *klass)
                                                              "",
                                                              G_PARAM_READWRITE));
 
+       g_object_class_install_property (object_class, PROP_TO_EDITABLE,
+                                        g_param_spec_boolean ("to-editable",
+                                                              "To field editable",
+                                                              "To field editable",
+                                                              TRUE,
+                                                              G_PARAM_READWRITE));
+
        g_object_class_install_property (object_class, PROP_CC,
                                         g_param_spec_string ("cc",
                                                              "Cc",
@@ -111,6 +131,13 @@ solipa_mail_ui_class_init (SolipaMailUIClass *klass)
                                                              "",
                                                              G_PARAM_READWRITE));
 
+       g_object_class_install_property (object_class, PROP_CC_EDITABLE,
+                                        g_param_spec_boolean ("cc-editable",
+                                                              "Cc field editable",
+                                                              "Cc field editable",
+                                                              TRUE,
+                                                              G_PARAM_READWRITE));
+
        g_object_class_install_property (object_class, PROP_BCC,
                                         g_param_spec_string ("bcc",
                                                              "Bcc",
@@ -118,6 +145,13 @@ solipa_mail_ui_class_init (SolipaMailUIClass *klass)
                                                              "",
                                                              G_PARAM_READWRITE));
 
+       g_object_class_install_property (object_class, PROP_BCC_EDITABLE,
+                                        g_param_spec_boolean ("bcc-editable",
+                                                              "Bcc field editable",
+                                                              "Bcc field editable",
+                                                              TRUE,
+                                                              G_PARAM_READWRITE));
+
        g_object_class_install_property (object_class, PROP_SUBJECT,
                                         g_param_spec_string ("subject",
                                                              "Subject",
@@ -125,6 +159,13 @@ solipa_mail_ui_class_init (SolipaMailUIClass *klass)
                                                              "",
                                                              G_PARAM_READWRITE));
 
+       g_object_class_install_property (object_class, PROP_SUBJECT_EDITABLE,
+                                        g_param_spec_boolean ("subject-editable",
+                                                              "Subject field editable",
+                                                              "Subject field editable",
+                                                              TRUE,
+                                                              G_PARAM_READWRITE));
+
        g_object_class_install_property (object_class, PROP_BODY,
                                         g_param_spec_string ("body",
                                                              "Body",
@@ -132,6 +173,13 @@ solipa_mail_ui_class_init (SolipaMailUIClass *klass)
                                                              "",
                                                              G_PARAM_READWRITE));
 
+       g_object_class_install_property (object_class, PROP_BODY_EDITABLE,
+                                        g_param_spec_boolean ("body-editable",
+                                                              "Body field editable",
+                                                              "Body field editable",
+                                                              TRUE,
+                                                              G_PARAM_READWRITE));
+
        /**
         * SolipaMailUI::btn_cancel_clicked:
         * @solipa_mail_ui:
@@ -394,22 +442,42 @@ solipa_mail_ui_set_property (GObject *object,
                                gtk_entry_set_text (GTK_ENTRY (priv->from), g_strstrip (g_value_dup_string (value)));
                                break;
 
+                       case PROP_FROM_EDITABLE:
+                               gtk_entry_set_editable (GTK_ENTRY (priv->from), g_value_get_boolean (value));
+                               break;
+
                        case PROP_TO:
                                gtk_entry_set_text (GTK_ENTRY (priv->to), g_strstrip (g_value_dup_string (value)));
                                break;
 
+                       case PROP_TO_EDITABLE:
+                               gtk_entry_set_editable (GTK_ENTRY (priv->to), g_value_get_boolean (value));
+                               break;
+
                        case PROP_CC:
                                gtk_entry_set_text (GTK_ENTRY (priv->cc), g_strstrip (g_value_dup_string (value)));
                                break;
 
+                       case PROP_CC_EDITABLE:
+                               gtk_entry_set_editable (GTK_ENTRY (priv->cc), g_value_get_boolean (value));
+                               break;
+
                        case PROP_BCC:
                                gtk_entry_set_text (GTK_ENTRY (priv->bcc), g_strstrip (g_value_dup_string (value)));
                                break;
 
+                       case PROP_BCC_EDITABLE:
+                               gtk_entry_set_editable (GTK_ENTRY (priv->bcc), g_value_get_boolean (value));
+                               break;
+
                        case PROP_SUBJECT:
                                gtk_entry_set_text (GTK_ENTRY (priv->subject), g_strstrip (g_value_dup_string (value)));
                                break;
 
+                       case PROP_SUBJECT_EDITABLE:
+                               gtk_entry_set_editable (GTK_ENTRY (priv->subject), g_value_get_boolean (value));
+                               break;
+
                        case PROP_BODY:
                                {
                                        GtkTextBuffer *buffer;
@@ -420,6 +488,10 @@ solipa_mail_ui_set_property (GObject *object,
                                        break;
                                }
 
+                       case PROP_BODY_EDITABLE:
+                               gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->body), g_value_get_boolean (value));
+                               break;
+
                        default:
                                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
                                break;
@@ -445,22 +517,42 @@ solipa_mail_ui_get_property (GObject *object,
                                g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (priv->from)));
                                break;
 
+                       case PROP_FROM_EDITABLE:
+                               g_value_set_boolean (value, gtk_editable_get_editable (GTK_EDITABLE (priv->from)));
+                               break;
+
                        case PROP_TO:
                                g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (priv->to)));
                                break;
 
+                       case PROP_TO_EDITABLE:
+                               g_value_set_boolean (value, gtk_editable_get_editable (GTK_EDITABLE (priv->to)));
+                               break;
+
                        case PROP_CC:
                                g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (priv->cc)));
                                break;
 
+                       case PROP_CC_EDITABLE:
+                               g_value_set_boolean (value, gtk_editable_get_editable (GTK_EDITABLE (priv->cc)));
+                               break;
+
                        case PROP_BCC:
                                g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (priv->bcc)));
                                break;
 
+                       case PROP_BCC_EDITABLE:
+                               g_value_set_boolean (value, gtk_editable_get_editable (GTK_EDITABLE (priv->bcc)));
+                               break;
+
                        case PROP_SUBJECT:
                                g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (priv->subject)));
                                break;
 
+                       case PROP_SUBJECT_EDITABLE:
+                               g_value_set_boolean (value, gtk_editable_get_editable (GTK_EDITABLE (priv->subject)));
+                               break;
+
                        case PROP_BODY:
                                {
                                        GtkTextBuffer *buffer;
@@ -474,6 +566,10 @@ solipa_mail_ui_get_property (GObject *object,
                                        break;
                                }
 
+                       case PROP_BODY_EDITABLE:
+                               g_value_set_boolean (value, gtk_text_view_get_editable (GTK_TEXT_VIEW (priv->body)));
+                               break;
+
                        default:
                                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
                                break;
index 7161cd3d083f9bf609923b3d09fac0934d35a204..f49c5689de51fb8fd397f34a7ce29e6e6e12cf41 100644 (file)
@@ -99,6 +99,7 @@ main (int argc, char *argv[])
        g_object_set (G_OBJECT (mailui),
                      "smtp-uri", "smtp://mail.comune.scandicci.fi.it/",
                      "from", "a.zagli@comune.scandicci.fi.it",
+                     "from-editable", FALSE,
                      "to", "a.zagli@comune.scandicci.fi.it",
                      "subject", "Da SolipaMailUI",
                      "body", "Il body della mail\n"