diff --git a/GUI/externals/qt-manhattan-style/FancyTabWidget.sip b/GUI/externals/qt-manhattan-style/FancyTabWidget.sip new file mode 100644 index 0000000000000000000000000000000000000000..eabf9de78662cc6c806b1db6744f42fb7ee7fa68 --- /dev/null +++ b/GUI/externals/qt-manhattan-style/FancyTabWidget.sip @@ -0,0 +1,22 @@ + + + +%Import QtGui/QtGuimod.sip + +namespace Manhattan { + +class FancyTabWidget : public QWidget{ + +%TypeHeaderCode +#include "fancytabwidget.h" +%End + +public: + + FancyTabWidget(QWidget *parent = 0); + + void insertTab(int index, QWidget *tab /TransferThis/, const QIcon &icon, const QString &label); + +}; + +}; \ No newline at end of file diff --git a/GUI/externals/qt-manhattan-style/ManhattanStyle.sip b/GUI/externals/qt-manhattan-style/ManhattanStyle.sip new file mode 100644 index 0000000000000000000000000000000000000000..3cc63bcdb811ac3c0e9abb0bd6a4af9a33091ea6 --- /dev/null +++ b/GUI/externals/qt-manhattan-style/ManhattanStyle.sip @@ -0,0 +1,8 @@ +%Module ManhattanStyle + +%Import QtGui/QtGuimod.sip +%Import QtCore/QtCoremod.sip +%Import QtWebKit/QtWebKitmod.sip + +%Include FancyTabWidget.sip + diff --git a/GUI/externals/qt-manhattan-style/module.cpp b/GUI/externals/qt-manhattan-style/module.cpp index deb77f89b5e3cf1ba22f70e326bdc2963b382b45..e3adca0831a4911793df7df5343e9c4ab268d900 100644 --- a/GUI/externals/qt-manhattan-style/module.cpp +++ b/GUI/externals/qt-manhattan-style/module.cpp @@ -33,6 +33,7 @@ BOOST_PYTHON_MODULE(libManhattanStyle) class_<Manhattan::FancyTabWidget, boost::noncopyable, std::auto_ptr<Manhattan::FancyTabWidget> >("FancyTabWidget") + .def(init<QWidget*>()) .def("insertTab",&Manhattan::FancyTabWidget::insertTab) ; diff --git a/GUI/externals/qt-manhattan-style/module_sip.cpp b/GUI/externals/qt-manhattan-style/module_sip.cpp index 8286be8a3f7a2ffc1651d90be46dffee686ac8a5..3335bf40e4bb2b1cc70a2632a2a37e5a361dd5b3 100644 --- a/GUI/externals/qt-manhattan-style/module_sip.cpp +++ b/GUI/externals/qt-manhattan-style/module_sip.cpp @@ -9,6 +9,7 @@ #include <QIcon> #include <QString> #include <QColor> +#include <QWebView> #include "manhattanstyle.h" #include "fancytabwidget.h" @@ -83,6 +84,7 @@ template <> struct MetaData<QWidget> { static const char* className() { return " template <> struct MetaData<QIcon> { static const char* className() { return "QIcon";} }; template <> struct MetaData<QColor> { static const char* className() { return "QColor";} }; template <> struct MetaData<QAction> { static const char* className() { return "QAction";} }; +template <> struct MetaData<QWebView> { static const char* className() { return "QWebView";} }; //template <> struct MetaData<QString> { static const char* className() { return "QString";} }; @@ -164,6 +166,7 @@ struct QClass_converters // transfer ownership from python to C++ #if SIP_API_MAJOR_NR >=4 + std::cout << "XXX 2.1" << std::endl; sip_API->api_transfer_to(obj_ptr, 0); #else sip_API->api_transfer(obj_ptr, 1); @@ -387,6 +390,7 @@ void export_sip() QClass_converters<QWidget>(); // from python QClass_converters<QAction>(); // from/to python QClass_converters<QIcon>(); + QClass_converters<QWebView>(); //QClass_converters<QString>(); //QClass_converters<QColor>(); diff --git a/GUI/externals/qt-manhattan-style/qt-manhattan-style.pro b/GUI/externals/qt-manhattan-style/qt-manhattan-style.pro index c81e4ebdc945811119a7b0c7354837324367a908..029cc654f9296ae66dcdf133fa3f88d156e3725d 100644 --- a/GUI/externals/qt-manhattan-style/qt-manhattan-style.pro +++ b/GUI/externals/qt-manhattan-style/qt-manhattan-style.pro @@ -2,7 +2,7 @@ TARGET = ManhattanStyle TEMPLATE = lib -QT += core gui +QT += core gui webkit webkitwidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets # making standard shared library extension diff --git a/GUI/pygui/images/mode_exp.png b/GUI/pygui/images/mode_exp.png new file mode 100644 index 0000000000000000000000000000000000000000..994520b8b53e344f4424c3c32f6872fccaa5427b Binary files /dev/null and b/GUI/pygui/images/mode_exp.png differ diff --git a/GUI/pygui/images/mode_fit.png b/GUI/pygui/images/mode_fit.png new file mode 100644 index 0000000000000000000000000000000000000000..e095ab64d8e186d5ecbdf13e166f00e913adbee5 Binary files /dev/null and b/GUI/pygui/images/mode_fit.png differ diff --git a/GUI/pygui/images/mode_job.png b/GUI/pygui/images/mode_job.png new file mode 100644 index 0000000000000000000000000000000000000000..53fd3b1a59dabed41f1996856673eef813084cda Binary files /dev/null and b/GUI/pygui/images/mode_job.png differ diff --git a/GUI/pygui/images/mode_sample.png b/GUI/pygui/images/mode_sample.png new file mode 100644 index 0000000000000000000000000000000000000000..fd388db826174d63dcafa57b5db5724b0b62ae12 Binary files /dev/null and b/GUI/pygui/images/mode_sample.png differ diff --git a/GUI/pygui/images/mode_script.png b/GUI/pygui/images/mode_script.png new file mode 100644 index 0000000000000000000000000000000000000000..e74d73df1123a0904ce5c35675a6ed769011cf09 Binary files /dev/null and b/GUI/pygui/images/mode_script.png differ diff --git a/GUI/pygui/images/mode_simul.png b/GUI/pygui/images/mode_simul.png new file mode 100644 index 0000000000000000000000000000000000000000..2d9abbdd56f1d44ec0f1992ab3252c2849f4c929 Binary files /dev/null and b/GUI/pygui/images/mode_simul.png differ diff --git a/GUI/pygui/images/mode_welcome.png b/GUI/pygui/images/mode_welcome.png new file mode 100644 index 0000000000000000000000000000000000000000..a14a2e6d4a41a639a5ddbbabdd5776e78c6ff306 Binary files /dev/null and b/GUI/pygui/images/mode_welcome.png differ diff --git a/GUI/pygui/mainwindow/MainWindow.py b/GUI/pygui/mainwindow/MainWindow.py index 4ffcc560bda483b0ded90c065c04b2d171ed4d5f..30531968eacd1c59d6d5a6d7b08a49c831d077fb 100644 --- a/GUI/pygui/mainwindow/MainWindow.py +++ b/GUI/pygui/mainwindow/MainWindow.py @@ -23,6 +23,7 @@ def fromPyQt(object, type): return type.wrap(ptr) +#import ManhattanStyle as lms import libManhattanStyle as lms from views.WelcomeView import WelcomeView @@ -32,26 +33,26 @@ class MainWindow(QMainWindow): baseName = QApplication.style().objectName() - manhattan_style = lms.ManhattanStyle( str(baseName) ) + #manhattan_style = lms.ManhattanStyle( str(baseName) ) #manhattan_style = lms.ManhattanStyle( sip.unwrapinstance(baseName) ) #manhattan_style = lms.ManhattanStyle( fromPyQt(baseName, lms.QString) ) #lms.StyleHelper.setBaseColor( fromPyQt(QColor(0x086FA1), lms.QColor) ) - k = QColor(Qt.red) - lms.StyleHelper.setBaseColor(k ) - qApp.setStyle( lms.toPyQt(manhattan_style) ) + #k = QColor(Qt.red) + #lms.StyleHelper.setBaseColor(k ) + #qApp.setStyle( lms.toPyQt(manhattan_style) ) - - self.__tabWidget = lms.FancyTabWidget() + self.__tabWidget = lms.FancyTabWidget(self) self.__welcomeView = WelcomeView() - #self.__welcomeView = QWidget() - self.__tabWidget.insertTab(0, self.__welcomeView, QIcon(":/images/mode_welcome.png"), "Welcome" ) + print "PPPPP 1.1" + self.__tabWidget.insertTab(0, self.__welcomeView, QIcon("images/mode_welcome.png"), "Welcome" ) + print "PPPPP 1.2" #self.__tabWidget.insertTab(0, fromPyQt(self.__welcomeView, lms.QWidget), fromPyQt(QIcon(":/images/mode_welcome.png"), lms.QIcon), fromPyQt(QString("Welcome"), lms.QString )) self.setCentralWidget( lms.toPyQt(self.__tabWidget) ) - #self.setCentralWidget( toPyQt(self.__tabWidget, QWidget) ) + #self.setCentralWidget( self.__welcomeView ) diff --git a/GUI/pygui/views/WelcomeView.py b/GUI/pygui/views/WelcomeView.py index 7a71f68cd1536b9bf0aa51b0e9c5b6c4497f54cb..9a8e1e667dc8105f65ccceeee84caf9abf086397 100644 --- a/GUI/pygui/views/WelcomeView.py +++ b/GUI/pygui/views/WelcomeView.py @@ -1,12 +1,27 @@ from PyQt4.QtCore import ( - QObject, + QObject, QUrl, SIGNAL, SLOT ) from PyQt4.QtGui import ( - QMainWindow, QWidget, + QMainWindow, QWidget, QDesktopServices ) +from PyQt4.QtWebKit import ( + QWebPage, QWebView +) + + +# class WelcomeView(QWidget): +# def __init__(self, parent = None): +# QWidget.__init__(self, parent) -class WelcomeView(QWidget): +class WelcomeView(QWebView): def __init__(self, parent = None): - QWidget.__init__(self, parent) + super(WelcomeView, self).__init__(parent) + self.url = QUrl("http://apps.jcns.fz-juelich.de/doku/sc/bornagain::start") + self.load(self.url) + self.connect(self, SIGNAL("linkClicked(const QUrl &)"), self.onWebLinkClicked) + self.page().setLinkDelegationPolicy( QWebPage.DelegateAllLinks ) + def onWebLinkClicked(self, url): + print "XXXclicked" + QDesktopServices.openUrl(url)