summaryrefslogtreecommitdiffstats
path: root/kicker/menuext/tdeprint
diff options
context:
space:
mode:
Diffstat (limited to 'kicker/menuext/tdeprint')
-rw-r--r--kicker/menuext/tdeprint/CMakeLists.txt33
-rw-r--r--kicker/menuext/tdeprint/Makefile.am15
-rw-r--r--kicker/menuext/tdeprint/print_mnu.cpp139
-rw-r--r--kicker/menuext/tdeprint/print_mnu.h46
-rw-r--r--kicker/menuext/tdeprint/printmenu.desktop144
5 files changed, 377 insertions, 0 deletions
diff --git a/kicker/menuext/tdeprint/CMakeLists.txt b/kicker/menuext/tdeprint/CMakeLists.txt
new file mode 100644
index 000000000..a013bcf82
--- /dev/null
+++ b/kicker/menuext/tdeprint/CMakeLists.txt
@@ -0,0 +1,33 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+##### other data ################################
+
+install( FILES printmenu.desktop DESTINATION ${DATA_INSTALL_DIR}/kicker/menuext )
+
+
+##### kickermenu_tdeprint (module) ##############
+
+tde_add_kpart( kickermenu_tdeprint AUTOMOC
+ SOURCES print_mnu.cpp
+ LINK tdeprint-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/kicker/menuext/tdeprint/Makefile.am b/kicker/menuext/tdeprint/Makefile.am
new file mode 100644
index 000000000..c8ad7858a
--- /dev/null
+++ b/kicker/menuext/tdeprint/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kickermenu_tdeprint.la
+
+kickermenu_tdeprint_la_SOURCES = print_mnu.cpp
+kickermenu_tdeprint_la_LDFLAGS = $(all_libraries) -module -avoid-version
+kickermenu_tdeprint_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) -ltdeprint
+
+kickermenu_tdeprint_la_METASOURCES = AUTO
+
+desktopmenu_DATA = printmenu.desktop
+desktopmenudir = $(kde_datadir)/kicker/menuext
+
+messages:
+ $(XGETTEXT) *.cpp -o $(podir)/libkickermenu_tdeprint.pot
diff --git a/kicker/menuext/tdeprint/print_mnu.cpp b/kicker/menuext/tdeprint/print_mnu.cpp
new file mode 100644
index 000000000..dee220d80
--- /dev/null
+++ b/kicker/menuext/tdeprint/print_mnu.cpp
@@ -0,0 +1,139 @@
+/*****************************************************************
+
+Copyright (c) 1996-2001 the kicker authors. See file AUTHORS.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+******************************************************************/
+
+#include "print_mnu.h"
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kapplication.h>
+#include <krun.h>
+#include <tdeprint/kmmanager.h>
+#include <tqregexp.h>
+
+K_EXPORT_KICKER_MENUEXT(tdeprint, PrintMenu)
+
+#define ADD_PRINTER_ID 0
+#define KDEPRINT_SETTINGS_ID 1
+#define CONFIG_SERVER_ID 2
+#define PRINT_MANAGER_ID 3
+#define PRINT_BROWSER_ID 4
+#define KPRINTER_ID 5
+#define PRINTER_LIST_ID 10
+
+PrintMenu::PrintMenu(TQWidget *parent, const char *name, const TQStringList & /*args*/)
+: KPanelMenu("", parent, name)
+{
+ static bool tdeprintIconsInitialized = false;
+ if ( !tdeprintIconsInitialized ) {
+ KGlobal::iconLoader()->addAppDir("tdeprint");
+ tdeprintIconsInitialized = true;
+ }
+}
+
+PrintMenu::~PrintMenu()
+{
+}
+
+void PrintMenu::initialize()
+{
+ if (initialized()) clear();
+ setInitialized(true);
+
+ int ID = PRINTER_LIST_ID;
+ // just to be sure the plugin is loaded -> icons are available
+ KMManager::self();
+
+ if ((KMManager::self()->printerOperationMask() & KMManager::PrinterCreation) && KMManager::self()->hasManagement())
+ insertItem(SmallIconSet("wizard"), i18n("Add Printer..."), ADD_PRINTER_ID);
+ insertItem(SmallIconSet("tdeprint_configmgr"), i18n("KDE Print Settings"), KDEPRINT_SETTINGS_ID);
+ if (KMManager::self()->serverOperationMask() & KMManager::ServerConfigure)
+ insertItem(SmallIconSet("tdeprint_configsrv"), i18n("Configure Server"), CONFIG_SERVER_ID);
+ insertSeparator();
+ insertItem(SmallIconSet("kcontrol"), i18n("Print Manager"), PRINT_MANAGER_ID);
+ insertItem(SmallIconSet("konqueror"), i18n("Print Browser (Konqueror)"), PRINT_BROWSER_ID);
+ insertSeparator();
+ insertItem(SmallIconSet("fileprint"), i18n("Print File..."), KPRINTER_ID);
+
+ // printer list
+ TQPtrList<KMPrinter> *l = KMManager::self()->printerList();
+ if (l && !l->isEmpty())
+ {
+ bool separatorInserted = false;
+ TQPtrListIterator<KMPrinter> it(*l);
+ for (; it.current(); ++it)
+ {
+ // no special, implicit or pure instances
+ if (it.current()->isSpecial() || it.current()->isVirtual())
+ continue;
+ if (!separatorInserted)
+ {
+ // we insert a separator only when we find the first
+ // printer
+ insertSeparator();
+ separatorInserted = true;
+ }
+ insertItem(SmallIconSet(it.current()->pixmap()),
+ it.current()->printerName(), ID++);
+ }
+ }
+}
+
+void PrintMenu::slotExec(int ID)
+{
+ switch (ID)
+ {
+ case ADD_PRINTER_ID:
+ kapp->tdeinitExec("kaddprinterwizard");
+ break;
+ case KDEPRINT_SETTINGS_ID:
+ kapp->tdeinitExec("kaddprinterwizard", TQStringList("--kdeconfig"));
+ break;
+ case CONFIG_SERVER_ID:
+ kapp->tdeinitExec("kaddprinterwizard", TQStringList("--serverconfig"));
+ break;
+ case PRINT_MANAGER_ID:
+ KRun::runCommand("kcmshell kde-printers.desktop");
+ break;
+ case PRINT_BROWSER_ID:
+ KRun::runCommand("kfmclient openProfile filemanagement print:/", "kfmclient", "konqueror");
+ break;
+ case KPRINTER_ID:
+ kapp->tdeinitExec("kprinter");
+ break;
+ default:
+ {
+ // start kjobviewer
+ TQStringList args;
+ args << "--show" << "-d" << text(ID).remove('&');
+ kapp->tdeinitExec("kjobviewer", args);
+ }
+ break;
+ }
+}
+
+void PrintMenu::reload()
+{
+ initialize();
+}
+
+#include "print_mnu.moc"
diff --git a/kicker/menuext/tdeprint/print_mnu.h b/kicker/menuext/tdeprint/print_mnu.h
new file mode 100644
index 000000000..47c9e609e
--- /dev/null
+++ b/kicker/menuext/tdeprint/print_mnu.h
@@ -0,0 +1,46 @@
+/*****************************************************************
+
+Copyright (c) 1996-2001 the kicker authors. See file AUTHORS.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+******************************************************************/
+
+#ifndef _print_mnu_h_
+#define _print_mnu_h_
+
+#include <kpanelmenu.h>
+#include <tdeprint/kpreloadobject.h>
+
+class PrintMenu : public KPanelMenu, public KPReloadObject
+{
+ Q_OBJECT
+
+public:
+ PrintMenu(TQWidget *parent, const char *name, const TQStringList & /*args*/);
+ ~PrintMenu();
+
+protected slots:
+ void slotExec(int id);
+ void initialize();
+
+protected:
+ void reload();
+};
+
+#endif
diff --git a/kicker/menuext/tdeprint/printmenu.desktop b/kicker/menuext/tdeprint/printmenu.desktop
new file mode 100644
index 000000000..447d62c8f
--- /dev/null
+++ b/kicker/menuext/tdeprint/printmenu.desktop
@@ -0,0 +1,144 @@
+[Desktop Entry]
+Name=Print System
+Name[af]=Drukker Stelsel
+Name[ar]=نظام الطباعة
+Name[az]=Çap Sistemi
+Name[be]=Сістэма друку
+Name[bg]=Система за печат
+Name[bn]=মুদ্রণ ব্যবস্থা
+Name[br]=Reizhiad moulañ
+Name[bs]=Sistem štampe
+Name[ca]=Sistema d'impressió
+Name[cs]=Tiskový systém
+Name[csb]=Systema drëkù
+Name[cy]=Cysawd Argraffu
+Name[da]=Udskriftssystem
+Name[de]=Drucksystem
+Name[el]=Σύστημα εκτύπωσης
+Name[eo]=Printosistemo
+Name[es]=Sistema de impresión
+Name[et]=Trükkimissüsteem
+Name[eu]=Inprimaketa sistema
+Name[fa]=سیستم چاپ
+Name[fi]=Tulostusjärjestelmä
+Name[fr]=Système d'impression
+Name[fy]=Printsysteem
+Name[ga]=Córas Priontála
+Name[gl]=Sistema de Impresión
+Name[he]=מערכת הדפסה
+Name[hi]=छापा तंत्र
+Name[hr]=Sustav za ispisivanje
+Name[hu]=Nyomtatási rendszer
+Name[is]=Prentkerfi
+Name[it]=Sistema di stampa
+Name[ja]=印刷システム
+Name[ka]=ბეჭდვის სისტემა
+Name[kk]=Басып шығару
+Name[km]=ប្រព័ន្ធ​បោះពុម្ព
+Name[ko]=모던 시스템
+Name[ku]=Pergala Çapkirinê
+Name[lo]=ລະບົບການພິມ
+Name[lt]=Spausdinimo sistema
+Name[lv]=Drukas Sistēma
+Name[mk]=Печатарски систем
+Name[mn]=Хэвлэх систем
+Name[ms]=Cetak Sistem
+Name[mt]=Sistema tal-ipprintjar
+Name[nb]=Utskriftsystem
+Name[nds]=Drucksysteem
+Name[ne]=मुद्रण प्रणाली
+Name[nl]=Afdruksysteem
+Name[nn]=Utskriftssystem
+Name[nso]=System ya Kgatiso
+Name[pa]=ਪਰਿੰਟ ਸਿਸਟਮ
+Name[pl]=System drukowania
+Name[pt]=Sistema de Impressão
+Name[pt_BR]=Sistema de Impressão
+Name[ro]=Sistem de tipărire
+Name[ru]=Система печати
+Name[rw]=Sisitemu Gucapa
+Name[se]=Čálihanvuogádat
+Name[sk]=Tlačový systém
+Name[sl]=Tiskalniški sistem
+Name[sr]=Систем за штампу
+Name[sr@Latn]=Sistem za štampu
+Name[sv]=Skrivarsystem
+Name[ta]=அச்சு அமைப்பு
+Name[te]=ప్రచురణ వ్యవస్థ
+Name[tg]=Системаи Чоп
+Name[th]=ระบบการพิมพ์
+Name[tr]=Yazıcı Sistemi
+Name[tt]=Bastıru Sisteme
+Name[uk]=Система друку
+Name[uz]=Bosib chiqarish tizimi
+Name[uz@cyrillic]=Босиб чиқариш тизими
+Name[ven]=Maitele au phirintha
+Name[vi]=Hệ thống In ấn
+Name[wa]=Sistinme d' imprimaedje
+Name[xh]=Indlela Yoshicilelo
+Name[zh_CN]=打印系统
+Name[zh_TW]=列印系統
+Name[zu]=Isistimu yokushicilela
+Comment=Menu for the print system
+Comment[af]=Kieslys vir die drukker stelsel
+Comment[ar]=قائمة لنظام الطباعة
+Comment[be]=Меню для сістэмы друку
+Comment[bg]=Меню на системата за печат
+Comment[bn]=মুদ্রণ ব্যবস্থার জন্য মেনু
+Comment[bs]=Meni za sistem štampe
+Comment[ca]=Menú per al sistema d'impressió
+Comment[cs]=Nabídka tiskového systému
+Comment[csb]=Menu systemë drëkù
+Comment[da]=Menu for udskriftssystemet
+Comment[de]=Einfacher Zugriff auf das Drucksystem
+Comment[el]=Μενού για το σύστημα εκτύπωσης
+Comment[eo]=Menuo por printosistemo
+Comment[es]=Menú para el sistema de impresión
+Comment[et]=Trükkimissüsteemi menüü
+Comment[eu]=Inprimaketa sistemarako menua
+Comment[fa]=گزینگان برای سیستم چاپ
+Comment[fi]=Tulostusjärjestelmävalikko
+Comment[fr]=Menu du système d'impression
+Comment[fy]=Menu foar it printsysteem
+Comment[gl]=Menu para o sistema de impresión
+Comment[he]=תפריט למערכת ההדפסה
+Comment[hr]=Izbornik sustava ispisivanja
+Comment[hu]=Menü a nyomtatási rendszer eléréséhez
+Comment[is]=Fljótleg leið að prentkerfinu
+Comment[it]=Menu del sistema di stampa
+Comment[ja]=印刷システム用メニュー
+Comment[ka]=ბეჭდვის სისტემის მენიუ
+Comment[kk]=Басып шығару жүйесінің мәзірі
+Comment[km]=ម៉ឺនុយ​សម្រាប់​ប្រព័ន្ធ​បោះពុម្ព
+Comment[lt]=Spausdinimo sistemos meniu
+Comment[mk]=Мени за системот за печатење
+Comment[nb]=Meny for utskriftssystemet
+Comment[nds]=Menü för dat Drucksysteem
+Comment[ne]=मुद्रण प्रणालीका लागि मेनु
+Comment[nl]=Menu voor het afdruksysteem
+Comment[nn]=Meny for utskriftssystemet
+Comment[pa]=ਪਰਿੰਟ ਸਿਸਟਮ ਲਈ ਮੇਨੂ
+Comment[pl]=Menu systemu drukowania
+Comment[pt]=Um menu para o sistema de impressão
+Comment[pt_BR]=Menu para o sistema de impressão
+Comment[ro]=Meniu pentru sistemul de tipărire
+Comment[ru]=Быстрый доступ к системе печати
+Comment[se]=Čálihanvuogádaga fállu
+Comment[sk]=Menu pre tlačový systém
+Comment[sl]=Meni za tiskalniški sistem
+Comment[sr]=Мени за систем штампања
+Comment[sr@Latn]=Meni za sistem štampanja
+Comment[sv]=Meny för skrivarsystemet
+Comment[te]=ప్రచురణ వ్యవస్థ కొరకు పట్టి
+Comment[th]=เมนูสำหรับระบบการพิมพ์
+Comment[tr]=Yazıcı sistemi menüsü
+Comment[uk]=Меню для системи друку
+Comment[uz]=Bosib chiqarish tizimining menyusi
+Comment[uz@cyrillic]=Босиб чиқариш тизимининг менюси
+Comment[vi]=Thực đơn cho hệ thống in ấn
+Comment[wa]=Dresseŷe pol sistinme d' imprimaedje
+Comment[zh_CN]=打印系统菜单
+Comment[zh_TW]=用於列印系統的選單
+Icon=fileprint
+
+X-KDE-Library=kickermenu_tdeprint