[rkward/frameworks] /: Merge branch 'master' into frameworks

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Feb 11 15:15:45 UTC 2016


Git commit 4561f70cd2cb6d6ef99c171fa0d4469126b93150 by Thomas Friedrichsmeier.
Committed on 11/02/2016 at 15:15.
Pushed by tfry into branch 'frameworks'.

Merge branch 'master' into frameworks

M  +6    -1    ChangeLog
M  +6    -0    TODO
M  +12   -2    rkward/dialogs/rkloadlibsdialog.cpp
M  +1    -0    rkward/misc/CMakeLists.txt
M  +1    -0    rkward/misc/rkdynamicsearchline.cpp
M  +5    -1    rkward/misc/rkstandardicons.cpp
M  +3    -1    rkward/misc/rkstandardicons.h
M  +4    -4    rkward/plugin/rkpreviewbox.cpp
M  +11   -3    rkward/plugin/rkstandardcomponent.cpp
M  +2    -1    rkward/plugin/rkstandardcomponent.h
M  +180  -84   rkward/plugin/rkstandardcomponentgui.cpp
M  +11   -4    rkward/plugin/rkstandardcomponentgui.h
M  +3    -3    rkward/settings/rksettingsmoduleplugins.cpp
M  +3    -3    rkward/settings/rksettingsmoduleplugins.h
M  +9    -1    rkward/windows/rkmdiwindow.cpp
M  +26   -0    rkward/windows/rkwindowcatcher.cpp
M  +2    -0    rkward/windows/rkwindowcatcher.h

http://commits.kde.org/rkward/4561f70cd2cb6d6ef99c171fa0d4469126b93150

diff --cc ChangeLog
index 0b9f232,081ec39..30eaed2
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,11 -1,8 +1,16 @@@
 +- Show the message accompanying rk.show.files() or rk.edit.files() inside the main window, instead of a separate dialog
 +- File browser gains "Rename" context menu action
 +- File selection fields in plugin dialogs remember the last used directory (per session), and check for a valid selection
 +- Better handling of text drag-and-drop inside the R console window
 +
 +--- Version 0.6.5 - XXXXXXXXXXXXXXX
 +
 +
+ - Provide better status feedback when searching / filtering among installable packages
+ - Add access to basic menu items for docked previews
+ - Move preview controls to the button-column of dialogs                                            TODO document, polish
+ - Add preview to Sort data-, Subset data, and Recode categorical data-plugins
+ - Add preview to Power Analysis plugin
  - Add support for adding "htmlwidget"- and "gvis"-class objects to the output window via rk.print()
  - Add plugins for importing Excel files (.xls and .xlsx, Perl- and Java-based)
  - Add ability to extract <matrix> values row-wise in plugins
diff --cc TODO
index 8e3f634,c2747fb..25dcc4c
--- a/TODO
+++ b/TODO
@@@ -2,28 -2,6 +2,31 @@@ The following list of TODO-items is NO
  Also, plans change frequently. If something is listed for a specific release, that's no more than a rough plan.
  All in all, this TODO list is mostly for internal purposes, and many parts may not necessarily be intellegible to anybody but the authors.
  
 +KF5 port:
 +Things to do:
 +- Remove kde4libssupport classes
 +- Adjust platform checks
 +- Device window embedding / remove qwinhost
++- Grep for "KF5 TODO"
 +Things to test at the end:
 +- Everthing concerning loading / saving, from recent files, scripts, workspace, etc.
 +  - Moved installations, moved workspaces.
 +- Window embedding
++Knwon issues to fix:
++- Initial window placement for plugins with previews is borked
 +
 +Upcoming porting efforts: Port from QtScript to QJSEngine:
 +- Unforunately, QJSEngine lacks support for pre-compiled JS (QScriptProgram), ATM (Qt 5.5). We'll need some other optimization.
 +- Idea: Use _one_ engine for each plugin, _including_ any embedded plugins. Wrap existing JS code into a closure, exporting only the "primary" functions as properties of an object.
 +  - Then, the scriptbackend will call plugin_a.preprocess(), etc.
 +  - The scriptbackend knows which of the plugins it is currently dealing with, and thus can trivially relay all getValue()-calls as appropriate.
 +- Same approach for UI scripting.
 +
 +Port from QtWebKit to QtWebEngine
 +- Should be mostly unproblematic
 +- Somewhat unfortunate that QWebElement will be gone. We might be using this to amend the context menu, e.g. for copying one section to clipboard / deleting one section, etc.
 +  - Could perhaps be done by catching contextmenu event in JS, instead, then send to frontend, somehow.
 +
  New features in R 3.1.0 to make use of / support:
  
  - A new browser command s has been added, to “step into” function calls.
