Ejemplo n.º 1
0
    def __init__(self, settings):
        gtk.HBox.__init__(self)

        self._settings = settings
        self._parent = self._settings.get_dialog()

        self.conf = tgcm.core.Config.Config()
        self.actions_manager = tgcm.core.Actions.ActionManager()
        self.actions_manager.connect('action-install-status-changed',
                                     self.__on_action_install_status_changed)
        self.actions_manager.connect(
            'url-launcher-install-status-changed',
            self.__on_url_launcher_install_status_changed)

        self._theme_manager = tgcm.core.Theme.ThemeManager()
        self._xml_theme_manager = tgcm.core.XMLTheme.XMLTheme()

        self.original_services_order = self.actions_manager.get_original_services_order(
        )
        self.actions = self.actions_manager.get_actions()
        self.actions_data = {}
        self.url_launchers_data = {}

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings',
                                       self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Services.ui'), \
                prefix='svc')

        # -- Replace wrapping labels
        self.auth_top_info_label = replace_wrap_label(self.auth_top_info_label)
        self.new_users_info_label = replace_wrap_label(
            self.new_users_info_label)
        self.new_users_info_label2 = replace_wrap_label(
            self.new_users_info_label2)

        self.__init_action_panel()

        if tgcm.country_support == "es":
            self.auth_on_radio_button.connect(
                "toggled", self.__on_auth_on_radio_button_toggled, None)
            self.ask_password_check_button.connect(
                "toggled", self.__on_ask_password_check_button_toggled, None)
            self._settings.connect('is-closing', self.__on_settings_closing)

            self.__load_user_data()

            self.main_notebook.set_show_tabs(True)
        else:
            self.main_notebook.set_current_page(0)
            self.main_notebook.set_show_tabs(False)
            self.main_notebook.set_show_border(False)
            self.services_box.set_border_width(0)

        self.add(self.main_vbox)

        self.show_all()
