From 03a3e6f84638c62c7848eee4d6f71cc4b1a7c1b8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 16 Jul 2008 19:37:02 +0000 Subject: Disable all components and plugins. Begin rewriting the shell. svn path=/branches/kill-bonobo/; revision=35748 --- shell/e-shell-window-actions.c | 1205 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1205 insertions(+) create mode 100644 shell/e-shell-window-actions.c (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c new file mode 100644 index 0000000000..580f147920 --- /dev/null +++ b/shell/e-shell-window-actions.c @@ -0,0 +1,1205 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- + * e-shell-window-actions.c + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "e-shell-window-private.h" + +#include "e-shell.h" +#include "e-shell-importer.h" + +#include "e-util/e-dialog-utils.h" +#include "e-util/e-error.h" +#include "e-util/e-print.h" + +#include +#include + +#define EVOLUTION_COPYRIGHT \ + "Copyright \xC2\xA9 1999 - 2008 Novell, Inc. and Others" + +#define EVOLUTION_FAQ \ + "http://www.go-evolution.org/FAQ" + +#define EVOLUTION_WEBSITE \ + "http://www.gnome.org/projects/evolution/" + +/* Authors and Documenters + * + * The names below must be in UTF8. The breaking of escaped strings + * is so the hexadecimal sequences don't swallow too many characters. + * + * SO THAT MEANS, FOR 8-BIT CHARACTERS USE \xXX HEX ENCODING ONLY! + * + * Not all environments are UTF8 and not all editors can handle it. + */ +static const gchar *authors[] = { + "Aaron Weber", + "Abel Cheung", + "Abhishek Parwal", + "Adam Weinberger", + "Adi Attar", + "Ahmad Riza H Nst", + "Aidan Delaney", + "Aishwarya K", + "Akagic Amila", + "Akhil Laddha", + "Akira Tagoh", + "Alastair McKinstry", + "Alastair Tse", + "Alejandro Andres", + "Alessandro Decina", + "Alex Graveley", + "Alex Jiang", + "Alex Jones", + "Alex Kloss", + "Alexander Shopov", + "Alfred Peng", + "Ali Abdin", + "Ali Akcaagac", + "Almer S. Tigelaar", + "Amish", + "Anand V M", + "Anders Carlsson", + "Andre Klapper", + "Andrea Campi", + "Andreas Henriksson", + "Andreas Hyden", + "Andreas J. Guelzow", + "Andreas K\xC3\xB6hler", + "Andreas Köhler", + "Andrew Ruthven", + "Andrew T. Veliath", + "Andrew Wu", + "Ankit Patel", + "Anna Marie Dirks", + "Antonio Xu", + "Arafat Medini", + "Arangel Angov", + "Archit Baweja", + "Ariel Rios", + "Arik Devens", + "Armin Bauer", + "Arturo Espinosa Aldama", + "Arulanandan P", + "Arun Prakash", + "Arvind Sundararajan", + "Arvind", + "Ashish", + "B S Srinidhi", + "Bastien Nocera", + "Behnam Esfahbod", + "Ben Gamari", + "Benjamin Berg", + "Benjamin Kahn", + "Benoît Dejean", + "Bernard Leach", + "Bertrand Guiheneuf", + "Bharath Acharya", + "Bill Zhu", + "Bj\xC3\xB6rn Torkelsson", + "Björn Lindqvist", + "Bob Doan", + "Bob Mauchin", + "Boby Wang", + "Bolian Yin", + "Brian Mury", + "Brian Pepple", + "Bruce Tao", + "Calvin Liu", + "Cantona Su", + "Carl Sun", + "Carlos Garcia Campos", + "Carlos Garnacho Parro", + "Carlos Perell\xC3\xB3" " Mar\xC3\xAD" "n", + "Carsten Guenther", + "Carsten Schaar", + "Changwoo Ryu", + "Chao-Hsiung Liao", + "Charles Zhang", + "Chema Celorio", + "Chenthill Palanisamy", + "Chpe", + "Chris Halls", + "Chris Heath", + "Chris Phelps", + "Chris Toshok", + "Christian Hammond", + "Christian Kellner", + "Christian Kirbach", + "Christian Krause", + "Christian Kreibich", + "Christian Neumair", + "Christophe Fergeau", + "Christophe Merlet", + "Christopher Blizzard", + "Christopher J. Lahey", + "Christopher R. Gabriel", + "Claude Paroz", + "Claudio Saavedra", + "Clifford R. Conover", + "Cody Russell", + "Colin Leroy", + "Craig Small", + "Dafydd Harries", + "Damian Ivereigh", + "Damien Carbery", + "Damon Chaplin", + "Dan Berger", + "Dan Damian", + "Dan Nguyen", + "Dan Winship", + "Daniel Gryniewicz", + "Daniel Nylander", + "Daniel van Eeden", + "Daniel Veillard", + "Daniel Yacob", + "Danilo \xC5\xA0" "egan", + "Danilo Segan", + "Darin Adler", + "Dave Benson", + "Dave Camp", + "Dave Fallon", + "Dave Malcolm", + "Dave West", + "David Farning", + "David Kaelbling", + "David Malcolm", + "David Moore", + "David Mosberger", + "David Richards", + "David Trowbridge", + "David Turner", + "David Woodhouse", + "Denis Washington", + "Devashish Sharma", + "Diego Escalante Urrelo", + "Diego Gonzalez", + "Diego Sevilla Ruiz", + "Dietmar Maurer", + "Dinesh Layek", + "Djihed Afifi", + "Dmitry Mastrukov", + "Dodji Seketeli", + "Duarte Loreto", + "Dulmandakh Sukhbaatar", + "Duncan Mak", + "Ebby Wiselyn", + "Ed Catmur", + "Edd Dumbill", + "Edgar Luna Díaz", + "Edward Rudd", + "Elijah Newren", + "Elizabeth Greene", + "Elliot Lee", + "Elliot Turner", + "Eneko Lacunza", + "Enver Altin", + "Erdal Ronahi", + "Eric Busboom", + "Eric Zhao", + "Eskil Heyn Olsen", + "Ettore Perazzoli", + "Evan Yan", + "Fatih Demir", + "Fazlu & Hannah", + "Federico Mena Quintero", + "Fernando Herrera", + "Francisco Javier F. Serrador", + "Frank Arnold", + "Frank Belew", + "Frederic Crozat", + "Frederic Peters", + "Funda Wang", + "Gabor Kelemen", + "Ganesh", + "Gareth Owen", + "Gary Coady", + "Gary Ekker", + "Gavin Scott", + "Gediminas Paulauskas", + "Gerg\xC5\x91 \xC3\x89rdi", + "George Lebl", + "Gerardo Marin", + "Gert Kulyk", + "Giancarlo Capella", + "Gil Osher", + "Gilbert Fang", + "Gilles Dartiguelongue", + "Grahame Bowland", + "Greg Hudson", + "Gregory Leblanc", + "Gregory McLean", + "Grzegorz Goawski", + "Gustavo Gir\xC3\x8E" "ldez", + "Gustavo Maciel Dias Vieira", + "H P Nadig", + "H\xC3\xA9" "ctor Garc\xC3\xAD" "a \xC3\x81" "lvarez", + "Hans Petter Jansson", + "Hao Sheng", + "Hari Prasad Nadig", + "Harish K", + "Harish Krishnaswamy", + "Harry Lu", + "Hasbullah Bin Pit", + "Havoc Pennington", + "Heath Harrelson", + "Hein-Pieter van Braam", + "Herbert V. Riedel", + "Hiroyuki Ikezoe", + "Iain Buchanan", + "Iain Holmes", + "Ian Campbell", + "Ilkka Tuohela", + "Irene Huang", + "Ismael Olea", + "Israel Escalante", + "Iv\xC3\xA1" "n Frade", + "Iván Frade", + "J.H.M. Dassen (Ray)", + "JP Rosevear", + "J\xC3\xBC" "rg Billeter", + "Jürg Billeter", + "Jack Jia", + "Jacob Ulysses Berkman", + "Jacob Berkman", + "Jaka Mocnik", + "Jakub Steiner", + "James Doc Livingston", + "James Bowes", + "James Henstridge", + "James Willcox", + "Jan Arne Petersen", + "Jan Tichavsky", + "Jan Van Buggenhout", + "Jared Moore", + "Jarkko Ranta", + "Jason Leach", + "Jason Tackaberry", + "Jayaradha", + "Jean-Noel Guiheneuf", + "Jedy Wang", + "Jeff Bailey", + "Jeff Cai", + "Jeff Garzik", + "Jeffrey Stedfast", + "Jens Granseuer", + "Jens Seidel", + "Jeremy Katz", + "Jeremy Wise", + "Jerome Lacoste", + "Jerry Yu", + "Jes\xC3\xBA" "s Bravo \xC3\x81" "lvarez", + "Jesse Pavel", + "Ji Lee", + "Joan Sanfeliu", + "Jody Goldberg", + "Joe Marcus Clarke", + "Joe Shaw", + "John Gotts", + "Johnny Jacob", + "Johnny", + "Jon Ander Hernandez", + "Jon K Hellan", + "Jon Oberheide", + "Jon Trowbridge", + "Jonas Borgstr", + "Jonathan Blandford", + "Jonathan Dieter", + "Jos Dehaes", + "Josselin Mouette", + "JP Rosvear", + "Jukka Zitting", + "Jules Colding", + "Julian Missig", + "Julio M. Merino Vidal", + "Jürg Billeter", + "Karl Eichwalder", + "Karl Relton", + "Karsten Br\xC3\xA4" "ckelmann", + "Kaushal Kumar", + "Kenneth Christiansen", + "Kenny Graunke", + "Keshav Upadhyaya", + "Kevin Breit", + "Kevin Piche", + "Kevin Vandersloot", + "Khasim Shaheed", + "Kidd Wang", + "Kjartan Maraas", + "Krishnan R", + "Krisztian Pifko", + "Kyle Ambroff", + "Larry Ewing", + "Laszlo (Laca) Peter", + "Laurent Dhima", + "Lauris Kaplinski", + "Leon Zhang", + "Li Yuan", + "Loïc Minier", + "Loïc Minier", + "Lorenzo Gil Sanchez", + "Luca Ferretti", + "Lucky Wankhede", + "Luis Villa", + "Lutz M", + "M Victor Aloysius J", + "Maciej Stachowiak", + "Makuchaku", + "Malcolm Tredinnick", + "Marco Pesenti Gritti", + "Marius Andreiana", + "Marius Vollmer", + "Mark Crichton", + "Mark G. Adams", + "Mark Gordon", + "Mark McLoughlin", + "Mark Moulder", + "Mark Tearle", + "Martha Burke", + "Martin Baulig", + "Martin Hicks", + "Martin Meyer", + "Martin Norb\xC3\xA4" "ck", + "Martyn Russell", + "Masahiro Sakai", + "Mathieu Lacage", + "Matias Mutchinick", + "Matt Bissiri", + "Matt Brown", + "Matt Loper", + "Matt Martin", + "Matt Wilson", + "Matthew Barnes", + "Matthew Daniel", + "Matthew Hall", + "Matthew Loper", + "Matthew Wilson", + "Matthias Clasen", + "Max Horn", + "Maxx Cao", + "Mayank Jain", + "Meilof Veeningen", + "Mengjie Yu", + "Michael Granger", + "Michael M. Morrison", + "Michael MacDonald", + "Michael Meeks", + "Michael Monreal", + "Michael Terry", + "Michael Zucchi", + "Michel Daenzer", + "Miguel Angel Lopez Hernandez", + "Miguel de Icaza", + "Mikael Hallendal", + "Mikael Nilsson", + "Mike Castle", + "Mike Kestner", + "Mike McEwan", + "Mikhail Zabaluev", + "Milan Crha", + "Miles Lane", + "Mohammad Damt", + "Morten Welinder", + "Mubeen Jukaku", + "Murray Cumming", + "Naba Kumar", + "Nagappan Alagappan", + "Nancy Cai", + "Nat Friedman", + "Nathan Owens", + "Nicel KM", + "Nicholas J Kreucher", + "Nicholas Miell", + "Nick Sukharev", + "Nickolay V. Shmyrev", + "Nike Gerdts", + "Noel", + "Nuno Ferreira", + "Nyall Dawson", + "Ondrej Jirman", + "Oswald Rodrigues", + "Owen Taylor", + "Oystein Gisnas", + "P Chenthill", + "P S Chakravarthi", + "Pablo Gonzalo del Campo", + "Pablo Saratxaga", + "Pamplona Hackers", + "Paolo Molaro", + "Parag Goel", + "Parthasarathi Susarla", + "Pascal Terjan", + "Patrick Ohly", + "Paul Bolle", + "Paul Lindner", + "Pavel Cisler", + "Pavel Roskin", + "Pavithran", + "Pawan Chitrakar", + "Pedro Villavicencio", + "Peter Pouliot", + "Peter Teichman", + "Peter Williams", + "Peteris Krisjanis", + "Petta Pietikainen", + "Phil Goembel", + "Philip Van Hoof", + "Philip Zhao", + "Poornima Nayak", + "Pratik V. Parikh", + "Praveen Kumar", + "Priit Laes", + "Priyanshu Raj", + "Radek Doul\xC3\xADk", + "Raghavendran R", + "Raja R Harinath", + "Rajeev Ramanathan", + "Rajesh Ranjan", + "Rakesh k.g", + "Ramiro Estrugo", + "Ranjan Somani", + "Ray Strode", + "Rhys Jones", + "Ricardo Markiewicz", + "Richard Boulton", + "Richard Hult", + "Richard Li", + "Rob Bradford", + "Robert Brady", + "Robert Sedak", + "Robin Slomkowski", + "Rodney Dawes", + "Rodrigo Moya", + "Rohini S", + "Rohini", + "Roland Illig", + "Ronald Kuetemeier", + "Roozbeh Pournader", + "Ross Burton", + "Rouslan Solomakhin", + "Runa Bhattacharjee", + "Russell Steinthal", + "Rusty Conover", + "Ryan P. Skadberg", + "S Antony Vincent Pandian", + "S N Tejasvi", + "S. \xC3\x87" "a\xC4\x9F" "lar Onur", + "S.Antony Vincent Pandian", + "S. Caglar Onur", + "Sam Creasey", + "Sam Yang", + "Sam\xC3\xBA" "el J\xC3\xB3" "n Gunnarsson", + "Sankar P", + "Sanlig Badral", + "Sanshao Jiang", + "Sarfraaz Ahmed", + "Sayamindu Dasgupta", + "Sean Atkinson", + "Sean Gao", + "Sebastian Rittau", + "Sebastian Wilhelmi", + "Sebastien Bacher", + "Sergey Panov", + "Seth Alves", + "Seth Nickell", + "Shakti Sen", + "Shi Pu", + "Shilpa C", + "Shree Krishnan", + "Shreyas Srinivasan", + "Simon Zheng", + "Simos Xenitellis", + "Sivaiah Nallagatla", + "Srinivasa Ragavan", + "Stanislav Brabec", + "Stanislav Visnovsky", + "Stéphane Raimbault", + "Stephen Cook", + "Steve Murphy", + "Steven Zhang", + "Stuart Parmenter", + "Subodh Soni", + "Suman Manjunath", + "Sunil Mohan Adapa", + "Suresh Chandrasekharan", + "Sushma Rai", + "Sven Herzberg", + "Szabolcs Ban", + "T\xC3\xB5" "ivo Leedj\xC3\xA4" "rv", + "Takao Fujiwara", + "Takayuki Kusano", + "Takeshi Aihana", + "Tambet Ingo", + "Taylor Hayward", + "Ted Percival", + "Theppitak Karoonboonyanan", + "Thomas Cataldo", + "Thomas Klausner", + "Thomas Mirlacher", + "Thouis R. Jones", + "Tim Wo", + "Tim Yamin", + "Timo Hoenig", + "Timo Sirainen", + "Timothy Lee", + "Timur Bakeyev", + "Tino Meinen", + "Tobias Mueller", + "Tõivo Leedjärv", + "Tom Tromey", + "Tomas Ogren", + "Tomasz K\xC5\x82" "oczko", + "Tomislav Vujec", + "Tommi Komulainen", + "Tommi Vainikainen", + "Tony Tsui", + "Tor Lillqvist", + "Trent Lloyd", + "Tuomas J. Lukka", + "Tuomas Kuosmanen", + "Ulrich Neumann", + "Umesh Tiwari", + "Umeshtej", + "Ushveen Kaur", + "V Ravi Kumar Raju", + "Vadim Strizhevsky", + "Valek Filippov", + "Vandana Shenoy .B", + "Vardhman Jain", + "Veerapuram Varadhan", + "Vincent Noel", + "Vincent van Adrighem", + "Viren", + "Vivek Jain", + "Vladimer Sichinava", + "Vladimir Vukicevic", + "Wadim Dziedzic", + "Wang Jian", + "Wang Xin", + "Wayne Davis", + "William Jon McCann", + "Wouter Bolsterlee", + "Xan Lopez", + "Xiurong Simon Zheng", + "Yanko Kaneti", + "Yi Jin", + "Yong Sun", + "Yu Mengjie", + "Yuedong Du", + "Yukihiro Nakai", + "Yuri Pankov", + "Yuri Syrota", + "Zach Frey", + "Zan Lynx", + "Zbigniew Chyla", + "\xC3\x98ystein Gisn\xC3\xA5s", + "\xC5\xBDygimantas Beru\xC4\x8Dka", + NULL +}; + +static const gchar *documenters[] = { + "Aaron Weber", + "Binika Preet", + "Dan Winship", + "David Trowbridge", + "Jessica Prabhakar", + "JP Rosevear", + "Radhika Nair", + NULL +}; + +static void +action_about_cb (GtkAction *action, + EShellWindow *window) +{ + gchar *translator_credits; + + /* The translator-credits string is for translators to list + * per-language credits for translation, displayed in the + * about dialog. */ + translator_credits = _("translator-credits"); + if (strcmp (translator_credits, "translator-credits") == 0) + translator_credits = NULL; + + gtk_show_about_dialog ( + GTK_WINDOW (window), + "program-name", "Evolution", + "version", VERSION, + "copyright", EVOLUTION_COPYRIGHT, + "comments", _("Groupware Suite"), + "website", EVOLUTION_WEBSITE, + "website-label", _("Evolution Website"), + "authors", authors, + "documenters", documenters, + "translator-credits", translator_credits, + "logo-icon-name", "evolution", + NULL); +} + +static void +action_close_cb (GtkAction *action, + EShellWindow *window) +{ + if (e_shell_request_close_window (window)) + gtk_widget_destroy (GTK_WIDGET (window)); +} + +static void +action_faq_cb (GtkAction *action, + EShellWindow *window) +{ + GError *error = NULL; + + gtk_show_uri (NULL, EVOLUTION_FAQ, GDK_CURRENT_TIME, &error); + + if (error != NULL) { + /* FIXME Show an error dialog. */ + g_warning ("%s", error->message); + g_error_free (error); + } +} + +static void +action_forget_passwords_cb (GtkAction *action, + EShellWindow *window) +{ + gint response; + + response = e_error_run ( + GTK_WINDOW (window), "shell:forget-passwords", NULL); + + if (response == GTK_RESPONSE_OK) + e_passwords_forget_passwords (); +} + +static void +action_import_cb (GtkAction *action, + EShellWindow *window) +{ + e_shell_importer_start_import (window); +} + +static void +action_new_window_cb (GtkAction *action, + EShellWindow *window) +{ + e_shell_create_window (); +} + +static void +action_page_setup_cb (GtkAction *action, + EShellWindow *window) +{ + e_print_run_page_setup_dialog (GTK_WINDOW (window)); +} + +static void +action_preferences_cb (GtkAction *action, + EShellWindow *window) +{ + e_shell_show_preferences (GTK_WINDOW (window)); +} + +static void +action_quick_reference_cb (GtkAction *action, + EShellWindow *window) +{ + const gchar * const *language_names; + + language_names = g_get_language_names (); + while (*language_names != NULL) { + const gchar *language = *language_names++; + gchar *filename; + + /* This must be a valid language AND a language with + * no encoding suffix. The next language should have + * no encoding suffix. */ + if (language == NULL || strchr (language, '.') != NULL) + continue; + + filename = g_build_filename ( + EVOLUTION_HELPDIR, "quickref", + language, "quickref.pdf", NULL); + + if (g_file_test (filename, G_FILE_TEST_EXISTS)) { + GFile *file; + gchar *uri; + GError *error = NULL; + + file = g_file_new_for_path (filename); + uri = g_file_get_uri (file); + + g_app_info_launch_default_for_uri (uri, NULL, &error); + + if (error != NULL) { + /* FIXME Show an error dialog. */ + g_warning ("%s", error->message); + g_error_free (error); + } + + g_object_unref (file); + g_free (uri); + } + + g_free (filename); + } +} + +static void +action_quit_cb (GtkAction *action, + EShellWindow *window) +{ + e_shell_quit (); +} + +static void +action_send_receive_cb (GtkAction *action, + EShellWindow *window) +{ + e_shell_send_receive (GTK_WINDOW (window)); +} + +static void +action_shell_view_cb (GtkRadioAction *action, + GtkRadioAction *current, + EShellWindow *window) +{ + gint value; + + if (action != current) + return; + + value = gtk_radio_action_get_current_value (action); +} + +static void +action_show_buttons_cb (GtkToggleAction *action, + EShellWindow *window) +{ + ESidebar *sidebar; + gboolean active; + + sidebar = E_SIDEBAR (window->priv->sidebar); + active = gtk_toggle_action_get_active (action); + e_sidebar_set_actions_visible (sidebar, active); +} + +static void +action_show_sidebar_cb (GtkToggleAction *action, + EShellWindow *window) +{ + GtkWidget *widget; + gboolean active; + + widget = window->priv->sidebar_notebook; + active = gtk_toggle_action_get_active (action); + g_object_set (widget, "visible", active, NULL); +} + +static void +action_show_statusbar_cb (GtkToggleAction *action, + EShellWindow *window) +{ + GtkWidget *widget; + gboolean active; + + widget = window->priv->status_area; + active = gtk_toggle_action_get_active (action); + g_object_set (widget, "visible", active, NULL); +} + +static void +action_show_toolbar_cb (GtkToggleAction *action, + EShellWindow *window) +{ + GtkWidget *widget; + gboolean active; + + widget = window->priv->main_toolbar; + active = gtk_toggle_action_get_active (action); + g_object_set (widget, "visible", active, NULL); +} + +static void +action_submit_bug_cb (GtkAction *action, + EShellWindow *window) +{ + const gchar *command_line; + GError *error = NULL; + + command_line = "bug-buddy --sm-disable --package=Evolution"; + + g_debug ("Spawning: %s", command_line); + g_spawn_command_line_async (command_line, &error); + + if (error != NULL) { + const gchar *message; + + if (error->code == G_SPAWN_ERROR_NOENT) + message = _("Bug Buddy is not installed."); + else + message = _("Bug Buddy could not be run."); + e_notice (window, GTK_MESSAGE_ERROR, message); + g_error_free (error); + } +} + +static void +action_sync_options_cb (GtkAction *action, + EShellWindow *window) +{ + const gchar *command_line; + GError *error = NULL; + + command_line = "gpilotd-control-applet"; + + g_debug ("Spawning: %s", command_line); + g_spawn_command_line_async (command_line, &error); + + if (error != NULL) { + const gchar *message; + + if (error->code == G_SPAWN_ERROR_NOENT) + message = _("GNOME Pilot is not installed."); + else + message = _("GNOME Pilot could not be run."); + e_notice (window, GTK_MESSAGE_ERROR, message); + g_error_free (error); + } +} + +static void +action_work_offline_cb (GtkAction *action, + EShellWindow *window) +{ + e_shell_go_offline (); +} + +static void +action_work_online_cb (GtkAction *action, + EShellWindow *window) +{ + e_shell_go_online (); +} + +static GtkActionEntry shell_entries[] = { + + { "about", + GTK_STOCK_ABOUT, + N_("_About"), + NULL, + N_("Show information about Evolution"), + G_CALLBACK (action_about_cb) }, + + { "close", + GTK_STOCK_CLOSE, + N_("_Close Window"), + "w", + N_("Close this window"), + G_CALLBACK (action_close_cb) }, + + { "faq", + GTK_STOCK_DIALOG_INFO, + N_("Evolution _FAQ"), + NULL, + N_("Open the Frequently Asked Questions webpage"), + G_CALLBACK (action_faq_cb) }, + + { "forget-passwords", + NULL, + N_("_Forget Passwords"), + NULL, + N_("Forget all remembered passwords"), + G_CALLBACK (action_forget_passwords_cb) }, + + { "import", + "stock_mail-import", + N_("I_mport..."), + NULL, + N_("Import data from other programs"), + G_CALLBACK (action_import_cb) }, + + { "new-window", + "window-new", + N_("New _Window"), + "w", + N_("Create a new window displaying this view"), + G_CALLBACK (action_new_window_cb) }, + + { "page-setup", + GTK_STOCK_PAGE_SETUP, + N_("Page Set_up..."), + NULL, + N_("Change the page settings for your current printer"), + G_CALLBACK (action_page_setup_cb) }, + + { "preferences", + GTK_STOCK_PREFERENCES, + N_("Prefere_nces"), + "s", + N_("Configure Evolution"), + G_CALLBACK (action_preferences_cb) }, + + { "quick-reference", + NULL, + N_("_Quick Reference"), + NULL, + N_("Show Evolution's shortcut keys"), + G_CALLBACK (action_quick_reference_cb) }, + + { "quit", + GTK_STOCK_QUIT, + N_("_Quit"), + "q", + N_("Exit the program"), + G_CALLBACK (action_quit_cb) }, + + { "send-receive", + "mail-send-receive", + N_("Send / _Receive"), + "F9", + N_("Send queued items and retrieve new items"), + G_CALLBACK (action_send_receive_cb) }, + + { "submit-bug", + NULL, + N_("Submit _Bug Report"), + NULL, + N_("Submit a bug report using Bug Buddy"), + G_CALLBACK (action_submit_bug_cb) }, + + { "sync-options", + NULL, + N_("_Synchronization Options..."), + NULL, + N_("Set up Pilot configuration"), + G_CALLBACK (action_sync_options_cb) }, + + { "work-offline", + "stock_disconnect", + N_("_Work Offline"), + NULL, + N_("Put Evolution into offline mode"), + G_CALLBACK (action_work_offline_cb) }, + + { "work-online", + "stock_connect", + N_("_Work Online"), + NULL, + N_("Put Evolution into online mode"), + G_CALLBACK (action_work_online_cb) }, + + /*** Menus ***/ + + { "edit-menu", + NULL, + N_("_Edit"), + NULL, + NULL, + NULL }, + + { "file-menu", + NULL, + N_("_File"), + NULL, + NULL, + NULL }, + + { "help-menu", + NULL, + N_("_Help"), + NULL, + NULL, + NULL }, + + { "new-menu", + GTK_STOCK_NEW, + N_("_New"), + NULL, + NULL, + NULL }, + + { "search-menu", + NULL, + N_("_Search"), + NULL, + NULL, + NULL }, + + { "view-menu", + NULL, + N_("_View"), + NULL, + NULL, + NULL }, + + { "window-menu", + NULL, + N_("_Window"), + NULL, + NULL, + NULL } +}; + +static GtkToggleActionEntry shell_toggle_entries[] = { + + { "show-buttons", + NULL, + N_("Show _Buttons"), + NULL, + N_("Show the switcher buttons"), + G_CALLBACK (action_show_buttons_cb), + TRUE }, + + { "show-sidebar", + NULL, + N_("Show Side _Bar"), + NULL, + N_("Show the side bar"), + G_CALLBACK (action_show_sidebar_cb), + TRUE }, + + { "show-statusbar", + NULL, + N_("Show _Status Bar"), + NULL, + N_("Show the status bar"), + G_CALLBACK (action_show_statusbar_cb), + TRUE }, + + { "show-toolbar", + NULL, + N_("Show _Toolbar"), + NULL, + N_("Show the toolbar"), + G_CALLBACK (action_show_toolbar_cb), + TRUE } +}; + +void +e_shell_window_actions_init (EShellWindow *window) +{ + GtkActionGroup *action_group; + GtkUIManager *manager; + const gchar *domain; + + g_return_if_fail (E_IS_SHELL_WINDOW (window)); + + manager = e_shell_window_get_ui_manager (window); + domain = GETTEXT_PACKAGE; + + /* Shell Actions */ + action_group = ACTION_GROUP (SHELL); + gtk_action_group_set_translation_domain (action_group, domain); + gtk_action_group_add_actions ( + action_group, shell_entries, + G_N_ELEMENTS (shell_entries), window); + gtk_action_group_add_toggle_actions ( + action_group, shell_toggle_entries, + G_N_ELEMENTS (shell_toggle_entries), window); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + + /* New Item Actions (empty) */ + action_group = ACTION_GROUP (NEW_ITEM); + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + + /* New Group Actions (empty) */ + action_group = ACTION_GROUP (NEW_GROUP); + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + + /* New Source Actions (empty) */ + action_group = ACTION_GROUP (NEW_SOURCE); + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (manager, action_group, 0); + + /* Shell View Actions (empty) */ + action_group = ACTION_GROUP (SHELL_VIEW); + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (manager, action_group, 0); +} + +void +e_shell_window_create_shell_view_actions (EShellWindow *window) +{ + GType *types; + GSList *group = NULL; + GtkActionGroup *action_group; + GtkUIManager *manager; + guint n_types, ii; + guint merge_id; + + g_return_if_fail (E_IS_SHELL_WINDOW (window)); + + action_group = ACTION_GROUP (SHELL_VIEW); + types = e_shell_registry_get_view_types (&n_types); + manager = e_shell_window_get_ui_manager (window); + merge_id = gtk_ui_manager_new_merge_id (manager); + + for (ii = 0; ii < n_types; ii++) { + EShellViewClass *class; + GtkRadioAction *action; + const gchar *type_name; + gchar *action_name; + gchar *tooltip; + + class = g_type_class_ref (types[ii]); + type_name = g_type_name (types[ii]); + + if (class->label != NULL) { + g_critical ("Label member not set on %s", type_name); + continue; + } + + action_name = g_strdup_printf ("shell-view-%s", type_name); + tooltip = g_strdup_printf (_("Switch to %s"), class->label); + + action = gtk_radio_action_new ( + action_name, class->label, + tooltip, class->icon_name, ii); + + g_signal_connect ( + action, "changed", + G_CALLBACK (action_shell_view_cb), window); + + gtk_radio_action_set_group (action, group); + group = gtk_radio_action_get_group (action); + + gtk_action_group_add_action ( + action_group, GTK_ACTION (action)); + + e_sidebar_add_action ( + E_SIDEBAR (window->priv->sidebar), + GTK_ACTION (action)); + + gtk_ui_manager_add_ui ( + manager, merge_id, + "/main-menu/view-menu/window-menu", + action_name, action_name, + GTK_UI_MANAGER_AUTO, FALSE); + + g_free (action_name); + g_free (tooltip); + + g_type_class_unref (class); + } + + g_free (types); +} -- cgit v1.2.3 From 91a6b6899e5568ed34f913bedb538dd6c9e35b32 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 8 Aug 2008 02:04:44 +0000 Subject: Commit progress, which breaks everything. svn path=/branches/kill-bonobo/; revision=35930 --- shell/e-shell-window-actions.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 580f147920..e11563fa10 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -656,8 +656,15 @@ static void action_close_cb (GtkAction *action, EShellWindow *window) { - if (e_shell_request_close_window (window)) - gtk_widget_destroy (GTK_WIDGET (window)); + GtkWidget *widget = GTK_WIDGET (window); + GdkEvent *event; + + /* Synthesize a delete_event on this window. */ + event = gdk_event_new (GDK_DELETE); + event->any.window = g_object_ref (widget->window); + event->any.send_event = TRUE; + gtk_main_do_event (event); + gdk_event_free (event); } static void -- cgit v1.2.3 From ed9c8cc740baed6a67c9a8e5953bb062862c845b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 9 Aug 2008 12:05:51 +0000 Subject: Treat the Preferences window as a singleton. Kill a bunch of Bonobo crud, which breaks compilation again. svn path=/branches/kill-bonobo/; revision=35947 --- shell/e-shell-window-actions.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index e11563fa10..13c2d42506 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -720,7 +720,12 @@ static void action_preferences_cb (GtkAction *action, EShellWindow *window) { - e_shell_show_preferences (GTK_WINDOW (window)); + GtkWidget *preferences_window; + + preferences_window = e_shell_get_preferences_window (); + gtk_window_present (GTK_WINDOW (preferences_window)); + + /* FIXME Switch to a page appropriate for the current view. */ } static void -- cgit v1.2.3 From ebec065334b5cf943591527254d628c13d06c369 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 11 Aug 2008 01:05:38 +0000 Subject: Add a few stub functions to get compilation to complete. Kill e-active-connection-dialog.glade (unused). svn path=/branches/kill-bonobo/; revision=35950 --- shell/e-shell-window-actions.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 13c2d42506..0f959fa668 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1117,7 +1117,7 @@ e_shell_window_actions_init (EShellWindow *window) domain = GETTEXT_PACKAGE; /* Shell Actions */ - action_group = ACTION_GROUP (SHELL); + action_group = window->priv->shell_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_action_group_add_actions ( action_group, shell_entries, @@ -1128,22 +1128,22 @@ e_shell_window_actions_init (EShellWindow *window) gtk_ui_manager_insert_action_group (manager, action_group, 0); /* New Item Actions (empty) */ - action_group = ACTION_GROUP (NEW_ITEM); + action_group = window->priv->new_item_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* New Group Actions (empty) */ - action_group = ACTION_GROUP (NEW_GROUP); + action_group = window->priv->new_group_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* New Source Actions (empty) */ - action_group = ACTION_GROUP (NEW_SOURCE); + action_group = window->priv->new_source_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* Shell View Actions (empty) */ - action_group = ACTION_GROUP (SHELL_VIEW); + action_group = window->priv->shell_view_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); } @@ -1160,7 +1160,7 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) g_return_if_fail (E_IS_SHELL_WINDOW (window)); - action_group = ACTION_GROUP (SHELL_VIEW); + action_group = window->priv->shell_view_actions; types = e_shell_registry_get_view_types (&n_types); manager = e_shell_window_get_ui_manager (window); merge_id = gtk_ui_manager_new_merge_id (manager); -- cgit v1.2.3 From 08bd7765721e5d866c4d7a546b94f691cf62d972 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 13 Aug 2008 20:31:08 +0000 Subject: Get a basic shell window working. svn path=/branches/kill-bonobo/; revision=35982 --- shell/e-shell-window-actions.c | 122 ++++++++++++++++++++++++++++++++--------- 1 file changed, 97 insertions(+), 25 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 0f959fa668..81934a46ea 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -667,6 +667,13 @@ action_close_cb (GtkAction *action, gdk_event_free (event); } +static void +action_contents_cb (GtkAction *action, + EShellWindow *window) +{ + /* FIXME Unfinished. */ +} + static void action_faq_cb (GtkAction *action, EShellWindow *window) @@ -800,18 +807,6 @@ action_shell_view_cb (GtkRadioAction *action, value = gtk_radio_action_get_current_value (action); } -static void -action_show_buttons_cb (GtkToggleAction *action, - EShellWindow *window) -{ - ESidebar *sidebar; - gboolean active; - - sidebar = E_SIDEBAR (window->priv->sidebar); - active = gtk_toggle_action_get_active (action); - e_sidebar_set_actions_visible (sidebar, active); -} - static void action_show_sidebar_cb (GtkToggleAction *action, EShellWindow *window) @@ -836,6 +831,18 @@ action_show_statusbar_cb (GtkToggleAction *action, g_object_set (widget, "visible", active, NULL); } +static void +action_show_switcher_cb (GtkToggleAction *action, + EShellWindow *window) +{ + ESidebar *sidebar; + gboolean active; + + sidebar = E_SIDEBAR (window->priv->sidebar); + active = gtk_toggle_action_get_active (action); + e_sidebar_set_actions_visible (sidebar, active); +} + static void action_show_toolbar_cb (GtkToggleAction *action, EShellWindow *window) @@ -872,6 +879,14 @@ action_submit_bug_cb (GtkAction *action, } } +static void +action_switcher_style_cb (GtkRadioAction *action, + GtkRadioAction *current, + EShellWindow *window) +{ + /* FIXME Unfinished. */ +} + static void action_sync_options_cb (GtkAction *action, EShellWindow *window) @@ -914,7 +929,7 @@ static GtkActionEntry shell_entries[] = { { "about", GTK_STOCK_ABOUT, - N_("_About"), + NULL, NULL, N_("Show information about Evolution"), G_CALLBACK (action_about_cb) }, @@ -926,6 +941,13 @@ static GtkActionEntry shell_entries[] = { N_("Close this window"), G_CALLBACK (action_close_cb) }, + { "contents", + GTK_STOCK_HELP, + N_("_Contents"), + NULL, + N_("Open the Evolution User Guide"), + G_CALLBACK (action_contents_cb) }, + { "faq", GTK_STOCK_DIALOG_INFO, N_("Evolution _FAQ"), @@ -956,14 +978,14 @@ static GtkActionEntry shell_entries[] = { { "page-setup", GTK_STOCK_PAGE_SETUP, - N_("Page Set_up..."), + NULL, NULL, N_("Change the page settings for your current printer"), G_CALLBACK (action_page_setup_cb) }, { "preferences", GTK_STOCK_PREFERENCES, - N_("Prefere_nces"), + NULL, "s", N_("Configure Evolution"), G_CALLBACK (action_preferences_cb) }, @@ -977,8 +999,8 @@ static GtkActionEntry shell_entries[] = { { "quit", GTK_STOCK_QUIT, - N_("_Quit"), - "q", + NULL, + NULL, N_("Exit the program"), G_CALLBACK (action_quit_cb) }, @@ -1040,6 +1062,13 @@ static GtkActionEntry shell_entries[] = { NULL, NULL }, + { "layout-menu", + NULL, + N_("Lay_out"), + NULL, + NULL, + NULL }, + { "new-menu", GTK_STOCK_NEW, N_("_New"), @@ -1054,6 +1083,13 @@ static GtkActionEntry shell_entries[] = { NULL, NULL }, + { "switcher-menu", + NULL, + N_("_Switcher Appearance"), + NULL, + NULL, + NULL }, + { "view-menu", NULL, N_("_View"), @@ -1071,14 +1107,6 @@ static GtkActionEntry shell_entries[] = { static GtkToggleActionEntry shell_toggle_entries[] = { - { "show-buttons", - NULL, - N_("Show _Buttons"), - NULL, - N_("Show the switcher buttons"), - G_CALLBACK (action_show_buttons_cb), - TRUE }, - { "show-sidebar", NULL, N_("Show Side _Bar"), @@ -1095,6 +1123,14 @@ static GtkToggleActionEntry shell_toggle_entries[] = { G_CALLBACK (action_show_statusbar_cb), TRUE }, + { "show-switcher", + NULL, + N_("Show _Buttons"), + NULL, + N_("Show the switcher buttons"), + G_CALLBACK (action_show_switcher_cb), + TRUE }, + { "show-toolbar", NULL, N_("Show _Toolbar"), @@ -1104,6 +1140,37 @@ static GtkToggleActionEntry shell_toggle_entries[] = { TRUE } }; +static GtkRadioActionEntry shell_switcher_style_entries[] = { + + { "switcher-style-icons", + NULL, + N_("_Icons Only"), + NULL, + N_("Display window buttons with icons only"), + E_SWITCHER_ICONS }, + + { "switcher-style-text", + NULL, + N_("_Text Only"), + NULL, + N_("Display window buttons with text only"), + E_SWITCHER_TEXT }, + + { "switcher-style-both", + NULL, + N_("Icons _and Text"), + NULL, + N_("Display window buttons with icons and text"), + E_SWITCHER_BOTH }, + + { "switcher-style-user", + NULL, + N_("Tool_bar Style"), + NULL, + N_("Display window buttons using the desktop toolbar setting"), + E_SWITCHER_USER } +}; + void e_shell_window_actions_init (EShellWindow *window) { @@ -1125,6 +1192,11 @@ e_shell_window_actions_init (EShellWindow *window) gtk_action_group_add_toggle_actions ( action_group, shell_toggle_entries, G_N_ELEMENTS (shell_toggle_entries), window); + gtk_action_group_add_radio_actions ( + action_group, shell_switcher_style_entries, + G_N_ELEMENTS (shell_switcher_style_entries), + E_SWITCHER_USER, + G_CALLBACK (action_switcher_style_cb), window); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* New Item Actions (empty) */ -- cgit v1.2.3 From cca29c3424aede2bb3c9ec5a6d255ce490d3511b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 14 Aug 2008 03:51:16 +0000 Subject: Demonstrate displaying the test shell view. Also get the "Switcher Appearance" menu working... mostly. Still need to respond to GtkSettings notifications and make the preference persistent. svn path=/branches/kill-bonobo/; revision=35985 --- shell/e-shell-window-actions.c | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 81934a46ea..c4d9b1b99e 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -884,7 +884,24 @@ action_switcher_style_cb (GtkRadioAction *action, GtkRadioAction *current, EShellWindow *window) { - /* FIXME Unfinished. */ + ESidebar *sidebar; + GtkToolbarStyle style; + + sidebar = E_SIDEBAR (window->priv->sidebar); + style = gtk_radio_action_get_current_value (action); + + switch (style) { + case GTK_TOOLBAR_ICONS: + case GTK_TOOLBAR_TEXT: + case GTK_TOOLBAR_BOTH: + case GTK_TOOLBAR_BOTH_HORIZ: + e_sidebar_set_style (sidebar, style); + break; + + default: + e_sidebar_unset_style (sidebar); + break; + } } static void @@ -1147,28 +1164,28 @@ static GtkRadioActionEntry shell_switcher_style_entries[] = { N_("_Icons Only"), NULL, N_("Display window buttons with icons only"), - E_SWITCHER_ICONS }, + GTK_TOOLBAR_ICONS }, { "switcher-style-text", NULL, N_("_Text Only"), NULL, N_("Display window buttons with text only"), - E_SWITCHER_TEXT }, + GTK_TOOLBAR_TEXT }, { "switcher-style-both", NULL, N_("Icons _and Text"), NULL, N_("Display window buttons with icons and text"), - E_SWITCHER_BOTH }, + GTK_TOOLBAR_BOTH_HORIZ }, { "switcher-style-user", NULL, N_("Tool_bar Style"), NULL, N_("Display window buttons using the desktop toolbar setting"), - E_SWITCHER_USER } + -1 } }; void @@ -1194,8 +1211,7 @@ e_shell_window_actions_init (EShellWindow *window) G_N_ELEMENTS (shell_toggle_entries), window); gtk_action_group_add_radio_actions ( action_group, shell_switcher_style_entries, - G_N_ELEMENTS (shell_switcher_style_entries), - E_SWITCHER_USER, + G_N_ELEMENTS (shell_switcher_style_entries), -1, G_CALLBACK (action_switcher_style_cb), window); gtk_ui_manager_insert_action_group (manager, action_group, 0); @@ -1247,7 +1263,7 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) class = g_type_class_ref (types[ii]); type_name = g_type_name (types[ii]); - if (class->label != NULL) { + if (class->label == NULL) { g_critical ("Label member not set on %s", type_name); continue; } @@ -1255,9 +1271,17 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) action_name = g_strdup_printf ("shell-view-%s", type_name); tooltip = g_strdup_printf (_("Switch to %s"), class->label); + /* Note, we have to set "icon-name" separately because + * gtk_radio_action_new() expects a "stock-id". Sadly, + * GTK+ still distinguishes between the two. */ + action = gtk_radio_action_new ( action_name, class->label, - tooltip, class->icon_name, ii); + tooltip, NULL, ii); + + g_object_set ( + G_OBJECT (action), + "icon-name", class->icon_name, NULL); g_signal_connect ( action, "changed", -- cgit v1.2.3 From 28b28bf057056d2aa28458b322319bf679608ae5 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 17 Aug 2008 01:36:11 +0000 Subject: Write the algorithm for sorting items in the "New" menu. Not yet tested. svn path=/branches/kill-bonobo/; revision=36004 --- shell/e-shell-window-actions.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index c4d9b1b99e..85bdf445d9 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1220,11 +1220,6 @@ e_shell_window_actions_init (EShellWindow *window) gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); - /* New Group Actions (empty) */ - action_group = window->priv->new_group_actions; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (manager, action_group, 0); - /* New Source Actions (empty) */ action_group = window->priv->new_source_actions; gtk_action_group_set_translation_domain (action_group, domain); @@ -1253,6 +1248,10 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) manager = e_shell_window_get_ui_manager (window); merge_id = gtk_ui_manager_new_merge_id (manager); + /* Construct a group of radio actions from the various EShellView + * subclasses and register them with our ESidebar. These actions + * are manifested as switcher buttons and View->Window menu items. */ + for (ii = 0; ii < n_types; ii++) { EShellViewClass *class; GtkRadioAction *action; -- cgit v1.2.3 From 035744f29bdea64cfb38f2e507020d5914cd666e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 19 Aug 2008 02:55:45 +0000 Subject: Committing the day's progress. Realized the "New" menu construction algorithm needs to live independently of shell view instances since we lazy load the shell views but have to display all possible "New" items immediately. Prototype the mechanisms for managing the various shell views and keeping track of which one is current. Various other tightening up and rethinking of APIs. svn path=/branches/kill-bonobo/; revision=36022 --- shell/e-shell-window-actions.c | 196 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 178 insertions(+), 18 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 85bdf445d9..a176a202b5 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -799,12 +799,10 @@ action_shell_view_cb (GtkRadioAction *action, GtkRadioAction *current, EShellWindow *window) { - gint value; + const gchar *view_name; - if (action != current) - return; - - value = gtk_radio_action_get_current_value (action); + view_name = g_object_get_data (G_OBJECT (current), "view-name"); + e_shell_window_set_current_view (window, view_name); } static void @@ -1188,6 +1186,77 @@ static GtkRadioActionEntry shell_switcher_style_entries[] = { -1 } }; +static gint +shell_window_compare_actions (GtkAction *action1, + GtkAction *action2) +{ + gchar *label1, *label2; + gint result; + + /* XXX This is really inefficient, but we're only sorting + * a small number of actions (repeatedly, though). */ + + g_object_get (action1, "label", &label1, NULL); + g_object_get (action2, "label", &label2, NULL); + + result = g_utf8_collate (label1, label2); + + g_free (label1); + g_free (label2); + + return result; +} + +static void +shell_window_extract_actions (EShellWindow *window, + GList **source_list, + GList **destination_list) +{ + const gchar *current_view; + GList *match_list = NULL; + GList *iter; + + /* Pick out the actions from the source list that are tagged + * as belonging to the current EShellView and move them to the + * destination list. */ + + current_view = e_shell_window_get_current_view (window); + + /* Example: Suppose [A] and [C] are tagged for this EShellView. + * + * source_list = [A] -> [B] -> [C] + * ^ ^ + * | | + * match_list = [ ] --------> [ ] + * + * + * destination_list = [1] -> [2] (other actions) + */ + for (iter = *source_list; iter != NULL; iter = iter->next) { + GtkAction *action = iter->data; + const gchar *view_name; + + view_name = g_object_get_data ( + G_OBJECT (action), "view-name"); + + if (view_name != current_view) + continue; + + match_list = g_list_append (match_list, iter); + } + + /* source_list = [B] match_list = [A] -> [C] */ + for (iter = match_list; iter != NULL; iter = iter->next) { + GList *link = iter->data; + + iter->data = link->data; + *source_list = g_list_delete_link (*source_list, link); + } + + /* destination_list = [1] -> [2] -> [A] -> [C] */ + *destination_list = g_list_concat (*destination_list, match_list); +} + void e_shell_window_actions_init (EShellWindow *window) { @@ -1231,20 +1300,91 @@ e_shell_window_actions_init (EShellWindow *window) gtk_ui_manager_insert_action_group (manager, action_group, 0); } +GtkWidget * +e_shell_window_create_new_menu (EShellWindow *window) +{ + GtkActionGroup *action_group; + GList *new_item_actions; + GList *new_source_actions; + GList *iter, *list = NULL; + GtkWidget *menu; + GtkWidget *separator; + + /* Get sorted lists of "new item" and "new source" actions. */ + + action_group = window->priv->new_item_actions; + + new_item_actions = g_list_sort ( + gtk_action_group_list_actions (action_group), + (GCompareFunc) shell_window_compare_actions); + + action_group = window->priv->new_source_actions; + + new_source_actions = g_list_sort ( + gtk_action_group_list_actions (action_group), + (GCompareFunc) shell_window_compare_actions); + + /* Give priority to actions that belong to this shell view. */ + + shell_window_extract_actions ( + window, &new_item_actions, &list); + + shell_window_extract_actions ( + window, &new_source_actions, &list); + + /* Convert the actions to menu item proxy widgets. */ + + for (iter = list; iter != NULL; iter = iter->next) + iter->data = gtk_action_create_menu_item (iter->data); + + for (iter = new_item_actions; iter != NULL; iter = iter->next) + iter->data = gtk_action_create_menu_item (iter->data); + + for (iter = new_source_actions; iter != NULL; iter = iter->next) + iter->data = gtk_action_create_menu_item (iter->data); + + /* Add menu separators. */ + + separator = gtk_separator_menu_item_new (); + new_item_actions = g_list_prepend (new_item_actions, separator); + + separator = gtk_separator_menu_item_new (); + new_source_actions = g_list_prepend (new_source_actions, separator); + + /* Merge everything into one list, reflecting the menu layout. */ + + list = g_list_concat (list, new_item_actions); + new_item_actions = NULL; /* just for clarity */ + + list = g_list_concat (list, new_source_actions); + new_source_actions = NULL; /* just for clarity */ + + /* And finally, build the menu. */ + + menu = gtk_menu_new (); + + for (iter = list; iter != NULL; iter = iter->next) + gtk_menu_shell_append (GTK_MENU_SHELL (menu), iter->data); + + g_list_free (list); + + return menu; +} + void e_shell_window_create_shell_view_actions (EShellWindow *window) { - GType *types; + GType *children; GSList *group = NULL; GtkActionGroup *action_group; GtkUIManager *manager; - guint n_types, ii; + guint n_children, ii; guint merge_id; g_return_if_fail (E_IS_SHELL_WINDOW (window)); action_group = window->priv->shell_view_actions; - types = e_shell_registry_get_view_types (&n_types); + children = g_type_children (E_TYPE_SHELL_VIEW, &n_children); manager = e_shell_window_get_ui_manager (window); merge_id = gtk_ui_manager_new_merge_id (manager); @@ -1252,22 +1392,31 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) * subclasses and register them with our ESidebar. These actions * are manifested as switcher buttons and View->Window menu items. */ - for (ii = 0; ii < n_types; ii++) { + for (ii = 0; ii < n_children; ii++) { EShellViewClass *class; GtkRadioAction *action; - const gchar *type_name; + const gchar *view_name; gchar *action_name; gchar *tooltip; - class = g_type_class_ref (types[ii]); - type_name = g_type_name (types[ii]); + class = g_type_class_ref (children[ii]); if (class->label == NULL) { - g_critical ("Label member not set on %s", type_name); + g_critical ( + "Label member not set on %s", + G_OBJECT_CLASS_NAME (class)); + continue; + } + + if (class->module == NULL) { + g_critical ( + "Module member not set on %s", + G_OBJECT_CLASS_NAME (class)); continue; } - action_name = g_strdup_printf ("shell-view-%s", type_name); + view_name = class->module->name; + action_name = g_strdup_printf ("shell-view-%s", view_name); tooltip = g_strdup_printf (_("Switch to %s"), class->label); /* Note, we have to set "icon-name" separately because @@ -1282,9 +1431,20 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) G_OBJECT (action), "icon-name", class->icon_name, NULL); - g_signal_connect ( - action, "changed", - G_CALLBACK (action_shell_view_cb), window); + g_object_set_data ( + G_OBJECT (action), + "view-name", (gpointer) view_name); + + if (group == NULL) { + + /* First view is the default. */ + window->priv->default_view = view_name; + + /* Only listen to the first action. */ + g_signal_connect ( + action, "changed", + G_CALLBACK (action_shell_view_cb), window); + } gtk_radio_action_set_group (action, group); group = gtk_radio_action_get_group (action); @@ -1308,5 +1468,5 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) g_type_class_unref (class); } - g_free (types); + g_free (children); } -- cgit v1.2.3 From fd6cd9e3a6dc06f9b8e44ec13ac881ebd6793e6e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 23 Aug 2008 15:36:32 +0000 Subject: Progress update: - Discard libnm-glib method of monitoring network connectivity. - Decided to make EShell a singleton GObject after all. Makes the design cleaner, despite having to pass a singleton instance around. - Make the switcher button style persistent. svn path=/branches/kill-bonobo/; revision=36043 --- shell/e-shell-window-actions.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index a176a202b5..bc1fcea27b 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -713,7 +713,10 @@ static void action_new_window_cb (GtkAction *action, EShellWindow *window) { - e_shell_create_window (); + EShell *shell; + + shell = e_shell_window_get_shell (window); + e_shell_create_window (shell); } static void @@ -784,14 +787,20 @@ static void action_quit_cb (GtkAction *action, EShellWindow *window) { - e_shell_quit (); + EShell *shell; + + shell = e_shell_window_get_shell (window); + e_shell_quit (shell); } static void action_send_receive_cb (GtkAction *action, EShellWindow *window) { - e_shell_send_receive (GTK_WINDOW (window)); + EShell *shell; + + shell = e_shell_window_get_shell (window); + e_shell_send_receive (shell, GTK_WINDOW (window)); } static void @@ -812,7 +821,7 @@ action_show_sidebar_cb (GtkToggleAction *action, GtkWidget *widget; gboolean active; - widget = window->priv->sidebar_notebook; + widget = window->priv->sidebar; active = gtk_toggle_action_get_active (action); g_object_set (widget, "visible", active, NULL); } @@ -930,14 +939,20 @@ static void action_work_offline_cb (GtkAction *action, EShellWindow *window) { - e_shell_go_offline (); + EShell *shell; + + shell = e_shell_window_get_shell (window); + e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_OFFLINE); } static void action_work_online_cb (GtkAction *action, EShellWindow *window) { - e_shell_go_online (); + EShell *shell; + + shell = e_shell_window_get_shell (window); + e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_ONLINE); } static GtkActionEntry shell_entries[] = { @@ -1280,7 +1295,8 @@ e_shell_window_actions_init (EShellWindow *window) G_N_ELEMENTS (shell_toggle_entries), window); gtk_action_group_add_radio_actions ( action_group, shell_switcher_style_entries, - G_N_ELEMENTS (shell_switcher_style_entries), -1, + G_N_ELEMENTS (shell_switcher_style_entries), + E_SIDEBAR_DEFAULT_TOOLBAR_STYLE, G_CALLBACK (action_switcher_style_cb), window); gtk_ui_manager_insert_action_group (manager, action_group, 0); -- cgit v1.2.3 From 2ef1b5bf42b5d429e00f94710458f237d18315b2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 24 Aug 2008 13:17:11 +0000 Subject: Progress update: - Get the "New" button and menu working. - Add a GtkMenuToolButton subclass called EMenuToolButton, which does some behind-the-scenes stuff to make the "New" button work properly. - Kill EComboButton and its associated a11y widget. svn path=/branches/kill-bonobo/; revision=36045 --- shell/e-shell-window-actions.c | 149 +++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 73 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index bc1fcea27b..24588b4931 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -20,14 +20,16 @@ #include "e-shell-window-private.h" -#include "e-shell.h" -#include "e-shell-importer.h" +#include -#include "e-util/e-dialog-utils.h" -#include "e-util/e-error.h" -#include "e-util/e-print.h" +#include +#include + +#include +#include +#include +#include -#include #include #define EVOLUTION_COPYRIGHT \ @@ -626,7 +628,7 @@ static const gchar *documenters[] = { static void action_about_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { gchar *translator_credits; @@ -638,7 +640,7 @@ action_about_cb (GtkAction *action, translator_credits = NULL; gtk_show_about_dialog ( - GTK_WINDOW (window), + GTK_WINDOW (shell_window), "program-name", "Evolution", "version", VERSION, "copyright", EVOLUTION_COPYRIGHT, @@ -654,9 +656,9 @@ action_about_cb (GtkAction *action, static void action_close_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { - GtkWidget *widget = GTK_WIDGET (window); + GtkWidget *widget = GTK_WIDGET (shell_window); GdkEvent *event; /* Synthesize a delete_event on this window. */ @@ -669,14 +671,14 @@ action_close_cb (GtkAction *action, static void action_contents_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { - /* FIXME Unfinished. */ + e_display_help (GTK_WINDOW (shell_window), NULL); } static void action_faq_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { GError *error = NULL; @@ -691,12 +693,12 @@ action_faq_cb (GtkAction *action, static void action_forget_passwords_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { gint response; response = e_error_run ( - GTK_WINDOW (window), "shell:forget-passwords", NULL); + GTK_WINDOW (shell_window), "shell:forget-passwords", NULL); if (response == GTK_RESPONSE_OK) e_passwords_forget_passwords (); @@ -704,31 +706,31 @@ action_forget_passwords_cb (GtkAction *action, static void action_import_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { - e_shell_importer_start_import (window); + e_shell_importer_start_import (shell_window); } static void action_new_window_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { EShell *shell; - shell = e_shell_window_get_shell (window); + shell = e_shell_window_get_shell (shell_window); e_shell_create_window (shell); } static void action_page_setup_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { - e_print_run_page_setup_dialog (GTK_WINDOW (window)); + e_print_run_page_setup_dialog (GTK_WINDOW (shell_window)); } static void action_preferences_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { GtkWidget *preferences_window; @@ -740,7 +742,7 @@ action_preferences_cb (GtkAction *action, static void action_quick_reference_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { const gchar * const *language_names; @@ -785,86 +787,86 @@ action_quick_reference_cb (GtkAction *action, static void action_quit_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { EShell *shell; - shell = e_shell_window_get_shell (window); + shell = e_shell_window_get_shell (shell_window); e_shell_quit (shell); } static void action_send_receive_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { EShell *shell; - shell = e_shell_window_get_shell (window); - e_shell_send_receive (shell, GTK_WINDOW (window)); + shell = e_shell_window_get_shell (shell_window); + e_shell_send_receive (shell, GTK_WINDOW (shell_window)); } static void action_shell_view_cb (GtkRadioAction *action, GtkRadioAction *current, - EShellWindow *window) + EShellWindow *shell_window) { const gchar *view_name; view_name = g_object_get_data (G_OBJECT (current), "view-name"); - e_shell_window_set_current_view (window, view_name); + e_shell_window_set_current_view (shell_window, view_name); } static void action_show_sidebar_cb (GtkToggleAction *action, - EShellWindow *window) + EShellWindow *shell_window) { GtkWidget *widget; gboolean active; - widget = window->priv->sidebar; + widget = shell_window->priv->sidebar; active = gtk_toggle_action_get_active (action); g_object_set (widget, "visible", active, NULL); } static void action_show_statusbar_cb (GtkToggleAction *action, - EShellWindow *window) + EShellWindow *shell_window) { GtkWidget *widget; gboolean active; - widget = window->priv->status_area; + widget = shell_window->priv->status_area; active = gtk_toggle_action_get_active (action); g_object_set (widget, "visible", active, NULL); } static void action_show_switcher_cb (GtkToggleAction *action, - EShellWindow *window) + EShellWindow *shell_window) { ESidebar *sidebar; gboolean active; - sidebar = E_SIDEBAR (window->priv->sidebar); + sidebar = E_SIDEBAR (shell_window->priv->sidebar); active = gtk_toggle_action_get_active (action); e_sidebar_set_actions_visible (sidebar, active); } static void action_show_toolbar_cb (GtkToggleAction *action, - EShellWindow *window) + EShellWindow *shell_window) { GtkWidget *widget; gboolean active; - widget = window->priv->main_toolbar; + widget = shell_window->priv->main_toolbar; active = gtk_toggle_action_get_active (action); g_object_set (widget, "visible", active, NULL); } static void action_submit_bug_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { const gchar *command_line; GError *error = NULL; @@ -881,7 +883,7 @@ action_submit_bug_cb (GtkAction *action, message = _("Bug Buddy is not installed."); else message = _("Bug Buddy could not be run."); - e_notice (window, GTK_MESSAGE_ERROR, message); + e_notice (shell_window, GTK_MESSAGE_ERROR, message); g_error_free (error); } } @@ -889,12 +891,12 @@ action_submit_bug_cb (GtkAction *action, static void action_switcher_style_cb (GtkRadioAction *action, GtkRadioAction *current, - EShellWindow *window) + EShellWindow *shell_window) { ESidebar *sidebar; GtkToolbarStyle style; - sidebar = E_SIDEBAR (window->priv->sidebar); + sidebar = E_SIDEBAR (shell_window->priv->sidebar); style = gtk_radio_action_get_current_value (action); switch (style) { @@ -913,7 +915,7 @@ action_switcher_style_cb (GtkRadioAction *action, static void action_sync_options_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { const gchar *command_line; GError *error = NULL; @@ -930,28 +932,28 @@ action_sync_options_cb (GtkAction *action, message = _("GNOME Pilot is not installed."); else message = _("GNOME Pilot could not be run."); - e_notice (window, GTK_MESSAGE_ERROR, message); + e_notice (shell_window, GTK_MESSAGE_ERROR, message); g_error_free (error); } } static void action_work_offline_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { EShell *shell; - shell = e_shell_window_get_shell (window); + shell = e_shell_window_get_shell (shell_window); e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_OFFLINE); } static void action_work_online_cb (GtkAction *action, - EShellWindow *window) + EShellWindow *shell_window) { EShell *shell; - shell = e_shell_window_get_shell (window); + shell = e_shell_window_get_shell (shell_window); e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_ONLINE); } @@ -1102,7 +1104,7 @@ static GtkActionEntry shell_entries[] = { { "new-menu", GTK_STOCK_NEW, N_("_New"), - NULL, + "", NULL, NULL }, @@ -1223,7 +1225,7 @@ shell_window_compare_actions (GtkAction *action1, } static void -shell_window_extract_actions (EShellWindow *window, +shell_window_extract_actions (EShellWindow *shell_window, GList **source_list, GList **destination_list) { @@ -1235,7 +1237,7 @@ shell_window_extract_actions (EShellWindow *window, * as belonging to the current EShellView and move them to the * destination list. */ - current_view = e_shell_window_get_current_view (window); + current_view = e_shell_window_get_current_view (shell_window); /* Example: Suppose [A] and [C] are tagged for this EShellView. * @@ -1273,51 +1275,51 @@ shell_window_extract_actions (EShellWindow *window, } void -e_shell_window_actions_init (EShellWindow *window) +e_shell_window_actions_init (EShellWindow *shell_window) { GtkActionGroup *action_group; GtkUIManager *manager; const gchar *domain; - g_return_if_fail (E_IS_SHELL_WINDOW (window)); + g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - manager = e_shell_window_get_ui_manager (window); + manager = e_shell_window_get_ui_manager (shell_window); domain = GETTEXT_PACKAGE; /* Shell Actions */ - action_group = window->priv->shell_actions; + action_group = shell_window->priv->shell_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_action_group_add_actions ( action_group, shell_entries, - G_N_ELEMENTS (shell_entries), window); + G_N_ELEMENTS (shell_entries), shell_window); gtk_action_group_add_toggle_actions ( action_group, shell_toggle_entries, - G_N_ELEMENTS (shell_toggle_entries), window); + G_N_ELEMENTS (shell_toggle_entries), shell_window); gtk_action_group_add_radio_actions ( action_group, shell_switcher_style_entries, G_N_ELEMENTS (shell_switcher_style_entries), E_SIDEBAR_DEFAULT_TOOLBAR_STYLE, - G_CALLBACK (action_switcher_style_cb), window); + G_CALLBACK (action_switcher_style_cb), shell_window); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* New Item Actions (empty) */ - action_group = window->priv->new_item_actions; + action_group = shell_window->priv->new_item_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* New Source Actions (empty) */ - action_group = window->priv->new_source_actions; + action_group = shell_window->priv->new_source_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* Shell View Actions (empty) */ - action_group = window->priv->shell_view_actions; + action_group = shell_window->priv->shell_view_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (manager, action_group, 0); } GtkWidget * -e_shell_window_create_new_menu (EShellWindow *window) +e_shell_window_create_new_menu (EShellWindow *shell_window) { GtkActionGroup *action_group; GList *new_item_actions; @@ -1328,13 +1330,13 @@ e_shell_window_create_new_menu (EShellWindow *window) /* Get sorted lists of "new item" and "new source" actions. */ - action_group = window->priv->new_item_actions; + action_group = shell_window->priv->new_item_actions; new_item_actions = g_list_sort ( gtk_action_group_list_actions (action_group), (GCompareFunc) shell_window_compare_actions); - action_group = window->priv->new_source_actions; + action_group = shell_window->priv->new_source_actions; new_source_actions = g_list_sort ( gtk_action_group_list_actions (action_group), @@ -1343,10 +1345,10 @@ e_shell_window_create_new_menu (EShellWindow *window) /* Give priority to actions that belong to this shell view. */ shell_window_extract_actions ( - window, &new_item_actions, &list); + shell_window, &new_item_actions, &list); shell_window_extract_actions ( - window, &new_source_actions, &list); + shell_window, &new_source_actions, &list); /* Convert the actions to menu item proxy widgets. */ @@ -1388,7 +1390,7 @@ e_shell_window_create_new_menu (EShellWindow *window) } void -e_shell_window_create_shell_view_actions (EShellWindow *window) +e_shell_window_create_shell_view_actions (EShellWindow *shell_window) { GType *children; GSList *group = NULL; @@ -1397,11 +1399,11 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) guint n_children, ii; guint merge_id; - g_return_if_fail (E_IS_SHELL_WINDOW (window)); + g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - action_group = window->priv->shell_view_actions; + action_group = shell_window->priv->shell_view_actions; children = g_type_children (E_TYPE_SHELL_VIEW, &n_children); - manager = e_shell_window_get_ui_manager (window); + manager = e_shell_window_get_ui_manager (shell_window); merge_id = gtk_ui_manager_new_merge_id (manager); /* Construct a group of radio actions from the various EShellView @@ -1454,12 +1456,13 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) if (group == NULL) { /* First view is the default. */ - window->priv->default_view = view_name; + shell_window->priv->default_view = view_name; /* Only listen to the first action. */ g_signal_connect ( action, "changed", - G_CALLBACK (action_shell_view_cb), window); + G_CALLBACK (action_shell_view_cb), + shell_window); } gtk_radio_action_set_group (action, group); @@ -1469,7 +1472,7 @@ e_shell_window_create_shell_view_actions (EShellWindow *window) action_group, GTK_ACTION (action)); e_sidebar_add_action ( - E_SIDEBAR (window->priv->sidebar), + E_SIDEBAR (shell_window->priv->sidebar), GTK_ACTION (action)); gtk_ui_manager_add_ui ( -- cgit v1.2.3 From cf3b01017162cbba568ee4317eee2efe5f6fdc10 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 Aug 2008 20:22:32 +0000 Subject: Progress update: - Further refinements of the shell API. - Kill ESMenu and EUserCreatableItemsHandler. - Start ripping apart the addressbook component. svn path=/branches/kill-bonobo/; revision=36093 --- shell/e-shell-window-actions.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 24588b4931..61f95576cd 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -22,9 +22,6 @@ #include -#include -#include - #include #include #include @@ -32,6 +29,8 @@ #include +#include "e-shell-importer.h" + #define EVOLUTION_COPYRIGHT \ "Copyright \xC2\xA9 1999 - 2008 Novell, Inc. and Others" @@ -1286,6 +1285,8 @@ e_shell_window_actions_init (EShellWindow *shell_window) manager = e_shell_window_get_ui_manager (shell_window); domain = GETTEXT_PACKAGE; + e_load_ui_definition (manager, "evolution-shell.ui"); + /* Shell Actions */ action_group = shell_window->priv->shell_actions; gtk_action_group_set_translation_domain (action_group, domain); @@ -1426,14 +1427,14 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) continue; } - if (class->module == NULL) { + if (class->type_module == NULL) { g_critical ( "Module member not set on %s", G_OBJECT_CLASS_NAME (class)); continue; } - view_name = class->module->name; + view_name = class->type_module->name; action_name = g_strdup_printf ("shell-view-%s", view_name); tooltip = g_strdup_printf (_("Switch to %s"), class->label); -- cgit v1.2.3 From 3843185df1e71e14e4f2e5d34aca34724090b496 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 30 Aug 2008 04:42:02 +0000 Subject: Preferences window awesomeness. svn path=/branches/kill-bonobo/; revision=36215 --- shell/e-shell-window-actions.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 61f95576cd..a43333c5b1 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -734,6 +734,12 @@ action_preferences_cb (GtkAction *action, GtkWidget *preferences_window; preferences_window = e_shell_get_preferences_window (); + gtk_window_set_transient_for ( + GTK_WINDOW (preferences_window), + GTK_WINDOW (shell_window)); + gtk_window_set_position ( + GTK_WINDOW (preferences_window), + GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_present (GTK_WINDOW (preferences_window)); /* FIXME Switch to a page appropriate for the current view. */ -- cgit v1.2.3 From 8bbf952350c37970e8947b807513e58e91435998 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 31 Aug 2008 12:29:42 +0000 Subject: Fix some bugs related to the New menu and toolbar button. svn path=/branches/kill-bonobo/; revision=36232 --- shell/e-shell-window-actions.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index a43333c5b1..13fe3c7d12 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1256,12 +1256,12 @@ shell_window_extract_actions (EShellWindow *shell_window, */ for (iter = *source_list; iter != NULL; iter = iter->next) { GtkAction *action = iter->data; - const gchar *view_name; + const gchar *module_name; - view_name = g_object_get_data ( - G_OBJECT (action), "view-name"); + module_name = g_object_get_data ( + G_OBJECT (action), "module-name"); - if (view_name != current_view) + if (strcmp (module_name, current_view) != 0) continue; match_list = g_list_append (match_list, iter); @@ -1372,9 +1372,11 @@ e_shell_window_create_new_menu (EShellWindow *shell_window) separator = gtk_separator_menu_item_new (); new_item_actions = g_list_prepend (new_item_actions, separator); + gtk_widget_show (GTK_WIDGET (separator)); separator = gtk_separator_menu_item_new (); new_source_actions = g_list_prepend (new_source_actions, separator); + gtk_widget_show (GTK_WIDGET (separator)); /* Merge everything into one list, reflecting the menu layout. */ -- cgit v1.2.3 From eca687589d106ff87cd4fca7bf581cb0532caf96 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 5 Sep 2008 15:47:38 +0000 Subject: Saving progress. Lots of changes. Things are a bit broken at the moment. svn path=/branches/kill-bonobo/; revision=36260 --- shell/e-shell-window-actions.c | 260 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 237 insertions(+), 23 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 13fe3c7d12..44d82e8bbe 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -703,6 +704,63 @@ action_forget_passwords_cb (GtkAction *action, e_passwords_forget_passwords (); } +static void +action_gal_define_views_cb (GtkAction *action, + EShellWindow *shell_window) +{ + EShellView *shell_view; + GalViewInstance *instance; + GtkWidget *dialog; + const gchar *view_name; + + view_name = e_shell_window_get_current_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + instance = e_shell_view_get_view_instance (shell_view); + g_return_if_fail (instance != NULL); + + dialog = gal_define_views_dialog_new (instance->collection); + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) + gal_view_collection_save (instance->collection); + gtk_widget_destroy (dialog); +} + +static void +action_gal_save_custom_view_cb (GtkAction *action, + EShellWindow *shell_window) +{ + EShellView *shell_view; + GalViewInstance *instance; + const gchar *view_name; + + view_name = e_shell_window_get_current_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + instance = e_shell_view_get_view_instance (shell_view); + g_return_if_fail (instance != NULL); + + gal_view_instance_save_as (instance); +} + +static void +action_gal_view_cb (GtkRadioAction *action, + GtkRadioAction *current, + EShellWindow *shell_window) +{ + EShellView *shell_view; + GalViewInstance *instance; + const gchar *view_name; + const gchar *view_id; + + view_name = e_shell_window_get_current_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + instance = e_shell_view_get_view_instance (shell_view); + g_return_if_fail (instance != NULL); + + view_id = g_object_get_data (G_OBJECT (current), "view-id"); + g_return_if_fail (view_id != NULL); + + gal_view_instance_set_current_view_id (instance, view_id); +} + static void action_import_cb (GtkAction *action, EShellWindow *shell_window) @@ -825,10 +883,13 @@ static void action_show_sidebar_cb (GtkToggleAction *action, EShellWindow *shell_window) { + GtkPaned *paned; GtkWidget *widget; gboolean active; - widget = shell_window->priv->sidebar; + paned = GTK_PANED (shell_window->priv->content_pane); + + widget = gtk_paned_get_child1 (paned); active = gtk_toggle_action_get_active (action); g_object_set (widget, "visible", active, NULL); } @@ -849,12 +910,12 @@ static void action_show_switcher_cb (GtkToggleAction *action, EShellWindow *shell_window) { - ESidebar *sidebar; + GtkWidget *widget; gboolean active; - sidebar = E_SIDEBAR (shell_window->priv->sidebar); + widget = shell_window->priv->switcher; active = gtk_toggle_action_get_active (action); - e_sidebar_set_actions_visible (sidebar, active); + g_object_set (widget, "visible", active, NULL); } static void @@ -898,10 +959,10 @@ action_switcher_style_cb (GtkRadioAction *action, GtkRadioAction *current, EShellWindow *shell_window) { - ESidebar *sidebar; + EShellSwitcher *switcher; GtkToolbarStyle style; - sidebar = E_SIDEBAR (shell_window->priv->sidebar); + switcher = E_SHELL_SWITCHER (shell_window->priv->switcher); style = gtk_radio_action_get_current_value (action); switch (style) { @@ -909,11 +970,11 @@ action_switcher_style_cb (GtkRadioAction *action, case GTK_TOOLBAR_TEXT: case GTK_TOOLBAR_BOTH: case GTK_TOOLBAR_BOTH_HORIZ: - e_sidebar_set_style (sidebar, style); + e_shell_switcher_set_style (switcher, style); break; default: - e_sidebar_unset_style (sidebar); + e_shell_switcher_unset_style (switcher); break; } } @@ -1208,6 +1269,42 @@ static GtkRadioActionEntry shell_switcher_style_entries[] = { -1 } }; +static GtkActionEntry shell_gal_view_entries[] = { + + { "gal-define-views", + NULL, + N_("Define Views..."), + NULL, + N_("Create or edit views"), + G_CALLBACK (action_gal_define_views_cb) }, + + { "gal-save-custom-view", + NULL, + N_("Save Custom View..."), + NULL, + N_("Save current custom view"), + G_CALLBACK (action_gal_save_custom_view_cb) }, + + /*** Menus ***/ + + { "gal-view-menu", + NULL, + N_("C_urrent View"), + NULL, + NULL, + NULL } +}; + +static GtkRadioActionEntry shell_gal_view_radio_entries[] = { + + { "gal-custom-view", + NULL, + N_("Custom View"), + NULL, + N_("Current view is a customized view"), + -1 } +}; + static gint shell_window_compare_actions (GtkAction *action1, GtkAction *action2) @@ -1283,15 +1380,15 @@ void e_shell_window_actions_init (EShellWindow *shell_window) { GtkActionGroup *action_group; - GtkUIManager *manager; + GtkUIManager *ui_manager; const gchar *domain; g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - manager = e_shell_window_get_ui_manager (shell_window); + ui_manager = e_shell_window_get_ui_manager (shell_window); domain = GETTEXT_PACKAGE; - e_load_ui_definition (manager, "evolution-shell.ui"); + e_load_ui_definition (ui_manager, "evolution-shell.ui"); /* Shell Actions */ action_group = shell_window->priv->shell_actions; @@ -1305,24 +1402,36 @@ e_shell_window_actions_init (EShellWindow *shell_window) gtk_action_group_add_radio_actions ( action_group, shell_switcher_style_entries, G_N_ELEMENTS (shell_switcher_style_entries), - E_SIDEBAR_DEFAULT_TOOLBAR_STYLE, + E_SHELL_SWITCHER_DEFAULT_TOOLBAR_STYLE, G_CALLBACK (action_switcher_style_cb), shell_window); - gtk_ui_manager_insert_action_group (manager, action_group, 0); + gtk_action_group_add_actions ( + action_group, shell_gal_view_entries, + G_N_ELEMENTS (shell_gal_view_entries), shell_window); + gtk_action_group_add_radio_actions ( + action_group, shell_gal_view_radio_entries, + G_N_ELEMENTS (shell_gal_view_radio_entries), + 0, G_CALLBACK (action_gal_view_cb), shell_window); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + + /* GAL View Actions (empty) */ + action_group = shell_window->priv->gal_view_actions; + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); /* New Item Actions (empty) */ action_group = shell_window->priv->new_item_actions; gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (manager, action_group, 0); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); /* New Source Actions (empty) */ action_group = shell_window->priv->new_source_actions; gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (manager, action_group, 0); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); /* Shell View Actions (empty) */ action_group = shell_window->priv->shell_view_actions; gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (manager, action_group, 0); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); } GtkWidget * @@ -1404,7 +1513,8 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) GType *children; GSList *group = NULL; GtkActionGroup *action_group; - GtkUIManager *manager; + GtkUIManager *ui_manager; + EShellSwitcher *switcher; guint n_children, ii; guint merge_id; @@ -1412,8 +1522,9 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) action_group = shell_window->priv->shell_view_actions; children = g_type_children (E_TYPE_SHELL_VIEW, &n_children); - manager = e_shell_window_get_ui_manager (shell_window); - merge_id = gtk_ui_manager_new_merge_id (manager); + switcher = E_SHELL_SWITCHER (shell_window->priv->switcher); + ui_manager = e_shell_window_get_ui_manager (shell_window); + merge_id = gtk_ui_manager_new_merge_id (ui_manager); /* Construct a group of radio actions from the various EShellView * subclasses and register them with our ESidebar. These actions @@ -1480,12 +1591,10 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) gtk_action_group_add_action ( action_group, GTK_ACTION (action)); - e_sidebar_add_action ( - E_SIDEBAR (shell_window->priv->sidebar), - GTK_ACTION (action)); + e_shell_switcher_add_action (switcher, GTK_ACTION (action)); gtk_ui_manager_add_ui ( - manager, merge_id, + ui_manager, merge_id, "/main-menu/view-menu/window-menu", action_name, action_name, GTK_UI_MANAGER_AUTO, FALSE); @@ -1498,3 +1607,108 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) g_free (children); } + +void +e_shell_window_update_gal_view_menu (EShellWindow *shell_window) +{ + EShellView *shell_view; + GtkUIManager *ui_manager; + GtkActionGroup *action_group; + GalViewInstance *instance; + GalViewCollection *collection; + GtkRadioAction *radio_action; + GtkAction *action; + GList *list, *iter; + GSList *radio_group; + gboolean visible; + const gchar *view_name; + const gchar *path; + gchar *gal_view_id; + guint merge_id; + gint count, ii; + + ui_manager = e_shell_window_get_ui_manager (shell_window); + view_name = e_shell_window_get_current_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + instance = e_shell_view_get_view_instance (shell_view); + + action_group = shell_window->priv->gal_view_actions; + merge_id = shell_window->priv->gal_view_merge_id; + + /* Unmerge the previous menu. */ + gtk_ui_manager_remove_ui (ui_manager, merge_id); + + /* XXX Annoying that GTK+ doesn't provide a function for this. + * http://bugzilla.gnome.org/show_bug.cgi?id=550485 */ + list = gtk_action_group_list_actions (action_group); + for (iter = list; iter != NULL; iter = iter->next) { + GtkAction *action = iter->data; + gtk_action_group_remove_action (action_group, action); + } + g_list_free (list); + + /* If there's no view instance then just hide the entire + * "Current View" menu and return. */ + action = ACTION (GAL_VIEW_MENU); + gtk_action_set_visible (action, instance != NULL); + if (instance == NULL) + return; + + /* We have a view instance, so forge ahead. */ + collection = instance->collection; + count = gal_view_collection_get_count (collection); + path = "/main-menu/view-menu/gal-view-menu/gal-view-list"; + gal_view_id = gal_view_instance_get_current_view_id (instance); + g_return_if_fail (gal_view_id != NULL); + + /* Default to "Custom View", unless we find our view ID. */ + radio_action = GTK_RADIO_ACTION (ACTION (GAL_CUSTOM_VIEW)); + gtk_radio_action_set_group (radio_action, NULL); + radio_group = gtk_radio_action_get_group (radio_action); + gtk_radio_action_set_current_value (radio_action, -1); + + /* Add a menu item for each view collection item. */ + for (ii = 0; ii < count; ii++) { + GalViewCollectionItem *item; + gchar *action_name; + gchar *tooltip; + + item = gal_view_collection_get_view_item (collection, ii); + + action_name = g_strdup_printf ( + "gal-view-%s-%d", view_name, ii); + tooltip = g_strdup_printf ("Select view: %s", item->title); + + radio_action = gtk_radio_action_new ( + action_name, item->title, tooltip, NULL, ii); + + gtk_radio_action_set_group (radio_action, radio_group); + radio_group = gtk_radio_action_get_group (radio_action); + + g_object_set_data_full ( + G_OBJECT (radio_action), "view-id", + g_strdup (item->id), (GDestroyNotify) g_free); + + if (strcmp (item->id, gal_view_id) == 0) + gtk_radio_action_set_current_value (radio_action, ii); + + action = GTK_ACTION (radio_action); + gtk_action_group_add_action (action_group, action); + + gtk_ui_manager_add_ui ( + ui_manager, merge_id, path, action_name, + action_name, GTK_UI_MANAGER_AUTO, FALSE); + + g_free (action_name); + g_free (tooltip); + } + + /* Doesn't matter which radio action we check. */ + visible = (gtk_radio_action_get_current_value (radio_action) < 0); + + action = ACTION (GAL_CUSTOM_VIEW); + gtk_action_set_visible (action, visible); + + action = ACTION (GAL_SAVE_CUSTOM_VIEW); + gtk_action_set_visible (action, visible); +} -- cgit v1.2.3 From 52d683e48cf1103a9806da95c72abce2db3ae1f4 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 7 Sep 2008 04:02:27 +0000 Subject: Progress update: - Contacts module mostly working now. - View and search UI not yet working. - Still refining shell design. svn path=/branches/kill-bonobo/; revision=36268 --- shell/e-shell-window-actions.c | 132 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 123 insertions(+), 9 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 44d82e8bbe..9983d77f36 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -22,10 +22,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -858,6 +858,77 @@ action_quit_cb (GtkAction *action, e_shell_quit (shell); } +static void +action_search_advanced_cb (GtkAction *action, + EShellWindow *shell_window) +{ +} + +static void +action_search_clear_cb (GtkAction *action, + EShellWindow *shell_window) +{ + EShellView *shell_view; + GtkWidget *widget; + const gchar *view_name; + + /* Dig up the search bar. */ + view_name = e_shell_window_get_current_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + widget = e_shell_view_get_content_widget (shell_view); + widget = e_shell_content_get_search_bar (E_SHELL_CONTENT (widget)); + + e_search_bar_set_search_text (E_SEARCH_BAR (widget), NULL); +} + +static void +action_search_edit_cb (GtkAction *action, + EShellWindow *shell_window) +{ + EShellView *shell_view; + RuleContext *context; + RuleEditor *editor; + GtkWidget *widget; + const gchar *filename; + const gchar *view_name; + + /* Dig up the search bar. */ + view_name = e_shell_window_get_current_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + widget = e_shell_view_get_content_widget (shell_view); + widget = e_shell_content_get_search_bar (E_SHELL_CONTENT (widget)); + + context = e_search_bar_get_context (E_SEARCH_BAR (widget)); + g_return_if_fail (context != NULL); + + /* XXX I don't know why the RuleContext can't just store + * system and user file names properly. Fix this? */ + filename = g_object_get_data (G_OBJECT (context), "user"); + g_return_if_fail (filename != NULL); + + editor = rule_editor_new ( + context, FILTER_SOURCE_INCOMING, _("Searches")); + gtk_window_set_title (GTK_WINDOW (editor), _("Searches")); + + if (gtk_dialog_run (GTK_DIALOG (editor)) == GTK_RESPONSE_OK) + rule_context_save (context, filename); + + gtk_widget_destroy (GTK_WIDGET (editor)); +} + +static void +action_search_execute_cb (GtkAction *action, + EShellWindow *shell_window) +{ + gtk_action_set_sensitive (action, FALSE); +} + +static void +action_search_save_cb (GtkAction *action, + EShellWindow *shell_window) +{ +} + static void action_send_receive_cb (GtkAction *action, EShellWindow *shell_window) @@ -910,12 +981,12 @@ static void action_show_switcher_cb (GtkToggleAction *action, EShellWindow *shell_window) { - GtkWidget *widget; + EShellSwitcher *switcher; gboolean active; - widget = shell_window->priv->switcher; + switcher = E_SHELL_SWITCHER (shell_window->priv->switcher); active = gtk_toggle_action_get_active (action); - g_object_set (widget, "visible", active, NULL); + e_shell_switcher_set_visible (switcher, active); } static void @@ -1102,6 +1173,41 @@ static GtkActionEntry shell_entries[] = { N_("Exit the program"), G_CALLBACK (action_quit_cb) }, + { "search-advanced", + NULL, + N_("_Advanced Search..."), + NULL, + N_("Construct a more advanced search"), + G_CALLBACK (action_search_advanced_cb) }, + + { "search-clear", + GTK_STOCK_CLEAR, + NULL, + "q", + N_("Clear the current search parameters"), + G_CALLBACK (action_search_clear_cb) }, + + { "search-edit", + NULL, + N_("_Edit Saved Searches..."), + NULL, + N_("Manage your saved searches"), + G_CALLBACK (action_search_edit_cb) }, + + { "search-execute", + GTK_STOCK_FIND, + N_("_Find Now"), + NULL, + N_("Execute the current search parameters"), + G_CALLBACK (action_search_execute_cb) }, + + { "search-save", + NULL, + N_("_Save Search..."), + NULL, + N_("Save the current search parameters"), + G_CALLBACK (action_search_save_cb) }, + { "send-receive", "mail-send-receive", N_("Send / _Receive"), @@ -1534,6 +1640,7 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) EShellViewClass *class; GtkRadioAction *action; const gchar *view_name; + gchar *accelerator; gchar *action_name; gchar *tooltip; @@ -1588,8 +1695,14 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) gtk_radio_action_set_group (action, group); group = gtk_radio_action_get_group (action); - gtk_action_group_add_action ( - action_group, GTK_ACTION (action)); + /* The first nine views have accelerators Ctrl+(1-9). */ + if (ii < 9) + accelerator = g_strdup_printf ("%d", ii + 1); + else + accelerator = g_strdup (""); + + gtk_action_group_add_action_with_accel ( + action_group, GTK_ACTION (action), accelerator); e_shell_switcher_add_action (switcher, GTK_ACTION (action)); @@ -1599,6 +1712,7 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) action_name, action_name, GTK_UI_MANAGER_AUTO, FALSE); + g_free (accelerator); g_free (action_name); g_free (tooltip); -- cgit v1.2.3 From 5350eebb5ef8c07e69110616ce1662e0e92bea16 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 8 Sep 2008 20:37:00 +0000 Subject: Progress update: - Merge ETaskBar into EShellTaskbar. - Remember the last view, and make --component work. svn path=/branches/kill-bonobo/; revision=36278 --- shell/e-shell-window-actions.c | 65 ++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 25 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 9983d77f36..aa14ec44eb 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -868,37 +868,31 @@ static void action_search_clear_cb (GtkAction *action, EShellWindow *shell_window) { + EShellContent *shell_content; EShellView *shell_view; - GtkWidget *widget; const gchar *view_name; - /* Dig up the search bar. */ view_name = e_shell_window_get_current_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); - widget = e_shell_view_get_content_widget (shell_view); - widget = e_shell_content_get_search_bar (E_SHELL_CONTENT (widget)); - - e_search_bar_set_search_text (E_SEARCH_BAR (widget), NULL); + shell_content = e_shell_view_get_content (shell_view); + e_shell_content_set_search_text (shell_content, ""); } static void action_search_edit_cb (GtkAction *action, EShellWindow *shell_window) { + EShellContent *shell_content; EShellView *shell_view; RuleContext *context; RuleEditor *editor; - GtkWidget *widget; const gchar *filename; const gchar *view_name; - /* Dig up the search bar. */ view_name = e_shell_window_get_current_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); - widget = e_shell_view_get_content_widget (shell_view); - widget = e_shell_content_get_search_bar (E_SHELL_CONTENT (widget)); - - context = e_search_bar_get_context (E_SEARCH_BAR (widget)); + shell_content = e_shell_view_get_content (shell_view); + context = e_shell_content_get_search_context (shell_content); g_return_if_fail (context != NULL); /* XXX I don't know why the RuleContext can't just store @@ -1621,12 +1615,16 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) GtkActionGroup *action_group; GtkUIManager *ui_manager; EShellSwitcher *switcher; + GList *list; + const gchar *current_view; + gint current_value = 0; guint n_children, ii; guint merge_id; g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); action_group = shell_window->priv->shell_view_actions; + current_view = e_shell_window_get_current_view (shell_window); children = g_type_children (E_TYPE_SHELL_VIEW, &n_children); switcher = E_SHELL_SWITCHER (shell_window->priv->switcher); ui_manager = e_shell_window_get_ui_manager (shell_window); @@ -1634,7 +1632,12 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) /* Construct a group of radio actions from the various EShellView * subclasses and register them with our ESidebar. These actions - * are manifested as switcher buttons and View->Window menu items. */ + * are manifested as switcher buttons and View->Window menu items. + * + * Note: The shell window has already selected a view by now, + * so we have to be careful not to overwrite that when setting + * up the radio action group. That means not connecting to any + * "changed" signals until after the group is built. */ for (ii = 0; ii < n_children; ii++) { EShellViewClass *class; @@ -1664,6 +1667,10 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) action_name = g_strdup_printf ("shell-view-%s", view_name); tooltip = g_strdup_printf (_("Switch to %s"), class->label); + /* Does this action represent the current view? */ + if (strcmp (view_name, current_view) == 0) + current_value = ii; + /* Note, we have to set "icon-name" separately because * gtk_radio_action_new() expects a "stock-id". Sadly, * GTK+ still distinguishes between the two. */ @@ -1680,18 +1687,6 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) G_OBJECT (action), "view-name", (gpointer) view_name); - if (group == NULL) { - - /* First view is the default. */ - shell_window->priv->default_view = view_name; - - /* Only listen to the first action. */ - g_signal_connect ( - action, "changed", - G_CALLBACK (action_shell_view_cb), - shell_window); - } - gtk_radio_action_set_group (action, group); group = gtk_radio_action_get_group (action); @@ -1719,6 +1714,26 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) g_type_class_unref (class); } + list = gtk_action_group_list_actions (action_group); + if (list != NULL) { + GObject *object = list->data; + const gchar *view_name; + + /* First view is the default. */ + view_name = g_object_get_data (object, "view-name"); + shell_window->priv->default_view = view_name; + + g_signal_connect ( + object, "changed", + G_CALLBACK (action_shell_view_cb), + shell_window); + + /* Sync up with the current shell view. */ + gtk_radio_action_set_current_value ( + GTK_RADIO_ACTION (object), current_value); + } + g_list_free (list); + g_free (children); } -- cgit v1.2.3 From 935897c9a256e0d260adc1dd0dc56b1a5c760cd9 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 9 Sep 2008 02:53:40 +0000 Subject: Fix some bugs in the way the shell widgets get initialized. svn path=/branches/kill-bonobo/; revision=36279 --- shell/e-shell-window-actions.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index aa14ec44eb..c785b9bc92 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1716,21 +1716,15 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) list = gtk_action_group_list_actions (action_group); if (list != NULL) { - GObject *object = list->data; - const gchar *view_name; - - /* First view is the default. */ - view_name = g_object_get_data (object, "view-name"); - shell_window->priv->default_view = view_name; + GtkRadioAction *action = list->data; g_signal_connect ( - object, "changed", + action, "changed", G_CALLBACK (action_shell_view_cb), shell_window); /* Sync up with the current shell view. */ - gtk_radio_action_set_current_value ( - GTK_RADIO_ACTION (object), current_value); + gtk_radio_action_set_current_value (action, current_value); } g_list_free (list); -- cgit v1.2.3 From 2e83206b30fad6e108b4a393002c171df0474c9e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 9 Sep 2008 17:29:09 +0000 Subject: Fix some bootstrapping issues. svn path=/branches/kill-bonobo/; revision=36291 --- shell/e-shell-window-actions.c | 54 ++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 33 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index c785b9bc92..090bee4025 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -20,12 +20,9 @@ #include "e-shell-window-private.h" -#include - -#include -#include -#include -#include +#include +#include +#include #include #include @@ -933,17 +930,6 @@ action_send_receive_cb (GtkAction *action, e_shell_send_receive (shell, GTK_WINDOW (shell_window)); } -static void -action_shell_view_cb (GtkRadioAction *action, - GtkRadioAction *current, - EShellWindow *shell_window) -{ - const gchar *view_name; - - view_name = g_object_get_data (G_OBJECT (current), "view-name"); - e_shell_window_set_current_view (shell_window, view_name); -} - static void action_show_sidebar_cb (GtkToggleAction *action, EShellWindow *shell_window) @@ -1019,6 +1005,17 @@ action_submit_bug_cb (GtkAction *action, } } +static void +action_switcher_cb (GtkRadioAction *action, + GtkRadioAction *current, + EShellWindow *shell_window) +{ + const gchar *view_name; + + view_name = g_object_get_data (G_OBJECT (current), "view-name"); + e_shell_window_switch_to_view (shell_window, view_name); +} + static void action_switcher_style_cb (GtkRadioAction *action, GtkRadioAction *current, @@ -1528,8 +1525,8 @@ e_shell_window_actions_init (EShellWindow *shell_window) gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - /* Shell View Actions (empty) */ - action_group = shell_window->priv->shell_view_actions; + /* Switcher Actions (empty) */ + action_group = shell_window->priv->switcher_actions; gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); } @@ -1608,7 +1605,7 @@ e_shell_window_create_new_menu (EShellWindow *shell_window) } void -e_shell_window_create_shell_view_actions (EShellWindow *shell_window) +e_shell_window_create_switcher_actions (EShellWindow *shell_window) { GType *children; GSList *group = NULL; @@ -1616,15 +1613,12 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) GtkUIManager *ui_manager; EShellSwitcher *switcher; GList *list; - const gchar *current_view; - gint current_value = 0; guint n_children, ii; guint merge_id; g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - action_group = shell_window->priv->shell_view_actions; - current_view = e_shell_window_get_current_view (shell_window); + action_group = shell_window->priv->switcher_actions; children = g_type_children (E_TYPE_SHELL_VIEW, &n_children); switcher = E_SHELL_SWITCHER (shell_window->priv->switcher); ui_manager = e_shell_window_get_ui_manager (shell_window); @@ -1664,13 +1658,9 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) } view_name = class->type_module->name; - action_name = g_strdup_printf ("shell-view-%s", view_name); + action_name = g_strdup_printf (SWITCHER_FORMAT, view_name); tooltip = g_strdup_printf (_("Switch to %s"), class->label); - /* Does this action represent the current view? */ - if (strcmp (view_name, current_view) == 0) - current_value = ii; - /* Note, we have to set "icon-name" separately because * gtk_radio_action_new() expects a "stock-id". Sadly, * GTK+ still distinguishes between the two. */ @@ -1720,11 +1710,8 @@ e_shell_window_create_shell_view_actions (EShellWindow *shell_window) g_signal_connect ( action, "changed", - G_CALLBACK (action_shell_view_cb), + G_CALLBACK (action_switcher_cb), shell_window); - - /* Sync up with the current shell view. */ - gtk_radio_action_set_current_value (action, current_value); } g_list_free (list); @@ -1754,6 +1741,7 @@ e_shell_window_update_gal_view_menu (EShellWindow *shell_window) view_name = e_shell_window_get_current_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); instance = e_shell_view_get_view_instance (shell_view); + g_debug ("GalViewInstance: %p", instance); action_group = shell_window->priv->gal_view_actions; merge_id = shell_window->priv->gal_view_merge_id; -- cgit v1.2.3 From 7ee6ef65f1019389c172478a80b8f0aa73a1453e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 13 Sep 2008 04:02:09 +0000 Subject: Allow EShellContent, EShellSidebar, and EShellTaskbar to be subclassed, and begin doing so for Calendars, Memos and Tasks. Makes the code cleaner. svn path=/branches/kill-bonobo/; revision=36317 --- shell/e-shell-window-actions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 090bee4025..917c6fce3b 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -871,7 +871,7 @@ action_search_clear_cb (GtkAction *action, view_name = e_shell_window_get_current_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); - shell_content = e_shell_view_get_content (shell_view); + shell_content = e_shell_view_get_shell_content (shell_view); e_shell_content_set_search_text (shell_content, ""); } @@ -888,7 +888,7 @@ action_search_edit_cb (GtkAction *action, view_name = e_shell_window_get_current_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); - shell_content = e_shell_view_get_content (shell_view); + shell_content = e_shell_view_get_shell_content (shell_view); context = e_shell_content_get_search_context (shell_content); g_return_if_fail (context != NULL); -- cgit v1.2.3 From bb7cb1d677117a938ae18d9cae7acc7a56678b6f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 17 Sep 2008 15:07:13 +0000 Subject: Massive address book refactoring. Things are mostly working again. Also, begin documenting the new shell API, and provide a Gtk-Doc framework. svn path=/branches/kill-bonobo/; revision=36359 --- shell/e-shell-window-actions.c | 90 ++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 60 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 917c6fce3b..b13c6785b1 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -706,56 +706,36 @@ action_gal_define_views_cb (GtkAction *action, EShellWindow *shell_window) { EShellView *shell_view; - GalViewInstance *instance; + EShellViewClass *shell_view_class; + GalViewCollection *view_collection; GtkWidget *dialog; const gchar *view_name; - view_name = e_shell_window_get_current_view (shell_window); + view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); - instance = e_shell_view_get_view_instance (shell_view); - g_return_if_fail (instance != NULL); + shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); + view_collection = shell_view_class->view_collection; + g_return_if_fail (view_collection != NULL); - dialog = gal_define_views_dialog_new (instance->collection); + dialog = gal_define_views_dialog_new (view_collection); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) - gal_view_collection_save (instance->collection); + gal_view_collection_save (view_collection); gtk_widget_destroy (dialog); } -static void -action_gal_save_custom_view_cb (GtkAction *action, - EShellWindow *shell_window) -{ - EShellView *shell_view; - GalViewInstance *instance; - const gchar *view_name; - - view_name = e_shell_window_get_current_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); - instance = e_shell_view_get_view_instance (shell_view); - g_return_if_fail (instance != NULL); - - gal_view_instance_save_as (instance); -} - static void action_gal_view_cb (GtkRadioAction *action, GtkRadioAction *current, EShellWindow *shell_window) { EShellView *shell_view; - GalViewInstance *instance; const gchar *view_name; const gchar *view_id; - view_name = e_shell_window_get_current_view (shell_window); + view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); - instance = e_shell_view_get_view_instance (shell_view); - g_return_if_fail (instance != NULL); - view_id = g_object_get_data (G_OBJECT (current), "view-id"); - g_return_if_fail (view_id != NULL); - - gal_view_instance_set_current_view_id (instance, view_id); + e_shell_view_set_view_id (shell_view, view_id); } static void @@ -869,7 +849,7 @@ action_search_clear_cb (GtkAction *action, EShellView *shell_view; const gchar *view_name; - view_name = e_shell_window_get_current_view (shell_window); + view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); e_shell_content_set_search_text (shell_content, ""); @@ -886,7 +866,7 @@ action_search_edit_cb (GtkAction *action, const gchar *filename; const gchar *view_name; - view_name = e_shell_window_get_current_view (shell_window); + view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); context = e_shell_content_get_search_context (shell_content); @@ -1380,7 +1360,7 @@ static GtkActionEntry shell_gal_view_entries[] = { N_("Save Custom View..."), NULL, N_("Save current custom view"), - G_CALLBACK (action_gal_save_custom_view_cb) }, + NULL }, /* Handled by subclasses. */ /*** Menus ***/ @@ -1436,7 +1416,7 @@ shell_window_extract_actions (EShellWindow *shell_window, * as belonging to the current EShellView and move them to the * destination list. */ - current_view = e_shell_window_get_current_view (shell_window); + current_view = e_shell_window_get_active_view (shell_window); /* Example: Suppose [A] and [C] are tagged for this EShellView. * @@ -1719,29 +1699,31 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) } void -e_shell_window_update_gal_view_menu (EShellWindow *shell_window) +e_shell_window_update_view_menu (EShellWindow *shell_window) { EShellView *shell_view; + EShellViewClass *shell_view_class; GtkUIManager *ui_manager; GtkActionGroup *action_group; - GalViewInstance *instance; - GalViewCollection *collection; + GalViewCollection *view_collection; GtkRadioAction *radio_action; GtkAction *action; GList *list, *iter; GSList *radio_group; gboolean visible; - const gchar *view_name; const gchar *path; - gchar *gal_view_id; + const gchar *view_id; + const gchar *view_name; guint merge_id; gint count, ii; ui_manager = e_shell_window_get_ui_manager (shell_window); - view_name = e_shell_window_get_current_view (shell_window); + view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); - instance = e_shell_view_get_view_instance (shell_view); - g_debug ("GalViewInstance: %p", instance); + shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); + view_collection = shell_view_class->view_collection; + view_id = e_shell_view_get_view_id (shell_view); + g_return_if_fail (view_collection != NULL); action_group = shell_window->priv->gal_view_actions; merge_id = shell_window->priv->gal_view_merge_id; @@ -1752,25 +1734,13 @@ e_shell_window_update_gal_view_menu (EShellWindow *shell_window) /* XXX Annoying that GTK+ doesn't provide a function for this. * http://bugzilla.gnome.org/show_bug.cgi?id=550485 */ list = gtk_action_group_list_actions (action_group); - for (iter = list; iter != NULL; iter = iter->next) { - GtkAction *action = iter->data; - gtk_action_group_remove_action (action_group, action); - } + for (iter = list; iter != NULL; iter = iter->next) + gtk_action_group_remove_action (action_group, iter->data); g_list_free (list); - /* If there's no view instance then just hide the entire - * "Current View" menu and return. */ - action = ACTION (GAL_VIEW_MENU); - gtk_action_set_visible (action, instance != NULL); - if (instance == NULL) - return; - - /* We have a view instance, so forge ahead. */ - collection = instance->collection; - count = gal_view_collection_get_count (collection); + /* We have a view ID, so forge ahead. */ + count = gal_view_collection_get_count (view_collection); path = "/main-menu/view-menu/gal-view-menu/gal-view-list"; - gal_view_id = gal_view_instance_get_current_view_id (instance); - g_return_if_fail (gal_view_id != NULL); /* Default to "Custom View", unless we find our view ID. */ radio_action = GTK_RADIO_ACTION (ACTION (GAL_CUSTOM_VIEW)); @@ -1784,7 +1754,7 @@ e_shell_window_update_gal_view_menu (EShellWindow *shell_window) gchar *action_name; gchar *tooltip; - item = gal_view_collection_get_view_item (collection, ii); + item = gal_view_collection_get_view_item (view_collection, ii); action_name = g_strdup_printf ( "gal-view-%s-%d", view_name, ii); @@ -1800,7 +1770,7 @@ e_shell_window_update_gal_view_menu (EShellWindow *shell_window) G_OBJECT (radio_action), "view-id", g_strdup (item->id), (GDestroyNotify) g_free); - if (strcmp (item->id, gal_view_id) == 0) + if (view_id != NULL && strcmp (item->id, view_id) == 0) gtk_radio_action_set_current_value (radio_action, ii); action = GTK_ACTION (radio_action); -- cgit v1.2.3 From 0c27b4ab1b75a29a0ea2b2c6ae3a568663179bdf Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 18 Sep 2008 21:10:23 +0000 Subject: Finally got the "Current View" menu under control. svn path=/branches/kill-bonobo/; revision=36380 --- shell/e-shell-window-actions.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index b13c6785b1..f03c775b3d 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -718,9 +718,11 @@ action_gal_define_views_cb (GtkAction *action, g_return_if_fail (view_collection != NULL); dialog = gal_define_views_dialog_new (view_collection); - if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) - gal_view_collection_save (view_collection); + gtk_dialog_run (GTK_DIALOG (dialog)); + gal_view_collection_save (view_collection); gtk_widget_destroy (dialog); + + e_shell_window_update_view_menu (shell_window); } static void @@ -1605,8 +1607,9 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) merge_id = gtk_ui_manager_new_merge_id (ui_manager); /* Construct a group of radio actions from the various EShellView - * subclasses and register them with our ESidebar. These actions - * are manifested as switcher buttons and View->Window menu items. + * subclasses and register them with the EShellSwitcher. These + * actions are manifested as switcher buttons and View->Window + * menu items. * * Note: The shell window has already selected a view by now, * so we have to be careful not to overwrite that when setting @@ -1692,8 +1695,8 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) action, "changed", G_CALLBACK (action_switcher_cb), shell_window); + g_list_free (list); } - g_list_free (list); g_free (children); } @@ -1742,6 +1745,12 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) count = gal_view_collection_get_count (view_collection); path = "/main-menu/view-menu/gal-view-menu/gal-view-list"; + /* Prevent spurious activations. */ + action = ACTION (GAL_CUSTOM_VIEW); + g_signal_handlers_block_matched ( + action, G_SIGNAL_MATCH_FUNC, 0, 0, + NULL, action_gal_view_cb, NULL); + /* Default to "Custom View", unless we find our view ID. */ radio_action = GTK_RADIO_ACTION (ACTION (GAL_CUSTOM_VIEW)); gtk_radio_action_set_group (radio_action, NULL); @@ -1763,6 +1772,7 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) radio_action = gtk_radio_action_new ( action_name, item->title, tooltip, NULL, ii); + action = GTK_ACTION (radio_action); gtk_radio_action_set_group (radio_action, radio_group); radio_group = gtk_radio_action_get_group (radio_action); @@ -1773,7 +1783,6 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) if (view_id != NULL && strcmp (item->id, view_id) == 0) gtk_radio_action_set_current_value (radio_action, ii); - action = GTK_ACTION (radio_action); gtk_action_group_add_action (action_group, action); gtk_ui_manager_add_ui ( @@ -1789,6 +1798,9 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) action = ACTION (GAL_CUSTOM_VIEW); gtk_action_set_visible (action, visible); + g_signal_handlers_unblock_matched ( + action, G_SIGNAL_MATCH_FUNC, 0, 0, + NULL, action_gal_view_cb, NULL); action = ACTION (GAL_SAVE_CUSTOM_VIEW); gtk_action_set_visible (action, visible); -- cgit v1.2.3 From 73c370019c4de89d4c901ee8c25cc0cbb55992fb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 22 Sep 2008 21:03:28 +0000 Subject: Search UI is kinda sorta working. Still some outstanding issues. svn path=/branches/kill-bonobo/; revision=36427 --- shell/e-shell-window-actions.c | 193 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 169 insertions(+), 24 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index f03c775b3d..5375774702 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -673,6 +673,29 @@ action_contents_cb (GtkAction *action, e_display_help (GTK_WINDOW (shell_window), NULL); } +static void +action_custom_rule_cb (GtkAction *action, + EShellWindow *shell_window) +{ + FilterRule *rule; + EShellView *shell_view; + EShellContent *shell_content; + const gchar *view_name; + + rule = g_object_get_data (G_OBJECT (action), "rule"); + g_return_if_fail (rule != NULL); + + view_name = e_shell_window_get_active_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + shell_content = e_shell_view_get_shell_content (shell_view); + + rule = g_object_get_data (G_OBJECT (action), "rule"); + g_return_if_fail (IS_FILTER_RULE (rule)); + + e_shell_content_set_search_rule (shell_content, rule); + gtk_action_activate (ACTION (SEARCH_EXECUTE)); +} + static void action_faq_cb (GtkAction *action, EShellWindow *shell_window) @@ -841,65 +864,85 @@ static void action_search_advanced_cb (GtkAction *action, EShellWindow *shell_window) { + EShellView *shell_view; + EShellContent *shell_content; + const gchar *view_name; + + view_name = e_shell_window_get_active_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + shell_content = e_shell_view_get_shell_content (shell_view); + + e_shell_content_run_advanced_search_dialog (shell_content); + e_shell_window_update_search_menu (shell_window); } static void action_search_clear_cb (GtkAction *action, EShellWindow *shell_window) { - EShellContent *shell_content; EShellView *shell_view; + EShellContent *shell_content; const gchar *view_name; view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); - e_shell_content_set_search_text (shell_content, ""); + + e_shell_content_set_search_rule (shell_content, NULL); + e_shell_content_set_search_text (shell_content, NULL); + + gtk_action_activate (ACTION (SEARCH_EXECUTE)); + + e_shell_window_update_search_menu (shell_window); } static void action_search_edit_cb (GtkAction *action, EShellWindow *shell_window) { - EShellContent *shell_content; EShellView *shell_view; - RuleContext *context; - RuleEditor *editor; - const gchar *filename; + EShellContent *shell_content; const gchar *view_name; view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); - context = e_shell_content_get_search_context (shell_content); - g_return_if_fail (context != NULL); - - /* XXX I don't know why the RuleContext can't just store - * system and user file names properly. Fix this? */ - filename = g_object_get_data (G_OBJECT (context), "user"); - g_return_if_fail (filename != NULL); - editor = rule_editor_new ( - context, FILTER_SOURCE_INCOMING, _("Searches")); - gtk_window_set_title (GTK_WINDOW (editor), _("Searches")); - - if (gtk_dialog_run (GTK_DIALOG (editor)) == GTK_RESPONSE_OK) - rule_context_save (context, filename); - - gtk_widget_destroy (GTK_WIDGET (editor)); + e_shell_content_run_edit_searches_dialog (shell_content); + e_shell_window_update_search_menu (shell_window); } static void -action_search_execute_cb (GtkAction *action, +action_search_options_cb (GtkAction *action, EShellWindow *shell_window) { - gtk_action_set_sensitive (action, FALSE); + EShellView *shell_view; + EShellViewClass *shell_view_class; + const gchar *view_name; + const gchar *widget_path; + + view_name = e_shell_window_get_active_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); + + widget_path = shell_view_class->search_options_path; + e_shell_window_show_popup_menu (shell_window, widget_path, NULL); } static void action_search_save_cb (GtkAction *action, EShellWindow *shell_window) { + EShellView *shell_view; + EShellContent *shell_content; + const gchar *view_name; + + view_name = e_shell_window_get_active_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + shell_content = e_shell_view_get_shell_content (shell_view); + + e_shell_content_run_save_search_dialog (shell_content); + e_shell_window_update_search_menu (shell_window); } static void @@ -1172,7 +1215,14 @@ static GtkActionEntry shell_entries[] = { N_("_Find Now"), NULL, N_("Execute the current search parameters"), - G_CALLBACK (action_search_execute_cb) }, + NULL }, /* Handled by EShellContent and subclasses. */ + + { "search-options", + GTK_STOCK_FIND, + NULL, + NULL, + N_("Click here to change the search type"), + G_CALLBACK (action_search_options_cb) }, { "search-save", NULL, @@ -1507,6 +1557,11 @@ e_shell_window_actions_init (EShellWindow *shell_window) gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + /* Custom Rule Actions (empty) */ + action_group = shell_window->priv->custom_rule_actions; + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + /* Switcher Actions (empty) */ action_group = shell_window->priv->switcher_actions; gtk_action_group_set_translation_domain (action_group, domain); @@ -1805,3 +1860,93 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) action = ACTION (GAL_SAVE_CUSTOM_VIEW); gtk_action_set_visible (action, visible); } + +void +e_shell_window_update_search_menu (EShellWindow *shell_window) +{ + EShellContent *shell_content; + EShellView *shell_view; + EShellViewClass *shell_view_class; + RuleContext *context; + FilterRule *rule; + GtkUIManager *ui_manager; + GtkActionGroup *action_group; + GList *list, *iter; + const gchar *source; + const gchar *view_name; + gboolean sensitive; + guint merge_id; + gint ii = 0; + + ui_manager = e_shell_window_get_ui_manager (shell_window); + view_name = e_shell_window_get_active_view (shell_window); + shell_view = e_shell_window_get_view (shell_window, view_name); + shell_content = e_shell_view_get_shell_content (shell_view); + context = e_shell_content_get_search_context (shell_content); + shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); + source = FILTER_SOURCE_INCOMING; + + /* Update sensitivity of search actions. */ + + sensitive = (e_shell_content_get_search_rule (shell_content) != NULL); + gtk_action_set_sensitive (ACTION (SEARCH_CLEAR), sensitive); + gtk_action_set_sensitive (ACTION (SEARCH_SAVE), sensitive); + + sensitive = (shell_view_class->search_options_path != NULL); + gtk_action_set_sensitive (ACTION (SEARCH_OPTIONS), sensitive); + + /* Add custom rules to the Search menu. */ + + action_group = shell_window->priv->custom_rule_actions; + merge_id = shell_window->priv->custom_rule_merge_id; + + /* Unmerge the previous menu. */ + gtk_ui_manager_remove_ui (ui_manager, merge_id); + + /* XXX Annoying that GTK+ doesn't provide a function for this. + * http://bugzilla.gnome.org/show_bug.cgi?id=550485 */ + list = gtk_action_group_list_actions (action_group); + for (iter = list; iter != NULL; iter = iter->next) + gtk_action_group_remove_action (action_group, iter->data); + g_list_free (list); + + rule = rule_context_next_rule (context, NULL, source); + while (rule != NULL) { + GtkAction *action; + gchar *action_name; + gchar *action_label; + + action_name = g_strdup_printf ("custom-rule-%d", ii++); + if (ii < 10) + action_label = g_strdup_printf ( + "_%d. %s", ii, rule->name); + else + action_label = g_strdup (rule->name); + + action = gtk_action_new ( + action_name, action_label, + _("Execute these search parameters"), NULL); + + g_object_set_data_full ( + G_OBJECT (action), + "rule", g_object_ref (rule), + (GDestroyNotify) g_object_unref); + + g_signal_connect ( + action, "activate", + G_CALLBACK (action_custom_rule_cb), shell_window); + + gtk_action_group_add_action (action_group, action); + + gtk_ui_manager_add_ui ( + ui_manager, merge_id, + "/main-menu/search-menu/custom-rules", + action_name, action_name, + GTK_UI_MANAGER_AUTO, FALSE); + + g_free (action_name); + g_free (action_label); + + rule = rule_context_next_rule (context, rule, source); + } +} -- cgit v1.2.3 From 9515b98403f2f7ef77dc6c51f82505fccef08c2b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 24 Sep 2008 22:53:30 +0000 Subject: Saving progress. Experimenting with directory layout. Saving progress. Experimenting with directory layout. svn path=/branches/kill-bonobo/; revision=36446 --- shell/e-shell-window-actions.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 5375774702..c03e60eecf 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -686,7 +686,7 @@ action_custom_rule_cb (GtkAction *action, g_return_if_fail (rule != NULL); view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); rule = g_object_get_data (G_OBJECT (action), "rule"); @@ -735,7 +735,7 @@ action_gal_define_views_cb (GtkAction *action, const gchar *view_name; view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); view_collection = shell_view_class->view_collection; g_return_if_fail (view_collection != NULL); @@ -758,7 +758,7 @@ action_gal_view_cb (GtkRadioAction *action, const gchar *view_id; view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); view_id = g_object_get_data (G_OBJECT (current), "view-id"); e_shell_view_set_view_id (shell_view, view_id); } @@ -869,7 +869,7 @@ action_search_advanced_cb (GtkAction *action, const gchar *view_name; view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); e_shell_content_run_advanced_search_dialog (shell_content); @@ -885,7 +885,7 @@ action_search_clear_cb (GtkAction *action, const gchar *view_name; view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); e_shell_content_set_search_rule (shell_content, NULL); @@ -905,7 +905,7 @@ action_search_edit_cb (GtkAction *action, const gchar *view_name; view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); e_shell_content_run_edit_searches_dialog (shell_content); @@ -922,10 +922,10 @@ action_search_options_cb (GtkAction *action, const gchar *widget_path; view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); - widget_path = shell_view_class->search_options_path; + widget_path = shell_view_class->search_options; e_shell_window_show_popup_menu (shell_window, widget_path, NULL); } @@ -938,7 +938,7 @@ action_search_save_cb (GtkAction *action, const gchar *view_name; view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); e_shell_content_run_save_search_dialog (shell_content); @@ -1777,7 +1777,7 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) ui_manager = e_shell_window_get_ui_manager (shell_window); view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); view_collection = shell_view_class->view_collection; view_id = e_shell_view_get_view_id (shell_view); @@ -1880,7 +1880,7 @@ e_shell_window_update_search_menu (EShellWindow *shell_window) ui_manager = e_shell_window_get_ui_manager (shell_window); view_name = e_shell_window_get_active_view (shell_window); - shell_view = e_shell_window_get_view (shell_window, view_name); + shell_view = e_shell_window_get_shell_view (shell_window, view_name); shell_content = e_shell_view_get_shell_content (shell_view); context = e_shell_content_get_search_context (shell_content); shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); @@ -1892,7 +1892,7 @@ e_shell_window_update_search_menu (EShellWindow *shell_window) gtk_action_set_sensitive (ACTION (SEARCH_CLEAR), sensitive); gtk_action_set_sensitive (ACTION (SEARCH_SAVE), sensitive); - sensitive = (shell_view_class->search_options_path != NULL); + sensitive = (shell_view_class->search_options != NULL); gtk_action_set_sensitive (ACTION (SEARCH_OPTIONS), sensitive); /* Add custom rules to the Search menu. */ -- cgit v1.2.3 From 098ea8aad8d3249d9faca5df5b4fe67b94ba660f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 29 Sep 2008 16:14:46 +0000 Subject: Get Memos to come up. Doesn't really work yet, but the widgets are all there. svn path=/branches/kill-bonobo/; revision=36491 --- shell/e-shell-window-actions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index c03e60eecf..28920a7eb7 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -926,7 +926,7 @@ action_search_options_cb (GtkAction *action, shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); widget_path = shell_view_class->search_options; - e_shell_window_show_popup_menu (shell_window, widget_path, NULL); + e_shell_view_show_popup_menu (shell_view, widget_path, NULL); } static void @@ -1727,6 +1727,7 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) gtk_action_group_add_action_with_accel ( action_group, GTK_ACTION (action), accelerator); + g_debug ("Adding action '%s'", action_name); e_shell_switcher_add_action (switcher, GTK_ACTION (action)); gtk_ui_manager_add_ui ( -- cgit v1.2.3 From c261a99bc4765ccb99206ed6105a323698b514c7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 30 Sep 2008 03:25:23 +0000 Subject: Memos are mostly working now. Tasks to follow. svn path=/branches/kill-bonobo/; revision=36495 --- shell/e-shell-window-actions.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 28920a7eb7..ab403c31dc 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1727,7 +1727,6 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) gtk_action_group_add_action_with_accel ( action_group, GTK_ACTION (action), accelerator); - g_debug ("Adding action '%s'", action_name); e_shell_switcher_add_action (switcher, GTK_ACTION (action)); gtk_ui_manager_add_ui ( @@ -1767,7 +1766,6 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) GalViewCollection *view_collection; GtkRadioAction *radio_action; GtkAction *action; - GList *list, *iter; GSList *radio_group; gboolean visible; const gchar *path; @@ -1789,13 +1787,7 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) /* Unmerge the previous menu. */ gtk_ui_manager_remove_ui (ui_manager, merge_id); - - /* XXX Annoying that GTK+ doesn't provide a function for this. - * http://bugzilla.gnome.org/show_bug.cgi?id=550485 */ - list = gtk_action_group_list_actions (action_group); - for (iter = list; iter != NULL; iter = iter->next) - gtk_action_group_remove_action (action_group, iter->data); - g_list_free (list); + e_action_group_remove_all_actions (action_group); /* We have a view ID, so forge ahead. */ count = gal_view_collection_get_count (view_collection); -- cgit v1.2.3 From c6795be3a8b7b17ced9e99e17db9ac6cbed6e018 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 1 Oct 2008 03:48:51 +0000 Subject: Continue documenting the new shell API. svn path=/branches/kill-bonobo/; revision=36511 --- shell/e-shell-window-actions.c | 311 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 308 insertions(+), 3 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index ab403c31dc..c13204942e 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -40,12 +40,12 @@ /* Authors and Documenters * - * The names below must be in UTF8. The breaking of escaped strings + * The names below must be in UTF-8. The breaking of escaped strings * is so the hexadecimal sequences don't swallow too many characters. * * SO THAT MEANS, FOR 8-BIT CHARACTERS USE \xXX HEX ENCODING ONLY! * - * Not all environments are UTF8 and not all editors can handle it. + * Not all environments are UTF-8 and not all editors can handle it. */ static const gchar *authors[] = { "Aaron Weber", @@ -623,6 +623,14 @@ static const gchar *documenters[] = { NULL }; +/** + * E_SHELL_WINDOW_ACTION_ABOUT: + * @window: an #EShellWindow + * + * Activation of this action displays the application's About dialog. + * + * Main menu item: Help -> About + **/ static void action_about_cb (GtkAction *action, EShellWindow *shell_window) @@ -651,6 +659,15 @@ action_about_cb (GtkAction *action, NULL); } +/** + * E_SHELL_WINDOW_ACTION_CLOSE: + * @window: an #EShellWindow + * + * Activation of this action closes @window. If this is the last window, + * the application initiates shutdown. + * + * Main menu item: File -> Close + **/ static void action_close_cb (GtkAction *action, EShellWindow *shell_window) @@ -666,6 +683,14 @@ action_close_cb (GtkAction *action, gdk_event_free (event); } +/** + * E_SHELL_WINDOW_ACTION_CONTENTS: + * @window: an #EShellWindow + * + * Activation of this action opens the application's user manual. + * + * Main menu item: Help -> Contents + **/ static void action_contents_cb (GtkAction *action, EShellWindow *shell_window) @@ -696,6 +721,15 @@ action_custom_rule_cb (GtkAction *action, gtk_action_activate (ACTION (SEARCH_EXECUTE)); } +/** + * E_SHELL_WINDOW_ACTION_FAQ: + * @window: an #EShellWindow + * + * Activation of this action opens a web page with answers to frequently + * asked questions about this application. + * + * Main menu item: Help -> Evolution FAQ + **/ static void action_faq_cb (GtkAction *action, EShellWindow *shell_window) @@ -711,6 +745,14 @@ action_faq_cb (GtkAction *action, } } +/** + * E_SHELL_WINDOW_ACTION_FORGET_PASSWORDS: + * @window: an #EShellWindow + * + * Activation of this action deletes all stored passwords. + * + * Main menu item: File -> Forget Passwords + **/ static void action_forget_passwords_cb (GtkAction *action, EShellWindow *shell_window) @@ -724,6 +766,15 @@ action_forget_passwords_cb (GtkAction *action, e_passwords_forget_passwords (); } +/** + * E_SHELL_WINDOW_ACTION_GAL_DEFINE_VIEWS: + * @window: an #EShellWindow + * + * Activation of this action opens a dialog for editing GAL views for + * the current shell view. + * + * Main menu item: View -> Current View -> Define Views... + **/ static void action_gal_define_views_cb (GtkAction *action, EShellWindow *shell_window) @@ -748,6 +799,15 @@ action_gal_define_views_cb (GtkAction *action, e_shell_window_update_view_menu (shell_window); } +/** + * E_SHELL_WINDOW_ACTION_GAL_CUSTOM_VIEW: + * @window: an #EShellWindow + * + * This radio action is selected when using a custom GAL view that has + * not been saved. + * + * Main menu item: View -> Current View -> Custom View + **/ static void action_gal_view_cb (GtkRadioAction *action, GtkRadioAction *current, @@ -763,6 +823,23 @@ action_gal_view_cb (GtkRadioAction *action, e_shell_view_set_view_id (shell_view, view_id); } +/** + * E_SHELL_WINDOW_ACTION_GAL_SAVE_CUSTOM_VIEW: + * @window: an #EShellWindow + * + * Activation of this action saves a custom GAL view. + * + * Main menu item: View -> Current View -> Save Custom View... + **/ + +/** + * E_SHELL_WINDOW_ACTION_IMPORT: + * @window: an #EShellWindow + * + * Activation of this action opens the Evolution Import Assistant. + * + * Main menu item: File -> Import... + **/ static void action_import_cb (GtkAction *action, EShellWindow *shell_window) @@ -770,6 +847,14 @@ action_import_cb (GtkAction *action, e_shell_importer_start_import (shell_window); } +/** + * E_SHELL_WINDOW_ACTION_NEW_WINDOW: + * @window: an #EShellWindow + * + * Activation of this action opens a new shell window. + * + * Main menu item: File -> New Window + **/ static void action_new_window_cb (GtkAction *action, EShellWindow *shell_window) @@ -780,6 +865,14 @@ action_new_window_cb (GtkAction *action, e_shell_create_window (shell); } +/** + * E_SHELL_WINDOW_ACTION_PAGE_SETUP: + * @window: an #EShellWindow + * + * Activation of this action opens the application's Page Setup dialog. + * + * Main menu item: File -> Page Setup... + **/ static void action_page_setup_cb (GtkAction *action, EShellWindow *shell_window) @@ -787,6 +880,14 @@ action_page_setup_cb (GtkAction *action, e_print_run_page_setup_dialog (GTK_WINDOW (shell_window)); } +/** + * E_SHELL_WINDOW_ACTION_PREFERENCES: + * @window: an #EShellWindow + * + * Activation of this action opens the application's Preferences window. + * + * Main menu item: Edit -> Preferences + **/ static void action_preferences_cb (GtkAction *action, EShellWindow *shell_window) @@ -805,6 +906,15 @@ action_preferences_cb (GtkAction *action, /* FIXME Switch to a page appropriate for the current view. */ } +/** + * E_SHELL_WINDOW_ACTION_QUICK_REFERENCE: + * @window: an #EShellWindow + * + * Activation of this action opens a printable table of useful shortcut + * keys for this application. + * + * Main menu item: Help -> Quick Reference + **/ static void action_quick_reference_cb (GtkAction *action, EShellWindow *shell_window) @@ -850,6 +960,14 @@ action_quick_reference_cb (GtkAction *action, } } +/** + * E_SHELL_WINDOW_ACTION_QUIT: + * @window: an #EShellWindow + * + * Activation of this action initiates application shutdown. + * + * Main menu item: File -> Quit + **/ static void action_quit_cb (GtkAction *action, EShellWindow *shell_window) @@ -860,6 +978,14 @@ action_quit_cb (GtkAction *action, e_shell_quit (shell); } +/** + * E_SHELL_WINDOW_ACTION_SEARCH_ADVANCED: + * @window: an #EShellWindow + * + * Activation of this action opens an Advanced Search dialog. + * + * Main menu item: Search -> Advanced Search... + **/ static void action_search_advanced_cb (GtkAction *action, EShellWindow *shell_window) @@ -876,6 +1002,14 @@ action_search_advanced_cb (GtkAction *action, e_shell_window_update_search_menu (shell_window); } +/** + * E_SHELL_WINDOW_ACTION_SEARCH_CLEAR: + * @window: an #EShellWindow + * + * Activation of this action clears the most recent search results. + * + * Main menu item: Search -> Clear + **/ static void action_search_clear_cb (GtkAction *action, EShellWindow *shell_window) @@ -896,6 +1030,14 @@ action_search_clear_cb (GtkAction *action, e_shell_window_update_search_menu (shell_window); } +/** + * E_SHELL_WINDOW_ACTION_SEARCH_EDIT: + * @window: an #EShellWindow + * + * Activation of this action opens a dialog for editing saved searches. + * + * Main menu item: Search -> Edit Saved Searches... + **/ static void action_search_edit_cb (GtkAction *action, EShellWindow *shell_window) @@ -912,6 +1054,22 @@ action_search_edit_cb (GtkAction *action, e_shell_window_update_search_menu (shell_window); } +/** + * E_SHELL_WINDOW_ACTION_SEARCH_EXECUTE: + * @window: an #EShellWindow + * + * Activation of this action executes the current search conditions. + * + * Main menu item: Search -> Find Now + **/ + +/** + * E_SHELL_WINDOW_ACTION_SEARCH_OPTIONS: + * @window: an #EShellWindow + * + * Activation of this action displays a menu of search options. + * This appears as a "find" icon in the window's search entry. + **/ static void action_search_options_cb (GtkAction *action, EShellWindow *shell_window) @@ -929,6 +1087,14 @@ action_search_options_cb (GtkAction *action, e_shell_view_show_popup_menu (shell_view, widget_path, NULL); } +/** + * E_SHELL_WINDOW_ACTION_SEARCH_SAVE: + * @window: an #EShellWindow + * + * Activation of this action saves the current search conditions. + * + * Main menu item: Search -> Save Search... + **/ static void action_search_save_cb (GtkAction *action, EShellWindow *shell_window) @@ -945,6 +1111,14 @@ action_search_save_cb (GtkAction *action, e_shell_window_update_search_menu (shell_window); } +/** + * E_SHELL_WINDOW_ACTION_SEND_RECEIVE: + * @window: an #EShellWindow + * + * Activation of this action opens the Send & Receive Mail dialog. + * + * Main menu item: File -> Send / Receive + **/ static void action_send_receive_cb (GtkAction *action, EShellWindow *shell_window) @@ -955,6 +1129,14 @@ action_send_receive_cb (GtkAction *action, e_shell_send_receive (shell, GTK_WINDOW (shell_window)); } +/** + * E_SHELL_WINDOW_ACTION_SHOW_SIDEBAR: + * @window: an #EShellWindow + * + * This toggle action controls whether the side bar is visible. + * + * Main menu item: View -> Layout -> Show Side Bar + **/ static void action_show_sidebar_cb (GtkToggleAction *action, EShellWindow *shell_window) @@ -970,6 +1152,14 @@ action_show_sidebar_cb (GtkToggleAction *action, g_object_set (widget, "visible", active, NULL); } +/** + * E_SHELL_WINDOW_ACTION_SHOW_STATUSBAR: + * @window: an #EShellWindow + * + * This toggle action controls whether the status bar is visible. + * + * Main menu item: View -> Layout -> Show Status Bar + **/ static void action_show_statusbar_cb (GtkToggleAction *action, EShellWindow *shell_window) @@ -982,6 +1172,14 @@ action_show_statusbar_cb (GtkToggleAction *action, g_object_set (widget, "visible", active, NULL); } +/** + * E_SHELL_WINDOW_ACTION_SHOW_SWITCHER: + * @window: an #EShellWindow + * + * This toggle action controls whether the switcher buttons are visible. + * + * Main menu item: View -> Switcher Appearance -> Show Buttons + **/ static void action_show_switcher_cb (GtkToggleAction *action, EShellWindow *shell_window) @@ -994,6 +1192,14 @@ action_show_switcher_cb (GtkToggleAction *action, e_shell_switcher_set_visible (switcher, active); } +/** + * E_SHELL_WINDOW_ACTION_SHOW_TOOLBAR: + * @window: an #EShellWindow + * + * This toggle action controls whether the tool bar is visible. + * + * Main menu item: View -> Layout -> Show Tool Bar + **/ static void action_show_toolbar_cb (GtkToggleAction *action, EShellWindow *shell_window) @@ -1006,6 +1212,15 @@ action_show_toolbar_cb (GtkToggleAction *action, g_object_set (widget, "visible", active, NULL); } +/** + * E_SHELL_WINDOW_ACTION_SUBMIT_BUG: + * @window: an #EShellWindow + * + * Activation of this action allows users to report a bug using + * Bug Buddy. + * + * Main menu item: Help -> Submit Bug Report + **/ static void action_submit_bug_cb (GtkAction *action, EShellWindow *shell_window) @@ -1041,6 +1256,42 @@ action_switcher_cb (GtkRadioAction *action, e_shell_window_switch_to_view (shell_window, view_name); } +/** + * E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_BOTH: + * @window: an #EShellWindow + * + * This radio action displays switcher buttons with icons and text. + * + * Main menu item: View -> Switcher Appearance -> Icons and Text + **/ + +/** + * E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_ICONS: + * @window: an #EShellWindow + * + * This radio action displays switcher buttons with icons only. + * + * Main menu item: View -> Switcher Appearance -> Icons Only + **/ + +/** + * E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_TEXT: + * @window: an #EShellWindow + * + * This radio action displays switcher buttons with text only. + * + * Main menu item: View -> Switcher Appearance -> Text Only + **/ + +/** + * E_SHELL_WINDOW_ACTION_SWITCHER_STYLE_USER: + * @window: an #EShellWindow + * + * This radio action displays switcher buttons according to the desktop + * toolbar setting. + * + * Main menu item: View -> Switcher Appearance -> Toolbar Style + **/ static void action_switcher_style_cb (GtkRadioAction *action, GtkRadioAction *current, @@ -1066,6 +1317,14 @@ action_switcher_style_cb (GtkRadioAction *action, } } +/** + * E_SHELL_WINDOW_ACTION_SYNC_OPTIONS: + * @window: an #EShellWindow + * + * Activation of this action opens the Gnome Pilot settings. + * + * Main menu item: Edit -> Synchronization Options... + **/ static void action_sync_options_cb (GtkAction *action, EShellWindow *shell_window) @@ -1090,6 +1349,14 @@ action_sync_options_cb (GtkAction *action, } } +/** + * E_SHELL_WINDOW_ACTION_WORK_OFFLINE: + * @window: an #EShellWindow + * + * Activation of this action puts the application into offline mode. + * + * Main menu item: File -> Work Offline + **/ static void action_work_offline_cb (GtkAction *action, EShellWindow *shell_window) @@ -1100,6 +1367,14 @@ action_work_offline_cb (GtkAction *action, e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_OFFLINE); } +/** + * E_SHELL_WINDOW_ACTION_WORK_ONLINE: + * @window: an #EShellWindow + * + * Activation of this action puts the application into online mode. + * + * Main menu item: File -> Work Online + **/ static void action_work_online_cb (GtkAction *action, EShellWindow *shell_window) @@ -1110,6 +1385,36 @@ action_work_online_cb (GtkAction *action, e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_ONLINE); } +/** + * E_SHELL_WINDOW_ACTION_GROUP_CUSTOM_RULES: + * @window: an #EShellWindow + **/ + +/** + * E_SHELL_WINDOW_ACTION_GROUP_GAL_VIEW: + * @window: an #EShellWindow + **/ + +/** + * E_SHELL_WINDOW_ACTION_GROUP_NEW_ITEM: + * @window: an #EShellWindow + **/ + +/** + * E_SHELL_WINDOW_ACTION_GROUP_NEW_SOURCE: + * @window: an #EShellWindow + **/ + +/** + * E_SHELL_WINDOW_ACTION_GROUP_SHELL: + * @window: an #EShellWindow + **/ + +/** + * E_SHELL_WINDOW_ACTION_GROUP_SWITCHER: + * @window: an #EShellWindow + **/ + static GtkActionEntry shell_entries[] = { { "about", @@ -1360,7 +1665,7 @@ static GtkToggleActionEntry shell_toggle_entries[] = { { "show-toolbar", NULL, - N_("Show _Toolbar"), + N_("Show _Tool Bar"), NULL, N_("Show the toolbar"), G_CALLBACK (action_show_toolbar_cb), -- cgit v1.2.3 From 791c982c456fca453978358d2e919082419b7808 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 1 Oct 2008 21:51:10 +0000 Subject: Update the headers on files I've created or completely rewritten to match Sankar's LGPLv3 template. svn path=/branches/kill-bonobo/; revision=36535 --- shell/e-shell-window-actions.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index c13204942e..91f1a16e78 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1,21 +1,22 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- +/* * e-shell-window-actions.c * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * - * 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., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. */ #include "e-shell-window-private.h" -- cgit v1.2.3 From 086a96050b16f6dabd99a391b5a4faf0411963a1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 3 Oct 2008 04:43:40 +0000 Subject: Tasks progress. Merge EMemoPreview back into ECalComponentPreview. svn path=/branches/kill-bonobo/; revision=36538 --- shell/e-shell-window-actions.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 91f1a16e78..9dac1127c3 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -2083,6 +2083,8 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) ui_manager = e_shell_window_get_ui_manager (shell_window); view_name = e_shell_window_get_active_view (shell_window); shell_view = e_shell_window_get_shell_view (shell_window, view_name); + g_return_if_fail (shell_view != NULL); + shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view); view_collection = shell_view_class->view_collection; view_id = e_shell_view_get_view_id (shell_view); -- cgit v1.2.3 From 253e90b8de63d9c064a0df05cf0e2e153f913474 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 3 Oct 2008 19:24:59 +0000 Subject: Tasks is working. Still need to deal with some loose ends and test it all. svn path=/branches/kill-bonobo/; revision=36551 --- shell/e-shell-window-actions.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 9dac1127c3..9e7c4aaee7 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1519,7 +1519,7 @@ static GtkActionEntry shell_entries[] = { { "search-execute", GTK_STOCK_FIND, N_("_Find Now"), - NULL, + "", /* Block the default Ctrl+F. */ N_("Execute the current search parameters"), NULL }, /* Handled by EShellContent and subclasses. */ @@ -1970,12 +1970,7 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) /* Construct a group of radio actions from the various EShellView * subclasses and register them with the EShellSwitcher. These * actions are manifested as switcher buttons and View->Window - * menu items. - * - * Note: The shell window has already selected a view by now, - * so we have to be careful not to overwrite that when setting - * up the radio action group. That means not connecting to any - * "changed" signals until after the group is built. */ + * menu items. */ for (ii = 0; ii < n_children; ii++) { EShellViewClass *class; -- cgit v1.2.3 From ff5e0b312d04daf97b35616b55280ae7f2d17cf7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 3 Oct 2008 22:05:32 +0000 Subject: Finally fix the stupid shell view bootstrapping issue. svn path=/branches/kill-bonobo/; revision=36553 --- shell/e-shell-window-actions.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 9e7c4aaee7..2e80ab6bf6 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1673,6 +1673,19 @@ static GtkToggleActionEntry shell_toggle_entries[] = { TRUE } }; +static GtkRadioActionEntry shell_switcher_entries[] = { + + /* This action represents the initial active shell view. + * It should not be visible in the UI, nor should it be + * possible to switch to it from another shell view. */ + { "switcher-initial", + NULL, + NULL, + NULL, + NULL, + -1 } +}; + static GtkRadioActionEntry shell_switcher_style_entries[] = { { "switcher-style-icons", @@ -1868,9 +1881,13 @@ e_shell_window_actions_init (EShellWindow *shell_window) gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - /* Switcher Actions (empty) */ + /* Switcher Actions */ action_group = shell_window->priv->switcher_actions; gtk_action_group_set_translation_domain (action_group, domain); + gtk_action_group_add_radio_actions ( + action_group, shell_switcher_entries, + G_N_ELEMENTS (shell_switcher_entries), + -1, G_CALLBACK (action_switcher_cb), shell_window); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); } @@ -1952,10 +1969,10 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) { GType *children; GSList *group = NULL; + GtkRadioAction *action; GtkActionGroup *action_group; GtkUIManager *ui_manager; EShellSwitcher *switcher; - GList *list; guint n_children, ii; guint merge_id; @@ -1972,9 +1989,12 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) * actions are manifested as switcher buttons and View->Window * menu items. */ + action = GTK_RADIO_ACTION (ACTION (SWITCHER_INITIAL)); + gtk_radio_action_set_group (action, group); + group = gtk_radio_action_get_group (action); + for (ii = 0; ii < n_children; ii++) { EShellViewClass *class; - GtkRadioAction *action; const gchar *view_name; gchar *accelerator; gchar *action_name; @@ -2043,17 +2063,6 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) g_type_class_unref (class); } - list = gtk_action_group_list_actions (action_group); - if (list != NULL) { - GtkRadioAction *action = list->data; - - g_signal_connect ( - action, "changed", - G_CALLBACK (action_switcher_cb), - shell_window); - g_list_free (list); - } - g_free (children); } -- cgit v1.2.3 From 79aa45cfed7e87150de85869795ef0dd3be06db0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 13 Oct 2008 17:57:46 +0000 Subject: Progress update: - Calendar is kind of a mess at the moment. Doesn't compile. - Roughed in the Mail module, including all the actions. That _does_ compile. Runs, even. svn path=/branches/kill-bonobo/; revision=36611 --- shell/e-shell-window-actions.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 2e80ab6bf6..a5ca5b310d 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1435,7 +1435,7 @@ static GtkActionEntry shell_entries[] = { { "contents", GTK_STOCK_HELP, N_("_Contents"), - NULL, + "F1", N_("Open the Evolution User Guide"), G_CALLBACK (action_contents_cb) }, @@ -1889,6 +1889,10 @@ e_shell_window_actions_init (EShellWindow *shell_window) G_N_ELEMENTS (shell_switcher_entries), -1, G_CALLBACK (action_switcher_cb), shell_window); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + + /* Fine tuning. */ + + g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL); } GtkWidget * @@ -1967,22 +1971,24 @@ e_shell_window_create_new_menu (EShellWindow *shell_window) void e_shell_window_create_switcher_actions (EShellWindow *shell_window) { - GType *children; GSList *group = NULL; GtkRadioAction *action; GtkActionGroup *action_group; GtkUIManager *ui_manager; EShellSwitcher *switcher; - guint n_children, ii; + EShell *shell; + GList *list, *iter; guint merge_id; + guint ii = 0; g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); action_group = shell_window->priv->switcher_actions; - children = g_type_children (E_TYPE_SHELL_VIEW, &n_children); switcher = E_SHELL_SWITCHER (shell_window->priv->switcher); ui_manager = e_shell_window_get_ui_manager (shell_window); merge_id = gtk_ui_manager_new_merge_id (ui_manager); + shell = e_shell_window_get_shell (shell_window); + list = e_shell_list_modules (shell); /* Construct a group of radio actions from the various EShellView * subclasses and register them with the EShellSwitcher. These @@ -1993,14 +1999,26 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) gtk_radio_action_set_group (action, group); group = gtk_radio_action_get_group (action); - for (ii = 0; ii < n_children; ii++) { + for (iter = list; iter != NULL; iter = iter->next) { + EShellModule *shell_module = iter->data; EShellViewClass *class; + GType type; const gchar *view_name; gchar *accelerator; gchar *action_name; gchar *tooltip; - class = g_type_class_ref (children[ii]); + type = e_shell_module_get_shell_view_type (shell_module); + + if (!g_type_is_a (type, E_TYPE_SHELL_VIEW)) { + g_critical ( + "%s is not a subclass of %s", + g_type_name (type), + g_type_name (E_TYPE_SHELL_VIEW)); + continue; + } + + class = g_type_class_ref (type); if (class->label == NULL) { g_critical ( @@ -2026,7 +2044,7 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) action = gtk_radio_action_new ( action_name, class->label, - tooltip, NULL, ii); + tooltip, NULL, ii++); g_object_set ( G_OBJECT (action), @@ -2040,8 +2058,8 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) group = gtk_radio_action_get_group (action); /* The first nine views have accelerators Ctrl+(1-9). */ - if (ii < 9) - accelerator = g_strdup_printf ("%d", ii + 1); + if (ii < 10) + accelerator = g_strdup_printf ("%d", ii); else accelerator = g_strdup (""); @@ -2062,8 +2080,6 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) g_type_class_unref (class); } - - g_free (children); } void -- cgit v1.2.3 From 54b80a7271e8ce1b2f3ccc68bb553940a24b80e2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 17 Oct 2008 03:48:03 +0000 Subject: Get the mail folder tree compiling, though I'm not yet sure why it's not showing anything. Probably something stupid. Also enabled the composer. svn path=/branches/kill-bonobo/; revision=36623 --- shell/e-shell-window-actions.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index a5ca5b310d..2dcdd4c4d4 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -2192,7 +2192,6 @@ e_shell_window_update_search_menu (EShellWindow *shell_window) FilterRule *rule; GtkUIManager *ui_manager; GtkActionGroup *action_group; - GList *list, *iter; const gchar *source; const gchar *view_name; gboolean sensitive; @@ -2223,13 +2222,7 @@ e_shell_window_update_search_menu (EShellWindow *shell_window) /* Unmerge the previous menu. */ gtk_ui_manager_remove_ui (ui_manager, merge_id); - - /* XXX Annoying that GTK+ doesn't provide a function for this. - * http://bugzilla.gnome.org/show_bug.cgi?id=550485 */ - list = gtk_action_group_list_actions (action_group); - for (iter = list; iter != NULL; iter = iter->next) - gtk_action_group_remove_action (action_group, iter->data); - g_list_free (list); + e_action_group_remove_all_actions (action_group); rule = rule_context_next_rule (context, NULL, source); while (rule != NULL) { -- cgit v1.2.3 From 17e030e2022b2343c795b7fd524ba9451ca71e9f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 27 Oct 2008 22:47:50 +0000 Subject: Fix a couple minor UI bugs. Populate the calendar's filter combo. svn path=/branches/kill-bonobo/; revision=36691 --- shell/e-shell-window-actions.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 2dcdd4c4d4..348daae89e 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1781,6 +1781,7 @@ shell_window_extract_actions (EShellWindow *shell_window, { const gchar *current_view; GList *match_list = NULL; + GList *primary = NULL; GList *iter; /* Pick out the actions from the source list that are tagged @@ -1809,7 +1810,10 @@ shell_window_extract_actions (EShellWindow *shell_window, if (strcmp (module_name, current_view) != 0) continue; - match_list = g_list_append (match_list, iter); + if (g_object_get_data (G_OBJECT (action), "primary")) + match_list = g_list_prepend (match_list, iter); + else + match_list = g_list_append (match_list, iter); } /* source_list = [B] match_list = [A] -> [C] */ -- cgit v1.2.3 From 8c0bd86d5fdd6d87c3170e2a01423e7c7018a981 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 14 Nov 2008 03:56:01 +0000 Subject: Rearranged some of the addressbook code to try and eliminate some circular dependencies in our libraries. The circular dependency between the composer and the mail module is still causing me headaches. And it doesn't help that the addressbook and calendar also want to link to the composer. svn path=/branches/kill-bonobo/; revision=36782 --- shell/e-shell-window-actions.c | 1 - 1 file changed, 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 348daae89e..38f33d99e9 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1781,7 +1781,6 @@ shell_window_extract_actions (EShellWindow *shell_window, { const gchar *current_view; GList *match_list = NULL; - GList *primary = NULL; GList *iter; /* Pick out the actions from the source list that are tagged -- cgit v1.2.3 From b7333387e8bd19299794e6485e3407d03c2eb73f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 14 Dec 2008 02:14:41 +0000 Subject: - Fix NetworkManager connection tracking. - Implement offline preparation as an EActivity that gets broadcast in a signal to shell modules. Offline preparations are complete when the last EActivity reference is dropped. - Bind some of the composer preferences to EShellSettings properties. svn path=/branches/kill-bonobo/; revision=36875 --- shell/e-shell-window-actions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 38f33d99e9..707edd8439 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1365,7 +1365,7 @@ action_work_offline_cb (GtkAction *action, EShell *shell; shell = e_shell_window_get_shell (shell_window); - e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_OFFLINE); + e_shell_set_online_mode (shell, FALSE); } /** @@ -1383,7 +1383,7 @@ action_work_online_cb (GtkAction *action, EShell *shell; shell = e_shell_window_get_shell (shell_window); - e_shell_set_line_status (shell, E_SHELL_LINE_STATUS_ONLINE); + e_shell_set_online_mode (shell, TRUE); } /** -- cgit v1.2.3 From 9d915124c28eb0772b4e1086d6988e7d56d9a04c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 31 Dec 2008 20:24:59 +0000 Subject: Get the Character Encoding menu working. Kill e_charset_picker_bonobo_ui_populate(). svn path=/branches/kill-bonobo/; revision=36950 --- shell/e-shell-window-actions.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 707edd8439..dc4307fe5c 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1753,27 +1753,6 @@ static GtkRadioActionEntry shell_gal_view_radio_entries[] = { -1 } }; -static gint -shell_window_compare_actions (GtkAction *action1, - GtkAction *action2) -{ - gchar *label1, *label2; - gint result; - - /* XXX This is really inefficient, but we're only sorting - * a small number of actions (repeatedly, though). */ - - g_object_get (action1, "label", &label1, NULL); - g_object_get (action2, "label", &label2, NULL); - - result = g_utf8_collate (label1, label2); - - g_free (label1); - g_free (label2); - - return result; -} - static void shell_window_extract_actions (EShellWindow *shell_window, GList **source_list, @@ -1914,13 +1893,13 @@ e_shell_window_create_new_menu (EShellWindow *shell_window) new_item_actions = g_list_sort ( gtk_action_group_list_actions (action_group), - (GCompareFunc) shell_window_compare_actions); + (GCompareFunc) e_action_compare_by_label); action_group = shell_window->priv->new_source_actions; new_source_actions = g_list_sort ( gtk_action_group_list_actions (action_group), - (GCompareFunc) shell_window_compare_actions); + (GCompareFunc) e_action_compare_by_label); /* Give priority to actions that belong to this shell view. */ -- cgit v1.2.3 From 8d8e4ac1c23905892a42b779188c852fdead7f5f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 7 Jan 2009 18:23:46 +0000 Subject: Tweak the EShell API. Disable File -> Close Window when there's only one window. Replace EMMessageBrowser with EMailBrowser. svn path=/branches/kill-bonobo/; revision=37009 --- shell/e-shell-window-actions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index dc4307fe5c..cf513669c8 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -863,7 +863,7 @@ action_new_window_cb (GtkAction *action, EShell *shell; shell = e_shell_window_get_shell (shell_window); - e_shell_create_window (shell); + e_shell_create_shell_window (shell); } /** @@ -1970,7 +1970,7 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) ui_manager = e_shell_window_get_ui_manager (shell_window); merge_id = gtk_ui_manager_new_merge_id (ui_manager); shell = e_shell_window_get_shell (shell_window); - list = e_shell_list_modules (shell); + list = e_shell_get_shell_modules (shell); /* Construct a group of radio actions from the various EShellView * subclasses and register them with the EShellSwitcher. These -- cgit v1.2.3 From e0610b2e0cea191f631dc825cdc8023cdcd9433d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 11 Jan 2009 14:20:50 +0000 Subject: Continue chipping away at EMFolderView and EMFolderBrowser. Migrate from gnome_url_show() to e_show_uri(). svn path=/branches/kill-bonobo/; revision=37038 --- shell/e-shell-window-actions.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index cf513669c8..3ab8b8e7dd 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -735,15 +735,7 @@ static void action_faq_cb (GtkAction *action, EShellWindow *shell_window) { - GError *error = NULL; - - gtk_show_uri (NULL, EVOLUTION_FAQ, GDK_CURRENT_TIME, &error); - - if (error != NULL) { - /* FIXME Show an error dialog. */ - g_warning ("%s", error->message); - g_error_free (error); - } + e_show_uri (GTK_WINDOW (shell_window), EVOLUTION_FAQ); } /** -- cgit v1.2.3 From 98d262b594caefd053a2d075e2d8482b2d8a12c8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 27 Jan 2009 03:50:19 +0000 Subject: Add action groups to support lockdown, starting with printing. Other categories to follow. Editors still need lockdown support. svn path=/branches/kill-bonobo/; revision=37136 --- shell/e-shell-window-actions.c | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 3ab8b8e7dd..f944d88eb6 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1459,13 +1459,6 @@ static GtkActionEntry shell_entries[] = { N_("Create a new window displaying this view"), G_CALLBACK (action_new_window_cb) }, - { "page-setup", - GTK_STOCK_PAGE_SETUP, - NULL, - NULL, - N_("Change the page settings for your current printer"), - G_CALLBACK (action_page_setup_cb) }, - { "preferences", GTK_STOCK_PREFERENCES, NULL, @@ -1745,6 +1738,16 @@ static GtkRadioActionEntry shell_gal_view_radio_entries[] = { -1 } }; +static GtkActionEntry shell_lockdown_print_setup_entries[] = { + + { "page-setup", + GTK_STOCK_PAGE_SETUP, + NULL, + NULL, + N_("Change the page settings for your current printer"), + G_CALLBACK (action_page_setup_cb) } +}; + static void shell_window_extract_actions (EShellWindow *shell_window, GList **source_list, @@ -1864,6 +1867,25 @@ e_shell_window_actions_init (EShellWindow *shell_window) -1, G_CALLBACK (action_switcher_cb), shell_window); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + /* Lockdown Printing Actions */ + action_group = shell_window->priv->lockdown_printing; + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + + /* Lockdown Print Setup Actions */ + action_group = shell_window->priv->lockdown_print_setup; + gtk_action_group_set_translation_domain (action_group, domain); + gtk_action_group_add_actions ( + action_group, shell_lockdown_print_setup_entries, + G_N_ELEMENTS (shell_lockdown_print_setup_entries), + shell_window); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + + /* Lockdown Save-to-Disk Actions */ + action_group = shell_window->priv->lockdown_save_to_disk; + gtk_action_group_set_translation_domain (action_group, domain); + gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); + /* Fine tuning. */ g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL); -- cgit v1.2.3 From 4b140a897f1b45515ac9987e0b2d343c12f02f1c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 27 Jan 2009 05:22:57 +0000 Subject: Make action group management in shell windows more elegant. svn path=/branches/kill-bonobo/; revision=37137 --- shell/e-shell-window-actions.c | 54 +++++++----------------------------------- 1 file changed, 8 insertions(+), 46 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index f944d88eb6..50749a7698 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1806,18 +1806,15 @@ e_shell_window_actions_init (EShellWindow *shell_window) { GtkActionGroup *action_group; GtkUIManager *ui_manager; - const gchar *domain; g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); ui_manager = e_shell_window_get_ui_manager (shell_window); - domain = GETTEXT_PACKAGE; e_load_ui_definition (ui_manager, "evolution-shell.ui"); /* Shell Actions */ - action_group = shell_window->priv->shell_actions; - gtk_action_group_set_translation_domain (action_group, domain); + action_group = ACTION_GROUP (SHELL); gtk_action_group_add_actions ( action_group, shell_entries, G_N_ELEMENTS (shell_entries), shell_window); @@ -1836,55 +1833,20 @@ e_shell_window_actions_init (EShellWindow *shell_window) action_group, shell_gal_view_radio_entries, G_N_ELEMENTS (shell_gal_view_radio_entries), 0, G_CALLBACK (action_gal_view_cb), shell_window); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - /* GAL View Actions (empty) */ - action_group = shell_window->priv->gal_view_actions; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - /* New Item Actions (empty) */ - action_group = shell_window->priv->new_item_actions; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - /* New Source Actions (empty) */ - action_group = shell_window->priv->new_source_actions; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - /* Custom Rule Actions (empty) */ - action_group = shell_window->priv->custom_rule_actions; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); /* Switcher Actions */ - action_group = shell_window->priv->switcher_actions; - gtk_action_group_set_translation_domain (action_group, domain); + action_group = ACTION_GROUP (SWITCHER); gtk_action_group_add_radio_actions ( action_group, shell_switcher_entries, G_N_ELEMENTS (shell_switcher_entries), -1, G_CALLBACK (action_switcher_cb), shell_window); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - /* Lockdown Printing Actions */ - action_group = shell_window->priv->lockdown_printing; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); /* Lockdown Print Setup Actions */ - action_group = shell_window->priv->lockdown_print_setup; - gtk_action_group_set_translation_domain (action_group, domain); + action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP); gtk_action_group_add_actions ( action_group, shell_lockdown_print_setup_entries, G_N_ELEMENTS (shell_lockdown_print_setup_entries), shell_window); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - /* Lockdown Save-to-Disk Actions */ - action_group = shell_window->priv->lockdown_save_to_disk; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); /* Fine tuning. */ @@ -1903,13 +1865,13 @@ e_shell_window_create_new_menu (EShellWindow *shell_window) /* Get sorted lists of "new item" and "new source" actions. */ - action_group = shell_window->priv->new_item_actions; + action_group = ACTION_GROUP (NEW_ITEM); new_item_actions = g_list_sort ( gtk_action_group_list_actions (action_group), (GCompareFunc) e_action_compare_by_label); - action_group = shell_window->priv->new_source_actions; + action_group = ACTION_GROUP (NEW_SOURCE); new_source_actions = g_list_sort ( gtk_action_group_list_actions (action_group), @@ -1979,7 +1941,7 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) g_return_if_fail (E_IS_SHELL_WINDOW (shell_window)); - action_group = shell_window->priv->switcher_actions; + action_group = ACTION_GROUP (SWITCHER); switcher = E_SHELL_SWITCHER (shell_window->priv->switcher); ui_manager = e_shell_window_get_ui_manager (shell_window); merge_id = gtk_ui_manager_new_merge_id (ui_manager); @@ -2106,7 +2068,7 @@ e_shell_window_update_view_menu (EShellWindow *shell_window) view_id = e_shell_view_get_view_id (shell_view); g_return_if_fail (view_collection != NULL); - action_group = shell_window->priv->gal_view_actions; + action_group = ACTION_GROUP (GAL_VIEW); merge_id = shell_window->priv->gal_view_merge_id; /* Unmerge the previous menu. */ @@ -2213,7 +2175,7 @@ e_shell_window_update_search_menu (EShellWindow *shell_window) /* Add custom rules to the Search menu. */ - action_group = shell_window->priv->custom_rule_actions; + action_group = ACTION_GROUP (CUSTOM_RULES); merge_id = shell_window->priv->custom_rule_merge_id; /* Unmerge the previous menu. */ -- cgit v1.2.3 From 533d59e2cd30ba79a99a71907ffdda65505e633a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 28 Jan 2009 17:19:34 +0000 Subject: Add unique-1.0 requirement (blessed external dependency). Make EShell a subclass of UniqueApp and handle single-instance negotiation. When another Evolution process is running: - Running "evolution" will simply present the existing windows. - Running "evolution -c " will open a shell window set to . - Running "evolution " will open an appropriate window for . The second process will then terminate immediately. svn path=/branches/kill-bonobo/; revision=37147 --- shell/e-shell-window-actions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 50749a7698..a9ed7efb09 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -853,9 +853,12 @@ action_new_window_cb (GtkAction *action, EShellWindow *shell_window) { EShell *shell; + const gchar *view_name; shell = e_shell_window_get_shell (shell_window); - e_shell_create_shell_window (shell); + view_name = e_shell_window_get_active_view (shell_window); + + e_shell_create_shell_window (shell, view_name); } /** -- cgit v1.2.3 From 0110c94c6abdbb25b4fea6a21f20f00b82a0fdd8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 19 Feb 2009 05:52:33 +0000 Subject: Rename EShell:online-mode to EShell:online and update docs. Use EBindings instead of a notify callback to keep other widgets and actions synchronized with EShell:online. Cleaner and less error prone. svn path=/branches/kill-bonobo/; revision=37293 --- shell/e-shell-window-actions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index a9ed7efb09..2364a69e4b 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1360,7 +1360,7 @@ action_work_offline_cb (GtkAction *action, EShell *shell; shell = e_shell_window_get_shell (shell_window); - e_shell_set_online_mode (shell, FALSE); + e_shell_set_online (shell, FALSE); } /** @@ -1378,7 +1378,7 @@ action_work_online_cb (GtkAction *action, EShell *shell; shell = e_shell_window_get_shell (shell_window); - e_shell_set_online_mode (shell, TRUE); + e_shell_set_online (shell, TRUE); } /** -- cgit v1.2.3 From 1a40acf554290883d6cf2a491dc36685842fd26b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 19 Feb 2009 06:22:32 +0000 Subject: Documentation tweaks. Have e_shell_get_preferences_window() take an EShell argument. svn path=/branches/kill-bonobo/; revision=37294 --- shell/e-shell-window-actions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 2364a69e4b..30d171e759 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -888,9 +888,12 @@ static void action_preferences_cb (GtkAction *action, EShellWindow *shell_window) { + EShell *shell; GtkWidget *preferences_window; - preferences_window = e_shell_get_preferences_window (); + shell = e_shell_window_get_shell (shell_window); + preferences_window = e_shell_get_preferences_window (shell); + gtk_window_set_transient_for ( GTK_WINDOW (preferences_window), GTK_WINDOW (shell_window)); -- cgit v1.2.3 From 0067abc21a679e78b05a138dd693b0400b7584a0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 29 Apr 2009 13:54:49 -0400 Subject: Make the message search bar more Firefoxy. Refine the EMailSearchBar to look more like Firefox's. Also, use GtkEntry's new icon capability (GTK+ 2.16 feature) in place of EIconEntry. And use a cute icon for Help -> Evolution FAQ. --- shell/e-shell-window-actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 30d171e759..3577e5b9bc 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1438,7 +1438,7 @@ static GtkActionEntry shell_entries[] = { G_CALLBACK (action_contents_cb) }, { "faq", - GTK_STOCK_DIALOG_INFO, + "help-faq", N_("Evolution _FAQ"), NULL, N_("Open the Frequently Asked Questions webpage"), -- cgit v1.2.3 From caa862135195b828d2e8355436fdd6eb0ec2443e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 7 May 2009 07:21:57 -0400 Subject: Convert EShellModule to EShellBackend Split the GTypeModule loader out of EShellModule as EModule, and rename EShellModule to EShellBackend. Backends (formerly modules) should now subclass EShellBackend. This commit converts EShell but breaks all the shell backends. --- shell/e-shell-window-actions.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 3577e5b9bc..9c8c8d46df 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1781,12 +1781,12 @@ shell_window_extract_actions (EShellWindow *shell_window, */ for (iter = *source_list; iter != NULL; iter = iter->next) { GtkAction *action = iter->data; - const gchar *module_name; + const gchar *backend_name; - module_name = g_object_get_data ( - G_OBJECT (action), "module-name"); + backend_name = g_object_get_data ( + G_OBJECT (action), "backend-name"); - if (strcmp (module_name, current_view) != 0) + if (strcmp (backend_name, current_view) != 0) continue; if (g_object_get_data (G_OBJECT (action), "primary")) @@ -1952,7 +1952,7 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) ui_manager = e_shell_window_get_ui_manager (shell_window); merge_id = gtk_ui_manager_new_merge_id (ui_manager); shell = e_shell_window_get_shell (shell_window); - list = e_shell_get_shell_modules (shell); + list = e_shell_get_shell_backends (shell); /* Construct a group of radio actions from the various EShellView * subclasses and register them with the EShellSwitcher. These @@ -1964,7 +1964,7 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) group = gtk_radio_action_get_group (action); for (iter = list; iter != NULL; iter = iter->next) { - EShellModule *shell_module = iter->data; + EShellBackend *shell_backend = iter->data; EShellViewClass *class; GType type; const gchar *view_name; @@ -1972,7 +1972,9 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) gchar *action_name; gchar *tooltip; - type = e_shell_module_get_shell_view_type (shell_module); + /* The backend name is also the view name. */ + view_name = E_SHELL_BACKEND_GET_CLASS (shell_backend)->name; + type = E_SHELL_BACKEND_GET_CLASS (shell_backend)->view_type; if (!g_type_is_a (type, E_TYPE_SHELL_VIEW)) { g_critical ( @@ -1991,14 +1993,6 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) continue; } - if (class->type_module == NULL) { - g_critical ( - "Module member not set on %s", - G_OBJECT_CLASS_NAME (class)); - continue; - } - - view_name = class->type_module->name; action_name = g_strdup_printf (SWITCHER_FORMAT, view_name); tooltip = g_strdup_printf (_("Switch to %s"), class->label); -- cgit v1.2.3 From 92e942499bffca812dcbc229f6c88ebb640e403a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 9 May 2009 23:50:43 -0400 Subject: Fix bugs caused by EShellBackend changes. --- shell/e-shell-window-actions.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 9c8c8d46df..846bb82d98 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1965,26 +1965,28 @@ e_shell_window_create_switcher_actions (EShellWindow *shell_window) for (iter = list; iter != NULL; iter = iter->next) { EShellBackend *shell_backend = iter->data; + EShellBackendClass *backend_class; EShellViewClass *class; - GType type; + GType view_type; const gchar *view_name; gchar *accelerator; gchar *action_name; gchar *tooltip; /* The backend name is also the view name. */ - view_name = E_SHELL_BACKEND_GET_CLASS (shell_backend)->name; - type = E_SHELL_BACKEND_GET_CLASS (shell_backend)->view_type; + backend_class = E_SHELL_BACKEND_GET_CLASS (shell_backend); + view_type = backend_class->shell_view_type; + view_name = backend_class->name; - if (!g_type_is_a (type, E_TYPE_SHELL_VIEW)) { + if (!g_type_is_a (view_type, E_TYPE_SHELL_VIEW)) { g_critical ( "%s is not a subclass of %s", - g_type_name (type), + g_type_name (view_type), g_type_name (E_TYPE_SHELL_VIEW)); continue; } - class = g_type_class_ref (type); + class = g_type_class_ref (view_type); if (class->label == NULL) { g_critical ( -- cgit v1.2.3 From 59c73e97a64345cb4e6dd9f9542bb94094fd1917 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 Aug 2009 13:24:44 -0400 Subject: Update GConf when the online/offline button is clicked. --- shell/e-shell-window-actions.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index a53412c00b..235456e954 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1361,9 +1361,17 @@ action_work_offline_cb (GtkAction *action, EShellWindow *shell_window) { EShell *shell; + EShellSettings *shell_settings; shell = e_shell_window_get_shell (shell_window); + shell_settings = e_shell_get_shell_settings (shell); + e_shell_set_online (shell, FALSE); + + /* XXX The sense of the setting is reversed. Would be more + * intuitive and less error-prone as "start-online". */ + e_shell_settings_set_boolean ( + shell_settings, "start-offline", TRUE); } /** @@ -1379,9 +1387,17 @@ action_work_online_cb (GtkAction *action, EShellWindow *shell_window) { EShell *shell; + EShellSettings *shell_settings; shell = e_shell_window_get_shell (shell_window); + shell_settings = e_shell_get_shell_settings (shell); + e_shell_set_online (shell, TRUE); + + /* XXX The sense of the setting is reversed. Would be more + * intuitive and less error-prone as "start-online". */ + e_shell_settings_set_boolean ( + shell_settings, "start-offline", FALSE); } /** -- cgit v1.2.3 From d8ddaf9a85dd4c5e484d8351a3dde0353f31f492 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 25 Aug 2009 00:24:30 -0400 Subject: Bug 592335 - Submit bug-report doesn't work --- shell/e-shell-window-actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 235456e954..a9323f3955 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1227,7 +1227,7 @@ action_submit_bug_cb (GtkAction *action, const gchar *command_line; GError *error = NULL; - command_line = "bug-buddy --sm-disable --package=Evolution"; + command_line = "bug-buddy --package=Evolution"; g_debug ("Spawning: %s", command_line); g_spawn_command_line_async (command_line, &error); -- cgit v1.2.3 From f6355e1fde1491c6e451975902906ea9921fee4a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 25 Aug 2009 11:40:56 -0400 Subject: Add menu item ellipsis according to bug #324492. --- shell/e-shell-window-actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell/e-shell-window-actions.c') diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index a9323f3955..77e50c50d4 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1553,7 +1553,7 @@ static GtkActionEntry shell_entries[] = { { "submit-bug", NULL, - N_("Submit _Bug Report"), + N_("Submit _Bug Report..."), NULL, N_("Submit a bug report using Bug Buddy"), G_CALLBACK (action_submit_bug_cb) }, -- cgit v1.2.3