diff --cc rkward/dialogs/rkloadlibsdialog.cpp
index e903d17,b5d16f2..d2e8aea
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@@ -696,9 -711,11 +702,11 @@@ InstallPackagesWidget::InstallPackagesW
  	filter_edit = new RKDynamicSearchLine (this);
  	RKCommonFunctions::setTips (i18n ("<p>You can limit the packages displayed in the list to with names or titles matching a filter string.</p>") + filter_edit->regexpTip (), label, filter_edit);
  	filter_edit->setModelToFilter (model);
+ 	// NOTE: Although the search line sets the filter in the model, automatically, we connect it, here, in order to expand new and updateable sections, when the filter changes.
+ 	connect (filter_edit, SIGNAL (searchChanged(QRegExp)), this, SLOT (filterChanged()));    // KF5 TODO
  	rkward_packages_only = new QCheckBox (i18n ("Show only packages providing RKWard dialogs"), this);
  	RKCommonFunctions::setTips (i18n ("<p>Some but not all R packages come with plugins for RKWard. That means they provide a graphical user-interface in addition to R functions. Check this box to show only such packages.</p><p></p>"), rkward_packages_only);
 -	connect (rkward_packages_only, SIGNAL(stateChanged(int)), this, SLOT (filterChanged()));
 +	connect (rkward_packages_only, &QCheckBox::stateChanged, this, &InstallPackagesWidget::filterChanged);
  	filterChanged ();
  
  	mark_all_updates_button = new QPushButton (i18n ("Select all updates"), this);
diff --cc rkward/misc/CMakeLists.txt
index b990ae5,2e70517..2fe7a11
--- a/rkward/misc/CMakeLists.txt
+++ b/rkward/misc/CMakeLists.txt
@@@ -28,10 -28,15 +28,11 @@@ SET(misc_STAT_SRC
     rkfindbar.cpp
     rkdynamicsearchline.cpp
     rkaccordiontable.cpp
+    rkxmlguipreviewarea.cpp
     )
  
 -QT4_AUTOMOC(${misc_STAT_SRCS})
 -# Urghs. QT4_AUTOMOC scans only the .h-file for Q_OBJECT macros. Let's hope this will be better with KF5
 -QT4_GENERATE_MOC (rkaccordiontable.cpp ${CMAKE_CURRENT_BINARY_DIR}/rkaccordiontablemodel_moc.cpp)
 -
  ADD_LIBRARY(misc STATIC ${misc_STAT_SRCS})
 -
 +TARGET_LINK_LIBRARIES(misc Qt5::Widgets KF5::WidgetsAddons KF5::KIOWidgets Qt5::Xml KF5::ConfigCore KF5::Parts KF5::KDELibs4Support)
  
  ########### install files ###############
  
