Esempio n. 1
0
class Qgis2Web(object):
    """Class abstraction for managing Qgis2Web plugin in QGIS."""
    def __init__(self, iface):
        self.iface = iface
        self.dlg = None

    def initGui(self):
        self.action = QAction(
            QIcon(":/plugins/qgis2web/icons/qgis2web.png"),
            u"Create web map", self.iface.mainWindow())
        self.action.triggered.connect(self.run)

        self.iface.addPluginToWebMenu(u"&qgis2web", self.action)
        self.iface.addToolBarIcon(self.action)

    def unload(self):
        self.iface.removePluginWebMenu(u"&qgis2web", self.action)
        self.iface.removeToolBarIcon(self.action)

    def run(self):
        if not self.dlg:
            self.dlg = MainDialog(self.iface)
        self.dlg.show()
        # bring to front
        self.dlg.raise_()
Esempio n. 2
0
class Qgis2Web(object):
    """Class abstraction for managing Qgis2Web plugin in QGIS."""
    def __init__(self, iface):
        self.provider = qgis2webProvider()
        self.iface = iface
        self.dlg = None

    def initGui(self):
        Processing.addProvider(self.provider)
        self.action = QAction(QIcon(":/plugins/qgis2web/icons/qgis2web.png"),
                              u"Create web map", self.iface.mainWindow())
        self.action.triggered.connect(self.run)

        self.iface.addPluginToWebMenu(u"&qgis2web", self.action)
        self.iface.addToolBarIcon(self.action)

    def unload(self):
        Processing.removeProvider(self.provider)
        self.iface.removePluginWebMenu(u"&qgis2web", self.action)
        self.iface.removeToolBarIcon(self.action)

    def run(self):
        if not self.dlg or sip.isdeleted(self.dlg):
            self.dlg = MainDialog(self.iface)
        self.dlg.setAttribute(Qt.WA_DeleteOnClose)
        self.dlg.show()
        # bring to front
        self.dlg.raise_()
def main():
    
    app = QtGui.QApplication(sys.argv)
    mainDialog = MainDialog()
    mainDialog.setWindowState(QtCore.Qt.WindowMaximized)
    mainDialog.initOptions()
    mainDialog.initWebKit()
    mainDialog.show()
    
    sys.exit(app.exec_())
Esempio n. 4
0
 def run(self):
     dlg = MainDialog(self.iface)
     dlg.show()
Esempio n. 5
0
from kdecore import *
from kdeui import *
import kdedesigner

from maindialog import MainDialog
from about import aboutData
from dumlogging import logger

def handleException(exception, value, tb):
    logger.error("".join(traceback.format_exception(exception, value, tb)))

if __name__ == '__main__':

    sys.excepthook = handleException

    KCmdLineArgs.init(sys.argv, aboutData)

    app = KUniqueApplication(True, True, True)
    args = KCmdLineArgs.parsedArgs()

    dbus.mainloop.qt3.DBusQtMainLoop(set_as_default=True)

    manager = MainDialog()
    app.setMainWidget(manager)
    manager.setCaption(i18n('Upgrade Manager'))
    manager.setIcon(KGlobal.iconLoader().loadIcon("package-manager", KIcon.Small))
    manager.show()

    sys.exit(app.exec_loop())