mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00
renamedlgplugins: remove them
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
ce26aac1a5
commit
267c7f5f28
16 changed files with 0 additions and 791 deletions
|
@ -366,7 +366,6 @@ add_subdirectory(solid-networkstatus)
|
||||||
add_subdirectory(kcmshell)
|
add_subdirectory(kcmshell)
|
||||||
add_subdirectory(kioslave)
|
add_subdirectory(kioslave)
|
||||||
add_subdirectory(kurifilter-plugins)
|
add_subdirectory(kurifilter-plugins)
|
||||||
add_subdirectory(renamedlgplugins)
|
|
||||||
add_subdirectory(kquitapp)
|
add_subdirectory(kquitapp)
|
||||||
if (Q_WS_X11)
|
if (Q_WS_X11)
|
||||||
add_subdirectory(kstart)
|
add_subdirectory(kstart)
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
add_subdirectory( images )
|
|
||||||
add_subdirectory( audio )
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
Here you willl find plugins for the RenameDlg
|
|
||||||
|
|
||||||
images This module will show the two different pictures/images
|
|
||||||
to let you better decide what you want to do
|
|
||||||
|
|
||||||
audio This module will show you some information on the audio
|
|
||||||
files to make it easier to decide what to do.
|
|
|
@ -1,21 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
########### next target ###############
|
|
||||||
|
|
||||||
set(renaudioplugin_PART_SRCS audiopreview.cpp audio_plugin.cpp )
|
|
||||||
|
|
||||||
kde4_add_plugin(renaudioplugin WITH_PREFIX ${renaudioplugin_PART_SRCS})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(renaudioplugin ${KDE4_KIO_LIBS} kmediaplayer )
|
|
||||||
|
|
||||||
install(TARGETS renaudioplugin DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} )
|
|
||||||
|
|
||||||
|
|
||||||
########### install files ###############
|
|
||||||
|
|
||||||
install( FILES renaudiodlg.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
$XGETTEXT *.cpp -o $podir/audiorename_plugin.pot
|
|
|
@ -1,9 +0,0 @@
|
||||||
Some ideas on what would be nice if implemented...
|
|
||||||
|
|
||||||
* Start playing the audio file when icon is hovered.
|
|
||||||
* Colorize differences in file information
|
|
||||||
* On remote files: load file when label is clicked
|
|
||||||
* Tell if source or destination file is broken
|
|
||||||
* Tell if they're different or the same, not taking e.g. the IDtag into
|
|
||||||
account, only the actual audio data.
|
|
||||||
* ...
|
|
|
@ -1,103 +0,0 @@
|
||||||
/* This file is part of the KDE project
|
|
||||||
Copyright (C) 2003 Fabian Wolf <fabianw@gmx.net>
|
|
||||||
|
|
||||||
image_plugin.cpp (also Part of the KDE Project) used as template
|
|
||||||
|
|
||||||
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; version 2
|
|
||||||
of the License.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <kpluginfactory.h>
|
|
||||||
#include <klocale.h>
|
|
||||||
#include <ksqueezedtextlabel.h>
|
|
||||||
#include <kio/renamedialogplugin.h>
|
|
||||||
#include <qlabel.h>
|
|
||||||
#include <qdialog.h>
|
|
||||||
#include <qwidget.h>
|
|
||||||
#include <qstringlist.h>
|
|
||||||
#include <QGridLayout>
|
|
||||||
#include <kdebug.h>
|
|
||||||
#include <kio/global.h>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include "audiopreview.h"
|
|
||||||
|
|
||||||
class AudioPlugin : public KIO::RenameDialogPlugin{
|
|
||||||
public:
|
|
||||||
AudioPlugin( QWidget *dialog, const QVariantList & );
|
|
||||||
~AudioPlugin();
|
|
||||||
|
|
||||||
bool wantToHandle( KIO::RenameDialog_Mode mode, const KIO::RenameDialogPlugin::FileItem& src,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& dst ) const;
|
|
||||||
void handle( KIO::RenameDialog_Mode, const KIO::RenameDialogPlugin::FileItem& src,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& dst );
|
|
||||||
};
|
|
||||||
|
|
||||||
AudioPlugin::AudioPlugin( QWidget *dialog, const QVariantList & )
|
|
||||||
: RenameDialogPlugin(static_cast<QDialog*>(dialog)) {
|
|
||||||
kDebug() << "loaded";
|
|
||||||
}
|
|
||||||
AudioPlugin::~AudioPlugin()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AudioPlugin::wantToHandle( KIO::RenameDialog_Mode, const KIO::RenameDialogPlugin::FileItem&,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& ) const {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudioPlugin::handle( KIO::RenameDialog_Mode mode, const KIO::RenameDialogPlugin::FileItem& src,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& dst ) {
|
|
||||||
|
|
||||||
QGridLayout *lay = new QGridLayout( this );
|
|
||||||
if( mode & KIO::M_OVERWRITE ){
|
|
||||||
QLabel *label_src = new QLabel(this);
|
|
||||||
QLabel *label_dst = new QLabel(this);
|
|
||||||
QLabel *label_ask = new QLabel(this);
|
|
||||||
|
|
||||||
QString sentence1;
|
|
||||||
QString dest = dst.url().pathOrUrl();
|
|
||||||
if ( src.mTime() < dst.mTime() )
|
|
||||||
sentence1 = i18n("An older file named '%1' already exists.\n", dest);
|
|
||||||
else if ( src.mTime() == dst.mTime() )
|
|
||||||
sentence1 = i18n("A similar file named '%1' already exists.\n", dest);
|
|
||||||
else
|
|
||||||
sentence1 = i18n("A newer file named '%1' already exists.\n", dest);
|
|
||||||
QLabel *label_head = new KSqueezedTextLabel(sentence1, this);
|
|
||||||
label_src->setText(i18n("Source File"));
|
|
||||||
label_dst->setText(i18n("Existing File"));
|
|
||||||
label_ask->setText(i18n("Would you like to replace the existing file with the one on the right?") );
|
|
||||||
label_head->adjustSize();
|
|
||||||
label_src->adjustSize();
|
|
||||||
label_dst->adjustSize();
|
|
||||||
label_ask->adjustSize();
|
|
||||||
lay->addWidget(label_head, 0, 0, 1, 3, Qt::AlignLeft);
|
|
||||||
lay->addWidget(label_dst, 1, 0, Qt::AlignLeft);
|
|
||||||
lay->addWidget(label_src, 1, 2, Qt::AlignLeft);
|
|
||||||
lay->addWidget(label_ask, 3, 0, 1, 3, Qt::AlignLeft);
|
|
||||||
adjustSize();
|
|
||||||
}
|
|
||||||
AudioPreview *left= new AudioPreview(this, dst.url(), dst.mimeType() );
|
|
||||||
AudioPreview *right = new AudioPreview( this, src.url(), src.mimeType() );
|
|
||||||
lay->addWidget(left, 2, 0 );
|
|
||||||
lay->addWidget(right, 2, 2 );
|
|
||||||
adjustSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
K_PLUGIN_FACTORY(AudioPluginFactory,
|
|
||||||
registerPlugin<AudioPlugin>();)
|
|
||||||
K_EXPORT_PLUGIN(AudioPluginFactory("audiorename_plugin"))
|
|
||||||
|
|
|
@ -1,128 +0,0 @@
|
||||||
/* This file is part of the KDE project
|
|
||||||
Copyright (C) 2003 Fabian Wolf <fabianw@gmx.net>
|
|
||||||
|
|
||||||
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; version 2
|
|
||||||
of the License.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "audiopreview.h"
|
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QPixmap>
|
|
||||||
|
|
||||||
#include <kfilemetainfo.h>
|
|
||||||
#include <klocale.h>
|
|
||||||
#include <kmimetype.h>
|
|
||||||
#include <kurl.h>
|
|
||||||
#include <kio/netaccess.h>
|
|
||||||
#include <kurllabel.h>
|
|
||||||
#include <kservicetypetrader.h>
|
|
||||||
#include <ksqueezedtextlabel.h>
|
|
||||||
|
|
||||||
AudioPreview::AudioPreview( QWidget *parent, const KUrl &url, const QString &mimeType)
|
|
||||||
: KVBox( parent )
|
|
||||||
{
|
|
||||||
m_isTempFile = false;
|
|
||||||
pic = 0;
|
|
||||||
m_player = 0L;
|
|
||||||
description = 0;
|
|
||||||
setSpacing( 0 );
|
|
||||||
if( url.isValid() && url.isLocalFile() ) {
|
|
||||||
m_localFile = url.toLocalFile();
|
|
||||||
pic = new QLabel(this);
|
|
||||||
pic->setPixmap(KIO::pixmapForUrl( url ));
|
|
||||||
pic->adjustSize();
|
|
||||||
initView( mimeType );
|
|
||||||
} else if( !url.isLocalFile() ) {
|
|
||||||
KUrlLabel *label = new KUrlLabel( this );
|
|
||||||
label->setText(i18n("This audio file is not stored\non the local host.\nClick on this label to load it.\n" ) );
|
|
||||||
label->setUrl( url.prettyUrl() );
|
|
||||||
connect(label, SIGNAL(leftClickedUrl(const QString&)), SLOT(downloadFile(const QString&)));
|
|
||||||
pic = label;
|
|
||||||
} else {
|
|
||||||
description = new QLabel(this );
|
|
||||||
description->setText(i18n("Unable to load audio file") );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AudioPreview::~AudioPreview()
|
|
||||||
{
|
|
||||||
if ( m_isTempFile )
|
|
||||||
KIO::NetAccess::removeTempFile( m_localFile );
|
|
||||||
|
|
||||||
delete m_player;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudioPreview::initView( const QString& mimeType )
|
|
||||||
{
|
|
||||||
KUrl url = KUrl::fromPath( m_localFile );
|
|
||||||
pic->setText( QString() );
|
|
||||||
pic->setPixmap(KIO::pixmapForUrl( url ));
|
|
||||||
pic->adjustSize();
|
|
||||||
|
|
||||||
KFileMetaInfo info(m_localFile);
|
|
||||||
KMimeType::Ptr mimeptr = KMimeType::mimeType(mimeType);
|
|
||||||
|
|
||||||
QString desc;
|
|
||||||
if (info.isValid())
|
|
||||||
{
|
|
||||||
if (mimeptr->is("audio/mpeg") || mimeptr->is("application/ogg"))
|
|
||||||
{
|
|
||||||
// following 3 labels might be very long; make sure they get squeezed
|
|
||||||
KSqueezedTextLabel *sl;
|
|
||||||
|
|
||||||
sl = new KSqueezedTextLabel(this);
|
|
||||||
sl->setText(i18n("Artist: %1", info.item("Artist").value().toString()));
|
|
||||||
|
|
||||||
sl = new KSqueezedTextLabel(this);
|
|
||||||
sl->setText(i18n("Title: %1", info.item("Title").value().toString()));
|
|
||||||
|
|
||||||
sl = new KSqueezedTextLabel(this);
|
|
||||||
sl->setText(i18n("Comment: %1", info.item("Comment").value().toString()));
|
|
||||||
|
|
||||||
desc.append(i18nc("Bitrate: 160 kbits/s", "Bitrate: %1 %2\n", info.item("Bitrate").value().toString(), info.item("Bitrate").suffix() ));
|
|
||||||
}
|
|
||||||
desc.append(i18n("Sample rate: %1 %2\n", info.item("Sample Rate").value().toString(), info.item("Sample Rate").suffix() ));
|
|
||||||
desc.append(i18n("Length: "));
|
|
||||||
|
|
||||||
/* Calculate length in mm:ss format */
|
|
||||||
int length = info.item("Length").value().toInt();
|
|
||||||
if (length/60 < 10)
|
|
||||||
desc.append("0");
|
|
||||||
desc.append(QString("%1:").arg(length/60, 0, 10));
|
|
||||||
if (length%60 < 10)
|
|
||||||
desc.append("0");
|
|
||||||
desc.append(QString("%1\n").arg(length%60, 0, 10));
|
|
||||||
}
|
|
||||||
|
|
||||||
description = new QLabel(this);
|
|
||||||
description->setText( desc );
|
|
||||||
description->adjustSize();
|
|
||||||
m_player = new KMediaWidget( this );
|
|
||||||
m_player->player()->setPlayerID("audio_rename_plugin");
|
|
||||||
m_player->show();
|
|
||||||
m_player->open( url.url() );
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudioPreview::downloadFile( const QString& url )
|
|
||||||
{
|
|
||||||
if( KIO::NetAccess::download( KUrl( url ), m_localFile , window()) )
|
|
||||||
{
|
|
||||||
m_isTempFile = true;
|
|
||||||
initView( KMimeType::findByPath( m_localFile )->name() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "moc_audiopreview.cpp"
|
|
|
@ -1,72 +0,0 @@
|
||||||
/* This file is part of the KDE project
|
|
||||||
Copyright (C) 2003 Fabian Wolf <fabianw@gmx.net>
|
|
||||||
|
|
||||||
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; version 2
|
|
||||||
of the License.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef AUDIOPREVIEW_H
|
|
||||||
#define AUDIOPREVIEW_H
|
|
||||||
|
|
||||||
#include <kvbox.h>
|
|
||||||
#include <kmediawidget.h>
|
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
class KUrl;
|
|
||||||
|
|
||||||
class AudioPreview : public KVBox
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
AudioPreview(QWidget *parent, const KUrl &url, const QString &mimeType);
|
|
||||||
~AudioPreview();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void downloadFile(const QString& url);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initView(const QString& mimeType);
|
|
||||||
|
|
||||||
QLabel *pic;
|
|
||||||
QLabel *description;
|
|
||||||
QString m_localFile;
|
|
||||||
bool m_isTempFile;
|
|
||||||
|
|
||||||
KMediaWidget *m_player;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Type=Service
|
|
||||||
Icon=edit-rename
|
|
||||||
Name=Audio Preview
|
|
||||||
Name[af]=Klankvoorskou
|
|
||||||
Name[ar]=معاينة صوت
|
|
||||||
Name[ast]=Prueba d'audio
|
|
||||||
Name[be]=Прагляд аўдыё
|
|
||||||
Name[be@latin]=Počut dla hukavoha fajła
|
|
||||||
Name[bg]=Преглед на звукови файлове
|
|
||||||
Name[bn]=অডিও প্রাকদর্শন
|
|
||||||
Name[bs]=Audio pregled
|
|
||||||
Name[ca]=Vista prèvia de l'àudio
|
|
||||||
Name[ca@valencia]=Vista prèvia de l'àudio
|
|
||||||
Name[cs]=Ukázka zvuku
|
|
||||||
Name[csb]=Pòdzérk zwãkù
|
|
||||||
Name[da]=Forhåndsvisning af lyd
|
|
||||||
Name[de]=Audiovorschau
|
|
||||||
Name[el]=Προεπισκόπηση ήχου
|
|
||||||
Name[en_GB]=Audio Preview
|
|
||||||
Name[eo]=Antaŭaŭskulto
|
|
||||||
Name[es]=Prueba de audio
|
|
||||||
Name[et]=Heli eelvaatlus
|
|
||||||
Name[eu]=Audio-aurrebista
|
|
||||||
Name[fa]=پیشنمایش صوتی
|
|
||||||
Name[fi]=Äänen esikuuntelu
|
|
||||||
Name[fr]=Aperçu de fichier audio
|
|
||||||
Name[fy]=Audio Foarbyld
|
|
||||||
Name[ga]=Réamhamharc Fuaime
|
|
||||||
Name[gl]=Vista previa do son
|
|
||||||
Name[gu]=ધ્વનિ પૂર્વદર્શન
|
|
||||||
Name[he]=השמעה מקדימה
|
|
||||||
Name[hi]=आडियो पूर्वावलोकन
|
|
||||||
Name[hne]=आडियो प्रीव्यू
|
|
||||||
Name[hr]=Preslušavanje
|
|
||||||
Name[hsb]=Přehladka za zwuki
|
|
||||||
Name[hu]=Hangminta
|
|
||||||
Name[ia]=Vista preliminar Audio
|
|
||||||
Name[id]=Pratilik Audio
|
|
||||||
Name[is]=Hljóðforsýn
|
|
||||||
Name[it]=Anteprima audio
|
|
||||||
Name[ja]=オーディオプレビュー
|
|
||||||
Name[kk]=Дыбысты алдын-ала қарау
|
|
||||||
Name[km]=មើលអូឌីយ៉ូជាមុន
|
|
||||||
Name[kn]=ಶ್ರವ್ಯಾಂಶ (ಧ್ವನಿ) ಮುನ್ನೋಟ
|
|
||||||
Name[ko]=오디오 미리 듣기
|
|
||||||
Name[ku]=Pêşdîtina Deng
|
|
||||||
Name[lt]=Audio perklausa
|
|
||||||
Name[lv]=Audio priekšapskate
|
|
||||||
Name[mai]=ऑडियो पूर्वावलोकन
|
|
||||||
Name[mk]=Аудиопреглед
|
|
||||||
Name[ml]=ശബ്ദം കേട്ടു് നോക്കുക
|
|
||||||
Name[mr]=आवाज पूर्वावलोकन
|
|
||||||
Name[nb]=Lydprøve
|
|
||||||
Name[nds]=Vörweghören
|
|
||||||
Name[ne]=अडियो पूर्वावलोकन
|
|
||||||
Name[nl]=Geluidsvoorbeeld
|
|
||||||
Name[nn]=Førehandsvising av lyd
|
|
||||||
Name[or]=ଧ୍ୱନି ପ୍ରାକଦର୍ଶନ
|
|
||||||
Name[pa]=ਆਡੀਓ ਝਲਕ
|
|
||||||
Name[pl]=Podgląd dźwięku
|
|
||||||
Name[pt]=Antevisão do Áudio
|
|
||||||
Name[pt_BR]=Previsão de áudio
|
|
||||||
Name[ro]=Previzualizare audio
|
|
||||||
Name[ru]=Прослушивание звукового файла
|
|
||||||
Name[se]=Jietna-ovdačájeheapmi
|
|
||||||
Name[si]=ස්වයංක්රීය පුර්වදසුන
|
|
||||||
Name[sk]=Náhľad zvuku
|
|
||||||
Name[sl]=Predogled zvoka
|
|
||||||
Name[sr]=Аудио преглед
|
|
||||||
Name[sr@ijekavian]=Аудио преглед
|
|
||||||
Name[sr@ijekavianlatin]=Audio pregled
|
|
||||||
Name[sr@latin]=Audio pregled
|
|
||||||
Name[sv]=Förhandsgranska ljud
|
|
||||||
Name[ta]=பதிவொலி மாதிரி
|
|
||||||
Name[te]=ఆడియో ఉపదర్శనం
|
|
||||||
Name[tg]=Шунидани пешакии аудио
|
|
||||||
Name[th]=ตัวอย่างเสียง
|
|
||||||
Name[tr]=Ses Ön İzlemesi
|
|
||||||
Name[ug]=ئۈننى ئالدىن كۆرۈش
|
|
||||||
Name[uk]=Перегляд аудіо
|
|
||||||
Name[vi]=Nghe trước âm thanh
|
|
||||||
Name[wa]=Prévoeyaedje di son
|
|
||||||
Name[x-test]=xxAudio Previewxx
|
|
||||||
Name[zh_CN]=音频预览
|
|
||||||
Name[zh_TW]=音效預覽
|
|
||||||
X-KDE-Library=librenaudioplugin
|
|
||||||
X-KDE-ServiceTypes=RenameDialog/Plugin,audio/mpeg,audio/x-wav,application/ogg
|
|
||||||
X-KDE-MediaPlayer=audio_rename_plugin
|
|
|
@ -1,21 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
########### next target ###############
|
|
||||||
|
|
||||||
set(renimageplugin_PART_SRCS imagevisualizer.cpp image_plugin.cpp )
|
|
||||||
|
|
||||||
kde4_add_plugin(renimageplugin WITH_PREFIX ${renimageplugin_PART_SRCS})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(renimageplugin ${KDE4_KIO_LIBS} )
|
|
||||||
|
|
||||||
install(TARGETS renimageplugin DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} )
|
|
||||||
|
|
||||||
|
|
||||||
########### install files ###############
|
|
||||||
|
|
||||||
install( FILES renimagedlg.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR} )
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
$XGETTEXT *.cpp -o $podir/imagerename_plugin.pot
|
|
|
@ -1,89 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2001, 2006 Holger Freyther <freyther@kde.org>
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <kio/renamedialogplugin.h>
|
|
||||||
#include <kio/global.h>
|
|
||||||
|
|
||||||
#include <kdebug.h>
|
|
||||||
#include <kpluginfactory.h>
|
|
||||||
#include <klocale.h>
|
|
||||||
#include <kiconloader.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QStringList>
|
|
||||||
|
|
||||||
//Added by qt3to4:
|
|
||||||
#include <QGridLayout>
|
|
||||||
#include <QLayout>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include "imagevisualizer.h"
|
|
||||||
|
|
||||||
class ImagePlugin : public KIO::RenameDialogPlugin {
|
|
||||||
public:
|
|
||||||
ImagePlugin( QWidget *dialog, const QVariantList & );
|
|
||||||
virtual bool wantToHandle( KIO::RenameDialog_Mode, const KIO::RenameDialogPlugin::FileItem&,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& ) const;
|
|
||||||
virtual void handle( KIO::RenameDialog_Mode, const KIO::RenameDialogPlugin::FileItem&,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& );
|
|
||||||
};
|
|
||||||
|
|
||||||
ImagePlugin::ImagePlugin( QWidget *dialog, const QVariantList & )
|
|
||||||
: RenameDialogPlugin(static_cast<QDialog*>(dialog))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ImagePlugin::wantToHandle( KIO::RenameDialog_Mode, const KIO::RenameDialogPlugin::FileItem&,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& ) const {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImagePlugin::handle( KIO::RenameDialog_Mode mode, const KIO::RenameDialogPlugin::FileItem& src,
|
|
||||||
const KIO::RenameDialogPlugin::FileItem& dst ) {
|
|
||||||
QGridLayout *lay = new QGridLayout( this );
|
|
||||||
if( mode & KIO::M_OVERWRITE ) {
|
|
||||||
QLabel *label = new QLabel(this );
|
|
||||||
label->setText(i18n("You want to overwrite the left picture with the one on the right.") );
|
|
||||||
label->adjustSize();
|
|
||||||
lay->addWidget(label, 1, 0, 1, 3, Qt::AlignHCenter );
|
|
||||||
adjustSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageVisualizer *left= new ImageVisualizer(this, dst.url() );
|
|
||||||
ImageVisualizer *right = new ImageVisualizer( this, src.url() );
|
|
||||||
|
|
||||||
lay->addWidget(left, 2, 0 );
|
|
||||||
lay->addWidget(right, 2, 2 );
|
|
||||||
adjustSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
K_PLUGIN_FACTORY(ImagePluginFactory,
|
|
||||||
registerPlugin<ImagePlugin>();)
|
|
||||||
K_EXPORT_PLUGIN(ImagePluginFactory("imagerename_plugin"))
|
|
|
@ -1,82 +0,0 @@
|
||||||
/* This file is part of the KDE project
|
|
||||||
Copyright (C) 2002 Holger Freyther <freyther@kde.org>
|
|
||||||
2003 Carsten Pfeiffer <pfeiffer@kde.org>
|
|
||||||
|
|
||||||
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; version 2
|
|
||||||
of the License.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "imagevisualizer.h"
|
|
||||||
|
|
||||||
#include <qlabel.h>
|
|
||||||
#include <qpixmap.h>
|
|
||||||
#include <qimage.h>
|
|
||||||
|
|
||||||
#include <klocale.h>
|
|
||||||
#include <kurl.h>
|
|
||||||
#include <kurllabel.h>
|
|
||||||
#include <kio/netaccess.h>
|
|
||||||
#include <kvbox.h>
|
|
||||||
|
|
||||||
ImageVisualizer::ImageVisualizer( QWidget *parent, const KUrl &url )
|
|
||||||
: KVBox( parent )
|
|
||||||
{
|
|
||||||
pic = 0;
|
|
||||||
description = 0;
|
|
||||||
setSpacing( 0 );
|
|
||||||
if( url.isValid() && url.isLocalFile() ) {
|
|
||||||
pic = new QLabel(this );
|
|
||||||
description = new QLabel( this );
|
|
||||||
loadImage( url.toLocalFile() );
|
|
||||||
} else if( !url.isLocalFile() ) {
|
|
||||||
KUrlLabel *label = new KUrlLabel( this );
|
|
||||||
label->setText(i18n("This picture is not stored\non the local host.\nClick on this label to load it.\n" ) );
|
|
||||||
label->setUrl( url.prettyUrl() );
|
|
||||||
connect(label, SIGNAL(leftClickedUrl(const QString&)), SLOT(downloadImage(const QString&)));
|
|
||||||
pic = label;
|
|
||||||
description = new QLabel(this);
|
|
||||||
description->adjustSize( );
|
|
||||||
} else {
|
|
||||||
description = new QLabel(this );
|
|
||||||
description->setText(i18n("Unable to load image") );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageVisualizer::loadImage( const QString& path )
|
|
||||||
{
|
|
||||||
QPixmap pix(path);
|
|
||||||
QPixmap pixmap(pix.scaled(180, 200, Qt::KeepAspectRatio, Qt::SmoothTransformation) );
|
|
||||||
pic->setText( QString() );
|
|
||||||
pic->setPixmap(pixmap );
|
|
||||||
pic->adjustSize();
|
|
||||||
|
|
||||||
QString desc;
|
|
||||||
desc.append(i18nc("The color depth of an image", "Depth: %1\n", pix.depth() ));
|
|
||||||
desc.append(i18nc("The dimensions of an image", "Dimensions: %1x%2", pix.width(), pix.height() ));
|
|
||||||
description->setText(desc );
|
|
||||||
description->adjustSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageVisualizer::downloadImage(const QString& url)
|
|
||||||
{
|
|
||||||
QString tmpFile;
|
|
||||||
if( KIO::NetAccess::download( KUrl( url ), tmpFile, window()) )
|
|
||||||
{
|
|
||||||
loadImage( tmpFile );
|
|
||||||
KIO::NetAccess::removeTempFile( tmpFile );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "moc_imagevisualizer.cpp"
|
|
|
@ -1,72 +0,0 @@
|
||||||
/* This file is part of the KDE project
|
|
||||||
Copyright (C) 2002 Holger Freyther <freyther@yahoo.com>
|
|
||||||
|
|
||||||
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; version 2
|
|
||||||
of the License.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; see the file COPYING. If not, write to
|
|
||||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef IMAGEVISUALIZER_H
|
|
||||||
#define IMAGEVISUALIZER_H
|
|
||||||
|
|
||||||
|
|
||||||
//Added by qt3to4:
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <kvbox.h>
|
|
||||||
|
|
||||||
#include <QPixmap>
|
|
||||||
#include <QLabel>
|
|
||||||
class KUrl;
|
|
||||||
|
|
||||||
class ImageVisualizer : public KVBox
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
ImageVisualizer(QWidget *parent, const KUrl & );
|
|
||||||
|
|
||||||
private:
|
|
||||||
void loadImage( const QString& path );
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void downloadImage( const QString& url );
|
|
||||||
|
|
||||||
private:
|
|
||||||
QLabel *pic;
|
|
||||||
QLabel *description;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Type=Service
|
|
||||||
Name=Image Displayer
|
|
||||||
Name[af]=Beeldwyser
|
|
||||||
Name[ar]=عارض صور
|
|
||||||
Name[ast]=Visor d'imáxenes
|
|
||||||
Name[be]=Праглядчык відарысаў
|
|
||||||
Name[be@latin]=Padhlad vyjavaŭ
|
|
||||||
Name[bg]=Показване на изображения
|
|
||||||
Name[bn]=চিত্র প্রদর্শক
|
|
||||||
Name[bn_IN]=ছবি প্রদর্শনব্যবস্থা
|
|
||||||
Name[bs]=Prikazivač slika
|
|
||||||
Name[ca]=Visor d'imatges
|
|
||||||
Name[ca@valencia]=Visor d'imatges
|
|
||||||
Name[cs]=Prohlížeč obrázků
|
|
||||||
Name[csb]=Przezérnik òbrôzków
|
|
||||||
Name[da]=Billedfremviser
|
|
||||||
Name[de]=Bildbetrachter
|
|
||||||
Name[el]=Προβολή εικόνων
|
|
||||||
Name[en_GB]=Image Displayer
|
|
||||||
Name[eo]=Bildomontrilo
|
|
||||||
Name[es]=Visor de imágenes
|
|
||||||
Name[et]=Pildinäitaja
|
|
||||||
Name[eu]=Irudi-ikustailea
|
|
||||||
Name[fa]=نمایشگر تصویر
|
|
||||||
Name[fi]=Kuvannäytin
|
|
||||||
Name[fr]=Afficheur d'image
|
|
||||||
Name[fy]=Ofbylding werjouwer
|
|
||||||
Name[ga]=Amharcán Íomhánna
|
|
||||||
Name[gl]=Visor de imaxes
|
|
||||||
Name[gu]=ચિત્ર દર્શક
|
|
||||||
Name[he]=מציג תמונות
|
|
||||||
Name[hi]=छवि प्रदर्शक
|
|
||||||
Name[hne]=फोटो दिखइया
|
|
||||||
Name[hr]=Preglednik slika
|
|
||||||
Name[hsb]=Přehladowar worazow
|
|
||||||
Name[hu]=Képnézegető
|
|
||||||
Name[ia]=Monstrator de imagine
|
|
||||||
Name[id]=Penampil Gambar
|
|
||||||
Name[is]=Myndbirtir
|
|
||||||
Name[it]=Visore di immagini
|
|
||||||
Name[ja]=イメージ表示ツール
|
|
||||||
Name[kk]=Кескінді қарау құралы
|
|
||||||
Name[km]=កម្មវិធីបង្ហាញរូបភាព
|
|
||||||
Name[kn]=ಬಿಂಬ (ಇಮೇಜ್) ಪ್ರದರ್ಶಕ
|
|
||||||
Name[ko]=그림 뷰어
|
|
||||||
Name[ku]=Pêşandana Wêneyî
|
|
||||||
Name[lt]=Paveikslėlių rodymo priemonė
|
|
||||||
Name[lv]=Attēlu skatītājs
|
|
||||||
Name[mai]=छवि देखैनिहार
|
|
||||||
Name[mk]=Прикажувач на слики
|
|
||||||
Name[ml]=ചിത്രം പ്രദര്ശിപ്പിക്കുന്നതിനുള്ള സംവിധാനം
|
|
||||||
Name[mr]=प्रतिमा प्रदर्शक
|
|
||||||
Name[nb]=Bildeviser
|
|
||||||
Name[nds]=Bildwieser
|
|
||||||
Name[ne]=छवि प्रदर्शक
|
|
||||||
Name[nl]=Afbeeldingweergave
|
|
||||||
Name[nn]=Biletvisar
|
|
||||||
Name[or]=ପ୍ରତିଛବି ପ୍ରଦର୍ଶକ
|
|
||||||
Name[pa]=ਚਿੱਤਰ ਦਰਸ਼ਕ
|
|
||||||
Name[pl]=Wyświetlacz obrazu
|
|
||||||
Name[pt]=Visualizador de Imagens
|
|
||||||
Name[pt_BR]=Visualizador de imagens
|
|
||||||
Name[ro]=Afișor de imagini
|
|
||||||
Name[ru]=Просмотр изображения
|
|
||||||
Name[se]=Govvačájeheaddji
|
|
||||||
Name[si]=පිංතූර දර්ශකය
|
|
||||||
Name[sk]=Prehliadač obrázkov
|
|
||||||
Name[sl]=Prikazovalnik slik
|
|
||||||
Name[sr]=Приказивач слика
|
|
||||||
Name[sr@ijekavian]=Приказивач слика
|
|
||||||
Name[sr@ijekavianlatin]=Prikazivač slika
|
|
||||||
Name[sr@latin]=Prikazivač slika
|
|
||||||
Name[sv]=Bildvisare
|
|
||||||
Name[ta]=பிம்ப காட்டி
|
|
||||||
Name[te]=చిత్ర ప్రదర్శని
|
|
||||||
Name[tg]=Намоишгари тасвирҳо
|
|
||||||
Name[th]=ตัวแสดงภาพ
|
|
||||||
Name[tr]=Resim Gösterici
|
|
||||||
Name[ug]=سۈرەت كۆرسەتكۈچ
|
|
||||||
Name[uk]=Перегляд зображень
|
|
||||||
Name[vi]=Trình hiển thị ảnh
|
|
||||||
Name[wa]=Håyneu d' imådje
|
|
||||||
Name[x-test]=xxImage Displayerxx
|
|
||||||
Name[zh_CN]=图片显示器
|
|
||||||
Name[zh_TW]=影像顯示
|
|
||||||
X-KDE-Library=librenimageplugin
|
|
||||||
X-KDE-ServiceTypes=RenameDialog/Plugin,image/jpeg,image/png
|
|
Loading…
Add table
Reference in a new issue