GTG

Merge lp:~anantzoid/gtg/cool-new-feature into lp:~gtg/gtg/old-trunk

Proposed by Anant Gupta
Status: Merged
Merged at revision: 1136
Proposed branch: lp:~anantzoid/gtg/cool-new-feature
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 103 lines (+41/-5) (has conflicts)
3 files modified
AUTHORS (+4/-0)
CHANGELOG (+3/-0)
GTG/gtk/browser/browser.py (+34/-5)
Text conflict in AUTHORS
To merge this branch: bzr merge lp:~anantzoid/gtg/cool-new-feature
Reviewer Review Type Date Requested Status
Anant Gupta (community) Approve
Izidor Matušov running, code Approve
Bertrand Rousseau Pending
Review via email: mp+99217@code.launchpad.net

This proposal supersedes a proposal from 2012-03-15.

Description of the change

To post a comment you must log in.
Revision history for this message
Izidor Matušov (izidor) wrote : Posted in a previous version of this proposal

Firstly, thanks for your fix. Have you committed and pushed all your changes? After your changes, GTG does not remember the size of its window any more (that is a regression).

To solve this bug, you need to store if the window is maximized and on the start maximize it if needed. You can find more information about maximization there:

http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--maximize

You found the place where you have to change things, keep working on it!

review: Needs Fixing (running, code)
Revision history for this message
Anant Gupta (anantzoid) wrote : Posted in a previous version of this proposal

I am not facing the bug now. Please see if the problem still exists.

Revision history for this message
Izidor Matušov (izidor) wrote : Posted in a previous version of this proposal

I've played with your code. I use Ubuntu & Unity and the bug seems to be solved there: if the window is the size of screen, it is maximized by Unity. However, not every window manager has that feature. Try to install other WMs, e.g. XFCE or FluxBox, and reproduce it there. It doesn't work it there.

In other words, without using method maximize() you are not able to solve this bug.

review: Needs Fixing (running, code)
Revision history for this message
Anant Gupta (anantzoid) wrote : Posted in a previous version of this proposal

I've used what you told me to and now there is again no problem. I don't have the test environments(XFCE or FluxBox). So please test it on different environments and let me know.

review: Needs Resubmitting
Revision history for this message
Izidor Matušov (izidor) wrote : Posted in a previous version of this proposal

Your code looks much more better now! You are able to detect when your window is maximized. on_window_state_event is called during the process of maximization and therefore you don't need to maximize the window (it is already happening)

You should instead save the fact that window is maximized: set a special values to width and height in config or introduce your new boolean variable to check if window was maximized. Don't forget to add back the code for maximizing of the window in restore_state_from_conf

Keep working on it, you are near the solution!

review: Needs Fixing (code)
Revision history for this message
Anant Gupta (anantzoid) wrote : Posted in a previous version of this proposal

That was a minor change to make. No trouble doing that. Please review the code.

Revision history for this message
Izidor Matušov (izidor) wrote : Posted in a previous version of this proposal

Could you change on_window_state_event to store state in config instead of trying to return value? (It doesn't work because of concept of GTK callbacks anyway)

review: Needs Fixing (code)
Revision history for this message
Anant Gupta (anantzoid) wrote : Posted in a previous version of this proposal

Sorry for the delay. Please check if this was what you asked for.

Revision history for this message
Anant Gupta (anantzoid) :
review: Needs Resubmitting
lp:~anantzoid/gtg/cool-new-feature updated
1119. By Anant Gupta

using boolean values in self.config

1120. By Anant Gupta

used string in config

1121. By Anant Gupta

used string in config

1122. By Anant Gupta

used string value in config.max:

1123. By Anant Gupta

used string value in config.max:

Revision history for this message
Izidor Matušov (izidor) wrote :

It works now. Thanks for the patch!

review: Approve (running, code)
Revision history for this message
Anant Gupta (anantzoid) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2012-03-26 16:09:56 +0000
3+++ AUTHORS 2012-03-26 16:59:18 +0000
4@@ -95,6 +95,10 @@
5 * dAnjou <https://launchpad.net/~danjou> (no email provided)
6 * Paul Kishimoto <mail@paul.kishimoto.name>
7 * Wolter Hellmund <wolterh6@gmail.com>
8+<<<<<<< TREE
9 * huxuan <i@huxuan.org>
10 * Nimit Shah <nimit.svnit@gmail.com>
11 * Abdul Rauf <abdulraufhaseeb@gmail.com>
12+=======
13+* Anant Gupta <anant718@hotmail.com>
14+>>>>>>> MERGE-SOURCE
15
16=== modified file 'CHANGELOG'
17--- CHANGELOG 2012-03-22 13:50:35 +0000
18+++ CHANGELOG 2012-03-26 16:59:18 +0000
19@@ -186,3 +186,6 @@
20
21 2009-03-01 Getting Things Gnome! 0.0.9rc1
22 * First official release 0.1rc1
23+
24+2012-03-15 Getting Things Gnome! 0.3
25+ *Bug #539037 fixed
26
27=== modified file 'GTG/gtk/browser/browser.py'
28--- GTG/gtk/browser/browser.py 2012-03-22 13:32:49 +0000
29+++ GTG/gtk/browser/browser.py 2012-03-26 16:59:18 +0000
30@@ -32,6 +32,7 @@
31 pygtk.require('2.0')
32 import gobject
33 import gtk
34+import gtk.gdk as gdk
35
36 #our own imports
37 from GTG import _, info, ngettext
38@@ -132,6 +133,7 @@
39 self.last_added_tags = "NewTag"
40 self.last_apply_tags_to_subtasks = False
41
42+
43 self.restore_state_from_conf()
44
45 self.on_select_tag()
46@@ -438,6 +440,23 @@
47
48 def quit(self,widget=None):
49 self.vmanager.close_browser()
50+
51+
52+ def on_window_state_event(self,widget,event,data=None):
53+
54+ """This event checks for the window state: maximized?
55+ and stores the state in self.config.max
56+ This is used to check the window state afterwards
57+ and maximize it if needed
58+ """
59+
60+ mask = gtk.gdk.WINDOW_STATE_MAXIMIZED
61+ if widget.get_window().get_state() & mask == mask:
62+ self.config.set("max","True")
63+ else:
64+ self.config.set("max","False")
65+
66+
67
68 def restore_state_from_conf(self):
69
70@@ -448,11 +467,21 @@
71 # self.builder.get_object("hpaned1").set_position(250)
72 # return
73
74- width = self.config.get('width')
75+
76+ width = self.config.get('width')
77 height = self.config.get('height')
78- if width and height:
79- self.window.resize(width, height)
80-
81+
82+ if width and height:
83+ self.window.resize(width, height)
84+# checks for maximum size of window
85+ self.window.connect('window-state-event',self.on_window_state_event)
86+ state = self.config.get("max")
87+ if state == "True":
88+ print "Maximize"
89+ self.window.maximize()
90+
91+
92+
93 xpos = self.config.get("x_pos")
94 ypos = self.config.get("y_pos")
95 if ypos and xpos:
96@@ -669,7 +698,7 @@
97 width, height = self.window.get_size()
98 self.config.set('width',width)
99 self.config.set('height',height)
100-
101+
102 def on_bottom_pane_position(self, widget, data = None):
103 self.config.set('bottom_pane_position', widget.get_position())
104

Subscribers

People subscribed via source and target branches

to status/vote changes: