7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25
26 import sys
27 import pango
28 import time
29 import datetime
30 import locale
31 import pkg.pkgsubprocess as subprocess
32 from threading import Thread
33
34 try:
35 import gobject
36 gobject.threads_init()
37 import gnome
38 import gtk
39 import gtk.glade
40 import pygtk
41 pygtk.require("2.0")
42 except ImportError:
43 sys.exit(1)
44 import pkg.gui.misc as gui_misc
45
46 nobe = False
81 msgbox.set_title(_("BE management"))
82 msgbox.run()
83 msgbox.destroy()
84 return
85
86 self.be_list = \
87 gtk.ListStore(
88 gobject.TYPE_INT, # BE_ID
89 gobject.TYPE_BOOLEAN, # BE_MARKED
90 gobject.TYPE_STRING, # BE_NAME
91 gobject.TYPE_STRING, # BE_ORIG_NAME
92 gobject.TYPE_STRING, # BE_DATE_TIME
93 gtk.gdk.Pixbuf, # BE_CURRENT_PIXBUF
94 gobject.TYPE_BOOLEAN, # BE_ACTIVE_DEFAULT
95 gobject.TYPE_STRING, # BE_SIZE
96 gobject.TYPE_BOOLEAN, # BE_EDITABLE
97 )
98 self.progress_stop_thread = False
99 self.initial_active = 0
100 self.initial_default = 0
101 w_tree_beadmin = gtk.glade.XML(parent.gladefile, "beadmin")
102 w_tree_progress = gtk.glade.XML(parent.gladefile, "progressdialog")
103 w_tree_beconfirmation = gtk.glade.XML(parent.gladefile,
104 "beconfirmationdialog")
105 self.w_beadmin_dialog = w_tree_beadmin.get_widget("beadmin")
106 self.w_be_treeview = w_tree_beadmin.get_widget("betreeview")
107 self.w_cancel_button = w_tree_beadmin.get_widget("cancelbebutton")
108 self.w_ok_button = w_tree_beadmin.get_widget("okbebutton")
109 w_active_gtkimage = w_tree_beadmin.get_widget("activebeimage")
110 self.w_progress_dialog = w_tree_progress.get_widget("progressdialog")
111 self.w_progress_dialog.connect('delete-event', lambda stub1, stub2: True)
112 self.w_progressinfo_label = w_tree_progress.get_widget("progressinfo")
113 progress_button = w_tree_progress.get_widget("progresscancel")
114 self.w_progressbar = w_tree_progress.get_widget("progressbar")
115 self.w_beconfirmation_dialog = \
116 w_tree_beconfirmation.get_widget("beconfirmationdialog")
117 self.w_beconfirmation_textview = \
118 w_tree_beconfirmation.get_widget("beconfirmtext")
119 self.w_cancelbe_button = w_tree_beconfirmation.get_widget("cancel_be")
120 self.w_ok_button.set_sensitive(False)
121 progress_button.hide()
122 self.w_progressbar.set_pulse_step(0.1)
123 self.list_filter = self.be_list.filter_new()
|
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25
26 import sys
27 import os
28 import pango
29 import time
30 import datetime
31 import locale
32 import pkg.pkgsubprocess as subprocess
33 from threading import Thread
34
35 try:
36 import gobject
37 gobject.threads_init()
38 import gnome
39 import gtk
40 import gtk.glade
41 import pygtk
42 pygtk.require("2.0")
43 except ImportError:
44 sys.exit(1)
45 import pkg.gui.misc as gui_misc
46
47 nobe = False
82 msgbox.set_title(_("BE management"))
83 msgbox.run()
84 msgbox.destroy()
85 return
86
87 self.be_list = \
88 gtk.ListStore(
89 gobject.TYPE_INT, # BE_ID
90 gobject.TYPE_BOOLEAN, # BE_MARKED
91 gobject.TYPE_STRING, # BE_NAME
92 gobject.TYPE_STRING, # BE_ORIG_NAME
93 gobject.TYPE_STRING, # BE_DATE_TIME
94 gtk.gdk.Pixbuf, # BE_CURRENT_PIXBUF
95 gobject.TYPE_BOOLEAN, # BE_ACTIVE_DEFAULT
96 gobject.TYPE_STRING, # BE_SIZE
97 gobject.TYPE_BOOLEAN, # BE_EDITABLE
98 )
99 self.progress_stop_thread = False
100 self.initial_active = 0
101 self.initial_default = 0
102 gladefile = os.path.join(self.parent.application_dir,
103 "usr/share/package-manager/packagemanager.glade")
104 w_tree_beadmin = gtk.glade.XML(gladefile, "beadmin")
105 w_tree_progress = gtk.glade.XML(gladefile, "progressdialog")
106 w_tree_beconfirmation = gtk.glade.XML(gladefile,
107 "beconfirmationdialog")
108 self.w_beadmin_dialog = w_tree_beadmin.get_widget("beadmin")
109 self.w_be_treeview = w_tree_beadmin.get_widget("betreeview")
110 self.w_cancel_button = w_tree_beadmin.get_widget("cancelbebutton")
111 self.w_ok_button = w_tree_beadmin.get_widget("okbebutton")
112 w_active_gtkimage = w_tree_beadmin.get_widget("activebeimage")
113 self.w_progress_dialog = w_tree_progress.get_widget("progressdialog")
114 self.w_progress_dialog.connect('delete-event', lambda stub1, stub2: True)
115 self.w_progressinfo_label = w_tree_progress.get_widget("progressinfo")
116 progress_button = w_tree_progress.get_widget("progresscancel")
117 self.w_progressbar = w_tree_progress.get_widget("progressbar")
118 self.w_beconfirmation_dialog = \
119 w_tree_beconfirmation.get_widget("beconfirmationdialog")
120 self.w_beconfirmation_textview = \
121 w_tree_beconfirmation.get_widget("beconfirmtext")
122 self.w_cancelbe_button = w_tree_beconfirmation.get_widget("cancel_be")
123 self.w_ok_button.set_sensitive(False)
124 progress_button.hide()
125 self.w_progressbar.set_pulse_step(0.1)
126 self.list_filter = self.be_list.filter_new()
|