2008-10-07 [colin] 3.6.0cvs9
[claws.git] / src / mainwindow.c
index b8705740c6a18282a6e6ed1857a9b967d81d2ae0..0e70e5166e0b99fb3008ddfd27b2595c01efa560 100644 (file)
@@ -692,7 +692,9 @@ static GtkActionEntry mainwin_entries[] =
        {"Tools/SSLCertificates",               NULL, N_("SSL cer_tificates"), NULL, NULL, G_CALLBACK(ssl_manager_open_cb) }, 
 #endif
        /* {"Tools/---",                        NULL, "---", NULL, NULL, NULL }, */
+#ifndef G_OS_WIN32
        {"Tools/FilteringLog",                  NULL, N_("Filtering Lo_g"), NULL, NULL, G_CALLBACK(filtering_debug_window_show_cb) }, 
+#endif
        {"Tools/NetworkLog",                    NULL, N_("Network _Log"), "<shift><control>L", NULL, G_CALLBACK(log_window_show_cb) }, 
        /* {"Tools/---",                        NULL, "---", NULL, NULL, NULL }, */
        {"Tools/ForgetSessionPasswords",                NULL, N_("_Forget all session passwords"), NULL, NULL, G_CALLBACK(forget_session_passwords_cb) }, 
@@ -781,21 +783,21 @@ static GtkRadioActionEntry mainwin_sorttype_radio_entries[] = { /* sort_summary_
 
 static GtkRadioActionEntry mainwin_radio_enc_entries[] =
 {
-       ENC_ACTION(CS_AUTO, C_AUTO, "_Automatic"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_US_ASCII, C_US_ASCII, "7bit ASCII (US-ASC_II)"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_UTF_8, C_UTF_8, "Unicode (_UTF-8)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_AUTO, C_AUTO, N_("_Automatic")), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_US_ASCII, C_US_ASCII, N_("7bit ASCII (US-ASC_II)")), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_UTF_8, C_UTF_8, N_("Unicode (_UTF-8)")), /* RADIO set_charset_cb */
        ENC_ACTION("Western/"CS_ISO_8859_1, C_ISO_8859_1, "ISO-8859-_1"), /* RADIO set_charset_cb */
        ENC_ACTION("Western/"CS_ISO_8859_15, C_ISO_8859_15, "ISO-8859-15"), /* RADIO set_charset_cb */
        ENC_ACTION("Western/"CS_WINDOWS_1252, C_WINDOWS_1252, "Windows-1252"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_ISO_8859_2, C_ISO_8859_2, "Central European (ISO-8859-_2)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_ISO_8859_2, C_ISO_8859_2, N_("Central European (ISO-8859-_2)")), /* RADIO set_charset_cb */
        ENC_ACTION("Baltic/"CS_ISO_8859_13, C_ISO_8859_13, "ISO-8859-13"), /* RADIO set_charset_cb */
        ENC_ACTION("Baltic/"CS_ISO_8859_4, C_ISO_8859_14, "ISO-8859-_4"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_ISO_8859_7, C_ISO_8859_7, "Greek (ISO-8859-_7)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_ISO_8859_7, C_ISO_8859_7, N_("Greek (ISO-8859-_7)")), /* RADIO set_charset_cb */
        ENC_ACTION("Hebrew/"CS_ISO_8859_8, C_ISO_8859_8, "ISO-8859-_8"), /* RADIO set_charset_cb */
        ENC_ACTION("Hebrew/"CS_WINDOWS_1255, C_WINDOWS_1255, "Windows-1255"), /* RADIO set_charset_cb */
        ENC_ACTION("Arabic/"CS_ISO_8859_6, C_ISO_8859_6, "ISO-8859-_6"), /* RADIO set_charset_cb */
        ENC_ACTION("Arabic/"CS_WINDOWS_1256, C_WINDOWS_1256, "Windows-1256"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_ISO_8859_9, C_ISO_8859_9, "Turkish (ISO-8859-_9)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_ISO_8859_9, C_ISO_8859_9, N_("Turkish (ISO-8859-_9)")), /* RADIO set_charset_cb */
        ENC_ACTION("Cyrillic/"CS_ISO_8859_5, C_ISO_8859_5, "ISO-8859-_5"), /* RADIO set_charset_cb */
        ENC_ACTION("Cyrillic/"CS_KOI8_R, C_KOI8_R, "KOI8-_R"), /* RADIO set_charset_cb */
        ENC_ACTION("Cyrillic/"CS_KOI8_U, C_KOI8_U, "KOI8-_U"), /* RADIO set_charset_cb */
@@ -816,7 +818,7 @@ static GtkRadioActionEntry mainwin_radio_enc_entries[] =
 
 static GtkRadioActionEntry mainwin_radio_dec_entries[] =
 {
-       DEC_ACTION("AutoDetect", 0, "_Auto detect"),    /* set_decode_cb */
+       DEC_ACTION("AutoDetect", 0, N_("_Auto detect")),        /* set_decode_cb */
        /* --- */
        DEC_ACTION("8bit", ENC_8BIT, "_8bit"),
        DEC_ACTION("QP", ENC_QUOTED_PRINTABLE, "_Quoted printable"),
@@ -1281,6 +1283,19 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
                        }
                }
                break;
+#ifndef MAEMO
+        case GDK_F11:
+                if (mainwin->fullscreen) {
+                    gtk_window_unfullscreen(GTK_WINDOW(mainwin->window));
+                    mainwin->fullscreen = FALSE;
+                }
+                else {
+                    mainwin->fullscreen = TRUE;
+                    gtk_window_fullscreen(GTK_WINDOW(mainwin->window));
+                }
+                break;
+#endif
+
 #ifdef MAEMO
        case GDK_F6:
                if (maemo_mainwindow_is_fullscreen(widget)) {
@@ -1541,7 +1556,7 @@ MainWindow *main_window_create()
 #ifndef MAEMO
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menu", NULL, GTK_UI_MANAGER_MENUBAR)
 #else
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menu", NULL, GTK_UI_MANAGER_MENU)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menu", NULL, GTK_UI_MANAGER_POPUP)
 #endif
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "File", "File", GTK_UI_MANAGER_MENU)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "Edit", "Edit", GTK_UI_MANAGER_MENU)
@@ -1852,7 +1867,9 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "SSLCertificates", "Tools/SSLCertificates", GTK_UI_MANAGER_MENUITEM)
 #endif
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator7", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
+#ifndef G_OS_WIN32
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "FilteringLog", "Tools/FilteringLog", GTK_UI_MANAGER_MENUITEM)
+#endif
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "NetworkLog", "Tools/NetworkLog", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator8", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "ForgetSessionPasswords", "Tools/ForgetSessionPasswords", GTK_UI_MANAGER_MENUITEM)
@@ -2150,6 +2167,9 @@ MainWindow *main_window_create()
        }
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
 
