[rkward-cvs] SF.net SVN: rkward: [2192] branches/KDE4_port/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Nov 9 13:54:21 UTC 2007


Revision: 2192
          http://rkward.svn.sourceforge.net/rkward/?rev=2192&view=rev
Author:   tfry
Date:     2007-11-09 05:54:21 -0800 (Fri, 09 Nov 2007)

Log Message:
-----------
Some work on data.frame editor, then got distracted by icons

Modified Paths:
--------------
    branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp
    branches/KDE4_port/rkward/dataeditor/rkvareditmodel.cpp
    branches/KDE4_port/rkward/dataeditor/twintable.cpp
    branches/KDE4_port/rkward/dataeditor/twintable.h
    branches/KDE4_port/rkward/dataeditor/twintablemember.cpp
    branches/KDE4_port/rkward/dataeditor/twintablemember.h
    branches/KDE4_port/rkward/misc/rkstandardicons.cpp
    branches/KDE4_port/rkward/misc/rkstandardicons.h
    branches/KDE4_port/rkward/rkward.cpp
    branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
    branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp
    branches/KDE4_port/rkward/windows/rkmdiwindow.cpp
    branches/KDE4_port/rkward/windows/rktoplevelwindowgui.cpp
    branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp

Modified: branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -30,7 +30,6 @@
 #include "../core/rcontainerobject.h"
 #include "rkeditordataframepart.h"
 #include "../windows/rkworkplace.h"
-#include "../misc/rkstandardicons.h"
 
 #include "../debug.h"
 
@@ -77,8 +76,6 @@
 	setPart (new RKEditorDataFramePart (this));
 	initializeActivationSignals ();
 
-	setWindowIcon (RKStandardIcons::iconForWindow (this));
-
 	open_chain = RKGlobals::rInterface ()->startChain (0);
 }
 

Modified: branches/KDE4_port/rkward/dataeditor/rkvareditmodel.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkvareditmodel.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/dataeditor/rkvareditmodel.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -282,7 +282,7 @@
 		return objects[section]->getShortName ();
 	}
 
-	return QString::number (section);
+	return QString::number (section + 1);
 }
 
 RKTextMatrix RKVarEditModel::getTextMatrix (const QItemSelectionRange& range) const {

Modified: branches/KDE4_port/rkward/dataeditor/twintable.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintable.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/dataeditor/twintable.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -29,6 +29,7 @@
 #include "twintablemember.h"
 #include "rkvareditmodel.h"
 #include "../core/rcontainerobject.h"
+#include "../misc/rkstandardicons.h"
 
 #include "../debug.h"
 
@@ -44,43 +45,38 @@
 	metaview = new TwinTableMember (splitter, this);
 	splitter->setResizeMode (metaview, QSplitter::KeepSize);
 	metaview->verticalHeader ()->setResizeMode (QHeaderView::Fixed);
-
-#warning TODO set item delegates
+	metaview->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
 	
 	dataview = new TwinTableMember (splitter, this);
 	dataview->verticalHeader ()->setResizeMode (QHeaderView::Fixed);
-	
 	dataview->horizontalHeader ()->hide ();
-#warning is this needed?
-//	dataview->setTopMargin (0);
-//	dataview->setLeftMargin (metaview->leftMargin ());
-	metaview->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
+
+#warning TODO set item delegates
 	
 	layout->addWidget (splitter);
-	
+
 	// these are to keep the two tables in sync
 	metaview->setTwin (dataview);
 	dataview->setTwin (metaview);
 	connect (metaview->horizontalHeader (), SIGNAL (sectionClicked(int)), dataview, SLOT (selectColumn(int)));
 	connect (metaview->horizontalHeader (), SIGNAL (sectionPressed(int)), dataview, SLOT (selectColumn(int)));
-	connect (metaview, SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)), this, SLOT (metaSelectionChanged (const QItemSelection&, const QItemSelection&)));
-	connect (dataview, SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)), this, SLOT (dataSelectionChanged (const QItemSelection&, const QItemSelection&)));
-	
+//connect(d->horizontalHeader, SIGNAL(sectionEntered(int)), this, SLOT(_q_selectColumn(int)));
+
 	// catch header context menu requests
