-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add module select widget, add it to launch config dialog
- Loading branch information
Showing
11 changed files
with
107 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "moduleselectwidget.hpp" | ||
|
||
#include "moduleselectiondialog.hpp" | ||
|
||
ModuleSelectWidget::ModuleSelectWidget(chi::Context& ctx) | ||
{ | ||
connect(this, &QPushButton::clicked, this, [this, &ctx](bool) { | ||
|
||
auto modName = ModuleSelectionDialog::getModule(this, ctx); | ||
|
||
if (modName.empty()) { | ||
return; | ||
} | ||
|
||
setModule(modName); | ||
|
||
}); | ||
|
||
setIcon(QIcon::fromTheme(QStringLiteral("package-available"))); | ||
} | ||
|
||
void ModuleSelectWidget::setModule(const boost::filesystem::path& newModule) | ||
{ | ||
setText(QString::fromStdString(newModule.string())); | ||
|
||
emit moduleChanged(newModule); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#ifndef CHIGRAPHGUI_MODULE_SELECT_WIDGET_HPP | ||
#define CHIGRAPHGUI_MODULE_SELECT_WIDGET_HPP | ||
|
||
#include <QPushButton> | ||
|
||
#include <chi/Fwd.hpp> | ||
|
||
#include <boost/filesystem/path.hpp> | ||
|
||
class ModuleSelectWidget : public QPushButton { | ||
Q_OBJECT | ||
public: | ||
|
||
ModuleSelectWidget(chi::Context& ctx); | ||
|
||
void setModule(const boost::filesystem::path& newModule); | ||
|
||
signals: | ||
void moduleChanged(const boost::filesystem::path& moduleName); | ||
}; | ||
|
||
#endif // CHIGRAPHGUI_MODULE_SELECT_WIDGET_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters