Minor improvements
This commit is contained in:
parent
6dcf36822d
commit
3034c475e3
|
@ -230,7 +230,7 @@ int account_config_save(Account * account, Config * config)
|
||||||
int account_init(Account * account, GtkTreeStore * store, GtkTreeIter * parent)
|
int account_init(Account * account, GtkTreeStore * store, GtkTreeIter * parent)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "DEBUG: account_init(%p, %p)\n", store, parent);
|
fprintf(stderr, "DEBUG: %s(%p, %p)\n", __func__, store, parent);
|
||||||
#endif
|
#endif
|
||||||
if(account->plugin->init == NULL)
|
if(account->plugin->init == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -242,6 +242,10 @@ int account_init(Account * account, GtkTreeStore * store, GtkTreeIter * parent)
|
||||||
int account_select(Account * account, AccountFolder * folder,
|
int account_select(Account * account, AccountFolder * folder,
|
||||||
AccountMessage * message)
|
AccountMessage * message)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, "DEBUG: %s(\"%s\", %p)\n", __func__, folder->name,
|
||||||
|
message);
|
||||||
|
#endif
|
||||||
if(account->plugin->select == NULL)
|
if(account->plugin->select == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
return account->plugin->select(folder, message);
|
return account->plugin->select(folder, message);
|
||||||
|
|
|
@ -122,6 +122,12 @@ void on_message_delete(GtkWidget * widget, gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void on_message_view_source(GtkWidget * widget, gpointer data)
|
||||||
|
{
|
||||||
|
/* FIXME implement */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* edit menu */
|
/* edit menu */
|
||||||
typedef enum _AccountColumn
|
typedef enum _AccountColumn
|
||||||
{
|
{
|
||||||
|
@ -391,6 +397,9 @@ void on_folder_change(GtkTreeSelection * selection, gpointer data)
|
||||||
-1);
|
-1);
|
||||||
gtk_tree_path_free(path);
|
gtk_tree_path_free(path);
|
||||||
/* display headers */
|
/* display headers */
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, "DEBUG: %s() account_get_store()\n", __func__);
|
||||||
|
#endif
|
||||||
store = account_get_store(mailer->account_cur, mailer->folder_cur);
|
store = account_get_store(mailer->account_cur, mailer->folder_cur);
|
||||||
gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers),
|
gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers),
|
||||||
GTK_TREE_MODEL(store));
|
GTK_TREE_MODEL(store));
|
||||||
|
@ -408,6 +417,9 @@ void on_header_change(GtkTreeSelection * selection, gpointer data)
|
||||||
char * p;
|
char * p;
|
||||||
AccountMessage * message;
|
AccountMessage * message;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, "DEBUG: %s()\n", __func__);
|
||||||
|
#endif
|
||||||
sel = gtk_tree_selection_get_selected_rows(selection, &model);
|
sel = gtk_tree_selection_get_selected_rows(selection, &model);
|
||||||
if(sel == NULL || sel->next != NULL) /* empty or multiple */
|
if(sel == NULL || sel->next != NULL) /* empty or multiple */
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,6 +39,7 @@ void on_message_reply(GtkWidget * widget, gpointer data);
|
||||||
void on_message_reply_to_all(GtkWidget * widget, gpointer data);
|
void on_message_reply_to_all(GtkWidget * widget, gpointer data);
|
||||||
void on_message_forward(GtkWidget * widget, gpointer data);
|
void on_message_forward(GtkWidget * widget, gpointer data);
|
||||||
void on_message_delete(GtkWidget * widget, gpointer data);
|
void on_message_delete(GtkWidget * widget, gpointer data);
|
||||||
|
void on_message_view_source(GtkWidget * widget, gpointer data);
|
||||||
|
|
||||||
/* help menu */
|
/* help menu */
|
||||||
void on_help_about(GtkWidget * widget, gpointer data);
|
void on_help_about(GtkWidget * widget, gpointer data);
|
||||||
|
|
|
@ -219,6 +219,7 @@ static GtkWidget * _new_text_view(Mailer * mailer)
|
||||||
static const char signature[] = "/.signature";
|
static const char signature[] = "/.signature";
|
||||||
static const char prefix[] = "\n-- \n";
|
static const char prefix[] = "\n-- \n";
|
||||||
GtkWidget * textview;
|
GtkWidget * textview;
|
||||||
|
char const * font;
|
||||||
PangoFontDescription * desc;
|
PangoFontDescription * desc;
|
||||||
char const * homedir;
|
char const * homedir;
|
||||||
char * filename;
|
char * filename;
|
||||||
|
@ -228,10 +229,12 @@ static GtkWidget * _new_text_view(Mailer * mailer)
|
||||||
|
|
||||||
textview = gtk_text_view_new();
|
textview = gtk_text_view_new();
|
||||||
/* font */
|
/* font */
|
||||||
desc = pango_font_description_from_string(mailer_get_config(mailer,
|
if((font = mailer_get_config(mailer, "messages_font")) != NULL)
|
||||||
"messages_font"));
|
{
|
||||||
gtk_widget_modify_font(textview, desc);
|
desc = pango_font_description_from_string(font);
|
||||||
pango_font_description_free(desc);
|
gtk_widget_modify_font(textview, desc);
|
||||||
|
pango_font_description_free(desc);
|
||||||
|
}
|
||||||
/* signature */
|
/* signature */
|
||||||
if((homedir = getenv("HOME")) == NULL)
|
if((homedir = getenv("HOME")) == NULL)
|
||||||
return textview;
|
return textview;
|
||||||
|
|
|
@ -56,7 +56,10 @@ static struct _menu _menu_message[] =
|
||||||
{ "Reply to _all", G_CALLBACK(on_message_reply_to_all),
|
{ "Reply to _all", G_CALLBACK(on_message_reply_to_all),
|
||||||
"stock_mail-reply-to-all", 0 },
|
"stock_mail-reply-to-all", 0 },
|
||||||
{ "_Forward", G_CALLBACK(on_message_forward), "stock_mail-forward", 0 },
|
{ "_Forward", G_CALLBACK(on_message_forward), "stock_mail-forward", 0 },
|
||||||
|
{ "", NULL, NULL, 0 },
|
||||||
{ "_Delete", G_CALLBACK(on_message_delete), GTK_STOCK_DELETE, 0 },
|
{ "_Delete", G_CALLBACK(on_message_delete), GTK_STOCK_DELETE, 0 },
|
||||||
|
{ "", NULL, NULL, 0 },
|
||||||
|
{ "_View source", G_CALLBACK(on_message_view_source), NULL, 0 },
|
||||||
{ NULL, NULL, NULL, 0 }
|
{ NULL, NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -202,8 +205,9 @@ Mailer * mailer_new(void)
|
||||||
/* load configuration */
|
/* load configuration */
|
||||||
_new_config_load(mailer);
|
_new_config_load(mailer);
|
||||||
/* show window */
|
/* show window */
|
||||||
gtk_widget_show_all(mailer->window);
|
gtk_widget_show_all(vbox);
|
||||||
gtk_widget_hide(mailer->hdr_vbox);
|
gtk_widget_hide(mailer->hdr_vbox);
|
||||||
|
gtk_widget_show(mailer->window);
|
||||||
mailer->pr_window = NULL;
|
mailer->pr_window = NULL;
|
||||||
return mailer;
|
return mailer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user