Пример #1
0
        def _status_save(conf):
            def status_combo(active_type_id):
                hbox = gtk.HBox(False, 10)
                hbox.pack_start(lbl(" Select status bar type "))
                self.cmb_status_type = gtk.combo_box_new_text()
                for strType in STATUS_TYPE:
                    self.cmb_status_type.append_text(strType)
                self.cmb_status_type.set_active(active_type_id)
                hbox.pack_start(self.cmb_status_type)
                return hbox

            def save_checkbox(active_bool):
                self.save_at_close_button = \
                        gtk.CheckButton(" Save View Params ")
                self.save_at_close_button.set_active(active_bool)
                return self.save_at_close_button

            status = myFrame(" Location Status ",
                             status_combo(conf.statusbar_type))
            save = myFrame(" Close Settings ",
                           save_checkbox(conf.save_at_close))
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(save)
            hbox.pack_start(status)
            return hbox
Пример #2
0
        def _color_debug():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Color:"))

            self.store = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING)

            options = [["red", "marker_combo_red.png"],
                       ["blue", "marker_combo_blue.png"],
                       ["yellow", "marker_combo_yellow.png"],
                       ["green", "marker_combo_green.png"],
                       ["camera_purple", "camera_combo_purple.png"]]

            self._marker_color = gtk.ComboBox(self.store)

            self._marker_color.set_active(1)
            cell = gtk.CellRendererText()
            self._marker_color.pack_start(cell, True)
            self._marker_color.add_attribute(cell, 'text', 1)

            cell = gtk.CellRendererPixbuf()
            self._marker_color.pack_start(cell, True)
            self._marker_color.add_attribute(cell, 'pixbuf', 0)

            markers = MyMarkers()
            for color, img in options:
                iter = self.store.append()
                pixbuf = markers.get_marker_pixbuf(15, img)
                self.store.set(iter, 0, pixbuf, 1, color)

            self._marker_color.set_active(1)
            hbox.pack_start(self._marker_color, False)
            vbox.pack_start(hbox)

            return myFrame(" Color", vbox)
Пример #3
0
 def gps_max_zoom(self, max_gps_zoom):
     hbox = gtk.HBox(False, 10)
     hbox.pack_start(lbl("Here you can set the maximum zoom for the GPS: "))
     self.s_gps_max_zoom = SpinBtn(max_gps_zoom, MAP_MIN_ZOOM_LEVEL,
                                   MAP_MAX_ZOOM_LEVEL - 1)
     hbox.pack_start(self.s_gps_max_zoom)
     return myFrame(" GPS Max Zoom ", hbox)
Пример #4
0
    def service_combo(self, conf):
        vbox = gtk.VBox(False, 5)
        hbox = gtk.HBox(False, 10)
        hbox.pack_start(lbl("Select your favorite map service: "))
        self.cmb_service = gtk.combo_box_new_text()
        intActive = 0
        bad_map_servers = conf.hide_map_servers.split(',')
        for intPos in range(len(MAP_SERVERS)):
            if not str(intPos) in bad_map_servers:
                self.cmb_service.append_text(MAP_SERVERS[intPos])
                if MAP_SERVERS[intPos] == conf.map_service:
                    intActive = len(self.cmb_service.get_model()) - 1
        self.cmb_service.set_active(intActive)
        hbox.pack_start(self.cmb_service)
        vbox.pack_start(hbox)

        # Check box for option to create a dir per Map service
        hbox = gtk.HBox()
        self.cb_oneDirPerMap = gtk.CheckButton("Use a different folder per Map Service")
        self.cb_oneDirPerMap.set_active(conf.oneDirPerMap)
        hbox.pack_start(self.cb_oneDirPerMap)

        event_box = gtk.EventBox()
        label = gtk.Label()
        label.set_text("<span foreground=\"blue\" underline=\"single\">Select Map Servers</span>")
        label.set_use_markup(True)
        event_box.add(label)
        event_box.set_events(gtk.gdk.BUTTON_PRESS_MASK)
        event_box.connect("button_press_event", self.open_editor)
        hbox.pack_start(event_box)
        vbox.pack_start(hbox)
        return myFrame(" Map service ", vbox)
