[Tkabber-dev] r1232 - in trunk/tkabber: . ifacetk plugins/unix plugins/windows

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Sep 20 21:07:01 MSD 2007


Author: sergei
Date: 2007-09-20 21:07:00 +0400 (Thu, 20 Sep 2007)
New Revision: 1232

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/iface.tcl
   trunk/tkabber/ifacetk/systray.tcl
   trunk/tkabber/plugins/unix/dockingtray.tcl
   trunk/tkabber/plugins/unix/systray.tcl
   trunk/tkabber/plugins/unix/tktray.tcl
   trunk/tkabber/plugins/windows/taskbar.tcl
Log:
	* ifacetk/systray.tcl, plugins/unix/dockingtray.tcl,
	  plugins/unix/systray.tcl, plugins/unix/tktray.tcl,
	  plugins/windows/taskbar.tcl: Split main window showing and hiding
	  into two separate gestures: left mouse button shows main window,
	  middle mouse button hides.

	* ifacetk/iface.tcl: Added a few words describing systray icon
	  behavior.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-09-20 10:45:36 UTC (rev 1231)
+++ trunk/tkabber/ChangeLog	2007-09-20 17:07:00 UTC (rev 1232)
@@ -3,6 +3,15 @@
 	* plugins/general/xaddress.tcl: Moved address rewriting to
 	  rewrite_message_hook, check for forged address changes.
 
+	* ifacetk/systray.tcl, plugins/unix/dockingtray.tcl,
+	  plugins/unix/systray.tcl, plugins/unix/tktray.tcl,
+	  plugins/windows/taskbar.tcl: Split main window showing and hiding
+	  into two separate gestures: left mouse button shows main window,
+	  middle mouse button hides.
+
+	* ifacetk/iface.tcl: Added a few words describing systray icon
+	  behavior.
+
 2007-09-18  Sergei Golovan  <sgolovan at nes.ru>
 
 	* ifacetk/iroster.tcl: Fixed showing own resources if username is not

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2007-09-20 10:45:36 UTC (rev 1231)
+++ trunk/tkabber/ifacetk/iface.tcl	2007-09-20 17:07:00 UTC (rev 1232)
@@ -514,7 +514,12 @@
     $::tk_modify-Z\t[::msgcat::mc {Undo}]
     $::tk_modify-Shift-Z\t[::msgcat::mc {Redo}]
     Alt-PgUp/Down\t[::msgcat::mc {Scroll chat window up/down}]
-    [::msgcat::mc {Right mouse button}]\t[::msgcat::mc {Correct word}]"
+    [::msgcat::mc {Right mouse button}]\t[::msgcat::mc {Correct word}]
+
+[::msgcat::mc Systray:]
+    [::msgcat::mc {Left mouse button}]\t[::msgcat::mc {Show main window}]
+    [::msgcat::mc {Middle mouse button}]\t[::msgcat::mc {Hide main window}]
+    [::msgcat::mc {Right mouse button}]\t[::msgcat::mc {Popup menu}]"
     $t configure -state disabled
 
     $w draw

Modified: trunk/tkabber/ifacetk/systray.tcl
===================================================================
--- trunk/tkabber/ifacetk/systray.tcl	2007-09-20 10:45:36 UTC (rev 1231)
+++ trunk/tkabber/ifacetk/systray.tcl	2007-09-20 17:07:00 UTC (rev 1232)
@@ -97,8 +97,7 @@
 proc systray::popupmenu {m} {
     set tearoff [set [namespace parent]::options(show_tearoffs)]
 
-    menu $m -title [::msgcat::mc "Tkabber Systray"] -tearoff $tearoff \
-	-postcommand [list [namespace code post] $m]
+    menu $m -title [::msgcat::mc "Tkabber Systray"] -tearoff $tearoff
     $m add command -label [::msgcat::mc "About"] \
 	-command [list [namespace parent]::about_window]
     $m add separator
@@ -126,10 +125,10 @@
 	incr id
     }
     $m add separator
-    $m add command -label [::msgcat::mc "Hide Main Window"] \
-		   -command [namespace code withdraw]
     $m add command -label [::msgcat::mc "Show Main Window"] \
 		   -command [namespace code restore]
