Index: src/mlx/config.py
===================================================================
--- src/mlx/config.py	(revision 113)
+++ src/mlx/config.py	(revision 123)
@@ -29,7 +29,7 @@
         self._updateURL = Config.DEFAULT_UPDATE_URL
 
+        self._language = ""
+
         self._modified = False
-
-        self._language = ""
 
     @property
@@ -67,4 +67,16 @@
         if rememberPassword!=self._rememberPassword:
             self._rememberPassword = rememberPassword
+            self._modified = True
+
+    @property
+    def language(self):
+        """Get the language to use."""
+        return self._language
+
+    @language.setter
+    def language(self, language):
+        """Set the language to use."""
+        if language!=self._language:
+            self._language = language
             self._modified = True
 
@@ -160,4 +172,10 @@
         import locale
         if self._language:
+            os.environ["LANGUAGE"] = self._language
+            os.environ["LANG"] = self._language + ".UTF-8"
+            os.environ["LC_MESSAGES"] = self._language + ".UTF-8"
+            os.environ["LC_COLLATE"] = self._language + ".UTF-8"
+            os.environ["LC_CTYPE"] = self._language + ".UTF-8"
+
             locale.setlocale(locale.LC_ALL, (self._language,
                                              locale.getpreferredencoding()))
Index: src/mlx/const.py
===================================================================
--- src/mlx/const.py	(revision 103)
+++ src/mlx/const.py	(revision 123)
@@ -219,3 +219,5 @@
     return _stageStrings[stage] if stage in _stageStrings else None
         
-    
+#-------------------------------------------------------------------------------
+
+languages = ["$system", "en_GB", "hu_HU"]
Index: src/mlx/gui/common.py
===================================================================
--- src/mlx/gui/common.py	(revision 105)
+++ src/mlx/gui/common.py	(revision 123)
@@ -27,6 +27,9 @@
     BUTTONSTYPE_YES_NO = gtk.BUTTONS_YES_NO
     RESPONSETYPE_YES = gtk.RESPONSE_YES
+    RESPONSETYPE_ACCEPT = gtk.RESPONSE_ACCEPT
+    RESPONSETYPE_REJECT = gtk.RESPONSE_REJECT
     ACCEL_VISIBLE = gtk.ACCEL_VISIBLE
     CONTROL_MASK = gdk.CONTROL_MASK
+    DIALOG_MODAL = gtk.DIALOG_MODAL
 
     def text2unicode(text):
@@ -49,6 +52,9 @@
     BUTTONSTYPE_YES_NO = gtk.ButtonsType.YES_NO
     RESPONSETYPE_YES = gtk.ResponseType.YES
+    RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT
+    RESPONSETYPE_REJECT = gtk.ResponseType.REJECT
     ACCEL_VISIBLE = gtk.AccelFlags.VISIBLE
     CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
+    DIALOG_MODAL = gtk.DialogFlags.MODAL
 
     import codecs
Index: src/mlx/gui/gui.py
===================================================================
--- src/mlx/gui/gui.py	(revision 120)
+++ src/mlx/gui/gui.py	(revision 123)
@@ -10,4 +10,5 @@
 from mlx.gui.weighthelp import WeightHelp
 from mlx.gui.gates import FleetGateStatus
+from mlx.gui.prefs import Preferences
 
 import mlx.const as const
@@ -61,5 +62,5 @@
         """Build the GUI."""
         
-        window = gtk.Window()
+        self._mainWindow = window = gtk.Window()
         window.set_title(WINDOW_TITLE_BASE)
         window.set_icon_from_file(os.path.join(iconDirectory, "logo.ico"))
@@ -73,4 +74,6 @@
         window.add(mainVBox)
 
+        self._preferences = Preferences(self)
+
         menuBar = self._buildMenuBar(accelGroup)
         mainVBox.pack_start(menuBar, False, False, 0)
@@ -130,6 +133,4 @@
         self._weightHelp.reset()
         self._weightHelp.disable()
-
-        self._mainWindow = window
 
         self._statusIcon = StatusIcon(iconDirectory, self)
@@ -663,4 +664,17 @@
         fileMenu.append(quitMenuItem)
 
+        toolsMenuItem = gtk.MenuItem(xstr("menu_tools"))
+        toolsMenu = gtk.Menu()
+        toolsMenuItem.set_submenu(toolsMenu)
+        menuBar.append(toolsMenuItem)
+
+        prefsMenuItem = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES)
+        prefsMenuItem.set_use_stock(True)
+        prefsMenuItem.set_label(xstr("menu_tools_prefs"))
+        prefsMenuItem.add_accelerator("activate", accelGroup,
+                                      ord(xstr("menu_tools_prefs_key")),
+                                      CONTROL_MASK, ACCEL_VISIBLE)
+        prefsMenuItem.connect("activate", self._editPreferences)
+        toolsMenu.append(prefsMenuItem)
 
         viewMenuItem = gtk.MenuItem(xstr("menu_view"))
