Permalink
Browse files

Rebrending

  • Loading branch information...
1 parent 14a32d8 commit f40b5dded6e733ce48f634d5f0f72bb60d672191 @SokoloffA SokoloffA committed Jan 18, 2013
View
17 CMakeLists.txt
@@ -1,15 +1,22 @@
cmake_minimum_required( VERSION 2.6 )
-project(booklet)
+project(boomaga)
-set(GUI_DIR ${CMAKE_INSTALL_PREFIX}/lib/booklet)
+set(GUI_DIR ${CMAKE_INSTALL_PREFIX}/lib/boomaga)
add_definitions(-DGUI_DIR=\"${GUI_DIR}\")
-set(GUI_PROGRAM ${GUI_DIR}/booklet)
+set(GUI_PROGRAM ${GUI_DIR}/boomaga)
add_definitions(-DGUI_PROGRAM=\"${GUI_PROGRAM}\")
-set(MY_CUPS_URI "booklet:/")
-add_definitions(-DMY_CUPS_URI=\"${MY_CUPS_URI}\")
+set(CUPS_BACKEND_URI "boomaga:/")
+add_definitions(-DCUPS_BACKEND_URI=\"${CUPS_BACKEND_URI}\")
+
+set(CUPS_BACKEND_MANUFACTURER "Generic")
+add_definitions(-DCUPS_BACKEND_MANUFACTURER=\"${CUPS_BACKEND_MANUFACTURER}\")
+
+set(CUPS_BACKEND_MODEL "Boomaga Printer")
+add_definitions(-DCUPS_BACKEND_MODEL=\"${CUPS_BACKEND_MODEL}\")
+
add_subdirectory(cups)
add_subdirectory(gui)
View
21 cups/CMakeLists.txt
@@ -1,18 +1,25 @@
cmake_minimum_required( VERSION 2.6 )
-project(bokletCups)
+project(boomagaCups)
+set(CUPS_BACKEND_ID "MFG:${CUPS_BACKEND_MANUFACTURER};MDL:${CUPS_BACKEND_MODEL};DES:${CUPS_BACKEND_MANUFACTURER} ${CUPS_BACKEND_MODEL};CLS:PRINTER;CMD:POSTSCRIPT;")
+add_definitions(-DCUPS_BACKEND_ID=\"${CUPS_BACKEND_ID}\")
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/booklet
- ${CMAKE_CURRENT_BINARY_DIR}/booklet
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/boomaga
+ ${CMAKE_CURRENT_BINARY_DIR}/boomaga
@ONLY)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/booklet
- DESTINATION /usr/lib/cups/backend
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/boomaga.ppd
+ ${CMAKE_CURRENT_BINARY_DIR}/boomaga.ppd
+ @ONLY)
+
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/boomaga
+ DESTINATION /usr/lib/cups/backend
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
)
-install(FILES booklet.ppd
- DESTINATION /usr/share/ppd/booklet
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/boomaga.ppd
+ DESTINATION /usr/share/ppd/boomaga
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
View
7 cups/booklet → cups/boomaga
@@ -9,9 +9,10 @@ CUPS_BACKEND_FAILED=1
#set -x
# Output "device discovery" information on stdout:
+# http://www.cups.org/documentation.php/doc-1.6/man-backend.html
if test "$#" = "0"; then
- echo 'file @MY_CUPS_URI@ "Booklet Printer" "Booklet" "MFG:Generic;MDL:Booklet Printer;DES:Booklet Printer;CLS:PRINTER;CMD:POSTSCRIPT;"'
- exit 0
+ echo "file @CUPS_BACKEND_URI@ \"@CUPS_BACKEND_MANUFACTURER@ @CUPS_BACKEND_MODEL@\" \"@CUPS_BACKEND_MANUFACTURER@ @CUPS_BACKEND_MODEL@\" \"@CUPS_BACKEND_ID@\""
+ exit 0
fi
jobID=$1
@@ -87,7 +88,7 @@ fi
chown ${user} ${psFile}
export DISPLAY=${xDisplay}
export XAUTHORITY=${homeDir}/.Xauthority
-su -l -c "@GUI_PROGRAM@ -t \"$title\" -n $count $psFile" $user 0<&- &>/tmp/booklet-${user}.log &
+su -l -c "@GUI_PROGRAM@ -t \"$title\" -n $count $psFile" $user 0<&- &>/tmp/boomaga-${user}.log &
exit $CUPS_BACKEND_OK
View
12 cups/booklet.ppd → cups/boomaga.ppd
@@ -25,13 +25,13 @@
*FileVersion: "1.1"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
-*PCFileName: "booklet.PPD"
-*Manufacturer: "Generic"
+*PCFileName: "boomaga.PPD"
+*Manufacturer: "@CUPS_BACKEND_MANUFACTURER@"
*Product: "(CUPS v1.1)"
-*ModelName: "Generic Booklet Printer"
-*ShortNickName: "Generic Booklet Printer"
-*NickName: "Generic Booklet Printer"
-*1284DeviceID: "MFG:Generic;MDL:Booklet Printer;DES:Generic Booklet Printer;CLS:PRINTER;CMD:POSTSCRIPT;"
+*ModelName: "@CUPS_BACKEND_MANUFACTURER@ @CUPS_BACKEND_MODEL@"
+*ShortNickName: "@CUPS_BACKEND_MANUFACTURER@ @CUPS_BACKEND_MODEL@"
+*NickName: "@CUPS_BACKEND_MANUFACTURER@ @CUPS_BACKEND_MODEL@"
+*1284DeviceID: "@CUPS_BACKEND_ID@"
*% cupsFilter: "application/vnd.cups-postscript 0 pstitleiconv"
*PSVersion: "(2017.000) 0"
*LanguageLevel: "2"
View
10 gui/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required( VERSION 2.6 )
-project(bookletGui)
+project(boomagaGui)
set(HEADERS
kernel/psconstants.h
@@ -71,7 +71,7 @@ file (GLOB TS_FILES
)
set(DATA_DIR
- ${CMAKE_INSTALL_PREFIX}/share/booklet
+ ${CMAKE_INSTALL_PREFIX}/share/boomaga
)
set(TRANSLATIONS_DIR
@@ -110,11 +110,11 @@ qt4_wrap_ui(UI_HEADERS ${UI_FILES})
qt4_add_translation(QM_FILES ${TS_FILES})
-add_executable(booklet ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QM_FILES} ${QRC_SOURCES} ${UI_HEADERS})
-target_link_libraries(booklet ${LIBRARIES} ${QT_LIBRARIES} ${GHOSTSCRIPT_LIBRARIES})
+add_executable(boomaga ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QM_FILES} ${QRC_SOURCES} ${UI_HEADERS})
+target_link_libraries(boomaga ${LIBRARIES} ${QT_LIBRARIES} ${GHOSTSCRIPT_LIBRARIES})
install(FILES ${QM_FILES} DESTINATION ${TRANSLATIONS_DIR})
-install(TARGETS booklet RUNTIME DESTINATION ${GUI_DIR})
+install(TARGETS boomaga RUNTIME DESTINATION ${GUI_DIR})
View
2 gui/dbus.cpp
@@ -47,7 +47,7 @@ DBusProjectAdaptor::DBusProjectAdaptor(PsProject *project) :
************************************************/
bool DBusProjectAdaptor::openFileInExisting(const QString &fileName)
{
- QDBusInterface remote("org.bprint", "/Project");
+ QDBusInterface remote("org.boomaga", "/Project");
if (!remote.isValid())
return false;
View
2 gui/dbus.h
@@ -36,7 +36,7 @@ class PsProject;
class DBusProjectAdaptor : public QDBusAbstractAdaptor
{
Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.bprint")
+ Q_CLASSINFO("D-Bus Interface", "org.boomaga")
public:
DBusProjectAdaptor(PsProject *project);
View
2 gui/kernel/psengine.cpp
@@ -215,7 +215,7 @@ void PsEngine::writeDocument(const QList<const PsSheet*> &sheets, QTextStream *o
{
*out << "%!PS-Adobe-3.0\n";
*out << "%%BoundingBox: (atend)\n";
- *out << "%%Creator: (bprint)\n";
+ *out << "%%Creator: (boomaga)\n";
*out << "%%LanguageLevel: 2\n";
*out << QString("%%Pages: %1\n").arg(sheets.count());
*out << "%%EndComments\n";
View
2 gui/kernel/psproject.cpp
@@ -44,7 +44,7 @@ PsProject::PsProject(QObject *parent) :
mEngine(0),
mPrinter(&mNullPrinter)
{
- mPsFile = new GsMergeFile(QDir::tempPath() + QString("/bprint_%1.ps").arg(QCoreApplication::applicationPid()), this);
+ mPsFile = new GsMergeFile(QDir::tempPath() + QString("/boomaga_%1.ps").arg(QCoreApplication::applicationPid()), this);
setLayout(settings->layout());
}
View
6 gui/main.cpp
@@ -41,7 +41,7 @@
void printHelp()
{
QTextStream out(stdout);
- out << "Usage: booklet [options] file" << endl;
+ out << "Usage: boomaga [options] file" << endl;
out << endl;
out << "Print poscript file as booklet" << endl;
@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
QTranslator translator;
- translator.load(QString("%1/booklet_%2.qm").arg(TRANSLATIONS_DIR, QLocale::system().name()));
+ translator.load(QString("%1/boomaga_%2.qm").arg(TRANSLATIONS_DIR, QLocale::system().name()));
application.installTranslator(&translator);
@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
PsProject project;
DBusProjectAdaptor dbus(&project);
- QDBusConnection::sessionBus().registerService("org.bprint");
+ QDBusConnection::sessionBus().registerService("org.boomaga");
QDBusConnection::sessionBus().registerObject("/Project", &project);
project.addFile(file.absoluteFilePath());
View
8 gui/mainwindow.cpp
@@ -70,7 +70,7 @@ MainWindow::MainWindow(PsProject *project, QWidget *parent):
setWindowIcon(findIcon("document-print", ":/images/print-48x48"));
- setWindowTitle(tr("Booklet print"));
+ setWindowTitle(tr("Boomaga"));
setStyleSheet("QListView::item { padding: 2px;}");
@@ -154,7 +154,7 @@ QList<Printer *> MainWindow::availablePrinters()
{
Printer *printer = new Printer(pi);
- if (printer->deviceUri() != MY_CUPS_URI)
+ if (printer->deviceUri() != CUPS_BACKEND_URI)
mAvailablePrinters << printer;
else
delete printer;
@@ -414,15 +414,15 @@ void MainWindow::switchToFile(PsFile *file)
************************************************/
QTemporaryFile *MainWindow::getTmpFile()
{
- QTemporaryFile *file = new QTemporaryFile(QDir::tempPath() + "/bprint_XXXXXX.ps");
+ QTemporaryFile *file = new QTemporaryFile(QDir::tempPath() + "/boomaga_XXXXXX.ps");
if (!file->open()) //QFile::WriteOnly))
{
qWarning() << "Can't open temporary file:" << file->errorString();
delete file;
return 0;
}
- file->setAutoRemove(false);
+ //file->setAutoRemove(false);
return file;
}
View
2 gui/settings.cpp
@@ -48,7 +48,7 @@ Settings *Settings::instance()
************************************************/
Settings::Settings():
- mSettings("bprint", "bprint")
+ mSettings("boomaga", "boomaga")
{
}
View
4 gui/translations/booklet_ru.ts
@@ -100,8 +100,8 @@
</message>
<message>
<location filename="../mainwindow.cpp" line="73"/>
- <source>Booklet print</source>
- <translation>Печать буклетов</translation>
+ <source>Boomaga</source>
+ <translation>Boomaga</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="263"/>
View
2 gui/translations/update.sh
@@ -1,4 +1,4 @@
#!/bin/sh
OPTIONS="-no-obsolete"
-lupdate ${OPTIONS} ../*.h ../*.cpp ../*.ui ../*/*.h ../*/*.cpp ../*/*.ui -ts booklet_ru.ts
+lupdate ${OPTIONS} ../*.h ../*.cpp ../*.ui ../*/*.h ../*/*.cpp ../*/*.ui -ts boomaga_ru.ts
View
10 scripts/installPrinter.sh
@@ -1,8 +1,8 @@
#!/bin/sh
-SCHEME="booklet"
+SCHEME="boomaga"
URI="${SCHEME}:/"
-NAME="Booklet_Printer"
+NAME="Boomaga_Printer"
PPD="lsb/usr/${SCHEME}/${SCHEME}.ppd"
while [ $# -gt 0 ]; do
@@ -30,7 +30,7 @@ then
fi
printer=${NAME}
-while $(LC_ALL=C lpstat -h localhost -v 2>/dev/null | cut -d ':' -f 1 | cut -d ' ' -f 3 | grep -q ^$printer\$)
+while $(LC_ALL=C lpstat -h localhost -v 2>/dev/null | cut -d ':' -f 1 | cut -d ' ' -f 3 | grep -q "^${printer}"\$)
do
number=$(($number + 1))
printer="${NAME}-${number}"
@@ -39,12 +39,12 @@ done
pageSize="$(LC_ALL=C paperconf 2>/dev/null)" || size=a4
-lpadmin -h localhost -p ${printer} -v ${URI} -E -m ${PPD} -o printer-is-shared=no -o PageSize=${pageSize}
+lpadmin -h localhost -p "${printer}" -v ${URI} -E -m ${PPD} -o printer-is-shared=no -o PageSize=${pageSize}
if [ -z "$(LC_ALL=C lpstat -h localhost -d 2>/dev/null | grep 'system default destination:')" ]
then
- echo lpadmin -h localhost -d $printer 2>/dev/null
+ lpadmin -h localhost -d "${printer}"
fi
echo "Printer ${printer} has been installed successfully."

0 comments on commit f40b5dd

Please sign in to comment.