diff --git a/src/common/gajim.py b/src/common/gajim.py index d6419931d..aa4eae3b7 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -65,6 +65,7 @@ else: # Unices VCARDPATH = os.path.expanduser('~/.gajim/vcards') AVATAR_PATH = os.path.expanduser('~/.gajim/avatars') +HOME_DIR = os.path.expanduser('~') TMP = tempfile.gettempdir() try: diff --git a/src/config.py b/src/config.py index 1b5d83e09..04feea167 100644 --- a/src/config.py +++ b/src/config.py @@ -914,8 +914,7 @@ class PreferencesWindow: if last_sounds_dir and os.path.isdir('last_sounds_dir'): dialog.set_current_folder(last_sounds_dir) else: - home_dir = os.path.expanduser('~') - dialog.set_current_folder(home_dir) + dialog.set_current_folder(gajim.HOME_DIR) filter = gtk.FileFilter() filter.set_name(_('All files')) @@ -2176,8 +2175,7 @@ class ManageEmoticonsWindow: if last_emoticons_dir and os.path.isdir('last_emoticons_dir'): dialog.set_current_folder(last_emoticons_dir) else: - home_dir = os.path.expanduser('~') - dialog.set_current_folder(home_dir) + dialog.set_current_folder(gajim.HOME_DIR) filter = gtk.FileFilter() filter.set_name(_('All files')) filter.add_pattern('*') diff --git a/src/filetransfers_window.py b/src/filetransfers_window.py index 8b2d7d638..b15667f14 100644 --- a/src/filetransfers_window.py +++ b/src/filetransfers_window.py @@ -257,8 +257,7 @@ _('Connection with peer cannot be established.')) if last_send_dir and os.path.isdir(last_send_dir): dialog.set_current_folder(last_send_dir) else: - home_dir = os.path.expanduser('~') - dialog.set_current_folder(home_dir) + dialog.set_current_folder(gajim.HOME_DIR) file_props = {} while True: response = dialog.run() @@ -351,8 +350,7 @@ _('Connection with peer cannot be established.')) if last_save_dir and os.path.isdir(last_save_dir): dialog.set_current_folder(last_save_dir) else: - home_dir = os.path.expanduser('~') - dialog.set_current_folder(home_dir) + dialog.set_current_folder(gajim.HOME_DIR) while True: response = dialog.run() if response == gtk.RESPONSE_OK: diff --git a/src/history_manager.py b/src/history_manager.py index 4dd84596d..70075a4d4 100755 --- a/src/history_manager.py +++ b/src/history_manager.py @@ -28,6 +28,7 @@ import exceptions import dialogs from common.logger import LOG_DB_PATH, constants +from common import gajim from common import i18n _ = i18n._ gtk.glade.bindtextdomain(i18n.APP, i18n.DIR) @@ -350,7 +351,12 @@ class HistoryManager: def on_export_menuitem_activate(self, widget): xml = gtk.glade.XML('history_manager.glade', 'filechooserdialog', i18n.APP) xml.signal_autoconnect(self) + dlg = xml.get_widget('filechooserdialog') + dlg.set_title(_('Exporting History Logs...')) + dlg.set_current_folder(gajim.HOME_DIR) + if gtk.pygtk_version > (2, 8, 0): + dlg.props.do_overwrite_confirmation = True response = dlg.run() if response == gtk.RESPONSE_OK: # user want us to export ;)