DummySessionConnection: new tab in the TestControl dialog box

...to trigger the new fake-functionality
This commit is contained in:
Fischlurch 2018-10-14 23:55:00 +02:00
parent 77902d54a6
commit de5f0b85d4
2 changed files with 86 additions and 9 deletions

View file

@ -43,12 +43,19 @@
#include "gui/dialog/dialog.hpp"
#include "gui/ctrl/bus-term.hpp"
#include "gui/model/tangible.hpp"
#include "proc/cmd.hpp"
#include "include/ui-protocol.hpp"
#include "proc/cmd.hpp"
#include "include/gui-notification-facade.h"
#include "lib/scoped-ptrvect.hpp"
#include "proc/mobject/session/dummy-session-connection.hpp"
#include "lib/test/test-helper.hpp"
#include "lib/diff/gen-node.hpp"
#include "lib/scoped-ptrvect.hpp"
#include "lib/format-string.hpp"
#include "lib/format-cout.hpp"
#include "lib/nocopy.hpp"
#include "lib/util.hpp"
#include <utility>
#include <string>
@ -59,6 +66,8 @@ namespace dialog {
using std::string;
using std::forward;
using lib::diff::GenNode;
using util::sanitise;
using util::_Fmt;
/**
@ -202,6 +211,7 @@ namespace dialog {
"it will be passed down and sent back</i>"));
trig_1_.set_use_underline();
trig_1_.set_label ("_display text");
trig_1_.property_xalign() = 0;
trig_1_.set_tooltip_markup (_("Trigger Proc-GUI <b>roundtrip</b>\n"
"Proc invokes GuiNotification::displayInfo"));
@ -223,6 +233,7 @@ namespace dialog {
trig_4_.set_use_underline();
trig_4_.set_label ("_mark");
trig_4_.property_xalign() = 0;
trig_4_.set_tooltip_markup (_("trigger Proc-command, which in turn\n"
"sends an <b>state mark</b> message, using\n"
"the message action-ID from the combobox"));
@ -249,9 +260,9 @@ namespace dialog {
seg_2_.pack_start (trig_3_);
seg_2_.pack_start (markParam_);
pack_start (content_);
pack_start (seg_1_);
pack_start (seg_2_);
pack_start (content_, Gtk::PACK_SHRINK);
pack_start (seg_1_, Gtk::PACK_SHRINK);
pack_start (seg_2_, Gtk::PACK_SHRINK);
// define the action triggers...
trig_1_.signal_clicked().connect(
@ -266,6 +277,67 @@ namespace dialog {
};
/**
* Ticket #1014 : populate the Timeline in the GUI.
* This page allows to send various diff messages up into the UI, to provide timeline content.
*/
struct Page2 : Page
{
Gtk::Entry dummy_;
FrameBox part_1_{_("populate"), Gtk::ORIENTATION_HORIZONTAL},
part_2_{_("modify content")};
Gtk::Button seq_1_, seq_2_;
Gtk::Button mut_1_;
string
getDummyID()
{
string dummyID = sanitise (dummy_.get_text());
dummy_.set_text (dummyID);
return dummyID;
}
Page2 (Bus bus)
{
seq_1_.set_label ("Sequence 1");
seq_1_.set_tooltip_markup (_("Push <b>population diff</b> up into the UI\n"
"provides the typical simple default timeline structure"));
seq_2_.set_label ("Sequence 2");
seq_2_.set_tooltip_markup (_("Push <b>population diff</b> up into the UI\n"
"provides a complex nested timeline structure"));
dummy_.set_tooltip_markup (_("<i>dummy ID value</i>\n"
"used to build names in the generated content"));
dummy_.set_text (string{_Fmt{"d%s%02d"} % lib::test::randStr(2) % (1 + rand() % 99)});
dummy_.set_max_width_chars(12);
part_1_.pack_start (seq_1_, Gtk::PACK_SHRINK);
part_1_.pack_start (seq_2_, Gtk::PACK_SHRINK);
part_1_.pack_start (dummy_, Gtk::PACK_EXPAND_WIDGET);
mut_1_.set_label ("move elements");
mut_1_.set_tooltip_markup (_("randomly manipulate temporal position of dummy elements"));
part_2_.pack_start (mut_1_);
pack_start (part_1_, Gtk::PACK_SHRINK);
pack_start (part_2_, Gtk::PACK_SHRINK);
// define the action triggers...
seq_1_.signal_clicked().connect(
[&]{ bus.act (model::commandMessage (proc::cmd::test_fake_injectSequence_1, getDummyID())); });
seq_2_.signal_clicked().connect(
[&]{ bus.act (model::commandMessage (proc::cmd::test_fake_injectSequence_2, getDummyID())); });
mut_1_.signal_clicked().connect(
[&]{ cerr << "gelldaschaugst..." <<endl; });
}
};
public:
TestControl (ctrl::BusTerm& upLink, Gtk::Window& parent)
@ -278,6 +350,8 @@ namespace dialog {
// construct and wire the pages...
notebook_.buildPage<Page1> (_("#1099"), uiBus_);
notebook_.buildPage<Page2> (_("Populate"), uiBus_);
notebook_.set_current_page(-1);
show_all();
}

View file

@ -5244,16 +5244,19 @@
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539525762357" ID="ID_401544840" MODIFIED="1539525773037" TEXT="Infrastruktur">
<icon BUILTIN="pencil"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539525774683" ID="ID_800878475" MODIFIED="1539525784706" TEXT="neuer Tab im TestControl">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1539525774683" ID="ID_800878475" MODIFIED="1539554116052" TEXT="neuer Tab im TestControl">
<icon BUILTIN="button_ok"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539525811238" ID="ID_257363214" MODIFIED="1539525816334" TEXT="Buttons / Commands">
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539525817565" ID="ID_609053758" MODIFIED="1539525932334" TEXT="Sequence-1">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1539525817565" ID="ID_609053758" MODIFIED="1539554120981" TEXT="Sequence-1">
<icon BUILTIN="button_ok"/>
<node CREATED="1539525949443" ID="ID_1576521954" MODIFIED="1539525960551" STYLE="fork" TEXT="einfacher Standardfall">
<icon BUILTIN="info"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539554145649" ID="ID_1360223401" MODIFIED="1539554160367" TEXT="Diff anlegen">
<icon BUILTIN="flag-yellow"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539525933590" ID="ID_1481796996" MODIFIED="1539525937141" TEXT="Sequence-2">
<icon BUILTIN="flag-yellow"/>