@@ -759,2 +773,6 @@
         else:
             self._mainWindow.set_default(None)
+
+    def _editPreferences(self, menuItem):
+        """Callback for editing the preferences."""
+        self._preferences.run(self.config)
Index: src/mlx/gui/info.py
===================================================================
--- src/mlx/gui/info.py	(revision 122)
+++ src/mlx/gui/info.py	(revision 123)
@@ -5,4 +5,6 @@
 from mlx.i18n import xstr
 import mlx.const as const
+
+#------------------------------------------------------------------------------
 
 class FlightInfo(gtk.VBox):
Index: src/mlx/gui/prefs.py
===================================================================
--- src/mlx/gui/prefs.py	(revision 123)
+++ src/mlx/gui/prefs.py	(revision 123)
@@ -0,0 +1,212 @@
+# Module for the preferences dialog
+
+#------------------------------------------------------------------------------
+
+from common import *
+
+from mlx.i18n import xstr
+import mlx.const as const
+
+import urlparse
+
+#------------------------------------------------------------------------------
+
+class Preferences(gtk.Dialog):
+    """The preferences dialog."""
+    def __init__(self, gui):
+        """Construct the dialog."""
+        super(Preferences, self).__init__(WINDOW_TITLE_BASE + " " +
+                                          xstr("prefs_title"),
+                                          gui.mainWindow,
+                                          DIALOG_MODAL,
+                                          (gtk.STOCK_CANCEL,
+                                           RESPONSETYPE_REJECT,
+                                           gtk.STOCK_OK,
+                                           RESPONSETYPE_ACCEPT))
+        self._gui = gui
+
+        contentArea = self.get_content_area()
+
+        notebook = gtk.Notebook()
+        contentArea.pack_start(notebook, True, True, 4)
+
+        general = self._buildGeneral()
+        label = gtk.Label(xstr("prefs_tab_general"))
+        label.set_use_underline(True)
+        label.set_tooltip_text(xstr("prefs_tab_general_tooltip"))
+        notebook.append_page(general, label)
+
+        advanced = self._buildAdvanced()
+        label = gtk.Label(xstr("prefs_tab_advanced"))
+        label.set_use_underline(True)
+        label.set_tooltip_text(xstr("prefs_tab_advanced_tooltip"))
+        notebook.append_page(advanced, label)
+
+    def run(self, config):
+        """Run the preferences dialog.
+
+        The dialog will be set up from data in the given configuration. If the
+        changes are accepted by the user, the configuration is updated and saved."""
+        self._fromConfig(config)
+
+        self.show_all()
+        response = super(Preferences, self).run()
+        self.hide()
+
+        if response==RESPONSETYPE_ACCEPT:
+            self._toConfig(config)
+            config.save()
+
+    def _fromConfig(self, config):
+        """Setup the dialog from the given configuration."""
+        self._setLanguage(config.language)
+
+        self._togglingAutoUpdate = True
+        self._autoUpdate.set_active(config.autoUpdate)
+        self._togglingAutoUpdate = False
+        if not config.autoUpdate:
+            self._warnedAutoUpdate = True
+
+        self._updateURL.set_text(config.updateURL)
+
+    def _toConfig(self, config):
+        """Setup the given config from the settings in the dialog."""
+        config.language = self._getLanguage()
+        config.autoUpdate = self._autoUpdate.get_active()
+        config.updateURL = self._updateURL.get_text()
+
+    def _buildGeneral(self):
+        """Build the page for the general settings."""
+        mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
+                                      xscale = 0.0, yscale = 0.0)
+        mainAlignment.set_padding(padding_top = 16, padding_bottom = 32,
+                                  padding_left = 4, padding_right = 48)
+        mainBox = gtk.VBox()
+        mainAlignment.add(mainBox)
+
+        languageBox = gtk.HBox()
+        mainBox.pack_start(languageBox, False, False, 4)
+
+        label = gtk.Label(xstr("prefs_language"))
+        label.set_use_underline(True)
+
+        languageBox.pack_start(label, False, False, 4)
+
+        self._languageList = gtk.ListStore(str, str)
+        for language in const.languages:
+            self._languageList.append([xstr("prefs_lang_" + language),
+                                       language])
+
+        self._languageComboBox = languageComboBox = \
+            gtk.ComboBox(model = self._languageList)                   
+        cell = gtk.CellRendererText()
+        languageComboBox.pack_start(cell, True)
+        languageComboBox.add_attribute(cell, 'text', 0)
+        languageComboBox.set_tooltip_text(xstr("prefs_language_tooltip"))
+        languageComboBox.connect("changed", self._languageChanged)
+        languageBox.pack_start(languageComboBox, False, False, 4)
+
+        self._changingLanguage = False
+        self._warnedRestartNeeded = False
+
+        label.set_mnemonic_widget(languageComboBox)
+                                       
+        return mainAlignment
+
+    def _setLanguage(self, language):
+        """Set the language to the given one."""
+        iter = self._languageList.get_iter_first()
+        while iter is not None:
+            (lang,) = self._languageList.get(iter, 1)
+            if (not language and lang=="$system") or \
+               lang==language:
+                self._changingLanguage = True
+                self._languageComboBox.set_active_iter(iter)
+                self._changingLanguage = False
+                break
+            else:
+                iter = self._languageList.iter_next(iter)
+
+    def _getLanguage(self):
+        """Get the language selected by the user."""        
+        iter = self._languageComboBox.get_active_iter()
+        (lang,) = self._languageList.get(iter, 1)
+        return "" if lang=="$system" else lang
+
+    def _languageChanged(self, comboBox):
+        """Called when the language has changed."""
+        if not self._changingLanguage and not self._warnedRestartNeeded:
+            dialog = gtk.MessageDialog(parent = self,
+                                       type = MESSAGETYPE_INFO,
+                                       buttons = BUTTONSTYPE_OK,
+                                       message_format = xstr("prefs_restart"))
+            dialog.set_title(self.get_title())
+            dialog.format_secondary_markup(xstr("prefs_language_restart_sec"))
+            dialog.run()
+            dialog.hide()
+            self._warnedRestartNeeded = True
+
+    def _buildAdvanced(self):
+        """Build the page for the advanced settings."""
+
+        mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
+                                      xscale = 0.0, yscale = 0.0)
+        mainAlignment.set_padding(padding_top = 16, padding_bottom = 32,
+                                  padding_left = 4, padding_right = 48)
+        mainBox = gtk.VBox()
+        mainAlignment.add(mainBox)
+
+        self._autoUpdate = gtk.CheckButton(xstr("prefs_update_auto"))
+        mainBox.pack_start(self._autoUpdate, False, False, 4)
+
+        self._autoUpdate.set_use_underline(True)
+        self._autoUpdate.connect("toggled", self._autoUpdateToggled)
+        self._autoUpdate.set_tooltip_text(xstr("prefs_update_auto_tooltip"))
+        self._warnedAutoUpdate = False
+        self._togglingAutoUpdate = False
+        
+        updateURLBox = gtk.HBox()
+        mainBox.pack_start(updateURLBox, False, False, 4)
+        label = gtk.Label(xstr("prefs_update_url"))
+        label.set_use_underline(True)
+        updateURLBox.pack_start(label, False, False, 4)
+
+        self._updateURL = gtk.Entry()
+        label.set_mnemonic_widget(self._updateURL)
+        self._updateURL.set_width_chars(40)
+        self._updateURL.set_tooltip_text(xstr("prefs_update_url_tooltip"))
+        self._updateURL.connect("changed", self._updateURLChanged)
+        updateURLBox.pack_start(self._updateURL, False, False, 4)
+
+        return mainAlignment
+
+    def _setOKButtonSensitivity(self):
+        """Set the sensitive state of the OK button."""
+        sensitive = False
+        try:
+            result = urlparse.urlparse(self._updateURL.get_text())
+            sensitive = result.scheme!="" and (result.netloc + result.path)!=""
+        except:
+            pass
+
+        okButton = self.get_widget_for_response(RESPONSETYPE_ACCEPT)
+        okButton.set_sensitive(sensitive)
+
+    def _autoUpdateToggled(self, button):
+        """Called when the auto update check button is toggled."""
+        if not self._togglingAutoUpdate and not self._warnedAutoUpdate and \
+           not self._autoUpdate.get_active():
+            dialog = gtk.MessageDialog(parent = self,
+                                       type = MESSAGETYPE_INFO,
+                                       buttons = BUTTONSTYPE_OK,
+                                       message_format = xstr("prefs_update_auto_warning"))
+            dialog.set_title(self.get_title())
+            dialog.run()
+            dialog.hide()
+            self._warnedAutoUpdate = True
+            
+    def _updateURLChanged(self, entry):
+        """Called when the update URL is changed."""
+        self._setOKButtonSensitivity()
+        
+            
Index: src/mlx/i18n.py
===================================================================
--- src/mlx/i18n.py	(revision 118)
+++ src/mlx/i18n.py	(revision 123)
@@ -128,4 +128,8 @@
         self.add("menu_file_quit_key", "q")
         self.add("quit_question", "Are you sure to quit the logger?")
