def __init__(self):
     self.__lastsong = None
     self.sbus = dbus.SessionBus()
     self.__connected_to_pidgin = False
     self.__check_pidgin_presence()
     gobject.timeout_add(10000, self.__check_pidgin_presence)
     gtk.quit_add(0, self.reset_status)
Exemple #2
0
 def __init__(self):
     self.main_window_xml = gtk.glade.XML(GLADE_FILE, "uploader_main")
     self.main_window = self.main_window_xml.get_widget("uploader_main")
     
     self.about_window_xml = gtk.glade.XML(GLADE_FILE, "uploader_about")
     self.about_window = self.about_window_xml.get_widget("uploader_about")
     self.about_window.set_transient_for(self.main_window)
     
     self.preferences_window_xml = gtk.glade.XML(GLADE_FILE, "uploader_preferences")
     self.preferences_window = self.preferences_window_xml.get_widget("uploader_preferences")
     self.preferences_window.set_transient_for(self.main_window)
     
     for i in "statusbar", "target", "documents_vbox", "documents_viewport":
         setattr(self, i, self.main_window_xml.get_widget(i))
     
     bgname = pkg_resources.resource_filename(__name__, "bg_txtrSynchronizer.png")
     self.bg_pixbuf = gtk.gdk.pixbuf_new_from_file(bgname)
     self.idle_image = gtk.image_new_from_pixbuf(self.bg_pixbuf)
     self.documents_vbox.pack_start(self.idle_image)
     self.idle_image.show()
     
     self.main_window_xml.signal_autoconnect(self)
     self.main_window.show()
     self.main_window.drag_dest_set(gtk.DEST_DEFAULT_ALL, [
             ("text/uri-list", 0, self._DRAG_INFO_URI),
             ("text/plain", 0, self._DRAG_INFO_TEXT),
         ], gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE | gtk.gdk.ACTION_DEFAULT)
     
     gtk.quit_add(0, self.fast_shutdown)
     
     self.documents = []
     self.current_upload = None
     self.available_lists = gtk.TreeStore(str, str)
     self.target.set_model(self.available_lists)
     
     ## Prepare file chooser filters
     patterns = (
         (_("Adobe PDF files"), "*.[pP][dD][fF]"),
         (_("Microsoft PowerPoint presentations"), "*.[pP][pP][tT]", "*.[pP][pP][tT][xX]"),
         (_("Microsoft Word documents"), "*.[dD][oO][cC]", "*.[dD][oO][cC][xX]"),
         (_("Microsoft Excel sheets"), "*.[xX][lL][sS]", "*.[xX][lL][sS][xX]"),
         (_("All files"), "*"),
     )
     self.uploader_chooser_filters = []
     for pattern in patterns:
         f = gtk.FileFilter()
         f.set_name(pattern[0])
         for p in pattern[1:]: f.add_pattern(p)
         self.uploader_chooser_filters.append(f)
     
     ## Prepare gconf, read config. Login if username/password available, otherwise display preferences
     self.gconf_client = gconf.client_get_default()
     self.preferences = Preferences(self, self.gconf_client)
     
     self.txtr_dirty = False
     self.preferences.add_changed_listener(self.login_data_changed)
     if not (self.preferences.username and self.preferences.password):
         self.on_preferences_activate(None)
     
     self.do_login()
Exemple #3
0
def gtk_main(Controller):
    """ main method for gtk frontend
    """
    global WEBKITERROR, INDICATORERROR

    import gtk
    import gobject

    import AccountMenu
    import Avatar
    import AvatarManager
    import AvatarChooser
    import config_gtk
    import ContactMenu
    import ContactList
    import ContactInfo
    import Conversation
    import ConversationManager
    import ConversationToolbar
    import DebugWindow
    import Dialog
    import EmptyWidget
    import FileTransferBarWidget
    import FileTransferWidget
    import GroupMenu
    import GtkNotification
    import Header
    import ImageAreaSelector
    import ImageChooser
    try:
        import Indicator
    except ImportError:
        INDICATORERROR = True
    import Login
    import MainMenu
    import MainWindow
    import NiceBar
    import PluginWindow
    import Preferences
    import Renderers
    import StatusMenu
    import TabWidget
    import TextBox
    import TrayIcon
    import UserPanel
    import Window
    try:
        import AdiumTextBox
    except ImportError:
        WEBKITERROR = True

    setup()
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    gtk.quit_add(0, controller.on_close)
    gtk.main()
    gtk.gdk.threads_leave()
 def __init__(self, *args): 
     storytext.guishared.UIMap.__init__(self, *args)
     gtk.Dialog = Dialog
     Dialog.uiMap = self
     gtk.FileChooserDialog = FileChooserDialog
     FileChooserDialog.uiMap = self
     gtk.quit_add(1, self.fileHandler.write) # Write changes to the GUI map when the application exits
 def __init__(self):
     self.__lastsong = None
     self.sbus = dbus.SessionBus()
     self.__connected_to_pidgin = False
     self.__check_pidgin_presence()
     gobject.timeout_add(10000, self.__check_pidgin_presence)
     gtk.quit_add(0,self.reset_status)
Exemple #6
0
def gtk_main(Controller):
    """ main method for gtk frontend
    """
    global WEBKITERROR, INDICATORERROR

    import gtk
    import gobject

    import AccountMenu
    import Avatar
    import AvatarManager
    import AvatarChooser
    import config_gtk
    import ContactMenu
    import ContactList
    import ContactInfo
    import Conversation
    import ConversationManager
    import ConversationToolbar
    import DebugWindow
    import Dialog
    import EmptyWidget
    import FileTransferBarWidget
    import FileTransferWidget
    import GroupMenu
    import Header
    import ImageAreaSelector
    import ImageChooser
    try:
        import Indicator
    except ImportError:
        INDICATORERROR = True
    import Login
    import MainMenu
    import MainWindow
    import NiceBar
    import PluginWindow
    import Preferences
    import Renderers
    import StatusMenu
    import TabWidget
    import TextBox
    import TrayIcon
    import UserPanel
    import Window
    try:
        import AdiumTextBox
    except ImportError:
        WEBKITERROR = True

    setup()
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    gtk.quit_add(0, controller.on_close)
    gtk.main()
    gtk.gdk.threads_leave()
Exemple #7
0
 def __init__(self, *args): 
     guiusecase.UIMap.__init__(self, *args)
     self.storedEvents = set()
     gtk.Dialog = Dialog
     Dialog.uiMap = self
     gtk.FileChooserDialog = FileChooserDialog
     FileChooserDialog.uiMap = self
     gtk.quit_add(1, self.fileHandler.write) # Write changes to the GUI map when the application exits
Exemple #8
0
        def __init__(self, tasklette):
                Widget.__init__(self)

                gtk.quit_add(0, self.kill)

                self.__tasklette = tasklette
                self.__is_running = False

                self.__task = None
 def show(self):
     self.init_video()
     gobject.timeout_add(200, self.run)
     #gobject.idle_add(self.run)
     gtk.Window.show(self)
     if not gtk.main_level():
         gtk.quit_add(0, self.drone.stop, True)
         gobject.threads_init()
         gtk.main()
Exemple #10
0
    def __init__(self, app=None, startpath=None):
        gviewapp.Tool_GViewApp.__init__(self, app)

        self.init_menu()
        self.view = None
        self.playing = 0
        self.id = None
        self.speed = 0.01

        gtk.quit_add(0, self.quit_cb)
Exemple #11
0
    def __init__(self, app=None, startpath=None):
        Tool_GViewApp.__init__(self, app)

        self.init_menu()
        self.view = None
        self.playing = 0
        self.id = None
        self.speed = 0.01

        gtk.quit_add(0,self.quit_cb)
Exemple #12
0
    def main(self):
        if HAVE_DBUS:
            session_bus = dbus.SessionBus()
            name = dbus.service.BusName("org.EveTimer", bus=session_bus)
            object = EveTimerDBus(name, "/org/EveTimer")

        EveDataThread().start()
        MainWindow(None, self.status_icon)
        gtk.quit_add(0, taskq.put, ['terminate'])
        gtk.main()