-	connect (dataview, SIGNAL (contextMenuRequest(int,int)), this, SLOT (dataHeaderContextMenu(int,int)));
-	connect (metaview, SIGNAL (contextMenuRequest(int,int)), this, SLOT (metaHeaderContextMenu(int,int)));
+	connect (dataview, SIGNAL (contextMenuRequest(int,int,const QPoint&)), this, SLOT (dataHeaderContextMenu(int,int,const QPoint&)));
+	connect (metaview, SIGNAL (contextMenuRequest(int,int,const QPoint&)), this, SLOT (metaHeaderContextMenu(int,int,const QPoint&)));
 	
-	// which will be reacted upon by the following popup-menu:
+	// which will be reacted upon by the following popup-menus:
 	top_header_menu = new QMenu (this);
-	action_insert_col_left = top_header_menu->addAction (QString (), this, SLOT (insertColumn()));
-	action_insert_col_right = top_header_menu->addAction (QString (), this, SLOT (insertColumn()));
-	action_delete_col = top_header_menu->addAction (QString (), this, SLOT (deleteColumn()));
+	action_insert_col_left = top_header_menu->addAction (RKStandardIcons::getIcon (RKStandardIcons::ActionInsertVar), QString (), this, SLOT (insertColumn()));
+	action_insert_col_right = top_header_menu->addAction (RKStandardIcons::getIcon (RKStandardIcons::ActionInsertVar), QString (), this, SLOT (insertColumn()));
+	action_delete_col = top_header_menu->addAction (RKStandardIcons::getIcon (RKStandardIcons::ActionDeleteVar), QString (), this, SLOT (deleteColumn()));
 	
 	left_header_menu = new QMenu (this);
-	action_insert_row_above = left_header_menu->addAction (QString (), this, SLOT (insertRow()));
-	action_insert_row_below = left_header_menu->addAction (QString (), this, SLOT (insertRow()));
-	action_delete_row = left_header_menu->addAction (QString (), this, SLOT (deleteRow()));
-	action_delete_rows = left_header_menu->addAction (QString (), this, SLOT (deleteSelectedRows()));
+	action_insert_row_above = left_header_menu->addAction (RKStandardIcons::getIcon (RKStandardIcons::ActionInsertRow), QString (), this, SLOT (insertRow()));
+	action_insert_row_below = left_header_menu->addAction (RKStandardIcons::getIcon (RKStandardIcons::ActionInsertRow), QString (), this, SLOT (insertRow()));
+	action_delete_row = left_header_menu->addAction (RKStandardIcons::getIcon (RKStandardIcons::ActionDeleteRow), QString (), this, SLOT (deleteRow()));
+	action_delete_rows = left_header_menu->addAction (RKStandardIcons::getIcon (RKStandardIcons::ActionDeleteRow), QString (), this, SLOT (deleteSelectedRows()));
 
 	setFocusPolicy (Qt::StrongFocus);
 }
@@ -106,7 +102,7 @@
 }
 
 // TODO: handle situation when several entire cols are selected!
