-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1562 from ghutchis/conda-environments
Add support for first launch dialog and conda environments
- Loading branch information
Showing
8 changed files
with
398 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/****************************************************************************** | ||
This source file is part of the Avogadro project. | ||
This source code is released under the 3-Clause BSD License, (see "LICENSE"). | ||
******************************************************************************/ | ||
|
||
#include "condadialog.h" | ||
#include "ui_condadialog.h" | ||
|
||
namespace Avogadro::QtPlugins { | ||
|
||
CondaDialog::CondaDialog(QWidget* aParent) | ||
: QDialog(aParent), m_ui(new Ui::CondaDialog) | ||
{ | ||
m_ui->setupUi(this); | ||
} | ||
|
||
CondaDialog::~CondaDialog() | ||
{ | ||
delete m_ui; | ||
} | ||
|
||
QString CondaDialog::environmentName() const | ||
{ | ||
return m_ui->environmentName->text(); | ||
} | ||
|
||
} // namespace Avogadro::QtPlugins |
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,38 @@ | ||
/****************************************************************************** | ||
This source file is part of the Avogadro project. | ||
This source code is released under the 3-Clause BSD License, (see "LICENSE"). | ||
******************************************************************************/ | ||
|
||
#ifndef AVOGADRO_QTPLUGINS_CONDADIALOG_H | ||
#define AVOGADRO_QTPLUGINS_CONDADIALOG_H | ||
|
||
#include <QtWidgets/QDialog> | ||
|
||
namespace Avogadro { | ||
namespace QtPlugins { | ||
|
||
namespace Ui { | ||
class CondaDialog; | ||
} | ||
|
||
/** | ||
* @brief Dialog to prompt a format and descriptor string. | ||
*/ | ||
class CondaDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit CondaDialog(QWidget* parent = nullptr); | ||
~CondaDialog() override; | ||
|
||
QString environmentName() const; | ||
|
||
private: | ||
Ui::CondaDialog* m_ui; | ||
}; | ||
|
||
} // namespace QtPlugins | ||
} // namespace Avogadro | ||
|
||
#endif // AVOGADRO_QTPLUGINS_CONDADIALOG_H |
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,111 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Avogadro::QtPlugins::CondaDialog</class> | ||
<widget class="QDialog" name="Avogadro::QtPlugins::CondaDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>376</width> | ||
<height>169</height> | ||
</rect> | ||
</property> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Python Settings…</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<item> | ||
<widget class="QLabel" name="textLabel"> | ||
<property name="text"> | ||
<string>Only the “base” conda environment exists. | ||
Would you like to create a new environment for Avogadro? | ||
This will make a copy of your base environment. | ||
</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>Environment name:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLineEdit" name="environmentName"> | ||
<property name="placeholderText"> | ||
<string>avogadro</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>0</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>accepted()</signal> | ||
<receiver>Avogadro::QtPlugins::CondaDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>187</x> | ||
<y>148</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>187</x> | ||
<y>84</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>Avogadro::QtPlugins::CondaDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>187</x> | ||
<y>148</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>187</x> | ||
<y>84</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
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
Oops, something went wrong.