Ejemplo n.º 2
0
    def __init__(self, settings):
        gtk.HBox.__init__(self)

        self._settings = settings
        self._parent = self._settings.get_dialog()

        self.conf = tgcm.core.Config.Config()
        self.actions_manager = tgcm.core.Actions.ActionManager()
        self.actions_manager.connect ('action-install-status-changed', self.__on_action_install_status_changed)
        self.actions_manager.connect ('url-launcher-install-status-changed', self.__on_url_launcher_install_status_changed)

        self._theme_manager = tgcm.core.Theme.ThemeManager()
        self._xml_theme_manager = tgcm.core.XMLTheme.XMLTheme()

        self.original_services_order = self.actions_manager.get_original_services_order()
        self.actions = self.actions_manager.get_actions ()
        self.actions_data = {}
        self.url_launchers_data = {}

        self.widget_dir = os.path.join(tgcm.widgets_dir , 'settings', self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Services.ui'), \
                prefix='svc')

        # -- Replace wrapping labels
        self.auth_top_info_label  = replace_wrap_label(self.auth_top_info_label)
        self.new_users_info_label = replace_wrap_label(self.new_users_info_label)
        self.new_users_info_label2 = replace_wrap_label(self.new_users_info_label2)

        self.__init_action_panel ()

        if tgcm.country_support == "es":
            self.auth_on_radio_button.connect("toggled", self.__on_auth_on_radio_button_toggled, None)
            self.ask_password_check_button.connect("toggled", self.__on_ask_password_check_button_toggled, None)
            self._settings.connect('is-closing', self.__on_settings_closing)

            self.__load_user_data ()

            self.main_notebook.set_show_tabs (True)
        else:
            self.main_notebook.set_current_page (0)
            self.main_notebook.set_show_tabs (False)
            self.main_notebook.set_show_border(False)
            self.services_box.set_border_width(0)

        self.add (self.main_vbox)

        self.show_all()
Ejemplo n.º 3
0
    def __init__(self, conf, widget_dir, settings):
        self.__settings = settings
        self.__conf = conf
        self.__device_manager = tgcm.core.FreeDesktop.DeviceManager()

        gtk_builder_magic(self, \
                filename=os.path.join(widget_dir, 'MyDetailsCommon.ui'), \
                prefix='gnrl')

        text = self.common_cancel_label.get_text() % {
            'app_name': self.__conf.get_app_name()
        }
        self.common_cancel_label.set_text(text)

        # -- Replease these two labels for wrapping
        self.top_info_label = replace_wrap_label(self.top_info_label)
        self.bam_info_label = replace_wrap_label(self.bam_info_label)

        self.my_details_common.show_all()

        # FIXME: It seems that Movistar ES has disabled monthly limits
        self.is_monthly_limit_enabled = tgcm.country_support != 'es'

        # Init comboboxes
        self.__init_dialog()

        # Load the BAM phone query area for Movistar (Spain)
        parent = self.__settings.get_dialog()

        self.__phonequery_area = tgcm.ui.windows.RecargaSaldoPhoneQuery(parent)
        self.phonenumber_parent.add(self.__phonequery_area.get_area())

        bam_textc = _('Mobile broadband number')
        self.__phonequery_area.set_description_label('%s:' % bam_textc)

        # Don't show the tooltip for the BAM help button
        self.phonenumber_bam_help.set_tooltip_text('')

        # IMSI, identifies the latest known SIM card
        self.__imsi = self.__conf.get_last_imsi_seen()
        if not self.__conf.is_last_imsi_seen_valid():
            self.my_details_common.set_sensitive(False)
        else:
            self.__load_dialog_values()

        # Connect some signals
        self.__connect_signals()
Ejemplo n.º 4
0
    def __init__(self, config_key):
        gobject.GObject.__init__(self)

        self.conn_manager = tgcm.core.Connections.ConnectionManager()
        self.connection_settings_manager = tgcm.core.ConnectionSettingsManager.ConnectionSettingsManager(
        )
        self.conf = tgcm.core.Config.Config()
        self._theme_manager = tgcm.core.Theme.ThemeManager()
        self._xml_theme_manager = tgcm.core.XMLTheme.XMLTheme()
        self._parent = tgcm.ui.ThemedDock().get_main_window()

        self.codename = self.__class__.__name__
        self.config_key = config_key

        action_dir = os.path.join(tgcm.actions_data_dir, self.codename)

        self._prefs_builder = gtk_builder_magic(self, \
                filename=os.path.join(action_dir, '%s_prefs.ui' % self.codename), \
                prefix='action')

        self._prefs_frame_builder = gtk_builder_magic(self, \
                filename=os.path.join(tgcm.msd_dir, 'MSDAction_frame.ui'), \
                prefix='pre')

        self.installed_service_label = replace_wrap_label(
            self.installed_service_label)
        self.uninstalled_service_label = replace_wrap_label(
            self.uninstalled_service_label)

        self.prefs_main_subcontainer.pack_end(self.connect_container)

        self.progress_dialog = tgcm.ui.MSD.MSDProgressWindow()
        self.progress_dialog.set_show_buttons(False)
        self.timer_id = 0

        self.__toggle_connections_check_button_cb_id = None
        self.__connections_combobox_cb_id = None
        self.__remove_service_button_cb_id = None
        self.__install_service_button_cb_id = None

        self.__check_preferences_interface()
        self.set_connections_model(self.conn_manager.get_connections_model())
        self.conn_manager.connect('pre_connections_change',
                                  self.__on_pre_connections_change)
        self.conn_manager.connect('connections_changed',
                                  self.__on_connections_changed)
        self.connect_signals()
Ejemplo n.º 5
0
    def __init__(self, settings):
        gtk.HBox.__init__(self)

        self._settings = settings
        self._parent = self._settings.get_dialog()
        self.conf = tgcm.core.Config.Config()
        self.connection_settings_manager = tgcm.core.ConnectionSettingsManager.ConnectionSettingsManager(
        )

        self.conn_manager = tgcm.core.Connections.ConnectionManager()
        self.theme_manager = tgcm.core.Theme.ThemeManager()

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings',
                                       self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Connections.ui'), \
                prefix='cnnt')
        self.add(self.main_vbox)

        # -- Replace for having wrapping labels
        msg = _(
            "Here, you can manage the connections saved in %s and order them according to your connection preferences."
        ) % self.conf.get_app_name()
        self.top_info_label = replace_wrap_label(self.top_info_label, text=msg)
        msg = _(
            "You can add new connections to %s by pressing the following buttons:"
        ) % self.conf.get_app_name()
        self.second_info_label = replace_wrap_label(self.second_info_label,
                                                    text=msg)

        if tgcm.country_support == 'de':
            self.add_wwan_connection_button.set_label(
                _("New 2G/3G/4G connection"))

        is_log_enabled = self.conf.is_connection_log_enabled()
        self.activate_connection_log_checkbutton.set_active(is_log_enabled)
        self.connection_file_label.set_text(
            self.conf.get_connection_log_filepath())

        self.importer = tgcm.ui.MSD.MSDImporter()
        self.importer.connections_treeview = self.connections_treeview
        self.importer.connect("connection-imported",
                              self.__connection_imported_cb)

        self.__create_connections_treeview()
        self.__load_connections_treeview()
        self.__connect_signals()
Ejemplo n.º 6
0
    def __init__(self, conf, widget_dir, settings):
        self.__settings = settings
        self.__conf = conf
        self.__device_manager = tgcm.core.FreeDesktop.DeviceManager()

        gtk_builder_magic(self, \
                filename=os.path.join(widget_dir, 'MyDetailsCommon.ui'), \
                prefix='gnrl')

        text = self.common_cancel_label.get_text() % {'app_name' : self.__conf.get_app_name()}
        self.common_cancel_label.set_text(text)

        # -- Replease these two labels for wrapping
        self.top_info_label = replace_wrap_label(self.top_info_label)
        self.bam_info_label = replace_wrap_label(self.bam_info_label)

        self.my_details_common.show_all()

        # FIXME: It seems that Movistar ES has disabled monthly limits
        self.is_monthly_limit_enabled = tgcm.country_support != 'es'

        # Init comboboxes
        self.__init_dialog()

        # Load the BAM phone query area for Movistar (Spain)
        parent = self.__settings.get_dialog()

        self.__phonequery_area = tgcm.ui.windows.RecargaSaldoPhoneQuery(parent)
        self.phonenumber_parent.add(self.__phonequery_area.get_area())

        bam_textc = _('Mobile broadband number')
        self.__phonequery_area.set_description_label('%s:' % bam_textc)

        # Don't show the tooltip for the BAM help button
        self.phonenumber_bam_help.set_tooltip_text('')

        # IMSI, identifies the latest known SIM card
        self.__imsi = self.__conf.get_last_imsi_seen()
        if not self.__conf.is_last_imsi_seen_valid():
            self.my_details_common.set_sensitive(False)
        else:
            self.__load_dialog_values()

        # Connect some signals
        self.__connect_signals()
Ejemplo n.º 7
0
    def __init__(self, device, parent=None, turn_off_if_cancel=False, \
            on_success_callback=None):
        self.device = device
        self.turn_off_if_cancel = turn_off_if_cancel
        self.on_success_callback = on_success_callback
        self.device_manager = tgcm.core.FreeDesktop.DeviceManager()

        title = _('Enter network PIN code')
        gtk.Dialog.__init__(self, title, parent, \
                gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, \
                (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, \
                 gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))

        self.windows_dir = os.path.join(tgcm.windows_dir, 'UnlockDeviceDialog')
        filename = os.path.join(self.windows_dir, 'UnlockDeviceDialog.ui')
        gtk_builder_magic(self, \
                filename=filename, \
                prefix='ud')

        self.set_border_width(6)
        self.vbox.pack_start(self.contents_vbox)
        if parent is None:
            parent = tgcm.ui.ThemedDock().get_main_window()
        self.set_transient_for(parent)
        self.unlock_code_entry.grab_focus()

        # Ugly hack to wrap a gtk.Label
        labels = (self.info_label, self.num_retries_label)
        for label in labels:
            text = label.get_label()
            replace_wrap_label(label, text)

        # Listen for removal of main WWAN device
        self.device_manager.connect('device-removed', self._on_device_removed)

        # Disable OK button if unlock code field is empty
        self.set_response_sensitive(gtk.RESPONSE_ACCEPT, False)
        self.unlock_code_entry.connect('changed',
                                       self._on_unlock_code_entry_changed)

        # Events necessary to avoid dialog to close
        self.connect('response', self._on_dialog_response)
        self.connect('close', self._on_dialog_close)
        self.connect('delete_event', self._on_dialog_close)
Ejemplo n.º 8
0
    def __init__(self, device, parent=None, turn_off_if_cancel=False, on_success_callback=None):
        self.device = device
        self.turn_off_if_cancel = turn_off_if_cancel
        self.on_success_callback = on_success_callback
        self.device_manager = tgcm.core.FreeDesktop.DeviceManager()

        title = _("Enter network PIN code")
        gtk.Dialog.__init__(
            self,
            title,
            parent,
            gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
            (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT),
        )

        self.windows_dir = os.path.join(tgcm.windows_dir, "UnlockDeviceDialog")
        filename = os.path.join(self.windows_dir, "UnlockDeviceDialog.ui")
        gtk_builder_magic(self, filename=filename, prefix="ud")

        self.set_border_width(6)
        self.vbox.pack_start(self.contents_vbox)
        if parent is None:
            parent = tgcm.ui.ThemedDock().get_main_window()
        self.set_transient_for(parent)
        self.unlock_code_entry.grab_focus()

        # Ugly hack to wrap a gtk.Label
        labels = (self.info_label, self.num_retries_label)
        for label in labels:
            text = label.get_label()
            replace_wrap_label(label, text)

        # Listen for removal of main WWAN device
        self.device_manager.connect("device-removed", self._on_device_removed)

        # Disable OK button if unlock code field is empty
        self.set_response_sensitive(gtk.RESPONSE_ACCEPT, False)
        self.unlock_code_entry.connect("changed", self._on_unlock_code_entry_changed)

        # Events necessary to avoid dialog to close
        self.connect("response", self._on_dialog_response)
        self.connect("close", self._on_dialog_close)
        self.connect("delete_event", self._on_dialog_close)
Ejemplo n.º 9
0
    def __init__(self, config_key):
        gobject.GObject.__init__(self)

        self.conn_manager = tgcm.core.Connections.ConnectionManager()
        self.connection_settings_manager=tgcm.core.ConnectionSettingsManager.ConnectionSettingsManager()
        self.conf = tgcm.core.Config.Config()
        self._theme_manager = tgcm.core.Theme.ThemeManager()
        self._xml_theme_manager = tgcm.core.XMLTheme.XMLTheme()
        self._parent = tgcm.ui.ThemedDock().get_main_window()

        self.codename = self.__class__.__name__
        self.config_key = config_key

        action_dir = os.path.join(tgcm.actions_data_dir , self.codename)

        self._prefs_builder = gtk_builder_magic(self, \
                filename=os.path.join(action_dir, '%s_prefs.ui' % self.codename), \
                prefix='action')

        self._prefs_frame_builder = gtk_builder_magic(self, \
                filename=os.path.join(tgcm.msd_dir, 'MSDAction_frame.ui'), \
                prefix='pre')

        self.installed_service_label = replace_wrap_label(self.installed_service_label)
        self.uninstalled_service_label = replace_wrap_label(self.uninstalled_service_label)

        self.prefs_main_subcontainer.pack_end(self.connect_container)

        self.progress_dialog = tgcm.ui.MSD.MSDProgressWindow()
        self.progress_dialog.set_show_buttons(False)
        self.timer_id = 0

        self.__toggle_connections_check_button_cb_id = None
        self.__connections_combobox_cb_id = None
        self.__remove_service_button_cb_id = None
        self.__install_service_button_cb_id = None

        self.__check_preferences_interface ()
        self.set_connections_model(self.conn_manager.get_connections_model())
        self.conn_manager.connect ('pre_connections_change', self.__on_pre_connections_change)
        self.conn_manager.connect ('connections_changed', self.__on_connections_changed)
        self.connect_signals ()
Ejemplo n.º 10
0
    def __init__(self, settings):
        gtk.HBox.__init__(self)

        self._settings = settings
        self._parent = self._settings.get_dialog()
        self.conf = tgcm.core.Config.Config()
        self.connection_settings_manager = tgcm.core.ConnectionSettingsManager.ConnectionSettingsManager()

        self.conn_manager = tgcm.core.Connections.ConnectionManager()
        self.theme_manager = tgcm.core.Theme.ThemeManager()

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings', self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Connections.ui'), \
                prefix='cnnt')
        self.add(self.main_vbox)

        # -- Replace for having wrapping labels
        msg = _("Here, you can manage the connections saved in %s and order them according to your connection preferences.") % self.conf.get_app_name()
        self.top_info_label = replace_wrap_label(self.top_info_label, text=msg)
        msg = _("You can add new connections to %s by pressing the following buttons:") % self.conf.get_app_name()
        self.second_info_label = replace_wrap_label(self.second_info_label, text=msg)

        if tgcm.country_support == 'de':
            self.add_wwan_connection_button.set_label(_("New 2G/3G/4G connection"))

        is_log_enabled = self.conf.is_connection_log_enabled()
        self.activate_connection_log_checkbutton.set_active(is_log_enabled)
        self.connection_file_label.set_text(self.conf.get_connection_log_filepath())

        self.importer = tgcm.ui.MSD.MSDImporter()
        self.importer.connections_treeview = self.connections_treeview
        self.importer.connect("connection-imported", self.__connection_imported_cb)

        self.__create_connections_treeview()
        self.__load_connections_treeview()
        self.__connect_signals()
Ejemplo n.º 11
0
    def __init__(self, parent=None):
        gtk.HBox.__init__(self)

        self.conf = tgcm.core.Config.Config()
        self.conf.connect('user-prepay-changed', self.__load_services_treeview)
        self.conf.connect('launcher-items-order-changed',
                          self.__load_services_treeview)
        self.conf.connect('last-imsi-seen-changed',
                          self.__load_services_treeview)

        self.action_manager = tgcm.core.Actions.ActionManager()
        self.action_manager.connect('action-install-status-changed', \
                self.__load_services_treeview)
        self.action_manager.connect('url-launcher-install-status-changed', \
                self.__load_services_treeview)

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings', \
                self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Dock.ui'), \
                prefix='dock')

        if tgcm.country_support == 'uk':
            self.title_label.set_text('<big><b>%s</b></big>' % _('Appearance'))

        # -- Replace the label for wrapping
        self.top_info_label = replace_wrap_label(self.top_info_label)

        self.add(self.main_container)

        self.selected = []

        self.__create_services_treeview()
        self.__load_services_treeview()

        self.up_button.connect('clicked', self.__on_up_button_clicked)
        self.down_button.connect('clicked', self.__on_down_button_clicked)
        self.up_button.set_sensitive(False)
        self.down_button.set_sensitive(False)