-void TwinTable::metaHeaderContextMenu (int row, int col) {
+void TwinTable::metaHeaderContextMenu (int row, int col, const QPoint& pos) {
 	RK_TRACE (EDITOR);
 
 	if (col >= 0) {
@@ -123,12 +119,11 @@
 		action_delete_col->setText (i18n ("Delete this variable"));	// TODO: show name
 		action_delete_col->setData (col);
 
-		// TODO: should be passed as a parameter, instead
-		top_header_menu->popup (metaview->mouse_at);
+		top_header_menu->popup (pos);
 	}
 }
 
-void TwinTable::dataHeaderContextMenu (int row, int col) {
+void TwinTable::dataHeaderContextMenu (int row, int col, const QPoint& pos) {
 	RK_TRACE (EDITOR);
 
 	RK_ASSERT (col < 0);
@@ -136,11 +131,11 @@
 		RK_ASSERT (row <= datamodel->trueRows ());
 
 		action_insert_row_above->setVisible (true);
-		action_insert_row_above->setText (i18n ("Insert new case above (at %1)", col + 1));
-		action_insert_row_above->setData (col);
+		action_insert_row_above->setText (i18n ("Insert new case above (at %1)", row + 1));
+		action_insert_row_above->setData (row);
 		action_insert_row_below->setVisible (row < datamodel->trueRows ());
-		action_insert_row_above->setText (i18n ("Insert new case below (at %1)", col + 2));
-		action_insert_row_below->setData (col + 1);
+		action_insert_row_below->setText (i18n ("Insert new case below (at %1)", row + 2));
+		action_insert_row_below->setData (row + 1);
 
 		QItemSelectionRange sel = dataview->getSelectionBoundaries ();
 		if (sel.isValid ()) {
@@ -159,7 +154,7 @@
 		action_delete_row->setText (i18n ("Delete this row (%1)", (row+1)));
 		action_delete_row->setData (row);
 
-		left_header_menu->popup (dataview->mouse_at);
+		left_header_menu->popup (pos);
 	}
 }
 
@@ -245,18 +240,6 @@
 	datamodel->insertRows (where, 1);
 }
 
-void TwinTable::metaSelectionChanged (const QItemSelection& selected, const QItemSelection&) {
-	RK_TRACE (EDITOR);
-
-	if (!selected.isEmpty ()) dataview->clearSelection ();
-}
-
-void TwinTable::dataSelectionChanged (const QItemSelection& selected, const QItemSelection&) {
-	RK_TRACE (EDITOR);
-
-	if (!selected.isEmpty ()) metaview->clearSelection ();
-}
-
 void TwinTable::copy () {
 	RK_TRACE (EDITOR);
 

Modified: branches/KDE4_port/rkward/dataeditor/twintable.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintable.h	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/dataeditor/twintable.h	2007-11-09 13:54:21 UTC (rev 2192)
@@ -53,13 +53,11 @@
 	
 	RKVarEditDataFrameModel* datamodel;
 public slots:
-	void dataHeaderContextMenu (int row, int col);
-	void metaHeaderContextMenu (int row, int col);
+	void dataHeaderContextMenu (int row, int col, const QPoint& pos);
+	void metaHeaderContextMenu (int row, int col, const QPoint& pos);
 /*
 	void headerClicked (int col);
 	void headerPressed (int col); */
-	void metaSelectionChanged (const QItemSelection& selected, const QItemSelection& deselected);
-	void dataSelectionChanged (const QItemSelection& selected, const QItemSelection& deselected);
 private:
 /** PopupMenu shown when top header is right-clicked */
 	QMenu *top_header_menu;

Modified: branches/KDE4_port/rkward/dataeditor/twintablemember.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintablemember.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/dataeditor/twintablemember.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -19,6 +19,7 @@
 
 #include <QKeyEvent>
 #include <QScrollBar>
+#include <QHeaderView>
 
 #include "celleditor.h"
 #include "twintable.h"
@@ -31,16 +32,21 @@
 	RK_TRACE (EDITOR);
 
 	twin = 0;
-	TwinTableMember::table = table;
+	TwinTableMember::table = table;		// TODO: seems unused
 	setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOn);
 	setSelectionMode (QAbstractItemView::ContiguousSelection);
-	setContextMenuPolicy (Qt::CustomContextMenu);
-	connect (this, SIGNAL (customContextMenuRequested (const QPoint&)), this, SLOT (headerContextMenuRequested (const QPoint&)));
-	
+
+	verticalHeader ()->setContextMenuPolicy (Qt::CustomContextMenu);
+	connect (verticalHeader (), SIGNAL (customContextMenuRequested(const QPoint&)), this, SLOT (headerContextMenuRequested(const QPoint&)));
+	horizontalHeader ()->setContextMenuPolicy (Qt::CustomContextMenu);
+	connect (horizontalHeader (), SIGNAL (customContextMenuRequested(const QPoint&)), this, SLOT (headerContextMenuRequested(const QPoint&)));
+
+	connect (this, SIGNAL (selectionChanged(const QItemSelection&,const QItemSelection&)), this, SLOT (tableSelectionChanged(const QItemSelection&,const QItemSelection&)));
+
+	updating_twin = false;
+
+#warning currently unused, but likey will be used.
 	tted = 0;
-#warning tted and changing width currently unused, but likey will be used.
-	changing_width = false;
-	changing_scroll = false;
 
 	connect (this, SIGNAL (currentChanged (int, int)), this, SLOT (currentCellChanged (int, int)));
 }
@@ -51,14 +57,25 @@
 
 void TwinTableMember::setRKModel (RKVarEditModelBase* model) {
 	RK_TRACE (EDITOR);
-	mymodel = model; setModel (model);
+	mymodel = model;
+	setModel (model);
 };
 
 void TwinTableMember::setTwin (TwinTableMember * new_twin) {
 	RK_TRACE (EDITOR);
 	twin = new_twin;
+
+	// probably we only need this one way (metaview->dataview), but why not be safe, when it's so easy
+	connect (twin->horizontalHeader (), SIGNAL (sectionResized(int,int,int)), this, SLOT (updateColWidth(int,int,int)));
 }
 
