Merge branch 'feature_mcmod_info' into develop
This commit is contained in:
commit
36edf6cbc6
@ -215,6 +215,8 @@ gui/LabeledToolButton.h
|
|||||||
gui/LabeledToolButton.cpp
|
gui/LabeledToolButton.cpp
|
||||||
gui/EditNotesDialog.h
|
gui/EditNotesDialog.h
|
||||||
gui/EditNotesDialog.cpp
|
gui/EditNotesDialog.cpp
|
||||||
|
gui/MCModInfoFrame.h
|
||||||
|
gui/MCModInfoFrame.cpp
|
||||||
|
|
||||||
# Base classes and infrastructure
|
# Base classes and infrastructure
|
||||||
logic/BaseVersion.h
|
logic/BaseVersion.h
|
||||||
@ -334,6 +336,8 @@ gui/IconPickerDialog.ui
|
|||||||
gui/LegacyModEditDialog.ui
|
gui/LegacyModEditDialog.ui
|
||||||
gui/OneSixModEditDialog.ui
|
gui/OneSixModEditDialog.ui
|
||||||
gui/EditNotesDialog.ui
|
gui/EditNotesDialog.ui
|
||||||
|
|
||||||
|
gui/MCModInfoFrame.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
set (FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${MULTIMC_SOURCES} ${MULTIMC_UIS})
|
set (FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${MULTIMC_SOURCES} ${MULTIMC_UIS})
|
||||||
|
@ -345,34 +345,41 @@ void LegacyModEditDialog::on_buttonBox_rejected()
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: too much copypasta makes peterix a sad hacker. BUT IT'S SO DELICIOUS!
|
void LegacyModEditDialog::on_jarModsTreeView_pressed(const QModelIndex &index)
|
||||||
|
|
||||||
void LegacyModEditDialog::on_coreWebsite_clicked()
|
|
||||||
{
|
|
||||||
int first, last;
|
|
||||||
auto list = ui->coreModsTreeView->selectionModel()->selectedRows();
|
|
||||||
|
|
||||||
if (!lastfirst(list, first, last))
|
|
||||||
return;
|
|
||||||
showWebsiteForMod(this, m_coremods->operator[](first));
|
|
||||||
}
|
|
||||||
|
|
||||||
void LegacyModEditDialog::on_jarWebsite_clicked()
|
|
||||||
{
|
{
|
||||||
int first, last;
|
int first, last;
|
||||||
auto list = ui->jarModsTreeView->selectionModel()->selectedRows();
|
auto list = ui->jarModsTreeView->selectionModel()->selectedRows();
|
||||||
|
|
||||||
if (!lastfirst(list, first, last))
|
if (!lastfirst(list, first, last))
|
||||||
return;
|
return;
|
||||||
showWebsiteForMod(this, m_jarmods->operator[](first));
|
|
||||||
|
Mod &m = m_jarmods->operator[](first);
|
||||||
|
|
||||||
|
handleModInfoUpdate(m, ui->jarMIFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LegacyModEditDialog::on_loaderWebsite_clicked()
|
void LegacyModEditDialog::on_coreModsTreeView_pressed(const QModelIndex &index)
|
||||||
|
{
|
||||||
|
int first, last;
|
||||||
|
auto list = ui->coreModsTreeView->selectionModel()->selectedRows();
|
||||||
|
|
||||||
|
if (!lastfirst(list, first, last))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Mod &m = m_coremods->operator[](first);
|
||||||
|
|
||||||
|
handleModInfoUpdate(m, ui->coreMIFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LegacyModEditDialog::on_loaderModTreeView_pressed(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
int first, last;
|
int first, last;
|
||||||
auto list = ui->loaderModTreeView->selectionModel()->selectedRows();
|
auto list = ui->loaderModTreeView->selectionModel()->selectedRows();
|
||||||
|
|
||||||
if (!lastfirst(list, first, last))
|
if (!lastfirst(list, first, last))
|
||||||
return;
|
return;
|
||||||
showWebsiteForMod(this, m_mods->operator[](first));
|
|
||||||
|
Mod &m = m_mods->operator[](first);
|
||||||
|
|
||||||
|
handleModInfoUpdate(m, ui->loaderMIFrame);
|
||||||
}
|
}
|
||||||
|
@ -53,13 +53,13 @@ slots:
|
|||||||
void on_rmTexPackBtn_clicked();
|
void on_rmTexPackBtn_clicked();
|
||||||
void on_viewTexPackBtn_clicked();
|
void on_viewTexPackBtn_clicked();
|
||||||
|
|
||||||
void on_jarWebsite_clicked();
|
|
||||||
void on_loaderWebsite_clicked();
|
|
||||||
void on_coreWebsite_clicked();
|
|
||||||
|
|
||||||
// Questionable: SettingsDialog doesn't need this for some reason?
|
// Questionable: SettingsDialog doesn't need this for some reason?
|
||||||
void on_buttonBox_rejected();
|
void on_buttonBox_rejected();
|
||||||
|
|
||||||
|
void on_jarModsTreeView_pressed(const QModelIndex &index);
|
||||||
|
void on_coreModsTreeView_pressed(const QModelIndex &index);
|
||||||
|
void on_loaderModTreeView_pressed(const QModelIndex &index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
bool jarListFilter(QKeyEvent *ev);
|
bool jarListFilter(QKeyEvent *ev);
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Jar Mods</string>
|
<string>Jar Mods</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="ModListView" name="jarModsTreeView">
|
<widget class="ModListView" name="jarModsTreeView">
|
||||||
@ -57,13 +59,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="jarWebsite">
|
|
||||||
<property name="text">
|
|
||||||
<string>Website</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="jarModsButtonSpacer">
|
<spacer name="jarModsButtonSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -94,11 +89,25 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="MCModInfoFrame" name="jarMIFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="coreTab">
|
<widget class="QWidget" name="coreTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Core Mods</string>
|
<string>Core Mods</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="ModListView" name="coreModsTreeView">
|
<widget class="ModListView" name="coreModsTreeView">
|
||||||
@ -123,13 +132,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="coreWebsite">
|
|
||||||
<property name="text">
|
|
||||||
<string>Website</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="coreModsButtonSpacer">
|
<spacer name="coreModsButtonSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -153,11 +155,25 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="MCModInfoFrame" name="coreMIFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="modTab">
|
<widget class="QWidget" name="modTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Loader Mods</string>
|
<string>Loader Mods</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="ModListView" name="loaderModTreeView">
|
<widget class="ModListView" name="loaderModTreeView">
|
||||||
@ -185,13 +201,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="loaderWebsite">
|
|
||||||
<property name="text">
|
|
||||||
<string>Website</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="mlModsButtonSpacer">
|
<spacer name="mlModsButtonSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -215,6 +224,18 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="MCModInfoFrame" name="loaderMIFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="texPackTab">
|
<widget class="QWidget" name="texPackTab">
|
||||||
<property name="acceptDrops">
|
<property name="acceptDrops">
|
||||||
@ -291,6 +312,12 @@
|
|||||||
<extends>QTreeView</extends>
|
<extends>QTreeView</extends>
|
||||||
<header>gui/ModListView.h</header>
|
<header>gui/ModListView.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>MCModInfoFrame</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>gui/MCModInfoFrame.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
92
gui/MCModInfoFrame.cpp
Normal file
92
gui/MCModInfoFrame.cpp
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/* Copyright 2013 MultiMC Contributors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "MCModInfoFrame.h"
|
||||||
|
#include "ui_MCModInfoFrame.h"
|
||||||
|
|
||||||
|
void handleModInfoUpdate(Mod &m, MCModInfoFrame *frame)
|
||||||
|
{
|
||||||
|
if(m.type() == m.MOD_FOLDER)
|
||||||
|
{
|
||||||
|
frame->setName("<p><span style=\" font-size:9pt; font-weight:600; font-style:italic;\">Select a mod to view information...</span></p>");
|
||||||
|
frame->setDescription("<p><span style=\" font-style:italic;\">Mod description</span></p>");
|
||||||
|
frame->setAuthors("<p><span style=\" font-style:italic; color:#4a4a4a;\">Mod authors</span></p>");
|
||||||
|
frame->setCredits("<p><span style=\" font-style:italic; color:#4a4a4a;\">Mod credits</span></p>");
|
||||||
|
frame->setWebsite("<p><span style=\" font-style:italic; color:#4a4a4a;\">Mod website</span></p>");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString missing = "<p><span style=\" font-style:italic; color:#4a4a4a;\">Missing from mcmod.info</span></p>";
|
||||||
|
|
||||||
|
QString name = m.name();
|
||||||
|
if(name.isEmpty()) name = missing;
|
||||||
|
QString description = m.description();
|
||||||
|
if(description.isEmpty()) description = missing;
|
||||||
|
QString authors = m.authors();
|
||||||
|
if(authors.isEmpty()) authors = missing;
|
||||||
|
QString credits = m.credits();
|
||||||
|
if(credits.isEmpty()) credits = missing;
|
||||||
|
QString website = m.homeurl();
|
||||||
|
if(website.isEmpty()) website = missing;
|
||||||
|
else website = "<a href=\"" + website + "\">" + website + "</a>";
|
||||||
|
|
||||||
|
frame->setName("<p><span style=\" font-size:9pt; font-weight:600;\">" + name + "</span></p>");
|
||||||
|
frame->setDescription(description);
|
||||||
|
frame->setAuthors(authors);
|
||||||
|
frame->setCredits(credits);
|
||||||
|
frame->setWebsite(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
MCModInfoFrame::MCModInfoFrame(QWidget *parent) :
|
||||||
|
QFrame(parent),
|
||||||
|
ui(new Ui::MCModInfoFrame)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
MCModInfoFrame::~MCModInfoFrame()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MCModInfoFrame::setName(QString name)
|
||||||
|
{
|
||||||
|
ui->label_Name->setText(name);
|
||||||
|
ui->label_Name->setToolTip(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MCModInfoFrame::setDescription(QString description)
|
||||||
|
{
|
||||||
|
ui->label_Description->setText(description);
|
||||||
|
ui->label_Description->setToolTip(description);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MCModInfoFrame::setAuthors(QString authors)
|
||||||
|
{
|
||||||
|
ui->label_Authors->setText(authors);
|
||||||
|
ui->label_Authors->setToolTip(authors);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MCModInfoFrame::setCredits(QString credits)
|
||||||
|
{
|
||||||
|
ui->label_Credits->setText(credits);
|
||||||
|
ui->label_Credits->setToolTip(credits);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MCModInfoFrame::setWebsite(QString website)
|
||||||
|
{
|
||||||
|
ui->label_Website->setText(website);
|
||||||
|
}
|
44
gui/MCModInfoFrame.h
Normal file
44
gui/MCModInfoFrame.h
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/* Copyright 2013 MultiMC Contributors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QFrame>
|
||||||
|
#include "logic/Mod.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class MCModInfoFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
class MCModInfoFrame : public QFrame
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MCModInfoFrame(QWidget *parent = 0);
|
||||||
|
~MCModInfoFrame();
|
||||||
|
|
||||||
|
void setName(QString name);
|
||||||
|
void setDescription(QString description);
|
||||||
|
void setAuthors(QString authors);
|
||||||
|
void setCredits(QString credits);
|
||||||
|
void setWebsite(QString website);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::MCModInfoFrame *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
void handleModInfoUpdate(Mod &m, MCModInfoFrame *frame);
|
261
gui/MCModInfoFrame.ui
Normal file
261
gui/MCModInfoFrame.ui
Normal file
@ -0,0 +1,261 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MCModInfoFrame</class>
|
||||||
|
<widget class="QFrame" name="MCModInfoFrame">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>571</width>
|
||||||
|
<height>55</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Frame</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>250</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_Name">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>250</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>92</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-size:9pt; font-weight:600; font-style:italic;">Select a mod to view information...</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_Description">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>250</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>92</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-style:italic;">Mod description</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
|
</property>
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
<property name="labelAlignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Authors:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_Authors">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>92</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-style:italic; color:#4a4a4a;">Mod authors</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Website:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="label_Website">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>92</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-style:italic; color:#4a4a4a;">Mod website</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="label_Credits">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>92</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-style:italic; color:#4a4a4a;">Mod credits</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Credits:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -9,4 +9,5 @@ class ModListView: public QTreeView
|
|||||||
public:
|
public:
|
||||||
explicit ModListView ( QWidget* parent = 0 );
|
explicit ModListView ( QWidget* parent = 0 );
|
||||||
virtual void setModel ( QAbstractItemModel* model );
|
virtual void setModel ( QAbstractItemModel* model );
|
||||||
|
|
||||||
};
|
};
|
@ -298,12 +298,15 @@ void OneSixModEditDialog::on_viewResPackBtn_clicked()
|
|||||||
openDirInDefaultProgram(m_inst->resourcePacksDir(), true);
|
openDirInDefaultProgram(m_inst->resourcePacksDir(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OneSixModEditDialog::on_loaderWebsite_clicked()
|
void OneSixModEditDialog::on_loaderModTreeView_pressed(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
int first, last;
|
int first, last;
|
||||||
auto list = ui->loaderModTreeView->selectionModel()->selectedRows();
|
auto list = ui->loaderModTreeView->selectionModel()->selectedRows();
|
||||||
|
|
||||||
if (!lastfirst(list, first, last))
|
if (!lastfirst(list, first, last))
|
||||||
return;
|
return;
|
||||||
showWebsiteForMod(this, m_mods->operator[](first));
|
|
||||||
|
Mod &m = m_mods->operator[](first);
|
||||||
|
|
||||||
|
handleModInfoUpdate(m, ui->frame);
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,11 @@ private slots:
|
|||||||
void on_forgeBtn_clicked();
|
void on_forgeBtn_clicked();
|
||||||
void on_customizeBtn_clicked();
|
void on_customizeBtn_clicked();
|
||||||
void on_revertBtn_clicked();
|
void on_revertBtn_clicked();
|
||||||
void on_loaderWebsite_clicked();
|
|
||||||
void updateVersionControls();
|
void updateVersionControls();
|
||||||
void disableVersionControls();
|
void disableVersionControls();
|
||||||
|
|
||||||
|
void on_loaderModTreeView_pressed(const QModelIndex &index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
bool loaderListFilter( QKeyEvent* ev );
|
bool loaderListFilter( QKeyEvent* ev );
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="libTab">
|
<widget class="QWidget" name="libTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -157,9 +157,19 @@
|
|||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Loader Mods</string>
|
<string>Loader Mods</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="ModListView" name="loaderModTreeView">
|
<widget class="ModListView" name="loaderModTreeView">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="acceptDrops">
|
<property name="acceptDrops">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -168,6 +178,8 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
@ -184,13 +196,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="loaderWebsite">
|
|
||||||
<property name="text">
|
|
||||||
<string>Website</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -214,6 +219,18 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="MCModInfoFrame" name="frame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="resPackTab">
|
<widget class="QWidget" name="resPackTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -290,6 +307,12 @@
|
|||||||
<extends>QTreeView</extends>
|
<extends>QTreeView</extends>
|
||||||
<header>gui/ModListView.h</header>
|
<header>gui/ModListView.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>MCModInfoFrame</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>gui/MCModInfoFrame.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
@ -119,6 +119,18 @@ void Mod::ReadMCModInfo(QByteArray contents)
|
|||||||
m_name = firstObj.value("name").toString();
|
m_name = firstObj.value("name").toString();
|
||||||
m_version = firstObj.value("version").toString();
|
m_version = firstObj.value("version").toString();
|
||||||
m_homeurl = firstObj.value("url").toString();
|
m_homeurl = firstObj.value("url").toString();
|
||||||
|
m_description = firstObj.value("description").toString();
|
||||||
|
QJsonArray authors = firstObj.value("authors").toArray();
|
||||||
|
if(authors.size() == 0) m_authors = "";
|
||||||
|
else if(authors.size() >= 1)
|
||||||
|
{
|
||||||
|
m_authors = authors.at(0).toString();
|
||||||
|
for(int i = 1; i < authors.size(); i++)
|
||||||
|
{
|
||||||
|
m_authors += ", " + authors.at(i).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_credits = firstObj.value("credits").toString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
18
logic/Mod.h
18
logic/Mod.h
@ -63,6 +63,21 @@ public:
|
|||||||
return m_homeurl;
|
return m_homeurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString description() const
|
||||||
|
{
|
||||||
|
return m_description;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString authors() const
|
||||||
|
{
|
||||||
|
return m_authors;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString credits() const
|
||||||
|
{
|
||||||
|
return m_credits;
|
||||||
|
}
|
||||||
|
|
||||||
// delete all the files of this mod
|
// delete all the files of this mod
|
||||||
bool destroy();
|
bool destroy();
|
||||||
// replace this mod with a copy of the other
|
// replace this mod with a copy of the other
|
||||||
@ -99,6 +114,9 @@ protected:
|
|||||||
QString m_version;
|
QString m_version;
|
||||||
QString m_mcversion;
|
QString m_mcversion;
|
||||||
QString m_homeurl;
|
QString m_homeurl;
|
||||||
|
QString m_description;
|
||||||
|
QString m_authors;
|
||||||
|
QString m_credits;
|
||||||
|
|
||||||
ModType m_type;
|
ModType m_type;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user