~dpm/qreator/snap

« back to all changes in this revision

Viewing changes to qreator_lib/Builder.py

  • Committer: David Planella
  • Date: 2012-05-17 08:12:32 UTC
  • Revision ID: david.planella@ubuntu.com-20120517081232-uq92gvxfji2v68gi
First working version ready for release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
2
### BEGIN LICENSE
3
 
# Copyright (C) 2012 David Planella <david.planella@ubuntu.com>
4
 
# This program is free software: you can redistribute it and/or modify it 
5
 
# under the terms of the GNU General Public License version 3, as published 
6
 
# by the Free Software Foundation.
7
 
8
 
# This program is distributed in the hope that it will be useful, but 
9
 
# WITHOUT ANY WARRANTY; without even the implied warranties of 
10
 
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
11
 
# PURPOSE.  See the GNU General Public License for more details.
12
 
13
 
# You should have received a copy of the GNU General Public License along 
14
 
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
3
# This file is in the public domain
15
4
### END LICENSE
16
5
 
17
 
### DO NOT EDIT THIS FILE ###
18
 
 
19
6
'''Enhances builder connections, provides object to access glade objects'''
20
7
 
21
8
from gi.repository import GObject, Gtk # pylint: disable=E0611
275
262
        # Now, automatically find any the user didn't specify in glade
276
263
        for sig in signal_names:
277
264
            # using convention suggested by glade
278
 
            sig = sig.replace("-", "_")
279
 
            handler_names = ["on_%s_%s" % (widget_name, sig)]
 
265
            sigpy = sig.replace("-", "_")
 
266
            handler_names = ["on_%s_%s" % (widget_name, sigpy)]
280
267
 
281
268
            # Using the convention that the top level window is not
282
269
            # specified in the handler name. That is use
283
270
            # on_destroy() instead of on_windowname_destroy()
284
271
            if widget is callback_obj:
285
 
                handler_names.append("on_%s" % sig)
 
272
                handler_names.append("on_%s" % sigpy)
286
273
 
287
274
            do_connect(item, sig, handler_names,
288
275
             callback_handler_dict, builder.connections)