mail-notification

Fork of Jean-Yves Lefort's mail-notification, a tray icon to notify of new mail
git clone https://code.djc.id.au/git/mail-notification/

src/mn-pop3-mailbox-properties.gob (2303B) - raw

      1 /*
      2  * Mail Notification
      3  * Copyright (C) 2003-2008 Jean-Yves Lefort <jylefort@brutele.be>
      4  *
      5  * This program is free software; you can redistribute it and/or modify
      6  * it under the terms of the GNU General Public License as published by
      7  * the Free Software Foundation; either version 3 of the License, or
      8  * (at your option) any later version.
      9  *
     10  * This program is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13  * GNU General Public License for more details.
     14  *
     15  * You should have received a copy of the GNU General Public License along
     16  * with this program; if not, write to the Free Software Foundation, Inc.,
     17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     18  */
     19 
     20 %headertop{
     21 #include "mn-pi-mailbox-properties.h"
     22 %}
     23 
     24 %{
     25 #include <glib/gi18n.h>
     26 #include "mn-mailbox-properties.h"
     27 #include "mn-auth-combo-box.h"
     28 #include "mn-util.h"
     29 #include "mn-authenticated-mailbox-properties-private.h"
     30 #include "mn-pi-mailbox-properties-private.h"
     31 #include "mn-properties-dialog.h"
     32 #include "mn-pop3-mailbox.h"
     33 %}
     34 
     35 class MN:POP3:Mailbox:Properties from MN:PI:Mailbox:Properties
     36 {
     37   property STRING default_name (override)
     38     get
     39     {
     40       const char *username;
     41       const char *server;
     42 
     43       mn_authenticated_mailbox_properties_get_contents(MN_AUTHENTICATED_MAILBOX_PROPERTIES(self),
     44 						       &username,
     45 						       NULL);
     46       mn_pi_mailbox_properties_get_contents(MN_PI_MAILBOX_PROPERTIES(self),
     47 					    NULL,
     48 					    NULL,
     49 					    &server,
     50 					    NULL);
     51 
     52       g_value_take_string(VAL, mn_pop3_mailbox_build_name(username, server));
     53     };
     54 
     55   class_init (class)
     56   {
     57     MNMailboxPropertiesClass *p_class = MN_MAILBOX_PROPERTIES_CLASS(class);
     58 
     59     p_class->type = "pop3";
     60     p_class->combo_label = "POP3";
     61   }
     62 
     63   init (self)
     64   {
     65     MNPIMailboxProperties *pi = MN_PI_MAILBOX_PROPERTIES(self);
     66     int i;
     67 
     68     mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+APOP", "APOP");
     69     mn_auth_combo_box_append(MN_AUTH_COMBO_BOX(pi->auth_combo), "+USERPASS", "USER/PASS");
     70 
     71     for (i = 0; i < MN_PI_MAILBOX_N_CONNECTION_TYPES; i++)
     72       gtk_spin_button_set_value(GTK_SPIN_BUTTON(pi->port_spin[i]), mn_pop3_mailbox_default_ports[i]);
     73   }
     74 }