Sync, removal of webkit as a dependency, removal of the web windows.
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
#include <logic/ModList.h>
|
||||
#include <pathutils.h>
|
||||
#include <QFileDialog>
|
||||
#include <QDebug>
|
||||
|
||||
LegacyModEditDialog::LegacyModEditDialog( LegacyInstance* inst, QWidget* parent ) :
|
||||
m_inst(inst),
|
||||
@ -32,11 +33,10 @@ LegacyModEditDialog::LegacyModEditDialog( LegacyInstance* inst, QWidget* parent
|
||||
m_mods = m_inst->loaderModList();
|
||||
m_coremods = m_inst->coreModList();
|
||||
m_jarmods = m_inst->jarModList();
|
||||
/*
|
||||
m_mods->startWatching();
|
||||
m_coremods->startWatching();
|
||||
m_jarmods->startWatching();
|
||||
*/
|
||||
|
||||
qDebug() << m_mods.data();
|
||||
qDebug() << m_coremods.data();
|
||||
qDebug() << m_jarmods.data();
|
||||
|
||||
ui->jarModsTreeView->setModel(m_jarmods.data());
|
||||
ui->coreModsTreeView->setModel(m_coremods.data());
|
||||
|
@ -1,6 +1,9 @@
|
||||
#include "ModListView.h"
|
||||
#include <QHeaderView>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QDrag>
|
||||
#include <QRect>
|
||||
|
||||
ModListView::ModListView ( QWidget* parent )
|
||||
:QTreeView ( parent )
|
||||
|
@ -1,76 +0,0 @@
|
||||
#include "browserdialog.h"
|
||||
#include "ui_browserdialog.h"
|
||||
|
||||
#include <QtWebKit/QWebHistory>
|
||||
|
||||
BrowserDialog::BrowserDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::BrowserDialog),
|
||||
m_pageTitleInWindowTitle(true),
|
||||
m_windowTitleFormat("%1")
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->webView->setPage(new QWebPage());
|
||||
refreshWindowTitle();
|
||||
resize(800, 600);
|
||||
}
|
||||
|
||||
BrowserDialog::~BrowserDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// Navigation Buttons
|
||||
void BrowserDialog::on_btnBack_clicked()
|
||||
{
|
||||
ui->webView->back();
|
||||
}
|
||||
|
||||
void BrowserDialog::on_btnForward_clicked()
|
||||
{
|
||||
ui->webView->forward();
|
||||
}
|
||||
|
||||
void BrowserDialog::on_webView_urlChanged(const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(url);
|
||||
//qDebug("urlChanged");
|
||||
ui->btnBack->setEnabled(ui->webView->history()->canGoBack());
|
||||
ui->btnForward->setEnabled(ui->webView->history()->canGoForward());
|
||||
}
|
||||
|
||||
// Window Title Magic
|
||||
void BrowserDialog::refreshWindowTitle()
|
||||
{
|
||||
//qDebug("refreshTitle");
|
||||
if (m_pageTitleInWindowTitle)
|
||||
setWindowTitle(m_windowTitleFormat.arg(ui->webView->title()));
|
||||
else
|
||||
setWindowTitle(m_windowTitleFormat);
|
||||
}
|
||||
|
||||
void BrowserDialog::setPageTitleInWindowTitle(bool enable)
|
||||
{
|
||||
m_pageTitleInWindowTitle = enable;
|
||||
refreshWindowTitle();
|
||||
}
|
||||
|
||||
void BrowserDialog::setWindowTitleFormat(QString format)
|
||||
{
|
||||
m_windowTitleFormat = format;
|
||||
refreshWindowTitle();
|
||||
}
|
||||
|
||||
void BrowserDialog::on_webView_titleChanged(const QString &title)
|
||||
{
|
||||
//qDebug("titleChanged");
|
||||
if (m_pageTitleInWindowTitle)
|
||||
setWindowTitle(m_windowTitleFormat.arg(title));
|
||||
}
|
||||
|
||||
// Public access Methods
|
||||
void BrowserDialog::load(const QUrl &url)
|
||||
{
|
||||
//qDebug("load");
|
||||
ui->webView->setUrl(url);
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
#ifndef BROWSERDIALOG_H
|
||||
#define BROWSERDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class BrowserDialog;
|
||||
}
|
||||
|
||||
class BrowserDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BrowserDialog(QWidget *parent = 0);
|
||||
~BrowserDialog();
|
||||
|
||||
void load(const QUrl &url);
|
||||
|
||||
void setPageTitleInWindowTitle(bool enable);
|
||||
bool pageTitleInWindowTitle(void) { return m_pageTitleInWindowTitle; }
|
||||
|
||||
void setWindowTitleFormat(QString format);
|
||||
QString windowTitleFormat(void) { return m_windowTitleFormat; }
|
||||
|
||||
private:
|
||||
Ui::BrowserDialog *ui;
|
||||
|
||||
bool m_pageTitleInWindowTitle;
|
||||
QString m_windowTitleFormat;
|
||||
|
||||
void refreshWindowTitle(void);
|
||||
|
||||
private slots:
|
||||
void on_btnBack_clicked(void);
|
||||
void on_btnForward_clicked(void);
|
||||
void on_webView_urlChanged(const QUrl &url);
|
||||
void on_webView_titleChanged(const QString &title);
|
||||
};
|
||||
|
||||
#endif // BROWSERDIALOG_H
|
@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BrowserDialog</class>
|
||||
<widget class="QDialog" name="BrowserDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>535</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="toolbarLayout">
|
||||
<item>
|
||||
<widget class="QCommandLinkButton" name="btnBack">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Back</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-previous"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCommandLinkButton" name="btnForward">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Forward</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="go-next"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="toolbarSpacer_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWebView" name="webView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="url">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>QtWebKitWidgets/QWebView</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -40,7 +40,6 @@
|
||||
#include "gui/newinstancedialog.h"
|
||||
#include "gui/logindialog.h"
|
||||
#include "gui/taskdialog.h"
|
||||
#include "gui/browserdialog.h"
|
||||
#include "gui/aboutdialog.h"
|
||||
#include "gui/versionselectdialog.h"
|
||||
#include "gui/lwjglselectdialog.h"
|
||||
@ -366,13 +365,13 @@ void MainWindow::on_actionViewSelectedInstFolder_triggered()
|
||||
|
||||
void MainWindow::on_actionEditInstMods_triggered()
|
||||
{
|
||||
//TODO: Needs to do current ModEditDialog too
|
||||
BaseInstance* inst = selectedInstance();
|
||||
if (inst)
|
||||
{
|
||||
auto dialog = inst->createModEditDialog(this);
|
||||
if(dialog)
|
||||
dialog->exec();
|
||||
dialog->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
@ -527,10 +526,7 @@ void MainWindow::on_actionMakeDesktopShortcut_triggered()
|
||||
// BrowserDialog
|
||||
void MainWindow::openWebPage ( QUrl url )
|
||||
{
|
||||
BrowserDialog *browser = new BrowserDialog ( this );
|
||||
|
||||
browser->load ( url );
|
||||
browser->exec();
|
||||
QDesktopServices::openUrl(url);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionChangeInstMCVersion_triggered()
|
||||
|
Reference in New Issue
Block a user