mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-27 23:19:13 +08:00
Cleanup and set correct assembly name
This commit is contained in:
parent
5cf82d7000
commit
7b6762609e
@ -9,6 +9,7 @@
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<AssemblyName>PowerToys.Espresso</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
@ -86,7 +86,7 @@ private:
|
||||
|
||||
SHELLEXECUTEINFOW sei{ sizeof(sei) };
|
||||
sei.fMask = { SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI };
|
||||
sei.lpFile = L"modules\\Espresso\\Espresso.Shell.exe";
|
||||
sei.lpFile = L"modules\\Espresso\\PowerToys.Espresso.exe";
|
||||
sei.nShow = SW_SHOWNORMAL;
|
||||
sei.lpParameters = executable_args.data();
|
||||
if (!ShellExecuteExW(&sei))
|
||||
@ -125,24 +125,6 @@ public:
|
||||
return MODULE_NAME;
|
||||
}
|
||||
|
||||
|
||||
//// Return array of the names of all events that this powertoy listens for, with
|
||||
//// nullptr as the last element of the array. Nullptr can also be retured for empty
|
||||
//// list.
|
||||
//virtual const wchar_t** get_events() override
|
||||
//{
|
||||
// static const wchar_t* events[] = { nullptr };
|
||||
// // Available events:
|
||||
// // - ll_keyboard
|
||||
// // - win_hook_event
|
||||
// //
|
||||
// // static const wchar_t* events[] = { ll_keyboard,
|
||||
// // win_hook_event,
|
||||
// // nullptr };
|
||||
|
||||
// return events;
|
||||
//}
|
||||
|
||||
// Return JSON with the configuration options.
|
||||
virtual bool get_config(wchar_t* buffer, int* buffer_size) override
|
||||
{
|
||||
@ -152,52 +134,6 @@ public:
|
||||
PowerToysSettings::Settings settings(hinstance, get_name());
|
||||
settings.set_description(MODULE_DESC);
|
||||
|
||||
// Show an overview link in the Settings page
|
||||
//settings.set_overview_link(L"https://");
|
||||
|
||||
// Show a video link in the Settings page.
|
||||
//settings.set_video_link(L"https://");
|
||||
|
||||
// A bool property with a toggle editor.
|
||||
//settings.add_bool_toogle(
|
||||
// L"bool_toggle_1", // property name.
|
||||
// L"This is what a BoolToggle property looks like", // description or resource id of the localized string.
|
||||
// g_settings.bool_prop // property value.
|
||||
//);
|
||||
|
||||
// An integer property with a spinner editor.
|
||||
//settings.add_int_spinner(
|
||||
// L"int_spinner_1", // property name
|
||||
// L"This is what a IntSpinner property looks like", // description or resource id of the localized string.
|
||||
// g_settings.int_prop, // property value.
|
||||
// 0, // min value.
|
||||
// 100, // max value.
|
||||
// 10 // incremental step.
|
||||
//);
|
||||
|
||||
// A string property with a textbox editor.
|
||||
//settings.add_string(
|
||||
// L"string_text_1", // property name.
|
||||
// L"This is what a String property looks like", // description or resource id of the localized string.
|
||||
// g_settings.string_prop // property value.
|
||||
//);
|
||||
|
||||
// A string property with a color picker editor.
|
||||
//settings.add_color_picker(
|
||||
// L"color_picker_1", // property name.
|
||||
// L"This is what a ColorPicker property looks like", // description or resource id of the localized string.
|
||||
// g_settings.color_prop // property value.
|
||||
//);
|
||||
|
||||
// A custom action property. When using this settings type, the "PowertoyModuleIface::call_custom_action()"
|
||||
// method should be overriden as well.
|
||||
//settings.add_custom_action(
|
||||
// L"custom_action_id", // action name.
|
||||
// L"This is what a CustomAction property looks like", // label above the field.
|
||||
// L"Call a custom action", // button text.
|
||||
// L"Press the button to call a custom action." // display values / extended info.
|
||||
//);
|
||||
|
||||
return settings.serialize_to_buffer(buffer, buffer_size);
|
||||
}
|
||||
|
||||
@ -217,10 +153,6 @@ public:
|
||||
// Parse the action values, including name.
|
||||
PowerToysSettings::CustomActionObject action_object =
|
||||
PowerToysSettings::CustomActionObject::from_json_string(action);
|
||||
|
||||
//if (action_object.get_name() == L"custom_action_id") {
|
||||
// // Execute your custom action
|
||||
//}
|
||||
}
|
||||
catch (std::exception&)
|
||||
{
|
||||
@ -237,31 +169,9 @@ public:
|
||||
PowerToysSettings::PowerToyValues values =
|
||||
PowerToysSettings::PowerToyValues::from_json_string(config, get_key());
|
||||
|
||||
// Update a bool property.
|
||||
//if (auto v = values.get_bool_value(L"bool_toggle_1")) {
|
||||
// g_settings.bool_prop = *v;
|
||||
//}
|
||||
|
||||
// Update an int property.
|
||||
//if (auto v = values.get_int_value(L"int_spinner_1")) {
|
||||
// g_settings.int_prop = *v;
|
||||
//}
|
||||
|
||||
// Update a string property.
|
||||
//if (auto v = values.get_string_value(L"string_text_1")) {
|
||||
// g_settings.string_prop = *v;
|
||||
//}
|
||||
|
||||
// Update a color property.
|
||||
//if (auto v = values.get_string_value(L"color_picker_1")) {
|
||||
// g_settings.color_prop = *v;
|
||||
//}
|
||||
|
||||
// If you don't need to do any custom processing of the settings, proceed
|
||||
// to persists the values calling:
|
||||
values.save_to_settings_file();
|
||||
// Otherwise call a custom function to process the settings before saving them to disk:
|
||||
// save_settings();
|
||||
}
|
||||
catch (std::exception&)
|
||||
{
|
||||
@ -294,34 +204,6 @@ public:
|
||||
{
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
//// Handle incoming event, data is event-specific
|
||||
//virtual intptr_t signal_event(const wchar_t* name, intptr_t data) override
|
||||
//{
|
||||
// if (wcscmp(name, ll_keyboard) == 0)
|
||||
// {
|
||||
// auto& event = *(reinterpret_cast<LowlevelKeyboardEvent*>(data));
|
||||
// // Return 1 if the keypress is to be suppressed (not forwarded to Windows),
|
||||
// // otherwise return 0.
|
||||
// return 0;
|
||||
// }
|
||||
// else if (wcscmp(name, win_hook_event) == 0)
|
||||
// {
|
||||
// auto& event = *(reinterpret_cast<WinHookEvent*>(data));
|
||||
// // Return value is ignored
|
||||
// return 0;
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
//// This methods are part of an experimental features not fully supported yet
|
||||
//virtual void register_system_menu_helper(PowertoySystemMenuIface* helper) override
|
||||
//{
|
||||
//}
|
||||
|
||||
//virtual void signal_system_menu_action(const wchar_t* name) override
|
||||
//{
|
||||
//}
|
||||
};
|
||||
|
||||
// Load the settings file.
|
||||
@ -340,44 +222,6 @@ void Espresso::init_settings()
|
||||
}
|
||||
}
|
||||
|
||||
// This method of saving the module settings is only required if you need to do any
|
||||
// custom processing of the settings before saving them to disk.
|
||||
//void $projectname$::save_settings() {
|
||||
// try {
|
||||
// // Create a PowerToyValues object for this PowerToy
|
||||
// PowerToysSettings::PowerToyValues values(get_name());
|
||||
//
|
||||
// // Save a bool property.
|
||||
// //values.add_property(
|
||||
// // L"bool_toggle_1", // property name
|
||||
// // g_settings.bool_prop // property value
|
||||
// //);
|
||||
//
|
||||
// // Save an int property.
|
||||
// //values.add_property(
|
||||
// // L"int_spinner_1", // property name
|
||||
// // g_settings.int_prop // property value
|
||||
// //);
|
||||
//
|
||||
// // Save a string property.
|
||||
// //values.add_property(
|
||||
// // L"string_text_1", // property name
|
||||
// // g_settings.string_prop // property value
|
||||
// );
|
||||
//
|
||||
// // Save a color property.
|
||||
// //values.add_property(
|
||||
// // L"color_picker_1", // property name
|
||||
// // g_settings.color_prop // property value
|
||||
// //);
|
||||
//
|
||||
// // Save the PowerToyValues JSON to the power toy settings file.
|
||||
// values.save_to_settings_file();
|
||||
// }
|
||||
// catch (std::exception ex) {
|
||||
// // Couldn't save the settings.
|
||||
// }
|
||||
//}
|
||||
|
||||
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user