[rkward-cvs] SF.net SVN: rkward: [899] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Oct 22 18:52:16 UTC 2006


Revision: 899
          http://svn.sourceforge.net/rkward/?rev=899&view=rev
Author:   tfry
Date:     2006-10-22 11:52:08 -0700 (Sun, 22 Oct 2006)

Log Message:
-----------
Show newly installed packages in the load/unload widget immediately

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp
    trunk/rkward/rkward/dialogs/rkloadlibsdialog.h

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2006-10-22 17:38:28 UTC (rev 898)
+++ trunk/rkward/ChangeLog	2006-10-22 18:52:08 UTC (rev 899)
@@ -1,3 +1,4 @@
+- when packages have been newly installed, show them in the load / unload packages tab immediately
 - fix to plugin input lines sizing, and visibility of scrollbars
 - on startup, show window maximized if not size stored (i.e. very first startup)
 - prevent infinite recursion when parsing structure of environments

Modified: trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp
===================================================================
--- trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2006-10-22 17:38:28 UTC (rev 898)
+++ trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2006-10-22 18:52:08 UTC (rev 899)
@@ -53,7 +53,9 @@
 	
 	QFrame *page = addPage (i18n ("Local packages"));
 	QVBoxLayout *layout = new QVBoxLayout (page, 0, KDialog::spacingHint ());
-	layout->addWidget (new LoadUnloadWidget (this, page));
+	LoadUnloadWidget *luwidget = new LoadUnloadWidget (this, page);
+	connect (this, SIGNAL (installedPackagesChanged ()), luwidget, SLOT (updateInstalledPackages ()));
+	layout->addWidget (luwidget);
 	
 	page = addPage (i18n ("Update"));
 	layout = new QVBoxLayout (page, 0, KDialog::spacingHint ());
@@ -210,6 +212,7 @@
 	file.remove ();
 	delete proc;
 
+	emit (installedPackagesChanged ());
 	return true;
 }
 
@@ -273,16 +276,13 @@
 	loaded_view->setSelectionMode (QListView::Extended);
 	loadedvbox->addWidget (label);
 	loadedvbox->addWidget (loaded_view);
-	
-	setEnabled (false);
-	
-	RKGlobals::rInterface ()->issueCommand (".rk.get.installed.packages ()", RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, GET_INSTALLED_PACKAGES, dialog->chain);
-	RKGlobals::rInterface ()->issueCommand (".packages ()", RCommand::App | RCommand::Sync | RCommand::GetStringVector, QString::null, this, GET_LOADED_PACKAGES, dialog->chain);
-	
+
 	connect (dialog, SIGNAL (okClicked ()), this, SLOT (ok ()));
 	connect (dialog, SIGNAL (apply ()), this, SLOT (apply ()));
 	connect (dialog, SIGNAL (cancelClicked ()), this, SLOT (cancel ()));
 	connect (this, SIGNAL (destroyed ()), dialog, SLOT (childDeleted ()));
+
+	updateInstalledPackages ();
 }
 
 LoadUnloadWidget::~LoadUnloadWidget () {
@@ -294,6 +294,8 @@
 	if (command->getFlags () == GET_INSTALLED_PACKAGES) {
 		RK_ASSERT (command->getDataLength () == 4);
 
+		installed_view->clear ();
+
 		RData *package = command->getStructureVector ()[0];
 		RData *title = command->getStructureVector ()[1];
 		RData *version = command->getStructureVector ()[2];
@@ -308,6 +310,9 @@
 		}
 	} else if (command->getFlags () == GET_LOADED_PACKAGES) {
 		RK_ASSERT (command->getDataType () == RData::StringVector);
+
+		loaded_view->clear ();
+
 		for (unsigned int i=0; i < command->getDataLength (); ++i) {
 			new QListViewItem (loaded_view, command->getStringVector ()[i]);
 		}
@@ -320,6 +325,15 @@
 	}
 }
 
+void LoadUnloadWidget::updateInstalledPackages () {
+	RK_TRACE (DIALOGS);
+
+	setEnabled (false);
+	
+	RKGlobals::rInterface ()->issueCommand (".rk.get.installed.packages ()", RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, GET_INSTALLED_PACKAGES, parent->chain);
+	RKGlobals::rInterface ()->issueCommand (".packages ()", RCommand::App | RCommand::Sync | RCommand::GetStringVector, QString::null, this, GET_LOADED_PACKAGES, parent->chain);
+}
+
 void LoadUnloadWidget::loadButtonClicked () {
 	RK_TRACE (DIALOGS);
 	

Modified: trunk/rkward/rkward/dialogs/rkloadlibsdialog.h
===================================================================
--- trunk/rkward/rkward/dialogs/rkloadlibsdialog.h	2006-10-22 17:38:28 UTC (rev 898)
+++ trunk/rkward/rkward/dialogs/rkloadlibsdialog.h	2006-10-22 18:52:08 UTC (rev 899)
@@ -64,6 +64,7 @@
 	void libraryLocationsChanged (const QStringList &);
 	void installationOutput (const QString &output);
 	void installationError (const QString &error);
+	void installedPackagesChanged ();
 protected:
 	void rCommandDone (RCommand *command);
 	void closeEvent (QCloseEvent *e);
@@ -113,6 +114,7 @@
 	void ok ();
 	void apply ();
 	void cancel ();
+	void updateInstalledPackages ();
 protected:
 	void rCommandDone (RCommand *command);
 private:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list