2011-11-11 [pawel] 3.7.10cvs83
[claws.git] / src / mainwindow.c
index d226f82618344334065a54a3086c50dbb42dd607..9317cb58445a83d799a25c07a47833bf72850c6e 100644 (file)
@@ -1093,11 +1093,7 @@ void mainwin_accel_changed_cb (GtkAccelGroup *accelgroup, guint keyval, GdkModif
                        
                        if (keyval == GDK_KEY_BackSpace) {
                                const gchar *accel_path;
-#if GTK_CHECK_VERSION(2,14,0)
                                accel_path = gtk_menu_item_get_accel_path(item);
-#else
-                               accel_path = GTK_MENU_ITEM(item)->accel_path;
-#endif
                                keyval = 0; modifier = 0;
                                gtk_accel_map_change_entry (accel_path, keyval, modifier, TRUE);
                        }
@@ -1546,16 +1542,17 @@ MainWindow *main_window_create()
        GtkWidget *offline_pixmap;
        GtkWidget *warning_icon;
        GtkWidget *warning_btn;
-       CLAWS_TIP_DECL();
 #endif
        GtkWidget *online_switch;
        GtkWidget *offline_switch;
        FolderView *folderview;
        SummaryView *summaryview;
        MessageView *messageview;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkColormap *colormap;
-       GdkColor color[4];
        gboolean success[4];
+#endif
+       GdkColor color[4];
        GtkWidget *ac_menu;
        gint i;
 
@@ -2206,12 +2203,14 @@ MainWindow *main_window_create()
        color[2] = folderview->color_new;
        color[3] = folderview->color_op;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        colormap = gdk_drawable_get_colormap(gtk_widget_get_window(window));
        gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success);
        for (i = 0; i < 4; i++) {
                if (success[i] == FALSE)
                        g_warning("MainWindow: color allocation %d failed\n", i);
        }
+#endif
 
        debug_print("done.\n");
 
@@ -2279,12 +2278,6 @@ MainWindow *main_window_create()
 
        ADD_MENU_ACCEL_GROUP_TO_WINDOW(summaryview->popupmenu, mainwin->window);
        
-#ifndef GENERIC_UMPC
-#ifdef G_OS_UNIX
-       gtk_window_iconify(GTK_WINDOW(mainwin->window));
-#endif
-#endif
-
        g_signal_connect(G_OBJECT(window), "window_state_event",
                         G_CALLBACK(mainwindow_state_event_cb), mainwin);
        g_signal_connect(G_OBJECT(window), "visibility_notify_event",
@@ -2297,8 +2290,6 @@ MainWindow *main_window_create()
        }
        summary_update_unread(mainwin->summaryview, NULL);
        
-       gtk_widget_show(mainwin->window);
-
        /* initialize views */
        folderview_init(folderview);
        summary_init(summaryview);
@@ -2950,7 +2941,7 @@ void main_window_get_size(MainWindow *mainwin)
                prefs_common.folderview_width  = allocation.width;
                prefs_common.folderview_height = allocation.height;
        }
-
+       
        gtk_widget_get_allocation(GTK_WIDGET_PTR(mainwin->messageview), &allocation);
        if (allocation.width > 1 && allocation.height > 1 &&
            !prefs_common.mainwin_fullscreen) {
@@ -3606,20 +3597,18 @@ void main_window_popup(MainWindow *mainwin)
 {
        static gboolean first_start = TRUE;
 
-       if (!gtkut_widget_get_visible(GTK_WIDGET(mainwin->window)))
+       if (!gtk_widget_get_visible(GTK_WIDGET(mainwin->window)))
                main_window_show(mainwin);
 
        if (prefs_common.mainwin_maximised)
                gtk_window_maximize(GTK_WINDOW(mainwin->window));
 
        if (first_start) {
-#ifdef G_OS_UNIX
-               gtk_window_deiconify(GTK_WINDOW(mainwin->window));
-#endif
                first_start = FALSE;
        } else {
                gtkut_window_popup(mainwin->window);
        }
+
        if (prefs_common.layout_mode == SMALL_LAYOUT) {
                if (mainwin->in_folder) {
                        mainwindow_enter_folder(mainwin);
@@ -3638,7 +3627,7 @@ void main_window_show(MainWindow *mainwin)
         gtk_window_move(GTK_WINDOW(mainwin->window),
                                  prefs_common.mainwin_x,
                                  prefs_common.mainwin_y);
-
+       
        gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
                             prefs_common.folderview_width,
                             prefs_common.folderview_height);
@@ -4141,12 +4130,12 @@ static void toggle_col_headers_cb(GtkAction *gaction, gpointer data)
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (gaction))) {
                gtk_cmclist_column_titles_show(GTK_CMCLIST(folderview->ctree));
                gtk_cmclist_column_titles_show(GTK_CMCLIST(summaryview->ctree));
-               gtk_cmclist_column_titles_show(GTK_CMCLIST(mimeview->ctree));
+               gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(mimeview->ctree), TRUE);
                prefs_common.show_col_headers = TRUE;
        } else {
                gtk_cmclist_column_titles_hide(GTK_CMCLIST(folderview->ctree));
                gtk_cmclist_column_titles_hide(GTK_CMCLIST(summaryview->ctree));
-               gtk_cmclist_column_titles_hide(GTK_CMCLIST(mimeview->ctree));           
+               gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(mimeview->ctree), FALSE);               
                prefs_common.show_col_headers = FALSE;
        }
 }
@@ -4864,7 +4853,7 @@ static void allsel_cb(GtkAction *action, gpointer data)
        MessageView *msgview = mainwin->messageview;
 
        if (messageview_is_visible(msgview) &&
-                (gtkut_widget_has_focus(msgview->mimeview->textview->text)))
+                (gtk_widget_has_focus(msgview->mimeview->textview->text)))
                messageview_select_all(mainwin->messageview);
        else
                summary_select_all(mainwin->summaryview);