~thomas-deruyter-3/qreator/qreator

« back to all changes in this revision

Viewing changes to qreator/QreatorWindow.py

  • Committer: David Planella
  • Date: 2012-06-02 09:17:40 UTC
  • mfrom: (81.1.2 qreator_bug1006630)
  • Revision ID: david.planella@ubuntu.com-20120602091740-3rbrviz5mqb1dre6
Merged lp:~stefan-schwarzburg/qreator/qreator:

* Fixes lp:1006630 'Resize QR input widgets'
* Additional changes to merge proposal:
  * Added Stefan Schwarzburg to autors credits
  * Added margins to qr_input box
  * Disabled automatic resizing of QR code

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        self.curr_width = 0
106
106
 
107
107
        for qr_type in self.qr_types:
108
 
            self.ui.qr_input_notebook.append_page(qr_type.widget.grid, None)
109
 
 
110
 
        self.ui.qr_input_notebook.connect("switch-page",
111
 
            self.on_qr_input_notebook_switch_page)
112
 
 
113
 
    def on_qr_input_notebook_switch_page(self, widget, label, page):
114
 
        for p in range(widget.get_n_pages()):
115
 
            container = widget.get_nth_page(p)
116
 
            if not p == page:
117
 
                for c in container.get_children():
118
 
                    try:
119
 
                        c.hide_all()
120
 
                    except AttributeError:
121
 
                        c.hide()
122
 
            else:
123
 
                for c in container.get_children():
124
 
                    try:
125
 
                        c.show_all()
126
 
                    except AttributeError:
127
 
                        c.show()
 
108
            self.ui.qr_input_box.add(qr_type.widget.grid)
128
109
 
129
110
    def fill_qr_types_store(self):
130
111
        self.qr_types_store.clear()
161
142
            "\nhttp://about.me/david.planella")
162
143
        about.set_website("https://launchpad.net/qreator")
163
144
 
164
 
        about.set_version('12.05.6')
 
145
        about.set_version('12.05.7-dev')
165
146
        about.set_authors([
166
147
            'David Planella <david.planella@ubuntu.com>',
167
148
            'Michael Hall <mhall119@ubuntu.com>',
168
 
            'Andrew Starr-Bochicchio <andrewsomething@ubuntu.com >',
 
149
            'Andrew Starr-Bochicchio <andrewsomething@ubuntu.com>',
 
150
            'Stefan Schwarzburg <stefan.schwarzburg@googlemail.com>',
169
151
            ])
170
152
        about.set_license(_('Distributed under the GPL v3 license.') +
171
153
                '\nhttp://www.opensource.org/licenses/gpl-3.0.html')
204
186
        self.qr_types[qr_id].widget.on_activated()
205
187
 
206
188
        self.ui.notebook1.set_current_page(PAGE_QR)
207
 
        self.ui.qr_input_notebook.set_current_page(qr_id)
 
189
 
 
190
        for child in self.ui.qr_input_box.get_children():
 
191
            child.hide()
 
192
        self.ui.qr_input_box.get_children()[qr_id].show()
208
193
 
209
194
##########################################
210
195
 
316
301
 
317
302
        if not text == '':
318
303
            ## Create the QR code
319
 
            qr_code = QRCode()
 
304
            qr_code = QRCode()  # output_size = int(min(width, height) * 0.9))
320
305
            self.surface = qr_code.encode(text, QRCodeOutput.CAIRO_SURFACE)
321
306
 
322
307
            # Center the image in the drawing area