More generalization.

This commit is contained in:
Bill Dengler 2015-04-19 19:23:31 -04:00
parent 9820d369c3
commit 109635b8f4
5 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from gi.repository import Gtk from gi.repository import Gtk
import application
def retweet_question(parent): def retweet_question(parent):
dialog = Gtk.MessageDialog(None, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, _(u"Retweet")) dialog = Gtk.MessageDialog(None, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, _(u"Retweet"))
dialog.format_secondary_text(_(u"Would you like to add a comment to this tweet?")) dialog.format_secondary_text(_(u"Would you like to add a comment to this tweet?"))
@ -17,13 +17,13 @@ def delete_tweet_dialog(parent):
def exit_dialog(parent): def exit_dialog(parent):
dialog = Gtk.MessageDialog(parent, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, _(u"Exit")) dialog = Gtk.MessageDialog(parent, 0, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, _(u"Exit"))
dialog.format_secondary_text(_(u"Do you really want to close TW Blue?")) dialog.format_secondary_text(_(u"Do you really want to close " + application.name + "?"))
answer = dialog.run() answer = dialog.run()
dialog.destroy() dialog.destroy()
return answer return answer
def needs_restart(): def needs_restart():
wx.MessageDialog(None, _(u"The application requires to be restarted to save these changes. Press OK to do it now."), _("Restart TW Blue"), wx.OK).ShowModal() wx.MessageDialog(None, _(unicode(application.name+" must be restarted to save these changes. Press OK to restart now.")), _("Restart " + application.name), wx.OK).ShowModal()
def delete_user_from_db(): def delete_user_from_db():
return wx.MessageDialog(None, _(u"Are you sure you want to delete this user from the database? This user will not appear on the autocomplete results anymore."), _(u"Confirm"), wx.YES_NO|wx.ICON_QUESTION).ShowModal() return wx.MessageDialog(None, _(u"Are you sure you want to delete this user from the database? This user will not appear on the autocomplete results anymore."), _(u"Confirm"), wx.YES_NO|wx.ICON_QUESTION).ShowModal()

View File

@ -110,7 +110,7 @@ class mainFrame(Gtk.Window):
### MAIN ### MAIN
def __init__(self): def __init__(self):
""" Main function of this class.""" """ Main function of this class."""
super(mainFrame, self).__init__(title="TW Blue") super(mainFrame, self).__init__(title=application.name)
self.accel_group = Gtk.AccelGroup() self.accel_group = Gtk.AccelGroup()
self.add_accel_group(self.accel_group) self.add_accel_group(self.accel_group)
self.box = Gtk.VBox() self.box = Gtk.VBox()
@ -203,4 +203,4 @@ class mainFrame(Gtk.Window):
getattr(self, menuitem).Check(check) getattr(self, menuitem).Check(check)
def no_update_available(): def no_update_available():
wx.MessageDialog(None, _(u"Your TW Blue version is up to date"), _(u"Update"), style=wx.OK).ShowModal() wx.MessageDialog(None, _(u"Your " + application.name + " version is up to date"), _(u"Update"), style=wx.OK).ShowModal()

View File

@ -66,7 +66,7 @@ class reportBugDialog(widgetUtils.BaseDialog):
severityB.Add(severityLabel, 0, wx.ALL, 5) severityB.Add(severityLabel, 0, wx.ALL, 5)
severityB.Add(self.severity, 0, wx.ALL, 5) severityB.Add(self.severity, 0, wx.ALL, 5)
sizer.Add(severityB, 0, wx.ALL, 5) sizer.Add(severityB, 0, wx.ALL, 5)
self.agree = wx.CheckBox(panel, -1, _(u"I know that the TW Blue bug system will get my Twitter username to contact me and fix the bug quickly")) self.agree = wx.CheckBox(panel, -1, _(u"I know that the " + application.name + " bug system will get my Twitter username to contact me and fix the bug quickly"))
self.agree.SetValue(False) self.agree.SetValue(False)
sizer.Add(self.agree, 0, wx.ALL, 5) sizer.Add(self.agree, 0, wx.ALL, 5)
self.ok = wx.Button(panel, wx.ID_OK, _(u"Send report")) self.ok = wx.Button(panel, wx.ID_OK, _(u"Send report"))

View File

@ -7,7 +7,7 @@ class sessionManagerWindow(wx.Dialog):
super(sessionManagerWindow, self).__init__(parent=None, title="Session manager", size=wx.DefaultSize) super(sessionManagerWindow, self).__init__(parent=None, title="Session manager", size=wx.DefaultSize)
panel = wx.Panel(self) panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.VERTICAL) sizer = wx.BoxSizer(wx.VERTICAL)
label = wx.StaticText(panel, -1, u"Select a twitter account to start TW Blue", size=wx.DefaultSize) label = wx.StaticText(panel, -1, u"Select a twitter account to start " + application.name, size=wx.DefaultSize)
listSizer = wx.BoxSizer(wx.HORIZONTAL) listSizer = wx.BoxSizer(wx.HORIZONTAL)
self.list = widgets.list(panel, u"Account", style=wx.LC_SINGLE_SEL|wx.LC_REPORT) self.list = widgets.list(panel, u"Account", style=wx.LC_SINGLE_SEL|wx.LC_REPORT)
listSizer.Add(label, 0, wx.ALL, 5) listSizer.Add(label, 0, wx.ALL, 5)

View File

@ -8,7 +8,7 @@ def delete_tweet_dialog(parent):
return wx.MessageDialog(parent, _(u"Do you really want to delete this message? It will be eliminated from Twitter as well."), _(u"Delete"), wx.ICON_QUESTION|wx.YES_NO).ShowModal() return wx.MessageDialog(parent, _(u"Do you really want to delete this message? It will be eliminated from Twitter as well."), _(u"Delete"), wx.ICON_QUESTION|wx.YES_NO).ShowModal()
def exit_dialog(parent): def exit_dialog(parent):
dlg = wx.MessageDialog(parent, _(u"Do you really want to close TW Blue?"), _(u"Exit"), wx.YES_NO|wx.ICON_QUESTION) dlg = wx.MessageDialog(parent, _(u"Do you really want to close " + application.name + "?"), _(u"Exit"), wx.YES_NO|wx.ICON_QUESTION)
return dlg.ShowModal() return dlg.ShowModal()
def needs_restart(): def needs_restart():