2010-03-22 [pawel] 3.7.5cvs36

* src/grouplistdialog.c
	* src/prefs_common.c
	* src/prefs_common.h
		- remember newsgroups list dialog size
		- respect use_dotted_lines hidden pref
		- respect use_stripes_everywhere hidden pref
This commit is contained in:
Paweł Pękala 2010-03-22 21:52:15 +00:00
parent b05b0ed425
commit c7456ba3ad
6 changed files with 57 additions and 12 deletions

View file

@ -1,3 +1,12 @@
2010-03-22 [pawel] 3.7.5cvs36
* src/grouplistdialog.c
* src/prefs_common.c
* src/prefs_common.h
- remember newsgroups list dialog size
- respect use_dotted_lines hidden pref
- respect use_stripes_everywhere hidden pref
2010-03-21 [pawel] 3.7.5cvs35
* src/addrgather.c

View file

@ -3976,3 +3976,4 @@
( cvs diff -u -r 1.5.2.29 -r 1.5.2.30 po/zh_CN.po; ) > 3.7.5cvs33.patchset
( cvs diff -u -r 1.115.2.225 -r 1.115.2.226 src/main.c; cvs diff -u -r 1.1.2.89 -r 1.1.2.90 src/gtk/quicksearch.c; cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/gtk/quicksearch.h; ) > 3.7.5cvs34.patchset
( cvs diff -u -r 1.5.10.30 -r 1.5.10.31 src/addrgather.c; cvs diff -u -r 1.83.2.160 -r 1.83.2.161 src/mimeview.c; cvs diff -u -r 1.36.2.183 -r 1.36.2.184 src/common/utils.c; ) > 3.7.5cvs35.patchset
( cvs diff -u -r 1.14.2.24 -r 1.14.2.25 src/grouplistdialog.c; cvs diff -u -r 1.204.2.194 -r 1.204.2.195 src/prefs_common.c; cvs diff -u -r 1.103.2.127 -r 1.103.2.128 src/prefs_common.h; ) > 3.7.5cvs36.patchset

View file

