[rkward-cvs] rkward/rkward rkward.cpp,1.67,1.68 rkward.h,1.28,1.29 rkwardui.rc,1.18,1.19

Pierre ecoch at users.sourceforge.net
Sun Apr 3 16:23:41 UTC 2005


Update of /cvsroot/rkward/rkward/rkward
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5482/rkward

Modified Files:
	rkward.cpp rkward.h rkwardui.rc 
Log Message:
Now we use KParts properly. Some parts of the interface still need to be adaped.

Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** rkward.cpp	3 Apr 2005 13:26:19 -0000	1.67
--- rkward.cpp	3 Apr 2005 16:23:39 -0000	1.68
***************
*** 91,119 ****
  	RKGlobals::list = 0;
  	
!   config=kapp->config();
! 
  	KGlobal::dirs()->addResourceType("plugins", KStandardDirs::kde_default("data") + "rkward/plugins/");
! 
  	// Nice docks a la Kdevelop.
  	setToolviewStyle(KMultiTabBar::KDEV3ICON);
  
  
  
!   ///////////////////////////////////////////////////////////////////
!   // call inits to invoke all other construction parts
!   initStatusBar();
!   initActions();
! 
!   ///////////////////////////////////////////////////////////////////
!   // disable actions at startup   // why?
! /*  fileSave->setEnabled(false);
!   fileSaveAs->setEnabled(false);
!   filePrint->setEnabled(false);
!   editCut->setEnabled(false);
!   editCopy->setEnabled(false);
!   editPaste->setEnabled(false); */
! 	setEnabledActions(false);
! 
! 
  
  	
--- 91,116 ----
  	RKGlobals::list = 0;
  	
! 	config=kapp->config();
! 	
  	KGlobal::dirs()->addResourceType("plugins", KStandardDirs::kde_default("data") + "rkward/plugins/");
! 	
  	// Nice docks a la Kdevelop.
  	setToolviewStyle(KMultiTabBar::KDEV3ICON);
+ 	
+ 	
+ 	
+ 	///////////////////////////////////////////////////////////////////
+ 	// call inits to invoke all other construction parts
+ 	initStatusBar();
+ 	initActions();
  
+ 	///////////////////////////////////////////////////////////////////
+ 	// build the interface
  
+ 	// use the absolute path to your rkwardui.rc file for testing purpose in createGUI();
+ 	setXMLFile( "rkwardui.rc" );
+ 	createShellGUI ( true );
  
! 	setEnabledActions(true);
  
  	
***************
*** 141,249 ****
  	connect (startup_timer, SIGNAL (timeout ()), this, SLOT (doPostInit ()));
  	
- 	
- 	
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- //   m_manager = new KParts::PartManager( this );
- //   // When the manager says the active part changes,
- //   // the builder updates (recreates) the GUI
- //   connect( m_manager, SIGNAL( activePartChanged( KParts::Part * ) ),
- //            this, SLOT( createGUI( KParts::Part * ) ) );
- //   m_splitter = new QSplitter( this );
- // 
- //   // Try to find libkghostview
- //   KLibFactory *factory = KLibLoader::self()->factory( "libkatepart" );
- //   if (factory)
- //   {
- //     // Create the part
- //     m_gvpart = (KParts::ReadOnlyPart *)factory->create( m_splitter,
- //                 "kgvpart", "KParts::ReadOnlyPart" );
- //   }
- // 
- // 
- //   factory = KLibLoader::self()->factory( "libkpdfpart" );
- //   if (factory)
- //     m_notepadpart = (KParts::ReadOnlyPart *)factory->create( m_splitter,
- //                      "knotepadpart", "KParts::ReadOnlyPart" );
- // 
- // 
- //   // CHANGE: No longer necessary.
- //   //setView( m_splitter );
- //   // Set a reasonable size
- //   /*m_splitter->setMinimumSize( 500, 400 );
- //   m_splitter->show();
- //   setCentralWidget(m_splitter);*/
- // 
- //   m_manager->addPart( m_gvpart, true ); // sets as the active part
- //   m_manager->addPart( m_notepadpart, false );
- // 
- // 
- // addWindow(createWrapper(m_splitter,"bla","bla"));
- 
- 
- 
- 
- 
- 
- 
- KMdiChildView *view1 = new KMdiChildView( i18n( "View 1" ), this );
- KMdiChildView *view2 = new KMdiChildView( i18n( "View 1" ), this );
- 
-   m_manager = new KParts::PartManager( this );
-   // When the manager says the active part changes,
-   // the builder updates (recreates) the GUI
-   connect( m_manager, SIGNAL( activePartChanged( KParts::Part * ) ),
-            this, SLOT( createGUI( KParts::Part * ) ) );
-   m_splitter = new QSplitter( this );
- 
-   // Try to find libkghostview
-   KLibFactory *factory = KLibLoader::self()->factory( "libkatepart" );
-   if (factory)
-   {
-     // Create the part
-     m_gvpart = (KParts::ReadOnlyPart *)factory->create( view1,
-                 "kgvpart", "KParts::ReadOnlyPart" );
-     //((QWidget *)m_gvpart)->setFocusPolicy(QWidget::ClickFocus);
-   }
- 
  
