Beispiel #1
0
 def get_own_menuitems(self):
     """Return a (set) of dicts of help menu items, with name, priority, URL,
     target and onclick code."""
     return {
         'help_items': [
             MenuItem(name='mnu_online_help',
                      label=gettext('Online Help'),
                      priority=100,
                      target='_blank',
                      icon='fa fa-question',
                      url=url_for('help.static', filename='index.html')),
             MenuItem(name='mnu_pgadmin_website',
                      label=gettext('pgAdmin Website'),
                      priority=200,
                      target='_blank',
                      icon='fa fa-external-link',
                      url='https://www.pgadmin.org/'),
             MenuItem(name='mnu_postgresql_website',
                      label=gettext('PostgreSQL Website'),
                      priority=300,
                      target='_blank',
                      icon='fa fa-external-link',
                      url='http://www.postgresql.org/')
         ]
     }
Beispiel #2
0
 def get_own_menuitems(self):
     return {
         'file_items': [
             MenuItem(name='mnu_locklayout',
                      module='pgAdmin.Browser',
                      label=gettext('Lock Layout'),
                      priority=999,
                      menu_items=[
                          MenuItem(name='mnu_lock_none',
                                   module='pgAdmin.Browser',
                                   callback='mnu_lock_none',
                                   priority=0,
                                   label=gettext('None'),
                                   checked=True),
                          MenuItem(name='mnu_lock_docking',
                                   module='pgAdmin.Browser',
                                   callback='mnu_lock_docking',
                                   priority=1,
                                   label=gettext('Prevent Docking'),
                                   checked=False),
                          MenuItem(name='mnu_lock_full',
                                   module='pgAdmin.Browser',
                                   callback='mnu_lock_full',
                                   priority=2,
                                   label=gettext('Full Lock'),
                                   checked=False)
                      ])
         ]
     }
Beispiel #3
0
 def get_own_menuitems(self):
     return {'tools': [
         MenuItem(name='mnu_query_tool',
                  label=gettext('Query tool'),
                  priority=100,
                  callback='show_query_tool',
                  icon='fa fa-question',
                  url=url_for('help.static', filename='index.html'))
     ]}
Beispiel #4
0
 def get_own_menuitems(self):
     return {
         'file_items': [
             MenuItem(name='mnu_preferences',
                      priority=997,
                      module="pgAdmin.Preferences",
                      callback='show',
                      icon='fa fa-cog',
                      label=gettext('Preferences'))
         ]
     }
Beispiel #5
0
 def get_own_menuitems(self):
     return {
         'file_items': [
             MenuItem(name='mnu_resetlayout',
                      priority=999,
                      module="pgAdmin.Settings",
                      callback='show',
                      icon='fa fa-retweet',
                      label=gettext('Reset Layout'))
         ]
     }
Beispiel #6
0
 def get_own_menuitems(self):
     return {
         'help_items': [
             MenuItem(name='mnu_about',
                      priority=999,
                      module="pgAdmin.About",
                      callback='about_show',
                      icon='fa fa-info-circle',
                      label=gettext('About %(appname)s',
                                    appname=config.APP_NAME))
         ]
     }
Beispiel #7
0
 def get_own_menuitems(self):
     appname = config.APP_NAME
     if hasattr(str, 'decode'):
         appname = appname.decode('utf-8')
     return {
         'help_items': [
             MenuItem(name='mnu_about',
                      priority=999,
                      module="pgAdmin.About",
                      callback='about_show',
                      icon='fa fa-info-circle',
                      label=gettext(u'About %(appname)s', appname=appname))
         ]
     }
Beispiel #8
0
    def get_own_menuitems(self):
        menus = {
            'file_items': [
                MenuItem(name='mnu_locklayout',
                         module=PGADMIN_BROWSER,
                         label=gettext('Lock Layout'),
                         priority=999,
                         menu_items=[
                             MenuItem(name='mnu_lock_none',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_lock_none',
                                      priority=0,
                                      label=gettext('None'),
                                      checked=True),
                             MenuItem(name='mnu_lock_docking',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_lock_docking',
                                      priority=1,
                                      label=gettext('Prevent Docking'),
                                      checked=False),
                             MenuItem(name='mnu_lock_full',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_lock_full',
                                      priority=2,
                                      label=gettext('Full Lock'),
                                      checked=False)
                         ])
            ]
        }

        # We need 'Configure...' and 'View log...' Menu only in runtime.
        if current_app.PGADMIN_RUNTIME:
            menus['file_items'].append(
                MenuItem(name='mnu_runtime',
                         module=PGADMIN_BROWSER,
                         label=gettext('Runtime'),
                         priority=999,
                         menu_items=[
                             MenuItem(name='mnu_configure_runtime',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_configure_runtime',
                                      priority=0,
                                      label=gettext('Configure...')),
                             MenuItem(name='mnu_viewlog_runtime',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_viewlog_runtime',
                                      priority=1,
                                      label=gettext('View log...'))
                         ]))

        return menus
