After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640075 - Port commander to libpeas/gtk
Port commander to libpeas/gtk
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-20 16:21 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2019-03-23 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Port commander to libpeas/gtk3 (36.36 KB, patch)
2011-01-20 16:21 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Port commander to libpeas/gtk3 (36.71 KB, patch)
2011-01-21 09:50 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
commander v2 (46.48 KB, patch)
2011-03-27 13:04 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Port commander to libpeas/gtk3 (48.50 KB, patch)
2011-04-05 07:56 UTC, jessevdk@gmail.com
none Details | Review

Description Ignacio Casal Quinteiro (nacho) 2011-01-20 16:21:33 UTC
First patch for the commander port.
Comment 1 Ignacio Casal Quinteiro (nacho) 2011-01-20 16:21:35 UTC
Created attachment 178851 [details] [review]
Port commander to libpeas/gtk3
Comment 2 Ignacio Casal Quinteiro (nacho) 2011-01-21 09:50:15 UTC
Created attachment 178918 [details] [review]
Port commander to libpeas/gtk3
Comment 3 jessevdk@gmail.com 2011-01-22 18:04:58 UTC
Review of attachment 178918 [details] [review]:

See inline comments. Some stuff probably just depends on things not working yet in pygi (like expose -> draw).

::: plugins/commander/commander/entry.py
@@ +58,3 @@
+
+		self._entry = Gtk.Entry()
+		self._entry.modify_font(font_desc)

use override_font

@@ +64,3 @@
 
+		# Set the same text color as the text view
+		self._entry.override_color(0, context.get_color(state))

Use Gtk.StateFlag (btw, 0 is the Active state, seems wrong)

@@ +71,3 @@
 		self._entry.show()
 
+		self._prompt_label = Gtk.Label(label='<b>&gt;&gt;&gt;</b>')

Maybe use markup= here?

@@ +79,3 @@
+		context.add_class(Gtk.STYLE_CLASS_VIEW)
+		label_color = context.get_color(0)
+		self._prompt_label.override_color(0, label_color)

use state flag

@@ +83,3 @@
+
+		self.override_background_color(0, self.background_gdk())
+		self._entry.override_background_color(0, self.background_gdk())

use state flag

@@ +124,3 @@
 		return self._view
 
 	def on_realize(self, widget):

Replace with do_realize

@@ +143,3 @@
 
+		#ct.rectangle(evnt.area.x, evnt.area.y, evnt.area.width, evnt.area.height)
+		#ct.clip()

Why?

@@ +176,3 @@
+		gdk_bg.red = bg[0] / 65535
+		gdk_bg.green = bg[1] / 65535
+		gdk_bg.blue = bg[2] / 65535

This is a bit pointless :) First the color is multiplied by 65535 and then divided again...

::: plugins/commander/commander/info.py
@@ +40,2 @@
 		self._text.modify_font(entry._view.style.font_desc)
+		self._text.modify_text(Gtk.StateType.NORMAL, entry._entry.style.text[Gtk.StateType.NORMAL])

Does this work? Seems it needs to be changed to use style context

@@ +92,3 @@
 	def status(self, text=None):
 		if self._status_label == None and text != None:
+			self._status_label = Gtk.Label(label='')

Empty constructor will probably work no?

@@ +95,2 @@
 			self._status_label.modify_font(self._text.style.font_desc)
+			self._status_label.modify_fg(Gtk.StateType.NORMAL, self._text.style.text[Gtk.StateType.NORMAL])

Deprecated

@@ +200,3 @@
 	def ensure_button_bar(self):
 		if not self._button_bar:
+			self._button_bar = Gtk.HBox(False, 3)

Use Gtk.Box(orientation stuff

@@ +262,3 @@
 			return False
 
+		ct = evnt.get_window().cairo_create()

Expose -> draw

@@ +276,2 @@
 	def on_text_realize(self, widget):
+		self._text.get_window(Gtk.TextWindowType.TEXT).set_back_pixmap(None, False)

I guess set_back_pixmap wont work anymore

@@ +308,3 @@
 			return True
 
+		ct = evnt.get_window().cairo_create()

Expose -> draw

::: plugins/commander/commander/transparentwindow.py
@@ +47,2 @@
 	def on_realize(self, widget):
+		self.get_window().set_back_pixmap(None, False)

Does set_back_pixmap still exist?

@@ +77,2 @@
 	def on_expose(self, widget, evnt):
+		if not self.get_window():

Expose -> draw

::: plugins/commander/modules/doc.py
@@ +91,3 @@
         self.iter = iter
 
+        bus = self.get_window().get_message_bus()

Does the bus actually work?

::: plugins/commander/modules/edit.py
@@ +55,3 @@
     if matches:
         for match in matches:
+            files.append(Gio.File(match))

Does this work, or does it need to new Gio.File constructor thingie

@@ +58,2 @@
     else:
+        files.append(Gio.File(filename))

Idem

@@ +93,2 @@
     if os.path.isabs(newfile):
+        dest = Gio.File(newfile)

Idem

@@ +134,3 @@
 def _edit_command(view, mod, func=None):
     try:
+        location = Gio.File(inspect.getsourcefile(mod))

Idem
Comment 4 Ignacio Casal Quinteiro (nacho) 2011-01-22 18:13:39 UTC
(In reply to comment #3)
> Review of attachment 178918 [details] [review]:
> 
> See inline comments. Some stuff probably just depends on things not working yet
> in pygi (like expose -> draw).
> 
> ::: plugins/commander/commander/entry.py
> @@ +58,3 @@
> +
> +        self._entry = Gtk.Entry()
> +        self._entry.modify_font(font_desc)
> 
> use override_font
right
> 
> @@ +64,3 @@
> 
> +        # Set the same text color as the text view
> +        self._entry.override_color(0, context.get_color(state))
> 
> Use Gtk.StateFlag (btw, 0 is the Active state, seems wrong)
> 
> @@ +71,3 @@
>          self._entry.show()
> 
> +        self._prompt_label = Gtk.Label(label='<b>&gt;&gt;&gt;</b>')
> 
> Maybe use markup= here?
> 
> @@ +79,3 @@
> +        context.add_class(Gtk.STYLE_CLASS_VIEW)
> +        label_color = context.get_color(0)
> +        self._prompt_label.override_color(0, label_color)
> 
> use state flag
> 
> @@ +83,3 @@
> +
> +        self.override_background_color(0, self.background_gdk())
> +        self._entry.override_background_color(0, self.background_gdk())
> 
> use state flag
> 
> @@ +124,3 @@
>          return self._view
> 
>      def on_realize(self, widget):
> 
> Replace with do_realize
> 
> @@ +143,3 @@
> 
> +        #ct.rectangle(evnt.area.x, evnt.area.y, evnt.area.width,
> evnt.area.height)
> +        #ct.clip()
> 
> Why?

This didn't work with the current pygobject, but it should be added back

> 
> @@ +176,3 @@
> +        gdk_bg.red = bg[0] / 65535
> +        gdk_bg.green = bg[1] / 65535
> +        gdk_bg.blue = bg[2] / 65535
> 
> This is a bit pointless :) First the color is multiplied by 65535 and then
> divided again...