!   factory = KLibLoader::self()->factory( "libkpdfpart" );
!   if (factory){
!     m_notepadpart = (KParts::ReadOnlyPart *)factory->create( view2,
!                      "knotepadpart", "KParts::ReadOnlyPart" );
!     //((QWidget *)m_notepadpart)->setFocusPolicy(QWidget::ClickFocus);
!   }
! 
!   // CHANGE: No longer necessary.
!   //setView( m_splitter );
!   // Set a reasonable size
!   /*m_splitter->setMinimumSize( 500, 400 );
!   m_splitter->show();
!   setCentralWidget(m_splitter);*/
! addWindow(view1);
! addWindow(view2);
! 
!   m_manager->addPart( m_gvpart, true ); // sets as the active part
!   m_manager->addPart( m_notepadpart, false );
! 
! 
! 
! 
! 
! 	
  }
  
--- 138,146 ----
  	connect (startup_timer, SIGNAL (timeout ()), this, SLOT (doPostInit ()));
  	
  
! 	m_manager = new KParts::PartManager( this );
! 	// When the manager says the active part changes,
! 	// the builder updates (recreates) the GUI
! 	connect( m_manager, SIGNAL( activePartChanged( KParts::Part * ) ), this, SLOT( createGUI( KParts::Part * ) ) );
  }
  
***************
*** 268,272 ****
  	output->hide ();*/
  
!     QString dummy = i18n("Before you start bashing at it: please note that this is merely a technology preview release. You might acutally be able to use it for some very simple tasks, but chances are it's of hardly any practical value so far. It does not do much good. It might do some very bad things (don't let it touch valuable data!). It's lacking in many respects. If you would like to help improve it, or simply get in contact, visit:\nhttp://rkward.sourceforge.net\nAll comments are welcome.");
  	KMessageBox::information (this, dummy, i18n("Before you complain..."), "state_of_rkward");
  	
--- 165,169 ----
  	output->hide ();*/
  
! 	QString dummy = i18n("Before you start bashing at it: please note that this is merely a technology preview release. You might acutally be able to use it for some very simple tasks, but chances are it's of hardly any practical value so far. It does not do much good. It might do some very bad things (don't let it touch valuable data!). It's lacking in many respects. If you would like to help improve it, or simply get in contact, visit:\nhttp://rkward.sourceforge.net\nAll comments are welcome.");
  	KMessageBox::information (this, dummy, i18n("Before you complain..."), "state_of_rkward");
  	
***************
*** 448,460 ****
  	fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "file_quitx");
  	
!   editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection(), "cut");
!   editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection(), "copy");
!   editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection(), "paste");
!   editPasteToTable = new KAction(i18n("Paste inside Table"), 0, 0, this, SLOT(slotEditPasteToTable()), actionCollection(), "paste_to_table");
!   editPasteToTable->setIcon("frame_spreadsheet");
!   editPasteToSelection = new KAction(i18n("Paste inside Selection"), 0, 0, this, SLOT(slotEditPasteToSelection()), actionCollection(), "paste_to_selection");
!   editPasteToSelection->setIcon("frame_edit");
!   viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
!   viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
  	showRKWatch = new KToggleAction (i18n ("Console"), 0, 0, this, SLOT(slotShowRKWatch ()), actionCollection(), "windows_rkwatch");
  	showRKOutput = new KToggleAction (i18n ("Output"), 0, 0, this, SLOT(slotShowRKOutput ()), actionCollection(), "windows_rkoutput");
--- 345,364 ----
  	fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "file_quitx");
  	
! 	editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection(), "cut");
! 	editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection(), "copy");
! 	editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection(), "paste");
! 	editPasteToTable = new KAction(i18n("Paste inside Table"), 0, 0, this, SLOT(slotEditPasteToTable()), actionCollection(), "paste_to_table");
! 	editPasteToTable->setIcon("frame_spreadsheet");
! 	editPasteToSelection = new KAction(i18n("Paste inside Selection"), 0, 0, this, SLOT(slotEditPasteToSelection()), actionCollection(), "paste_to_selection");
! 	editPasteToSelection->setIcon("frame_edit");
! 
! 
! 	outputShow= new KAction (i18n ("&Show"), 0, 0, this, SLOT (slotOutputShow ()), actionCollection (), "output_show");
! 	outputFlush= new KAction (i18n ("&Flush"), 0, 0, this, SLOT (slotOutputFlush ()), actionCollection (), "output_flush");
! 	outputRefresh= new KAction (i18n ("&Refresh"), 0, 0, this, SLOT (slotOutputRefresh ()), actionCollection (), "output_refresh");
! 
! 
! 	viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
! 	viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
  	showRKWatch = new KToggleAction (i18n ("Console"), 0, 0, this, SLOT(slotShowRKWatch ()), actionCollection(), "windows_rkwatch");
  	showRKOutput = new KToggleAction (i18n ("Output"), 0, 0, this, SLOT(slotShowRKOutput ()), actionCollection(), "windows_rkoutput");
***************
*** 471,500 ****
  	
  	helpFunction = new KAction (i18n ("&Function reference"), KShortcut ("Ctrl+I"), this, SLOT(slotFunctionReference ()), actionCollection(), "function_reference");
! 
  	new_data_frame->setStatusText (i18n ("Creates new empty dataset and opens it for editing"));
!   fileOpenWorkspace->setStatusText(i18n("Opens an existing document"));
!   fileOpenRecentWorkspace->setStatusText(i18n("Opens a recently used file"));
!   fileSaveWorkspace->setStatusText(i18n("Saves the actual document"));
!   fileSaveWorkspaceAs->setStatusText(i18n("Saves the actual document as..."));
  	close_editor->setStatusText (i18n ("Closes the current data editor"));
  	close_all_editors->setStatusText (i18n ("Closes all open data editors"));
!   filePrint ->setStatusText(i18n("Prints out the actual document"));
!   fileQuit->setStatusText(i18n("Quits the application"));
!   editCut->setStatusText(i18n("Cuts the selected section and puts it to the clipboard"));
!   editCopy->setStatusText(i18n("Copies the selected section to the clipboard"));
!   editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position"));
!   editPasteToTable->setStatusText(i18n("Pastes the clipboard contents to actual position, but not beyond the table's boundaries"));
!   editPasteToSelection->setStatusText(i18n("Pastes the clipboard contents to actual position, but not beyond the boundaries of the current selection"));
!   viewToolBar->setStatusText(i18n("Enables/disables the toolbar"));
!   viewStatusBar->setStatusText(i18n("Enables/disables the statusbar"));
!   
!   // use the absolute path to your rkwardui.rc file for testing purpose in createGUI();
!   setXMLFile( "/home/pierre/adetr/rkward/rkward/rkwardui.rc" );
!   createShellGUI ( true );
! 
!   //Is the following relevant now?
! 	// is there a better way to change the name of the "File" menu?
! 	//	menuBar ()->changeItem (menuBar ()->idAt (0), i18n ("&Workspace"));
! 
  }
  
--- 375,395 ----
  	
  	helpFunction = new KAction (i18n ("&Function reference"), KShortcut ("Ctrl+I"), this, SLOT(slotFunctionReference ()), actionCollection(), "function_reference");
! 	
  	new_data_frame->setStatusText (i18n ("Creates new empty dataset and opens it for editing"));