Exemple #13
0
    def __init__(self):
        GenericPlugin.__init__(self)

        self.pidFile = "/tmp/.g15music.pid"

        self.__lastsong = None

        self.autoconnect(Player, "new-song", self.on_new_song)

        self.on_new_song(Player, Player.song)
        gtk.quit_add(0, self.resetScreen)
Exemple #14
0
	def __init__(self):
		super(self.__class__, self).__init__()
		self.load(config.GTKBUILDER_DECKEDITOR)
		self.main_win.set_title(config.APP_NAME_EDITOR)
		self.main_win.maximize()
		self.textview_deckdesc.get_buffer().connect("changed",
			self.deckdesc_changed)
		self.quicksearch_entry.grab_focus()
		self.cardview.get_model().set_sort_func(3, self.sort_by_type, 3)
		self.resultview.get_model().set_sort_func(3, self.sort_by_type, 3)
		self.cardview.get_model().set_sort_func(2, self.sort_by_cost, 2)
		self.resultview.get_model().set_sort_func(2, self.sort_by_cost, 2)
		self.treestore_files.set_sort_func(2, self.sort_files)
		self.treestore_files.set_sort_column_id(2, gtk.SORT_ASCENDING)
		self.cardview.get_model().set_sort_column_id(3, gtk.SORT_ASCENDING)
		self.resultview.get_model().set_sort_column_id(10, gtk.SORT_DESCENDING)
		gtk.quit_add(0, self.save_deck) # one extra decksave just to be sure
		
		# Render folder and deck icons
		self._folder_icon = self.main_win.render_icon(gtk.STOCK_DIRECTORY,
			gtk.ICON_SIZE_MENU, None)
		self._deck_icon = self.main_win.render_icon(gtk.STOCK_FILE,
			gtk.ICON_SIZE_MENU, None)
		
		# Check if the database is accessable
		db_file = os.path.join(settings.cache_dir, config.DB_FILE)
		if not os.path.exists(db_file):
			self.warn_about_empty_db()
			return
		
		cards.connect()
		num = cards.count()
		if num == 0:
			self.warn_about_empty_db()
			return
		else:
			self.label_results.set_text("%d cards available" % num)
		
		# Create deck directory if it doesn't exist
		if not os.path.exists(settings.deck_dir):
			os.mkdir(settings.deck_dir)
			if os.name == 'posix':
				os.symlink(os.path.abspath(config.DEFAULT_DECKS_PATH),
					os.path.join(settings.deck_dir, _("default decks")))
		
		# Initialize the file view
		async.start(self._update_dir(settings.deck_dir))
		self._create_monitor(settings.deck_dir)
		
		# Initialize the quicksearch autocompletion
		async.start(self.init_qs_autocomplete())
Exemple #15
0
    def __init__(self):
        gtk.Window.__init__(self)

        self.set_title('low-level')
        if sys.platform != 'win32':
            self.set_resize_mode(gtk.RESIZE_IMMEDIATE)
        self.set_reallocate_redraws(True)
        self.connect('delete_event', gtk.main_quit)

        # VBox to hold everything.
        vbox = gtk.VBox()
        self.add(vbox)

        # Query the OpenGL extension version.
        print "OpenGL extension version - %d.%d\n" % gtk.gdkgl.query_version()

        # Configure OpenGL framebuffer.
        # Try to get a double-buffered framebuffer configuration,
        # if not successful then try to get a single-buffered one.
        display_mode = (gtk.gdkgl.MODE_RGB    |
                        gtk.gdkgl.MODE_DEPTH  |
                        gtk.gdkgl.MODE_DOUBLE)
        try:
            glconfig = gtk.gdkgl.Config(mode=display_mode)
        except gtk.gdkgl.NoMatches:
            display_mode &= ~gtk.gdkgl.MODE_DOUBLE
            glconfig = gtk.gdkgl.Config(mode=display_mode)

        print "is RGBA:",                 glconfig.is_rgba()
        print "is double-buffered:",      glconfig.is_double_buffered()
        print "is stereo:",               glconfig.is_stereo()
        print "has alpha:",               glconfig.has_alpha()
        print "has depth buffer:",        glconfig.has_depth_buffer()
        print "has stencil buffer:",      glconfig.has_stencil_buffer()
        print "has accumulation buffer:", glconfig.has_accum_buffer()
        print

        # LowLevelDrawingArea
        drawing_area = LowLevelDrawingArea(glconfig)
        drawing_area.set_size_request(200, 200)
        vbox.pack_start(drawing_area)

        # Unrealize drawing_area on quit.
        gtk.quit_add(gtk.main_level()+1, self._on_quit, drawing_area)

        # A quit button.
        button = gtk.Button('Quit')
        # Destroy window on quit explicitly.
        button.connect('clicked', gtk.main_quit)
        vbox.pack_start(button, expand=False)
 def __init__( self ):
     
     if not os.path.exists(storage):
         try:
             shutil.copy(os.path.join(globals.paths.base, "config.xml.in"), storage)
         except:
             print _("Error: Unable to create initial config file (%s)") % storage
             sys.exit(2)
     
     self.__xml = ElementTree.parse( os.path.realpath( storage ) )
     #self.__xml = xml.getroot()
     
     self.plugins = PluginList( self.__xml )
     
     gtk.quit_add( 0, self.__dump )
