diff options
author | Andrew <forkk@forkk.net> | 2013-02-25 13:31:37 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-02-25 13:31:37 -0600 |
commit | 23474da17500b35bf4fb2a754021175361baab00 (patch) | |
tree | db2dda426ec4a91982f5f5539b08cc7c3bb1fd35 /gui/mainwindow.cpp | |
parent | 498225debdb22d83e591635dbd172cca12476279 (diff) | |
parent | 4fd5bdb01b27c99f16c9acf3c7ac13c7ea719800 (diff) | |
download | MultiMC-23474da17500b35bf4fb2a754021175361baab00.tar MultiMC-23474da17500b35bf4fb2a754021175361baab00.tar.gz MultiMC-23474da17500b35bf4fb2a754021175361baab00.tar.lz MultiMC-23474da17500b35bf4fb2a754021175361baab00.tar.xz MultiMC-23474da17500b35bf4fb2a754021175361baab00.zip |
Merge branch 'master' of git://github.com/peterix/MultiMC5
Conflicts:
CMakeLists.txt
main.cpp
Diffstat (limited to 'gui/mainwindow.cpp')
-rw-r--r-- | gui/mainwindow.cpp | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index ab46048a..87661da6 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,17 +22,23 @@ #include <QMenu> #include <QMessageBox> - +#include <QInputDialog> +#include <QApplication> #include <QDesktopServices> #include <QUrl> +#include <QDir> #include <QFileInfo> #include "osutils.h" +#include "userutils.h" +#include "pathutils.h" #include "gui/settingsdialog.h" #include "gui/newinstancedialog.h" #include "gui/logindialog.h" #include "gui/taskdialog.h" +#include "gui/browserdialog.h" +#include "gui/aboutdialog.h" #include "instancelist.h" #include "data/appsettings.h" @@ -94,17 +104,20 @@ 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() { - + AboutDialog dialog(this); + dialog.exec(); } void MainWindow::on_mainToolBar_visibilityChanged(bool) @@ -163,6 +176,26 @@ void MainWindow::onLoginComplete(LoginResponse response) arg(response.username(), response.sessionID())); } +// 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(); +} + void openInDefaultProgram(QString filename) { QDesktopServices::openUrl("file:///" + QFileInfo(filename).absolutePath()); |