</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="type" type="o:modeTypeT" use="required" />
- <xs:attribute name="custom" type="xs:boolean" use="optional" default="false" />
</xs:complexType>
</xs:element>
</xs:sequence>
MODES_NAMESPACE_USE;
Mode::Mode()
- : customized(false), type(MODE_NORMAL)
+ : type(MODE_NORMAL)
{
}
return type;
}
-void Mode::setCustomized(bool data)
-{
- customized = data;
-}
-
-bool Mode::getCustomized() const
-{
- return customized;
-}
-
int Mode::apply()
{
std::list<std::shared_ptr<Action>>::iterator it;
void setModeType(int val);
ModeType getModeType() const;
- void setCustomized(bool data);
- bool getCustomized() const;
-
void addAction(Action *action);
std::list<std::shared_ptr<Action>> getActionList() const;
int applyOneShot();
void undo();
private:
- bool customized;
std::string name;
ModeType type;
std::list<std::shared_ptr<Action>> actionList;
{
auto found = savedModes.find(name);
if (savedModes.end() != found) {
- ERR("Mode(%s) is already applied", name.c_str());
+ INFO("Mode(%s) is Saved Mode", name.c_str());
return true;
}
{
mode.setName(extractModeName(node));
mode.setModeType(extractModeType(node));
- mode.setCustomized(extractModeCustom(node));
}
std::string ModeXMLParser::extractModeName(xmlNodePtr node)
return extractValueOfTag(node, ModesXMLTag::TYPE);
}
-bool ModeXMLParser::extractModeCustom(xmlNodePtr node)
-{
- std::string data = extractValueOfTag(node, ModesXMLTag::CUSTOM);
- return ("yes" == data);
-}
-
void ModeXMLParser::parseUndo(xmlNodePtr node)
{
Action *action = parseActionInfo(node);
void parseMode(xmlNodePtr node);
std::string extractModeName(xmlNodePtr node);
std::string extractModeType(xmlNodePtr node);
- bool extractModeCustom(xmlNodePtr node);
void parseActionAttr(xmlNodePtr node, Action *action);
void parseAction(xmlNodePtr node);
void parseUndo(xmlNodePtr node);
const xmlChar* const ModesXMLTag::MODE = (xmlChar*)"mode";
const xmlChar* const ModesXMLTag::NAME = (xmlChar*)"name";
const xmlChar* const ModesXMLTag::TYPE = (xmlChar*)"type";
-const xmlChar* const ModesXMLTag::CUSTOM = (xmlChar*)"custom";
//Action
const xmlChar* const ModesXMLTag::ACTION = (xmlChar*)"action";
const xmlChar* const ModesXMLTag::UNDO = (xmlChar*)"undo";
static const xmlChar* const MODE;
static const xmlChar* const NAME;
static const xmlChar* const TYPE;
- static const xmlChar* const CUSTOM;
//Action
static const xmlChar* const ACTION;
static const xmlChar* const UNDO;
mode.setName(modeName);
mode.setModeType(type);
- mode.setCustomized(true);
g_free(modeName);
g_variant_get(actionList, MODES_DBUS_ACTION_LIST_SIG, &iter);
xmlSetProp(modeNode, ModesXMLTag::NAME, (xmlChar*)modeName.c_str());
xmlSetProp(modeNode, ModesXMLTag::TYPE, (xmlChar*)modeType.c_str());
- xmlSetProp(modeNode, ModesXMLTag::CUSTOM, (xmlChar*)((mode.getCustomized())? "yes": "no"));
xmlAddChild(rootNode, modeNode);
std::list<std::shared_ptr<Action>> actionList = mode.getActionList();
value = (char*)xmlGetProp(node, tag);
if (value == NULL) {
- ERR("attribute(%s) is NULL. ", tag);
+ WARN("attribute(%s) is NULL. ", tag);
return std::string();
}
<policy group="system_fw">
<allow own="@DBUS_INTERFACE@"/>
<allow send_destination="@DBUS_INTERFACE@"/>
- </policy>
+ <allow send_type="signal" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@"/>
+ </policy>
<policy context="default">
<deny own="@DBUS_INTERFACE@"/>
<deny send_destination="@DBUS_INTERFACE@" send_type="method_call"/>
- <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="applyMode"/>
- <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="undoMode"/>
- <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="registerMode"/>
- <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="getModes"/>
- <allow send_type="signal" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="changedMode"/>
+
+ <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@"/>
+
+ <deny send_type="signal" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@"/>
<allow send_destination="@DBUS_INTERFACE@" send_interface="org.freedesktop.DBus.Properties" send_member="GetAll"/>
</policy>
</busconfig>