Skip to content
Snippets Groups Projects
Commit 94f607c3 authored by Owen Arnold's avatar Owen Arnold
Browse files

Merge remote-tracking branch 'origin/feature/7120_repo_folder_visible'

parents 675b0284 af886366
No related merge requests found
......@@ -87,6 +87,7 @@ namespace API
void updateModel();
void currentChanged ( const QModelIndex & current );
void helpClicked();
void openFolderLink(QString);
private:
......
......@@ -6,57 +6,96 @@
<rect>
<x>0</x>
<y>0</y>
<width>616</width>
<width>630</width>
<height>505</height>
</rect>
</property>
<property name="windowTitle">
<string>Script Repository</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Mantid Scripts Repository</string>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="MantidQt::API::RepoTreeView" name="repo_treeView"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="desc_label">
<widget class="QLabel" name="label">
<property name="text">
<string>Description</string>
<string>Mantid Scripts Repository</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>228</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="authorNameLabel">
<widget class="QLabel" name="folderPathLabel">
<property name="text">
<string>AuthorName</string>
<string>folder</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextBrowser" name="desc_textBrowser"/>
</item>
<item>
<widget class="MantidQt::API::RepoTreeView" name="repo_treeView"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="desc_label">
<property name="text">
<string>Description</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>228</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="authorNameLabel">
<property name="text">
<string>AuthorName</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextBrowser" name="desc_textBrowser"/>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,10">
......
......@@ -141,6 +141,20 @@ Mantid::Kernel::Logger & ScriptRepositoryView::g_log = Mantid::Kernel::Logger::g
this, SLOT(cell_activated(const QModelIndex&)));
connect(ui->repo_treeView, SIGNAL(currentCell(const QModelIndex&)),
this, SLOT(currentChanged(const QModelIndex&)));
ConfigServiceImpl & config = ConfigService::Instance();
QString loc = QString::fromStdString(config.getString("ScriptLocalRepository"));
QString loc_info = "<html><head/><body><p><a href=\"file://%1\"><span style=\" text-decoration: underline; color:#0000ff;\">%2</span></a></p></body></html>";
QString path_label;
if (loc.size()<50)
path_label = loc;
else{
path_label = QString("%1...%2").arg(loc.left(20)).arg(loc.right(27));
}
ui->folderPathLabel->setText(loc_info.arg(loc).arg(path_label));
ui->folderPathLabel->setToolTip(QString("Click here to open Script Repository Folder: %1.").arg(loc));
connect(ui->folderPathLabel, SIGNAL(linkActivated(QString)),this,SLOT(openFolderLink(QString)));
}
/** This method refreshes the ScriptRepository and allows it
......@@ -406,5 +420,9 @@ void ScriptRepositoryView::helpClicked(){
QDesktopServices::openUrl(QUrl("http://www.mantidproject.org/ScriptRepository"));
}
void ScriptRepositoryView::openFolderLink(QString link){
QDesktopServices::openUrl(QUrl(link));
}
} // namespace API
} // namespace Mantid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment