[rkward-cvs] rkward/rkward khelpdlg.cpp,1.7,1.8 khelpdlg.h,1.5,1.6 rkconsole.cpp,1.7,1.8 rkconsole.h,1.5,1.6

Pierre ecoch at users.sourceforge.net
Sun Apr 24 16:16:11 UTC 2005


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

Modified Files:
	khelpdlg.cpp khelpdlg.h rkconsole.cpp rkconsole.h 
Log Message:
Various stuff about the console and the help dialog.

Index: rkconsole.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkconsole.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rkconsole.cpp	17 Apr 2005 17:42:25 -0000	1.7
--- rkconsole.cpp	24 Apr 2005 16:16:09 -0000	1.8
***************
*** 44,48 ****
  	prefix = "> ";
  	command_incomplete = false;
! 	flush();
  	
  	commandsList.append (new QString(""));
--- 44,48 ----
  	prefix = "> ";
  	command_incomplete = false;
! 	clear();
  	
  	commandsList.append (new QString(""));
***************
*** 114,125 ****
  
  
- void RKConsole::flush()
- {
- 	setText("");
- 	append (i18n (" "));
- 	newLine ();
- }
- 
- 
  void RKConsole::setCurrentCommand(QString command)
  {
--- 114,117 ----
***************
*** 263,264 ****
--- 255,263 ----
  	submitBatch (cb->text());
  }
+ 
+ void RKConsole::clear()
+ {
+ 	QTextEdit::clear();
+ 	newLine();
+ 	
+ }
\ No newline at end of file

Index: khelpdlg.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/khelpdlg.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** khelpdlg.cpp	26 Mar 2005 10:32:18 -0000	1.7
--- khelpdlg.cpp	24 Apr 2005 16:16:09 -0000	1.8
***************
*** 26,30 ****
  #include <qcombobox.h>
  #include <qlistview.h>
! #include <qtimer.h>
  
  #include "rbackend/rinterface.h"
--- 26,30 ----
  #include <qcombobox.h>
  #include <qlistview.h>
! #include <qlineedit.h>
  
  #include "rbackend/rinterface.h"
***************
*** 52,59 ****
  	packagesList->insertItem (i18n("All"));
  
! 	fieldsList->insertItem (i18n("Not implemented yet"));
  
! 	connect(this, SIGNAL(keyPressEvent (QKeyEvent * e)), this, SLOT(slotFieldKeyPressEvent (QKeyEvent * e)));
! 	
  
  
--- 52,64 ----
  	packagesList->insertItem (i18n("All"));
  
! 	// HACK the following is hardcoded, do not modify
! 	fieldsList->insertItem (i18n("All"));
! 	fieldsList->insertItem (i18n("All but keywords"));
! 	fieldsList->insertItem (i18n("Keywords"));
! 	fieldsList->insertItem (i18n("Title"));
  
! 	QLineEdit *edit=field->lineEdit();
! 
! 	connect(edit, SIGNAL(returnPressed()), this, SLOT(slotFieldReturnPressed ()));
  
  
***************
*** 91,101 ****
  		package.append("\"");
  	}
  	
  	
  	QString s = ".rk.get.search.results(\"" +field->currentText() +"\",agrep=" 
! 		+ agrep +", ignore.case=" + ignoreCase + ", package=" + package +")";
  		
  	
  	RKGlobals::rInterface ()->issueCommand (s, RCommand::App | RCommand::Sync | RCommand::GetStringVector, "", this, HELP_SEARCH, 0);
  	field->insertItem(field->currentText());
  	
--- 96,118 ----
  		package.append("\"");
  	}
+ 
+ 	// HACK the following is hardcoded, do not modify
+ 	QString fields="";
+ 	
+ 	switch(fieldsList->currentItem()){
+ 		case 1: fields = "c(\"alias\", \"concept\", \"title\")";break;
+ 		case 2: fields = "c(\"keyword\")";break;
+ 		case 3: fields = "c(\"title\")";break;
+ 		default: fields = "c(\"alias\", \"concept\", \"title\",\"keyword\")";
+ 			
+ 	}
  	
  	
  	QString s = ".rk.get.search.results(\"" +field->currentText() +"\",agrep=" 
! 		+ agrep +", ignore.case=" + ignoreCase + ", package=" + package +", fields=" + fields +")";
  		
  	
  	RKGlobals::rInterface ()->issueCommand (s, RCommand::App | RCommand::Sync | RCommand::GetStringVector, "", this, HELP_SEARCH, 0);
+ 	setEnabled(false);
  	field->insertItem(field->currentText());
  	
***************
*** 138,141 ****
--- 155,159 ----
  			new QListViewItem (resultsList, command->getStringVector ()[i], command->getStringVector ()[count + i], command->getStringVector ()[2*count + i]);
  		}
+ 		setEnabled(true);
  	} 
  	else if (command->getFlags () == GET_HELP_URL) {
***************
*** 163,182 ****
  
  
! 
! 
! /*!
!     \fn KHelpDlg::slotFieldKeyPressEvent ( QKeyEvent * e )
! 
!     We intercept enter.
!  */
! void KHelpDlg::slotFieldKeyPressEvent ( QKeyEvent * e )
  {
! 
! 	
! 	if ( (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) && field->hasFocus ()) {
! 		slotFindButtonClicked ();
! 		return;
! 	}
! 	
! 	//QComboBox::keyPressEvent( e );
  }
--- 181,187 ----
  
  
! void KHelpDlg::slotFieldReturnPressed (  )
  {
! 	slotFindButtonClicked ();
  }
+ 

Index: rkconsole.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkconsole.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkconsole.h	19 Apr 2005 06:48:06 -0000	1.5
--- rkconsole.h	24 Apr 2005 16:16:09 -0000	1.6
***************
*** 45,50 ****
  	~RKConsole();
  	
- 	/** Empties the console */
- 	void flush ();
  	/** Sets the current command
  	\param command the new command */
--- 45,48 ----
***************
*** 88,91 ****
--- 86,91 ----
  @sa submitBatch */
  	void paste();
+ /** We overload the clear function.*/
+ 	void clear();
      
  private slots:

Index: khelpdlg.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/khelpdlg.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** khelpdlg.h	26 Mar 2005 10:32:18 -0000	1.5
--- khelpdlg.h	24 Apr 2005 16:16:09 -0000	1.6
***************
*** 41,48 ****
    virtual void          slotResultsListDblClicked( QListViewItem *item, const QPoint &, int );
    virtual void          slotPackageListActivated();
!   
! protected:
!   /*$PROTECTED_FUNCTIONS$*/
!   void slotFieldKeyPressEvent ( QKeyEvent * e );
  protected slots:
    /*$PROTECTED_SLOTS$*/
--- 41,46 ----
    virtual void          slotResultsListDblClicked( QListViewItem *item, const QPoint &, int );
    virtual void          slotPackageListActivated();
!   virtual void          slotFieldReturnPressed();
! 
  protected slots:
    /*$PROTECTED_SLOTS$*/





More information about the rkward-tracker mailing list