Пример #5
0
    def service_combo(self, conf):
        vbox = gtk.VBox(False, 5)
        hbox = gtk.HBox(False, 10)
        hbox.pack_start(lbl("Select your favorite map service: "))
        self.cmb_service = gtk.combo_box_new_text()
        intActive = 0
        bad_map_servers = conf.hide_map_servers.split(',')
        for intPos in range(len(MAP_SERVERS)):
            if not str(intPos) in bad_map_servers:
                self.cmb_service.append_text(MAP_SERVERS[intPos])
                if MAP_SERVERS[intPos] == conf.map_service:
                    intActive = len(self.cmb_service.get_model()) - 1
        self.cmb_service.set_active(intActive)
        hbox.pack_start(self.cmb_service)
        vbox.pack_start(hbox)

        # Check box for option to create a dir per Map service
        hbox = gtk.HBox()
        self.cb_oneDirPerMap = gtk.CheckButton(
            "Use a different folder per Map Service")
        self.cb_oneDirPerMap.set_active(conf.oneDirPerMap)
        hbox.pack_start(self.cb_oneDirPerMap)

        event_box = gtk.EventBox()
        label = gtk.Label()
        label.set_text(
            "<span foreground=\"blue\" underline=\"single\">Select Map Servers</span>"
        )
        label.set_use_markup(True)
        event_box.add(label)
        event_box.set_events(gtk.gdk.BUTTON_PRESS_MASK)
        event_box.connect("button_press_event", self.open_editor)
        hbox.pack_start(event_box)
        vbox.pack_start(hbox)
        return myFrame(" Map service ", vbox)
Пример #6
0
    def show(self, conf):
        def inner_box():
            vbox = gtk.VBox(False, 10)
            vbox.pack_start(self.scale_cross_element(conf.scale_visible, conf.show_cross))
            vbox.pack_start(self.service_combo(conf.map_service, conf.oneDirPerMap))
            hbox = gtk.HBox(False, 10)
            hbox.set_border_width(20)
            hbox.pack_start(vbox)
            return hbox

        vbox = gtk.VBox(False, 10)
        vbox.set_border_width(10)
        hbox = gtk.HBox(False, 10)
        hbox.pack_start(lbl("Select new theme and restart GMapCatcher."))
        self.cmb_themes = gtk.combo_box_new_text()

        self.load_combo(self.cmb_themes)
        hbox.pack_start(self.cmb_themes)
        vbox.pack_start(myFrame(" Available themes ", hbox), False)
        vbox.pack_start(inner_box(), False)

        hpaned = gtk.VPaned()
        hpaned.pack1(vbox, True, True)
        buttons = self.__action_buttons(conf)
        hpaned.connect('key-press-event', self.key_press, conf)
        hpaned.pack2(buttons, False, False)
        return hpaned
Пример #7
0
 def gps_max_zoom(self, max_gps_zoom):
     hbox = gtk.HBox(False, 10)
     hbox.pack_start(lbl("Here you can set the maximum zoom for the GPS: "))
     self.s_gps_max_zoom = SpinBtn(max_gps_zoom,
             MAP_MIN_ZOOM_LEVEL, MAP_MAX_ZOOM_LEVEL-1)
     hbox.pack_start(self.s_gps_max_zoom)
     return myFrame(" GPS Max Zoom ", hbox)
Пример #8
0
 def _offline(active):
     hbox = gtk.HBox(False, 10)
     self.cmb_start_offline = gtk.combo_box_new_text()
     self.cmb_start_offline.append_text('no')
     self.cmb_start_offline.append_text('yes')
     self.cmb_start_offline.set_active(active)
     hbox.pack_start(self.cmb_start_offline)
     return myFrame(" Start offline ", hbox)
Пример #9
0
 def _offline(active):
     hbox = gtk.HBox(False, 10)
     self.cmb_start_offline = gtk.combo_box_new_text()
     self.cmb_start_offline.append_text('no')
     self.cmb_start_offline.append_text('yes')
     self.cmb_start_offline.set_active(active)
     hbox.pack_start(self.cmb_start_offline)
     return myFrame(" Start offline ", hbox)
Пример #10
0
 def _units(active):
     hbox = gtk.HBox(False, 10)
     self.cmb_unit_type = gtk.combo_box_new_text()
     for i in range(len(DISTANCE_UNITS)):
         self.cmb_unit_type.append_text('%s / %s' % (DISTANCE_UNITS[i], SPEED_UNITS[i]))
     self.cmb_unit_type.set_active(active)
     hbox.pack_start(self.cmb_unit_type)
     return myFrame(" Select units ", hbox)
