diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-02-12 21:19:08 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-02-12 21:19:08 (GMT) |
commit | 18b4066acc0d3072895bb61c8f2bbb378d1dd361 (patch) | |
tree | 441444a5d8b2148e0d8ea092be078698e24d757a | |
parent | 4bee5bec8d4764ed0c5625c26ee239cbe2100f25 (diff) |
Fixes in new file alert
-rw-r--r-- | develop-activity/develop_app.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/develop-activity/develop_app.py b/develop-activity/develop_app.py index d2ac596..ef7f8b5 100644 --- a/develop-activity/develop_app.py +++ b/develop-activity/develop_app.py @@ -639,26 +639,27 @@ class DevelopActivity(activity.Activity): alert.connect('response', self.__create_file_alert_cb) def __create_file_alert_cb(self, alert, response_id): - file_name = alert.entry.get_text() - try: - path = os.path.dirname(self.editor.get_file_path()) - except: - path = self.activity_dir + if response_id is Gtk.ResponseType.OK: + file_name = alert.entry.get_text() + try: + path = os.path.dirname(self.editor.get_file_path()) + except: + path = self.activity_dir - file_path = os.path.join(path, file_name) - with open(file_path, 'w') as new_file: - new_file.write('') + file_path = os.path.join(path, file_name) + with open(file_path, 'w') as new_file: + new_file.write('') - self.refresh_files() - self.editor.load_object(file_path, file_name) + self.refresh_files() + self.editor.load_object(file_path, file_name) self.remove_alert(alert) def __remove_file_cb(self, button): file_path = self.editor.get_file_path() - msg = _('The action you will do can not be revereted.\n' - 'Do you want remove the file %s?') % file_path - alert = self.create_confirmation_alert(msg, _('WARNING')) + title = _('WARNING: The action you will do can not be reverted.') + msg = _('Do you want remove the file %s?') % file_path + alert = self.create_confirmation_alert(msg, title) alert.show() alert.connect('response', self.__remove_file_alert_cb, file_path) |