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