mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00
kmediaplayer: use KMessageBox instead of QMessageBox for reporting errors
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
767c2c5e73
commit
5be830894a
1 changed files with 10 additions and 10 deletions
|
@ -28,8 +28,8 @@
|
||||||
#include <KFileDialog>
|
#include <KFileDialog>
|
||||||
#include <KToolBar>
|
#include <KToolBar>
|
||||||
#include <KStatusBar>
|
#include <KStatusBar>
|
||||||
|
#include <KMessageBox>
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ KMediaWindow::KMediaWindow(QWidget *parent, Qt::WindowFlags flags)
|
||||||
resize(640, 480);
|
resize(640, 480);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_menu = new QMenu();
|
m_menu = new QMenu(this);
|
||||||
m_menu->addAction(KIcon("show-menu"), i18n("Show/hide menubar"), this, SLOT(slotMenubar()));
|
m_menu->addAction(KIcon("show-menu"), i18n("Show/hide menubar"), this, SLOT(slotMenubar()));
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotMenu(QPoint)));
|
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotMenu(QPoint)));
|
||||||
|
@ -126,8 +126,7 @@ void KMediaWindow::slotOpenPath()
|
||||||
const QString path = KFileDialog::getOpenFileName(KUrl(), QString(), this, i18n("Select paths"));
|
const QString path = KFileDialog::getOpenFileName(KUrl(), QString(), this, i18n("Select paths"));
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
if (!m_player->player()->isPathSupported(path)) {
|
if (!m_player->player()->isPathSupported(path)) {
|
||||||
QMessageBox::warning(this, i18n("Invalid path"),
|
KMessageBox::error(this, i18n("The path <filename>%1</filename> is not supported.", path), i18n("Invalid path"));
|
||||||
i18n("The path is invalid:\n%1", path));
|
|
||||||
} else {
|
} else {
|
||||||
m_player->open(path);
|
m_player->open(path);
|
||||||
m_recentfiles->addUrl(KUrl(path));
|
m_recentfiles->addUrl(KUrl(path));
|
||||||
|
@ -138,15 +137,16 @@ void KMediaWindow::slotOpenPath()
|
||||||
void KMediaWindow::slotOpenURL()
|
void KMediaWindow::slotOpenURL()
|
||||||
{
|
{
|
||||||
bool dummy;
|
bool dummy;
|
||||||
QString protocols = m_player->player()->protocols().join(", ");
|
QString protocols = m_player->player()->protocols().join(QLatin1String(", "));
|
||||||
KUrl url = KInputDialog::getText(i18n("Input URL"),
|
KUrl url = KInputDialog::getText(
|
||||||
|
i18n("Input URL"),
|
||||||
i18n("Supported protocols are:\n\n%1", protocols),
|
i18n("Supported protocols are:\n\n%1", protocols),
|
||||||
QString(), &dummy, this);
|
QString(), &dummy, this
|
||||||
|
);
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
QString urlstring = url.prettyUrl();
|
const QString urlstring = url.prettyUrl();
|
||||||
if (!m_player->player()->isPathSupported(urlstring)) {
|
if (!m_player->player()->isPathSupported(urlstring)) {
|
||||||
QMessageBox::warning(this, i18n("Invalid URL"),
|
KMessageBox::error(this, i18n("The URL <filename>%1</filename> is not supported.", urlstring), i18n("Invalid URL"));
|
||||||
i18n("Invalid URL:\n%1", urlstring));
|
|
||||||
} else {
|
} else {
|
||||||
m_player->open(urlstring);
|
m_player->open(urlstring);
|
||||||
m_recentfiles->addUrl(url);
|
m_recentfiles->addUrl(url);
|
||||||
|
|
Loading…
Add table
Reference in a new issue