@ -12,7 +12,7 @@ MINOR_VERSION=7
MICRO_VERSION=5
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=35
EXTRA_VERSION=36
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -39,6 +39,7 @@
#include "alertpanel.h"
#include "recv.h"
#include "socket.h"
#include "prefs_common.h"
#define GROUPLIST_DIALOG_WIDTH 450
#define GROUPLIST_DIALOG_HEIGHT 400
@ -66,6 +67,8 @@ static gboolean grouplist_recv_func (SockInfo *sock,
gint count,
gint read_bytes,
gpointer data);
static void grouplist_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint window_deleted (GtkWidget *widget,
GdkEventAny *event,
@ -146,14 +149,12 @@ static void grouplist_dialog_create(void)
GtkWidget *cancel_button;
GtkWidget *refresh_button;
GtkWidget *scrolledwin;
static GdkGeometry geometry;
gchar *titles[3];
gint i;
dialog = gtk_dialog_new();
gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
gtk_widget_set_size_request(dialog,
GROUPLIST_DIALOG_WIDTH,
GROUPLIST_DIALOG_HEIGHT);
gtk_container_set_border_width
(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), 5);
gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
@ -162,10 +163,10 @@ static void grouplist_dialog_create(void)
G_CALLBACK(window_deleted), NULL);
g_signal_connect(G_OBJECT(dialog), "key_press_event",
G_CALLBACK(key_pressed), NULL);
g_signal_connect(G_OBJECT(dialog), "size_allocate",
G_CALLBACK(grouplist_size_allocate), NULL);
MANAGE_WINDOW_SIGNALS_CONNECT(dialog);
gtk_widget_realize(dialog);
vbox = gtk_vbox_new(FALSE, 8);
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
@ -196,21 +197,29 @@ static void grouplist_dialog_create(void)
scrolledwin = gtk_scrolled_window_new(NULL, NULL);
gtk_box_pack_start(GTK_BOX (vbox), scrolledwin, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrolledwin),
GTK_POLICY_ALWAYS,
GTK_POLICY_ALWAYS);
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
titles[0] = _("Newsgroup name");
titles[1] = _("Messages");
titles[2] = _("Type");
ctree = gtk_cmctree_new_with_titles(3, 0, titles);
ctree = gtk_sctree_new_with_titles(3, 0, titles);
gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
gtk_cmclist_set_column_width
(GTK_CMCLIST(ctree), 0, GROUPLIST_COL_NAME_WIDTH);
gtk_cmclist_set_column_auto_resize(GTK_CMCLIST(ctree), 0, TRUE);
gtk_cmclist_set_selection_mode(GTK_CMCLIST(ctree), GTK_SELECTION_MULTIPLE);
gtk_cmctree_set_line_style(GTK_CMCTREE(ctree), GTK_CMCTREE_LINES_DOTTED);
gtk_cmctree_set_expander_style(GTK_CMCTREE(ctree),
GTK_CMCTREE_EXPANDER_SQUARE);
if (prefs_common.enable_dotted_lines) {
gtk_cmctree_set_line_style(GTK_CMCTREE(ctree), GTK_CMCTREE_LINES_DOTTED);
gtk_cmctree_set_expander_style(GTK_CMCTREE(ctree),
GTK_CMCTREE_EXPANDER_SQUARE);
} else {
gtk_cmctree_set_line_style(GTK_CMCTREE(ctree), GTK_CMCTREE_LINES_NONE);
gtk_cmctree_set_expander_style(GTK_CMCTREE(ctree),
GTK_CMCTREE_EXPANDER_TRIANGLE);
}
for (i = 0; i < 3; i++)
GTK_WIDGET_UNSET_FLAGS(GTK_CMCLIST(ctree)->column[i].button,
GTK_CAN_FOCUS);
@ -238,6 +247,17 @@ static void grouplist_dialog_create(void)
g_signal_connect(G_OBJECT(refresh_button), "clicked",
G_CALLBACK(refresh_clicked), NULL);
if (!geometry.min_width) {
geometry.min_width = GROUPLIST_DIALOG_WIDTH;
geometry.min_height = GROUPLIST_DIALOG_HEIGHT;
}
gtk_window_set_geometry_hints(GTK_WINDOW(dialog), NULL, &geometry,
GDK_HINT_MIN_SIZE);
gtk_window_set_default_size(GTK_WINDOW(dialog),
prefs_common.news_subscribe_width,
prefs_common.news_subscribe_height);
gtk_widget_show_all(GTK_DIALOG(dialog)->vbox);
}
@ -483,6 +503,14 @@ static gboolean grouplist_recv_func(SockInfo *sock, gint count, gint read_bytes,
return TRUE;
}
static void grouplist_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
{
cm_return_if_fail( allocation != NULL );
prefs_common.news_subscribe_width = allocation->width;
prefs_common.news_subscribe_height = allocation->height;
}
static gint window_deleted(GtkWidget *widget, GdkEventAny *event, gpointer data)
{
ack = FALSE;

View file

@ -1033,6 +1033,11 @@ static PrefParam param[] = {
{"addrgather_height", "-1", &prefs_common.addrgather_height, P_INT,
NULL, NULL, NULL},
{"news_subscribe_width", "450", &prefs_common.news_subscribe_width, P_INT,
NULL, NULL, NULL},
{"news_subscribe_height", "400", &prefs_common.news_subscribe_height, P_INT,
NULL, NULL, NULL},
/* Hidden */
{"warn_dnd", "1", &prefs_common.warn_dnd, P_INT,
NULL, NULL, NULL},

View file

@ -470,6 +470,8 @@ struct _PrefsCommon
gint aboutwin_height;
gint addrgather_width;
gint addrgather_height;
gint news_subscribe_width;
gint news_subscribe_height;
gint warn_dnd;
gint broken_are_utf8;