~dpm/qreator/snap

« back to all changes in this revision

Viewing changes to qreator/qrcodes/QRCodeSoftwareCenterApp.py

  • Committer: David Planella
  • Date: 2016-06-13 19:13:29 UTC
  • mfrom: (189.1.1 qreator)
  • Revision ID: david.planella@ubuntu.com-20160613191329-jcmx0ioq7opvpjs1
Merged fix for QR code not being generated in Ubuntu 16.04

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
 
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/>.
 
15
### END LICENSE
 
16
 
 
17
from qreator_lib import VendorError
 
18
import platform
 
19
 
 
20
 
 
21
# This is a vendor-specific plugin
 
22
if not platform.linux_distribution()[0] == "Ubuntu":
 
23
    raise VendorError
 
24
 
 
25
from qreator_lib.i18n import _
 
26
from QRCodeType import QRCodeType
 
27
from QRCodeSoftwareCenterAppGtk import QRCodeSoftwareCenterAppGtk
 
28
 
 
29
 
 
30
class QRCodeSoftwareCenterApp(QRCodeType):
 
31
    description = _('Ubuntu Software Center app')
 
32
    icon_name = 'softwarecentre.png'
 
33
    cmdline_option_long = "--software"
 
34
    cmdline_option_short = "-s"
 
35
    message = _("Create a QR code for an app from the Software Center")
 
36
 
 
37
    def create_widget(self):
 
38
        self.widget = QRCodeSoftwareCenterAppGtk(self.qr_code_update_func)