Пример #11
0
        def _angle2():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("angle:"))
            self.angle2 = myEntry("%.9g" % 0, 10, False)
            hbox.pack_start(self.angle2, False)
            vbox.pack_start(hbox)

            return myFrame(" angle 2", vbox)
Пример #12
0
 def general_gps_box():
     self.boxes = [self.gps_type_combo(), self.gps_updt_rate(conf.gps_update_rate),
             self.gps_max_zoom(conf.max_gps_zoom), self.gps_mode_combo(conf.gps_mode)]
     vbox = gtk.VBox(False, 5)
     for box in self.boxes:
         hbox = gtk.HBox(False, 10)
         hbox.pack_start(box)
         vbox.pack_start(hbox)
     return myFrame(" GPS ", vbox)
Пример #13
0
 def gps_mode_combo(self, gps_mode):
     hbox = gtk.HBox(False, 10)
     hbox.pack_start(lbl("Select your initial GPS mode: "))
     self.cmb_gps_mode = gtk.combo_box_new_text()
     for strMode in GPS_NAMES:
         self.cmb_gps_mode.append_text(strMode)
     self.cmb_gps_mode.set_active(gps_mode)
     hbox.pack_start(self.cmb_gps_mode)
     return myFrame(" GPS Mode ", hbox)
Пример #14
0
 def _units(active):
     hbox = gtk.HBox(False, 10)
     self.cmb_unit_type = gtk.combo_box_new_text()
     for i in range(len(DISTANCE_UNITS)):
         self.cmb_unit_type.append_text(
             '%s / %s' % (DISTANCE_UNITS[i], SPEED_UNITS[i]))
     self.cmb_unit_type.set_active(active)
     hbox.pack_start(self.cmb_unit_type)
     return myFrame(" Select units ", hbox)
Пример #15
0
 def gps_mode_combo(self, gps_mode):
     hbox = gtk.HBox(False, 10)
     hbox.pack_start(lbl("Select your initial GPS mode: "))
     self.cmb_gps_mode = gtk.combo_box_new_text()
     for strMode in GPS_NAMES:
         self.cmb_gps_mode.append_text(strMode)
     self.cmb_gps_mode.set_active(gps_mode)
     hbox.pack_start(self.cmb_gps_mode)
     return myFrame(" GPS Mode ", hbox)
Пример #16
0
        def _compass():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("compass:"******"%.6g" % 0, 10, False)
            hbox.pack_start(self._compass, False)
            vbox.pack_start(hbox)
            self._compass.connect("changed", _update_target_cb)

            return myFrame(" Compass", vbox)
Пример #17
0
        def _distance():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("distance:"))
            self._distance = myEntry("%.6g" % 0, 10, False)
            hbox.pack_start(self._distance, False)
            vbox.pack_start(hbox)
            self._distance.connect("changed", _update_target_cb)

            return myFrame(" Distance", vbox)
Пример #18
0
        def _size(width, height):
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Width:"), False)
            self.s_width = SpinBtn(width, 450, 1024, 100, 4)
            hbox.pack_start(self.s_width)

            hbox.pack_start(lbl("Height:"), False)
            self.s_height = SpinBtn(height, 400, 768, 100, 4)
            hbox.pack_start(self.s_height)
            return myFrame(" Size ", hbox)
Пример #19
0
        def _markerName():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Choose Name:"))
            self._marker_name = gtk.Entry()
            self._marker_name.set_text("")
            hbox.pack_start(self._marker_name, False)
            vbox.pack_start(hbox)

            return myFrame(" Marker Name", vbox)
        def _size(width, height):
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Width:"), False)
            self.s_width = SpinBtn(width, 450, 1024, 100, 4)
            hbox.pack_start(self.s_width)

            hbox.pack_start(lbl("Height:"), False)
            self.s_height = SpinBtn(height, 400, 768, 100, 4)
            hbox.pack_start(self.s_height)
            return myFrame(" Size ", hbox)
Пример #21
0
        def _end_point_height():
            mapElevation = MapElevation()
            height = mapElevation.getHeight(end_point)
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("высота:"))
            self.azimuth = myEntry(str(height), 10, False)
            hbox.pack_start(self.azimuth, False)
            vbox.pack_start(hbox)

            return myFrame("цель", vbox)
