Example #1
0
def parse_options():
    """Support for command line options"""
    parser = optparse.OptionParser(version="%%prog %s" % get_version())
    parser.add_option(
        "-v", "--verbose", action="count", dest="verbose", help=_("Show debug messages (-vv debugs maps_lib also)")
    )
    (options, args) = parser.parse_args()

    set_up_logging(options)
Example #2
0
    def __init__(self, files):
        Gtk.Application.__init__(self, application_id=self.BASE_KEY,
                flags=Gio.ApplicationFlags.HANDLES_OPEN)

        self.settings = Gio.Settings.new(self.BASE_KEY)
        self.latitude = self.settings.get_double("latitude")
        self.longitude = self.settings.get_double("longitude")
        self.zoom = self.settings.get_int("zoom")

        self.embed = GtkChamplain.Embed()
        self.view = self.embed.get_view()
        self.view.set_kinetic_mode(True)
        self.view.set_zoom_level(self.zoom)
        self.view.center_on(self.latitude, self.longitude)
        scale = Champlain.Scale()
        scale.connect_view(self.view)
        self.view.bin_layout_add(scale, Clutter.BinAlignment.START,
                Clutter.BinAlignment.END)

        self.files = files
        tempdir = tempfile.gettempdir()
        self.icon_cache = os.path.join(tempdir, "maps-icon-cache")
        if not os.path.exists(self.icon_cache):
            os.makedirs(self.icon_cache)

        #######
        # About
        #######

        self.about = Gtk.AboutDialog()
        self.about.set_program_name(_("Maps"))
        self.about.set_title(_("About Maps"))
        self.about.set_authors(["Sigurd Gartmann <*****@*****.**>"])
        self.about.set_copyright(_("Copyright © 2012 Sigurd Gartmann <*****@*****.**>"))
        self.about.set_wrap_license(True)
        self.about.set_comments(_(
        "Early works on a generic map application for Gnome or Ubuntu.\n\n"

        "This application uses Mapquest Open for search and directions search,"
        "and standard tiles from Openstreetmap. I'm a mapper myself, and I think"
        "there is room for an application like this.\n\n"

        "It will also show GPX tracks if you drag them to the Ubuntu launcher or"
        "to an open program.\n\n"

        "When viewing results, in most cases a single click in the result"
        "listing will highlight the result. For searches, a double click will"
        "save the location to 'My places'. During directions search, a double"
        "click in the results will set proper locations to be able to search for"
        "directions."
        ))
        #self.about.set_license("GPL 3+")
        self.about.set_version(get_version())

        self.about.connect("response", self.dialog_response)