def __init__(self): MSD.init_i18n() self._widget_tree = gtk.glade.XML(MSD.glade_files_dir + "agenda.glade" ,"contact_editor_dialog") self._dlg = self._widget_tree.get_widget("contact_editor_dialog") self._dlg.set_icon_from_file(MSD.icons_files_dir + "addressbook_16x16.png") self._dlg.hide() self._dlg.connect("delete-event",self.on_dialog_delete) self._name_entry = self._widget_tree.get_widget("name_entry") self._mobile_phone_entry = self._widget_tree.get_widget("mobile_phone_entry") self._email_entry = self._widget_tree.get_widget("email_entry") self._ok_button = self._widget_tree.get_widget("ok_button") self._ok_button.set_sensitive(False) self._name_entry.connect("changed", self.__entry_changed, None) self._mobile_phone_entry.connect("changed", self.__entry_changed, None) self._email_entry.connect("changed", self.__entry_changed, None)
def __init__(self, sync): MSD.init_i18n() self._widget_tree = gtk.glade.XML(MSD.glade_files_dir + "agenda.glade" ,"import_progress_dialog") self._dlg = self._widget_tree.get_widget("import_progress_dialog") self._progress = self._widget_tree.get_widget("progressbar") self._cancel = self._widget_tree.get_widget("cancel_button") self._cancel.connect("clicked",self.on_clicked) self._dlg.connect("destroy",self.on_destroy) self._image = self._widget_tree.get_widget("image") self._anim = gtk.gdk.PixbufAnimation(MSD.icons_files_dir + "movistar.gif") self._animit = self._anim.get_iter() self._timeout = gobject.timeout_add(100, self.on_timeout) self._timeoutanim = gobject.timeout_add(50, self.on_timeout_anim) self._sync = sync self._cancelando = False self._dlg.set_deletable(False) self._dlg.set_icon_from_file(MSD.icons_files_dir + "synchronize_32x32.png") self._dlg.run()
def __init__(self, act_manager, conf, conn_manager): print "Init MSDAction" MSD.init_i18n() self.act_manager = act_manager self.conf = conf self.conn_manager = conn_manager self.codename = str(self.__class__).split(".")[-1] action_dir = os.path.join(MSD.actions_data_dir , self.codename) self.xml_prefs = gtk.glade.XML(os.path.join(action_dir,"%s.glade" % self.codename), root="action_prefs_main_container") self.prefs_main_container = self.xml_prefs.get_widget ("action_prefs_main_container") self.conf_container = self.xml_prefs.get_widget("action_conf_container") self.xml_connect = gtk.glade.XML(os.path.join(MSD.glade_files_dir,"connect-preferences-frame.glade"), root="connect_container") self.connect_container = self.xml_connect.get_widget("connect_container") self.manual_connection_check_button = self.xml_connect.get_widget("manual_connection_check_button") self.connections_combobox = self.xml_connect.get_widget("connections_combobox") self.remove_service_button = self.xml_connect.get_widget("remove_service_button") self.install_service_alignment = self.xml_connect.get_widget("install_service_alignment") self.uninstall_service_alignment = self.xml_connect.get_widget("uninstall_service_alignment") self.install_service_button = self.xml_connect.get_widget("install_service_button") self.installed_service_label = self.xml_prefs.get_widget("installed_service_label") self.uninstalled_service_label = self.xml_prefs.get_widget("uninstalled_service_label") self.connection_vbox = self.xml_connect.get_widget("connection_vbox") if self.conf.exists_action_conf(self.codename) == False: default_conf = self.get_default_conf() default_conf['installed'] = True self.conf.set_default_action_conf(self.codename, default_conf) self.prefs_main_container.pack_end(self.connect_container) action_main_title = self.get_action_main_title() self.prefs_main_container.pack_start(action_main_title, expand=False) self.prefs_main_container.reorder_child(action_main_title, 0) self.progress_dialog = MSD.MSDProgressWindow() self.progress_dialog.set_show_buttons(False) #self.progress_dialog.set_image(gtk.STOCK_DIALOG_INFO) self.timer_id = 0
def __init__(self,address_book,conf,preferences): MSD.init_i18n() self._addressbook = address_book self.conf = conf self.preferences = preferences self._model = None self._last_search_text ="" self._clip_board = None # Main window self._widget_tree = gtk.glade.XML(MSD.glade_files_dir + "agenda.glade", "main_window") self._main_window = self._widget_tree.get_widget("main_window") self._header_image = self._widget_tree.get_widget("header_image") # add self._add_contact_button = self._widget_tree.get_widget("add_contact_button") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "contactonuevo_32x32.png") self._add_contact_button.set_icon_widget(icon) icon.show() # remove self._remove_contact_button = self._widget_tree.get_widget("remove_contact_button") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "eliminarcontacto_32x32.png") self._remove_contact_button.set_icon_widget(icon) icon.show() # synchronize self._synchronize_contacts_button = self._widget_tree.get_widget("synchronize_contacts_button") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "synchronize_32x32.png") self._synchronize_contacts_button.set_icon_widget(icon) icon.show() # edit self._edit_contact_button = self._widget_tree.get_widget("edit_contact_button") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "editarcontacto_32x32.png") self._edit_contact_button.set_icon_widget(icon) icon.show() self._send_mail_button = self._widget_tree.get_widget("mail_button") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "mail_32x32.png") self._send_mail_button.set_icon_widget(icon) icon.show() self._contact_treeview = self._widget_tree.get_widget("contact_treeview") self._search_entry = self._widget_tree.get_widget("search_entry") self._clear_search_entry_button = self._widget_tree.get_widget("clear_search_entry_button") tmp_widget = self._widget_tree.get_widget("search_image") tmp_widget.set_from_file(MSD.icons_files_dir + "buscar_16x16.png") # Looking self._main_window.set_icon_from_file(MSD.icons_files_dir + "addressbook_16x16.png") self._header_image.set_from_file(os.path.join(MSD.icons_files_dir,"cabecera-agenda.png")) # About dialog self._xml_about = gtk.glade.XML(MSD.glade_files_dir + "agenda.glade", "about_dialog") self._about_dialog = self._xml_about.get_widget ("about_dialog") self._about_dialog.set_name (_(u"Escritorio Movistar - Beta")) self._about_dialog.set_version (self.conf.get_version()) self._about_dialog.set_logo (gtk.gdk.pixbuf_new_from_file((MSD.icons_files_dir + "addressbook_48x48.png"))) self._about_dialog.set_icon_from_file(MSD.icons_files_dir + "addressbook_16x16.png") self._about_dialog.hide() self._about_dialog.connect("delete-event", self.__on_about_close_clicked) # Menu self._menu_modif_contact_item = self._widget_tree.get_widget("modificar_contacto1") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "editarcontacto_16x16.png") self._menu_modif_contact_item.set_image(icon) self._menu_remove_contact_item = self._widget_tree.get_widget("borrar_contacto1") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "eliminarcontacto_16x16.png") self._menu_remove_contact_item.set_image(icon) menu_item = self._widget_tree.get_widget("nuevo_contacto1") icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "contactonuevo_16x16.png") menu_item.set_image(icon) menu_item2 = self._widget_tree.get_widget("importar1") icon2 = gtk.Image() ; icon2.set_from_file(MSD.icons_files_dir + "synchronize_16x16.png") menu_item2.set_image(icon2) item_dict = {"on_nuevo_contacto1_activate": self.on_add_button_clicked, "on_exportar1_activate": self.__on_export_clicked, "on_importar1_activate": self.__on_import_clicked, "on_salir1_activate": self.on_window_delete, #"on_cortar1_activate": self.__on_cut_clicked, #"on_copiar1_activate": self.__on_copy_clicked, #"on_pegar1_activate": self.__on_paste_clicked, "on_modificar_contacto1_activate": self.on_edit_button_clicked, "on_borrar_contacto1_activate": self.on_remove_button_clicked, "on_importar1_activate": self.on_synchronize_button_clicked, "on_abrir_configuracion1_activate": self.__on_config_clicked, "on_ver_ayuda1_activate": self.__on_show_help_clicked #"on_acerca_de1_activate": self.__on_about_clicked } self._widget_tree.signal_autoconnect(item_dict) # Contacts treeview self.__build_model() self._contact_editor = MDContactEditor() self.__build_treeview(self._contact_treeview) tips = gtk.Tooltips() tips.set_tip(self._contact_treeview, "") # Contextual menu self._xml = gtk.glade.XML(MSD.glade_files_dir + "agenda.glade", "addresbook_ctx_menu") self._contextual_menu = self._xml.get_widget ("addresbook_ctx_menu") menu_item = gtk.ImageMenuItem (_(u"Eliminar contacto")) icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "eliminarcontacto_16x16.png") menu_item.set_image(icon) menu_item.connect ("activate", self.on_remove_button_clicked) menu_item.show_all() self._contextual_menu.append (menu_item) menu_item = gtk.ImageMenuItem (_(u"Modificar contacto")) icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "editarcontacto_16x16.png") menu_item.set_image(icon) menu_item.connect ("activate", self.on_edit_button_clicked) menu_item.show_all() self._ctx_edit_contact__menu_item = menu_item self._contextual_menu.append (menu_item) menu_item = gtk.ImageMenuItem (_(u"Nuevo contacto")) icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "contactonuevo_16x16.png") menu_item.set_image(icon) menu_item.connect ("activate", self.on_add_button_clicked) menu_item.show_all() self._contextual_menu.append (menu_item) menu_item = gtk.ImageMenuItem(_(u"Enviar Correo")) icon = gtk.Image() ; icon.set_from_file(MSD.icons_files_dir + "mail_16x16.png") menu_item.set_image(icon) menu_item.connect ("activate", self.on_send_mail_button_clicked) menu_item.show_all() self._ctx_send_mail_menu_item = menu_item self._contextual_menu.prepend (menu_item) # Signals self._main_window.connect("delete-event",self.on_window_delete) self._add_contact_button.connect("clicked",self.on_add_button_clicked) self._remove_contact_button.connect("clicked",self.on_remove_button_clicked) self._edit_contact_button.connect("clicked",self.on_edit_button_clicked) self._synchronize_contacts_button.connect("clicked",self.on_synchronize_button_clicked) self._send_mail_button.connect("clicked",self.on_send_mail_button_clicked) self._search_entry.connect("changed",self.on_search_entry_changed); self._clear_search_entry_button.connect("clicked", self.on_clear_search_entry_button_clicked) self._contact_treeview.connect("button_press_event",self.__contact_treeview_button_event_cb) self._contact_treeview.connect("key_press_event",self.__contact_treeview_key_event_cb) self._contact_treeview.connect("cursor-changed",self.__contact_treeview_cursor_changed_cb,None) self._contact_treeview.connect("motion-notify-event", self.__contact_treeview_tooltip, tips, None) treeselection = self._contact_treeview.get_selection() treeselection.set_mode (gtk.SELECTION_MULTIPLE) treeselection.connect ("changed", self.__contact_treeview_cursor_changed_cb, None) # Glade fix #tmp_widget = self._widget_tree.get_widget ("addb_alignment_search") #tmp_widget.set (1, 0.50, 0, 1) self._main_window.hide()
def __init__(self, main_window_obj): MSD.init_i18n() self.main_window_obj = main_window_obj self.conf = main_window_obj.MSDConf self.act_manager = main_window_obj.MSDActManager self.main_actions_view = main_window_obj.main_actions_view self.main_device_label= main_window_obj.device_selected_label self.main_stats = main_window_obj.main_stats self.main_connmanager = main_window_obj.MSDConnManager self.exporter = MSD.MSDExporter(self.conf) self.importer = MSD.MSDImporter(self.conf) self.xml = gtk.glade.XML(MSD.glade_files_dir + "preferences.glade") self.preferences_dialog = self.xml.get_widget("preferences_dialog") self.preferences_dialog.set_icon_from_file(MSD.icons_files_dir + "configuracion_16x16.png") self.close_button = self.xml.get_widget("close_button") self.actions_prefs_area = self.xml.get_widget("actions_prefs_area") self.prefs_notebook = self.xml.get_widget("preferences_notebook") self.prefs_notebook.set_show_tabs(False) self.prefs_main_treeview = self.xml.get_widget("preferences_main_treeview") self.actions_iters = {} self.actions_paths = {} self.last_preference_path = None self.populate_prefs_main_treeview() self.initial_device_selected = self.conf.get_device_selected() #Init Tabs Objects #self.addressbook_tab = MSD.MSDAddressbookTab(self) self.general_tab = MSD.MSDGeneralTab(self, self.main_window_obj.mcontroller) self.addressbook_tab = MSD.MSDAddressbookTab(self) self.connections_tab = MSD.MSDConnectionsTab(self) self.bookmarks_tab = MSD.MSDBookmarksTab(self) self.services_tab = MSD.MSDServicesTab(self) self.security_tab = MSD.MSDSecurityTab(self) #FIXED : Controller self.devices_tab = MSD.MSDDevicesTab(self, self.main_window_obj.mcontroller) self.tabs=[self.general_tab, self.addressbook_tab, self.bookmarks_tab, self.services_tab, self.security_tab, self.devices_tab, self.connections_tab] #Signals treeselection = self.prefs_main_treeview.get_selection() treeselection.set_mode(gtk.SELECTION_SINGLE) treeselection.connect("changed" , self.__prefs_main_treview_row_changed_cb, None) treeselection.select_path(0) self.preferences_dialog.connect("delete_event", self.__delete_event_preferences_cb) self.close_button.connect("clicked", self.__close_preferences_cb, None) #Connect the tab's signals self.general_tab.connect_signals() self.addressbook_tab.connect_signals() self.bookmarks_tab.connect_signals() self.services_tab.connect_signals() self.connections_tab.connect_signals() self.security_tab.connect_signals()
def __init__(self): MSD.init_i18n() self.xml = gtk.glade.XML(MSD.glade_files_dir + "mainwindow.glade") self.main_window = self.xml.get_widget("main_window") self.main_window.set_icon_from_file(MSD.icons_files_dir + "main_window_icon.png") self.main_vbox = self.xml.get_widget("main_vbox") #FIXED : Controller self.mcontroller = MSD.MobileManagerControllerClient() self.main_toolbar = MSD.MSDMainToolbar() #FIXED : Controller self.main_stats = MSD.MSDMainStatsWidget(self.mcontroller) self.rss = MSD.MSDRSSFeeder() self.main_vbox.pack_start(self.main_toolbar) self.main_vbox.reorder_child(self.main_toolbar, 0) self.main_vbox.pack_start(self.main_stats) self.main_vbox.reorder_child(self.main_stats, 3) self.actions_scrolled_window = self.xml.get_widget("actions_scrolled_window") self.main_actions_view = self.xml.get_widget("main_actions_view") self.bookmarks_button = self.main_toolbar.bookmarks_button self.preferences_button = self.main_toolbar.preferences_button self.addressbook_button = self.main_toolbar.addressbook_button self.help_button = self.main_toolbar.help_button self.expander_eventbox = self.xml.get_widget("expander_eventbox") self.expander_eventbox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#ecf1fb")) self.main_separator = self.xml.get_widget("main_separator") self.mini_banner_eventbox = self.xml.get_widget("mini_banner_eventbox") self.mini_banner_eventbox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#525774")) self.mini_banner_image = self.xml.get_widget("mini_banner_image") self.mini_banner_image.set_from_file(MSD.icons_files_dir + "mini_banner.png") self.device_eventbox = self.xml.get_widget("device_eventbox") self.device_eventbox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#515774")) self.main_statusbar = self.xml.get_widget("main_statusbar") self.connect_statusbar_im = gtk.Image() self.connect_statusbar_im.set_from_file(MSD.icons_files_dir + "conectado.png") self.disconnect_statusbar_im = gtk.Image() self.disconnect_statusbar_im.set_from_file(MSD.icons_files_dir + "no-conectado.png") self.main_statusbar.pack_start(self.connect_statusbar_im, expand=False) self.main_statusbar.pack_start(self.disconnect_statusbar_im, expand=False) self.connect_statusbar_im.hide() self.disconnect_statusbar_im.hide() self.main_statusbar.reorder_child(self.connect_statusbar_im, 0) self.main_statusbar.reorder_child(self.disconnect_statusbar_im, 1) self.card_statusbar = gtk.Statusbar() self.card_statusbar.set_has_resize_grip(False) self.main_statusbar.pack_end(self.card_statusbar, expand=True) self.card_statusbar.hide() self.consum_button = self.main_stats.consum_button self.connect_button = self.main_stats.connect_button self.disconnect_button = self.main_stats.disconnect_button self.expander_on_button = self.xml.get_widget("expander_on_button") self.expander_off_button = self.xml.get_widget("expander_off_button") self.device_selected_button = self.xml.get_widget("device_selected_button") self.device_selected_label = self.xml.get_widget("device_selected_label") self.device_selected_button.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.color_parse("#717aa6")) self.device_selected_button.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse("#717aa6")) self.device_selected_button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.color_parse("#717aa6")) #FIXED : UI self.at_options_button = MobileManager.ui.MobileATOptionsButton() #FIXED : Controller dev = self.mcontroller.get_active_device() #FIXED : Controller (esto puede dar None?) if dev == None : self.device_selected_label.set_markup(_(u'<span foreground="white">Ningún dispositivo disponible</span>')) else: #FIXED : Set odev = self.mcontroller.get_device_obj_from_path(dev) self.device_selected_label.set_markup ('<span foreground="white">%s</span>' % odev.get_prettyname()) self.mcontroller.set_active_device(dev) self.can_show_main_pcmcia_menu = False self.MSDConf = MSD.MSDConf() self.MSDConnManager = MSD.MSDConnectionsManager(self.MSDConf, self) self.main_actions_menu_item_mail = gtk.MenuItem(_(u"Nuevo correo")) self.MSDActManager = MSD.MSDActionsManager(self.MSDConf, self.MSDConnManager) liststore = self.MSDActManager.get_actions_model() cellrenderpixbuf = gtk.CellRendererPixbuf() cellrenderpixbuf.set_property('cell-background', '#DEDEDE') cellrendertext = gtk.CellRendererText() cellrendertext.set_property('cell-background', '#DEDEDE') column = gtk.TreeViewColumn('MAV_icon', cellrenderpixbuf, pixbuf=0, cell_background_set=3) self.main_actions_view.append_column(column) column = gtk.TreeViewColumn('MAV_name', cellrendertext, markup=1, cell_background_set=3) self.main_actions_view.append_column(column) # assign the tooltip tips = gtk.Tooltips() tips.set_tip(self.main_actions_view, "") self.main_actions_view.set_model(liststore) self.preferences = MSD.MSDPreferencesDialog(self) self.MSDActManager.set_connections_model(self.preferences.get_connections_model()) # Consum emtraffic.set_db_file(get_user_traffic_db_path()) emtraffic.set_version( MSD.msd_version_major, MSD.msd_version_minor, MSD.msd_version_update, MSD.msd_version_string) self.consum = MSD.MSDConsumWindow(self.MSDConf) #FIXED: mcontroller self.consum_manager = MSD.MSDConsumManager(self.mcontroller, self.main_stats, self.consum,self.MSDConf) # Help stuff self.progress_dialog = MSD.MSDProgressWindow() self.progress_dialog.set_show_buttons(False) self.timer_id = 0 self.help_dialog = self.xml.get_widget("help_window") self.help_dialog.set_icon_from_file(MSD.icons_files_dir + "ayuda_16x16.png") self.hd_help_button = self.xml.get_widget("help_button") self.hd_help_online_button = self.xml.get_widget("help_online_button") self.hd_help_close_button = self.xml.get_widget("help_close_button") self.hd_help_info_treeview = self.xml.get_widget("help_info_treeview") self.help_liststore = gtk.ListStore(str, str) column = gtk.TreeViewColumn('Option_key', gtk.CellRendererText(), markup=0) self.hd_help_info_treeview.append_column(column) column = gtk.TreeViewColumn('Option_value', gtk.CellRendererText(), markup=1) self.hd_help_info_treeview.append_column(column) self.hd_help_info_treeview.set_model(self.help_liststore) # Bookmarks self.bookmarks_menu = gtk.Menu() for bookmark in self.MSDConf.get_bookmarks_list(): self.bookmarks_menu.append(gtk.MenuItem(gobject.markup_escape_text(bookmark[0]), False)) #Warning self.warning_dialog = MSD.MSDWarningDialog(self.xml, self.main_window, self.MSDConf) # Main actions menu self.main_actions_menu = gtk.Menu() self.main_actions_menu_item_open = gtk.ImageMenuItem(_(u"Abrir")) self.main_actions_menu_item_config = gtk.MenuItem(_(u"Configuración")) self.main_actions_menu_item_install = gtk.MenuItem(_(u"Instalar")) self.main_actions_menu_item_help = gtk.ImageMenuItem(gtk.STOCK_HELP) self.main_actions_menu.append (self.main_actions_menu_item_mail) self.main_actions_menu.append (self.main_actions_menu_item_open) self.main_actions_menu.append (self.main_actions_menu_item_config) self.main_actions_menu.append (self.main_actions_menu_item_install) self.main_actions_menu.append (self.main_actions_menu_item_help) #Signals ! self.MSDActManager.connect_signals() self.main_window.connect("delete-event", self.__closeapp_cb, None) self.bookmarks_button.connect("clicked", self.__show_bookmarks_cb, None) self.addressbook_button.connect("clicked",self.__show_addressbook_cb,None) self.preferences_button.connect("clicked", self.__show_preferences_cb, None) self.help_button.connect("clicked", self.__show_help_cb, None) self.hd_help_button.connect("clicked", self.__open_help_button_cb, None) self.hd_help_online_button.connect("clicked", self.__open_help_online_button_cb, None) self.hd_help_close_button.connect("clicked", self.__close_help_dialog_cb, None) self.help_dialog.connect("delete_event", self.__close_help_dialog_cb) self.expander_on_button.connect("clicked", self.__expander_on_button_cb, None) self.expander_off_button.connect("clicked", self.__expander_off_button_cb, None) self.consum_button.connect("clicked", self.__consum_button_cb) self.device_selected_button.connect("clicked", self.__device_selected_button_cb, None) self.main_actions_view.connect("row-activated", self.__action_activated_cb, None) self.main_actions_view.connect("event", self.__roll_over_main_actions_treeview_cb, None) self.main_actions_view.connect("motion-notify-event", self.__main_actions_view_tooltip, tips, 4) self.main_actions_view.set_events(gtk.gdk.POINTER_MOTION_MASK) self.main_actions_menu_item_mail.connect("activate", self.__main_actions_menu_item_mail_cb, None) self.main_actions_menu_item_open.connect("activate", self.__main_actions_menu_item_open_cb, None) self.main_actions_menu_item_config.connect("activate", self.__main_actions_menu_item_config_cb, None) self.main_actions_menu_item_install.connect("activate", self.__main_actions_menu_item_install_cb, None) self.main_actions_menu_item_help.connect("activate", self.__main_actions_menu_item_help_cb, None) #Rss stopper delegate self.mcontroller.dialer.add_stop_delegate(self.rss.kill_downloader) #FIXED : Controller self.mcontroller.connect ("active-device-changed", self.__active_device_changed_cb) self.mcontroller.connect ("active-dev-card-status-changed", self.__active_device_card_status_changed) #FIXME : Politica nueva? self.mcontroller.connect ("added-device", self.__device_added_cb) self.mcontroller.connect ("removed-device", self.__device_removed_cb) self.mcontroller.dialer.connect("connected", self.__connected_cb) self.mcontroller.dialer.connect("disconnected", self.__disconnected_cb) self.mcontroller.dialer.connect("connecting", self.__connecting_cb) self.mcontroller.dialer.connect("disconnecting", self.__disconnecting_cb) if self.MSDConnManager.ppp_manager.status() == MobileManager.PPP_STATUS_CONNECTED: self.mcontroller.dialer.emit("connected") self.pcmcia_manager = None # Systray #FIXED : Controller self.systray = MSD.MSDSystray(self.MSDConf, self.main_window, self.MSDConnManager, self.MSDActManager, self.mcontroller) self.MSDActManager.set_systray(self.systray) if self.MSDConf.get_ui_general_key_value ("systray_showing_mw"): self.main_window.show() else: self.main_window.hide() self.main_stats.show() self.main_toolbar.show() if self.MSDConf.get_ui_general_key_value("main_expander_on") == True: self.__expander_on_button_cb(None, None) else: self.__expander_off_button_cb(None, None) # pongo un timeout para ejecutar las acciones que deben se ejecutadas de manera autonoma (sin intervencion del usuario) # al cargarse la aplicacion gobject.timeout_add(1,self.__initial_actions_cb) if len(sys.argv) == 3 : if os.path.exists(sys.argv[2]): self.preferences.importer.import_from_file(sys.argv[2]) gobject.timeout_add(3000, self.__import_while_app_working_cb) # Addressbook self._addressbook_controller = None self._user_book = MSDAddressBook.get_user_addressbook() self._select_contact_window = self.xml.get_widget("select_contact_window") self._select_contact_window.set_icon_from_file(MSD.icons_files_dir + "mail_16x16.png") self._sc_send_mail_button = self.xml.get_widget("sc_send_mail_button") self._sc_cancel_button = self.xml.get_widget("sc_cancel_button") ## treeview self._sc_treeview = self.xml.get_widget("sc_contacts_treeview") base_id = 1 for field in [_(u"Nombre"),_(u"Correo electrónico")]: col = gtk.TreeViewColumn(field) self._sc_treeview.append_column(col) cell = gtk.CellRendererText() col.pack_start(cell, True) col.add_attribute(cell, 'text', base_id) col.set_resizable(True) cell.set_property("ellipsize", pango.ELLIPSIZE_END) base_id = base_id + 1 model = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING, gobject.TYPE_STRING) self._sc_treeview.set_model(model) #signals self._select_contact_window.connect("delete-event", self.__sl_delete_cb, None) self._sc_send_mail_button.connect("clicked", self.__sl_send_mail_cb, None) self._sc_cancel_button.connect("clicked", self.__sl_delete_cb, None) # Select active device if available # FIXED: Controller self.__select_active_device_on_init() # Feed updater #FIXED: Controller self.update_checker = MSD.MSDUpdateChecker (self.MSDConf, self.mcontroller)
def __init__(self, conf): self.conf = conf MSD.init_i18n() self.xml = gtk.glade.XML(MSD.glade_files_dir + "consum.glade") self.consum_window = self.xml.get_widget ("consum_window") self.consum_window.set_icon_from_file(MSD.icons_files_dir + "consumo_icon_16x16.png") self.consum_notebook = self.xml.get_widget ("consum_notebook") self.consum_header_image = self.xml.get_widget ("header_image") self.consum_header_image.set_from_file(MSD.icons_files_dir + "cabecera-consumo.png") self.consum_graph_hbox = self.xml.get_widget ("consum_graph_hbox") self.traffic_history_hbox = self.xml.get_widget ("traffic_history_hbox") self.consum_as_send_label = self.xml.get_widget("consum_actual_session_send_label") self.consum_as_recv_label = self.xml.get_widget("consum_actual_session_recv_label") self.consum_as_conntime_label = self.xml.get_widget("consum_actual_session_conntime_label") self.consum_as_mvs_label = self.xml.get_widget("consum_actual_session_mvs_label") self.consum_as_mvs_label.set_no_show_all(True) self.consum_as_mvr_label = self.xml.get_widget("consum_actual_session_mvr_label") self.consum_as_total_label = self.xml.get_widget("consum_actual_session_total_label") self.consum_total_sended_label = self.xml.get_widget("consum_total_sended_label") self.consum_total_recv_label = self.xml.get_widget("consum_total_recv_label") self.consum_total_traffic_label = self.xml.get_widget("consum_total_traffic_label") self.consum_total_traffic_label2 = self.xml.get_widget("consum_total_traffic_label2") self.consum_total_conntime_label = self.xml.get_widget("consum_total_conntime_label") self.consum_total_ro_sended_label = self.xml.get_widget("consum_total_ro_sended_label") self.consum_total_ro_recv_label = self.xml.get_widget("consum_total_ro_recv_label") self.consum_total_ro_traffic_label = self.xml.get_widget("consum_total_ro_traffic_label") self.consum_total_ro_traffic_label2 = self.xml.get_widget("consum_total_ro_traffic_label2") self.consum_total_ro_conntime_label = self.xml.get_widget("consum_total_ro_conntime_label") self.consum_max_upload_speed_label = self.xml.get_widget("consum_max_upload_speed_label") self.consum_max_upload_speed_label.set_no_show_all(True) self.consum_max_download_speed_label = self.xml.get_widget("consum_max_download_speed_label") self.consum_max_download_speed_label.set_no_show_all(True) self.consum_reset_button = self.xml.get_widget("consum_reset_button") self.consum_close_button = self.xml.get_widget("consum_close_button") self.consum_send_image = self.xml.get_widget("send_image") self.consum_send_image.set_from_file(MSD.icons_files_dir + "send_consum.png") self.consum_send_image2 = self.xml.get_widget("send_image2") self.consum_send_image2.set_from_file(MSD.icons_files_dir + "send_consum2.png") self.consum_send_image_red = self.xml.get_widget("send_image_red") self.consum_send_image_red.set_from_file(MSD.icons_files_dir + "send_consum2.png") self.consum_send_image_roaming = self.xml.get_widget("send_image_roaming") self.consum_send_image_roaming.set_from_file(MSD.icons_files_dir + "send_consum2.png") self.consum_help_button = self.xml.get_widget("consum_help_button") self.consum_recv_image = self.xml.get_widget("recv_image") self.consum_recv_image.set_from_file(MSD.icons_files_dir + "recv_consum.png") self.consum_recv_image2 = self.xml.get_widget("recv_image2") self.consum_recv_image2.set_from_file(MSD.icons_files_dir + "recv_consum2.png") self.consum_recv_image_red = self.xml.get_widget("recv_image_red") self.consum_recv_image_red.set_from_file(MSD.icons_files_dir + "recv_consum2.png") self.consum_recv_image_roaming = self.xml.get_widget("recv_image_roaming") self.consum_recv_image_roaming.set_from_file(MSD.icons_files_dir + "recv_consum2.png") self.header_image = self.xml.get_widget("header_image") self.consum_mb_warning_chk = self.xml.get_widget("consum_mb_warning_chk") self.consum_mb_limit_combo = self.xml.get_widget("consum_mb_limit_combo") self.consum_mb_limit_entry = self.xml.get_widget("consum_mb_limit_entry") self.consum_ro_mb_warning_chk = self.xml.get_widget("consum_ro_mb_warning_chk") self.consum_ro_mb_limit_entry = self.xml.get_widget("consum_ro_mb_limit_entry") self.consum_percent_warning_chk = self.xml.get_widget("consum_percent_warning_chk") self.consum_percent_entry = self.xml.get_widget("consum_percent_entry") self.consum_percent_mb_label = self.xml.get_widget("consum_percent_mb_label") self.consum_percent_hscale = self.xml.get_widget("consum_percent_hscale") self.consum_apply_button = self.xml.get_widget("consum_apply_button") self.consum_actual_session_type_label = self.xml.get_widget("consum_actual_session_type_label") self.consum_warning_image = self.xml.get_widget("consum_warning_image") self.consum_r_warning_image = self.xml.get_widget("consum_r_warning_image") self.consum_resumen_label = self.xml.get_widget("consum_resumen_label") self.consum_resumen_label2 = self.xml.get_widget("consum_resumen_label2") self.consum_clean_resumen_checkbutton = self.xml.get_widget("consum_clean_resumen_checkbutton") self.consum_warning_movistar_label = self.xml.get_widget("consum_warning_movistar_label") self.consum_warning_roaming_label = self.xml.get_widget("consum_warning_roaming_label") self.graph = MSD.MSDConsumGraph() self.consum_graph_hbox.pack_end(self.graph) self.history_graph = MSD.MSDTrafficHistoryGraph() self.traffic_history_hbox.pack_end(self.history_graph) self.traffic_hist_back = self.xml.get_widget("traffic_hist_back") self.traffic_hist_forward = self.xml.get_widget("traffic_hist_forward") self.traffic_hist_back.connect("clicked", self.__hist_go_back, None) self.traffic_hist_forward.connect("clicked", self.__hist_go_forward, None) self.traffic_hist_back.set_no_show_all(True) self.traffic_hist_forward.set_no_show_all(True) self.consum_window.connect("delete_event", self.__delete_event_consum_cb) self.consum_close_button.connect("clicked", self.__close_consum_cb, None) self.consum_help_button.connect("clicked", self.__show_help_online_cb, None)