Skip to content

Commit

Permalink
small wwivconfig display tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wwiv committed Jan 5, 2023
1 parent 979c8a7 commit c816fc6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion localui/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ template <class T> class SubDialog : public BaseEditItem {

protected:
[[nodiscard]] const wwiv::sdk::Config& config() const noexcept { return c_; }
[[nodiscard]] virtual std::string menu_label() const { return "[Press Enter to Edit]"; }
[[nodiscard]] virtual std::string menu_label() const { return "[Edit]"; }

const sdk::Config& c_;
T& t_;
Expand Down
11 changes: 9 additions & 2 deletions wwivconfig/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,14 @@ class ActionSubDialog final : public SubDialog<std::vector<menus::menu_action_56
}

[[nodiscard]] std::string menu_label() const override {
return fmt::format("[Edit] {} actions.", t_.size());
switch (t_.size()) {
case 0:
return "[Edit] No actions.";
case 1:
return fmt::format("[Edit] cmd: '{}'", t_.at(0).cmd);
default:
return fmt::format("[Edit] {} actions.", t_.size());
}
}
std::vector<const value::ValueProvider*> providers_;
};
Expand Down Expand Up @@ -447,7 +454,7 @@ class ShowGeneratedMenuSubDialog : public BaseEditItem {
};

static void edit_settings(const Config& config, wwiv::sdk::menus::MenuSet56& menu_set) {
const auto menu_path = menu_set.menuset_dir();
const auto& menu_path = menu_set.menuset_dir();

const UserManager um(config);
User user{};
Expand Down

0 comments on commit c816fc6

Please sign in to comment.