#include "selective_download.h"
#include "ssl_manager.h"
#include "sslcertwindow.h"
+#include "prefswindow.h"
+#include "pluginwindow.h"
#define AC_LABEL_WIDTH 240
static void account_menu_cb (GtkMenuItem *menuitem,
gpointer data);
+static void prefs_open_cb (GtkMenuItem *menuitem,
+ gpointer data);
+static void plugins_open_cb (GtkMenuItem *menuitem,
+ gpointer data);
+
static void online_switch_clicked(GtkButton *btn,
gpointer data);
guint action,
GtkWidget *widget );
+static gboolean mainwindow_focus_in_event (GtkWidget *widget,
+ GdkEventFocus *focus,
+ gpointer data);
+
#define SEPARATE_ACTION 500
static GtkItemFactoryEntry mainwin_entries[] =
NULL, account_edit_open, 0, NULL},
{N_("/_Configuration/C_hange current account"),
NULL, NULL, 0, "<Branch>"},
+ {N_("/_Configuration/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Configuration/Preferences..."), NULL, prefs_open_cb, 0, NULL},
+ {N_("/_Configuration/Plugins..."), NULL, plugins_open_cb, 0, NULL},
{N_("/_Help"), NULL, NULL, 0, "<Branch>"},
{N_("/_Help/_Manual (Local)"), NULL, manual_open_cb, MANUAL_MANUAL_LOCAL, NULL},
gtk_signal_connect(GTK_OBJECT(window), "delete_event",
GTK_SIGNAL_FUNC(main_window_close_cb), mainwin);
MANAGE_WINDOW_SIGNALS_CONNECT(window);
+ gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
+ GTK_SIGNAL_FUNC(mainwindow_focus_in_event),
+ mainwin);
gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
GTK_SIGNAL_FUNC(mainwindow_key_pressed), mainwin);
main_window_reflect_prefs_all();
}
+static void prefs_open_cb(GtkMenuItem *menuitem, gpointer data)
+{
+ prefswindow_create();
+}
+
+static void plugins_open_cb(GtkMenuItem *menuitem, gpointer data)
+{
+ pluginwindow_create();
+}
+
static void manual_open_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
g_free(str);
}
+static gboolean mainwindow_focus_in_event(GtkWidget *widget, GdkEventFocus *focus,
+ gpointer data)
+{
+ SummaryView *summary;
+
+ g_return_val_if_fail(data, FALSE);
+
+ if (gtk_grab_get_current())
+ return FALSE;
+
+ summary = ((MainWindow *)data)->summaryview;
+ g_return_val_if_fail(summary, FALSE);
+ if (summary->selected != summary->displayed)
+ summary_select_node(summary, summary->displayed, FALSE, TRUE);
+ return FALSE;
+}
+
#define BREAK_ON_MODIFIER_KEY() \
if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break