set home folder as default folder for fchooser and set nice title on fchooser
This commit is contained in:
parent
04c5d6bfae
commit
3d21947e2a
|
@ -65,6 +65,7 @@ else: # Unices
|
||||||
VCARDPATH = os.path.expanduser('~/.gajim/vcards')
|
VCARDPATH = os.path.expanduser('~/.gajim/vcards')
|
||||||
AVATAR_PATH = os.path.expanduser('~/.gajim/avatars')
|
AVATAR_PATH = os.path.expanduser('~/.gajim/avatars')
|
||||||
|
|
||||||
|
HOME_DIR = os.path.expanduser('~')
|
||||||
TMP = tempfile.gettempdir()
|
TMP = tempfile.gettempdir()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -914,8 +914,7 @@ class PreferencesWindow:
|
||||||
if last_sounds_dir and os.path.isdir('last_sounds_dir'):
|
if last_sounds_dir and os.path.isdir('last_sounds_dir'):
|
||||||
dialog.set_current_folder(last_sounds_dir)
|
dialog.set_current_folder(last_sounds_dir)
|
||||||
else:
|
else:
|
||||||
home_dir = os.path.expanduser('~')
|
dialog.set_current_folder(gajim.HOME_DIR)
|
||||||
dialog.set_current_folder(home_dir)
|
|
||||||
|
|
||||||
filter = gtk.FileFilter()
|
filter = gtk.FileFilter()
|
||||||
filter.set_name(_('All files'))
|
filter.set_name(_('All files'))
|
||||||
|
@ -2176,8 +2175,7 @@ class ManageEmoticonsWindow:
|
||||||
if last_emoticons_dir and os.path.isdir('last_emoticons_dir'):
|
if last_emoticons_dir and os.path.isdir('last_emoticons_dir'):
|
||||||
dialog.set_current_folder(last_emoticons_dir)
|
dialog.set_current_folder(last_emoticons_dir)
|
||||||
else:
|
else:
|
||||||
home_dir = os.path.expanduser('~')
|
dialog.set_current_folder(gajim.HOME_DIR)
|
||||||
dialog.set_current_folder(home_dir)
|
|
||||||
filter = gtk.FileFilter()
|
filter = gtk.FileFilter()
|
||||||
filter.set_name(_('All files'))
|
filter.set_name(_('All files'))
|
||||||
filter.add_pattern('*')
|
filter.add_pattern('*')
|
||||||
|
|
|
@ -257,8 +257,7 @@ _('Connection with peer cannot be established.'))
|
||||||
if last_send_dir and os.path.isdir(last_send_dir):
|
if last_send_dir and os.path.isdir(last_send_dir):
|
||||||
dialog.set_current_folder(last_send_dir)
|
dialog.set_current_folder(last_send_dir)
|
||||||
else:
|
else:
|
||||||
home_dir = os.path.expanduser('~')
|
dialog.set_current_folder(gajim.HOME_DIR)
|
||||||
dialog.set_current_folder(home_dir)
|
|
||||||
file_props = {}
|
file_props = {}
|
||||||
while True:
|
while True:
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
|
@ -351,8 +350,7 @@ _('Connection with peer cannot be established.'))
|
||||||
if last_save_dir and os.path.isdir(last_save_dir):
|
if last_save_dir and os.path.isdir(last_save_dir):
|
||||||
dialog.set_current_folder(last_save_dir)
|
dialog.set_current_folder(last_save_dir)
|
||||||
else:
|
else:
|
||||||
home_dir = os.path.expanduser('~')
|
dialog.set_current_folder(gajim.HOME_DIR)
|
||||||
dialog.set_current_folder(home_dir)
|
|
||||||
while True:
|
while True:
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
if response == gtk.RESPONSE_OK:
|
if response == gtk.RESPONSE_OK:
|
||||||
|
|
|
@ -28,6 +28,7 @@ import exceptions
|
||||||
import dialogs
|
import dialogs
|
||||||
from common.logger import LOG_DB_PATH, constants
|
from common.logger import LOG_DB_PATH, constants
|
||||||
|
|
||||||
|
from common import gajim
|
||||||
from common import i18n
|
from common import i18n
|
||||||
_ = i18n._
|
_ = i18n._
|
||||||
gtk.glade.bindtextdomain(i18n.APP, i18n.DIR)
|
gtk.glade.bindtextdomain(i18n.APP, i18n.DIR)
|
||||||
|
@ -350,7 +351,12 @@ class HistoryManager:
|
||||||
def on_export_menuitem_activate(self, widget):
|
def on_export_menuitem_activate(self, widget):
|
||||||
xml = gtk.glade.XML('history_manager.glade', 'filechooserdialog', i18n.APP)
|
xml = gtk.glade.XML('history_manager.glade', 'filechooserdialog', i18n.APP)
|
||||||
xml.signal_autoconnect(self)
|
xml.signal_autoconnect(self)
|
||||||
|
|
||||||
dlg = xml.get_widget('filechooserdialog')
|
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()
|
response = dlg.run()
|
||||||
|
|
||||||
if response == gtk.RESPONSE_OK: # user want us to export ;)
|
if response == gtk.RESPONSE_OK: # user want us to export ;)
|
||||||
|
|
Loading…
Reference in New Issue