diff --cc rkward/misc/rkstandardicons.cpp
index a8bdf96,52fc3b2..ec6c43a
--- a/rkward/misc/rkstandardicons.cpp
+++ b/rkward/misc/rkstandardicons.cpp
@@@ -61,35 -55,38 +61,38 @@@ void RKStandardIcons::doInitIcons () 
  	icons[ActionPasteInsideSelection] = QIcon (rkward_icon_base + "paste_inside_selection.png");
  
  	icons[ActionDelete] = icons[ActionDeleteRow];
 -	icons[ActionAddRight] = KIcon ("arrow-right");
 -	icons[ActionRemoveLeft] = KIcon ("arrow-left");
 +	icons[ActionAddRight] = QIcon::fromTheme("arrow-right");
 +	icons[ActionRemoveLeft] = QIcon::fromTheme("arrow-left");
  
 -	icons[ActionMoveLeft] = KIcon ("go-previous");
 -	icons[ActionMoveRight] = KIcon ("go-next");
 -	icons[ActionMoveFirst] = KIcon ("go-first");
 -	icons[ActionMoveLast] = KIcon ("go-last");
 -	icons[ActionMoveUp] = KIcon ("go-up");
 -	icons[ActionMoveDown] = KIcon ("go-down");
 +	icons[ActionMoveLeft] = QIcon::fromTheme("go-previous");
 +	icons[ActionMoveRight] = QIcon::fromTheme("go-next");
 +	icons[ActionMoveFirst] = QIcon::fromTheme("go-first");
 +	icons[ActionMoveLast] = QIcon::fromTheme("go-last");
 +	icons[ActionMoveUp] = QIcon::fromTheme("go-up");
 +	icons[ActionMoveDown] = QIcon::fromTheme("go-down");
  
 -	icons[ActionExpandDown] = KIcon ("arrow-right");
 -	icons[ActionCollapseUp] = KIcon ("arrow-down");
 +	icons[ActionExpandDown] = QIcon::fromTheme("arrow-right");
 +	icons[ActionCollapseUp] = QIcon::fromTheme("arrow-down");
  
 -	icons[ActionDocumentInfo] = KIcon ("documentinfo.png");
 -	icons[ActionFlagGreen] = KIcon ("flag-green.png");
 -	icons[ActionSnapshot] = KIcon ("list-add.png");
 -	icons[ActionListPlots] = KIcon ("view-preview.png");
 -	icons[ActionRemovePlot] = KIcon ("list-remove.png");
 -	icons[ActionWindowDuplicate] = KIcon ("window-duplicate.png");
 +	icons[ActionDocumentInfo] = QIcon::fromTheme("documentinfo.png");
 +	icons[ActionFlagGreen] = QIcon::fromTheme("flag-green.png");
 +	icons[ActionSnapshot] = QIcon::fromTheme("list-add.png");
 +	icons[ActionListPlots] = QIcon::fromTheme("view-preview.png");
 +	icons[ActionRemovePlot] = QIcon::fromTheme("list-remove.png");
 +	icons[ActionWindowDuplicate] = QIcon::fromTheme("window-duplicate.png");
  
 -	icons[ActionClear] = KIcon ("edit-clear.png");
 -	icons[ActionInterrupt] = KIcon ("media-playback-stop");
 +	icons[ActionClear] = QIcon::fromTheme("edit-clear.png");
 +	icons[ActionInterrupt] = QIcon::fromTheme("media-playback-stop");
  
 -	icons[ActionDetachWindow] = KIcon ("view-fullscreen");
 -	icons[ActionAttachWindow] = KIcon ("view-restore");
 +	icons[ActionDetachWindow] = QIcon::fromTheme("view-fullscreen");
 +	icons[ActionAttachWindow] = QIcon::fromTheme("view-restore");
  
 -	icons[ActionLock] = KIcon ("object-locked");
 -	icons[ActionUnlock] = KIcon ("object-unlocked");
 +	icons[ActionLock] = QIcon::fromTheme("object-locked");
 +	icons[ActionUnlock] = QIcon::fromTheme("object-unlocked");
  
+ 	icons[ActionShowMenu] = QIcon::fromTheme ("application-menu");
+ 	if (icons[ActionShowMenu].isNull ()) icons[ActionShowMenu] = QIcon (rkward_icon_base + "menu.svg");  // fallback
+ 
  	// objects
  	icons[ObjectList] = QIcon (rkward_icon_base + "list.png");
  	icons[ObjectFunction] = QIcon (rkward_icon_base + "function.png");