Пример #22
0
 def gps_serial_box():
     vbox = gtk.VBox(False, 5)
     if serialAvailable:
         boxes = [self.gps_serial_port_combo(conf.gps_serial_port), self.gps_baudrate_combo(conf.gps_serial_baudrate)]
         for box in boxes:
             hbox = gtk.HBox(False, 10)
             hbox.pack_start(box)
             vbox.pack_start(hbox)
     else:
         vbox.pack_start(lbl('Install python-serial to use serial GPS.'))
     return myFrame(" Serial ", vbox)
Пример #23
0
 def general_gps_box():
     self.boxes = [
         self.gps_type_combo(),
         self.gps_updt_rate(conf.gps_update_rate),
         self.gps_max_zoom(conf.max_gps_zoom),
         self.gps_mode_combo(conf.gps_mode)
     ]
     vbox = gtk.VBox(False, 5)
     for box in self.boxes:
         hbox = gtk.HBox(False, 10)
         hbox.pack_start(box)
         vbox.pack_start(hbox)
     return myFrame(" GPS ", vbox)
Пример #24
0
        def _center(lat0, lon0):
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("latitude:"))
            self.e_lat0 = myEntry("%.6f" % lat0, 15, False)
            hbox.pack_start(self.e_lat0, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("longitude:"))
            self.e_lon0 = myEntry("%.6f" % lon0, 15, False)
            hbox.pack_start(self.e_lon0, False)
            vbox.pack_start(hbox)
            return myFrame(" Center ", vbox)
 def _language(old_lang="en"):
     vbox = gtk.VBox(False, 5)
     combo = gtk.combo_box_new_text()
     nr = -1
     df = 0
     for lang in LANGUAGES:
         nr = nr + 1
         combo.append_text(lang)
         if (lang == old_lang):
             df = nr
     combo.set_active(df)
     vbox.pack_start(combo)
     self.s_language = combo
     return myFrame(" Language ", vbox)
Пример #26
0
        def _target_sk42():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Latitude:"))
            self._target_sk42_Lat = myEntry("%.9g" % 0, 10, False)
            hbox.pack_start(self._target_sk42_Lat, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Longitude:"))
            self._target_sk42_Lon = myEntry("%.9g" % 0, 10, False)
            hbox.pack_start(self._target_sk42_Lon, False)
            vbox.pack_start(hbox)
            return myFrame(" Target sk42", vbox)
Пример #27
0
        def _area(kmx, kmy):
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("width:"))
            self.e_kmx = myEntry("%.6g" % kmx, 10, False)
            hbox.pack_start(self.e_kmx, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("height:"))
            self.e_kmy = myEntry("%.6g" % kmy, 10, False)
            hbox.pack_start(self.e_kmy, False)
            vbox.pack_start(hbox)
            return myFrame(" Area (km) ", vbox)
Пример #28
0
 def _language(old_lang="en"):
     vbox = gtk.VBox(False, 5)
     combo = gtk.combo_box_new_text()
     nr = -1
     df = 0
     for lang in LANGUAGES:
         nr = nr + 1
         combo.append_text(lang)
         if (lang == old_lang):
             df = nr
     combo.set_active(df)
     vbox.pack_start(combo)
     self.s_language = combo
     return myFrame(" Language ", vbox)
        def _area(kmx, kmy):
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("width:"))
            self.e_kmx = myEntry("%.6g" % kmx, 10, False)
            hbox.pack_start(self.e_kmx, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("height:"))
            self.e_kmy = myEntry("%.6g" % kmy, 10, False)
            hbox.pack_start(self.e_kmy, False)
            vbox.pack_start(hbox)
            return myFrame(" Area (km) ", vbox)
        def _center(lat0, lon0):
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("latitude:"))
            self.e_lat0 = myEntry("%.6f" % lat0, 15, False)
            hbox.pack_start(self.e_lat0, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("longitude:"))
            self.e_lon0 = myEntry("%.6f" % lon0, 15, False)
            hbox.pack_start(self.e_lon0, False)
            vbox.pack_start(hbox)
            return myFrame(" Center ", vbox)
Пример #31
0
 def gps_serial_box():
     vbox = gtk.VBox(False, 5)
     if serialAvailable:
         boxes = [
             self.gps_serial_port_combo(conf.gps_serial_port),
             self.gps_baudrate_combo(conf.gps_serial_baudrate)
         ]
         for box in boxes:
             hbox = gtk.HBox(False, 10)
             hbox.pack_start(box)
             vbox.pack_start(hbox)
     else:
         vbox.pack_start(
             lbl('Install python-serial to use serial GPS.'))
     return myFrame(" Serial ", vbox)