Ejemplo n.º 12
0
    def __init__(self, parent=None):
        gtk.HBox.__init__(self)

        self.conf = tgcm.core.Config.Config()
        self.conf.connect('user-prepay-changed', self.__load_services_treeview)
        self.conf.connect('launcher-items-order-changed', self.__load_services_treeview)
        self.conf.connect('last-imsi-seen-changed', self.__load_services_treeview)

        self.action_manager = tgcm.core.Actions.ActionManager()
        self.action_manager.connect('action-install-status-changed', \
                self.__load_services_treeview)
        self.action_manager.connect('url-launcher-install-status-changed', \
                self.__load_services_treeview)

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings', \
                self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Dock.ui'), \
                prefix='dock')

        if tgcm.country_support == 'uk':
            self.title_label.set_text('<big><b>%s</b></big>' %_('Appearance'))

        # -- Replace the label for wrapping
        self.top_info_label = replace_wrap_label(self.top_info_label)

        self.add(self.main_container)

        self.selected = []

        self.__create_services_treeview ()
        self.__load_services_treeview ()

        self.up_button.connect ('clicked', self.__on_up_button_clicked)
        self.down_button.connect ('clicked', self.__on_down_button_clicked)
        self.up_button.set_sensitive (False)
        self.down_button.set_sensitive (False)