Exemple #17
0
def gtk_main(Controller):
    """ main method for gtk frontend
    """
    import gtk
    import gobject

    import Login
    import Dialog
    import Header
    import Window
    import TextBox
    import MainMenu
    import TrayIcon
    import UserPanel
    import TabWidget
    import GroupMenu
    import StatusMenu
    import MainWindow
    import EmptyWidget
    import AccountMenu
    import ContactMenu
    import ContactList
    import ContactInfo
    import Preferences
    import Conversation
    import ImageChooser
    import AdiumTextBox
    import WebKitTextBox
    import AvatarChooser
    import ConversationManager
    import ConversationToolbar
    import DebugWindow
    import PluginWindow
    import Renderers
    import config_gtk

    setup()
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    gtk.quit_add(0, controller.on_close)
    gtk.main()
    gtk.gdk.threads_leave()
Exemple #18
0
    def __init__(self):
        gtk.Window.__init__(self)

        self.set_title('pixmap')
        self.connect('delete_event', gtk.main_quit)

        # VBox to hold everything.
        vbox = gtk.VBox()
        self.add(vbox)

        # Query the OpenGL extension version.
        print "OpenGL extension version - %d.%d\n" % gtk.gdkgl.query_version()

        # Configure OpenGL framebuffer.
        # Try to get a single-buffered framebuffer configuration.
        display_mode = (gtk.gdkgl.MODE_RGB    |
                        gtk.gdkgl.MODE_DEPTH  |
                        gtk.gdkgl.MODE_SINGLE)
        try:
            glconfig = gtk.gdkgl.Config(mode=display_mode)
        except gtk.gdkgl.NoMatches:
            raise SystemExit

        print "is RGBA:",                 glconfig.is_rgba()
        print "is double-buffered:",      glconfig.is_double_buffered()
        print "is stereo:",               glconfig.is_stereo()
        print "has alpha:",               glconfig.has_alpha()
        print "has depth buffer:",        glconfig.has_depth_buffer()
        print "has stencil buffer:",      glconfig.has_stencil_buffer()
        print "has accumulation buffer:", glconfig.has_accum_buffer()
        print

        # PixmapDrawingArea
        drawing_area = PixmapDrawingArea(glconfig)
        drawing_area.set_size_request(200, 200)
        vbox.pack_start(drawing_area)

        # Unrealize drawing_area on quit.
        gtk.quit_add(gtk.main_level()+1, self._on_quit, drawing_area)

        # A quit button.
        button = gtk.Button('Quit')
        button.connect('clicked', gtk.main_quit)
        vbox.pack_start(button, expand=False)