+void TwinTableMember::tableSelectionChanged (const QItemSelection& selected, const QItemSelection&) {
+	RK_TRACE (EDITOR);
+	RK_ASSERT (twin);
+
+	if (!selected.isEmpty ()) twin->clearSelection ();
+}
+
 void TwinTableMember::editorLostFocus () {
 	RK_TRACE (EDITOR);
 	stopEditing ();
@@ -160,19 +177,36 @@
 void TwinTableMember::scrollContentsBy (int dx, int dy) {
 	RK_TRACE (EDITOR);
 
-	if (changing_scroll) return;
-	changing_scroll = true;
+	if (updating_twin) return;
+	updating_twin = true;
 	RK_ASSERT (twin);
 	QTableView::scrollContentsBy (dx, dy);
 	twin->horizontalScrollBar ()->setValue (horizontalScrollBar ()->value ());
-	changing_scroll = false;
+	updating_twin = false;
 }
 
+void TwinTableMember::updateColWidth (int section, int old_w, int new_w) {
+	RK_TRACE (EDITOR);
+
+	if (updating_twin) return;
+	updating_twin = true;
+	RK_ASSERT (columnWidth (section) == old_w);
+	setColumnWidth (section, new_w);
+	updating_twin = false;
+}
+
 void TwinTableMember::headerContextMenuRequested (const QPoint& pos) {
 	RK_TRACE (EDITOR);
 
-	mouse_at = pos;
-#warning TODO
+	if (sender () == horizontalHeader ()) {
+		int col = horizontalHeader ()->logicalIndexAt (pos);
+		if (col >= 0) emit (contextMenuRequest (-1, col, horizontalHeader ()->mapToGlobal (pos)));
+	} else if (sender () == verticalHeader ()) {
+		int row = verticalHeader ()->logicalIndexAt (pos);
+		if (row >= 0) emit (contextMenuRequest (row, -1, verticalHeader ()->mapToGlobal (pos)));
+	} else {
+		RK_ASSERT (false);
+	}
 }
 
 #include "twintablemember.moc"

Modified: branches/KDE4_port/rkward/dataeditor/twintablemember.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintablemember.h	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/dataeditor/twintablemember.h	2007-11-09 13:54:21 UTC (rev 2192)
@@ -64,15 +64,13 @@
 
 	void setRKModel (RKVarEditModelBase* model);
 signals:
-	void contextMenuRequest (int row, int col);
+	void contextMenuRequest (int row, int col, const QPoint& pos);
 protected:
 	TwinTableMember *twin;
 	TwinTable *table;
-	bool changing_width;
-	bool changing_scroll;
+	bool updating_twin;
+
 	CellEditor *tted;
-/** stores the position of the mouse, when headerRightClick gets emitted */
-	QPoint mouse_at;
 /** reimplemented from QTableView to also adjust the twin */
 	void scrollContentsBy (int dx, int dy);
 
@@ -85,6 +83,8 @@
 //	void currentCellChanged (int row, int col);
 protected slots:
 	void headerContextMenuRequested (const QPoint& pos);
+	void updateColWidth (int section, int old_w, int new_w);
+	void tableSelectionChanged (const QItemSelection& selected, const QItemSelection& deselected);
 };
 
 #endif

Modified: branches/KDE4_port/rkward/misc/rkstandardicons.cpp
===================================================================
--- branches/KDE4_port/rkward/misc/rkstandardicons.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/misc/rkstandardicons.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -42,25 +42,44 @@
 	icons[ActionRunLine] = QIcon (rkward_icon_base + "run_line.png");
 	icons[ActionRunSelection] = QIcon (rkward_icon_base + "run_selection.png");
 
+	icons[ActionDeleteRow] = KIcon ("no");
+	icons[ActionInsertRow] = KIcon ("edit_add");
+	icons[ActionDeleteVar] = icons[ActionDeleteRow];
+	icons[ActionInsertVar] = icons[ActionInsertRow];
+
+#warning TODO add further action icons here
+
 	// objects
 	icons[ObjectList] = QIcon (rkward_icon_base + "list.png");
 	icons[ObjectFunction] = QIcon (rkward_icon_base + "function.png");
 #warning KDE 4: some of these icons have been renamed
 	icons[ObjectEnvironment] = KIcon ("konqueror");
 	icons[ObjectPackageEnvironment] = KIcon ("ark");
