## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
##
import argparse
-import sigrok.core as sr
import sys
import textwrap
import signal
qtcompat.load_modules(args.pyside)
QtCore = qtcompat.QtCore
QtGui = qtcompat.QtGui
- import mainwindow
app = QtGui.QApplication([])
+ try:
+ import sigrok.core as sr
+ except Exception as e:
+ QtGui.QMessageBox.critical(None, 'Error starting sigrok-meter',
+ 'Unable to use the sigrok Python bindings:\n{}.'.format(e))
+ sys.exit(1)
+
# Initialize modules that need a QApplication to exist.
import settings
settings.init()
except:
sys.exit('Error: invalid log level.')
+ import mainwindow
s = mainwindow.MainWindow(context, args.drivers)
s.show()