+
+        self.add("menu_tools", "Tools")
+        self.add("menu_tools_prefs", "_Preferences")
+        self.add("menu_tools_prefs_key", "p")
 
         self.add("menu_view", "View")
@@ -528,5 +532,38 @@
         self.add("gates_plane_parking", "PARKING")
         self.add("gates_plane_unknown", "UNKNOWN")
-                 
+
+        self.add("prefs_title", "Preferences")
+        self.add("prefs_tab_general", "_General")
+        self.add("prefs_tab_general_tooltip", "General preferences")
+        self.add("prefs_tab_advanced", "_Advanced")
+        self.add("prefs_tab_advanced_tooltip",
+                 "Advanced preferences, edit with care!")
+        self.add("prefs_language", "_Language:")
+        self.add("prefs_language_tooltip",
+                 "The language of the program")
+        self.add("prefs_restart",
+                 "Restart needed")
+        self.add("prefs_language_restart_sec",
+                 "If you change the language, the program should be restarted "
+                 "so that the change has an effect.")
+        self.add("prefs_lang_$system", "system default")
+        self.add("prefs_lang_en_GB", "English")
+        self.add("prefs_lang_hu_HU", "Hungarian")
+        self.add("prefs_update_auto", "Update the program auto_matically")
+        self.add("prefs_update_auto_tooltip",
+                 "If checked the program will look for updates when "
+                 "it is starting, and if new updates are found, they "
+                 "will be downloaded and installed. This ensures that "
+                 "the PIREP you send will always conform to the latest "
+                 "expectations of the airline.")
+        self.add("prefs_update_auto_warning",
+                 "Disabling automatic updates may result in "
+                 "your version of the program becoming out of date "
+                 "and your PIREPs not being accepted.")
+        self.add("prefs_update_url", "Update _URL:")
+        self.add("prefs_update_url_tooltip",
+                 "The URL from which to download the updates. Change this "
+                 "only if you know what you are doing!")
+
 #------------------------------------------------------------------------------
 