Yeah, I fixed this in multi-edit and I thought I did it here too. 

> 
> ::: plugins/commander/commander/info.py
> @@ +40,2 @@
>          self._text.modify_font(entry._view.style.font_desc)
> +        self._text.modify_text(Gtk.StateType.NORMAL,
> entry._entry.style.text[Gtk.StateType.NORMAL])
> 
> Does this work? Seems it needs to be changed to use style context

For sure it doesn't but I couldn't reach this part of the code when testing

> 
> @@ +92,3 @@
>      def status(self, text=None):
>          if self._status_label == None and text != None:
> +            self._status_label = Gtk.Label(label='')
> 
> Empty constructor will probably work no?



> 
> @@ +95,2 @@
>              self._status_label.modify_font(self._text.style.font_desc)
> +            self._status_label.modify_fg(Gtk.StateType.NORMAL,
> self._text.style.text[Gtk.StateType.NORMAL])
> 
> Deprecated
> 
> @@ +200,3 @@
>      def ensure_button_bar(self):
>          if not self._button_bar:
> +            self._button_bar = Gtk.HBox(False, 3)
> 
> Use Gtk.Box(orientation stuff
> 
> @@ +262,3 @@
>              return False
> 
> +        ct = evnt.get_window().cairo_create()
> 
> Expose -> draw
> 
> @@ +276,2 @@
>      def on_text_realize(self, widget):
> +        self._text.get_window(Gtk.TextWindowType.TEXT).set_back_pixmap(None,
> False)
> 
> I guess set_back_pixmap wont work anymore
> 
> @@ +308,3 @@
>              return True
> 
> +        ct = evnt.get_window().cairo_create()
> 
> Expose -> draw
> 
> ::: plugins/commander/commander/transparentwindow.py
> @@ +47,2 @@
>      def on_realize(self, widget):
> +        self.get_window().set_back_pixmap(None, False)
> 
> Does set_back_pixmap still exist?
> 
> @@ +77,2 @@
>      def on_expose(self, widget, evnt):
> +        if not self.get_window():
> 
> Expose -> draw
> 
> ::: plugins/commander/modules/doc.py
> @@ +91,3 @@
>          self.iter = iter
> 
> +        bus = self.get_window().get_message_bus()
> 
> Does the bus actually work?
> 
> ::: plugins/commander/modules/edit.py
> @@ +55,3 @@
>      if matches:
>          for match in matches:
> +            files.append(Gio.File(match))
> 
> Does this work, or does it need to new Gio.File constructor thingie
> 
> @@ +58,2 @@
>      else:
> +        files.append(Gio.File(filename))
> 
> Idem
> 
> @@ +93,2 @@
>      if os.path.isabs(newfile):
> +        dest = Gio.File(newfile)
> 
> Idem
> 
> @@ +134,3 @@
>  def _edit_command(view, mod, func=None):
>      try:
> +        location = Gio.File(inspect.getsourcefile(mod))
> 
> Idem


Most of it is shit left by the converter script.
Comment 5 Ignacio Casal Quinteiro (nacho) 2011-03-27 13:04:09 UTC
Created attachment 184359 [details] [review]
commander v2

Same but with jesse's patch rebased over it.
Comment 6 jessevdk@gmail.com 2011-04-05 07:56:19 UTC
Created attachment 185176 [details] [review]
Port commander to libpeas/gtk3
Comment 7 jessevdk@gmail.com 2011-04-05 07:57:15 UTC
I managed to make some things more or less work, but the rendering is still not correct.
Comment 8 Ignacio Casal Quinteiro (nacho) 2011-04-05 09:00:13 UTC
Review of attachment 185176 [details] [review]:

I'd say let's push it and fix the remaining issues in different patches if not it is a pain for review as this is a big monster.
Comment 9 Ignacio Casal Quinteiro (nacho) 2011-04-05 09:00:14 UTC
Review of attachment 185176 [details] [review]:

I'd say let's push it and fix the remaining issues in different patches if not it is a pain for review as this is a big monster.