Exemple #19
0
    def __init__(self, host, port, lamp):
        self.host = host
        self.port = port
        self.lamp = lamp

        self.connect()

        color_selector = gtk.ColorSelection()
        color_selector.connect("color_changed", self.color_changed)
 
        window = gtk.Window()
        window.set_title("Moody: Moodlamp Color Selector")
        window.connect("delete_event", gtk.main_quit)
        window.set_border_width(10)
        window.add(color_selector)
        window.show_all()

        gtk.quit_add(gtk.main_level(), self.exit)
        gtk.main()
    def __init__(self, vlabel = False):
        gtk.HBox.__init__(self)
        
        self.tooltip = globals.tooltips.set_tip
        
        self.eb = gtk.EventBox()
        self.bar = gtk.ProgressBar()
        self.bar.set_orientation(gtk.PROGRESS_BOTTOM_TO_TOP)
        self.bar.set_size_request(11, 55)
        
        self.label = gtk.Label(self.name)
        self.pack_start(self.label)
        self.pack_start(self.eb)
        self.eb.add(self.bar)

        self.f = open(self.file)
        gtk.quit_add(0, self.quit)
        self.update()
        gobject.timeout_add(500, self.update)

        self.show_all()
Exemple #21
0
    def gtk_quit_init(self):
        """
		Adds the hooks required to detect when GTK has quit.
		"""
        # Add the hook if not already added
        if self.gtk_quit_handler_id is None:

            def on_quit():
                """
				Callback on GTK quit.
				"""
                with self.on_gtk_quit_lock:
                    self.quit_occurred = True
                    for func, args, kwargs in self.on_gtk_quit:
                        try:
                            func(*args, **kwargs)
                        except Exception, e:
                            sys.stderr.write(traceback.format_exc())

            self.gtk_quit_handler_id = gtk.quit_add(0, on_quit)
    def __init__(self, drone=None):
            
        gobject.threads_init()
        if drone is not None:
            self.drone = drone
        else:
            import drone
            self.drone = drone.main()
            self.drone.gui = self

        self.detector = self.drone.get_detector_sensor()
        self.sensors = self.drone.get_sensors()
	self.wifi_sensor = self.drone.get_wifi_sensor()
	self.video_sensor = self.drone.get_video_sensor()
	self.navdata_sensor = self.drone.get_navdata_sensor()
        self.controller_manager = self.drone.get_controller_manager()
        self.task_manager = self.drone.get_task_manager()

	self.show_targets = False
	self.show_significance = False

        # Glade stuff ---------
	# Set the Glade file
        self.gladefile = "demogui.glade"  
        self.wTree = gtk.glade.XML(self.gladefile)
        self.window = self.wTree.get_widget("mainWindow")

        if self.window:
            self.window.connect("destroy", self.stop)#gtk.main_quit)
            self.window.connect('key_press_event', self.handle_key_pressed) 

        self.drawing = self.wTree.get_widget("draw1")
	self.drawing.connect("configure-event", self.configure_event)
	self.drawing.connect("expose-event", self.expose_event)

	self.radiobutton1 = self.wTree.get_widget("radiobutton1")
	self.radiobutton2 = self.wTree.get_widget("radiobutton2")
	self.radiobutton3 = self.wTree.get_widget("radiobutton3")
	self.radiobutton4 = self.wTree.get_widget("radiobutton4")

        self.wifi_buttons = self.wTree.get_widget("hbox2")

	self.button1 = self.wTree.get_widget("button1")
	self.button2 = self.wTree.get_widget("button2")
	self.button3 = self.wTree.get_widget("button3")
        self.button4 = self.wTree.get_widget("button4")

	self.radiobutton1.connect("toggled", self.handle_radiobuttons_pressed)
	self.radiobutton2.connect("toggled", self.handle_radiobuttons_pressed)
	self.radiobutton3.connect("toggled", self.handle_radiobuttons_pressed)
	self.radiobutton4.connect("toggled", self.handle_radiobuttons_pressed)

	# Create our dictionary and connect it
        dic = {"btn2OnClick" : self.toggle_targets,
	       "btn3OnClick" : self.toggle_significance,
	       "btn4OnClick" : self.take_sample,
	       "btn5OnClick" : self.set_target,
	       "btn6OnClick" : self.toggle_capture}

	
        self.wTree.signal_autoconnect(dic)
	gtk.quit_add(0, self.drone.stop, True)