@@ -543,4 +580,8 @@
         self.add("menu_file_quit_key", "k")
         self.add("quit_question", "Biztosan ki akarsz lépni?")
+
+        self.add("menu_tools", "Eszközök")
+        self.add("menu_tools_prefs", "_Beállítások")
+        self.add("menu_tools_prefs_key", "b")
 
         self.add("menu_view", "Nézet")
@@ -951,4 +992,37 @@
         self.add("gates_plane_unknown", "ISMERETLEN")
                  
+        self.add("prefs_title", "Beállítások")
+        self.add("prefs_tab_general", "_Általános")
+        self.add("prefs_tab_general_tooltip", "Általános beállítások")
+        self.add("prefs_tab_advanced", "_Haladó")
+        self.add("prefs_tab_advanced_tooltip",
+                 "Haladó beállítások: óvatosan módosítsd őket!")
+        self.add("prefs_language", "_Nyelv:")
+        self.add("prefs_language_tooltip",
+                 "A program által használt nyelv")
+        self.add("prefs_restart",
+                 "Újraindítás szükséges")
+        self.add("prefs_language_restart_sec",
+                 "A program nyelvének megváltoztatása csak egy újraindítást "
+                 "követően jut érvényre.")
+        self.add("prefs_lang_$system", "alapértelmezett")
+        self.add("prefs_lang_en_GB", "angol")
+        self.add("prefs_lang_hu_HU", "magyar")
+        self.add("prefs_update_auto",
+                 "Frissítsd a programot _automatikusan")
+        self.add("prefs_update_auto_tooltip",
+                 "Ha ez be van jelölve, a program induláskor frissítést "
+                 "keres, és ha talál, azokat letölti és telepíti. Ez "
+                 "biztosítja, hogy az elküldött PIREP minden megfelel "
+                 "a legújabb elvárásoknak.")
+        self.add("prefs_update_auto_warning",
+                 "Az automatikus frissítés kikapcsolása azt okozhatja, "
+                 "hogy a program Nálad lévő verziója elavulttá válik, "
+                 "és a PIREP-jeidet így nem fogadják el.")
+        self.add("prefs_update_url", "Frissítés _URL-je:")
+        self.add("prefs_update_url_tooltip",
+                 "Az URL, ahol a frissítéseket keresi a program. Csak akkor "
+                 "változtasd meg, ha biztos vagy a dolgodban!")
+
 #------------------------------------------------------------------------------
 
Index: src/mlx/mlx.py
===================================================================
--- src/mlx/mlx.py	(revision 107)
+++ src/mlx/mlx.py	(revision 123)
@@ -1,5 +1,3 @@
 # The main program
-
-from .gui.gui import GUI
 
 from config import Config
@@ -35,4 +33,5 @@
     setLanguage(config.getLanguage())
     
+    from .gui.gui import GUI
     gui = GUI(programDirectory, config)
     
