I change all QAction* to KAction* in rkward.h, and the shortcut setting
worked.
And I find another bug: in R console, backspace key don't work when the
cursor is at begin of current line and some part of the line is selected.
Attachment is a patch for these 2 bugs.
2009/1/23 Prasenjit Kapat <[email protected]>
> Hi All,
>
> On Thu, Jan 22, 2009 at 7:42 PM, Stefan Rödiger <[email protected]>
> wrote:
> > Am Tuesday 13 January 2009 08:29:27 schrieb Prasenjit Kapat:
> >> Hi All,
> >>
> >> Since KDE 4.2 is about to release, I am test driving it on a separate
> >> partition... So, I checked out the trunk of rkward from svn and am
> >> giving it a spin... The compile seems to work without any errors (lots
> >> of warnings, of course).
> >>
> >> When a script editor window is open, pressing Ctrl+S to save the file,
> >> results in a conflict with the "Save Workspace" shortcut. This is
> >> observed using the svn trunk of rkward and KDE 4.1.85 on Kubuntu 8.10.
> >>
> >> I presume Thomas is busy so any clarification will take time..
> >>
> >> I was fiddling with the svn code myself. Lines 349 - 352 of rkward.cpp
> >> specifically sets Qt:ControlModifier + Qt::ShiftModifier + Qt::Key_S
> >> as the action shortcut for "Save Workspace" but, the Shift modifier
> >> seems to be ignored, as shown below:
> >>
> >> fileSaveWorkspace = actionCollection ()->addAction
> >> KStandardAction::Save, "file_savex", this,
> >> LOT(slotFileSaveWorkspace()));
> >> fileSaveWorkspace->setText (i18n ("Save Workspace"));
> >> fileSaveWorkspace->setShortcut (Qt::ControlModifier +
> >> t::ShiftModifier + Qt::Key_S);
> >> fileSaveWorkspace->setStatusTip (i18n ("Saves the actual document"));
> >>
> >> One solution (that works) is to change the Save shortcut of "Kate
> >> Part" from Kate to something other than Ctrl+S. But that an
> >> outside-of-rkward solution.
> >>
> >> I've filed a bug report on this for rkward, so that it doesn't get
> >> lost. Any one seen this issue? Any clue? As of now, I've commented the
> >> above four lines in rkward.cpp for my local compilation.
> >>
> >> I can ask on kde devel list about this, but I am not at all familiar
> >> with the structure of rkward codes, so it may seem pretty lame!
> >
> > Hi Prasenjit,
> >
> > As you may have seen in the list Roy Qu provided a patch (in trunk now)
> and according to Thomas it
> > might solve your problem. Can you confirm this?
>
> Well, Yes and No!
>
> No:
> Roy's patch was only for the "rkconsole.cpp". So, only the RConsole
> part was affected (this is my understanding, which given my C++
> knowledge, might very well be wrong).
>
> Yes:
> I did not know this: you could right click on "Save Workspace Ctrl+S"
> menu option to change its shortcut (to, say, Ctrl+Shift+S -- "main"
> not "alternate"). This creates the file
> ~/.kde/share/apps/rkward/rkwardui.rc wherein this shortcut info is
> stored. Similarly, for "Open Workspace Ctrl+O" to Ctrl+Shift+O. And
> now, all the four shortcuts work as intended.
>
> So, as you see, the "Yes" part was not influenced by Roy's patch. I
> actually tried it - removed Roy's patch and changed the shortcuts.
> Works.
>
> The issue then is, why are the shortcuts from the source code
> (rkward.cpp) not honored? I should add: my previous bug-mail was
> under 4.1.85 (beta2) and today I did all this on 4.1.96 (rc1) - so I
> guess the KDE APIs are still buggy!?
>
> One more thing (ala Steve Jobs): If you use Ctrl+S or Ctrl+O before
> changing the shortcuts you get the "Ambiguous Shortcut" message. Then
> when you try to change the shortcuts, RkWard quits with Fatal Error.
> So, you start the application again, and the change the shortcuts
> first.
>
> > Regards
> > Stefan
>
> Thanks to Roy for the RkConsole patch...
> --
> Prasenjit
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> RKWard-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rkward-devel
>
Index: rkward/rkward.h
===================================================================
--- rkward/rkward.h (版本 2398)
+++ rkward/rkward.h (工作副本)
@@ -178,33 +178,33 @@
KParts::PartManager *part_manager;
// KAction pointers to enable/disable actions
- QAction* fileOpen;
+ KAction* fileOpen;
KRecentFilesAction* fileOpenRecent;
- QAction* fileOpenWorkspace;
+ KAction* fileOpenWorkspace;
KRecentFilesAction* fileOpenRecentWorkspace;
- QAction* fileSaveWorkspace;
- QAction* fileSaveWorkspaceAs;
- QAction* fileQuit;
- QAction* file_load_libs;
- QAction* close_all_editors;
- QAction* new_data_frame;
- QAction* new_command_editor;
+ KAction* fileSaveWorkspace;
+ KAction* fileSaveWorkspaceAs;
+ KAction* fileQuit;
+ KAction* file_load_libs;
+ KAction* close_all_editors;
+ KAction* new_data_frame;
+ KAction* new_command_editor;
- QAction* editUndo;
- QAction* editRedo;
+ KAction* editUndo;
+ KAction* editRedo;
- QAction* window_close_all;
- QAction* window_detach;
+ KAction* window_close_all;
+ KAction* window_detach;
- QAction* configure;
+ KAction* configure;
/** used so that if the menu is empty, there is a note in it, explaining that fact */
- QAction* edit_menu_dummy;
+ KAction* edit_menu_dummy;
/** used so that if the menu is empty, there is a note in it, explaining that fact */
- QAction* view_menu_dummy;
+ KAction* view_menu_dummy;
/** used so that if the menu is empty, there is a note in it, explaining that fact */
- QAction* run_menu_dummy;
+ KAction* run_menu_dummy;
friend class RKSettingsModule;
friend class RKSettingsModulePlugins;
Index: rkward/rkconsole.cpp
===================================================================
--- rkward/rkconsole.cpp (版本 2398)
+++ rkward/rkconsole.cpp (工作副本)
@@ -261,12 +261,11 @@
return true;
} else if (e->key () == Qt::Key_Backspace){
- if(pos<=prefix.length ()) return true;
-
if (view->selection ()) {
doc->removeText (view->selectionRange ());
view->removeSelection ();
} else {
+ if(pos<=prefix.length ()) return true;
doc->removeText (KTextEditor::Range (para, pos, para, pos-1));
}
return true;
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
RKWard-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rkward-devel