[rkward-cvs] rkward/rkward rkconsole.cpp,1.5,1.6 rkward.cpp,1.76,1.77 rkward.h,1.31,1.32
Pierre
ecoch at users.sourceforge.net
Fri Apr 15 21:38:10 UTC 2005
Update of /cvsroot/rkward/rkward/rkward
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32450/rkward
Modified Files:
rkconsole.cpp rkward.cpp rkward.h
Log Message:
Improving output mdi child handling.
Index: rkward.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** rkward.cpp 15 Apr 2005 20:03:09 -0000 1.76
--- rkward.cpp 15 Apr 2005 21:38:08 -0000 1.77
***************
*** 166,170 ****
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");
--- 166,170 ----
output->hide ();*/
! QString dummy = i18n("Before you start bashing at it: please note that this is merely a technology preview release. You might actually 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");
***************
*** 690,718 ****
{
RK_TRACE (APP);
! if (! activeWindow()->inherits("RKCommandEditorWindow")) {
! slotStatusMsg(i18n("Cutting selection..."));
! slotEditCopy ();
! RKGlobals::editorManager ()->currentEditor ()->clearSelected ();
! slotStatusMsg(i18n("Ready."));
! }
! else {
! ((RKCommandEditorWindow*) activeWindow())->cut();
}
}
void RKwardApp::slotEditCopy() {
RK_TRACE (APP);
! if (! activeWindow()->inherits("RKCommandEditorWindow")) {
! slotStatusMsg(i18n("Copying selection to clipboard..."));
! QApplication::clipboard()->setData(RKGlobals::editorManager ()->currentEditor ()->makeDrag ());
! slotStatusMsg(i18n("Ready."));
! }
! else {
! ((RKCommandEditorWindow*) activeWindow())->copy();
}
}
void RKwardApp::doPaste () {
RK_TRACE (APP);
slotStatusMsg(i18n("Inserting clipboard contents..."));
--- 690,726 ----
{
RK_TRACE (APP);
!
! if ((QString) activeWindow()->name()!="dataeditor"){
! return;
}
+
+ slotStatusMsg(i18n("Cutting selection..."));
+ slotEditCopy ();
+ RKGlobals::editorManager ()->currentEditor ()->clearSelected ();
+ slotStatusMsg(i18n("Ready."));
+
}
void RKwardApp::slotEditCopy() {
RK_TRACE (APP);
!
! if ((QString) activeWindow()->name()!="dataeditor"){
! return;
}
+
+ slotStatusMsg(i18n("Copying selection to clipboard..."));
+ QApplication::clipboard()->setData(RKGlobals::editorManager ()->currentEditor ()->makeDrag ());
+ slotStatusMsg(i18n("Ready."));
+
}
void RKwardApp::doPaste () {
RK_TRACE (APP);
+
+ if ((QString) activeWindow()->name()!="dataeditor"){
+ return;
+ }
+
+
slotStatusMsg(i18n("Inserting clipboard contents..."));
***************
*** 732,749 ****
void RKwardApp::slotEditPaste() {
! if (! activeWindow()->inherits("RKCommandEditorWindow")) {
! RK_TRACE (APP);
! RKGlobals::editorManager ()->currentEditor ()->setPasteMode (RKEditor::PasteEverywhere);
! doPaste ();
! }
! else {
! ((RKCommandEditorWindow*) activeWindow())->paste();
}
}
void RKwardApp::slotEditPasteToTable() {
RK_TRACE (APP);
! if (activeWindow()->inherits("RKCommandEditorWindow"))
return;
--- 740,759 ----
void RKwardApp::slotEditPaste() {
! if ((QString) activeWindow()->name()!="dataeditor"){
! return;
}
+
+ RK_TRACE (APP);
+ RKGlobals::editorManager ()->currentEditor ()->setPasteMode (RKEditor::PasteEverywhere);
+ doPaste ();
+
+
}
void RKwardApp::slotEditPasteToTable() {
RK_TRACE (APP);
! if ((QString) activeWindow()->name()!="dataeditor"){
return;
+ }
***************
*** 753,758 ****
void RKwardApp::slotEditPasteToSelection() {
RK_TRACE (APP);
! if (activeWindow()->inherits("RKCommandEditorWindow"))
! return;
RKGlobals::editorManager ()->currentEditor ()->setPasteMode (RKEditor::PasteToSelection);
--- 763,770 ----
void RKwardApp::slotEditPasteToSelection() {
RK_TRACE (APP);
!
! if ((QString) activeWindow()->name()!="dataeditor"){
! return;
! }
RKGlobals::editorManager ()->currentEditor ()->setPasteMode (RKEditor::PasteToSelection);
***************
*** 1024,1038 ****
if (status == KMessageBox::Yes) {
! window->hide();
! delete window;
}
}
else {
! window->hide();
! delete window;
}
}
! else if (window->inherits("RKHelpWindow")){
! delete window;
}
}
--- 1036,1049 ----
if (status == KMessageBox::Yes) {
! closeWindow(window);
}
}
else {
! closeWindow(window);
}
}
! else if (window->inherits("RKHelpWindow"))
! {
! closeWindow(window);
}
}
***************
*** 1157,1165 ****
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 );
}
--- 1168,1183 ----
void RKwardApp::slotOutputShow()
{
!
! KMdiChildView* outp = outputView();
! if (outp){
! activateView(outp);
! }
! else {
! RKHelpWindow *out = new RKHelpWindow(this,"output",true);
! KURL url(RKSettingsModuleLogfiles::filesPath() + "/rk_out.html");
! out->openURL (url);
! out->setIcon(SmallIcon("text_block"));
! addWindow( out );
! }
}
***************
*** 1175,1178 ****
--- 1193,1197 ----
QFile out_file (RKSettingsModuleLogfiles::filesPath () + "/rk_out.html");
out_file.remove ();
+ slotOutputRefresh();
}
}
***************
*** 1185,1190 ****
void RKwardApp::slotOutputRefresh()
{
! if ((QString) activeWindow()->name()=="output"){
((RKHelpWindow*) activeWindow())->refresh();
}
}
--- 1204,1238 ----
void RKwardApp::slotOutputRefresh()
{
! KMdiChildView* outp = outputView();
! if (outp){
! activateView(outp);
! }
! else {
! return;
! }
!
! // Lets be cautious about what we get.
! if ( activeWindow()->inherits("RKHelpWindow"))
((RKHelpWindow*) activeWindow())->refresh();
+
+ }
+
+
+ /*!
+ \fn RKwardApp::outputView()
+ Returns a pointer to the output MDI child view.
+ */
+ KMdiChildView* RKwardApp::outputView()
+ {
+ KMdiChildView* result = 0;
+ KMdiIterator<KMdiChildView*>* it = createIterator();
+ for ( it->first(); !it->isDone(); it->next() )
+ {
+ if ((QString)it->currentItem()->name() == "output" && it->currentItem() != 0){
+ result = it->currentItem();
+ }
}
+ deleteIterator(it);
+
+ return(result);
}
Index: rkward.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkward.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** rkward.h 15 Apr 2005 20:03:09 -0000 1.31
--- rkward.h 15 Apr 2005 21:38:08 -0000 1.32
***************
*** 298,301 ****
--- 298,302 ----
void saveAsProcedure(RKCommandEditorWindow *editor);
void setEnabledActions(bool commandEditor);
+ KMdiChildView* outputView();
Index: rkconsole.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rkconsole.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkconsole.cpp 15 Apr 2005 20:03:09 -0000 1.5
--- rkconsole.cpp 15 Apr 2005 21:38:08 -0000 1.6
***************
*** 57,63 ****
void RKConsole::keyPressEvent ( QKeyEvent * e )
{
! int para=0; int pos=0;
! getCursorPosition (¶, &pos);
!
if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
--- 57,64 ----
void RKConsole::keyPressEvent ( QKeyEvent * e )
{
! int para=0; int p=0;
! getCursorPosition (¶, &p);
! // Explicitely converting so we get less warnings.
! uint pos=(uint) p;
if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
***************
*** 207,211 ****
if (command->errorIncomplete ()) {
! prefix = "# ";
command_incomplete = true;
incomplete_command = command->command ();
--- 208,212 ----
if (command->errorIncomplete ()) {
! prefix = "+ ";
command_incomplete = true;
incomplete_command = command->command ();
More information about the rkward-tracker
mailing list