-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce private link sharing #5023
* SocketAPI has COPL_LOCAL_LINK / EMAIL_LOCAL_LINK commands * The nautilus and dolphing shell integrations show a submenu from which one can share as well as access the private link. * The SocketAPI provides a new GET_STRINGS command to access localized strings. * The private link can also be accessed from the user/group sharing dialog. * The numeric file id is extracted from the full id to create the private link url.
- Loading branch information
Showing
25 changed files
with
390 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (C) by Christian Kamm <mail@ckamm.de> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#include "guiutility.h" | ||
|
||
#include <QClipboard> | ||
#include <QApplication> | ||
#include <QDesktopServices> | ||
#include <QMessageBox> | ||
|
||
using namespace OCC; | ||
|
||
bool Utility::openBrowser(const QUrl &url, QWidget *errorWidgetParent) | ||
{ | ||
if (!QDesktopServices::openUrl(url) && errorWidgetParent) { | ||
QMessageBox::warning( | ||
errorWidgetParent, | ||
QCoreApplication::translate("utility", "Could not open browser"), | ||
QCoreApplication::translate("utility", | ||
"There was an error when launching the browser to go to " | ||
"URL %1. Maybe no default browser is configured?") | ||
.arg(url.toString())); | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
bool Utility::openEmailComposer(const QString &subject, const QString &body, QWidget *errorWidgetParent) | ||
{ | ||
QUrl url(QLatin1String("mailto: ")); | ||
url.setQueryItems({ { QLatin1String("subject"), subject }, | ||
{ QLatin1String("body"), body } }); | ||
|
||
if (!QDesktopServices::openUrl(url) && errorWidgetParent) { | ||
QMessageBox::warning( | ||
errorWidgetParent, | ||
QCoreApplication::translate("utility", "Could not open email client"), | ||
QCoreApplication::translate("utility", | ||
"There was an error when launching the email client to " | ||
"create a new message. Maybe no default email client is " | ||
"configured?")); | ||
return false; | ||
} | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (C) by Christian Kamm <mail@ckamm.de> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#ifndef GUIUTILITY_H | ||
#define GUIUTILITY_H | ||
|
||
#include <QString> | ||
#include <QUrl> | ||
#include <QWidget> | ||
|
||
namespace OCC { | ||
namespace Utility { | ||
|
||
/** Open an url in the browser. | ||
* | ||
* If launching the browser fails, display a message. | ||
*/ | ||
bool openBrowser(const QUrl &url, QWidget *errorWidgetParent); | ||
|
||
/** Start composing a new email message. | ||
* | ||
* If launching the email program fails, display a message. | ||
*/ | ||
bool openEmailComposer(const QString &subject, const QString &body, | ||
QWidget *errorWidgetParent); | ||
|
||
} // namespace Utility | ||
} // namespace OCC | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.