pygtk 2.4 is now in debian distribution, so I use it (color button in particular)

This commit is contained in:
Yann Leboulanger 2004-10-11 21:03:34 +00:00
parent 9d2304a625
commit 76e4d6042d
2 changed files with 182 additions and 200 deletions

View File

@ -3653,204 +3653,6 @@ on the server.</property>
<widget class="GtkFixed" id="fixed3">
<property name="visible">True</property>
<child>
<widget class="GtkFrame" id="frame8">
<property name="width_request">200</property>
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
<widget class="GtkTable" id="table5">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">10</property>
<property name="column_spacing">3</property>
<child>
<widget class="GtkLabel" id="label70">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Outgoing Messages</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label71">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Status Messages</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label72">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Incoming Messages</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="colorOut">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_but_col_clicked" last_modification_time="Sun, 28 Dec 2003 23:54:58 GMT"/>
<child>
<widget class="GtkDrawingArea" id="drawing_out">
<property name="width_request">40</property>
<property name="height_request">20</property>
<property name="visible">True</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="colorStatus">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_but_col_clicked" last_modification_time="Sun, 28 Dec 2003 23:55:09 GMT"/>
<child>
<widget class="GtkDrawingArea" id="drawing_status">
<property name="width_request">40</property>
<property name="height_request">20</property>
<property name="visible">True</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="colorIn">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_but_col_clicked" last_modification_time="Sun, 28 Dec 2003 23:54:43 GMT"/>
<child>
<widget class="GtkDrawingArea" id="drawing_in">
<property name="width_request">40</property>
<property name="height_request">20</property>
<property name="visible">True</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label73">
<property name="visible">True</property>
<property name="label" translatable="yes">Color</property>
<property name="use_underline">False</property>
<property name="use_markup">False</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>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="x">0</property>
<property name="y">0</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame13">
<property name="width_request">144</property>
@ -3981,6 +3783,177 @@ on the server.</property>
<property name="y">0</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame8">
<property name="width_request">200</property>
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
<widget class="GtkTable" id="table5">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">10</property>
<property name="column_spacing">3</property>
<child>
<widget class="GtkLabel" id="label70">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Outgoing Messages</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label71">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Status Messages</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label72">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Incoming Messages</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkColorButton" id="colorbutton_in">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkColorButton" id="colorbutton_out">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkColorButton" id="colorbutton_status">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label73">
<property name="visible">True</property>
<property name="label" translatable="yes">Color</property>
<property name="use_underline">False</property>
<property name="use_markup">False</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>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="x">0</property>
<property name="y">0</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>

View File

@ -2343,8 +2343,6 @@ class plugin:
def __init__(self, quIN, quOUT):
gtk.gdk.threads_init()
#in pygtk2.4
#gtk.window_set_default_icon(??pixbuf??)
# gtk.gdk.threads_enter()
self.queueIN = quIN
self.queueOUT = quOUT
@ -2384,6 +2382,17 @@ class plugin:
#2:autoaway and use sleeper
#3:autoxa and use sleeper
self.send('ASK_ROSTER', a, self.queueIN)
#in pygtk2.4
iconstyle = self.config['iconstyle']
if not iconstyle:
iconstyle = 'sun'
path = 'plugins/gtkgui/icons/' + iconstyle + '/'
files = [path + 'online.gif', path + 'online.png', path + 'online.xpm']
for file in files:
if os.path.exists(file):
pix = gtk.gdk.pixbuf_new_from_file(file)
break
gtk.window_set_default_icon(pix)
self.roster = roster_Window(self)
gtk.timeout_add(100, self.read_queue)
gtk.timeout_add(1000, self.read_sleepy)