Skip to content

Commit

Permalink
Templates: add description for Online Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
octaeder committed Feb 11, 2024
1 parent 739e4ee commit d544b8d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/templateselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ void TemplateSelector::addResource(AbstractTemplateResource *res)
void TemplateSelector::addOnlineRepository()
{
QTreeWidgetItem *topitem = new QTreeWidgetItem(QStringList() << tr("Online Repository"));
//topitem->setIcon(0, res->icon());
QFont ft = topitem->font(0);
ft.setBold(true);
topitem->setFont(0, ft);
topitem->setData(0, ResourceRole, tr("Online available templates"));
topitem->setData(0, UrlRole, QString("https://api.github.com/repos/texstudio-org/texstudio-template/contents"));
topitem->setData(0, PathRole, QString(""));
ui.templatesTree->addTopLevelItem(topitem);
Expand Down Expand Up @@ -505,6 +505,16 @@ void TemplateSelector::showInfo(QTreeWidgetItem *currentItem, QTreeWidgetItem *p
QString path=currentItem->data(0,PathRole).toString();
QString url=currentItem->data(0,UrlRole).toString();
QString downloadUrl=currentItem->data(0,DownloadRole).toString();
if (currentItem->data(0,ResourceRole).isValid()) {
QString topDescription = currentItem->data(0,ResourceRole).toString();
ui.lbName->setText(currentItem->text(0));
ui.lbDescription->setText(topDescription);
ui.lbAuthor->setText("");
ui.lbDate->setText("");
ui.lbVersion->setText("");
ui.lbLicense->setText("");
ui.lbAuthorTag->setVisible(false);
}
if(!downloadUrl.isEmpty()){
makeRequest(downloadUrl,path,currentItem,true);
}
Expand Down

0 comments on commit d544b8d

Please sign in to comment.