-	icons[ObjectDataFrame] = KIcon ("spreadsheet");
+	icons[ObjectDataFrame] = KIcon ("table");
 	icons[ObjectDataNumeric] = KIcon ("math_paren");
 	icons[ObjectDataFactor] = KIcon ("math_onetwomatrix");
 	icons[ObjectDataCharacter] = KIcon ("text");
 #warning TODO icon for logical
 	icons[ObjectDataLogical] = QIcon ();
 	icons[ObjectDataUnknown] = KIcon ("help");
-	icons[ObjectDataOther] = KIcon ("no");
-	icons[ObjectObjectList] = KIcon ("view_tree");
+	icons[ObjectDataOther] = icons[ActionDeleteRow];
+	icons[ObjectObjectList] = KIcon ("view-tree");
 
 	// windows
-#warning TODO icons for windows
 	icons[WindowDataFrameEditor] = icons[ObjectDataFrame];
+	icons[WindowCommandEditor] = KIcon ("make");	// 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 ("xclipboard");
+	icons[WindowHelp] = KIcon ("help");
+	icons[WindowX11] = KIcon ("x");
+	icons[WindowObject] = KIcon ("zoom-best-fit");
+	icons[WindowConsole] = KIcon ("konsole");
+	icons[WindowCommandLog] = KIcon ("format-justify-left");
+	icons[WindowWorkspaceBrowser] = KIcon("fileview-detailed");
+	icons[WindowSearchHelp] = KIcon ("help-contents");
+	icons[WindowPendingJobs] = KIcon ("system-run");
+	icons[WindowFileBrowser] = KIcon ("document-open");
+
+
 }
 
 QIcon RKStandardIcons::iconForObject (const RObject* object) {
@@ -98,8 +117,18 @@
 	if (!window) return QIcon ();
 
 	if (window->isType (RKMDIWindow::DataEditorWindow)) return icons[WindowDataFrameEditor];
+	if (window->isType (RKMDIWindow::CommandEditorWindow)) return icons[WindowCommandEditor];
+	if (window->isType (RKMDIWindow::OutputWindow)) return icons[WindowOutput];
+	if (window->isType (RKMDIWindow::HelpWindow)) return icons[WindowHelp];
+	if (window->isType (RKMDIWindow::X11Window)) return icons[WindowX11];
+	if (window->isType (RKMDIWindow::ObjectWindow)) return icons[WindowObject];
+	if (window->isType (RKMDIWindow::ConsoleWindow)) return icons[WindowConsole];
+	if (window->isType (RKMDIWindow::CommandLogWindow)) return icons[WindowCommandLog];
+	if (window->isType (RKMDIWindow::WorkspaceBrowserWindow)) return icons[WindowWorkspaceBrowser];
+	if (window->isType (RKMDIWindow::SearchHelpWindow)) return icons[WindowSearchHelp];
+	if (window->isType (RKMDIWindow::PendingJobsWindow)) return icons[WindowPendingJobs];
+	if (window->isType (RKMDIWindow::FileBrowserWindow)) return icons[WindowFileBrowser];
 
-#warning TODO
 	RK_ASSERT (false);
 	return QIcon ();
 }

Modified: branches/KDE4_port/rkward/misc/rkstandardicons.h
===================================================================
--- branches/KDE4_port/rkward/misc/rkstandardicons.h	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/misc/rkstandardicons.h	2007-11-09 13:54:21 UTC (rev 2192)
@@ -42,6 +42,11 @@
 		ActionRunLine,
 		ActionRunSelection,
 
+		ActionDeleteRow,
+		ActionInsertRow,
+		ActionDeleteVar,
+		ActionInsertVar,
+
 		ObjectList,
 		ObjectFunction,
 		ObjectEnvironment,
@@ -56,6 +61,17 @@
 		ObjectObjectList,
 
 		WindowDataFrameEditor,
+		WindowCommandEditor,
+		WindowOutput,
+		WindowHelp,
+		WindowX11,
+		WindowObject,
+		WindowConsole,
+		WindowCommandLog,
+		WindowWorkspaceBrowser,
+		WindowSearchHelp,
+		WindowPendingJobs,
+		WindowFileBrowser,
 
 		Last	/**< not really an item, only the count of items available. Do not use. */
 	};

