DrawLineAction::~DrawLineAction() {
}
-AddImageAction::AddImageAction() {
+AddImageAction::AddImageAction() : Action(Action::AddImage) {
}
AddImageAction::~AddImageAction() {
}
-UserChatAction::UserChatAction() {
+UserChatAction::UserChatAction() : Action(Action::UserChat) {
}
UserChatAction::~UserChatAction() {
}
-ClearBoardAction::ClearBoardAction() {
+ClearBoardAction::ClearBoardAction() : Action(Action::ClearBoard) {
}
ClearBoardAction::~ClearBoardAction() {
}
QObject::connect(board, SIGNAL(actionHappened(Action*)), this, SLOT(marshallAction(Action*)));
QObject::connect(colorAction, SIGNAL(triggered()), this, SLOT(chooseColor()));
+ QObject::connect(clearAction, SIGNAL(triggered()), this, SLOT(clearBoard()));
statusBar()->showMessage("Ready");
}
colorAction->setIcon(QIcon(pixmap));
}
+void MainWindow::clearBoard() {
+ ClearBoardAction* action = new ClearBoardAction();
+ marshallAction(action);
+}
+
void MainWindow::load() {
QString fileName = QFileDialog::getOpenFileName(this, "Load saved board:", ".", "Shareboards (*.board)");
if(fileName.isEmpty()) {
// Create some other one-click actions that are not a part of the action group.
QAction* imageAction = new QAction(QIcon("icons/import_image.png"), "Import Image", this);
- QAction* clearAction = new QAction(QIcon("icons/clear.png"), "Clear", this);
+ clearAction = new QAction(QIcon("icons/clear.png"), "Clear", this);
// Style
spinboxWidget = new QSpinBox(this);
void switchToConnect();
void showError(QString error);
void chooseColor();
+ void clearBoard();
void marshallAction(Action* action);
private:
void createActions();
QAction* saveAction;
QAction* quitAction;
QAction* colorAction;
+ QAction* clearAction;
QSpinBox* spinboxWidget;
ConnectionManager* connMan;
// HistoryManager* historyManager;