! 	fileOpenWorkspace->setStatusText(i18n("Opens an existing document"));
! 	fileOpenRecentWorkspace->setStatusText(i18n("Opens a recently used file"));
! 	fileSaveWorkspace->setStatusText(i18n("Saves the actual document"));
! 	fileSaveWorkspaceAs->setStatusText(i18n("Saves the actual document as..."));
  	close_editor->setStatusText (i18n ("Closes the current data editor"));
  	close_all_editors->setStatusText (i18n ("Closes all open data editors"));
! 	filePrint ->setStatusText(i18n("Prints out the actual document"));
! 	fileQuit->setStatusText(i18n("Quits the application"));
! 	editCut->setStatusText(i18n("Cuts the selected section and puts it to the clipboard"));
! 	editCopy->setStatusText(i18n("Copies the selected section to the clipboard"));
! 	editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position"));
! 	editPasteToTable->setStatusText(i18n("Pastes the clipboard contents to actual position, but not beyond the table's boundaries"));
! 	editPasteToSelection->setStatusText(i18n("Pastes the clipboard contents to actual position, but not beyond the boundaries of the current selection"));
! 	viewToolBar->setStatusText(i18n("Enables/disables the toolbar"));
! 	viewStatusBar->setStatusText(i18n("Enables/disables the statusbar"));
  }
  
***************
*** 503,510 ****
  {
  	RK_TRACE (APP);
!   ///////////////////////////////////////////////////////////////////
!   // STATUSBAR
!   // TODO: add your own items you need for displaying current application status.
!   statusBar()->insertItem(i18n("Ready."), ID_STATUS_MSG);
  	statusBar()->insertItem(i18n("starting R engine"), ID_R_STATUS_MSG);
  }
--- 398,405 ----
  {
  	RK_TRACE (APP);
! 	///////////////////////////////////////////////////////////////////
! 	// STATUSBAR
! 	// TODO: add your own items you need for displaying current application status.
! 	statusBar()->insertItem(i18n("Ready."), ID_STATUS_MSG);
  	statusBar()->insertItem(i18n("starting R engine"), ID_R_STATUS_MSG);
  }
***************
*** 519,534 ****
  {	
  	RK_TRACE (APP);
!   config->setGroup("General Options");
!   config->writeEntry("Geometry", size());
!   config->writeEntry("Show Toolbar", viewToolBar->isChecked());
!   config->writeEntry("Show Statusbar",viewStatusBar->isChecked());
!   config->writeEntry("ToolBarPos", (int) toolBar("mainToolBar")->barPos());
!   config->writeEntry("EditBarPos", (int) toolBar("editToolBar")->barPos());
!   config->writeEntry("RunBarPos", (int) toolBar("runToolBar")->barPos());
  
  
  	RKSettings::saveSettings (config);
  	
!   fileOpenRecentWorkspace->saveEntries(config,"Recent Files");
  }
  
--- 414,430 ----
  {	
  	RK_TRACE (APP);
! 	config->setGroup("General Options");
! 	config->writeEntry("Geometry", size());
! 	config->writeEntry("Show Toolbar", viewToolBar->isChecked());
! 	config->writeEntry("Show Statusbar",viewStatusBar->isChecked());
! 	config->writeEntry("ToolBarPos", (int) toolBar("mainToolBar")->barPos());
! 	config->writeEntry("EditBarPos", (int) toolBar("editToolBar")->barPos());
! 	config->writeEntry("RunBarPos", (int) toolBar("runToolBar")->barPos());
  
  
  	RKSettings::saveSettings (config);
  	
! 	fileOpenRecentWorkspace->saveEntries(config,"Recent Files");
! 	fileOpenRecent->saveEntries(config,"Recent Command Files");
  }
  
***************
*** 538,575 ****
  	RK_TRACE (APP);
  	
