コード例 #1
0
 def _init_docs_iconview(self):
     # Initialize the list store and the icon view.
     self._docs_liststore = gtk.ListStore(str, str, gtk.gdk.Pixbuf)
     self._docs_iconview.set_model(self._docs_liststore)
     self._docs_iconview.set_pixbuf_column(
         self.DOCS_TREEVIEW_COLUMN_ICON_PIXBUF)
     self._docs_iconview.set_selection_mode(gtk.SELECTION_MULTIPLE)
     self._docs_iconview.connect('selection-changed',
                                 self.on_docs_iconview_selection_changed)
     self._docs_icon_size = self.DOC_ICON_NORMAL
     # Configure the signals to load the thumbnails of the documents.
     adjustment = self._docs_scrolledwindow.get_hadjustment()
     adjustment.connect('value-changed',
                        self.on_iconview_adjustment_changed)
     adjustment = self._docs_scrolledwindow.get_vadjustment()
     adjustment.connect('value-changed',
                        self.on_iconview_adjustment_changed)
     # Default document icons.
     self._docs_icon_small = gtk.gdk.pixbuf_new_from_file_at_size(
         get_image('diglib-document.svg'),
         self._library.THUMBNAIL_SIZE_SMALL,
         self._library.THUMBNAIL_SIZE_SMALL)
     self._docs_icon_normal = gtk.gdk.pixbuf_new_from_file_at_size(
         get_image('diglib-document.svg'),
         self._library.THUMBNAIL_SIZE_NORMAL,
         self._library.THUMBNAIL_SIZE_NORMAL)
     self._docs_icon_large = gtk.gdk.pixbuf_new_from_file_at_size(
         get_image('diglib-document.svg'),
         self._library.THUMBNAIL_SIZE_LARGE,
         self._library.THUMBNAIL_SIZE_LARGE)
コード例 #2
0
ファイル: __init__.py プロジェクト: yasserglez/diglib
 def _init_icons(self):
     gtk.window_set_default_icon_from_file(get_image('diglib.svg'))
     icon_factory = gtk.IconFactory()
     for stock_id in ('diglib-document-add', 'diglib-document-open',
                      'diglib-document-copy', 'diglib-document-delete',
                      'diglib-document-tag', 'diglib-directory-add'):
         icon_path = get_image('%s.svg' % stock_id)
         icon_set = gtk.IconSet(gtk.gdk.pixbuf_new_from_file(icon_path))
         icon_factory.add(stock_id, icon_set)
     icon_factory.add_default()
コード例 #3
0
ファイル: aboutdialog.py プロジェクト: avenet/diglib
    def __init__(self):
        super(AboutDialog, self).__init__()
        url_hook = lambda dialog, url, data: open_url(url)
        gtk.about_dialog_set_url_hook(url_hook, None)
        email_hook = lambda dialog, email, data: open_email(email)
        gtk.about_dialog_set_email_hook(email_hook, None)
        self.set_logo(gtk.gdk.pixbuf_new_from_file(get_image('diglib.svg')))
        self.set_name(about.NAME)
        self.set_program_name(about.NAME)
        self.set_version(about.VERSION)
        self.set_comments(about.DESCRIPTION)
        self.set_authors([about.AUTHOR])
        self.set_copyright(about.COPYRIGHT)
        self.set_wrap_license(True)
        self.set_license(
'This program is free software: you can redistribute it and/or \
modify it under the terms of the GNU General Public License as published \
by the Free Software Foundation, either version 3 of the License, or \
any later version.\n\n\
This program is distributed in the hope that it will be useful, but WITHOUT \
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for \
more details.\n\n\
You should have received a copy of the GNU General Public License along with \
this program. If not, see http://www.gnu.org/licenses/.')
コード例 #4
0
    def __init__(self):
        super(AboutDialog, self).__init__()
        url_hook = lambda dialog, url, data: open_url(url)
        gtk.about_dialog_set_url_hook(url_hook, None)
        email_hook = lambda dialog, email, data: open_email(email)
        gtk.about_dialog_set_email_hook(email_hook, None)
        self.set_logo(gtk.gdk.pixbuf_new_from_file(get_image('diglib.svg')))
        self.set_name(about.NAME)
        self.set_program_name(about.NAME)
        self.set_version(about.VERSION)
        self.set_comments(about.DESCRIPTION)
        self.set_authors([about.AUTHOR])
        self.set_copyright(about.COPYRIGHT)
        self.set_wrap_license(True)
        self.set_license(
            'This program is free software: you can redistribute it and/or \
modify it under the terms of the GNU General Public License as published \
by the Free Software Foundation, either version 3 of the License, or \
any later version.\n\n\
This program is distributed in the hope that it will be useful, but WITHOUT \
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for \
more details.\n\n\
You should have received a copy of the GNU General Public License along with \
this program. If not, see http://www.gnu.org/licenses/.')
コード例 #5
0
ファイル: mainwindow.py プロジェクト: avenet/diglib
 def _init_docs_iconview(self):
     # Initialize the list store and the icon view.
     self._docs_liststore = gtk.ListStore(str, str, gtk.gdk.Pixbuf)
     self._docs_iconview.set_model(self._docs_liststore)
     self._docs_iconview.set_pixbuf_column(self.DOCS_TREEVIEW_COLUMN_ICON_PIXBUF)
     self._docs_iconview.set_selection_mode(gtk.SELECTION_MULTIPLE)
     self._docs_iconview.connect('selection-changed', self.on_docs_iconview_selection_changed)
     self._docs_icon_size = self.DOC_ICON_NORMAL
     # Configure the signals to load the thumbnails of the documents.
     adjustment = self._docs_scrolledwindow.get_hadjustment()
     adjustment.connect('value-changed', self.on_iconview_adjustment_changed)
     adjustment = self._docs_scrolledwindow.get_vadjustment()
     adjustment.connect('value-changed', self.on_iconview_adjustment_changed)        
     # Default document icons.
     self._docs_icon_small = gtk.gdk.pixbuf_new_from_file_at_size(get_image('diglib-document.svg'), self._library.THUMBNAIL_SIZE_SMALL, self._library.THUMBNAIL_SIZE_SMALL)
     self._docs_icon_normal = gtk.gdk.pixbuf_new_from_file_at_size(get_image('diglib-document.svg'), self._library.THUMBNAIL_SIZE_NORMAL, self._library.THUMBNAIL_SIZE_NORMAL)
     self._docs_icon_large = gtk.gdk.pixbuf_new_from_file_at_size(get_image('diglib-document.svg'), self._library.THUMBNAIL_SIZE_LARGE, self._library.THUMBNAIL_SIZE_LARGE)