Ejemplo n.º 13
0
    def __init__(self, settings):
        gtk.HBox.__init__(self)

        self._settings = settings
        self.conf = tgcm.core.Config.Config()
        self.device_manager = tgcm.core.FreeDesktop.DeviceManager()
        self.modem_manager = tgcm.core.MainModem.MainModem()
        self.wifi_manager = tgcm.core.MainWifi.MainWifi()

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings',
                                       self.__class__.__name__)

        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Devices.ui'), \
                prefix='mm')

        #Device desc labels
        if tgcm.country_support == 'de':
            tech_name = '2G/3G/4G'
        else:
            tech_name = 'WWAN'
        msg = _('Choose the device you want to use with %s to connect to the %s networks. You can use a Mobile Internet Device.') % \
                (self.conf.get_app_name(), tech_name)
        self.device_wwan_label.set_markup(_('<b>%s Device</b>') % tech_name)
        self.mobile_desc_label = replace_wrap_label(self.mobile_desc_label,
                                                    text=msg)

        msg = _(
            'Choose the device you want to use with %s to connect to the Wi-Fi networks.'
        ) % self.conf.get_app_name()
        self.wifi_desc_label = replace_wrap_label(self.wifi_desc_label,
                                                  text=msg)

        #Devices treview
        self.wwan_model = DeviceModel(DEVICE_MODEM)
        self.wifi_model = DeviceModel(DEVICE_WLAN)

        col = gtk.TreeViewColumn("name")
        self.mobile_devices_treeview.append_column(col)
        cell = gtk.CellRendererText()
        col.pack_start(cell, True)
        col.add_attribute(cell, 'markup', 1)

        col = gtk.TreeViewColumn("name")
        self.wifi_devices_treeview.append_column(col)
        cell = gtk.CellRendererText()
        col.pack_start(cell, True)
        col.add_attribute(cell, 'markup', 1)

        self.mobile_devices_treeview.set_model(self.wwan_model)
        self.mobile_devices_treeview.set_headers_visible(False)
        self.wifi_devices_treeview.set_model(self.wifi_model)
        self.wifi_devices_treeview.set_headers_visible(False)

        # Buttons signals
        self.mobile_select_button.connect(
            "clicked", self.__mobile_select_button_clicked_cb, None)
        self.wifi_select_button.connect("clicked",
                                        self.__wifi_select_button_clicked_cb,
                                        None)
        self.mobile_unlock_button.connect(
            "clicked", self.__mobile_unlock_button_clicked_cb, None)

        # Listen to selection changes in WWAN devices list
        selection = self.mobile_devices_treeview.get_selection()
        selection.set_mode(gtk.SELECTION_SINGLE)
        selection.connect('changed', self.__on_wwan_device_selection_changed)

        # Listen to selection changes in Wi-Fi devices list
        selection = self.wifi_devices_treeview.get_selection()
        selection.set_mode(gtk.SELECTION_SINGLE)
        selection.connect('changed', self.__on_wifi_device_selection_changed)

        self.add(self.device_conf_widget)
