-
Notifications
You must be signed in to change notification settings - Fork 1
/
ControlPanel.cpp
49 lines (42 loc) · 1.1 KB
/
ControlPanel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* =====================================================================================
*
* Filename: ControlPanel.cpp
*
* Description: Control Panel code goes here
*
* Version: 1.0
* Created: 06/03/2011 09:39:46 AM
* Revision: none
* Compiler: gcc
*
* Author: Matthew Sherborne (), msherborne@gmail.com
* Company:
*
* =====================================================================================
*/
#include "ControlPanel.hpp"
#include "PageEdit.hpp"
#include <Wt/WDialog>
#include "App.hpp"
using Wt::WDialog;
namespace vidanueva {
const string ControlPanel::addPageURL = "/newPage";
/**
* Called when the user hits the add page button. Shows the add a new page dialog.
*/
void ControlPanel::addNewPage() {
PageEdit* pageEdit = new PageEdit();
getApp()->mainWindow()->setBody(pageEdit);
}
/**
* @brief If someone navigates to /page/new .. show a new page dialog.
*
* @param path
*/
void ControlPanel::urlChanged(const std::string& path) {
if (path == addPageURL) {
addNewPage();
}
}
} // namespace vidanueva