Exemple #23
0
 def __init__(self, library, window, player):
     self.__open(library, window, player)
     gtk.quit_add(1, self.__cleanup)
Exemple #24
0
 def __init__(self, player):
     player.connect('song-started', self.__started)
     player.connect('song-ended', self.__ended)
     gtk.quit_add(1, self.__cleanup)
Exemple #25
0
 def __init__(self):
     gtk.quit_add(0, self.quit)
Exemple #26
0
gtk_window.set_reallocate_redraws (True)
gtk_window.connect ('delete_event', gtk.main_quit)
vbox = gtk.VBox()
gtk_window.add (vbox)
display_mode = gtk.gdkgl.MODE_RGBA | gtk.gdkgl.MODE_DEPTH | gtk.gdkgl.MODE_DOUBLE | gtk.gdkgl.MODE_MULTISAMPLE
glconfig = gtk.gdkgl.Config (mode = display_mode)
drawing_area = gtk.DrawingArea ()
drawing_area.set_double_buffered(False)
drawing_area.glconfig = glconfig
drawing_area.gldrawable = None
drawing_area.glcontext = None


drawing_area.connect_after ('realize', on_realize)
drawing_area.connect ('size_allocate', on_size_allocate)
drawing_area.connect ('configure_event', on_configure_event)
drawing_area.connect ('expose_event', on_expose_event)
drawing_area.connect ('unrealize', on_unrealize)

drawing_area.set_size_request (1280, 720)
vbox.pack_start (drawing_area)
gtk.quit_add (gtk.main_level() + 1, on_quit, drawing_area)
button1 = gtk.Button ('Quit')
button1.connect ('clicked', gtk.main_quit)
vbox.pack_start(button1, expand = False)

gtk.timeout_add (1300, on_timer_tick, drawing_area)

gtk_window.show_all()
gtk.main()
Exemple #27
0
def gtk_main(Controller):
    """ main method for gtk frontend
    """
    global WEBKITERROR, INDICATORERROR, INFOBARERROR, PYNOTIFYERROR, MESSAGINGMENUERROR, GROWLERROR

    import gtk
    import gobject

    import AccountMenu
    import Avatar
    import AvatarChooser
    import AvatarManager
    import CallWidget
    import ContactMenu
    import ContactList
    import SyncTool
    import ContactInfo
    import Conversation
    import ConversationManager
    import ConversationToolbar
    import DebugWindow
    import Dialog
    import EmptyWidget
    import FileTransferBarWidget
    import FileTransferWidget
    import GroupMenu
    import GtkNotification
    try:
        import PyNotification
        import ThemeNotification
    except ImportError:
        PYNOTIFYERROR = True
    
    try:
        fsock = open("/usr/local/bin/growlnotify") 
        import GrowlNotification
    except IOError:
        GROWLERROR = True
        
    import Header
    import ImageAreaSelector
    import ImageChooser

    try:
        import Indicator
    except ImportError:
        INDICATORERROR = True
    try:
        import MessagingMenu
    except ImportError:
        MESSAGINGMENUERROR = True

    import Login
    import MainMenu
    import MainWindow

    try:
        import InfoBar
    except ImportError:
        INFOBARERROR = True
    import NiceBar

    import PluginWindow
    import Preferences
    import Renderers
    import StatusMenu
    import TabWidget
    import TextBox
    import TrayIcon
    import UserPanel
    import Window

    try:
        import AdiumTextBox
    except ImportError:
        WEBKITERROR = True
    
    import PictureHandler

    setup()
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    gtk.quit_add(0, controller.on_close)
    gtk.main()
    gtk.gdk.threads_leave()
