diff options
author | Orochimarufan <orochimarufan.x3@gmail.com> | 2013-02-13 04:03:15 +0100 |
---|---|---|
committer | Orochimarufan <orochimarufan.x3@gmail.com> | 2013-02-13 04:03:15 +0100 |
commit | 369b1c55c99aa8bdcd2d57ab4aad3633343f1417 (patch) | |
tree | a5d772ab16c53ac8e69dcc7e92bd3b6b48c6ef73 /gui | |
parent | c755195b9721ad9f040684c3be1e93178f95c2cf (diff) | |
download | MultiMC-369b1c55c99aa8bdcd2d57ab4aad3633343f1417.tar MultiMC-369b1c55c99aa8bdcd2d57ab4aad3633343f1417.tar.gz MultiMC-369b1c55c99aa8bdcd2d57ab4aad3633343f1417.tar.lz MultiMC-369b1c55c99aa8bdcd2d57ab4aad3633343f1417.tar.xz MultiMC-369b1c55c99aa8bdcd2d57ab4aad3633343f1417.zip |
implement desktop shortcut creation. windows code not tested.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/browserdialog.cpp | 8 | ||||
-rw-r--r-- | gui/mainwindow.cpp | 14 | ||||
-rw-r--r-- | gui/mainwindow.h | 2 |
3 files changed, 20 insertions, 4 deletions
diff --git a/gui/browserdialog.cpp b/gui/browserdialog.cpp index 58f185ce..40c50c3f 100644 --- a/gui/browserdialog.cpp +++ b/gui/browserdialog.cpp @@ -34,7 +34,7 @@ void BrowserDialog::on_btnForward_clicked() void BrowserDialog::on_webView_urlChanged(const QUrl &url) { Q_UNUSED(url); - qDebug("urlChanged"); + //qDebug("urlChanged"); ui->btnBack->setEnabled(ui->webView->history()->canGoBack()); ui->btnForward->setEnabled(ui->webView->history()->canGoForward()); } @@ -42,7 +42,7 @@ void BrowserDialog::on_webView_urlChanged(const QUrl &url) // Window Title Magic void BrowserDialog::refreshWindowTitle() { - qDebug("refreshTitle"); + //qDebug("refreshTitle"); if (m_pageTitleInWindowTitle) setWindowTitle(m_windowTitleFormat.arg(ui->webView->title())); else @@ -63,7 +63,7 @@ void BrowserDialog::setWindowTitleFormat(QString format) void BrowserDialog::on_webView_titleChanged(const QString &title) { - qDebug("titleChanged"); + //qDebug("titleChanged"); if (m_pageTitleInWindowTitle) setWindowTitle(m_windowTitleFormat.arg(title)); } @@ -71,6 +71,6 @@ void BrowserDialog::on_webView_titleChanged(const QString &title) // Public access Methods void BrowserDialog::load(const QUrl &url) { - qDebug("load"); + //qDebug("load"); ui->webView->setUrl(url); } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 271a67fb..9bbc4c38 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -18,11 +18,14 @@ #include <QMenu> #include <QMessageBox> +#include <QInputDialog> #include <QDesktopServices> #include <QUrl> #include "util/osutils.h" +#include "util/userutil.h" +#include "util/pathutils.h" #include "gui/settingsdialog.h" #include "gui/newinstancedialog.h" @@ -159,6 +162,17 @@ void MainWindow::onLoginComplete(LoginResponse response) 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(), "test", QStringList() << "-d" << "lol", name, "application-x-octet-stream"); + + QMessageBox::warning(this, "Stupidness", "A Dummy Shortcut was created. the current instance model doesnt allow for anything more"); +} + // BrowserDialog void MainWindow::openWebPage(QUrl url) { diff --git a/gui/mainwindow.h b/gui/mainwindow.h index cf6a9dbc..f2dfbc70 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -64,6 +64,8 @@ private slots: void on_actionLaunchInstance_triggered(); + + void on_actionMakeDesktopShortcut_triggered(); void doLogin(const QString& errorMsg = ""); |