Skip to content

Commit

Permalink
Shell: Adjusting menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 30, 2013
1 parent 3815f3b commit c012f67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doomsday/libshell/include/de/shell/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class Action : public QObject

Action(String const &label, KeyEvent const &event, QObject *target = 0, char const *slot = 0);

Action(String const &label, QObject *target = 0, char const *slot = 0);

Action(String const &label);

~Action();
Expand Down
9 changes: 9 additions & 0 deletions doomsday/libshell/src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ Action::Action(String const &label, KeyEvent const &event, QObject *target, char
}
}

Action::Action(String const &label, QObject *target, char const *slot)
: _event(KeyEvent("")), _label(label)
{
if(target && slot)
{
connect(this, SIGNAL(triggered()), target, slot);
}
}

Action::Action(String const &label) : _event(KeyEvent("")), _label(label)
{}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/tools/shell/shell-text/src/shellapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct ShellApp::Instance
// Main menu.
menu = new MenuWidget;
menu->hide(); // closed initially
menu->appendItem(new Action("Open connection...",
menu->appendItem(new Action("Connect to...",
KeyEvent(Qt::Key_O),
&self, SLOT(openConnection())), "O");
menu->appendItem(new Action("Disconnect"));
Expand Down

0 comments on commit c012f67

Please sign in to comment.