Modified: branches/KDE4_port/rkward/rkward.cpp
===================================================================
--- branches/KDE4_port/rkward/rkward.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/rkward.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -205,7 +205,6 @@
 	RObjectBrowser::object_browser = new RObjectBrowser (0, true, "workspace");
 
 	RKCommandLog *log = new RKCommandLog (0, true, "Command log");
-	log->setWindowIcon (SmallIcon ("format-justify-left"));
 	RKWorkplace::mainWorkplace ()->placeInToolWindowBar (log, KMultiTabBar::Bottom);
 	RKCommandLog::rkcommand_log = log;
 
@@ -216,27 +215,22 @@
 	
 	initPlugins ();
 
-	RObjectBrowser::mainBrowser ()->setWindowIcon(SmallIcon("fileview-detailed"));
 	RObjectBrowser::mainBrowser ()->setCaption (i18n ("Workspace"));
 	RKWorkplace::mainWorkplace ()->placeInToolWindowBar (RObjectBrowser::mainBrowser (), KMultiTabBar::Left);
 
 	RKFileBrowser::main_browser = new RKFileBrowser (0, true, "file_browser");
-	RKFileBrowser::main_browser->setWindowIcon (SmallIcon ("document-open"));
 	RKFileBrowser::main_browser->setCaption (i18n ("Files"));
 	RKWorkplace::mainWorkplace ()->placeInToolWindowBar (RKFileBrowser::main_browser, KMultiTabBar::Left);
 
 	RControlWindow::control_window = new RControlWindow (0, true, "rcontrol");
 	RControlWindow::getControl ()->setCaption (i18n ("Pending Jobs"));
-	RControlWindow::getControl ()->setWindowIcon (SmallIcon ("system-run"));
 	RKWorkplace::mainWorkplace ()->placeInToolWindowBar (RControlWindow::getControl (), KMultiTabBar::Bottom);
 
 	RKConsole *console = new RKConsole (0, true, "r_console");
-	console->setWindowIcon (SmallIcon ("konsole"));
 	RKConsole::setMainConsole (console);
 	RKWorkplace::mainWorkplace ()->placeInToolWindowBar (console, KMultiTabBar::Bottom);
 
 	RKHelpSearchWindow *help_search = new RKHelpSearchWindow (0, true, "r_help");
-	help_search->setWindowIcon (SmallIcon ("help-contents"));
 	RKHelpSearchWindow::main_help_search = help_search;
 	RKWorkplace::mainWorkplace ()->placeInToolWindowBar (help_search, KMultiTabBar::Bottom);
 
@@ -330,12 +324,12 @@
 	// TODO: is there a way to insert actions between standard actions without having to give all standard actions custom ids?
 	new_data_frame = actionCollection ()->addAction ("new_data_frame", this, SLOT (slotNewDataFrame ()));
 	new_data_frame->setText (i18n ("Dataset"));
-	new_data_frame->setIcon (KIcon ("spreadsheet"));
+	new_data_frame->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowDataFrameEditor));
 	new_data_frame->setStatusTip (i18n ("Creates new empty dataset and opens it for editing"));
 
 	new_command_editor = actionCollection ()->addAction (KStandardAction::New, "new_command_editor", this, SLOT(slotNewCommandEditor()));
 	new_command_editor->setText (i18n ("Script File"));
-	new_command_editor->setIcon (KIcon ("source"));
+	new_command_editor->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowCommandEditor));
 
 	fileOpen = actionCollection ()->addAction (KStandardAction::Open, "file_openy", this, SLOT(slotOpenCommandEditor()));
 	fileOpen->setText (i18n ("Open R Script File"));

Modified: branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/windows/rkcommandeditorwindow.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -86,8 +86,6 @@
 	layout->setContentsMargins (0, 0, 0, 0);
 	layout->addWidget(m_view);
 
-	setIcon (SmallIcon ("source"));
-
 	connect (m_doc, SIGNAL (documentUrlChanged (KTextEditor::Document*)), this, SLOT (updateCaption (KTextEditor::Document*)));
 	connect (m_doc, SIGNAL (modifiedChanged (KTextEditor::Document*)), this, SLOT (updateCaption (KTextEditor::Document*)));		// of course most of the time this causes a redundant call to updateCaption. Not if a modification is undone, however.
 	connect (m_doc, SIGNAL (textChanged (KTextEditor::Document*)), this, SLOT (tryCompletionProxy (KTextEditor::Document*)));

