]> git.zarvox.org Git - shareboard.git/commitdiff
Connect board-wipe button to functionality.
authorDrew Fisher <drew.m.fisher@gmail.com>
Fri, 8 Oct 2010 10:33:56 +0000 (03:33 -0700)
committerDrew Fisher <drew.m.fisher@gmail.com>
Fri, 8 Oct 2010 10:33:56 +0000 (03:33 -0700)
action.cpp
mainwindow.cpp
mainwindow.h

index a3dce91bbc819baf4019e3d9474a929327904ba9..9eb7e485299535a52c64ec0d1d60cd6d269e267d 100644 (file)
@@ -47,17 +47,17 @@ DrawLineAction::DrawLineAction() : Action(Action::DrawLine) {
 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() {
 }
index cdc3b7dfa811f51a4cf4ef970768a9892e64cc01..fb8669ebafc43a5074a11a82ce268abfe2650776 100644 (file)
@@ -37,6 +37,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) {
        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");
 }
@@ -53,6 +54,11 @@ void MainWindow::chooseColor() {
        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()) {
@@ -145,7 +151,7 @@ void MainWindow::createToolBars() {
 
        // 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);
index 6914f30d65dc3e8aced9e422e72e362e67b45b29..9437980687fa108a964dbc40d6f949f3436dc794 100644 (file)
@@ -26,6 +26,7 @@ public slots:
        void switchToConnect();
        void showError(QString error);
        void chooseColor();
+       void clearBoard();
        void marshallAction(Action* action);
 private:
        void createActions();
@@ -38,6 +39,7 @@ private:
        QAction* saveAction;
        QAction* quitAction;
        QAction* colorAction;
+       QAction* clearAction;
        QSpinBox* spinboxWidget;
        ConnectionManager* connMan;
 //     HistoryManager* historyManager;