Project

General

Profile

Feature #2273 ยป 2015-01-31_00-19-59_r2353 .diff

Kosta A., 01/31/2015 12:40 AM

View differences:

chirpui/mainapp.py Thu Jan 29 07:14:39 2015 -0800 โ†’ chirpui/mainapp.py Sat Jan 31 00:19:59 2015 -0800
for i in ["export", "close", "columns", "irbook", "irfinder",
"move_up", "move_dn", "exchange", "iradioreference",
"cut", "copy", "paste", "delete", "viewdeveloper"]:
"cut", "copy", "paste", "delete", "viewdeveloper",
"all", "properties"]:
set_action_sensitive(i, eset is not None)
def ev_status(self, editorset, msg):
......
radio_name = "%s %s %s" % (eset.rthread.radio.VENDOR,
eset.rthread.radio.MODEL,
eset.rthread.radio.VARIANT)
d = gtk.Dialog(title=_("Select Columns"),
d = gtk.Dialog(title=_("Choose Columns"),
parent=self,
buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
......
self.do_toggle_no_smart_tmode(_action)
elif action == "developer":
self.do_toggle_developer(_action)
elif action in ["cut", "copy", "paste", "delete",
"move_up", "move_dn", "exchange",
elif action in ["cut", "copy", "paste", "delete", "all",
"move_up", "move_dn", "exchange", "properties",
"devshowraw", "devdiffraw"]:
self.get_current_editorset().get_current_editor().hotkey(_action)
elif action == "devdifftab":
......
<menuitem action="paste"/>
<menuitem action="delete"/>
<separator/>
<menuitem action="all"/>
<separator/>
<menuitem action="move_up"/>
<menuitem action="move_dn"/>
<menuitem action="exchange"/>
<separator/>
<menuitem action="properties"/>
</menu>
<menu action="view">
<menuitem action="columns"/>
<separator/>
<menuitem action="hide_unused"/>
<menuitem action="no_smart_tmode"/>
<menu action="viewdeveloper">
......
<menuitem action="devdiffraw"/>
<menuitem action="devdifftab"/>
</menu>
<separator/>
<menuitem action="language"/>
</menu>
<menu action="radio" name="radio">
<menuitem action="download"/>
<menuitem action="upload"/>
<separator/>
<menu action="importsrc" name="importsrc">
<menuitem action="iradioreference"/>
<menuitem action="irbook"/>
......
('file', None, _("_File"), None, None, self.mh),
('new', gtk.STOCK_NEW, None, None, None, self.mh),
('open', gtk.STOCK_OPEN, None, None, None, self.mh),
('openstock', None, _("Open stock config"), None, None, self.mh),
('openstock', None, _("Open Stock Config"), None, None, self.mh),
('recent', None, _("_Recent"), None, None, self.mh),
('save', gtk.STOCK_SAVE, None, None, None, self.mh),
('saveas', gtk.STOCK_SAVE_AS, None, None, None, self.mh),
('loadmod', None, _("Load Module"), None, None, self.mh),
('loadmod', None, _("Load Module..."), None, None, self.mh),
('close', gtk.STOCK_CLOSE, None, None, None, self.mh),
('quit', gtk.STOCK_QUIT, None, None, None, self.mh),
('edit', None, _("_Edit"), None, None, self.mh),
......
('copy', None, _("_Copy"), "<Ctrl>c", None, self.mh),
('paste', None, _("_Paste"), "<Ctrl>v", None, self.mh),
('delete', None, _("_Delete"), "Delete", None, self.mh),
('all', None, _("Select _All"), None, None, self.mh),
('move_up', None, _("Move _Up"), "<Control>Up", None, self.mh),
('move_dn', None, _("Move Dow_n"), "<Control>Down", None, self.mh),
('exchange', None, _("E_xchange"), "<Control><Shift>x", None, self.mh),
('properties', None, _("P_roperties"), None, None, self.mh),
('view', None, _("_View"), None, None, self.mh),
('columns', None, _("Columns"), None, None, self.mh),
('columns', None, _("C_hoose Columns..."), None, None, self.mh),
('viewdeveloper', None, _("Developer"), None, None, self.mh),
('devshowraw', None, _('Show raw memory'), "<Control><Shift>r", None, self.mh),
('devdiffraw', None, _("Diff raw memories"), "<Control><Shift>d", None, self.mh),
('devdifftab', None, _("Diff tabs"), "<Control><Shift>t", None, self.mh),
('language', None, _("Change language"), None, None, self.mh),
('language', None, _("Change Language..."), None, None, self.mh),
('radio', None, _("_Radio"), None, None, self.mh),
('download', None, _("Download From Radio"), "<Alt>d", None, self.mh),
('upload', None, _("Upload To Radio"), "<Alt>u", None, self.mh),
('import', None, _("Import"), "<Alt>i", None, self.mh),
('export', None, _("Export"), "<Alt>x", None, self.mh),
('importsrc', None, _("Import from data source"), None, None, self.mh),
('import', None, _("Import..."), "<Alt>i", None, self.mh),
('export', None, _("Export..."), "<Alt>x", None, self.mh),
('importsrc', None, _("Import Data Source"), None, None, self.mh),
('iradioreference', None, _("RadioReference.com"), None, None, self.mh),
('irfinder', None, _("RFinder"), None, None, self.mh),
('irbook', None, _("RepeaterBook"), None, None, self.mh),
('ipr', None, _("przemienniki.net"), None, None, self.mh),
('querysrc', None, _("Query data source"), None, None, self.mh),
('querysrc', None, _("Query Data Source"), None, None, self.mh),
('qradioreference', None, _("RadioReference.com"), None, None, self.mh),
('qrfinder', None, _("RFinder"), None, None, self.mh),
('qpr', None, _("przemienniki.net"), None, None, self.mh),
......
('export_chirp', None, _("CHIRP Native File"), None, None, self.mh),
('export_csv', None, _("CSV File"), None, None, self.mh),
('stock', None, _("Import from stock config"), None, None, self.mh),
('channel_defaults', None, _("Channel defaults"), None, None, self.mh),
('channel_defaults', None, _("Reset Channel Defaults"), None, None, self.mh),
('cancelq', gtk.STOCK_STOP, None, "Escape", None, self.mh),
('help', None, _('Help'), None, None, self.mh),
('about', gtk.STOCK_ABOUT, None, None, None, self.mh),
chirpui/memdetail.py Thu Jan 29 07:14:39 2015 -0800 โ†’ chirpui/memdetail.py Sat Jan 31 00:19:59 2015 -0800
self.vbox.pack_start(sw, 1, 1, 1)
tab.show()
row = 0
def _err(name, msg):
try:
_img = self._editors[name][2]
......
self.set_response_sensitive(gtk.RESPONSE_OK,
True not in self._errors)
row = 0
for name in self._order:
labeltxt, editorcls, data = self._elements[name]
......
row += 1
self._order.append(name)
def _title(self):
return _("Edit Memory #{num}").format(num=self._memory.number)
def __init__(self, features, memory, parent=None):
self._memory = memory
gtk.Dialog.__init__(self,
title=self._title(),
title="Memory Properties",
flags=gtk.DIALOG_MODAL,
parent=parent,
buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
......
if isinstance(msg, chirp_common.ValidationError):
errors.append(msg)
if errors:
common.show_error_text(_("Memory validation failed:"),
common.show_error_text(_("Memory Validation Failed:"),
os.linesep +
os.linesep.join(errors))
self.emit_stop_by_name('response')
......
return self._memory
class MultiMemoryDetailEditor(MemoryDetailEditor):
def _title(self):
return _("Edit Multiple Memories")
def __init__(self, features, memory, parent=None):
self._selections = dict()
super(MultiMemoryDetailEditor, self).__init__(features, memory, parent)
chirpui/memedit.py Thu Jan 29 07:14:39 2015 -0800 โ†’ chirpui/memedit.py Sat Jan 31 00:19:59 2015 -0800
return True # We changed memories
def _delete_rows_and_shift(self, paths, all=False):
def _remove_rows_and_shift(self, paths, all=False):
iter = self.store.get_iter(paths[0])
starting_loc, = self.store.get(iter, self.col(_("Loc")))
for i in range(0, len(paths)):
......
elif action == "delete":
changed = self._delete_rows(paths)
elif action == "delete_s":
changed = self._delete_rows_and_shift(paths)
changed = self._remove_rows_and_shift(paths)
elif action == "delete_sall":
changed = self._delete_rows_and_shift(paths, all=True)
changed = self._remove_rows_and_shift(paths, all=True)
elif action in ["move_up", "move_dn"]:
changed = self._move_up_down(paths, action)
elif action == "exchange":
......
changed = self.copy_selection(action=="cut")
elif action == "paste":
changed = self.paste_selection()
elif action == "all":
self._select_all()
elif action == "devshowraw":
self._show_raw(cur_pos)
elif action == "devdiffraw":
self._diff_raw(paths)
elif action == "edit":
elif action == "properties":
job = common.RadioJob(self.edit_memory, "get_memory", cur_pos)
job.set_cb_args(selected)
self.rthread.submit(job)
......
menu_xml = """
<ui>
<popup name="Menu">
<menuitem action="edit"/>
<menuitem action="insert_prev"/>
<menuitem action="insert_next"/>
<menu action="deletes">
<menuitem action="delete"/>
<menuitem action="cut"/>
<menuitem action="copy"/>
<menuitem action="paste"/>
<menuitem action="delete"/>
<separator/>
<menuitem action="all"/>
<separator/>
<menu action="insert">
<menuitem action="insert_prev"/>
<menuitem action="insert_next"/>
</menu>
<menu action="remove">
<menuitem action="delete_s"/>
<menuitem action="delete_sall"/>
</menu>
......
<menuitem action="move_dn"/>
<menuitem action="exchange"/>
<separator/>
<menuitem action="cut"/>
<menuitem action="copy"/>
<menuitem action="paste"/>
<menuitem action="properties"/>
%s
</popup>
</ui>
......
istwo = len(paths) == 2
actions = [
("edit", _("Edit")),
("insert_prev", _("Insert row above")),
("insert_next", _("Insert row below")),
("deletes", _("Delete")),
("delete", issingle and _("this memory") or _("these memories")),
("properties", _("P_roperties")),
("insert", _("Insert")),
("insert_prev", _("Row Above")),
("insert_next", _("Row Below")),
("remove", _("Remove")),
("delete_s", _("...and shift block up")),
("delete_sall", _("...and shift all memories up")),
("move_up", _("Move up")),
("move_dn", _("Move down")),
("exchange", _("Exchange memories")),
("move_up", _("Move Up")),
("move_dn", _("Move Down")),
("exchange", _("Exchange Memories")),
("cut", _("Cut")),
("copy", _("Copy")),
("paste", _("Paste")),
("delete", _("Delete")),
("all", _("Select All")),
("devshowraw", _("Show Raw Memory")),
("devdiffraw", _("Diff Raw Memories")),
]
......
def make_controls(self, min, max):
hbox = gtk.HBox(False, 2)
lab = gtk.Label(_("Memory range:"))
lab = gtk.Label(_("Memory Range:"))
lab.show()
hbox.pack_start(lab, 0, 0, 0)
......
hi.show()
hbox.pack_start(hi, 0, 0, 0)
refresh = gtk.Button(_("Go"))
refresh = gtk.Button()
refresh.set_relief(gtk.RELIEF_NONE)
image = gtk.Image()
image.set_from_stock(gtk.STOCK_REFRESH, gtk.ICON_SIZE_MENU)
image.show()
label = gtk.Label(_("Refresh"))
label.show()
box = gtk.HBox(False, 2)
box.pack_start(image, 0, 0, 0)
box.pack_start(label, 0, 0, 0)
box.show()
refresh.add(box)
refresh.connect("clicked", lambda x: self.prefill())
refresh.show()
refresh.connect("clicked", lambda x: self.prefill())
hbox.pack_start(refresh, 0, 0, 0)
def activate_go(widget):
refresh.clicked()
......
sep = gtk.VSeparator()
sep.show()
sep.set_size_request(20, -1)
hbox.pack_start(sep, 0, 0, 0)
hbox.pack_start(sep, 0, 0, 2)
showspecial = gtk.CheckButton(_("Special Channels"))
showspecial = gtk.ToggleButton(_("Special Channels"))
showspecial.set_relief(gtk.RELIEF_NONE)
showspecial.set_active(self.show_special)
showspecial.connect("toggled",
lambda x: self.set_show_special(x.get_active()))
showspecial.show()
hbox.pack_start(showspecial, 0, 0, 0)
showempty = gtk.CheckButton(_("Show Empty"))
showempty = gtk.ToggleButton(_("Show Empty"))
showempty.set_relief(gtk.RELIEF_NONE)
showempty.set_active(self.show_empty);
showempty.connect("toggled",
lambda x: self.set_show_empty(x.get_active()))
showempty.show()
hbox.pack_start(showempty, 0, 0, 0)
sep = gtk.VSeparator()
sep.show()
hbox.pack_start(sep, 0, 0, 2)
edit = gtk.Button()
edit.set_relief(gtk.RELIEF_NONE)
image = gtk.Image()
image.set_from_stock(gtk.STOCK_EXECUTE, gtk.ICON_SIZE_MENU)
image.show()
label = gtk.Label(_("Properties"))
label.show()
box = gtk.HBox(False, 2)
box.pack_start(image, 0, 0, 0)
box.pack_start(label, 0, 0, 0)
box.show()
edit.add(box)
edit.connect("clicked", lambda x: self.hotkey(gtk.Action("properties", "", "", 0)))
edit.show()
hbox.pack_start(edit, 0, 0, 0)
hbox.show()
return hbox
......
clipboard = gtk.Clipboard(selection="PRIMARY")
clipboard.request_text(self._paste_selection)
def _select_all(self):
self.view.get_selection().select_all()
def prepare_close(self):
cols = self.view.get_columns()
self._config.set("column_order_%s" % self.__class__.__name__,
    (1-1/1)