Beispiel #9
0
 def get_own_menuitems(self):
     return {'file_items': [
         MenuItem(name='mnu_generate_test_html',
                  label=gettext('Generated Test HTML'),
                  priority=2,
                  url=url_for('test.generated')),
         MenuItem(name='mnu_test_alert',
                  label=gettext('Test Alert'),
                  priority=200,
                  module='pgAdmin.Test',
                  category=gettext('alertify'),
                  callback='test_alert'),
         MenuItem(name='mnu_test_confirm',
                  label=gettext('Test Confirm'),
                  priority=300,
                  module='pgAdmin.Test',
                  category=gettext('alertify'),
                  callback='test_confirm'),
         MenuItem(name='mnu_test_dialog',
                  label=gettext('Test Dialog'),
                  priority=400,
                  module='pgAdmin.Test',
                  category=gettext('alertify'),
                  callback='test_dialog'),
         MenuItem(name='mnu_test_prompt',
                  label=gettext('Test Prompt'),
                  priority=500,
                  module='pgAdmin.Test',
                  category=gettext('alertify'),
                  callback='test_prompt'),
         MenuItem(name='mnu_test_notifier',
                  label=gettext('Test Notifier'),
                  priority=600,
                  module='pgAdmin.Test',
                  category=gettext('alertify'),
                  callback='test_notifier'),
         MenuItem(name='mnu_test_disabled',
             label=gettext('Test Disabled'),
                  priority=700,
                  module='pgAdmin.Test',
                  callback='test_notifier',
                  enable=False)
     ]}
Beispiel #10
0
    def get_own_menuitems(self):
        menus = {
            'file_items': [
                MenuItem(name='mnu_locklayout',
                         module=PGADMIN_BROWSER,
                         label=gettext('Lock Layout'),
                         priority=999,
                         menu_items=[
                             MenuItem(name='mnu_lock_none',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_lock_none',
                                      priority=0,
                                      label=gettext('None'),
                                      checked=True),
                             MenuItem(name='mnu_lock_docking',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_lock_docking',
                                      priority=1,
                                      label=gettext('Prevent Docking'),
                                      checked=False),
                             MenuItem(name='mnu_lock_full',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_lock_full',
                                      priority=2,
                                      label=gettext('Full Lock'),
                                      checked=False)
                         ])
            ]
        }

        # We need 'Configure...' and 'View log...' Menu only in runtime.
        if current_app.PGADMIN_RUNTIME:
            full_screen_label = gettext('Enter Full Screen  (F10)')
            actual_size_label = gettext('Actual Size (Ctrl 0)')
            zoom_in_label = gettext('Zoom In (Ctrl +)')
            zoom_out_label = gettext('Zoom Out (Ctrl -)')

            if sys.platform == 'darwin':
                full_screen_label = gettext('Enter Full Screen  (Cmd Ctrl F)')
                actual_size_label = gettext('Actual Size (Cmd 0)')
                zoom_in_label = gettext('Zoom In (Cmd +)')
                zoom_out_label = gettext('Zoom Out (Cmd -)')

            menus['file_items'].append(
                MenuItem(name='mnu_runtime',
                         module=PGADMIN_BROWSER,
                         label=gettext('Runtime'),
                         priority=999,
                         menu_items=[
                             MenuItem(name='mnu_configure_runtime',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_configure_runtime',
                                      priority=0,
                                      label=gettext('Configure...')),
                             MenuItem(
                                 name='mnu_viewlog_runtime',
                                 module=PGADMIN_BROWSER,
                                 callback='mnu_viewlog_runtime',
                                 priority=1,
                                 label=gettext('View log...'),
                                 below=True,
                             ),
                             MenuItem(name='mnu_toggle_fullscreen_runtime',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_toggle_fullscreen_runtime',
                                      priority=2,
                                      label=full_screen_label),
                             MenuItem(name='mnu_actual_size_runtime',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_actual_size_runtime',
                                      priority=3,
                                      label=actual_size_label),
                             MenuItem(name='mnu_zoomin_runtime',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_zoomin_runtime',
                                      priority=4,
                                      label=zoom_in_label),
                             MenuItem(name='mnu_zoomout_runtime',
                                      module=PGADMIN_BROWSER,
                                      callback='mnu_zoomout_runtime',
                                      priority=5,
                                      label=zoom_out_label)
                         ]))

        return menus