Skip to content
Permalink
Browse files

[pyqgis-console] adress some comment: add button to link at generate …

…token page
  • Loading branch information
slarosa authored and nyalldawson committed Sep 26, 2020
1 parent eee2925 commit 4347e81202aa84368df503f253c091cb71640b30
Showing with 18 additions and 4 deletions.
  1. +9 −2 python/console/console_settings.py
  2. +9 −2 python/console/console_settings.ui
@@ -19,9 +19,9 @@
Some portions of code were taken from https://code.google.com/p/pydee/
"""

from qgis.PyQt.QtCore import QCoreApplication, QSize, Qt
from qgis.PyQt.QtCore import QCoreApplication, QSize, Qt, QUrl
from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QMessageBox, QTableWidgetItem
from qgis.PyQt.QtGui import QIcon, QFont, QColor, QFontDatabase
from qgis.PyQt.QtGui import QIcon, QFont, QColor, QFontDatabase, QDesktopServices

from qgis.core import QgsSettings

@@ -59,6 +59,13 @@ def __init__(self, parent):
self.resetFontColor.setIconSize(QSize(18, 18))
self.resetFontColor.clicked.connect(self._resetFontColor)

self.generateToken.clicked.connect(self.generateGHToken)

def generateGHToken(self):
description = self.tr("PyQGIS Console")
url = 'https://github.com/settings/tokens/new?description={}&scopes=gist'.format(description)
QDesktopServices.openUrl(QUrl(url))

def initialCheck(self):
if self.preloadAPI.isChecked():
self.enableDisable(False)
@@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>1055</width>
<height>720</height>
<height>786</height>
</rect>
</property>
<property name="sizePolicy">
@@ -687,7 +687,14 @@
<item row="0" column="0">
<widget class="QLineEdit" name="tokenGhLineEdit">
<property name="placeholderText">
<string>&lt;ACCESS_TOKEN&gt;</string>
<string>&lt;PERSONAL_ACCESS_TOKEN&gt;</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="generateToken">
<property name="text">
<string>Generate</string>
</property>
</widget>
</item>

0 comments on commit 4347e81

Please sign in to comment.
You can’t perform that action at this time.