Пример #32
0
        def _status_save(conf):
            def status_combo(active_type_id):
                hbox = gtk.HBox(False, 10)
                hbox.pack_start(lbl(" Select status bar type "))
                self.cmb_status_type = gtk.combo_box_new_text()
                for strType in STATUS_TYPE:
                    self.cmb_status_type.append_text(strType)
                self.cmb_status_type.set_active(active_type_id)
                hbox.pack_start(self.cmb_status_type)
                return hbox

            def save_checkbox(active_bool):
                self.save_at_close_button = \
                        gtk.CheckButton(" Save View Params ")
                self.save_at_close_button.set_active(active_bool)
                return self.save_at_close_button
            status = myFrame(" Location Status ",
                            status_combo(conf.statusbar_type))
            save = myFrame(" Close Settings ",
                          save_checkbox(conf.save_at_close))
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(save)
            hbox.pack_start(status)
            return hbox
Пример #33
0
    def gps_track_settings(self, gps_track, track_width, track_interval):
        self.cb_gps_track = gtk.CheckButton('Draw GPS track')
        self.cb_gps_track.set_active(gps_track)
        self.sb_gps_track_width = SpinBtn(track_width, 1, 20, 1, 2)
        self.sb_gps_track_interval = SpinBtn(track_interval, 1, 1000, 10, 4)

        vbox = gtk.VBox(False, 10)
        hbox = gtk.HBox(False, 10)
        hbox.pack_start(self.cb_gps_track)
        hbox.pack_start(lbl("Track width: "))
        hbox.pack_start(self.sb_gps_track_width)
        hbox.pack_start(lbl("Point interval (in meters): "))
        hbox.pack_start(self.sb_gps_track_interval)
        vbox.pack_start(hbox)
        return myFrame(" GPS track ", vbox)
Пример #34
0
    def gps_track_settings(self, gps_track, track_width, track_interval):
        self.cb_gps_track = gtk.CheckButton('Log GPS track')
        self.cb_gps_track.set_active(gps_track)
        self.sb_gps_track_width = SpinBtn(track_width, 1, 20, 1, 2)
        self.sb_gps_track_interval = SpinBtn(track_interval, 1, 1000, 10, 4)

        vbox = gtk.VBox(False, 10)
        hbox = gtk.HBox(False, 10)
        hbox.pack_start(self.cb_gps_track)
        hbox.pack_start(lbl("Track width: "))
        hbox.pack_start(self.sb_gps_track_width)
        hbox.pack_start(lbl("Point interval (in meters): "))
        hbox.pack_start(self.sb_gps_track_interval)
        vbox.pack_start(hbox)
        return myFrame(" GPS track ", vbox)
