Add InformationDialog

Use InformationDialog instead of ErrorDialog in AddTorrentDialog
Make dialog in GtkUI translatable
This commit is contained in:
Andrew Resch 2009-05-21 00:18:53 +00:00
parent 2374d44c70
commit d45e2de1c9
3 changed files with 23 additions and 4 deletions

View File

@ -466,7 +466,7 @@ class AddTorrentDialog(component.Component):
(model, row) = self.listview_torrents.get_selection().get_selected()
if self.options[model[row][0]]["compact_allocation"]:
import dialogs
dialogs.ErrorDialog(_("Unable to set file priority!"), _("File prioritization is unavailable when using Compact allocation.")).run()
dialogs.InformationDialog(_("Unable to set file priority!"), _("File prioritization is unavailable when using Compact allocation.")).run()
return
(model, paths) = self.listview_files.get_selection().get_selected_rows()
if len(paths) > 1:

View File

@ -104,6 +104,25 @@ class YesNoDialog(BaseDialog):
(gtk.STOCK_YES, gtk.RESPONSE_YES, gtk.STOCK_NO, gtk.RESPONSE_NO),
parent)
class InformationDialog(BaseDialog):
"""
Displays an information dialog.
When run(), it will return a gtk.RESPONSE_CLOSE.
"""
def __init__(self, header, text, parent=None):
"""
:param header: see `:class:BaseDialog`
:param text: see `:class:BaseDialog`
:param parent: see `:class:BaseDialog`
"""
super(InformationDialog, self).__init__(
header,
text,
gtk.STOCK_DIALOG_INFO,
(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE),
parent)
class ErrorDialog(BaseDialog):
"""
Displays an error dialog with optional details text for more information.

View File

@ -238,9 +238,9 @@ class GtkUI:
client.start_classic_mode()
except deluge.error.DaemonRunningError:
response = dialogs.YesNoDialog(
"Turn off Classic Mode?",
"It appears that a Deluge daemon process (deluged) is already running.\n\n\
You will either need to stop the daemon or turn off Classic Mode to continue.").run()
_("Turn off Classic Mode?"),
_("It appears that a Deluge daemon process (deluged) is already running.\n\n\
You will either need to stop the daemon or turn off Classic Mode to continue.")).run()
self.started_in_classic = False
if response != gtk.RESPONSE_YES: