Commit 9fa3363e authored by Jan Möbius's avatar Jan Möbius

Toolbar for scripting widget

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12435 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b6fba524
......@@ -83,27 +83,50 @@ void ScriptingPlugin::pluginsInitialized() {
scriptWidget_ = new ScriptWidget();
QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
scriptWidget_->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"document-open.png");
icon.addFile(iconPath+"document-open.png");
scriptWidget_->actionLoad_Script->setIcon(icon);
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"document-save.png");
icon.addFile(iconPath+"document-save.png");
scriptWidget_->actionSave_Script->setIcon(icon);
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"document-save-as.png");
icon.addFile(iconPath+"document-save-as.png");
scriptWidget_->actionSave_Script_As->setIcon(icon);
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"window-close.png");
icon.addFile(iconPath+"window-close.png");
scriptWidget_->actionClose->setIcon(icon);
QToolBar* toolBar = new QToolBar(tr("File Actions"));
QAction* openButton = new QAction(QIcon(iconPath + "document-open.png"), "Open", toolBar);
toolBar->addAction(openButton);
connect (openButton, SIGNAL( triggered() ), this, SLOT( slotLoadScript() ) );
QAction* saveButton = new QAction(QIcon(iconPath + "document-save.png"), "Save", toolBar);
toolBar->addAction(saveButton);
connect (saveButton, SIGNAL( triggered() ), this, SLOT( slotSaveScript() ) );
QAction* saveAsButton = new QAction(QIcon(iconPath + "document-save-as.png"), "Save as", toolBar);
toolBar->addAction(saveAsButton);
connect (saveAsButton, SIGNAL( triggered() ), this, SLOT( slotSaveScriptAs() ) );
toolBar->addSeparator();
QAction* executeButton = new QAction(QIcon(iconPath + "arrow-right.png"), "Execute", toolBar);
toolBar->addAction(executeButton);
connect (executeButton, SIGNAL( triggered() ), this, SLOT( slotExecuteScriptButton() ) );
scriptWidget_->addToolBar(toolBar);
scriptWidget_->hide();
scriptWidget_->resize(scriptWidget_->width() , std::min(QApplication::desktop()->screenGeometry().height() - 150 , 800) );
connect( scriptWidget_->executeButton, SIGNAL(clicked()),
this , SLOT( slotExecuteScriptButton() ));
connect (scriptWidget_->actionLoad_Script, SIGNAL( triggered() ), this, SLOT( slotLoadScript() ) );
scriptWidget_->actionLoad_Script->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_O) );
connect (scriptWidget_->actionSave_Script, SIGNAL( triggered() ), this, SLOT( slotSaveScript() ) );
......
......@@ -32,13 +32,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="executeButton">
<property name="text">
<string>Execute</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QTabWidget" name="tabWidget">
......@@ -126,7 +119,7 @@
<x>0</x>
<y>0</y>
<width>895</width>
<height>26</height>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
......
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