remove: unused files
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
ca258109c5
commit
fe0c52ff78
9 changed files with 0 additions and 411 deletions
|
@ -1106,8 +1106,6 @@ SET(LAUNCHER_SOURCES
|
||||||
ui/widgets/CustomCommands.h
|
ui/widgets/CustomCommands.h
|
||||||
ui/widgets/EnvironmentVariables.cpp
|
ui/widgets/EnvironmentVariables.cpp
|
||||||
ui/widgets/EnvironmentVariables.h
|
ui/widgets/EnvironmentVariables.h
|
||||||
ui/widgets/FocusLineEdit.cpp
|
|
||||||
ui/widgets/FocusLineEdit.h
|
|
||||||
ui/widgets/IconLabel.cpp
|
ui/widgets/IconLabel.cpp
|
||||||
ui/widgets/IconLabel.h
|
ui/widgets/IconLabel.h
|
||||||
ui/widgets/JavaWizardWidget.cpp
|
ui/widgets/JavaWizardWidget.cpp
|
||||||
|
@ -1116,8 +1114,6 @@ SET(LAUNCHER_SOURCES
|
||||||
ui/widgets/LabeledToolButton.h
|
ui/widgets/LabeledToolButton.h
|
||||||
ui/widgets/LanguageSelectionWidget.cpp
|
ui/widgets/LanguageSelectionWidget.cpp
|
||||||
ui/widgets/LanguageSelectionWidget.h
|
ui/widgets/LanguageSelectionWidget.h
|
||||||
ui/widgets/LineSeparator.cpp
|
|
||||||
ui/widgets/LineSeparator.h
|
|
||||||
ui/widgets/LogView.cpp
|
ui/widgets/LogView.cpp
|
||||||
ui/widgets/LogView.h
|
ui/widgets/LogView.h
|
||||||
ui/widgets/InfoFrame.cpp
|
ui/widgets/InfoFrame.cpp
|
||||||
|
@ -1216,7 +1212,6 @@ qt_wrap_ui(LAUNCHER_UI
|
||||||
ui/pages/modplatform/OptionalModDialog.ui
|
ui/pages/modplatform/OptionalModDialog.ui
|
||||||
ui/pages/modplatform/modrinth/ModrinthPage.ui
|
ui/pages/modplatform/modrinth/ModrinthPage.ui
|
||||||
ui/pages/modplatform/technic/TechnicPage.ui
|
ui/pages/modplatform/technic/TechnicPage.ui
|
||||||
ui/widgets/InstanceCardWidget.ui
|
|
||||||
ui/widgets/CustomCommands.ui
|
ui/widgets/CustomCommands.ui
|
||||||
ui/widgets/EnvironmentVariables.ui
|
ui/widgets/EnvironmentVariables.ui
|
||||||
ui/widgets/InfoFrame.ui
|
ui/widgets/InfoFrame.ui
|
||||||
|
|
|
@ -1,116 +0,0 @@
|
||||||
/* Copyright 2013-2021 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 <QMessageBox>
|
|
||||||
#include <QtGui>
|
|
||||||
|
|
||||||
#include "ErrorFrame.h"
|
|
||||||
#include "ui_ErrorFrame.h"
|
|
||||||
|
|
||||||
#include "ui/dialogs/CustomMessageBox.h"
|
|
||||||
|
|
||||||
void ErrorFrame::clear()
|
|
||||||
{
|
|
||||||
setTitle(QString());
|
|
||||||
setDescription(QString());
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorFrame::ErrorFrame(QWidget* parent) : QFrame(parent), ui(new Ui::ErrorFrame)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->label_Description->setHidden(true);
|
|
||||||
ui->label_Title->setHidden(true);
|
|
||||||
updateHiddenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorFrame::~ErrorFrame()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ErrorFrame::updateHiddenState()
|
|
||||||
{
|
|
||||||
if (ui->label_Description->isHidden() && ui->label_Title->isHidden()) {
|
|
||||||
setHidden(true);
|
|
||||||
} else {
|
|
||||||
setHidden(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ErrorFrame::setTitle(QString text)
|
|
||||||
{
|
|
||||||
if (text.isEmpty()) {
|
|
||||||
ui->label_Title->setHidden(true);
|
|
||||||
} else {
|
|
||||||
ui->label_Title->setText(text);
|
|
||||||
ui->label_Title->setHidden(false);
|
|
||||||
}
|
|
||||||
updateHiddenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ErrorFrame::setDescription(QString text)
|
|
||||||
{
|
|
||||||
if (text.isEmpty()) {
|
|
||||||
ui->label_Description->setHidden(true);
|
|
||||||
updateHiddenState();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
ui->label_Description->setHidden(false);
|
|
||||||
updateHiddenState();
|
|
||||||
}
|
|
||||||
ui->label_Description->setToolTip("");
|
|
||||||
QString intermediatetext = text.trimmed();
|
|
||||||
bool prev(false);
|
|
||||||
QChar rem('\n');
|
|
||||||
QString finaltext;
|
|
||||||
finaltext.reserve(intermediatetext.size());
|
|
||||||
foreach (const QChar& c, intermediatetext) {
|
|
||||||
if (c == rem && prev) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
prev = c == rem;
|
|
||||||
finaltext += c;
|
|
||||||
}
|
|
||||||
QString labeltext;
|
|
||||||
labeltext.reserve(300);
|
|
||||||
if (finaltext.length() > 290) {
|
|
||||||
ui->label_Description->setOpenExternalLinks(false);
|
|
||||||
ui->label_Description->setTextFormat(Qt::TextFormat::RichText);
|
|
||||||
desc = text;
|
|
||||||
// This allows injecting HTML here.
|
|
||||||
labeltext.append("<html><body>" + finaltext.left(287) + "<a href=\"#mod_desc\">...</a></body></html>");
|
|
||||||
QObject::connect(ui->label_Description, &QLabel::linkActivated, this, &ErrorFrame::ellipsisHandler);
|
|
||||||
} else {
|
|
||||||
ui->label_Description->setTextFormat(Qt::TextFormat::PlainText);
|
|
||||||
labeltext.append(finaltext);
|
|
||||||
}
|
|
||||||
ui->label_Description->setText(labeltext);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ErrorFrame::ellipsisHandler(const QString& link)
|
|
||||||
{
|
|
||||||
if (!currentBox) {
|
|
||||||
currentBox = CustomMessageBox::selectable(this, QString(), desc);
|
|
||||||
connect(currentBox, &QMessageBox::finished, this, &ErrorFrame::boxClosed);
|
|
||||||
currentBox->show();
|
|
||||||
} else {
|
|
||||||
currentBox->setText(desc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ErrorFrame::boxClosed(int result)
|
|
||||||
{
|
|
||||||
currentBox = nullptr;
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
/* Copyright 2013-2021 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>
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class ErrorFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ErrorFrame : public QFrame {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit ErrorFrame(QWidget* parent = 0);
|
|
||||||
~ErrorFrame();
|
|
||||||
|
|
||||||
void setTitle(QString text);
|
|
||||||
void setDescription(QString text);
|
|
||||||
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void ellipsisHandler(const QString& link);
|
|
||||||
void boxClosed(int result);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updateHiddenState();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::ErrorFrame* ui;
|
|
||||||
QString desc;
|
|
||||||
class QMessageBox* currentBox = nullptr;
|
|
||||||
};
|
|
|
@ -1,92 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ErrorFrame</class>
|
|
||||||
<widget class="QFrame" name="ErrorFrame">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>527</width>
|
|
||||||
<height>113</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>120</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<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="QLabel" name="label_Title">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</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>
|
|
||||||
<property name="textInteractionFlags">
|
|
||||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_Description">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</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>
|
|
||||||
<property name="textInteractionFlags">
|
|
||||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
|
@ -1,24 +0,0 @@
|
||||||
#include "FocusLineEdit.h"
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
FocusLineEdit::FocusLineEdit(QWidget* parent) : QLineEdit(parent)
|
|
||||||
{
|
|
||||||
_selectOnMousePress = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FocusLineEdit::focusInEvent(QFocusEvent* e)
|
|
||||||
{
|
|
||||||
QLineEdit::focusInEvent(e);
|
|
||||||
selectAll();
|
|
||||||
_selectOnMousePress = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FocusLineEdit::mousePressEvent(QMouseEvent* me)
|
|
||||||
{
|
|
||||||
QLineEdit::mousePressEvent(me);
|
|
||||||
if (_selectOnMousePress) {
|
|
||||||
selectAll();
|
|
||||||
_selectOnMousePress = false;
|
|
||||||
}
|
|
||||||
qDebug() << selectedText();
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QLineEdit>
|
|
||||||
|
|
||||||
class FocusLineEdit : public QLineEdit {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
FocusLineEdit(QWidget* parent);
|
|
||||||
virtual ~FocusLineEdit() {}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void focusInEvent(QFocusEvent* e);
|
|
||||||
void mousePressEvent(QMouseEvent* me);
|
|
||||||
|
|
||||||
bool _selectOnMousePress;
|
|
||||||
};
|
|
|
@ -1,58 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>InstanceCardWidget</class>
|
|
||||||
<widget class="QWidget" name="InstanceCardWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>473</width>
|
|
||||||
<height>118</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0" rowspan="2">
|
|
||||||
<widget class="QToolButton" name="iconButton">
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>80</width>
|
|
||||||
<height>80</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLabel" name="nameLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Name:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>instNameTextBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLineEdit" name="instNameTextBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLabel" name="groupLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Group:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>groupBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QComboBox" name="groupBox">
|
|
||||||
<property name="editable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
|
@ -1,35 +0,0 @@
|
||||||
#include "LineSeparator.h"
|
|
||||||
|
|
||||||
#include <QLayout>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QStyle>
|
|
||||||
#include <QStyleOption>
|
|
||||||
|
|
||||||
void LineSeparator::initStyleOption(QStyleOption* option) const
|
|
||||||
{
|
|
||||||
option->initFrom(this);
|
|
||||||
// in a horizontal layout, the line is vertical (and vice versa)
|
|
||||||
if (m_orientation == Qt::Vertical)
|
|
||||||
option->state |= QStyle::State_Horizontal;
|
|
||||||
}
|
|
||||||
|
|
||||||
LineSeparator::LineSeparator(QWidget* parent, Qt::Orientation orientation) : QWidget(parent), m_orientation(orientation)
|
|
||||||
{
|
|
||||||
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize LineSeparator::sizeHint() const
|
|
||||||
{
|
|
||||||
QStyleOption opt;
|
|
||||||
initStyleOption(&opt);
|
|
||||||
const int extent = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, &opt, parentWidget());
|
|
||||||
return QSize(extent, extent);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LineSeparator::paintEvent(QPaintEvent*)
|
|
||||||
{
|
|
||||||
QPainter p(this);
|
|
||||||
QStyleOption opt;
|
|
||||||
initStyleOption(&opt);
|
|
||||||
style()->drawPrimitive(QStyle::PE_IndicatorToolBarSeparator, &opt, &p, parentWidget());
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
class QStyleOption;
|
|
||||||
|
|
||||||
class LineSeparator : public QWidget {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
/// Create a line separator. orientation is the orientation of the line.
|
|
||||||
explicit LineSeparator(QWidget* parent, Qt::Orientation orientation = Qt::Horizontal);
|
|
||||||
QSize sizeHint() const;
|
|
||||||
void paintEvent(QPaintEvent*);
|
|
||||||
void initStyleOption(QStyleOption* option) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Qt::Orientation m_orientation = Qt::Horizontal;
|
|
||||||
};
|
|
Loading…
Add table
Add a link
Reference in a new issue