diff --git a/src/client/GearyApplication.vala b/src/client/GearyApplication.vala
index f0aa516f..a10f68af 100644
--- a/src/client/GearyApplication.vala
+++ b/src/client/GearyApplication.vala
@@ -5,6 +5,34 @@
*/
public class GearyApplication : YorbaApplication {
+ // TODO: replace static strings with const strings when gettext is integrated properly
+ public const string PROGRAM_NAME = "Geary";
+ public static string PROGRAM_DESCRIPTION = _("Email Client");
+ public const string VERSION = "0.0.1";
+ public const string COPYRIGHT = "Copyright 2011 Yorba Foundation";
+ public const string WEBSITE = "http://www.yorba.org";
+ public static string WEBSITE_LABEL = _("Visit the Yorba web site");
+
+ public const string[] AUTHORS = {
+ "Jim Nelson"
+ };
+
+ public const string LICENSE = """
+Shotwell is free software; you can redistribute it and/or modify it under the
+terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2.1 of the License, or (at your option)
+any later version.
+
+Shotwell 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 Lesser General Public License for
+more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with Shotwell; if not, write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+""";
+
public static GearyApplication instance {
get {
if (_instance == null)
diff --git a/src/client/ui/MainWindow.vala b/src/client/ui/MainWindow.vala
index b248c909..bcc793ee 100644
--- a/src/client/ui/MainWindow.vala
+++ b/src/client/ui/MainWindow.vala
@@ -5,14 +5,41 @@
*/
public class MainWindow : Gtk.Window {
+ private const string MAIN_MENU_XML = """
+
+
+
+
+
+
+
+""";
+
private MessageListStore message_list_store = new MessageListStore();
private MessageListView message_list_view;
-
+ private Gtk.UIManager ui = new Gtk.UIManager();
private Geary.Engine? engine = null;
public MainWindow() {
+ title = GearyApplication.PROGRAM_NAME;
set_default_size(800, 600);
+ try {
+ ui.add_ui_from_string(MAIN_MENU_XML, -1);
+ } catch (Error err) {
+ error("Unable to load main menu UI: %s", err.message);
+ }
+
+ Gtk.ActionGroup action_group = new Gtk.ActionGroup("MainMenuActionGroup");
+ action_group.add_actions(create_actions(), this);
+
+ ui.insert_action_group(action_group, 0);
+ add_accel_group(ui.get_accel_group());
+
message_list_view = new MessageListView(message_list_store);
create_layout();
@@ -52,12 +79,65 @@ public class MainWindow : Gtk.Window {
base.destroy();
}
+ private Gtk.ActionEntry[] create_actions() {
+ Gtk.ActionEntry[] entries = new Gtk.ActionEntry[0];
+
+ //
+ // File
+ //
+
+ Gtk.ActionEntry file_menu = { "FileMenu", null, TRANSLATABLE, null, null, null };
+ file_menu.label = _("_File");
+ entries += file_menu;
+
+ Gtk.ActionEntry quit = { "FileQuit", Gtk.Stock.QUIT, TRANSLATABLE, "Q", null, on_quit };
+ quit.label = _("_Quit");
+ entries += quit;
+
+ //
+ // Help
+ //
+
+ Gtk.ActionEntry help_menu = { "HelpMenu", null, TRANSLATABLE, null, null, null };
+ help_menu.label = _("_Help");
+ entries += help_menu;
+
+ Gtk.ActionEntry about = { "HelpAbout", Gtk.Stock.ABOUT, TRANSLATABLE, null, null, on_about };
+ about.label = _("_About");
+ entries += about;
+
+ return entries;
+ }
+
private void create_layout() {
+ Gtk.VBox main_layout = new Gtk.VBox(false, 0);
+
+ // main menu
+ main_layout.pack_start(ui.get_widget("/MenuBar"), false, false, 0);
+
+ // message list
Gtk.ScrolledWindow message_list_scrolled = new Gtk.ScrolledWindow(null, null);
message_list_scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
message_list_scrolled.add_with_viewport(message_list_view);
+ main_layout.pack_end(message_list_scrolled, true, true, 0);
- add(message_list_scrolled);
+ add(main_layout);
+ }
+
+ private void on_quit() {
+ GearyApplication.instance.exit();
+ }
+
+ private void on_about() {
+ Gtk.show_about_dialog(this,
+ "program-name", GearyApplication.PROGRAM_NAME,
+ "authors", GearyApplication.AUTHORS,
+ "copyright", GearyApplication.COPYRIGHT,
+ "license", GearyApplication.LICENSE,
+ "version", GearyApplication.VERSION,
+ "website", GearyApplication.WEBSITE,
+ "website-label", GearyApplication.WEBSITE_LABEL
+ );
}
}
diff --git a/src/client/util/Intl.vala b/src/client/util/Intl.vala
index 809e7789..79aa7022 100644
--- a/src/client/util/Intl.vala
+++ b/src/client/util/Intl.vala
@@ -5,10 +5,12 @@
*/
// TODO: This fakes internationalization support until fully integrated.
-public string _(string text) {
+public unowned string _(string text) {
return text;
}
+public const string TRANSLATABLE = "TRANSLATABLE";
+
namespace Intl {
}
diff --git a/src/engine/rfc822/MessageData.vala b/src/engine/rfc822/MessageData.vala
index 689a3f22..ecbd4195 100644
--- a/src/engine/rfc822/MessageData.vala
+++ b/src/engine/rfc822/MessageData.vala
@@ -28,7 +28,7 @@ public class Geary.RFC822.Date : Geary.RFC822.MessageData, Geary.Common.MessageD
if (tm == 0)
throw new ImapError.PARSE_ERROR("Unable to parse \"%s\": not ISO-8601 date", iso8601);
- value = new DateTime.from_unix_utc(tm);
+ value = new DateTime.from_unix_local(tm);
original = iso8601;
}