1 #include <QtGui/QApplication>
2 #include <QtCore/QList>
10 #include "NodeListDialog.h"
11 #include "vlp/config.h"
21 void QInstall::on_actionConfigure_triggered()
23 dialog::NodeListDialog dialog(nodes, this);
26 nodes = dialog.getNodes();
28 if (!nodes.isEmpty()) {
34 QListIterator<VLPEntry *> nodesIterator(nodes);
36 while (nodesIterator.hasNext()) {
37 pom = nodesIterator.next();
38 i = nodes.indexOf(pom);
39 sprintf(pomstr, "%s.cfg", pom->addr);
42 loglan::vlp::Config config;
44 config.setProgramDir(pom->progdir);
45 config.setNodeNumber(pom->ID);
46 config.setConnectionType(
47 (pom->type == 0) ? EXPLICIT : REGISTER
50 std::vector<std::string> hosts;
51 for (auto node : nodes) {
53 hosts.push_back(node->addr);
56 config.setHosts(hosts);
60 // TODO: add handling of homedir or remove it at all
61 // setting = config_setting_get_member(root, "homedir");
63 // setting = config_setting_add(root, "homedir", CONFIG_TYPE_STRING);
65 // config_setting_set_string(setting, pom->homedir);
75 void QInstall::on_actionQuit_triggered()
77 QApplication::instance()->quit();
84 int main(int argc, char **argv)
86 QApplication *app = new QApplication(argc,argv);
87 loglan::vlp::QInstall cfg;