!   config->setGroup("General Options");
! 
!   // bar status settings
!   bool bViewToolbar = config->readBoolEntry("Show Toolbar", true);
!   viewToolBar->setChecked(bViewToolbar);
!   slotViewToolBar();
! 
!   bool bViewStatusbar = config->readBoolEntry("Show Statusbar", true);
!   viewStatusBar->setChecked(bViewStatusbar);
!   slotViewStatusBar();
! 
! 
!   // bar position settings
!   KToolBar::BarPosition toolBarPos;
!   toolBarPos=(KToolBar::BarPosition) config->readNumEntry("ToolBarPos", KToolBar::Top);
!   toolBar("mainToolBar")->setBarPos(toolBarPos);
! 
!   KToolBar::BarPosition editBarPos;
!   editBarPos=(KToolBar::BarPosition) config->readNumEntry("EditBarPos", KToolBar::Top);
!   toolBar("editToolBar")->setBarPos(editBarPos);
!   
!   KToolBar::BarPosition runBarPos;
!   runBarPos=(KToolBar::BarPosition) config->readNumEntry("RunBarPos", KToolBar::Top);
!   toolBar("runToolBar")->setBarPos(runBarPos);
!  
!   QSize size=config->readSizeEntry("Geometry");
!   if(!size.isEmpty ())
!   {
!     resize (size);
!   }
!   
!   // initialize the recent file list
!   fileOpenRecentWorkspace->loadEntries(config,"Recent Files");
! 
  	// do this last, since we may be setting some different config-group(s) in the process
  	RKSettings::loadSettings (config);  
--- 434,471 ----
  	RK_TRACE (APP);
  	
! 	config->setGroup("General Options");
! 	
! 	// bar status settings
! 	bool bViewToolbar = config->readBoolEntry("Show Toolbar", true);
! 	viewToolBar->setChecked(bViewToolbar);
! 	slotViewToolBar();
! 	
! 	bool bViewStatusbar = config->readBoolEntry("Show Statusbar", true);
! 	viewStatusBar->setChecked(bViewStatusbar);
! 	slotViewStatusBar();
! 	
! 	
! 	// bar position settings
! 	KToolBar::BarPosition toolBarPos;
! 	toolBarPos=(KToolBar::BarPosition) config->readNumEntry("ToolBarPos", KToolBar::Top);
! 	toolBar("mainToolBar")->setBarPos(toolBarPos);
! 	
! 	KToolBar::BarPosition editBarPos;
! 	editBarPos=(KToolBar::BarPosition) config->readNumEntry("EditBarPos", KToolBar::Top);
! 	toolBar("editToolBar")->setBarPos(editBarPos);
! 	
! 	KToolBar::BarPosition runBarPos;
! 	runBarPos=(KToolBar::BarPosition) config->readNumEntry("RunBarPos", KToolBar::Top);
! 	toolBar("runToolBar")->setBarPos(runBarPos);
! 	
! 	QSize size=config->readSizeEntry("Geometry");
! 	if(!size.isEmpty ()) {
! 		resize (size);
! 	}
! 	
! 	// initialize the recent file list
! 	fileOpenRecentWorkspace->loadEntries(config,"Recent Files");
! 	fileOpenRecent->loadEntries(config,"Recent Command Files");
! 	
  	// do this last, since we may be setting some different config-group(s) in the process
  	RKSettings::loadSettings (config);  
***************
*** 658,663 ****
  {
  	RK_TRACE (APP);
!   saveOptions();
!   return true;
  }
  
--- 554,559 ----
  {
  	RK_TRACE (APP);
! 	saveOptions();
! 	return true;
  }
  
***************
*** 758,771 ****
  void RKwardApp::slotFilePrint()
  {
! 	RK_TRACE (APP);
!   slotStatusMsg(i18n("Printing..."));
! 
!   QPrinter printer;
!   if (printer.setup(this))
!   {
! //    view->print(&printer);
!   }
! 
!   slotStatusMsg(i18n("Ready."));
  }
  
--- 654,667 ----
  void RKwardApp::slotFilePrint()
  {
! 		RK_TRACE (APP);
! 	slotStatusMsg(i18n("Printing..."));
! 	
! 	QPrinter printer;
! 	if (printer.setup(this))
! 	{
! 	//    view->print(&printer);
! 	}
! 	
! 	slotStatusMsg(i18n("Ready."));
  }
  
***************
*** 978,982 ****
  	}
  	
! 
  	editor->setIcon(SmallIcon("source"));
  	editor->name("RCEditor");
--- 874,878 ----
  	}
  	
! 	fileOpenRecent->addURL (url);
  	editor->setIcon(SmallIcon("source"));
  	editor->name("RCEditor");
***************
*** 998,1003 ****
  	
  	urls = dlg.selectedURLs();
! 	for (it = urls.begin() ; it != urls.end() ; ++it)
  		slotOpenURL(*it);
  
  };
