/offlineimap/head: changeset 192

Removed the old Log menu code; no longer necessary.
This commit is contained in:
jgoerzen 2002-07-25 06:37:54 +01:00
parent e45e737640
commit 413b5aac0b
2 changed files with 14 additions and 25 deletions

View File

@ -6,7 +6,13 @@ offlineimap (3.2.1) unstable; urgency=low
* Blinkenlights UI log window is now scrolled and has a new * Blinkenlights UI log window is now scrolled and has a new
config file option "bufferlines" to specify the size of the scroll config file option "bufferlines" to specify the size of the scroll
buffer. buffer.
* Make the Blinkenlights window non-resizable. * The Blinkenlights window is now non-resizable when the log is disabled.
When the log is enabled, the window is resizable, and the changes in
size are reflected in the log widget. Therefore, the Bigger Log
and Smaller Log items can disappear, and the Log menu now becomes
a Show Log or a Hide Log menu option. No sub-menus necessary anymore.
This presents a much cleaner feel, more intuitive operation, and
faster navigation.
-- John Goerzen <jgoerzen@complete.org> Wed, 24 Jul 2002 17:04:04 -0500 -- John Goerzen <jgoerzen@complete.org> Wed, 24 Jul 2002 17:04:04 -0500

View File

@ -401,50 +401,33 @@ class Blinkenlights(VerboseUI):
s.gettf().setcolor('red') s.gettf().setcolor('red')
s._msg(version.banner) s._msg(version.banner)
s.text.see(END) s.text.see(END)
#s.top.minsize(s.top.winfo_reqwidth(),
# s.top.winfo_reqheight() + s.menubar.winfo_reqheight())
if s.config.has_option("ui.Tk.Blinkenlights", "showlog") and \ if s.config.has_option("ui.Tk.Blinkenlights", "showlog") and \
s.config.getboolean("ui.Tk.Blinkenlights", "showlog"): s.config.getboolean("ui.Tk.Blinkenlights", "showlog"):
s._togglelog() s._togglelog()
def _largerlog(s):
s.loglines += 1
s.text.configure(height = s.loglines)
def _smallerlog(s):
if s.loglines >= 2:
s.loglines -= 1
s.text.configure(height = s.loglines)
def _togglelog(s): def _togglelog(s):
print "togglelog"
if s.textenabled: if s.textenabled:
s.oldtextheight = s.text.winfo_height() s.oldtextheight = s.text.winfo_height()
s.text.pack_forget() s.text.pack_forget()
s.textenabled = 0 s.textenabled = 0
s.menubar.delete('Log') s.menubar.entryconfig('Hide Log', label = 'Show Log')
s.menubar.insert_command('Exit', label = 'Show Log',
command = s._togglelog)
s.top.update() s.top.update()
s.top.geometry("%dx%d" % (s.top.winfo_reqwidth(), s.top.geometry("%dx%d" % (s.top.winfo_reqwidth(),
s.top.winfo_reqheight())) s.top.winfo_reqheight()))
s.top.update() s.top.update()
s.top.resizable(width = 0, height = 0) s.top.resizable(width = 0, height = 0)
s.top.update()
else: else:
s.text.pack(side = BOTTOM, expand = 1, fill = BOTH) s.text.pack(side = BOTTOM, expand = 1, fill = BOTH)
s.textenabled = 1 s.textenabled = 1
s.top.update() s.top.update()
s.top.geometry("%dx%d" % (s.top.winfo_reqwidth(), s.top.geometry("%dx%d" % (s.top.winfo_reqwidth(),
s.top.winfo_height() + s.oldtextheight)) s.top.winfo_height() + s.oldtextheight))
s.menubar.delete('Show Log') s.menubar.entryconfig('Show Log', label = 'Hide Log')
logmenu = Menu(s.menubar, tearoff = 0,
activebackground = "#000030",
background = "#000030", foreground = "blue",
activeforeground = "white",
font = ("Helvetica", 8))
logmenu.add_command(label = "Hide Log", command = s._togglelog)
logmenu.add_command(label = "Larger Log", command = s._largerlog)
logmenu.add_command(label = "Smaller Log", command = s._smallerlog)
s.menubar.insert_cascade('Exit', label = "Log", menu = logmenu)
s._rescroll() s._rescroll()
s.top.resizable(width = 1, height = 1) s.top.resizable(width = 1, height = 1)