[rkward] /: Place manually added plugimaps at the end of the list, initially.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Mar 11 16:35:26 UTC 2016


Git commit 9b67fc07a4610922aef381f1b36eff52126e9b5f by Thomas Friedrichsmeier.
Committed on 11/03/2016 at 16:34.
Pushed by tfry into branch 'master'.

Place manually added plugimaps at the end of the list, initially.

See https://mail.kde.org/pipermail/rkward-devel/2016-March/004561.html

M  +1    -0    ChangeLog
M  +1    -0    rkward/dialogs/rkloadlibsdialog.cpp
M  +3    -1    rkward/misc/multistringselector.cpp
M  +2    -0    rkward/misc/multistringselector.h

http://commits.kde.org/rkward/9b67fc07a4610922aef381f1b36eff52126e9b5f

diff --git a/ChangeLog b/ChangeLog
index 87b2eb7..a9a66aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+- When manually adding pluginmaps, load these after, not before other pluginmaps, by default
 - Added context menu option to search for information on current symbol online
 - Fixed: Wizard plugins would be too small, initially
 - Fixed: Help Search was not longer working correctly with R 3.2.x
diff --git a/rkward/dialogs/rkloadlibsdialog.cpp b/rkward/dialogs/rkloadlibsdialog.cpp
index b5d16f2..511d5b5 100644
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@ -1272,6 +1272,7 @@ RKPluginMapSelectionWidget::RKPluginMapSelectionWidget (RKLoadLibsDialog* dialog
 	vbox->setContentsMargins (0, 0, 0, 0);
 	vbox->addWidget (new QLabel (i18n ("Installed plugin groups (.pluginmap files)"), this));
 	selector = new RKMultiStringSelectorV2 (QString (), this);
+	selector->setAlwaysAddAtBottom (true);
 	vbox->addWidget (selector);
 }
 
diff --git a/rkward/misc/multistringselector.cpp b/rkward/misc/multistringselector.cpp
index b46a3a6..8c2c126 100644
--- a/rkward/misc/multistringselector.cpp
+++ b/rkward/misc/multistringselector.cpp
@@ -89,6 +89,7 @@ void MultiStringSelector::swapRowsImpl (int rowa, int rowb) {
 RKMultiStringSelectorV2::RKMultiStringSelectorV2 (const QString& label, QWidget* parent) : QWidget (parent) {
 	RK_TRACE (MISC);
 
+	add_at_bottom = false;
 	QHBoxLayout *hbox = new QHBoxLayout (this);
 	hbox->setContentsMargins (0, 0, 0, 0);
 
@@ -170,8 +171,9 @@ void RKMultiStringSelectorV2::buttonClicked () {
 	if (index.isValid ()) row = index.row ();
 
 	if (sender () == add_button) {
-		if (row < 0) row = tree_view->model ()->rowCount ();
+		if (add_at_bottom || (row < 0)) row = tree_view->model ()->rowCount ();
 		emit (insertNewStrings (row));
+		tree_view->setCurrentIndex (tree_view->model ()->index (row, 0));
 	} else if (row < 0) {	// all actions below need a valid row
 		RK_ASSERT (false);
 	} else if (sender () == remove_button) {
diff --git a/rkward/misc/multistringselector.h b/rkward/misc/multistringselector.h
index e81f55a..31e3d7c 100644
--- a/rkward/misc/multistringselector.h
+++ b/rkward/misc/multistringselector.h
@@ -40,6 +40,7 @@ public:
 	explicit RKMultiStringSelectorV2 (const QString& label, QWidget* parent = 0);
 	virtual ~RKMultiStringSelectorV2 ();
 	void setModel (QAbstractItemModel *model, int main_column=-1);
+	void setAlwaysAddAtBottom (bool always_add_at_bottom) { add_at_bottom = always_add_at_bottom; };
 public slots:
 	void buttonClicked ();
 	void updateButtons ();
@@ -50,6 +51,7 @@ protected:
 	QPushButton* remove_button;
 	QPushButton* up_button;
 	QPushButton* down_button;
+	bool add_at_bottom;
 signals:
 	void insertNewStrings (int above_row);
 	void swapRows (int rowa, int rowb);



More information about the rkward-tracker mailing list