diff options
Diffstat (limited to 'gui/mainwindow.cpp')
-rw-r--r-- | gui/mainwindow.cpp | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index bc0840a0..0ca9fde1 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1,5 +1,9 @@ /* Copyright 2013 MultiMC Contributors * + * Authors: Andrew Okin + * Peterix + * Orochimarufan <orochimarufan.x3@gmail.com> + * * 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 @@ -18,16 +22,21 @@ #include <QMenu> #include <QMessageBox> - +#include <QInputDialog> +#include <QApplication> #include <QDesktopServices> #include <QUrl> +#include <QDir> #include "util/osutils.h" +#include "util/userutil.h" +#include "util/pathutils.h" #include "gui/settingsdialog.h" #include "gui/newinstancedialog.h" #include "gui/logindialog.h" #include "gui/taskdialog.h" +#include "gui/browserdialog.h" #include "data/appsettings.h" #include "data/version.h" @@ -36,7 +45,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), - ui(new Ui::MainWindow) + ui(new Ui::MainWindow) { ui->setupUi(this); @@ -88,12 +97,14 @@ void MainWindow::on_actionSettings_triggered() void MainWindow::on_actionReportBug_triggered() { - QDesktopServices::openUrl(QUrl("http://bugs.forkk.net/")); + //QDesktopServices::openUrl(QUrl("http://bugs.forkk.net/")); + openWebPage(QUrl("http://bugs.forkk.net/")); } void MainWindow::on_actionNews_triggered() { - QDesktopServices::openUrl(QUrl("http://news.forkk.net/")); + //QDesktopServices::openUrl(QUrl("http://news.forkk.net/")); + openWebPage(QUrl("http://news.forkk.net/")); } void MainWindow::on_actionAbout_triggered() @@ -155,3 +166,23 @@ void MainWindow::onLoginComplete(LoginResponse response) QString("Logged in as %1 with session ID %2."). arg(response.getUsername(), response.getSessionID())); } + +// Create A Desktop Shortcut +void MainWindow::on_actionMakeDesktopShortcut_triggered() +{ + QString name("Test"); + name = QInputDialog::getText(this, tr("MultiMC Shortcut"), tr("Enter a Shortcut Name."), QLineEdit::Normal, name); + + Util::createShortCut(Util::getDesktopDir(), QApplication::instance()->applicationFilePath(), QStringList() << "-dl" << QDir::currentPath() << "test", name, "application-x-octet-stream"); + + QMessageBox::warning(this, "Not useful", "A Dummy Shortcut was created. it will not do anything productive"); +} + +// BrowserDialog +void MainWindow::openWebPage(QUrl url) +{ + BrowserDialog *browser = new BrowserDialog(this); + + browser->load(url); + browser->exec(); +} |