Re: [jokosher-devel] [PATCH] Added description textview to ExtensionManagerDialog
- From: "Knut Erik Teigen" <knutert gmail com>
- To: jokosher-devel-list gnome org
- Subject: Re: [jokosher-devel] [PATCH] Added description textview to ExtensionManagerDialog
- Date: Wed, 15 Aug 2007 13:26:39 +0200
Hello again,
Ok, now I've modified the patch so that a Label is used instead. Not sure if
the description headline is needed, but take a look and tell me what you think.
-Knut Erik-
On 8/13/07, Knut Erik Teigen <knutert gmail com> wrote:
On 8/13/07, Laszlo Pandy <
laszlok2 gmail com> wrote:
Knut Erik Teigen wrote:
> Hello,
>
> This is my first patch for Jokosher, and actually the first time I've
> contributed code to an open source project. I'm a guitar player, and
> have been looking for a decent, lightweight recording app, and I'm very
> pleased with Jokosher so far. Since my day gig is coding, I thought I
> might as well try to give something back to the project as well.
> Anyways, hope you agree with what I've done. It was mostly just to
> familiarize myself with the codebase and the tools you use.
>
> First, I've fixed bug #87850, changed tooltip "Edit this mixdown step
> settings" to "Edit settings for this mixdown step".
>
> Second, I've added a textview box with the description in it for the
> ExtensionManagerDialog. I found that nearly all the descriptions didn't
> fit in the treeView, so I think it is better this way. Now even longer
> descriptions are also possible.
>
> That's all for now, but expect to hear more from me:)
>
> Regards,
> Knut Erik Teigen
>
>
I realize it is two months later, but I finally got a chance to look at
this patch. It is a good idea and something that needed to be done, but
I don't like the way it is implemented. Having an extra viewport around
the treeview puts a border around everything and sometimes makes a
scrollbar visible, both of which are ugly.
Also I'm not sure the textview widget is the best idea, even though this
the GTK widget that is most obvious for this job. Because the text is
not editable, I would suggest using a multi-line GTK label. You can see
an example of this in my API search dialog in the Extension Console
extension. When you click on the name of the function, the documentation
comes up in a GTK label on the bottom of the treeview. Of course this
wasn't implemented when you originally submitted this patch.
I'm sorry that I didn't respond earlier, but if you make the changes and
resubmit the patch, I'll accept it. Also you are very close to getting
the 3 patches needed for you to get an SVN account.
Laszlo
Hello,
Thanks for the feedback. I also noticed the scrollbar after I submitted the patch,
and agree that it's ugly.
I'll try to use a multi-line label instead, and resubmit the patch.
-Knut Erik-
Index: Jokosher.glade
===================================================================
--- Jokosher.glade (revision 1459)
+++ Jokosher.glade (working copy)
@@ -824,6 +824,7 @@
</widget>
<widget class="GtkAboutDialog" id="AboutDialog">
+ <property name="border_width">5</property>
<property name="visible">True</property>
<property name="destroy_with_parent">True</property>
<property name="name" translatable="yes">version 0.9</property>
@@ -4444,9 +4445,10 @@
<child>
<widget class="GtkVBox" id="vbox20">
<property name="border_width">12</property>
+ <property name="height_request">353</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">12</property>
+ <property name="spacing">13</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow4">
@@ -4479,6 +4481,86 @@
</child>
<child>
+ <widget class="GtkFrame" id="frame15">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment29">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkEventBox" id="descriptionEventBox">
+ <property name="visible">True</property>
+ <property name="visible_window">True</property>
+ <property name="above_child">False</property>
+
+ <child>
+ <widget class="GtkLabel" id="ExtensionDescription">
+ <property name="height_request">100</property>
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label121">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Description</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkHBox" id="hbox19">
<property name="visible">True</property>
<property name="homogeneous">False</property>
Index: ExtensionManagerDialog.py
===================================================================
--- ExtensionManagerDialog.py (revision 1459)
+++ ExtensionManagerDialog.py (working copy)
@@ -7,7 +7,7 @@
#
#-------------------------------------------------------------------------------
-import gtk.glade, pango
+import gtk.glade, gtk.gdk, pango
import Globals, Extension
import gettext
import os
@@ -41,11 +41,13 @@
self.dlg = self.wTree.get_widget("ExtensionManagerDialog")
self.tree = self.wTree.get_widget("treeviewExtensions")
+ self.eb = self.wTree.get_widget("descriptionEventBox")
+ self.description = self.wTree.get_widget("ExtensionDescription")
+ self.eb.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
self.prefs_button = self.wTree.get_widget("buttonPreferences")
self.AddColumn("Enabled", 0, 'toggle')
- self.AddColumn("Name", 1, 'text', 25)
- self.AddColumn("Description", 2, 'text', 25)
+ self.AddColumn("Name", 1, 'text', 30)
self.AddColumn("Version", 3, 'text', 7)
self.model = gtk.ListStore(bool, str, str, str, str, bool)
@@ -54,6 +56,7 @@
for extension in self.parent.extensionManager.GetExtensions():
self.model.append((extension["enabled"], extension["name"], extension["description"], extension["version"], extension["filename"], extension["preferences"]))
+
self.dlg.set_transient_for(self.parent.window)
self.dlg.show()
@@ -137,7 +140,8 @@
def OnSelect(self, tree):
"""
When an Extension is selected, enables/disables the preferences button
- according to the reported Extension capabilities.
+ according to the reported Extension capabilities and updates the
+ description label.
Parameters:
tree -- GTKTreeView holding the Extensions's representation.
@@ -149,6 +153,8 @@
else:
self.prefs_button.set_sensitive(False)
+ descr_text = self.model.get_value(selection, 2)
+ self.description.set_text(descr_text)
#_____________________________________________________________________
def OnAdd(self, button):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]