*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
static gint account_delete_event (GtkWidget *widget,
GdkEventAny *event,
gpointer data);
+static void account_size_allocate_cb(GtkWidget *widget,
+ GtkAllocation *allocation);
static gboolean account_key_pressed (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
debug_print("Reading all config for each account...\n");
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACCOUNT_RC, NULL);
- if ((fp = fopen(rcpath, "rb")) == NULL) {
+ if ((fp = g_fopen(rcpath, "rb")) == NULL) {
if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
g_free(rcpath);
return;
main_window_set_account_menu(account_list);
}
+void account_set_menu_only_toolbar(void)
+{
+ main_window_set_account_menu_only_toolbar(account_list);
+}
+
void account_foreach(AccountFunc func, gpointer user_data)
{
GList *cur;
}
}
+/*!
+ *\brief Save Gtk object size to prefs dataset
+ */
+static void account_size_allocate_cb(GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ g_return_if_fail(allocation != NULL);
+
+ prefs_common.accountswin_width = allocation->width;
+ prefs_common.accountswin_height = allocation->height;
+}
static void account_edit_create(void)
{
GtkWidget *hbbox;
GtkWidget *close_btn;
+ static GdkGeometry geometry;
+
debug_print("Creating account edit window...\n");
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_widget_set_size_request (window, 500, 350);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_window_set_title (GTK_WINDOW (window), _("Edit accounts"));
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
account_create_list_view_images(list_view);
+ g_signal_connect(G_OBJECT(window), "size_allocate",
+ G_CALLBACK(account_size_allocate_cb), NULL);
+
+ if (!geometry.min_height) {
+ geometry.min_width = 500;
+ geometry.min_height = 350;
+ }
+
+ gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+ GDK_HINT_MIN_SIZE);
+ gtk_widget_set_size_request(window, prefs_common.accountswin_width,
+ prefs_common.accountswin_height);
+
edit_account.window = window;
edit_account.list_view = list_view;
edit_account.close_btn = close_btn;