Commit d47bee03 authored by Daniel Brötzmann's avatar Daniel Brötzmann

Use Accept default button, adapt some text strings

parent a27a4003
...@@ -1152,7 +1152,7 @@ class ChatControl(ChatControlBase): ...@@ -1152,7 +1152,7 @@ class ChatControl(ChatControlBase):
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
callback=lambda: on_no(self)), callback=lambda: on_no(self)),
DialogButton.make('Remove', DialogButton.make('Remove',
text=_('Close'), text=_('_Close'),
callback=lambda: on_yes(self))], callback=lambda: on_yes(self))],
transient_for=self.parent_win.window).show() transient_for=self.parent_win.window).show()
return return
......
...@@ -1168,12 +1168,12 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): ...@@ -1168,12 +1168,12 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
NewConfirmationDialog( NewConfirmationDialog(
_('Privacy'), _('Privacy'),
_('Warning'), _('Warning'),
_('If you send a file to <b>%s</b>, ' _('If you send a file to <b>%s</b>, your real XMPP '
'your real JID will be revealed.' % gc_contact.name), 'address will be revealed.' % gc_contact.name),
[DialogButton.make('Cancel'), [DialogButton.make('Cancel'),
DialogButton.make( DialogButton.make(
'OK', 'OK',
text=_('Continue'), text=_('_Continue'),
callback=lambda: _on_ok(gc_contact))]).show() callback=lambda: _on_ok(gc_contact))]).show()
return return
_on_ok(gc_contact) _on_ok(gc_contact)
......
...@@ -667,11 +667,12 @@ class ChangeStatusMessageDialog(TimeoutDialog): ...@@ -667,11 +667,12 @@ class ChangeStatusMessageDialog(TimeoutDialog):
self.countdown_enabled = False self.countdown_enabled = False
start_iter, finish_iter = self.message_buffer.get_bounds() start_iter, finish_iter = self.message_buffer.get_bounds()
status_message_to_save_as_preset = self.message_buffer.get_text( status_message_to_save_as_preset = self.message_buffer.get_text(
start_iter, finish_iter, True) start_iter, finish_iter, True)
def on_ok(msg_name): def on_ok(msg_name):
msg_text = status_message_to_save_as_preset msg_text = status_message_to_save_as_preset
msg_text_1l = helpers.to_one_line(msg_text) msg_text_1l = helpers.to_one_line(msg_text)
if not msg_name: # msg_name was '' if not msg_name: # msg_name was ''
msg_name = msg_text_1l msg_name = msg_text_1l
def _on_ok2(): def _on_ok2():
...@@ -681,23 +682,23 @@ class ChangeStatusMessageDialog(TimeoutDialog): ...@@ -681,23 +682,23 @@ class ChangeStatusMessageDialog(TimeoutDialog):
self.pep_dict.get('activity_text'), self.pep_dict.get('activity_text'),
self.pep_dict.get('mood'), self.pep_dict.get('mood_text')] self.pep_dict.get('mood'), self.pep_dict.get('mood_text')]
app.config.set_per('statusmsg', msg_name, 'message', app.config.set_per('statusmsg', msg_name, 'message',
msg_text_1l) msg_text_1l)
app.config.set_per('statusmsg', msg_name, 'activity', app.config.set_per('statusmsg', msg_name, 'activity',
self.pep_dict.get('activity')) self.pep_dict.get('activity'))
app.config.set_per('statusmsg', msg_name, 'subactivity', app.config.set_per('statusmsg', msg_name, 'subactivity',
self.pep_dict.get('subactivity')) self.pep_dict.get('subactivity'))
app.config.set_per('statusmsg', msg_name, 'activity_text', app.config.set_per('statusmsg', msg_name, 'activity_text',
self.pep_dict.get('activity_text')) self.pep_dict.get('activity_text'))
app.config.set_per('statusmsg', msg_name, 'mood', app.config.set_per('statusmsg', msg_name, 'mood',
self.pep_dict.get('mood')) self.pep_dict.get('mood'))
app.config.set_per('statusmsg', msg_name, 'mood_text', app.config.set_per('statusmsg', msg_name, 'mood_text',
self.pep_dict.get('mood_text')) self.pep_dict.get('mood_text'))
if msg_name in self.preset_messages_dict: if msg_name in self.preset_messages_dict:
NewConfirmationDialog( NewConfirmationDialog(
_('Overwrite'), _('Overwrite'),
_('Overwrite Status Message?'), _('Overwrite Status Message?'),
_('Preset name is already in use. ' _('This name is already in use. Do you want to '
'Do you want to overwrite this preset?'), 'overwrite this preset?'),
[DialogButton.make('Cancel'), [DialogButton.make('Cancel'),
DialogButton.make('Remove', DialogButton.make('Remove',
text=_('_Overwrite'), text=_('_Overwrite'),
......
...@@ -64,7 +64,6 @@ from gajim.common import contacts ...@@ -64,7 +64,6 @@ from gajim.common import contacts
from gajim.common.const import StyleAttr from gajim.common.const import StyleAttr
from gajim.common.const import Chatstate from gajim.common.const import Chatstate
from gajim.common.const import MUCJoinedState from gajim.common.const import MUCJoinedState
from gajim.common.const import ButtonAction
from gajim.chat_control_base import ChatControlBase from gajim.chat_control_base import ChatControlBase
...@@ -1174,9 +1173,8 @@ class GroupchatControl(ChatControlBase): ...@@ -1174,9 +1173,8 @@ class GroupchatControl(ChatControlBase):
_('<b>%s</b> from <b>%s</b> requests voice') % ( _('<b>%s</b> from <b>%s</b> requests voice') % (
event.voice_request.nick, self.room_name), event.voice_request.nick, self.room_name),
[DialogButton.make('Cancel'), [DialogButton.make('Cancel'),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('Approve'), text=_('_Approve'),
action=ButtonAction.SUGGESTED,
callback=on_approve)], callback=on_approve)],
modal=False).show() modal=False).show()
...@@ -2278,8 +2276,9 @@ class GroupchatControl(ChatControlBase): ...@@ -2278,8 +2276,9 @@ class GroupchatControl(ChatControlBase):
_('_Do not ask me again'), _('_Do not ask me again'),
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
callback=on_cancel), callback=on_cancel),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('_Leave'), text=_('_Leave'),
is_default=True,
callback=on_ok)], callback=on_ok)],
transient_for=self.parent_win.window).show() transient_for=self.parent_win.window).show()
return return
......
...@@ -139,7 +139,7 @@ class AccountsWindow(Gtk.ApplicationWindow): ...@@ -139,7 +139,7 @@ class AccountsWindow(Gtk.ApplicationWindow):
_('To apply all changes instantly, you have to re-login.'), _('To apply all changes instantly, you have to re-login.'),
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
text=_('_Later')), text=_('_Later')),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('_Re-Login'), text=_('_Re-Login'),
callback=lambda *args: relog(account))], callback=lambda *args: relog(account))],
transient_for=self).show() transient_for=self).show()
...@@ -193,8 +193,7 @@ class AccountsWindow(Gtk.ApplicationWindow): ...@@ -193,8 +193,7 @@ class AccountsWindow(Gtk.ApplicationWindow):
NewConfirmationDialog( NewConfirmationDialog(
_('Remove Account'), _('Remove Account'),
_('You still have open chats in your account %s') % account, _('You still have open chats in your account %s') % account,
_('All chat and group chat windows will be closed.\n' _('All chat and group chat windows will be closed.'),
'Do you want to continue?'),
[DialogButton.make('Cancel'), [DialogButton.make('Cancel'),
DialogButton.make('Remove', DialogButton.make('Remove',
callback=remove)], callback=remove)],
...@@ -571,8 +570,7 @@ class AccountRow(Gtk.ListBoxRow): ...@@ -571,8 +570,7 @@ class AccountRow(Gtk.ListBoxRow):
NewConfirmationDialog( NewConfirmationDialog(
_('Disable Account'), _('Disable Account'),
_('Account %s is still connected') % account, _('Account %s is still connected') % account,
_('All chat and group chat windows will be closed. ' _('All chat and group chat windows will be closed.'),
'Do you want to continue?'),
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
callback=lambda: switch.set_active(True)), callback=lambda: switch.set_active(True)),
DialogButton.make('Remove', DialogButton.make('Remove',
...@@ -972,13 +970,13 @@ class RemoveAccountWindow: ...@@ -972,13 +970,13 @@ class RemoveAccountWindow:
else: else:
self._on_remove_success(True) self._on_remove_success(True)
if self.account in app.connections and \ if (self.account in app.connections and
app.connections[self.account].connected: app.connections[self.account].connected):
NewConfirmationDialog( NewConfirmationDialog(
_('Remove Account'), _('Remove Account'),
_('Account \'%s\' is still connected to the ' _('Still connected to the server'),
'server') % self.account, _('Account \'%s\' is still connected to the server. If you '
_('If you remove it, the connection will be lost.'), 'remove it, the connection will be lost.') % self.account,
[DialogButton.make('Cancel'), [DialogButton.make('Cancel'),
DialogButton.make('Remove', DialogButton.make('Remove',
callback=remove)], callback=remove)],
......
...@@ -336,7 +336,7 @@ class FileTransfersWindow: ...@@ -336,7 +336,7 @@ class FileTransfersWindow:
'Do you want to download it again?') % file_name, 'Do you want to download it again?') % file_name,
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
text=_('_No')), text=_('_No')),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('_Download Again'), text=_('_Download Again'),
callback=on_yes, callback=on_yes,
args=[jid, args=[jid,
...@@ -421,16 +421,17 @@ class FileTransfersWindow: ...@@ -421,16 +421,17 @@ class FileTransfersWindow:
NewConfirmationDialog( NewConfirmationDialog(
_('File Transfer Conflict'), _('File Transfer Conflict'),
_('This file already exists'), _('File already exists'),
_('Resume download or replace file?'), _('Resume download or replace file?'),
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
callback=_on_cancel), callback=_on_cancel),
DialogButton.make('OK',
text=_('Replace _File'),
callback=_on_replace),
DialogButton.make('OK', DialogButton.make('OK',
text=_('Resume _Download'), text=_('Resume _Download'),
callback=_on_resume)]).show() callback=_on_resume),
DialogButton.make('Accept',
text=_('Replace _File'),
is_default=True,
callback=_on_replace)]).show()
# File does not exist yet # File does not exist yet
dirname = os.path.dirname(file_path) dirname = os.path.dirname(file_path)
...@@ -486,8 +487,7 @@ class FileTransfersWindow: ...@@ -486,8 +487,7 @@ class FileTransfersWindow:
sectext, sectext,
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
callback=_on_cancel), callback=_on_cancel),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('_Accept'),
callback=_on_ok)]).show() callback=_on_ok)]).show()
def set_status(self, file_props, status): def set_status(self, file_props, status):
......
...@@ -167,7 +167,7 @@ class Interface: ...@@ -167,7 +167,7 @@ class Interface:
obj.stanza, answer) obj.stanza, answer)
account = obj.conn.name account = obj.conn.name
pri_msg = _('HTTP (%(method)s) Authorization ' message = _('HTTP (%(method)s) Authorization '
'for %(url)s (ID: %(id)s)') % { 'for %(url)s (ID: %(id)s)') % {
'method': obj.method, 'method': obj.method,
'url': obj.url, 'url': obj.url,
...@@ -177,17 +177,17 @@ class Interface: ...@@ -177,17 +177,17 @@ class Interface:
sec_msg = _('Do you accept this request (account: %s)?') % account sec_msg = _('Do you accept this request (account: %s)?') % account
if obj.msg: if obj.msg:
sec_msg = obj.msg + '\n' + sec_msg sec_msg = obj.msg + '\n' + sec_msg
message = message + '\n' + sec_msg
NewConfirmationDialog( NewConfirmationDialog(
_('Authorization'), _('Authorization Request'),
pri_msg, _('HTTP Authorization Request'),
sec_msg, message,
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
text=_('_No'), text=_('_No'),
callback=_response, callback=_response,
args=[obj, 'yes']), args=[obj, 'yes']),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('_Accept'),
callback=_response, callback=_response,
args=[obj, 'no'])]).show() args=[obj, 'no'])]).show()
......
...@@ -245,9 +245,9 @@ class HistoryManager: ...@@ -245,9 +245,9 @@ class HistoryManager:
NewConfirmationDialog( NewConfirmationDialog(
_('Database Cleanup'), _('Database Cleanup'),
_('Do you want to clean up the database? ' _('Clean up the database?'),
'(STRONGLY NOT RECOMMENDED IF GAJIM IS RUNNING)'), _('This is STRONGLY NOT RECOMMENDED IF GAJIM IS RUNNING.\n'
_('Normally, the allocated database size will not be freed, it ' 'Normally, the allocated database size will not be freed, it '
'will just become reusable. This operation may take a while.'), 'will just become reusable. This operation may take a while.'),
[DialogButton.make('Cancel', [DialogButton.make('Cancel',
callback=_on_no), callback=_on_no),
......
...@@ -358,11 +358,13 @@ class MessageWindow: ...@@ -358,11 +358,13 @@ class MessageWindow:
NewConfirmationCheckDialog( NewConfirmationCheckDialog(
_('Close Tabs'), _('Close Tabs'),
_('You are going to close several tabs'), _('You are about to close several tabs'),
_('Do you really want to close them all?'), _('Do you really want to close all of them?'),
_('_Do not ask me again'), _('_Do not ask me again'),
[DialogButton.make('Cancel'), [DialogButton.make('Cancel'),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('_Close'),
is_default=True,
callback=_on_yes1)], callback=_on_yes1)],
transient_for=self.window).show() transient_for=self.window).show()
return True return True
......
...@@ -4125,8 +4125,9 @@ class RosterWindow: ...@@ -4125,8 +4125,9 @@ class RosterWindow:
sectext, sectext,
_('_Do not ask me again'), _('_Do not ask me again'),
[DialogButton.make('Cancel'), [DialogButton.make('Cancel'),
DialogButton.make('OK', DialogButton.make('Accept',
text=_('_Create'), text=_('_Create'),
is_default=True,
callback=merge_contacts)]).show() callback=merge_contacts)]).show()
def on_drop_in_group(self, widget, account, c_source, grp_dest, def on_drop_in_group(self, widget, account, c_source, grp_dest,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment