2007-03-28 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: call dbmanager if no file loaded on startup * src/DbManger.py: open buttons and double click * src/gramps_main.py: use "Family Trees" svn: r8336
This commit is contained in:
parent
d5651b061e
commit
a9a388bead
@ -1,3 +1,8 @@
|
||||
2007-03-28 Don Allingham <don@gramps-project.org>
|
||||
* src/ViewManager.py: call dbmanager if no file loaded on startup
|
||||
* src/DbManger.py: open buttons and double click
|
||||
* src/gramps_main.py: use "Family Trees"
|
||||
|
||||
2007-03-28 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
|
||||
* src/DataViews/_NoteView.py: enable shortcuts and drag-and-drop.
|
||||
* src/Bookmarks.py (NoteBookmarks.make_label): better note label.
|
||||
|
@ -60,7 +60,7 @@ import QuestionDialog
|
||||
|
||||
|
||||
DEFAULT_DIR = os.path.expanduser("~/grampsdb")
|
||||
DEFAULT_TITLE = _("Database")
|
||||
DEFAULT_TITLE = _("Family Tree")
|
||||
NAME_FILE = "name.txt"
|
||||
META_NAME = "meta_data.db"
|
||||
|
||||
@ -72,10 +72,12 @@ OPEN_COL = 5
|
||||
|
||||
class DbManager:
|
||||
|
||||
def __init__(self, dbstate):
|
||||
def __init__(self, dbstate, parent=None):
|
||||
|
||||
self.glade = gtk.glade.XML(const.gladeFile, "dbmanager", "gramps")
|
||||
self.top = self.glade.get_widget('dbmanager')
|
||||
if parent:
|
||||
self.top.set_transient_for(parent)
|
||||
|
||||
self.connect = self.glade.get_widget('ok')
|
||||
self.cancel = self.glade.get_widget('cancel')
|
||||
@ -100,6 +102,13 @@ class DbManager:
|
||||
self.remove.connect('clicked', self.remove_db)
|
||||
self.new.connect('clicked', self.new_db)
|
||||
self.selection.connect('changed', self.selection_changed)
|
||||
self.dblist.connect('button-press-event', self.button_press)
|
||||
|
||||
def button_press(self, obj, event):
|
||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||
self.top.response(gtk.RESPONSE_OK)
|
||||
return True
|
||||
return False
|
||||
|
||||
def selection_changed(self, selection):
|
||||
store, iter = selection.get_selected()
|
||||
@ -118,7 +127,7 @@ class DbManager:
|
||||
render = gtk.CellRendererText()
|
||||
render.set_property('editable',True)
|
||||
render.connect('edited', self.change_name)
|
||||
self.column = gtk.TreeViewColumn(_('Database name'), render,
|
||||
self.column = gtk.TreeViewColumn(_('Family tree name'), render,
|
||||
text=NAME_COL)
|
||||
self.dblist.append_column(self.column)
|
||||
|
||||
@ -153,7 +162,7 @@ class DbManager:
|
||||
|
||||
if dirpath == self.active:
|
||||
enable = True
|
||||
stock_id = gtk.STOCK_CONNECT
|
||||
stock_id = gtk.STOCK_OPEN
|
||||
else:
|
||||
enable = False
|
||||
stock_id = ""
|
||||
|
@ -110,7 +110,6 @@ UIDEFAULT = '''<ui>
|
||||
</menu>
|
||||
<separator/>
|
||||
<menuitem action="Import"/>
|
||||
<menuitem action="SaveAs"/>
|
||||
<menuitem action="Export"/>
|
||||
<placeholder name="LocalExport"/>
|
||||
<separator/>
|
||||
@ -329,8 +328,8 @@ class ViewManager:
|
||||
|
||||
def _init_lists(self):
|
||||
self._file_action_list = [
|
||||
('FileMenu', None, _('_File')),
|
||||
('Open', 'gramps-db', _('_Manage Databases'), "<control>o",
|
||||
('FileMenu', None, _('_Family Trees')),
|
||||
('Open', 'gramps-db', _('_Manage Family Trees'), "<control>o",
|
||||
_("Manage databases"), self.open_activate),
|
||||
('OpenRecent', None, _('Open _Recent'), None,
|
||||
_("Open an existing database")),
|
||||
@ -492,6 +491,8 @@ class ViewManager:
|
||||
# Showing the main window is deferred so that
|
||||
# ArgHandler can work without it always shown
|
||||
self.window.show()
|
||||
if not self.state.db.is_open():
|
||||
self.open_activate(None)
|
||||
|
||||
def do_load_plugins(self):
|
||||
self.uistate.status_text(_('Loading document formats...'))
|
||||
@ -901,7 +902,7 @@ class ViewManager:
|
||||
|
||||
def open_activate(self, obj):
|
||||
import DbManager
|
||||
dialog = DbManager.DbManager(self.state)
|
||||
dialog = DbManager.DbManager(self.state, self.window)
|
||||
value = dialog.run()
|
||||
if value:
|
||||
(filename, title) = value
|
||||
@ -1301,7 +1302,7 @@ def check_for_portability_problems(filetype):
|
||||
version = (sys.version_info[0], sys.version_info[1])
|
||||
if version < (2, 5) and not Config.get(Config.PORT_WARN):
|
||||
QuestionDialog.MessageHideDialog(
|
||||
_('Database is not portable'),
|
||||
_('Family Tree is not portable'),
|
||||
_('If you need to transfer the database to another machine, '
|
||||
'export to a GRAMPS Package, and import the GRAMPS Package '
|
||||
'on the other machine.'),
|
||||
|
@ -15418,9 +15418,9 @@ Very High</property>
|
||||
<widget class="GtkDialog" id="dbmanager">
|
||||
<property name="border_width">6</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">GRAMPS - Database Manager</property>
|
||||
<property name="title" translatable="yes">Family Tree Manager - GRAMPS</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="default_width">500</property>
|
||||
<property name="default_height">250</property>
|
||||
@ -15464,7 +15464,7 @@ Very High</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-connect</property>
|
||||
<property name="label">gtk-open</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
|
@ -94,7 +94,7 @@ def register_stock_icons ():
|
||||
]
|
||||
|
||||
items = [
|
||||
('gramps-db',_('Databases'),gtk.gdk.CONTROL_MASK,0,''),
|
||||
('gramps-db',_('Family Trees'),gtk.gdk.CONTROL_MASK,0,''),
|
||||
('gramps-address',_('Address'),gtk.gdk.CONTROL_MASK,0,''),
|
||||
('gramps-attribute',_('Attribute'),gtk.gdk.CONTROL_MASK,0,''),
|
||||
#('gramps-bookmark',_('Bookmarks'),gtk.gdk.CONTROL_MASK,0,''),
|
||||
|
Loading…
x
Reference in New Issue
Block a user