Ejemplo n.º 14
0
    def __init__(self):
        self.conf = tgcm.core.Config.Config()
        self.device_manager = tgcm.core.FreeDesktop.DeviceManager()
        self.doc_manager = tgcm.core.DocManager.DocManager()
        self.theme_manager = tgcm.core.Theme.ThemeManager()
        self.__main_modem = tgcm.core.MainModem.MainModem()
        self.__main_wifi  = tgcm.core.MainWifi.MainWifi()

        self.windows_dir = os.path.join(tgcm.windows_dir , self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.windows_dir, 'HelpDialog.ui'), \
                prefix='hd')

        window_icon_path = self.theme_manager.get_icon ('icons', 'help_taskbar.png')
        self.help_dialog.set_icon_from_file(window_icon_path)

        self.help_dialog.set_title (_("%s - Help") % self.conf.get_caption())

        self.help_liststore = gtk.ListStore(str, str, str)
        column = gtk.TreeViewColumn('Option_key', gtk.CellRendererText(), markup=0)
        self.help_info_treeview.append_column(column)
        column = gtk.TreeViewColumn('Option_value', gtk.CellRendererText(), markup=1)
        self.help_info_treeview.append_column(column)
        # -- This column will store the tooltip
        column = gtk.TreeViewColumn('Option_tooltip', gtk.CellRendererText(), markup=2)
        column.set_visible(False)
        self.help_info_treeview.append_column(column)
        self.help_info_treeview.set_tooltip_column(2)

        # -- Set the model for this treeview
        self.help_info_treeview.set_model(self.help_liststore)

        self.help_tgcm_version_label.set_markup("<b>%s Linux %s (%s)</b>" % \
                (self.conf.get_app_name(), self.conf.get_version(), tgcm.core.Constants.TGCM_DEVELOPMENT_REVISION()))

        help_phone = self.conf.get_help_phone()
        url = self.conf.get_support_url().replace ("&", "&amp;")
        show_url = len(url) > 0
        show_phone = len(help_phone) > 0

        if tgcm.country_support == 'es':
            url_text = _('Online help')
        else:
            url_text = url

        if not (url.startswith('http://') or url.startswith('https://')):
            url = "http://%s" % url

        self.help_online_linkbutton.set_label(url_text)
        self.help_online_linkbutton.set_uri(url)
        self.help_online_linkbutton.set_tooltip_text('')

        hide_phone_label=False;
        if show_url and show_phone:
            self.help_phone_label.set_text (_("For more information, you can either call %s or post your enquiry at the following address:") % help_phone)
        elif show_url and not show_phone:
            self.help_phone_label.set_text (_("For more information, you can send your query to the following address:"))
        elif not show_url and show_phone:
            self.help_phone_label.set_text (_("For more information, you can phone %s.") % help_phone)
            self.help_online_linkbutton.hide()
        else:
            hide_phone_label=True
            self.help_phone_label.hide()
            self.help_online_linkbutton.hide()

        #signals
        self.help_button.connect("clicked", self.__open_help_button_cb, None)
        self.help_close_button.connect("clicked", self.__close_help_dialog_cb, None)
        self.help_dialog.connect("delete_event", self.__close_help_dialog_cb)
        self.device_manager.connect ("active-dev-card-status-changed", self.__active_device_status_changed_cb)

        self.__main_modem.connect('main-modem-changed' , self.__refresh_info_treeview)
        self.__main_modem.connect('main-modem-removed' , self.__refresh_info_treeview)
        self.__main_wifi.connect('main-wifi-changed' , self.__refresh_info_treeview)
        self.__main_wifi.connect('main-wifi-removed' , self.__refresh_info_treeview)

        self.help_close_button.grab_focus()

        parent = tgcm.ui.ThemedDock().get_main_window()
        self.help_dialog.set_transient_for(parent)

        # -- Replace the Labels for happing a correct wrapping
        self.help_description_label = replace_wrap_label(self.help_description_label)
        if not hide_phone_label:
            self.help_phone_label = replace_wrap_label(self.help_phone_label)

        glib.idle_add(self.__refresh_info_treeview)