@@@ -107,22 -104,23 +110,23 @@@
  
  	// windows
  	icons[WindowDataFrameEditor] = icons[ObjectDataFrame];
 -	icons[WindowCommandEditor] = KIcon ("text-x-makefile");	// this may not be the most obvious choice, but it is not quite as awfully close to the data.frame editor icons as most other text icons
 -	icons[WindowOutput] = KIcon ("applications-education");
 -	icons[WindowHelp] = KIcon ("help-contents");
 -	icons[WindowX11] = KIcon ("x");
 -	icons[WindowObject] = KIcon ("zoom-original");
 -	icons[WindowConsole] = KIcon ("utilities-terminal");
 -	icons[WindowCommandLog] = KIcon ("format-justify-left");
 -	icons[WindowWorkspaceBrowser] = KIcon ("view-list-tree");
 -	icons[WindowSearchHelp] = KIcon ("help-contents");
 -	icons[WindowPendingJobs] = KIcon ("system-run");
 -	icons[WindowFileBrowser] = KIcon ("folder");
 -	icons[WindowDebugConsole] = KIcon ("view-process-system");
 -	icons[WindowCallstackViewer] = KIcon ("view-sort-ascending");
 -
 -	icons[DocumentPDF] = KIcon ("application-pdf");
 +	icons[WindowCommandEditor] = QIcon::fromTheme("text-x-makefile");	// this may not be the most obvious choice, but it is not quite as awfully close to the data.frame editor icons as most other text icons
 +	icons[WindowOutput] = QIcon::fromTheme("applications-education");
 +	icons[WindowHelp] = QIcon::fromTheme("help-contents");
 +	icons[WindowX11] = QIcon::fromTheme("x");
 +	icons[WindowObject] = QIcon::fromTheme("zoom-original");
 +	icons[WindowConsole] = QIcon::fromTheme("utilities-terminal");
 +	icons[WindowCommandLog] = QIcon::fromTheme("format-justify-left");
 +	icons[WindowWorkspaceBrowser] = QIcon::fromTheme("view-list-tree");
 +	icons[WindowSearchHelp] = QIcon::fromTheme("help-contents");
 +	icons[WindowPendingJobs] = QIcon::fromTheme("system-run");
 +	icons[WindowFileBrowser] = QIcon::fromTheme("folder");
 +	icons[WindowDebugConsole] = QIcon::fromTheme("view-process-system");
 +	icons[WindowCallstackViewer] = QIcon::fromTheme("view-sort-ascending");
 +
 +	icons[DocumentPDF] = QIcon::fromTheme("application-pdf");
  
