diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/cpp/app_templates/noatunui | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/app_templates/noatunui')
-rw-r--r-- | languages/cpp/app_templates/noatunui/.kdev_ignore | 0 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/Makefile.am | 17 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/noatunui | 8 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/noatunui.kdevtemplate | 195 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/noatunui.png | bin | 0 -> 5433 bytes | |||
-rw-r--r-- | languages/cpp/app_templates/noatunui/plugin.kdevelop | 111 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/plugin.plugin | 8 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/plugin_app.cpp | 15 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/plugin_impl.cpp | 301 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/plugin_impl.h | 78 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/src-Makefile.am | 24 | ||||
-rw-r--r-- | languages/cpp/app_templates/noatunui/subdirs | 3 |
12 files changed, 760 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/noatunui/.kdev_ignore b/languages/cpp/app_templates/noatunui/.kdev_ignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/languages/cpp/app_templates/noatunui/.kdev_ignore diff --git a/languages/cpp/app_templates/noatunui/Makefile.am b/languages/cpp/app_templates/noatunui/Makefile.am new file mode 100644 index 00000000..29358f2f --- /dev/null +++ b/languages/cpp/app_templates/noatunui/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = src-Makefile.am plugin_app.cpp plugin_impl.cpp plugin_impl.h \ + noatunui.png plugin.plugin plugin.kdevelop subdirs +templateName = noatunui + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz
\ No newline at end of file diff --git a/languages/cpp/app_templates/noatunui/noatunui b/languages/cpp/app_templates/noatunui/noatunui new file mode 100644 index 00000000..631c4798 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/noatunui @@ -0,0 +1,8 @@ +# KDE Config File +[General] +Name=Noatun UI plugin +Icon=noatunui.png +Category=C++/KDE +Comment=Generates a simple user interface plugin for noatun. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/plugin_APPNAMELC_impl.cpp diff --git a/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate b/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate new file mode 100644 index 00000000..394e71ed --- /dev/null +++ b/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate @@ -0,0 +1,195 @@ +# KDE Config File +[General] +Name=Noatun UI plugin +Name[ca]=Connector d'interfície d'usuari per a Noatun +Name[de]=Noatun-UI-Modul +Name[el]=Πρόσθετο Noatun UI +Name[es]=Complemento de interfaz de usuario para Noatun +Name[et]=Noatuni kasutajaliidese plugin +Name[eu]=Noatun UI plugina +Name[fa]=وصلۀ Noatun UI +Name[fr]=Module externe d'interface utilisateur pour Noatun +Name[ga]=Breiseán Chomhéadan Noatun +Name[gl]=Extensión para a IU de Noatun +Name[hu]=Noatun UI-modul +Name[it]=Plugin UI di noatun +Name[ja]=Noatun UI プラグイン +Name[nds]=Böversiet-Moduul för Noatun +Name[ne]=नोअटन UI plugin +Name[nl]=Noatun UI-plugin +Name[pl]=Wtyczka do interfejsu użytkownika Noatun +Name[pt]='Plugin' de UI do Noatun +Name[pt_BR]='Plugin' de UI do Noatun +Name[ru]=Модуль интерфейса Noatun +Name[sk]=Noatun UI modul +Name[sr]=UI прикључак за Noatun +Name[sr@Latn]=UI priključak za Noatun +Name[sv]=Noatun-insticksprogram för användargränssnitt +Name[tr]=Noatun Arayüz eklentisi +Name[zh_CN]=Noatun 界面插件 +Name[zh_TW]=Noatun 使用者介面外掛程式 +Icon=noatunui.png +Category=C++/KDE +Comment=Generates a simple user interface plugin for noatun. +Comment[ca]=Genera un simple connector d'interfície d'usuari per a Noatun. +Comment[da]=Genererer en simpel brugergrænseflade-plugin for noatun. +Comment[de]=Erstellt ein einfaches Oberflächen-Modul für Noatun +Comment[el]=Δημιουργεί ένα απλό πρόσθετο γραφικού περιβάλλοντος για το noatun. +Comment[es]=Genera un complemento de interfaz de usuario para Noatun. +Comment[et]=Noatuni lihtsa kasutajaliidese plugina loomine. +Comment[eu]=Noatun-entzat erabiltzaile-interfazerako plugin sinple bat sortzen du. +Comment[fa]=یک وصلۀ واسط کاربر ساده برای noatun تولید میکند. +Comment[fr]=Génère un module externe d'interface utilisateur simple pour Noatun. +Comment[gl]=Xera unha extensión sinxela para a interface de usuario de noatun. +Comment[hu]=Létrehoz egy egyszerű felületbővítő modult a Noatun programhoz. +Comment[it]=Genera un semplice plugin di interfaccia per noatun. +Comment[nds]=Stellt en eenfach Böversietmoduul för Noatun op. +Comment[ne]=नोअटनका लागि साधारण इन्टरफेस प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een eenvoudige gebruikersinterfaceplugin voor Noatun. +Comment[pl]=Generuje prostą wtyczkę do interfejsu użytkownika programu Noatun. +Comment[pt]=Gera um 'plugin' simples para a interface de utilizador do Noatun. +Comment[pt_BR]=Gera um 'plugin' simples para a interface de utilizador do Noatun. +Comment[ru]=Создание простого интерфейса для Noatun. +Comment[sk]=Vygeneruje jednoduchý modul užívateľského rozhrania pre Noatun +Comment[sr]=Прави једноставан прикључак корисничког интерфејса за Noatun. +Comment[sr@Latn]=Pravi jednostavan priključak korisničkog interfejsa za Noatun. +Comment[sv]=Skapar ett enkelt insticksprogram för användargränssnitt till Noatun. +Comment[tr]=Noatun için basit bir kullanıcı arayüzü eklentisi yaratır. +Comment[zh_CN]=生成 noatun 的简单用户界面插件。 +Comment[zh_TW]=產生一個簡單的 noatun 的使用者介面外掛程式。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp +Archive=noatunui.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/plugin_impl.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp + +[FILE14] +Type=install +Source=%{src}/plugin_impl.h +Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.h + +[FILE15] +Type=install +Source=%{src}/plugin.plugin +Dest=%{dest}/src/%{APPNAMELC}.plugin + +[MSG] +Type=message +Comment=A Noatun UI plugin was created in %{dest} +Comment[ca]=Un connector d'interfície d'usuari per a Noatun ha estat creat en %{dest} +Comment[da]=Et Noatun UI-plugin blev oprettet i %{dest} +Comment[de]=Ein Oberflächen-Modul für Noatun wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο Noatun UI δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento de interfaz de usuario para Noatun ha sido creado en %{dest} +Comment[et]=Noatuni kasutajaliidese plugin loodi asukohta %{dest} +Comment[eu]=Noatun UI plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ Noatun UI در %{dest} ایجاد شد +Comment[fr]=Un module externe d'interface utilisateur pour Noatun a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán chomhéadan Noatun i %{dest} +Comment[gl]=Creouse unha extensión para a IU de Noatun en %{dest} +Comment[hu]=Létrejött egy Noatun UI-modul itt: %{dest} +Comment[it]=È stato creato un plugin UI per noatun in %{dest} +Comment[ja]=Noatun UI プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Noatun-Böversietmoduul opstellt +Comment[ne]=नोअटन UI प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Noatun UI-plugin is aangemaakt in %{dest} +Comment[pl]=Wtyczka do interfejsu Noatun została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' da UI do Noatun em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' da UI do Noatun em %{dest} +Comment[ru]=Модуль интерфейса для Noatun создан в %{dest} +Comment[sk]=Noatun UI modul bol vytvorený v %{dest} +Comment[sr]=UI прикључак за Noatun направљен је у %{dest} +Comment[sr@Latn]=UI priključak za Noatun napravljen je u %{dest} +Comment[sv]=Ett Noatun-insticksprogram för användargränssnitt skapades i %{dest} +Comment[tr]=Bir Noatun Arayüz eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 Noatun 界面插件 +Comment[zh_TW]=一個 Noatun 使用者介面外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/noatunui/noatunui.png b/languages/cpp/app_templates/noatunui/noatunui.png Binary files differnew file mode 100644 index 00000000..0d2c3e30 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/noatunui.png diff --git a/languages/cpp/app_templates/noatunui/plugin.kdevelop b/languages/cpp/app_templates/noatunui/plugin.kdevelop new file mode 100644 index 00000000..f0cda142 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin.kdevelop @@ -0,0 +1,111 @@ +<?xml version="1.0"?> +<kdevelop> + <general> + <author>%{AUTHOR}</author> + <email>%{EMAIL}</email> + <version>%{VERSION}</version> + <projectmanagement>KDevKDEAutoProject</projectmanagement> + <primarylanguage>C++</primarylanguage> + <keywords> + <keyword>C++</keyword> + <keyword>Code</keyword> + <keyword>Qt</keyword> + <keyword>KDE</keyword> + </keywords> + </general> + <kdevcppsupport> + <qt> + <version>3</version> + <used>true</used> + <includestyle>3</includestyle> + <designerintegration>EmbeddedKDevDesigner</designerintegration> + </qt> + </kdevcppsupport> + +<kdevautoproject> + <general> + <activetarget>src/noatun_%{APPNAMELC}plugin.la</activetarget> + <useconfiguration>debug</useconfiguration> + </general> + <configurations> + <optimized> + <builddir>optimized</builddir> + <ccompiler>kdevgccoptions</ccompiler> + <cxxcompiler>kdevgppoptions</cxxcompiler> + <f77compiler>kdevg77options</f77compiler> + <cxxflags>-O2 -g0</cxxflags> + </optimized> + <debug> + <configargs>--enable-debug=full</configargs> + <builddir>debug</builddir> + <ccompiler>kdevgccoptions</ccompiler> + <cxxcompiler>kdevgppoptions</cxxcompiler> + <f77compiler>kdevg77options</f77compiler> + <cxxflags>-O0 -g3</cxxflags> + </debug> + </configurations> + </kdevautoproject> + <kdevfileview> + <groups> + <group pattern="*.cpp;*.cxx;*.h" name="Sources" /> + <group pattern="*.ui" name="User Interface" /> + <group pattern="*.png" name="Icons" /> + <group pattern="*.po;*.ts" name="Translations" /> + <group pattern="*" name="Others" /> + </groups> + </kdevfileview> + <kdevdoctreeview> + <ignoretocs> + <toc>bash</toc> + <toc>bash_bugs</toc> + <toc>clanlib</toc> + <toc>w3c-dom-level2-html</toc> + <toc>fortran_bugs_gcc</toc> + <toc>gnome1</toc> + <toc>gnustep</toc> + <toc>gtk</toc> + <toc>gtk_bugs</toc> + <toc>haskell</toc> + <toc>haskell_bugs_ghc</toc> + <toc>java_bugs_gcc</toc> + <toc>java_bugs_sun</toc> + <toc>opengl</toc> + <toc>pascal_bugs_fp</toc> + <toc>php</toc> + <toc>php_bugs</toc> + <toc>perl</toc> + <toc>perl_bugs</toc> + <toc>python</toc> + <toc>python_bugs</toc> + <toc>ruby</toc> + <toc>ruby_bugs</toc> + <toc>stl</toc> + <toc>w3c-svg</toc> + <toc>sw</toc> + <toc>w3c-uaag10</toc> + <toc>wxwidgets_bugs</toc> + </ignoretocs> + <ignoreqt_xml> + <toc>qmake User Guide</toc> + </ignoreqt_xml> + </kdevdoctreeview> + <kdevdebugger> + <general> + <dbgshell>libtool</dbgshell> + </general> + </kdevdebugger> + <kdevfilecreate> + <filetypes/> + <useglobaltypes> + <type ext="ui" /> + <type ext="cpp" /> + <type ext="h" /> + </useglobaltypes> + </kdevfilecreate> + <kdevdocumentation> + <projectdoc> + <docsystem>Doxygen Documentation Collection</docsystem> + <docurl>%{APPNAMELC}.tag</docurl> + </projectdoc> + </kdevdocumentation> +</kdevelop> diff --git a/languages/cpp/app_templates/noatunui/plugin.plugin b/languages/cpp/app_templates/noatunui/plugin.plugin new file mode 100644 index 00000000..a7bb9170 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin.plugin @@ -0,0 +1,8 @@ +Filename=noatun_%{APPNAMELC}plugin.la +Author=%{AUTHOR} +Site=http://noatun.kde.org/ +Email=%{EMAIL} +Type=userinterface +License=$LICENSE$ +Name=%{APPNAME} +Comment=A UI for Noatun diff --git a/languages/cpp/app_templates/noatunui/plugin_app.cpp b/languages/cpp/app_templates/noatunui/plugin_app.cpp new file mode 100644 index 00000000..23067139 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin_app.cpp @@ -0,0 +1,15 @@ + +#include "plugin_%{APPNAMELC}_impl.h" + +#include <kglobal.h> +#include <klocale.h> + +extern "C" +{ + Plugin *create_plugin() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}UI; + } +} + diff --git a/languages/cpp/app_templates/noatunui/plugin_impl.cpp b/languages/cpp/app_templates/noatunui/plugin_impl.cpp new file mode 100644 index 00000000..1b5eea45 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin_impl.cpp @@ -0,0 +1,301 @@ + +#include "plugin_%{APPNAMELC}_impl.h" +#include "plugin_%{APPNAMELC}_impl.moc" + +#include <noatun/playlist.h> +#include <noatun/stdaction.h> +#include <noatun/app.h> +#include <noatun/player.h> +#include <noatun/controls.h> +#include <noatun/effects.h> + +#include <qpushbutton.h> +#include <qdragobject.h> +#include <qlayout.h> +#include <qtooltip.h> +#include <qobjectlist.h> +#include <qobjectdict.h> + +#include <kpopupmenu.h> +#include <kstatusbar.h> +#include <kglobal.h> +#include <klocale.h> +#include <kiconloader.h> +#include <kurldrag.h> +//#include <kfiledialog.h> +//#include <kconfig.h> + +%{APPNAME}UI::%{APPNAME}UI() : QWidget(0,"%{APPNAME}UI"), UserInterface() +{ + setAcceptDrops(true); + static const int buttonSize=32; + + mBack=new QPushButton(this); + mBack->setFixedSize(buttonSize,buttonSize); + mBack->setPixmap(BarIcon("noatunback")); + connect(mBack, SIGNAL(clicked()), napp->player(), SLOT(back())); + QToolTip::add(mBack,i18n("Back")); + + mStop=new QPushButton(this); + mStop->setFixedSize(buttonSize,buttonSize); + mStop->setPixmap(BarIcon("noatunstop")); + connect(mStop, SIGNAL(clicked()), napp->player(), SLOT(stop())); + QToolTip::add(mStop, i18n("Stop")); + + mPlay=new QPushButton(this); + mPlay->setToggleButton(true); + mPlay->setFixedSize(buttonSize,buttonSize); + mPlay->setPixmap(BarIcon("noatunplay")); + connect(mPlay, SIGNAL(clicked()), napp->player(), SLOT(playpause())); + QToolTip::add(mPlay, i18n("Play")); + + mForward=new QPushButton(this); + mForward->setFixedSize(buttonSize,buttonSize); + mForward->setPixmap(BarIcon("noatunforward")); + connect(mForward, SIGNAL(clicked()), napp->player(), SLOT(forward())); + QToolTip::add(mForward, i18n("Forward")); + + mPlaylist=new QPushButton(this); + mPlaylist->setToggleButton(true); + mPlaylist->setFixedSize(buttonSize,buttonSize); + mPlaylist->setPixmap(BarIcon("noatunplaylist")); + connect(mPlaylist, SIGNAL(clicked()), napp->player(), SLOT(toggleListView())); + QToolTip::add(mPlaylist, i18n("Playlist")); + + mLoop=new QPushButton(this); + mLoop->setFixedSize(buttonSize,buttonSize); + mLoop->setPixmap(BarIcon("noatunloopnone")); + connect(mLoop, SIGNAL(clicked()), napp->player(), SLOT(loop())); + QToolTip::add(mLoop, i18n("Change loop style")); + + mPopup=new QPushButton(this); + mPopup->setFixedSize(buttonSize,buttonSize); + mPopup->setPixmap(BarIcon("noatun")); + connect(mPopup, SIGNAL(clicked()), SLOT(popup())); + + + mVolume=new L33tSlider(0,100,10,0, Horizontal, this); + mVolume->setValue(napp->player()->volume()); + mSeeker=new L33tSlider(0,1000,10,0, Horizontal, this); + + mStatusBar=new KStatusBar(this); + + + QGridLayout *l=new QGridLayout(this); + l->addWidget(mBack,0,0); + l->addWidget(mStop,0,1); + l->addWidget(mPlay,0,2); + l->addWidget(mForward,0,3); + l->addWidget(mPlaylist,0,4, Qt::AlignLeft); + l->addWidget(mLoop,0,5); + l->addWidget(mPopup,0,6); + l->addColSpacing(4, buttonSize+8); + + l->addMultiCellWidget(mVolume,1,1,0,6); + l->addMultiCellWidget(mSeeker,2,2,0,6); + l->addMultiCellWidget(mStatusBar,3,3,0,6); + + statusBar()->message(i18n("No File Loaded")); + statusBar()->insertItem("--:--/--:--", 1, 0, true); + + connect(napp, SIGNAL(hideYourself()), this, SLOT(hide()) ); + connect(napp, SIGNAL(showYourself()), this, SLOT(show()) ); + + connect(napp->player(), SIGNAL(playing()), this, SLOT(slotPlaying())); + connect(napp->player(), SIGNAL(stopped()), this, SLOT(slotStopped())); + connect(napp->player(), SIGNAL(paused()), this, SLOT(slotPaused())); + napp->player()->handleButtons(); + + connect(napp->player(), SIGNAL(timeout()), this, SLOT(slotTimeout())); + connect(napp->player(), SIGNAL(loopTypeChange(int)), this, SLOT(changeLoopType(int))); + + /* This skipToWrapper is needed to pass milliseconds to Player() as everybody + * below the GUI is based on milliseconds instead of some unprecise thingy + * like seconds or mille */ + connect(seeker(), SIGNAL(userChanged(int)), this, SLOT(skipToWrapper(int))); + connect(this, SIGNAL(skipTo(int)), napp->player(), SLOT(skipTo(int))); + connect(seeker(), SIGNAL(sliderMoved(int)), SLOT(sliderMoved(int))); + + connect(mVolume, SIGNAL(sliderMoved(int)), napp->player(), SLOT(setVolume(int))); + connect(mVolume, SIGNAL(userChanged(int)), napp->player(), SLOT(setVolume(int))); + + + connect(napp->player(), SIGNAL(playlistShown()), SLOT(playlistShown())); + connect(napp->player(), SIGNAL(playlistHidden()), SLOT(playlistHidden())); + + // Event Filter for the RMB + for (QPtrListIterator<QObject> i(*children()); i.current(); ++i) + (*i)->installEventFilter(this); + + setCaption("Noatun"); + setIcon(BarIcon("noatun")); + show(); + + // What it is now, stay. + setFixedSize(minimumSize()); +} + +%{APPNAME}UI::~%{APPNAME}UI() +{ + /** save settings here */ +} + +void %{APPNAME}UI::closeEvent(QCloseEvent*) +{ + unload(); +} + +void %{APPNAME}UI::showEvent(QShowEvent*e) +{ + QWidget::showEvent(e); +} + +void %{APPNAME}UI::dragEnterEvent(QDragEnterEvent *event) +{ + // accept uri drops only + event->accept(KURLDrag::canDecode(event)); +} + +void %{APPNAME}UI::dropEvent(QDropEvent *event) +{ + KURL::List uri; + if (KURLDrag::decode(event, uri)) + { + for (KURL::List::Iterator i = uri.begin(); i != uri.end(); ++i) + napp->player()->openFile(*i, false); + } +} + +void %{APPNAME}UI::mouseReleaseEvent(QMouseEvent *e) +{ + QWidget::mouseReleaseEvent(e); + if (e->button()!=RightButton) return; + NoatunStdAction::ContextMenu::showContextMenu(); +} + +void %{APPNAME}UI::changeStatusbar(const QString& text, const QString &text2) +{ + if (!text2.isNull()) + statusBar()->changeItem(text2, 1); + + statusBar()->message(!text.isNull() ? text : napp->player()->current().title()); +} + +void %{APPNAME}UI::changeCaption(const QString& text) +{ + setCaption(text); +} + +void %{APPNAME}UI::popup() +{ + NoatunStdAction::ContextMenu::showContextMenu( + mapToGlobal(mPopup->geometry().bottomLeft()) ); +} + +void %{APPNAME}UI::slotPlaying() +{ + changeStatusbar(napp->player()->current().title(), napp->player()->lengthString()); + mPlay->setOn(true); + mStop->setEnabled(true); + mPlay->setPixmap(BarIcon("noatunpause")); +} + +void %{APPNAME}UI::slotStopped() +{ + if (!napp->player()->current()) return; + changeStatusbar(i18n("No File Loaded"), napp->player()->lengthString()); + mStop->setEnabled(false); + mPlay->setOn(false); + seeker()->setValue(0); + mPlay->setPixmap(BarIcon("noatunplay")); +} + +void %{APPNAME}UI::slotPaused() +{ + mStop->setEnabled(true); + mPlay->setOn(false); + mPlay->setPixmap(BarIcon("noatunplay")); +} + +void %{APPNAME}UI::slotTimeout() +{ + mVolume->setValue(napp->player()->volume()); + + if (!napp->player()->current()) return; + if (static_cast<L33tSlider*>(seeker())->currentlyPressed()) return; + if (seeker()) + { + seeker()->setRange ( 0, (int)napp->player()->getLength()/1000 ); + seeker()->setValue ( (int)napp->player()->getTime()/1000 ); + } + changeStatusbar(0, napp->player()->lengthString()); +} + +void %{APPNAME}UI::sliderMoved(int seconds) +{ + if (napp->player()->current()) + changeStatusbar(0, napp->player()->lengthString(seconds*1000)); +} + +void %{APPNAME}UI::skipToWrapper(int second) +{ + emit skipTo((long)(second*1000)); +} + +void %{APPNAME}UI::changeLoopType(int t) +{ + static const int time=2000; + switch (t) + { + case(Player::None): + statusBar()->message(i18n("No looping"), time); + mLoop->setPixmap(BarIcon("noatunloopnone")); + break; + case(Player::Song): + statusBar()->message(i18n("Song looping"), time); + mLoop->setPixmap(BarIcon("noatunloopsong")); + break; + case(Player::Playlist): + statusBar()->message(i18n("Playlist looping"), time); + mLoop->setPixmap(BarIcon("noatunloopplaylist")); + break; + case(Player::Random): + statusBar()->message(i18n("Random play"), time); + mLoop->setPixmap(BarIcon("noatunlooprandom")); + } +} + +bool %{APPNAME}UI::eventFilter(QObject *o, QEvent *e) +{ + if ((e->type() == QEvent::MouseButtonRelease) + && ((static_cast<QMouseEvent*>(e))->button()==RightButton)) + { + mouseReleaseEvent(static_cast<QMouseEvent*>(e)); + return true; + } + + if (e->type() == QEvent::Wheel) + { + wheelEvent(static_cast<QWheelEvent*>(e)); + return true; + } + return QWidget::eventFilter(o, e); +} + +void %{APPNAME}UI::playlistShown() +{ + mPlaylist->setOn(true); +} + +void %{APPNAME}UI::playlistHidden() +{ + mPlaylist->setOn(false); +} + +void %{APPNAME}UI::wheelEvent(QWheelEvent *e) +{ + int delta=e->delta(); + mVolume->setValue(mVolume->value()+(delta/120)); + napp->player()->setVolume(mVolume->value()+(delta/120)); +} + diff --git a/languages/cpp/app_templates/noatunui/plugin_impl.h b/languages/cpp/app_templates/noatunui/plugin_impl.h new file mode 100644 index 00000000..970246d4 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin_impl.h @@ -0,0 +1,78 @@ + +#ifndef %{APPNAMEUC}_IMPL_H +#define %{APPNAMEUC}_IMPL_H + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <noatun/plugin.h> +#include <noatun/app.h> + +// Pref dialog pointer global now for position saving +#include <noatun/pref.h> + +class Player; +class QSlider; +class QPushButton; +class KStatusBar; + +/** + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version 0.1 + * Note: You can user _every_ widget for implementing your userinterface. + */ +class %{APPNAME}UI : public QWidget, public UserInterface +{ +Q_OBJECT +public: + %{APPNAME}UI(); + virtual ~%{APPNAME}UI(); + void load(const QString& url); + +protected: + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dropEvent(QDropEvent *event); + virtual void closeEvent(QCloseEvent*); + virtual void showEvent(QShowEvent*e); + /** RMB -> context menu */ + virtual void mouseReleaseEvent(QMouseEvent *); + virtual bool eventFilter(QObject*, QEvent*); + /** volume control */ + virtual void wheelEvent(QWheelEvent *e); + +protected: + QSlider *seeker() const { return mSeeker; } + KStatusBar *statusBar() const { return mStatusBar; } + +public slots: + void slotPlaying(); + void slotStopped(); + void slotPaused(); + + /** "show/hide playlist" button */ + void playlistShown(); + void playlistHidden(); + + void slotTimeout(); + void sliderMoved(int seconds); + void changeLoopType(int t); + void skipToWrapper(int second); + +signals: + void skipTo( int ); // emitted by skipToWrapper() + +private slots: + void changeStatusbar(const QString& text, const QString &text2=0); + void changeCaption(const QString& text); + void popup(); + +private: + QPushButton *mBack, *mStop, *mPlay, *mForward, *mPlaylist, *mPopup, *mLoop; + QSlider *mSeeker, *mVolume; + KStatusBar *mStatusBar; +}; + +#endif // %{APPNAMEUC}_IMPL_H + diff --git a/languages/cpp/app_templates/noatunui/src-Makefile.am b/languages/cpp/app_templates/noatunui/src-Makefile.am new file mode 100644 index 00000000..95506569 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/src-Makefile.am @@ -0,0 +1,24 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = noatun_%{APPNAMELC}plugin.la + +noatun_%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp plugin_%{APPNAMELC}_impl.cpp +noatun_%{APPNAMELC}plugin_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +noatun_%{APPNAMELC}plugin_la_LIBADD = $(LIB_KFILE) -lnoatun -lnoatuncontrols \ + -lqtmcop -lkmedia2_idl -lsoundserver_idl + +noinst_HEADERS = plugin_%{APPNAMELC}_impl.h + +# noatun_modules_uidir = $(kde_datadir)/noatun +# noatun_modules_ui_DATA = %{APPNAMELC}.plugin + +pluginsdir = $(kde_datadir)/noatun +plugins_DATA = %{APPNAMELC}.plugin + +# kde_services_DATA = %{APPNAMELC}.desktop + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/noatunui/subdirs b/languages/cpp/app_templates/noatunui/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/subdirs @@ -0,0 +1,3 @@ +doc +po +src |