Modified: branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/windows/rkhtmlwindow.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -254,7 +254,6 @@
 
 	khtmlpart->insertChildClient (this);
 
-	setIcon (SmallIcon ("text_block"));
 	setCaption (i18n ("Output"));
 
 	outputFlush = actionCollection ()->addAction ("output_flush", this, SLOT (flushOutput()));
@@ -420,7 +419,6 @@
 
 	khtmlpart->insertChildClient (this);
 
-	setIcon (SmallIcon ("help"));
 	setCaption (i18n ("R Help"));
 }
 

Modified: branches/KDE4_port/rkward/windows/rkmdiwindow.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkmdiwindow.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/windows/rkmdiwindow.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -29,6 +29,7 @@
 #include "rkworkplace.h"
 #include "rkworkplaceview.h"
 #include "rktoolwindowbar.h"
+#include "../misc/rkstandardicons.h"
 
 #include "../debug.h"
 
@@ -45,6 +46,8 @@
 	tool_window_bar = 0;
 	part = 0;
 	active = false;
+
+	setWindowIcon (RKStandardIcons::iconForWindow (this));
 }
 
 RKMDIWindow::~RKMDIWindow () {

Modified: branches/KDE4_port/rkward/windows/rktoplevelwindowgui.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rktoplevelwindowgui.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/windows/rktoplevelwindowgui.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -35,6 +35,7 @@
 #include "../windows/rkcommandlog.h"
 #include "../windows/rkhelpsearchwindow.h"
 #include "../windows/rkmdiwindow.h"
+#include "../misc/rkstandardicons.h"
 #include "../rbackend/rinterface.h"
 #include "../rkglobals.h"
 #include "../rkward.h"
@@ -68,21 +69,27 @@
 	QAction *action;
 	action = actionCollection ()->addAction ("window_show_workspace", this, SLOT(toggleWorkspace()));
 	action->setText (i18n ("Show/Hide Workspace Browser"));
+	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowWorkspaceBrowser));
 	action->setShortcut (Qt::AltModifier + Qt::Key_1);
 	action = actionCollection ()->addAction ("window_show_filebrowser", this, SLOT(toggleFilebrowser()));
 	action->setText (i18n ("Show/Hide Filesystem Browser"));
+	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowFileBrowser));
 	action->setShortcut (Qt::AltModifier + Qt::Key_2);
 	action = actionCollection ()->addAction ("window_show_commandlog", this, SLOT(toggleCommandLog()));
 	action->setText (i18n ("Show/Hide Command Log"));
+	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowCommandLog));
 	action->setShortcut (Qt::AltModifier + Qt::Key_3);
 	action = actionCollection ()->addAction ("window_show_pendingjobs", this, SLOT(togglePendingJobs()));
 	action->setText (i18n ("Show/Hide Pending Jobs"));
+	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowPendingJobs));
 	action->setShortcut (Qt::AltModifier + Qt::Key_4);
 	action = actionCollection ()->addAction ("window_show_console", this, SLOT(toggleConsole()));
 	action->setText (i18n ("Show/Hide Console"));
+	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowConsole));
 	action->setShortcut (Qt::AltModifier + Qt::Key_5);
 	action = actionCollection ()->addAction ("window_show_helpsearch", this, SLOT(toggleHelpSearch()));
 	action->setText (i18n ("Show/Hide R Help Search"));
+	action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::WindowSearchHelp));
 	action->setShortcut (Qt::AltModifier + Qt::Key_6);
 	action = actionCollection ()->addAction ("window_activate_docview", this, SLOT(activateDocumentView()));
 	action->setText (i18n ("Activate Document view"));

Modified: branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp	2007-11-09 00:29:46 UTC (rev 2191)
+++ branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp	2007-11-09 13:54:21 UTC (rev 2192)
@@ -120,7 +120,6 @@
 	RK_ASSERT (wininfo.valid ());
 	setGeometry (wininfo.frameGeometry ());
 	setCaption (wininfo.name ());
-	setIcon (SmallIcon ("kcmx"));			// looks like an X, here
 	capture->embedClient (window_to_embed);
 
 	RKWardApplication::getApp ()->registerNameWatcher (window_to_embed, this);


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