mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 07:36:16 +00:00
Changed: Open directory containing the profile
This commit is contained in:
parent
da8b49bd76
commit
ca0d73fcf4
2 changed files with 26 additions and 1 deletions
|
@ -32,6 +32,7 @@ CProfilesDialog::CProfilesDialog(QWidget *parent):QDialog(parent), m_currentProf
|
|||
connect(deleteButton, SIGNAL(clicked()), SLOT(onDeleteProfile()));
|
||||
connect(profilesListView, SIGNAL(clicked(QModelIndex)), SLOT(onProfileClicked(QModelIndex)));
|
||||
connect(executableBrowseButton, SIGNAL(clicked()), SLOT(onExecutableBrowseClicked()));
|
||||
connect(directoryButton, SIGNAL(clicked()), SLOT(onProfileDirectoryClicked()));
|
||||
|
||||
m_model = new CProfilesModel(this);
|
||||
m_serversModel = new CServersModel(this);
|
||||
|
@ -97,6 +98,15 @@ void CProfilesDialog::displayProfile(int index)
|
|||
|
||||
const CProfile &profile = m_model->getProfiles()[index];
|
||||
|
||||
QString executable = profile.executable;
|
||||
|
||||
if (executable.isEmpty())
|
||||
{
|
||||
executable = CConfigFile::getInstance()->getServerClientFullPath(profile.server);
|
||||
}
|
||||
|
||||
QString profileDirectory = CConfigFile::getInstance()->getProfileDirectory() + "/" + profile.id;
|
||||
|
||||
// update all widgets with content of profile
|
||||
profileIdLabel->setText(profile.id);
|
||||
nameEdit->setText(profile.name);
|
||||
|
@ -104,10 +114,13 @@ void CProfilesDialog::displayProfile(int index)
|
|||
executablePathLabel->setText(QFileInfo(profile.executable).fileName());
|
||||
argumentsEdit->setText(profile.arguments);
|
||||
commentsEdit->setPlainText(profile.comments);
|
||||
directoryPathLabel->setText(CConfigFile::getInstance()->getProfileDirectory());
|
||||
directoryPathLabel->setText(profileDirectory);
|
||||
desktopShortcutCheckBox->setChecked(profile.desktopShortcut);
|
||||
menuShortcutCheckBox->setChecked(profile.menuShortcut);
|
||||
|
||||
// disable click on button if directory doesn't exist
|
||||
directoryButton->setEnabled(QFile::exists(profileDirectory));
|
||||
|
||||
updateExecutableVersion(index);
|
||||
|
||||
m_currentProfileIndex = index;
|
||||
|
@ -249,3 +262,14 @@ void CProfilesDialog::onExecutableBrowseClicked()
|
|||
|
||||
updateExecutableVersion(m_currentProfileIndex);
|
||||
}
|
||||
|
||||
void CProfilesDialog::onProfileDirectoryClicked()
|
||||
{
|
||||
if (m_currentProfileIndex < 0) return;
|
||||
|
||||
const CProfile &profile = m_model->getProfiles()[m_currentProfileIndex];
|
||||
|
||||
QString profileDirectory = CConfigFile::getInstance()->getProfileDirectory() + "/" + profile.id;
|
||||
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(profileDirectory));
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ private slots:
|
|||
void onAddProfile();
|
||||
void onDeleteProfile();
|
||||
void onProfileClicked(const QModelIndex &index);
|
||||
void onProfileDirectoryClicked();
|
||||
|
||||
void displayProfile(int index);
|
||||
void saveProfile(int index);
|
||||
|
|
Loading…
Reference in a new issue