+       toolbar_set_style(mainwin->toolbar->toolbar, 
+                         mainwin->handlebox, 
+                         prefs_common.toolbar_style);
 #ifndef GENERIC_UMPC
        gtk_widget_hide(mainwin->hbox_stat);
        menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/StatusBar");
@@ -2230,6 +2250,8 @@ MainWindow *main_window_create()
 #ifdef MAEMO
        main_window_install_maemo_hooks(mainwin);
 #endif
+        mainwin->fullscreen = FALSE;
+
        return mainwin;
 }
 
@@ -2806,8 +2828,12 @@ void main_window_get_size(MainWindow *mainwin)
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation);
-
-       if (allocation->width > 1 && allocation->height > 1) {
+       
+       if (mainwin->fullscreen) {
+               debug_print("mainwin in full screen state. "
+                           "Keeping original settings\n");
+       }
+       if (allocation->width > 1 && allocation->height > 1 && !mainwin->fullscreen) {
                prefs_common.summaryview_width = allocation->width;
 
                if (messageview_is_visible(mainwin->messageview))
@@ -2818,20 +2844,22 @@ void main_window_get_size(MainWindow *mainwin)
 
        allocation = &mainwin->window->allocation;
        if (allocation->width > 1 && allocation->height > 1 &&
-           !prefs_common.mainwin_maximised) {
+           !prefs_common.mainwin_maximised && !mainwin->fullscreen) {
                prefs_common.mainview_height = allocation->height;
                prefs_common.mainwin_width   = allocation->width;
                prefs_common.mainwin_height  = allocation->height;
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->folderview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1) {
+       if (allocation->width > 1 && allocation->height > 1 &&
+           !mainwin->fullscreen) {
                prefs_common.folderview_width  = allocation->width;
                prefs_common.folderview_height = allocation->height;
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->messageview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1) {
+       if (allocation->width > 1 && allocation->height > 1 &&
+           !mainwin->fullscreen) {
                prefs_common.msgview_width = allocation->width;
                prefs_common.msgview_height = allocation->height;
        }
@@ -2851,7 +2879,7 @@ void main_window_get_position(MainWindow *mainwin)
 {
        gint x, y;
 
-       if (prefs_common.mainwin_maximised)
+       if (prefs_common.mainwin_maximised || mainwin->fullscreen)
                return;
 
        gtkut_widget_get_uposition(mainwin->window, &x, &y);
@@ -3045,15 +3073,11 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
        if (prefs_common.layout_mode != SMALL_LAYOUT || mainwin->in_folder)
                state |= M_IN_MSGLIST;
 
-       if (prefs_common.session_passwords) {
-               GList *list = NULL;
-
-               for (list = account_get_list(); list != NULL; list = list->next) {
-                       PrefsAccount *account = list->data;
-                       if (account->session_passwd || account->session_smtp_passwd) {
-                               state |= M_SESSION_PASSWORDS;
-                               break;
-                       }
+       for (account_list = account_get_list(); account_list != NULL; account_list = account_list->next) {
+               PrefsAccount *account = account_list->data;
+               if (account->session_passwd || account->session_smtp_passwd) {
+                       state |= M_SESSION_PASSWORDS;
+                       break;
                }
        }