Пример #35
0
        def _second_point():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("широта:"))
            self.entry = myEntry("%.6f" % second_point[0], 10, False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("долгота:"))
            self.entry = myEntry("%.6f" % second_point[1], 10, False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            return myFrame("цель", vbox)
Пример #36
0
        def _first_point():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("широта:"))
            self.entry = myEntry("%.6f" % first_point[0], 10, False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("долгота:"))
            self.distance = myEntry("%.6f" % first_point[1], 10, False)
            hbox.pack_start(self.distance, False)
            vbox.pack_start(hbox)

            return myFrame("базовая точка", vbox)
 def _center(center):
     hbox = gtk.HBox(False, 0)
     hbox.pack_start(lbl(" (( "), False)
     self.s_center00 = SpinBtn(center[0][0], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center00, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center01 = SpinBtn(center[0][1], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center01, False)
     hbox.pack_start(lbl(" ), ( "), False)
     self.s_center10 = SpinBtn(center[1][0], 0, 256, 32, 3)
     hbox.pack_start(self.s_center10, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center11 = SpinBtn(center[1][1], 0, 256, 32, 3)
     hbox.pack_start(self.s_center11, False)
     hbox.pack_start(lbl(" )) "), False)
     return myFrame(" Center ", hbox)
Пример #38
0
 def _center(center):
     hbox = gtk.HBox(False, 0)
     hbox.pack_start(lbl(" (( "), False)
     self.s_center00 = SpinBtn(center[0][0], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center00, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center01 = SpinBtn(center[0][1], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center01, False)
     hbox.pack_start(lbl(" ), ( "), False)
     self.s_center10 = SpinBtn(center[1][0], 0, 256, 32, 3)
     hbox.pack_start(self.s_center10, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center11 = SpinBtn(center[1][1], 0, 256, 32, 3)
     hbox.pack_start(self.s_center11, False)
     hbox.pack_start(lbl(" )) "), False)
     return myFrame(" Center ", hbox)
Пример #39
0
        def _target_wgs84():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Latitude:"))
            self._target_wgs84_Lat = myEntry("%.9g" % 0, 10, False)
            hbox.pack_start(self._target_wgs84_Lat, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Longitude:"))
            self._target_wgs84_Lon = myEntry("%.9g" % 0, 10, False)
            hbox.pack_start(self._target_wgs84_Lon, False)
            vbox.pack_start(hbox)

            self._target_wgs84_Lon.connect("changed", _target_wg84_changed)
            self._target_wgs84_Lat.connect("changed", _target_wg84_changed)

            return myFrame(" Target Wgs84", vbox)
Пример #40
0
 def _center(center):
     hbox = gtk.HBox(False, 0)
     hbox.pack_start(lbl(" (( "), False)
     self.s_center00 = SpinBtn(center[0][0], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center00, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center01 = SpinBtn(center[0][1], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center01, False)
     hbox.pack_start(lbl(" ), ( "), False)
     self.s_center10 = SpinBtn(center[1][0], 0, 256, 32, 3)
     hbox.pack_start(self.s_center10, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center11 = SpinBtn(center[1][1], 0, 256, 32, 3)
     hbox.pack_start(self.s_center11, False)
     hbox.pack_start(lbl(" )) "), False)
     button = gtk.Button("Use Current")
     button.connect('clicked', btn_use_current, parent)
     hbox.pack_start(button)
     return myFrame(" Center ", hbox)
Пример #41
0
 def _center(center):
     hbox = gtk.HBox(False, 0)
     hbox.pack_start(lbl(" (( "), False)
     self.s_center00 = SpinBtn(center[0][0], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center00, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center01 = SpinBtn(center[0][1], 0, 999999, 1, 6)
     hbox.pack_start(self.s_center01, False)
     hbox.pack_start(lbl(" ), ( "), False)
     self.s_center10 = SpinBtn(center[1][0], 0, 256, 32, 3)
     hbox.pack_start(self.s_center10, False)
     hbox.pack_start(lbl(" ,  "), False)
     self.s_center11 = SpinBtn(center[1][1], 0, 256, 32, 3)
     hbox.pack_start(self.s_center11, False)
     hbox.pack_start(lbl(" )) "), False)
     button = gtk.Button("Use Current")
     button.connect('clicked', btn_use_current, parent)
     hbox.pack_start(button)
     return myFrame(" Center ", hbox)
        def custom_path(conf):
            def repository_type_combo(repos_type_id):
                self.cmb_repos_type = gtk.combo_box_new_text()
                for strMode in REPOS_TYPE:
                    self.cmb_repos_type.append_text(strMode)
                self.cmb_repos_type.set_active(repos_type_id)
                return self.cmb_repos_type

            def get_folder(button):
                folderName = FolderChooser()
                if folderName:
                    self.entry_custom_path.set_text(folderName)

            def set_folder(button):
                self.cmb_repos_type.set_active(REPOS_TYPE_FILES)
                self.entry_custom_path.set_text(
                    os.path.join(os.path.expanduser(USER_PATH), TILES_PATH))

            vbox = gtk.VBox(False, 5)
            vbox.set_border_width(5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start( \
                lbl(" This is the directory with all the images. "))
            button = gtk.Button("Reset to default")
            button.connect('clicked', set_folder)
            hbox.pack_start(button)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            myEntry = gtk.Entry()
            if conf.init_path:
                myEntry.set_text(conf.init_path)
            else:
                myEntry.set_text("None")
            cmbbox = repository_type_combo(conf.repository_type)
            hbox.pack_start(cmbbox, False)
            hbox.pack_start(myEntry)
            self.entry_custom_path = myEntry
            button = gtk.Button(" ... ")
            button.connect('clicked', get_folder)
            hbox.pack_start(button, False)
            vbox.pack_start(hbox)
            return myFrame(" Custom Maps Directory ", vbox)
Пример #43
0
        def _area():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("азимут:"))
            self.entry = myEntry("%.6g" % azimuth, 10, False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            hbox.pack_start(lbl("Дирекционный угол:"))
            self.entry = myEntry("%.2f" % float((azimuth - true_north) / 6),
                                 10, False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            hbox.pack_start(lbl("маг. угол с искажением:"))
            self.entry = myEntry("%.2f" % float((azimuth + mag_merid) / 6), 10,
                                 False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("azimuth input:"))
            self.entry = myEntry("%.2f" % distance, 10, False)
            hbox.pack_start(self.entry, False)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("encoder:"))
            azimuth_compass_encoder_diff = azimuth + compass_encoder_diff
            # correcting the diff hwen its above 360
            if azimuth_compass_encoder_diff >= 360:
                azimuth_compass_encoder_diff -= 360
            self.entry = myEntry("%.2f" % azimuth_compass_encoder_diff, 10,
                                 False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            hbox.pack_start(lbl("distance:"))
            self.entry = myEntry("%.1f" % distance, 10, False)
            hbox.pack_start(self.entry, False)
            vbox.pack_start(hbox)

            return myFrame(" Calculated Azimuth and Distance", vbox)
Пример #44
0
        def custom_path(conf):
            def repository_type_combo(repos_type_id):
                self.cmb_repos_type = gtk.combo_box_new_text()
                for strMode in REPOS_TYPE:
                    self.cmb_repos_type.append_text(strMode)
                self.cmb_repos_type.set_active(repos_type_id)
                return self.cmb_repos_type

            def get_folder(button):
                folderName = FolderChooser()
                if folderName:
                    self.entry_custom_path.set_text(folderName)

            def set_folder(button):
                self.cmb_repos_type.set_active(REPOS_TYPE_FILES)
                self.entry_custom_path.set_text(DEFAULT_PATH)

            vbox = gtk.VBox(False, 5)
            vbox.set_border_width(5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start( \
                lbl(" This is the directory with all the images. "))
            button = gtk.Button("Reset to default")
            button.connect('clicked', set_folder)
            hbox.pack_start(button)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            myEntry = gtk.Entry()
            if conf.init_path:
                myEntry.set_text(conf.init_path)
            else:
                myEntry.set_text("None")
            cmbbox = repository_type_combo(conf.repository_type)
            hbox.pack_start(cmbbox, False)
            hbox.pack_start(myEntry)
            self.entry_custom_path = myEntry
            button = gtk.Button(" ... ")
            button.connect('clicked', get_folder)
            hbox.pack_start(button, False)
            vbox.pack_start(hbox)
            return myFrame(" Custom Maps Directory ", vbox)
Пример #45
0
        def _wgs84():
            vbox = gtk.VBox(False, 5)
            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Latitude:"))
            self._wgs84_Lat = myEntry("%.9g" % 39.930474, 10, False)
            hbox.pack_start(self._wgs84_Lat, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            hbox.pack_start(lbl("Longitude:"))
            self._wgs84_Lon = myEntry("%.9g" % 46.84519, 10, False)
            hbox.pack_start(self._wgs84_Lon, False)
            vbox.pack_start(hbox)

            self._wgs84_Lon.connect("changed", _wg84_changed)
            self._wgs84_Lat.connect("changed", _wg84_changed)

            self._wgs84_Lon.connect("focus_in_event", _wgs84_activated)
            self._wgs84_Lat.connect("focus_in_event", _wgs84_activated)
            return myFrame(" Wgs84", vbox)
        def _zoom(zoom0, zoom1):
            out_hbox = gtk.HBox(False, 50)
            out_hbox.set_border_width(10)
            in_hbox = gtk.HBox(False, 20)
            in_hbox.pack_start(lbl("min:"), False)
            self.s_zoom0 = SpinBtn(zoom0)
            self.s_zoom0.set_digits(0)
            in_hbox.pack_start(self.s_zoom0)
            out_hbox.pack_start(in_hbox)

            in_hbox = gtk.HBox(False, 20)
            in_hbox.pack_start(lbl("max:"), False)
            self.s_zoom1 = SpinBtn(zoom1)
            self.s_zoom1.set_digits(0)
            in_hbox.pack_start(self.s_zoom1)
            out_hbox.pack_start(in_hbox)
            hbox = gtk.HBox()
            hbox.set_border_width(10)
            hbox.pack_start(myFrame(" Zoom ", out_hbox, 0))
            return hbox
Пример #47
0
        def _zoom(zoom0, zoom1):
            out_hbox = gtk.HBox(False, 50)
            out_hbox.set_border_width(10)
            in_hbox = gtk.HBox(False, 20)
            in_hbox.pack_start(lbl("min:"), False)
            self.s_zoom0 = SpinBtn(zoom0)
            self.s_zoom0.set_digits(0)
            in_hbox.pack_start(self.s_zoom0)
            out_hbox.pack_start(in_hbox)

            in_hbox = gtk.HBox(False, 20)
            in_hbox.pack_start(lbl("max:"), False)
            self.s_zoom1 = SpinBtn(zoom1)
            self.s_zoom1.set_digits(0)
            in_hbox.pack_start(self.s_zoom1)
            out_hbox.pack_start(in_hbox)
            hbox = gtk.HBox()
            hbox.set_border_width(10)
            hbox.pack_start(myFrame(" Zoom ", out_hbox, 0))
            return hbox
Пример #48
0
    def service_combo(self, map_service, oneDirPerMap):
        vbox = gtk.VBox(False, 5)
        hbox = gtk.HBox(False, 10)
        hbox.pack_start(lbl("Select your favorite map service: "))
        self.cmb_service = gtk.combo_box_new_text()
        intActive = 0
        for intPos in range(1, len(MAP_SERVERS)):
            self.cmb_service.append_text(MAP_SERVERS[intPos])
            if MAP_SERVERS[intPos] == map_service:
                intActive = intPos - 1
        self.cmb_service.set_active(intActive)
        hbox.pack_start(self.cmb_service)
        vbox.pack_start(hbox)

        # Check box for option to create a dir per Map service
        hbox = gtk.HBox()
        self.cb_oneDirPerMap = gtk.CheckButton( \
            "Use a different folder per Map Service")
        self.cb_oneDirPerMap.set_active(oneDirPerMap)
        hbox.pack_start(self.cb_oneDirPerMap)
        vbox.pack_start(hbox)
        return myFrame(" Map service ", vbox)
        def _custom_path():
            def repository_type_combo(repos_type_id):
                self.cmb_repos_type = gtk.combo_box_new_text()
                for strMode in REPOS_TYPE:
                    self.cmb_repos_type.append_text(strMode)
                self.cmb_repos_type.set_active(repos_type_id)
                return self.cmb_repos_type

            def get_folder(button):
                #if os.path.isdir(self.entry_custom_path.get_text()):
                #    dir = self.entry_custom_path
                #else:
                #    dir = None
                folderName = FolderChooser()
                if folderName:
                    self.entry_custom_path.set_text(folderName)

            vbox = gtk.VBox(False, 5)
            vbox.set_border_width(5)
            hbox = gtk.HBox(False, 10)
            self.entry_custom_path = gtk.Entry()
            self.entry_custom_path.set_text(EXWindow.configpath)
            repository_type_combo(EXWindow.repostype_id)
            hbox.pack_start(self.cmb_repos_type, False)
            hbox.pack_start(self.entry_custom_path)
            button = gtk.Button(" ... ")
            button.connect('clicked', get_folder)
            hbox.pack_start(button, False)
            vbox.pack_start(hbox)

            hbox = gtk.HBox(False, 10)
            self.cb_overwrite_destination = gtk.CheckButton("Overwrite existing tiles in destination repository")
            hbox.pack_start(self.cb_overwrite_destination)
            vbox.pack_start(hbox)

            return myFrame(" Destination repository for export ", vbox)
Пример #50
0
 def gps_updt_rate(self, gps_update_rate):
     hbox = gtk.HBox(False, 10)
     hbox.pack_start(lbl("Here you can change the GPS update rate: "))
     self.e_gps_updt_rate = myEntry(str(gps_update_rate), 4, False)
     hbox.pack_start(self.e_gps_updt_rate)
     return myFrame(" GPS Update Rate ", hbox)
Пример #51
0
 def cross_check_box(self, show_cross):
     self.cb_show_cross = gtk.CheckButton('Show a "+" in the center of the map')
     self.cb_show_cross.set_active(show_cross)
     return myFrame(" Mark center of the map ", self.cb_show_cross)
Пример #52
0
 def view_scale_check(self, view_scale):
     self.cb_view_scale = gtk.CheckButton('View scale of map')
     self.cb_view_scale.set_active(view_scale)
     return myFrame(' Map Scale ', self.cb_view_scale)
Пример #53
0
 def _zoom(zoom):
     hbox = gtk.HBox(False, 10)
     self.s_zoom = SpinBtn(zoom)
     hbox.pack_start(self.s_zoom, False)
     return myFrame(" Zoom ", hbox)