Ejemplo n.º 15
0
    def __init__(self):
        self.windows_dir = os.path.join(tgcm.windows_dir,
                                        self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.windows_dir, 'Traffic.ui'), \
                prefix='trfc')

        self.message_label = replace_wrap_label(self.message_label)
        self.help_label = replace_wrap_label(self.help_label)
        self.warn_uk_label = replace_wrap_label(self.warn_uk_label)

        self.conf = tgcm.core.Config.Config()
        self.theme_manager = tgcm.core.Theme.ThemeManager()
        self.traffic_manager = tgcm.core.TrafficManager.TrafficManager()

        self.dialog = tgcm.ui.windows.ServiceWindow('banner.traffic',
                                                    _('Traffic'))
        self.window_icon_path = self.theme_manager.get_icon(
            'icons', 'traffic_taskbar.png')
        self.dialog.set_icon_from_file(self.window_icon_path)

        self.session_info = tgcm.ui.widgets.traffic.SessionInfo()
        self.billing_info = tgcm.ui.widgets.traffic.BillingInfo()
        self.dataused_info = tgcm.ui.widgets.traffic.DataUsedInfo(
            self.traffic_history_label)

        self.current_session_area.add(self.session_info)
        self.current_billing_day_area.add(self.billing_info)
        self.data_used_area.add(self.dataused_info)
        self.session_info.show()
        self.billing_info.show()
        self.dataused_info.show()

        self.__update_reset_history_button()

        self.reset_history_button.connect(
            "clicked", self.__on_reset_history_button_clicked)

        self.__update_billing_period_info_label()

        # Small hack to show smaller text in linkbuttons
        orig_label = self.change_billing_day_linkbutton.get_label()
        self.change_billing_day_linkbutton.set_label('<small>%s</small>' %
                                                     orig_label)
        self.change_billing_day_linkbutton.child.set_use_markup(True)
        self.change_billing_day_linkbutton.set_tooltip_text('')

        if len(self.conf.get_selfcare_url()) > 0:
            self.help_linkbutton.set_label('<small>%s</small>' %
                                           self.conf.get_selfcare_url())
            self.help_linkbutton.child.set_use_markup(True)
            self.help_linkbutton.set_uri(self.conf.get_selfcare_url())
            self.help_linkbutton.set_tooltip_text('')
        else:
            self.help_label.hide()
            self.help_linkbutton.hide()

        self.dialog.add(self.main_widget)

        self.conf.connect('last-imsi-seen-changed',
                          self.__on_last_imsi_changed)
        self.conf.connect('billing-day-changed', self.__on_billing_day_changed)
        self.conf.connect('fixed-billing-day-changed',
                          self.__on_is_fixed_billing_day_changed)
        self.conf.connect('monthly-limit-changed',
                          self.__on_monthly_limit_changed)
        self.traffic_manager.connect('billing-period-changed',
                                     self.__on_billing_period_changed)
        self.dialog.close_button.connect('clicked', self.__dialog_close_cb)
        self.dialog.connect('delete-event', self.__dialog_close_cb)

        self.__update_current_billing_period_label()

        self.dialog.resize(650, 600)
Ejemplo n.º 16
0
    def __init__(self):
        self.windows_dir = os.path.join(tgcm.windows_dir , self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.windows_dir, 'Traffic.ui'), \
                prefix='trfc')

        self.message_label = replace_wrap_label(self.message_label)
        self.help_label = replace_wrap_label(self.help_label)
        self.warn_uk_label = replace_wrap_label(self.warn_uk_label)

        self.conf = tgcm.core.Config.Config()
        self.theme_manager = tgcm.core.Theme.ThemeManager()
        self.traffic_manager = tgcm.core.TrafficManager.TrafficManager()

        self.dialog = tgcm.ui.windows.ServiceWindow('banner.traffic', _('Traffic'))
        self.window_icon_path = self.theme_manager.get_icon('icons', 'traffic_taskbar.png')
        self.dialog.set_icon_from_file(self.window_icon_path)

        self.session_info = tgcm.ui.widgets.traffic.SessionInfo()
        self.billing_info = tgcm.ui.widgets.traffic.BillingInfo()
        self.dataused_info = tgcm.ui.widgets.traffic.DataUsedInfo(self.traffic_history_label)

        self.current_session_area.add(self.session_info)
        self.current_billing_day_area.add(self.billing_info)
        self.data_used_area.add(self.dataused_info)
        self.session_info.show()
        self.billing_info.show()
        self.dataused_info.show()

        self.__update_reset_history_button()

        self.reset_history_button.connect ("clicked", self.__on_reset_history_button_clicked)

        self.__update_billing_period_info_label()

        # Small hack to show smaller text in linkbuttons
        orig_label = self.change_billing_day_linkbutton.get_label()
        self.change_billing_day_linkbutton.set_label('<small>%s</small>' % orig_label)
        self.change_billing_day_linkbutton.child.set_use_markup(True)
        self.change_billing_day_linkbutton.set_tooltip_text('')

        if len(self.conf.get_selfcare_url()) > 0:
            self.help_linkbutton.set_label('<small>%s</small>' % self.conf.get_selfcare_url())
            self.help_linkbutton.child.set_use_markup(True)
            self.help_linkbutton.set_uri(self.conf.get_selfcare_url())
            self.help_linkbutton.set_tooltip_text('')
        else:
            self.help_label.hide()
            self.help_linkbutton.hide()

        self.dialog.add(self.main_widget)

        self.conf.connect('last-imsi-seen-changed', self.__on_last_imsi_changed)
        self.conf.connect('billing-day-changed', self.__on_billing_day_changed)
        self.conf.connect('fixed-billing-day-changed', self.__on_is_fixed_billing_day_changed)
        self.conf.connect('monthly-limit-changed', self.__on_monthly_limit_changed)
        self.traffic_manager.connect('billing-period-changed', self.__on_billing_period_changed)
        self.dialog.close_button.connect('clicked', self.__dialog_close_cb)
        self.dialog.connect('delete-event', self.__dialog_close_cb)

        self.__update_current_billing_period_label()

        self.dialog.resize(650, 600)
