Use InformationDialog instea...
Content-type: text/plain

Author: andar

Revision: 5299

Log:
        Add InformationDialog
Use InformationDialog instead of ErrorDialog in AddTorrentDialog
Make dialog in GtkUI translatable

Diff:
Modified: trunk/deluge/ui/gtkui/addtorrentdialog.py
===================================================================
--- trunk/deluge/ui/gtkui/addtorrentdialog.py   2009-05-20 23:46:27 UTC (rev 
5298)
+++ trunk/deluge/ui/gtkui/addtorrentdialog.py   2009-05-21 00:18:53 UTC (rev 
5299)
@@ -466,7 +466,7 @@
         (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:

Modified: trunk/deluge/ui/gtkui/dialogs.py
===================================================================
--- trunk/deluge/ui/gtkui/dialogs.py    2009-05-20 23:46:27 UTC (rev 5298)
+++ trunk/deluge/ui/gtkui/dialogs.py    2009-05-21 00:18:53 UTC (rev 5299)
@@ -104,6 +104,25 @@
             (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.

Modified: trunk/deluge/ui/gtkui/gtkui.py
===================================================================
--- trunk/deluge/ui/gtkui/gtkui.py      2009-05-20 23:46:27 UTC (rev 5298)
+++ trunk/deluge/ui/gtkui/gtkui.py      2009-05-21 00:18:53 UTC (rev 5299)
@@ -238,9 +238,9 @@
                 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:



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to