~thomas-deruyter-3/qreator/qreator

« back to all changes in this revision

Viewing changes to qreator/__init__.py

Merged fix for Quicklist entries to work again (bug 1016826)

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
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 
 
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
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 
 
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
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 
 
12
#
 
13
# You should have received a copy of the GNU General Public License along
14
14
# with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
### END LICENSE
16
16
 
44
44
    parser.add_option(
45
45
        "-w", "--wifi", dest="view", action="store_const", const="wifi",
46
46
        help=UTF8_("Create a QR code for WiFi settings"))
 
47
    parser.add_option(
 
48
        "-s", "--software", dest="view", action="store_const", const="software",
 
49
        help=UTF8_("Create a QR code for an app from the software-center"))
 
50
    parser.add_option(
 
51
        "-b", "--businesscard", dest="view", action="store_const", const="vcard",
 
52
        help=UTF8_("Create a QR code for a business card"))
47
53
    (options, args) = parser.parse_args()
48
54
 
49
55
    set_up_logging(options)
59
65
    window.show()
60
66
    if getattr(options, 'view', None) is not None:
61
67
        if options.view == 'url':
62
 
            window.on_qr_url_clicked()
 
68
            qr_id = 0
63
69
        elif options.view == 'text':
64
 
            window.on_qr_text_clicked()
 
70
            qr_id = 1
65
71
        elif options.view == 'location':
66
 
            window.on_qr_location_clicked()
 
72
            qr_id = 2
67
73
        elif options.view == 'wifi':
68
 
            window.on_qr_wifi_clicked()
 
74
            qr_id = 3
 
75
        elif options.view == 'vcard':
 
76
            qr_id = 4
 
77
        elif options.view == 'software':
 
78
            qr_id = 5
 
79
        window.switch_qrcode_view(qr_id)
69
80
        window.ui.notebook1.set_current_page(QreatorWindow.PAGE_QR)
70
81
    Gtk.main()