Skip to content

Commit 22e0c3b

Browse files
committed
after pressing a button reset focus in console | new function in
LuaGlobal | shortcut for "save" in TriggerEditor set to CTRL+S
1 parent fc6d1f0 commit 22e0c3b

4 files changed

Lines changed: 26 additions & 8 deletions

File tree

src/LuaGlobal.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,3 +466,14 @@ function table.unpickle( t, tables, tcopy, pickled )
466466
end
467467

468468

469+
-- Replaces the given wildcard (as a number) with the given text.
470+
--
471+
-- -- Example: replaceWildcard(1, "hello") on a trigger of `^You wave (goodbye)\.$`
472+
function replaceWildcard(what, replacement)
473+
if replacement == nil or what == nil then
474+
return
475+
end
476+
selectCaptureGroup(what)
477+
replace(replacement)
478+
end
479+

src/TAction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ void TAction::execute(QStringList & list)
121121
QString funcName = QString("Action") + QString::number( mID );
122122
pL->call( funcName, mName );
123123
}
124+
// move focus back to the active console / command line
125+
mpHost->mpConsole->activateWindow();
126+
mpHost->mpConsole->setFocus();
124127
}
125128

126129
void TAction::expandToolbar( mudlet * pMainWindow, TToolBar * pT, QMenu * menu )

src/dlgTriggerEditor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ dlgTriggerEditor::dlgTriggerEditor( Host * pH )
265265
connect( addFolderAction, SIGNAL(triggered()), this, SLOT( slot_add_new_folder()));
266266

267267
QAction * showSearchAreaAction = new QAction(QIcon(":/icons/edit-find-user.png"), tr("Search"), this);
268-
showSearchAreaAction->setShortcut(tr("Ctrl+S"));
268+
//showSearchAreaAction->setShortcut(tr("Ctrl+F"));
269269
showSearchAreaAction->setStatusTip(tr("Show Search Results List"));
270270
connect( showSearchAreaAction, SIGNAL(triggered()), this, SLOT( slot_show_search_area()));
271271

272272
QAction * saveAction = new QAction(QIcon(":/icons/document-save-as.png"), tr("Save"), this);
273-
saveAction->setShortcut(tr("Ctrl+A"));
273+
saveAction->setShortcut(tr("Ctrl+S"));
274274
saveAction->setStatusTip(tr("Save Edited Trigger, Script, Alias etc. If information has been edited, it must be saved or the changes will be lost."));
275275
connect( saveAction, SIGNAL(triggered()), this, SLOT( slot_save_edit() ));
276276

src/mudlet_documentation.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TITLE></TITLE>
66
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.4 (Linux)">
77
<META NAME="CREATED" CONTENT="20081028;19075200">
8-
<META NAME="CHANGED" CONTENT="20090227;5330300">
8+
<META NAME="CHANGED" CONTENT="20090307;1040200">
99
<STYLE TYPE="text/css">
1010
<!--
1111
@page { size: 21cm 29.7cm }
@@ -1870,14 +1870,18 @@ <H1 CLASS="western" STYLE="margin-top: 0cm; margin-bottom: 0cm; line-height: 150
18701870
</TR>
18711871
<TR VALIGN=TOP>
18721872
<TD WIDTH=360>
1873-
<P CLASS="western" STYLE="margin-right: 0cm; text-indent: -0.1cm; margin-top: 0cm; border: none; padding: 0cm">
1874-
<BR>
1873+
<P CLASS="western" STYLE="text-indent: -0.1cm; border: none; padding: 0cm">
1874+
<FONT COLOR="#008000"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=1 STYLE="font-size: 8pt">function
1875+
replaceWildcard(what, replacement) </FONT></FONT></FONT>
18751876
</P>
18761877
</TD>
18771878
<TD WIDTH=485>
1878-
<P CLASS="western" STYLE="margin-right: 0cm; text-indent: -0.1cm; margin-top: 0cm; border: none; padding: 0cm">
1879-
<BR>
1880-
</P>
1879+
<P CLASS="western" STYLE="text-indent: -0.1cm; border: none; padding: 0cm">
1880+
<FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=1 STYLE="font-size: 8pt">Replaces
1881+
the given wildcard (as a number) with the given text.</FONT></FONT></FONT></P>
1882+
<P CLASS="western" STYLE="text-indent: -0.1cm; border: none; padding: 0cm">
1883+
<FONT SIZE=1 STYLE="font-size: 8pt">Example: replaceWildcard(1,
1884+
&quot;hello&quot;) on a trigger of `^You wave (goodbye)\.$`</FONT></P>
18811885
</TD>
18821886
</TR>
18831887
<TR>

0 commit comments

Comments
 (0)