Skip to content

Commit

Permalink
Shell: Setting up basic UI interconnections
Browse files Browse the repository at this point in the history
When the user enters a command in the command line widget, it will be
sent to the server.
  • Loading branch information
skyjake committed Jan 25, 2013
1 parent 9d7882c commit a595dc8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doomsday/tools/shell/shell-text/src/commandlinewidget.cpp
Expand Up @@ -118,10 +118,11 @@ bool CommandLineWidget::handleEvent(Event const *event)
// Override the editor's normal Enter handling.
if(ev->key() == Qt::Key_Enter)
{
d->updateCommandFromEditor();

String entered = d->command().text;

// Update the history.
d->updateCommandFromEditor();
if(d->historyPos < d->history.size() - 1)
{
if(d->history.last().text.isEmpty())
Expand Down
9 changes: 9 additions & 0 deletions doomsday/tools/shell/shell-text/src/shellapp.cpp
Expand Up @@ -49,6 +49,8 @@ struct ShellApp::Instance
root.add(log);

root.setFocus(cli);

QObject::connect(cli, SIGNAL(commandEntered(de::String)), &self, SLOT(sendCommandToServer(de::String)));
}

~Instance()
Expand All @@ -64,3 +66,10 @@ ShellApp::~ShellApp()
delete d;
}

void ShellApp::sendCommandToServer(String command)
{
DENG2_UNUSED(command);

// todo
}

3 changes: 3 additions & 0 deletions doomsday/tools/shell/shell-text/src/shellapp.h
Expand Up @@ -28,6 +28,9 @@ class ShellApp : public CursesApp

~ShellApp();

public slots:
void sendCommandToServer(de::String command);

private:
struct Instance;
Instance *d;
Expand Down

0 comments on commit a595dc8

Please sign in to comment.