+ 	// KF5 TODO: The code below should work allright with QIcon::fromTheme
  /*	This does not work, as the icons are not really Null in this case, but some default icon. Any way to really test this?
  	RK_DO ({
  		for (int i = ActionRunAll; i < Last; ++i) {
diff --cc rkward/plugin/rkstandardcomponentgui.cpp
index ee180df,1c53085..3b8458e
--- a/rkward/plugin/rkstandardcomponentgui.cpp
+++ b/rkward/plugin/rkstandardcomponentgui.cpp
@@@ -18,9 -18,9 +18,7 @@@
  #include "rkstandardcomponentgui.h"
  
  #include <klocale.h>
- #include <QAction>
 -#include <kaction.h>
  #include <kactioncollection.h>
- #include <QUrl>
 -#include <kurl.h>
  #include <kvbox.h>
  
  #include <qtimer.h>
@@@ -31,6 -31,7 +29,10 @@@
  #include <QSplitter>
  #include <QHBoxLayout>
  #include <QToolButton>
+ #include <QDesktopWidget>
++#include <QAction>
++#include <QUrl>
++#include <QApplication>
  
  #include "rkcomponentmap.h"
  #include "../misc/rkcommonfunctions.h"
@@@ -122,34 -193,40 +194,40 @@@ void RKStandardComponentGUI::createDial
  	hbox->addLayout (vbox);
  	vbox->setContentsMargins (0, 0, 0, 0);
  	vbox->setSpacing (RKGlobals::spacingHint ());
- 	ok_button = new QPushButton (i18n ("Submit"), upper_widget);
+ 	ok_button = new QPushButton (i18n ("Submit"), central_widget);
 -	connect (ok_button, SIGNAL (clicked()), this, SLOT (ok()));
 +	connect (ok_button, &QPushButton::clicked, this, &RKStandardComponentGUI::ok);
  	vbox->addWidget (ok_button);
  	if (enslaved) ok_button->hide ();
  
- 	cancel_button = new QPushButton (i18n ("Close"), upper_widget);
+ 	cancel_button = new QPushButton (i18n ("Close"), central_widget);
 -	connect (cancel_button, SIGNAL (clicked()), this, SLOT (cancel()));
 +	connect (cancel_button, &QPushButton::clicked, this, &RKStandardComponentGUI::cancel);
  	vbox->addWidget (cancel_button);
- 	auto_close_box = new QCheckBox (i18n ("Auto close"), upper_widget);
+ 	auto_close_box = new QCheckBox (i18n ("Auto close"), central_widget);
  	auto_close_box->setChecked (true);
  	vbox->addWidget (auto_close_box);
  	if (enslaved) auto_close_box->hide ();
  	vbox->addStretch (1);
  	
- 	help_button = new QPushButton (i18n ("Help"), upper_widget);
+ 	help_button = new QPushButton (i18n ("Help"), central_widget);
  	help_button->setEnabled (component->haveHelp ());
 -	connect (help_button, SIGNAL (clicked()), this, SLOT (help()));
 +	connect (help_button, &QPushButton::clicked, this, &RKStandardComponentGUI::help);
  	vbox->addWidget (help_button);
  	
  	if (switchable && (!enslaved)) {
- 		switch_button = new QPushButton (i18n ("Use Wizard"), upper_widget);
+ 		switch_button = new QPushButton (i18n ("Use Wizard"), central_widget);
 -		connect (switch_button, SIGNAL (clicked()), this, SLOT (switchInterface()));
 +		connect (switch_button, &QPushButton::clicked, this, &RKStandardComponentGUI::switchInterface);
  		vbox->addWidget (switch_button);
  	}
  	vbox->addStretch (2);
- 	
- 	toggle_code_box = new QCheckBox (i18n ("Code Preview"), upper_widget);
+ 
+ 	custom_preview_buttons_area = new QWidget ();
+ 	QVBoxLayout *dummy = new QVBoxLayout (custom_preview_buttons_area);
+ 	dummy->setContentsMargins (0, 0, 0, 0);
+ 	vbox->addWidget (custom_preview_buttons_area);
+ 
+ 	toggle_code_box = new QCheckBox (i18n ("Code Preview"), central_widget);
+ 	toggle_code_box->setChecked (code_display_visibility.boolValue ());
 -	connect (toggle_code_box, SIGNAL (clicked()), this, SLOT (toggleCode()));
 +	connect (toggle_code_box, &QCheckBox::clicked, this, &RKStandardComponentGUI::toggleCode);
  	vbox->addWidget (toggle_code_box);
  	if (enslaved) toggle_code_box->hide ();
  
@@@ -182,7 -264,9 +265,9 @@@ void RKStandardComponentGUI::finalize (
  		tb->setAutoRaise (true);
  		tb->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionDelete));
  		tb->setProperty ("preview_area", QVariant::fromValue (dummy));
 -		connect (tb, SIGNAL (clicked()), this, SLOT (previewCloseButtonClicked()));
 +		connect (tb, &QAbstractButton::clicked, this, &RKStandardComponentGUI::previewCloseButtonClicked);
+ 		RKXMLGUIPreviewArea *parea = qobject_cast<RKXMLGUIPreviewArea*> (previews[i].area);
+ 		if (parea) hl->addWidget (parea->menuButton ());
  		hl->addStretch ();
  		hl->addWidget (lab);
  		hl->addWidget (tb);
@@@ -191,9 -275,25 +276,25 @@@
  		vl->addWidget (previews[i].area);
  		previews[i].area->show ();
  		previews[i].area = dummy;
 -		connect (previews[i].controller, SIGNAL (valueChanged(RKComponentPropertyBase*)), this, SLOT (previewVisibilityChanged(RKComponentPropertyBase*)));
++		connect (previews[i].controller, &RKComponentPropertyBase::valueChanged, this, &RKStandardComponentGUI::previewVisibilityChanged);
  		if (!(previews[i].controller->boolValue ())) dummy->hide ();
- 		splitter->insertWidget (i+1, previews[i].area);
- 		splitter->setStretchFactor (i+1, 1);
+ 		else {
+ 			if (previews[i].position == Qt::Horizontal) any_hpreview_visible = true;
+ 			else any_vpreview_visible = true;
+ 		}
+ 		if (previews[i].position == Qt::Horizontal) hpreview_area->insertWidget (hpreview_area->count () - 1, previews[i].area);
+ 		else vpreview_area->layout ()->addWidget (previews[i].area);
+ 	}
+ 
+ 	if (any_hpreview_visible) {
+ 		hpreview_area->setMinimumWidth (hsplitter->defaultExtensionSize ());  // enforce minimum, here to achieve sane size on show. Will be cleared directly after show.
+ 	} else {
+ 		hpreview_area->hide ();
+ 	}
+ 	if (any_vpreview_visible) {
+ 		vpreview_area->setMinimumHeight (vsplitter->defaultExtensionSize ());  // see above
+ 	} else {
+ 		vpreview_area->hide ();
  	}
  }
  
diff --cc rkward/windows/rkmdiwindow.cpp
index 6b58e5b,356afe2..70b27e7
--- a/rkward/windows/rkmdiwindow.cpp
+++ b/rkward/windows/rkmdiwindow.cpp
@@@ -367,10 -363,18 +367,18 @@@ void RKMDIWindow::showEvent (QShowEvent
  void RKMDIWindow::setWindowStyleHint (const QString& hint) {
  	RK_TRACE (APP);
  
- 	if (hint == "preview") no_border_when_active = true;
+ 	if (hint == "preview") {
+ 		if (standard_client) {
+ 			QAction *act = standardActionCollection ()->action ("window_help");
+ 			if (act) act->setVisible (false);
+ 			act = standardActionCollection ()->action ("window_configure");
+ 			if (act) act->setVisible (false);
+ 		}
+ 		no_border_when_active = true;
+ 	}
  }
  
 -void RKMDIWindow::setMetaInfo (const QString& _generic_window_name, const QString& _help_url, RKSettings::SettingsPage _settings_page) {
 +void RKMDIWindow::setMetaInfo (const QString& _generic_window_name, const QUrl& _help_url, RKSettings::SettingsPage _settings_page) {
  	RK_TRACE (APP);
  
  	// only meant to be called once
diff --cc rkward/windows/rkwindowcatcher.cpp
index 021e04d,fc2f5f4..8bde5fd
--- a/rkward/windows/rkwindowcatcher.cpp
+++ b/rkward/windows/rkwindowcatcher.cpp
@@@ -653,59 -611,73 +664,73 @@@ RKCaughtX11WindowPart::RKCaughtX11Windo
  	setXMLFile ("rkcatchedx11windowpart.rc");
  
  	window->dynamic_size_action = new KToggleAction (i18n ("Draw area follows size of window"), window);
 -	connect (window->dynamic_size_action, SIGNAL (triggered()), window, SLOT (fixedSizeToggled()));
 +	connect (window->dynamic_size_action, &KToggleAction::triggered, window, &RKCaughtX11Window::fixedSizeToggled);
  	actionCollection ()->addAction ("toggle_fixed_size", window->dynamic_size_action);
+ 	window->actions_not_for_preview.append (window->dynamic_size_action);
  
  	QAction *action;
  	action = actionCollection ()->addAction ("set_fixed_size_1", window, SLOT (setFixedSize1()));
  	action->setText (i18n ("Set fixed size 500x500"));
+ 	window->actions_not_for_preview.append (action);
  	action = actionCollection ()->addAction ("set_fixed_size_2", window, SLOT (setFixedSize2()));
  	action->setText (i18n ("Set fixed size 1000x1000"));
+ 	window->actions_not_for_preview.append (action);
  	action = actionCollection ()->addAction ("set_fixed_size_3", window, SLOT (setFixedSize3()));
  	action->setText (i18n ("Set fixed size 2000x2000"));
+ 	window->actions_not_for_preview.append (action);
  	action = actionCollection ()->addAction ("set_fixed_size_manual", window, SLOT (setFixedSizeManual()));
  	action->setText (i18n ("Set specified fixed size..."));
+ 	window->actions_not_for_preview.append (action);
  
  	action = actionCollection ()->addAction ("plot_prev", window, SLOT (previousPlot()));
+ 	window->actions_not_for_preview.append (action);
   	action->setText (i18n ("Previous plot"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionMoveLeft));
 -	window->plot_prev_action = (KAction*) action;
 +	window->plot_prev_action = (QAction *) action;
  	action = actionCollection ()->addAction ("plot_first", window, SLOT (firstPlot()));
+ 	window->actions_not_for_preview.append (action);
   	action->setText (i18n ("First plot"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionMoveFirst));
 -	window->plot_first_action = (KAction*) action;
 +	window->plot_first_action = (QAction *) action;
  	action = actionCollection ()->addAction ("plot_next", window, SLOT (nextPlot()));
+ 	window->actions_not_for_preview.append (action);
   	action->setText (i18n ("Next plot"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionMoveRight));
 -	window->plot_next_action = (KAction*) action;
 +	window->plot_next_action = (QAction *) action;
  	action = actionCollection ()->addAction ("plot_last", window, SLOT (lastPlot()));
+ 	window->actions_not_for_preview.append (action);
   	action->setText (i18n ("Last plot"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionMoveLast));
 -	window->plot_last_action = (KAction*) action;
 +	window->plot_last_action = (QAction *) action;
  	action = window->plot_list_action = new KSelectAction (i18n ("Go to plot"), 0);
+ 	window->actions_not_for_preview.append (action);
  	window->plot_list_action->setToolBarMode (KSelectAction::MenuMode);
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionListPlots));
  	actionCollection ()->addAction ("plot_list", action);
 -	connect (action, SIGNAL (triggered(int)), window, SLOT (gotoPlot(int)));
 +	connect (action, &QAction::triggered, window, &RKCaughtX11Window::gotoPlot);
  
  	action = actionCollection ()->addAction ("plot_force_append", window, SLOT (forceAppendCurrentPlot()));
+ 	window->actions_not_for_preview.append (action);
   	action->setText (i18n ("Append this plot"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionSnapshot));
 -	window->plot_force_append_action = (KAction*) action;
 +	window->plot_force_append_action = (QAction *) action;
  	action = actionCollection ()->addAction ("plot_remove", window, SLOT (removeCurrentPlot()));
+ 	window->actions_not_for_preview.append (action);
   	action->setText (i18n ("Remove this plot"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionRemovePlot));
 -	window->plot_remove_action = (KAction*) action;
 +	window->plot_remove_action = (QAction *) action;
  
  	action = actionCollection ()->addAction ("plot_clear_history", window, SLOT (clearHistory()));
 -	window->plot_clear_history_action = (KAction*) action;
 +	window->plot_clear_history_action = (QAction *) action;
   	action->setText (i18n ("Clear history"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionClear));
+ 	window->actions_not_for_preview.append (action);
  
  	action = actionCollection ()->addAction ("plot_properties", window, SLOT (showPlotInfo()));
 -	window->plot_properties_action = (KAction*) action;
 +	window->plot_properties_action = (QAction *) action;
  	action->setText (i18n ("Plot properties"));
  	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionDocumentInfo));
+ 	window->actions_not_for_preview.append (action);
  
  	action = actionCollection ()->addAction ("device_activate", window, SLOT (activateDevice()));
  	action->setText (i18n ("Make active"));
diff --cc rkward/windows/rkwindowcatcher.h
index 32b2a02,6db344e..f3cadaa
--- a/rkward/windows/rkwindowcatcher.h
+++ b/rkward/windows/rkwindowcatcher.h
@@@ -164,8 -150,9 +164,9 @@@ public slots
  	void showPlotInfo ();
  
  /** reimplemented to keep window alive while saving history */
 -	bool close (bool also_delete);
 +	bool close (bool also_delete) override;
  	void setKilledInR () { killed_in_r = true; };
+ 	void setWindowStyleHint (const QString& hint); // KF5 TODO: add override keyword
  private slots:
  	void doEmbed ();
  private:
@@@ -195,17 -182,18 +196,18 @@@
  
  	bool dynamic_size;
  	KToggleAction *dynamic_size_action;
 -	KAction *plot_prev_action;
 -	KAction *plot_next_action;
 -	KAction *plot_first_action;
 -	KAction *plot_last_action;
 -	KAction *plot_force_append_action;
 -	KAction *plot_remove_action;
 -	KAction *plot_clear_history_action;
 -	KAction *plot_properties_action;
 +	QAction *plot_prev_action;
 +	QAction *plot_next_action;
 +	QAction *plot_first_action;
 +	QAction *plot_last_action;
 +	QAction *plot_force_append_action;
 +	QAction *plot_remove_action;
 +	QAction *plot_clear_history_action;
 +	QAction *plot_properties_action;
  	KSelectAction *plot_list_action;
 -	KAction *stop_interaction;
 +	QAction *stop_interaction;
  
+ 	QList<QAction*> actions_not_for_preview;
  	int history_length;
  	int history_position;
  };



More information about the rkward-tracker mailing list