+    $m add command -label [::msgcat::mc "Hide Main Window"] \
+		   -command [namespace code withdraw]
     $m add separator
     $m add command -label [::msgcat::mc "Quit"] -command quit
 
@@ -138,32 +137,6 @@
 
 ##########################################################################
 
-proc systray::post {m} {
-    global curuserstatus
-
-    switch -- [wm state .] {
-        withdrawn {
-            set state1 normal
-            set state2 disabled
-        }
-        default {
-            set state1 disabled
-            set state2 normal
-        }
-    }
-    if {$curuserstatus == "unavailable"} {
-	set state0 disabled
-    } else {
-	set state0 normal
-    }
-
-    $m entryconfigure [$m index [::msgcat::mc "Presence"]] -state $state0
-    $m entryconfigure [$m index [::msgcat::mc "Show Main Window"]] -state $state1
-    $m entryconfigure [$m index [::msgcat::mc "Hide Main Window"]] -state $state2
-}
-
-##########################################################################
-
 # Withdraws the main Tkabber window from the screen:
 proc systray::withdraw {} {
     variable saved_state

Modified: trunk/tkabber/plugins/unix/dockingtray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/dockingtray.tcl	2007-09-20 10:45:36 UTC (rev 1231)
+++ trunk/tkabber/plugins/unix/dockingtray.tcl	2007-09-20 17:07:00 UTC (rev 1232)
@@ -70,7 +70,8 @@
 
     set m [ifacetk::systray::popupmenu $icon.menu]
 
-    bind $mb <ButtonRelease-1> ifacetk::systray::toggle_state
+    bind $mb <ButtonRelease-1> ifacetk::systray::restore
+    bind $mb <ButtonRelease-2> ifacetk::systray::withdraw
     bind $mb <ButtonRelease-3> [list tk_popup $m %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }

Modified: trunk/tkabber/plugins/unix/systray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/systray.tcl	2007-09-20 10:45:36 UTC (rev 1231)
+++ trunk/tkabber/plugins/unix/systray.tcl	2007-09-20 17:07:00 UTC (rev 1232)
@@ -70,7 +70,8 @@
 
     set m [ifacetk::systray::popupmenu $icon.menu]
 
-    bind $icon <ButtonRelease-1> ifacetk::systray::toggle_state
+    bind $icon <ButtonRelease-1> ifacetk::systray::restore
+    bind $icon <ButtonRelease-2> ifacetk::systray::withdraw
     bind $icon <ButtonRelease-3> [list tk_popup $m %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }

Modified: trunk/tkabber/plugins/unix/tktray.tcl
===================================================================
--- trunk/tkabber/plugins/unix/tktray.tcl	2007-09-20 10:45:36 UTC (rev 1231)
+++ trunk/tkabber/plugins/unix/tktray.tcl	2007-09-20 17:07:00 UTC (rev 1232)
@@ -64,7 +64,8 @@
 
     set m [ifacetk::systray::popupmenu $icon.menu]
 
-    bind $icon <ButtonRelease-1> ifacetk::systray::toggle_state
+    bind $icon <ButtonRelease-1> ifacetk::systray::restore
+    bind $icon <ButtonRelease-2> ifacetk::systray::withdraw
     bind $icon <ButtonRelease-3> [list tk_popup $m %X %Y]
     balloon::setup $icon -command [list ifacetk::systray::balloon $icon]
 }

Modified: trunk/tkabber/plugins/windows/taskbar.tcl
===================================================================
--- trunk/tkabber/plugins/windows/taskbar.tcl	2007-09-20 10:45:36 UTC (rev 1231)
+++ trunk/tkabber/plugins/windows/taskbar.tcl	2007-09-20 17:07:00 UTC (rev 1232)
@@ -115,9 +115,13 @@
 proc taskbar::callback {m event x y} {
     switch -- $event {
 	WM_LBUTTONUP {
-	    ifacetk::systray::toggle_state
+	    ifacetk::systray::restore
 	}
 
+	WM_LBUTTONUP {
+	    ifacetk::systray::withdraw
+	}
+
 	WM_RBUTTONUP {
 	    $m post $x $y
 	}



More information about the Tkabber-dev mailing list