Commit b86d4c85 authored by Adrian Georgescu's avatar Adrian Georgescu

Added Tools menu entry for purchasing access to PSTN

parent a2682dd9
......@@ -648,6 +648,16 @@ class ServerToolsWindow(base_class, ui_class):
view.load_account_page(account, tab='calls')
self.show()
def open_purchase_pstn_access_page(self, account):
view = self.tab_widget.currentWidget()
account = account or view.account
if account is None or account.server.settings_url is None:
account = self.account_button.menu().actions()[0].data().toPyObject()
self.account_label.setText(account.id)
self.tab_widget.setTabText(self.tab_widget.currentIndex(), account.id)
view.load_account_page(account, tab='payments')
self.show()
del ui_class, base_class
......@@ -55,6 +55,7 @@ class MainWindow(base_class, ui_class):
self.sip_server_settings_action.setEnabled(False)
self.search_for_people_action.setEnabled(False)
self.history_on_server_action.setEnabled(False)
self.purchase_pstn_access_action.setEnabled(False)
self.main_view.setCurrentWidget(self.contacts_panel)
self.contacts_view.setCurrentWidget(self.contact_list_panel)
self.search_view.setCurrentWidget(self.search_list_panel)
......@@ -145,6 +146,7 @@ class MainWindow(base_class, ui_class):
self.sip_server_settings_action.triggered.connect(self._AH_SIPServerSettings)
self.search_for_people_action.triggered.connect(self._AH_SearchForPeople)
self.history_on_server_action.triggered.connect(self._AH_HistoryOnServer)
self.purchase_pstn_access_action.triggered.connect(self._AH_PurchasePstnAccess)
self.contact_model.load()
......@@ -321,6 +323,11 @@ class MainWindow(base_class, ui_class):
account = account if account is not BonjourAccount() and account.server.settings_url else None
self.server_tools_window.open_history_page(account)
def _AH_PurchasePstnAccess(self, checked):
account = self.identity.itemData(self.identity.currentIndex()).toPyObject().account
account = account if account is not BonjourAccount() and account.server.settings_url else None
self.server_tools_window.open_purchase_pstn_access_page(account)
def _SH_AddContactButtonClicked(self, clicked):
model = self.contact_model
selected_items = ((index.row(), model.data(index)) for index in self.contact_list.selectionModel().selectedIndexes())
......@@ -447,6 +454,7 @@ class MainWindow(base_class, ui_class):
self.sip_server_settings_action.setEnabled(server_tools_enabled)
self.search_for_people_action.setEnabled(server_tools_enabled)
self.history_on_server_action.setEnabled(server_tools_enabled)
self.purchase_pstn_access_action.setEnabled(server_tools_enabled)
def _SH_SessionListSelectionChanged(self, selected, deselected):
selected_indexes = selected.indexes()
......
......@@ -1029,6 +1029,7 @@ padding: 2px;</string>
<addaction name="sip_server_settings_action"/>
<addaction name="search_for_people_action"/>
<addaction name="history_on_server_action"/>
<addaction name="purchase_pstn_access_action"/>
<addaction name="separator"/>
<addaction name="file_transfers_action"/>
<addaction name="logs_action"/>
......@@ -1261,6 +1262,11 @@ padding: 2px;</string>
<string>Call history on server...</string>
</property>
</action>
<action name="purchase_pstn_access_action">
<property name="text">
<string>Purchase access to PSTN...</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment