コード例 #1
0
	def __init__ (self, data_dir):
		self.__write_flags = 0
		self.data_dir = data_dir
		# Sets up data dir and version
		if release:
			self.version = release.version
		else:
			self.version = "testing"
		
		# setup ui
		g = gtk.glade.XML (os.path.join(self.data_dir, 'serpentine.glade'),
		                   'preferences_dialog')
		self.__dialog = g.get_widget ("preferences_dialog")
		self.dialog.connect ('destroy-event', self.__on_destroy)
		
		# Drive selection
		drv = g.get_widget ("drive")
		cmb_drv = nautilus_burn.DriveSelection ()
		cmb_drv.show ()
		self.__drive_selection = cmb_drv
		drv.pack_start (cmb_drv, False, False)
		
		# Speed selection
		self.__speed = gaw.data_spin_button (g.get_widget ("speed"),
		                                     '/apps/serpentine/write_speed')
		self.__use_max_speed = gaw.data_toggle_button (g.get_widget ("use_max_speed"),
		                                               '/apps/serpentine/use_max_speed')
		self.__update_speed ()
		self.__speed.sync_widget()
	
		# eject checkbox
		self.__eject = gaw.data_toggle_button (g.get_widget ("eject"),
		                                       '/apps/serpentine/eject')
		
		# temp
		self.__tmp = gaw.data_entry (g.get_widget ('location_ent'),
		                                           '/apps/serpentine/temporary_dir')
		if self.__tmp.data == '':
			self.__tmp.data = '/tmp'
			
		self.__tmp.widget.connect ('changed', self.__on_tmp_changed)
		self.__tmp.sync_widget()
		self.dialog.connect ('show', self.__on_tmp_changed)
		g.get_widget ('location_btn').connect ('clicked', self.__on_tmp_choose)
		self.__tmp_dlg = gtk.FileChooserDialog (action  = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
		                                        parent  = self.dialog,
		                                        buttons = (gtk.STOCK_CANCEL,
		                                                   gtk.RESPONSE_CANCEL,
		                                                   gtk.STOCK_OPEN,
		                                                   gtk.RESPONSE_OK))
		self.__tmp_dlg.set_local_only (True)
		self.__tmp_dlg.set_filename (self.__tmp.data)
		
		# Pool
		self.__pool = GvfsMusicPool ()
		
		# Close button
		self.__close = g.get_widget ('close_btn')