--- 894,900 ----
  	
  	urls = dlg.selectedURLs();
! 	for (it = urls.begin() ; it != urls.end() ; ++it){
  		slotOpenURL(*it);
+ 	}
  
  };
***************
*** 1173,1177 ****
  {
  	if ((QString) activeWindow()->name()=="dataeditor"){
! 		createGUI(0L);
  	}
  	setEnabledActions((QString) activeWindow()->name()=="dataeditor");
--- 1070,1074 ----
  {
  	if ((QString) activeWindow()->name()=="dataeditor"){
! 		m_manager->setActivePart(0L);
  	}
  	setEnabledActions((QString) activeWindow()->name()=="dataeditor");
***************
*** 1180,1186 ****
  
  
! void RKwardApp::slotOpenRecentCommandEditor(const KURL&)
  {
! 
  }
  
--- 1077,1083 ----
  
  
! void RKwardApp::slotOpenRecentCommandEditor(const KURL& url)
  {
! 	slotOpenURL(url);
  }
  
***************
*** 1194,1212 ****
  void RKwardApp::setEnabledActions(bool objectEditor)
  {
! 	if (!objectEditor) {
!   		editCut->setEnabled(false);
!   		editCopy->setEnabled(false);
!   		editPaste->setEnabled(false);
!     		editPasteToSelection->setEnabled(false);
!     		editPasteToTable->setEnabled(false);
! 		fileSave->setEnabled(true);
! 		fileSaveAs->setEnabled(true);
! 		runAll->setEnabled(true);
! 		runSelection->setEnabled(true);
! 		interruptCommand->setEnabled(true);
! 		fileOpenRecent->setEnabled(true);
! 
! 	}
! 	else {
    		editCut->setEnabled(true);
    		editCopy->setEnabled(true);
--- 1091,1095 ----
  void RKwardApp::setEnabledActions(bool objectEditor)
  {
! 	if (objectEditor) {
    		editCut->setEnabled(true);
    		editCopy->setEnabled(true);
***************
*** 1219,1224 ****
  		runSelection->setEnabled(false);
  		interruptCommand->setEnabled(false);
! 		fileOpenRecent->setEnabled(false);
! 
  	}
  }
--- 1102,1117 ----
  		runSelection->setEnabled(false);
  		interruptCommand->setEnabled(false);
! 	}
! 	else{
! 		editCut->setEnabled(false);
! 		editCopy->setEnabled(false);
! 		editPaste->setEnabled(false);
! 		editPasteToSelection->setEnabled(false);
! 		editPasteToTable->setEnabled(false);
! 		fileSave->setEnabled(true);
! 		fileSaveAs->setEnabled(true);
! 		runAll->setEnabled(true);
! 		runSelection->setEnabled(true);
! 		interruptCommand->setEnabled(true);
  	}
  }
***************
*** 1226,1230 ****
  void RKwardApp::openHTML(KURL url)
  {
! 	RKHelpWindow *help = new RKHelpWindow;
  	help->openURL (url);	
  	help->setIcon(SmallIcon("help"));
--- 1119,1123 ----
  void RKwardApp::openHTML(KURL url)
  {
! 	RKHelpWindow *help = new RKHelpWindow(this,"help");
  	help->openURL (url);	
  	help->setIcon(SmallIcon("help"));
***************
*** 1241,1242 ****
--- 1134,1176 ----
  }
  
+ 
+ 
+ /*!
+     \fn RKwardApp::slotOutputShow()
+ 	Show html output.
+  */
+ void RKwardApp::slotOutputShow()
+ {
+ 	RKHelpWindow *out = new RKHelpWindow(this,"output",true);
+ 	KURL url(RKSettingsModuleLogfiles::filesPath() + "/rk_out.html");
+ 	out->openURL (url);	
+ 	out->setIcon(SmallIcon("text_block"));
+ 	addWindow( out );
+ }
+ 
+ 
+ /*!
+     \fn RKwardApp::slotOutputFlush()
+ 	Empties output.
+  */
+ void RKwardApp::slotOutputFlush()
+ {
+ 	int res = KMessageBox::questionYesNo (this, i18n ("Do you really want to flush the ouput? It won't be possible to restore it."), i18n ("Flush output?"));
+ 	if (res==KMessageBox::Yes) {
+ 		QFile out_file (RKSettingsModuleLogfiles::filesPath () + "/rk_out.html");
+ 		out_file.remove ();
+ 	}
+ }
+ 
+ 
+ /*!
+     \fn RKwardApp::slotOutputRefresh()
+ 	Refresh output.
+  */
+ void RKwardApp::slotOutputRefresh()
+ {
+ 	if ((QString) activeWindow()->name()=="output"){
+ 		KURL url(RKSettingsModuleLogfiles::filesPath() + "/rk_out.html");
+ 		((RKHelpWindow*) activeWindow())->openURL (url);
+ 	}	
+ }

Index: rkward.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** rkward.h	3 Apr 2005 13:26:20 -0000	1.28
--- rkward.h	3 Apr 2005 16:23:39 -0000	1.29
***************
*** 245,248 ****
--- 245,255 ----
      KAction* editPasteToSelection;
      KAction* editPasteToTable;
+ 
+ KAction* outputShow;
+ KAction* outputFlush;
+ KAction* outputRefresh;
+ 
+ 
+ 
      KToggleAction* viewToolBar;
      KToggleAction* viewStatusBar;
***************
*** 305,308 ****
--- 312,319 ----
  signals:
      void childWindowCloseRequest(KMdiChildView * window);
+ private slots:
+     void slotOutputShow();
+     void slotOutputFlush();
+     void slotOutputRefresh();
  };
   

Index: rkwardui.rc
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkwardui.rc,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** rkwardui.rc	3 Apr 2005 13:26:20 -0000	1.18
--- rkwardui.rc	3 Apr 2005 16:23:39 -0000	1.19
***************
*** 3,16 ****
  <MenuBar>
  	<Menu name="file"><text>&File</text>
! 		<Menu name="new_data"><text>&Create New</text>
  			<Action name="new_data_frame"/>
  			<Action name="new_command_editor"/>
  		</Menu>
- 		<Merge/> 
- 		<Separator/>
  		<Action name="file_openy"/>
  		<Action name="file_open_recenty"/>
! 		<Action name="file_savey"/>
! 		<Action name="file_save_asy"/>
  		<Separator/>
  		<Action name="file_quitx"/>
--- 3,14 ----
  <MenuBar>
  	<Menu name="file"><text>&File</text>
! 		<Menu name="new_data"><text>&New</text>
  			<Action name="new_data_frame"/>
  			<Action name="new_command_editor"/>
  		</Menu>
  		<Action name="file_openy"/>
  		<Action name="file_open_recenty"/>
! 		<Separator/>
! 		<Merge/> 
  		<Separator/>
  		<Action name="file_quitx"/>
***************
*** 25,31 ****
  		<Separator/>
  		<Action name="file_load_libs"/>
- 		<Separator/>
- 		<Action name="file_printx"/>
- 
  	</Menu>
  	
--- 23,26 ----
***************
*** 40,44 ****
  		<Merge/> 
  	</Menu>
!   
  	<Menu name="run"><text>&Run</text>
  		<Separator/>
--- 35,47 ----
  		<Merge/> 
  	</Menu>
! 
! 	<Menu name="output"><text>&Output</text>
! 		<Separator/>
! 		<Action name="output_show"/>
! 		<Action name="output_refresh"/>
! 		<Separator/>
! 		<Action name="output_flush"/>
! 	</Menu>   
! 	
  	<Menu name="run"><text>&Run</text>
  		<Separator/>
***************
*** 61,69 ****
  		<Action name="new_data_frame"/>
  		<Action name="new_command_editor"/>
  </ToolBar>
  <ToolBar fullWidth="true" name="editToolBar">
- 		<Action name="undo"/>
- 		<Action name="redo"/>
- 		<Separator/>
  		<Action name="cut"/>
  		<Action name="copy"/>
--- 64,71 ----
  		<Action name="new_data_frame"/>
  		<Action name="new_command_editor"/>
+ 		<Action name="file_openy"/>
+ 		<Action name="file_open_recenty"/>
  </ToolBar>
  <ToolBar fullWidth="true" name="editToolBar">
  		<Action name="cut"/>
  		<Action name="copy"/>





More information about the rkward-tracker mailing list