Exemple #28
0
def gtk_main(Controller):
    """ main method for gtk frontend
    """
    global WEBKITERROR, INFOBARERROR

    import gtk
    import gobject

    import AccountMenu
    import Avatar
    import AvatarChooser
    import AvatarManager
    import CallWidget
    import ContactMenu
    import ContactList
    import SyncTool
    import ContactInfoRotate
    import ContactInfoList
    import Conversation
    import ConversationManager
    import ConversationToolbar
    import DebugWindow
    import Dialog
    import EmptyWidget
    import FileTransferBarWidget
    import FileTransferWidget
    import GroupMenu

    import Header
    if not check_gtk3():
        import ImageAreaSelector
    else:
        import ImageAreaSelectorNew as ImageAreaSelector

    import Login
    import MainMenu
    import MainWindow
    import MarkupParser

    try:
        import InfoBar
    except ImportError:
        INFOBARERROR = True
    import NiceBar

    import PluginWindow
    import Preferences

    if not check_gtk3():
        import Renderers
    else:
        import RenderersNew as Renderers

    import StatusMenu
    import TabWidget
    import TextBox
    import UserPanel
    import Window

    try:
        import AdiumTextBox
    except ImportError:
        WEBKITERROR = True

    import PictureHandler

    setup()
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    gtk.quit_add(0, controller.on_close)
    gtk.main()
    gtk.gdk.threads_leave()
  def __init__(self, sqlFilepath, parent=None):
    gtk.Window.__init__(self)
    try:
      self.set_screen(parent.get_screen())
    except AttributeError:
      self.connect('destroy', lambda *w: gtk.main_quit())
    self.set_title('Addressbook')
    icon_theme = gtk.icon_theme_get_default()
    icon = icon_theme.load_icon('stock_new-address-book', 48, 0)
    self.set_icon(icon)
    gtk.window_set_default_icon(icon)

    hbox = gtk.HBox(False, 8)
    self.add(hbox)

    button_hbox = gtk.HButtonBox()
    button_hbox.set_layout(gtk.BUTTONBOX_START)
    button_hbox.set_spacing(8)
    add_button = gtk.Button('_Add', gtk.STOCK_ADD)
    edit_button = gtk.Button('_Edit', gtk.STOCK_EDIT)
    del_button = gtk.Button('_Delete', gtk.STOCK_DELETE)
    import_button = gtk.Button('_Import vCard')
    import_button.set_image( gtk.image_new_from_pixbuf(gtk.icon_theme_get_default().load_icon('vcard', gtk.ICON_SIZE_BUTTON, 0)) )
    export_button = gtk.Button('_Export vCard')
    export_button.set_image( gtk.image_new_from_pixbuf(gtk.icon_theme_get_default().load_icon('vcard', gtk.ICON_SIZE_BUTTON, 0)) )
    settings_button = gtk.Button('_Synchronisation settings')
    settings_button.set_image( gtk.image_new_from_pixbuf(gtk.icon_theme_get_default().load_icon('stock_properties', gtk.ICON_SIZE_BUTTON, 0)) )
    button_hbox.pack_start(add_button)
    button_hbox.pack_start(edit_button)
    button_hbox.pack_start(del_button)
    button_hbox.pack_start(import_button)
    button_hbox.pack_start(export_button)
    button_hbox.pack_start(settings_button)
    add_button.connect('clicked', self.add_contact)
    edit_button.connect('clicked', self.edit_contact)
    del_button.connect('clicked', self.delete_contact)
    import_button.connect('clicked', self.import_file)
    export_button.connect('clicked', self.export_file)
    settings_button.connect('clicked', self.open_settings)

    vbox = gtk.VBox(False, 0)
    sw = gtk.ScrolledWindow()
    sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
    vbox.pack_start(sw, True, True, 2)
    vbox.pack_end(button_hbox, False, False, 8)
    hbox.pack_start(vbox, True, True, 2)

    # idx in card_list, formatted name, email, bday, next_bday_diff (for sorting), tel
    self.model = gtk.ListStore( gobject.TYPE_INT, gobject.TYPE_STRING, gobject.TYPE_STRING,
                                gobject.TYPE_STRING, gobject.TYPE_LONG, gobject.TYPE_STRING )
    self.treeview = gtk.TreeView(self.model)
    self.treeview.set_rules_hint(True)
    self.treeview.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
    sw.add(self.treeview)
    column = gtk.TreeViewColumn('Name', gtk.CellRendererText(), text=1)
    column.set_resizable(True)
    column.set_sort_column_id(1)
    self.treeview.append_column(column)
    column = gtk.TreeViewColumn('Email', gtk.CellRendererText(), text=2)
    column.set_resizable(True)
    column.set_sort_column_id(2)
    self.treeview.append_column(column)
    column = gtk.TreeViewColumn('Birthday', gtk.CellRendererText(), text=3)
    column.set_resizable(True)
    column.set_sort_column_id(4)
    self.treeview.append_column(column)
    column = gtk.TreeViewColumn('Telephone', gtk.CellRendererText(), text=5)
    column.set_resizable(True)
    column.set_sort_column_id(5)
    self.treeview.append_column(column)
    self.treeview.get_selection().connect('changed', self.on_selection_changed)
    self.treeview.connect('row_activated', self.on_row_activated)

    self.vcard_label = gtk.Label()
    self.vcard_label.set_selectable(True)
    hbox.pack_end(self.vcard_label, False, False, 2)

    self.card_list_sql = {}
    self.key_from_href = {}
    self.max_key = 0
    self.sqlFilepath = sqlFilepath
    self.read_contacts_from_db(self.sqlFilepath)
    self.treeview.get_column(0).clicked()
    self.show_all()
    self.maximize()

    gobject.threads_init()
    self.syncerThreadQueue = Queue.Queue()
    self.syncerThreadQueue.put('full_sync')
    self.syncerThread = threading.Thread(target=sync.SyncerThread, kwargs={"queue": self.syncerThreadQueue, "addressbook": self})
    self.syncerThread.start()

    gtk.quit_add(0, self.stopSyncerThread)

    for sig in (SIGINT, SIGTERM):
      signal(sig, gtk.main_quit)