Ejemplo n.º 17
0
    def __init__(self, settings):
        gtk.HBox.__init__(self)

        self._conf = tgcm.core.Config.Config()
        self._settings = settings

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings',
                                       self.__class__.__name__)
        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Alerts.ui'), \
                prefix='alrt')

        self._alert_text = _(
            'Alert me when I reach %(percent)s%% of the reference data volume (%(data)s)'
        )

        self._alert_widgets = [
            self.limit1_checkbutton,
            self.limit2_checkbutton,
            self.limit3_checkbutton,
            self.limit4_checkbutton,
        ]

        self._alert_roaming_widgets = [
            self.ro_limit1_checkbutton,
            self.ro_limit2_checkbutton,
            self.ro_limit3_checkbutton,
            self.ro_limit4_checkbutton,
        ]

        self._alert_labels = [
            self.limit1_label,
            self.limit2_label,
            self.limit3_label,
            self.limit4_label,
        ]

        self._alert_roaming_labels = [
            self.ro_limit1_label,
            self.ro_limit2_label,
            self.ro_limit3_label,
            self.ro_limit4_label,
        ]

        self.__init_dialog()

        # IMSI, identifies the latest known SIM card
        self.__imsi = self._conf.get_last_imsi_seen()
        if not self._conf.is_last_imsi_seen_valid():
            self.main_vbox.set_sensitive(False)
        else:
            self.__load_data(is_roaming=False)
            self.__load_data(is_roaming=True)

        # Connect signals
        self.__connect_signals()

        self.ref_label_connected = replace_wrap_label(self.ref_label_connected)
        self.ref_label_roaming = replace_wrap_label(self.ref_label_roaming)
        self.ref_label_connected.set_markup(_("<b>When connected via %s network...</b>") % \
                self._conf.get_network_mnemonic())
        self.add(self.main_vbox)
Ejemplo n.º 18
0
    def __init__(self, settings):
        gtk.HBox.__init__(self)

        self._settings = settings
        self.conf = tgcm.core.Config.Config()
        self.device_manager = tgcm.core.FreeDesktop.DeviceManager()
        self.modem_manager = tgcm.core.MainModem.MainModem()
        self.wifi_manager = tgcm.core.MainWifi.MainWifi()

        self.widget_dir = os.path.join(tgcm.widgets_dir, 'settings', self.__class__.__name__)

        gtk_builder_magic(self, \
                filename=os.path.join(self.widget_dir, 'Devices.ui'), \
                prefix='mm')

        #Device desc labels
        if tgcm.country_support == 'de':
            tech_name = '2G/3G/4G'
        else:
            tech_name = 'WWAN'
        msg = _('Choose the device you want to use with %s to connect to the %s networks. You can use a Mobile Internet Device.') % \
                (self.conf.get_app_name(), tech_name)
        self.device_wwan_label.set_markup(_('<b>%s Device</b>') % tech_name);
        self.mobile_desc_label = replace_wrap_label(self.mobile_desc_label, text=msg)

        msg = _('Choose the device you want to use with %s to connect to the Wi-Fi networks.') % self.conf.get_app_name()
        self.wifi_desc_label = replace_wrap_label(self.wifi_desc_label, text=msg)

        #Devices treview
        self.wwan_model = DeviceModel(DEVICE_MODEM)
        self.wifi_model = DeviceModel(DEVICE_WLAN)

        col = gtk.TreeViewColumn("name")
        self.mobile_devices_treeview.append_column(col)
        cell = gtk.CellRendererText()
        col.pack_start(cell, True)
        col.add_attribute(cell, 'markup', 1)

        col = gtk.TreeViewColumn("name")
        self.wifi_devices_treeview.append_column(col)
        cell = gtk.CellRendererText()
        col.pack_start(cell, True)
        col.add_attribute(cell, 'markup', 1)

        self.mobile_devices_treeview.set_model(self.wwan_model)
        self.mobile_devices_treeview.set_headers_visible(False)
        self.wifi_devices_treeview.set_model(self.wifi_model)
        self.wifi_devices_treeview.set_headers_visible(False)

        # Buttons signals
        self.mobile_select_button.connect("clicked", self.__mobile_select_button_clicked_cb, None)
        self.wifi_select_button.connect("clicked", self.__wifi_select_button_clicked_cb, None)
        self.mobile_unlock_button.connect("clicked", self.__mobile_unlock_button_clicked_cb, None)

        # Listen to selection changes in WWAN devices list
        selection = self.mobile_devices_treeview.get_selection()
        selection.set_mode(gtk.SELECTION_SINGLE)
        selection.connect('changed', self.__on_wwan_device_selection_changed)

        # Listen to selection changes in Wi-Fi devices list
        selection = self.wifi_devices_treeview.get_selection()
        selection.set_mode(gtk.SELECTION_SINGLE)
        selection.connect('changed', self.__on_wifi_device_selection_changed)

        self.add(self.device_conf_widget)