コード例 #2
0
	def __init__ (self):
		# By default use burnproof
		self.__write_flags = nautilusburn.RECORDER_WRITE_BURNPROOF
		# Sets up data dir and version
		if release:
			self.version = release.version
		else:
			self.version = "testing"
		
		# setup ui
		g = gtk.glade.XML (os.path.join(constants.data_dir, 'serpentine.glade'),
		                   'preferences_dialog')
		self.__dialog = g.get_widget ("preferences_dialog")
		self.dialog.connect ('destroy-event', self.__on_destroy)
		
		# Drive selection
		drv = g.get_widget ("drive")
		cmb_drv = nautilusburn.DriveSelection ()
		cmb_drv.show ()
		cmb_drv.connect ("device-changed", self.__on_drive_changed)
		
		self.__drive_selection = cmb_drv
		drv.pack_start (cmb_drv, False, False)
		self.__drive_listeners = []
		
		# Speed selection
		self.__speed = gaw.data_spin_button (g.get_widget ("speed"),
		                                     '/apps/serpentine/write_speed')
		self.__specify_speed = gaw.data_toggle_button (g.get_widget ("specify_speed"),
		                                               "/apps/serpentine/specify_speed")
		self.__specify_speed.widget.connect ("toggled", self.__on_specify_speed)
		
		# No default value set, set it to 99
		if self.__speed.data == 0:
			self.__speed.data = 99
		self.__use_max_speed = gaw.data_toggle_button (g.get_widget ("use_max_speed"),
		                                               '/apps/serpentine/use_max_speed')
		self.__update_speed ()
		self.__speed.sync_widget()
		self.__speed.widget.set_sensitive (self.__specify_speed.widget.get_active ())
	
		# eject checkbox
		self.__eject = gaw.data_toggle_button (g.get_widget ("eject"),
		                                       '/apps/serpentine/eject')
		
		# temp
		f = gtk.FileChooserButton ("")
		f.set_action (gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
		self.__tmp = gaw.data_file_chooser (f, "/apps/serpentine/temporary_dir", True, True)
		f.show()
		g.get_widget("location_box").add(f)
		
		# Pool
		self.__pool = GvfsMusicPool ()
		
		# Close button
		self.__close = g.get_widget ('close_btn')
コード例 #3
0
    def __init__ (self, locations):
        # By default use burnproof
        self.__write_flags = nautilusburn.RECORDER_WRITE_BURNPROOF
        # Sets up data dir and version
        self.version = release.version

        # setup ui
        filename = locations.get_data_file("serpentine.glade")
        g = glade.XML (filename, "preferences_dialog")
        self.__dialog = g.get_widget ("preferences_dialog")
        self.dialog.connect ("destroy-event", self.__on_destroy)
        self.dialog.set_title ("")
        
        # Drive selection
        drv = g.get_widget ("drive")
        cmb_drv = nautilusburn.DriveSelection ()
        cmb_drv.set_property ("show-recorders-only", True)
        cmb_drv.show ()
        
        self.__drive_selection = cmb_drv
        drv.pack_start (cmb_drv, False, False)
        
        # Speed selection
        self.__speed = WriteSpeed(g, self.__drive_selection.get_drive)
        
        # eject checkbox
        self.__eject = gaw.data_toggle_button (g.get_widget ("eject"),
                                               GCONF_DIR + "/eject")
        
        # use gap checkbox
        self.__use_gap = gaw.data_toggle_button (
            g.get_widget ("use_gap"),
            GCONF_DIR + "/use_gap",
            default = True
        )
        
        # temp
        ncb_temp_dir = NCB_GCONF_DIR + "/temp_iso_dir"
        gconf.client_get_default ().add_dir (ncb_temp_dir, gconf.CLIENT_PRELOAD_NONE)
        self.__tmp = gaw.GConfValue (
            key = ncb_temp_dir,
            data_spec = gaw.Spec.STRING,
            default = "file:///tmp"
        )
        
        # debug
        self.__debug = gaw.GConfValue (
            key = GCONF_DIR + "/debug_mode",
            data_spec = gaw.Spec.BOOL,
            default = False
        )
        
        # Pool
        self.__pool = GvfsMusicPool ()
        
        # Close button
        self.__close_button_handler = HideCloseButton(g.get_widget("close_btn"))
コード例 #4
0
 def _setup_glade (self, g):
     # Toolbar style
     self.__style = gaw.GConfValue (
         key = "/desktop/gnome/interface/toolbar_style",
         data_spec = gaw.Spec.STRING,
     )
     self.__style.set_callback (self.__on_style_change)
     
     # Detachable toolbar
     self.__detachable = gaw.GConfValue (
         key = "/desktop/gnome/interface/toolbar_detachable",
         data_spec = gaw.Spec.BOOL
     )
     self.__detachable.set_callback (self.__on_detachable_change)
     
     self.toolbar = g.get_widget ("main_toolbar")
     self.handle = g.get_widget ("main_handle")
     self.wrapper = g.get_widget ("main_toolbar_wrapper")
     
     # Show hide toolbar
     view_toolbar = g.get_widget ("view_toolbar_mni")
     self.__visible = gaw.data_toggle_button (
         toggle = view_toolbar,
         key = "/apps/serpentine/view_toolbar",
         default = True
     )
     view_toolbar.connect ("toggled", self.__on_toolbar_visible)
     
     # Update to current state
     self.__on_style_change ()
     self.__on_detachable_change ()
     self.__on_toolbar_visible ()
コード例 #5
0
    def _setup_glade(self, g):
        # Toolbar style
        self.__style = gaw.GConfValue(
            key="/desktop/gnome/interface/toolbar_style",
            data_spec=gaw.Spec.STRING,
        )
        self.__style.set_callback(self.__on_style_change)

        # Detachable toolbar
        self.__detachable = gaw.GConfValue(
            key="/desktop/gnome/interface/toolbar_detachable",
            data_spec=gaw.Spec.BOOL)
        self.__detachable.set_callback(self.__on_detachable_change)

        self.toolbar = g.get_widget("main_toolbar")
        self.handle = g.get_widget("main_handle")
        self.wrapper = g.get_widget("main_toolbar_wrapper")

        # Show hide toolbar
        view_toolbar = g.get_widget("view_toolbar_mni")
        self.__visible = gaw.data_toggle_button(
            toggle=view_toolbar,
            key="/apps/serpentine/view_toolbar",
            default=True)
        view_toolbar.connect("toggled", self.__on_toolbar_visible)

        # Update to current state
        self.__on_style_change()
        self.__on_detachable_change()
        self.__on_toolbar_visible()
コード例 #6
0
    def __init__ (self):
        # By default use burnproof
        self.__write_flags = nautilusburn.RECORDER_WRITE_BURNPROOF

        # Sets up data dir and version
        if release:
            self.version = release.version
        else:
            self.version = "testing"
        
        # setup ui
        g = gtk.glade.XML (os.path.join(constants.data_dir, "serpentine.glade"),
                           "preferences_dialog")
        self.__dialog = g.get_widget ("preferences_dialog")
        self.dialog.connect ("destroy-event", self.__on_destroy)
        self.dialog.set_title ("")
        
        # Drive selection
        drv = g.get_widget ("drive")
        cmb_drv = nautilusburn.DriveSelection ()
        cmb_drv.set_property ("show-recorders-only", True)
        cmb_drv.show ()
        
        self.__drive_selection = cmb_drv
        drv.pack_start (cmb_drv, False, False)
        
        # Speed selection
        self.__speed = gaw.data_spin_button (g.get_widget ("speed"),
                                             GCONF_DIR + "/write_speed")
        
        self.__specify_speed = g.get_widget ("specify_speed_wrapper")
                                             
        specify_speed = g.get_widget ("specify_speed")
        
        self.__speed_select = gaw.RadioButtonData (
            widgets = dict (
                specify_speed = specify_speed,
                use_max_speed = g.get_widget ("use_max_speed")
            ),
            
            key = GCONF_DIR + "/speed_select"
        )
        self.__speed_select.seleted_by_default = "use_max_speed"
        
        specify_speed.connect ("toggled", self.__on_specify_speed)
        # init specify speed box sensitivity
        self.__on_specify_speed (specify_speed)
        
        # No default value set, set it to 99
        if self.__speed.data == 0:
            self.__speed.data = 99

        self.__update_speed ()
        self.__speed.sync_widget()
        self.__speed.widget.set_sensitive (specify_speed.get_active ())
    
        # eject checkbox
        self.__eject = gaw.data_toggle_button (g.get_widget ("eject"),
                                               GCONF_DIR + "/eject")
        
        g.get_widget ("refresh_speed").connect ("clicked", self.__on_refresh_speed)
        
        # use gap checkbox
        self.__use_gap = gaw.data_toggle_button (
            g.get_widget ("use_gap"),
            GCONF_DIR + "/use_gap",
            default = True
        )
        
        # temp
        ncb_temp_dir = "/apps/nautilus-cd-burner/temp_iso_dir"
        gconf.client_get_default ().add_dir (ncb_temp_dir, gconf.CLIENT_PRELOAD_NONE)
        self.__tmp = gaw.GConfValue (
            key = ncb_temp_dir,
            data_spec = gaw.Spec.STRING,
            default = "file:///tmp"
        )
        
        # debug
        self.__debug = gaw.GConfValue (
            key = GCONF_DIR + "/debug_mode",
            data_spec = gaw.Spec.BOOL,
            default = False
        )
        
        # Pool
        self.__pool = GvfsMusicPool ()
        
        # Close button
        self.__close = g.get_widget ("close_btn")
コード例 #7
0
    def __init__(self):
        # By default use burnproof
        self.__write_flags = nautilusburn.RECORDER_WRITE_BURNPROOF

        # Sets up data dir and version
        if release:
            self.version = release.version
        else:
            self.version = "testing"

        # setup ui
        g = gtk.glade.XML(os.path.join(constants.data_dir, "serpentine.glade"),
                          "preferences_dialog")
        self.__dialog = g.get_widget("preferences_dialog")
        self.dialog.connect("destroy-event", self.__on_destroy)

        # Drive selection
        drv = g.get_widget("drive")
        cmb_drv = nautilusburn.DriveSelection()
        cmb_drv.set_property("show-recorders-only", True)
        cmb_drv.show()

        self.__drive_selection = cmb_drv
        drv.pack_start(cmb_drv, False, False)

        # Speed selection
        self.__speed = gaw.data_spin_button(g.get_widget("speed"),
                                            GCONF_DIR + "/write_speed")

        self.__specify_speed = g.get_widget("specify_speed_wrapper")

        specify_speed = g.get_widget("specify_speed")

        self.__speed_select = gaw.RadioButtonData(
            widgets=dict(specify_speed=specify_speed,
                         use_max_speed=g.get_widget("use_max_speed")),
            key=GCONF_DIR + "/speed_select")
        self.__speed_select.seleted_by_default = "use_max_speed"

        specify_speed.connect("toggled", self.__on_specify_speed)
        # init specify speed box sensitivity
        self.__on_specify_speed(specify_speed)

        # No default value set, set it to 99
        if self.__speed.data == 0:
            self.__speed.data = 99

        self.__update_speed()
        self.__speed.sync_widget()
        self.__speed.widget.set_sensitive(specify_speed.get_active())

        # eject checkbox
        self.__eject = gaw.data_toggle_button(g.get_widget("eject"),
                                              GCONF_DIR + "/eject")

        g.get_widget("refresh_speed").connect("clicked",
                                              self.__on_refresh_speed)

        # use gap checkbox
        self.__use_gap = gaw.data_toggle_button(g.get_widget("use_gap"),
                                                GCONF_DIR + "/use_gap",
                                                default=True)

        # temp
        ncb_temp_dir = "/apps/nautilus-cd-burner/temp_iso_dir"
        gconf.client_get_default().add_dir(ncb_temp_dir,
                                           gconf.CLIENT_PRELOAD_NONE)
        self.__tmp = gaw.GConfValue(key=ncb_temp_dir,
                                    data_spec=gaw.Spec.STRING,
                                    default="file:///tmp")

        # debug
        self.__debug = gaw.GConfValue(key=GCONF_DIR + "/debug_mode",
                                      data_spec=gaw.Spec.BOOL,
                                      default=False)

        # Pool
        self.__pool = GvfsMusicPool()

        # Close button
        self.__close = g.get_widget("close_btn")