本文整理匯總了Python中Setup.setup_profile_check方法的典型用法代碼示例。如果您正苦於以下問題:Python Setup.setup_profile_check方法的具體用法?Python Setup.setup_profile_check怎麽用?Python Setup.setup_profile_check使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Setup
的用法示例。
在下文中一共展示了Setup.setup_profile_check方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create
# 需要導入模塊: import Setup [as 別名]
# 或者: from Setup import setup_profile_check [as 別名]
def create(self, notebook):
Setup.setup_profile_check(self)
self.window.set_size_request(450,310) # TODO Correct size
# Frame - Select Profile Frame
select_profile_frame = create_page(self, notebook, 'Select Profile', 100, 75)
# Select Profile Window (scrolled)
select_profile_window = gtk.ScrolledWindow()
select_profile_window.set_border_width(10)
select_profile_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
select_profile_window.show()
select_profile_frame.add(select_profile_window)
# Select Profile ListStore
# Profile Name = String
self.select_profile_liststore = gtk.ListStore(str,str)
self.select_profile_treeview = gtk.TreeView(self.select_profile_liststore)
select_profile_column_1 = gtk.TreeViewColumn('Profile')
self.select_profile_treeview.append_column(select_profile_column_1)
select_profile_window.add(self.select_profile_treeview)
self.select_profile_treeview.show()
for i in range(0,len(self.profiles)):
self.select_profile_liststore.append([self.profiles[i],self.ini[i]])
# Add Mouse Click event to select_profile_treeview
self.select_profile_treeview.add_events(gtk.gdk.BUTTON_PRESS_MASK)
self.select_profile_treeview.connect('event',profile_selection, self)
# create a CellRenderers to render the data
self.cell1 = gtk.CellRendererText()
# set background color property
self.cell1.set_property('cell-background', 'white')
# add the cells to the columns
select_profile_column_1.pack_start(self.cell1, False)
# set the cell attributes to the appropriate liststore column
select_profile_column_1.set_attributes(self.cell1, text=0)
# INSTALL SETUP INFO
if sys.platform != 'win32':
install_types = GLOBAL.LINUX_INSTALL_TYPES
install_types_default = GLOBAL.LINUX_INSTALL_TYPES_DEFAULT
else:
install_types = GLOBAL.WINDOWS_INSTALL_TYPES
install_types_default = GLOBAL.WINDOWS_INSTALL_TYPES_DEFAULT
# Frame - Create Profile Frame
create_profile_frame = create_page(self, notebook, 'Create Profile', 100, 75)
# Table
create_profile_table = gtk.Table(rows=1,columns=1, homogeneous=False)
create_profile_table.show()
create_profile_frame.add(create_profile_table)
# Profile Name
profile_name_label = label_create("Profile Name")
self.profile_name = gtk.Entry(max=0)
self.profile_name.show()
create_profile_table.attach(profile_name_label, 0,1,0,1, gtk.FILL,gtk.FILL,10,10)
create_profile_table.attach(self.profile_name, 1,2,0,1, gtk.FILL,gtk.FILL,10,10)
# Install Type
install_type_label = label_create("Install Type")
self.install_type_combobox = combobox_setup(None, None, None, install_types_default, install_types)
self.install_type_combobox.connect("changed", install_type_selection, self)
create_profile_table.attach(install_type_label, 0,1,1,2, gtk.FILL,gtk.FILL,10,10)
create_profile_table.attach(self.install_type_combobox, 1,2,1,2, gtk.FILL,gtk.FILL,10,10)
# Spring Binary
spring_binary_label = label_create('Spring Binary')
self.spring_binary = gtk.Entry(max=0)
self.spring_binary.set_text('spring')
self.spring_binary.show()
create_profile_table.attach(spring_binary_label, 0,1,2,3, gtk.FILL,gtk.FILL,10,10)
create_profile_table.attach(self.spring_binary, 1,2,2,3, gtk.FILL,gtk.FILL,10,10)
# Datadir Location
self.spring_datadir_label = label_create('Spring Datadir')
self.spring_datadir = gtk.Entry(max=0)
self.spring_datadir.show()
create_profile_table.attach(self.spring_datadir_label, 0,1,3,4, gtk.FILL,gtk.FILL,10,10)
create_profile_table.attach(self.spring_datadir, 1,2,3,4, gtk.FILL,gtk.FILL,10,10)
# Spring-GUI Background
background_label = label_create('Spring GUI Background')
self.background = gtk.Entry(max=0)
self.background.show()
create_profile_table.attach(background_label, 0,1,4,5, gtk.FILL,gtk.FILL,10,10)
create_profile_table.attach(self.background, 1,2,4,5, gtk.FILL,gtk.FILL,10,10)
# Default -> Background
if os.path.isfile (GLOBAL.SPRING_GUI_BACKGROUND):
self.background.set_text(GLOBAL.SPRING_GUI_BACKGROUND)
# Button -> Save
save_button = gtk.Button(label=None, stock=gtk.STOCK_SAVE)
save_button.connect("clicked", Setup.profile_save, self)
#.........這裏部分代碼省略.........