Exemple #30
0
	def stop(self, *args):
		self.mpdclient.stop()
		self.notify()

	def open_preferences(self, *args):
		IndiMPCPreferencesDialog()
		self.notify()

	def launch_player(self, *args):
		if self.config.client_mode == "guake":
			# we will control guake via DBus
			guake = self.bus.get_object('org.guake.RemoteControl', '/org/guake/RemoteControl')
			guake.execute_command("q\n" + self.config.client_command, dbus_interface="org.guake.RemoteControl") # "q\n" is a hack so ncmpcpp will quit if it's already running in the terminal (we can't do better with the guake DBus API)
			guake.show_forced(dbus_interface="org.guake.RemoteControl") # this depends on our patch for guake
		elif self.config.client_mode == "standalone":
			pargs = self.config.client_command.split()
			Popen(pargs)
		else: # we will assume we are running a terminal client; the mode is the terminal emulator we will use
			pargs = [self.config.client_mode, "-e"] # gnome-terminal, xterm and uxterm work with -e
			pargs.extend(self.config.client_command.split())
			Popen(pargs)
		self.notify()

if __name__ == "__main__":
	if "-p" in sys.argv:
		IndiMPCPreferencesDialog()
	else:
		indimpc = IndiMPDClient()
		gtk.quit_add(0, indimpc.close)
	gtk.main()
Exemple #31
0
 def __init__(self):
     gtk.quit_add(0, self.quit)
Exemple #32
0
 def run(self):
     gtk.quit_add(0,self.termme)
     while(not self.term):
         polldata = xinputextdev.poll()
         if polldata!=[]:
             gobject.idle_add(self.events,polldata)
Exemple #33
0
    def stop(self):
        self.is_sample = False
        try:
            self.playerL.stop()
        except:
            print "playerL stops---"
        try:
            self.playerR.stop()
        except:
            print "playerR stops---"
            
        return 0
 


if __name__ == "__main__":    
    parser = argparse.ArgumentParser(description='Configure the arguments of this program')
    parser.add_argument("-m", "--show_movie", help="show the movie or not", dest="show_movie", action="store_false")
    #parser.add_argument("-g", "--show_gui", help="show gui or not", dest="show_gui", action="store_false")
    parser.add_argument("-f", "--show_figure", help="show monitoring figue or not", dest="show_figure", action="store_false")
     
    args = parser.parse_args()
    
    print args
    
    gui = Gui(args)
    gtk.quit_add(0, gui.stop)
    gtk.main()
    print "stop-"