root/branch/QuickScan/umit/plugin/Window.py @ 4946

Revision 4946, 3.5 kB (checked in by cassiano, 4 years ago)

Merged revisions 4909,4930-4932,4934-4935 via svnmerge from
http://svn.umitproject.org/svnroot/umit/trunk

................

r4909 | nopper | 2009-06-22 11:55:24 -0300 (Mon, 22 Jun 2009) | 21 lines


Merged revisions 4781-4783,4908 via svnmerge from
http://svn.umitproject.org/svnroot/umit/branch/UmitPlugins


........

r4781 | nopper | 2009-05-08 21:26:32 +0200 (ven, 08 mag 2009) | 1 line


Switching to new schema see UmitPlugins.xsd in PM branch. Switched also from xml.minidom to sax to speed up things.

........

r4782 | nopper | 2009-05-09 16:11:38 +0200 (sab, 09 mag 2009) | 1 line


Switched update process to new xml schema file.

........

r4783 | nopper | 2009-05-09 17:02:06 +0200 (sab, 09 mag 2009) | 1 line


Updating documentation to the new schema

........

r4908 | nopper | 2009-06-22 16:43:59 +0200 (lun, 22 giu 2009) | 1 line


Fixing a typo

........

................

r4930 | luis | 2009-06-27 11:33:59 -0300 (Sat, 27 Jun 2009) | 1 line


Fixing #334 - import error when umit is installed from package

................

r4931 | luis | 2009-06-27 22:38:54 -0300 (Sat, 27 Jun 2009) | 1 line


Fixed #331 - Permission denied writing umit config file

................

r4932 | luis | 2009-06-27 23:09:05 -0300 (Sat, 27 Jun 2009) | 1 line


Typo in Flow Analyzer plugin

................

r4934 | luis | 2009-06-27 23:30:31 -0300 (Sat, 27 Jun 2009) | 3 lines


Initialized merge tracking via "svnmerge" with revisions "1-4699" from
http://svn.umitproject.org/svnroot/umit/branch/radialnet

................

r4935 | ignotus | 2009-06-27 23:54:28 -0300 (Sat, 27 Jun 2009) | 3 lines


Fix accents problem in header.

................

Line 
1# -*- coding: utf-8 -*-
2# Copyright (C) 2008 Adriano Monteiro Marques
3#
4# Author: Francesco Piccinno <stack.box@gmail.com>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20import gtk
21import os.path
22
23from higwidgets.higwindows import HIGWindow
24from higwidgets.higboxes import HIGVBox
25
26from higwidgets.higanimates import HIGAnimatedBar
27from higwidgets.higtoolbars import HIGToolBar, HIGToolItem
28
29from PathPage import PathPage
30from PluginPage import PluginPage
31
32from umit.core.Paths import Path
33from umit.plugin.Update import UpdateEngine
34from umit.plugin.Engine import PluginEngine
35
36from Network import *
37
38from umit.core.I18N import _
39
40
41class PluginWindow(HIGWindow):
42    def __init__(self):
43        HIGWindow.__init__(self)
44
45        self.engine = PluginEngine()
46        self.update_eng = UpdateEngine()
47
48        self.set_title(_('Plugin Manager'))
49        self.set_position(gtk.WIN_POS_CENTER)
50        self.set_size_request(600, 400)
51        self.set_icon_from_file(os.path.join(Path.icons_dir, "umit_16.ico"))
52
53        self.__create_widgets()
54        self.__pack_widgets()
55
56    def __create_widgets(self):
57        self.vbox = HIGVBox()
58
59        self.animated_bar = HIGAnimatedBar('')
60        self.toolbar = HIGToolBar()
61
62        self.notebook = gtk.Notebook()
63        self.notebook.set_show_tabs(False)
64        self.notebook.set_show_border(False)
65
66        self.plug_page = PluginPage(self)
67        self.path_page = PathPage(self)
68
69    def __pack_widgets(self):
70        self.add(self.vbox)
71
72        self.vbox.pack_start(self.animated_bar, False, False, 0)
73        self.vbox.pack_start(self.toolbar, False, False, 0)
74        self.vbox.pack_start(self.notebook)
75
76        self.notebook.append_page(self.plug_page)
77        self.notebook.append_page(self.path_page)
78
79        self.toolbar.connect('changed', self.__on_switch_page)
80
81        self.connect('realize', self.__on_realize)
82
83        # Create the pages
84
85        lbls = (_('Extensions'), _('Paths'))
86        imgs = ('extension_small', 'paths_small')
87
88        for lbl, stock in zip(lbls, imgs):
89            image = gtk.image_new_from_stock(stock, gtk.ICON_SIZE_MENU)
90
91            self.toolbar.append(
92                HIGToolItem('<b>%s</b>' % lbl, image)
93            )
94
95        self.toolbar.set_active(0)
96        self.get_child().show_all() # No show the root
97
98        # We have to hide unused buttons in plugin page
99        self.plug_page.install_updates_btn.hide()
100        self.plug_page.skip_install_btn.hide()
101        self.plug_page.restart_btn.hide()
102
103        self.connect('delete-event', self.__on_delete_event)
104
105    def __on_delete_event(self, widget, evt):
106        self.hide()
107        return True
108
109    def __on_realize(self, widget):
110        self.animated_bar.hide()
111
112        self.plug_page.populate()
113        self.path_page.populate()
114
115    def __on_switch_page(self, widget, id):
116        self.notebook.set_current_page(id)
Note: See TracBrowser for help on using the browser.