Skip to content

Commit ef48548

Browse files
authored
Use variable app name (AcademySoftwareFoundation#61)
The branch moves the name of the application and the copyright text to variables. This allows them to be changed/overloaded in a single place. Signed-off-by: Roger Nelson <[email protected]>
1 parent edadafd commit ef48548

13 files changed

+53
-35
lines changed

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ SET(RV_REVISION_NUMBER
1818
CACHE STRING "RV's revision number"
1919
)
2020

21-
#
2221
SET(RV_VERSION_YEAR
2322
"2023"
2423
CACHE STRING "RV's year of release."
@@ -47,6 +46,10 @@ ELSE()
4746
)
4847
ENDIF()
4948

49+
SET(RV_UI_APPLICATION_NAME
50+
"Open RV"
51+
CACHE STRING "RV's UI application name"
52+
)
5053
SET(RV_INTERNAL_APPLICATION_NAME
5154
"OpenRV"
5255
CACHE STRING "RV's internal application name"

cmake/globals/rv_globals.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,8 @@ IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
218218
"_d"
219219
)
220220
ENDIF()
221+
222+
SET(RV_COPYRIGHT_TEXT
223+
"Copyright contributors to the Open Review Initiative project."
224+
CACHE STRING "RV's copyright text."
225+
)

cmake/macros/rv_stage.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ FUNCTION(rv_stage)
620620
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${RV_APP_ROOT}"
621621
MACOSX_BUNDLE TRUE
622622
OUTPUT_NAME ${_target}
623-
MACOSX_BUNDLE_BUNDLE_NAME ${_target}
623+
MACOSX_BUNDLE_BUNDLE_NAME "${RV_UI_APPLICATION_NAME}"
624624
MACOSX_BUNDLE_EXECUTABLE_NAME ${_target}
625625
RESOURCE "${arg_FILES}"
626626
MACOSX_BUNDLE_GUI_IDENTIFIER "com.autodesk.${_target}"

src/bin/apps/rvpkg/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ TARGET_COMPILE_OPTIONS(
7272
RV_STAGE(TYPE "EXECUTABLE" TARGET ${_target})
7373

7474
ADD_CUSTOM_COMMAND(
75-
COMMENT "Installing Open RV Packages"
75+
COMMENT "Installing ${RV_UI_APPLICATION_NAME} Packages"
7676
OUTPUT ${RV_STAGE_PLUGINS_PACKAGES_DIR}/rvinstall ${INSTALLED_RV_PACKAGE_LIST}
7777
COMMAND $<TARGET_FILE:${_target}> -force -install -add ${RV_STAGE_PLUGINS_DIR} ${RV_PACKAGE_LIST}
7878
WORKING_DIRECTORY ${RV_STAGE_BIN_DIR}

src/bin/apps/rvprof/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,9 @@ TARGET_LINK_LIBRARIES(
5151
PRIVATE TwkMath TwkGLText OpenGL::GLU Qt5::Gui Qt5::OpenGL Qt5::Widgets
5252
)
5353

54+
TARGET_COMPILE_OPTIONS(
55+
${_target}
56+
PRIVATE -DUI_APPLICATION_NAME=\"${RV_UI_APPLICATION_NAME}\"
57+
)
58+
5459
RV_STAGE(TYPE "EXECUTABLE" TARGET ${_target})

src/bin/apps/rvprof/VisMainWindow.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void
158158
VisMainWindow::openFile()
159159
{
160160
QString filename =
161-
QFileDialog::getOpenFileName(this, "Select File", ".", "Open RV Profile Data (*.rvprof *.timedata)");
161+
QFileDialog::getOpenFileName(this, "Select File", ".", UI_APPLICATION_NAME " Profile Data (*.rvprof *.timedata)");
162162

163163
readFile(filename);
164164
}
@@ -183,7 +183,7 @@ VisMainWindow::readFile(const QString& filename)
183183
}
184184

185185
QFileInfo info(filename);
186-
setWindowTitle(QString("Open RV Profile Viewer -- %1").arg(info.baseName()));
186+
setWindowTitle(QString(UI_APPLICATION_NAME " Profile Viewer -- %1").arg(info.baseName()));
187187

188188
DataVector data;
189189

src/bin/nsapps/RV/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@
587587
<key>CFBundleIdentifier</key>
588588
<string>com.autodesk.RV</string>
589589
<key>CFBundleName</key>
590-
<string>Open RV</string>
590+
<string>${RV_UI_APPLICATION_NAME}</string>
591591
<key>CFBundlePackageType</key>
592592
<string>APPL</string>
593593
<key>CFBundleResourcesFileMapped</key>

src/lib/app/RvCommon/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ TARGET_COMPILE_OPTIONS(
241241
-DPLATFORM_VERSION=\"${CMAKE_SYSTEM_VERSION}\"
242242
-DRELEASE_DESCRIPTION=\"${RV_RELEASE_DESCRIPTION}\"
243243
-DINTERNAL_APPLICATION_NAME=\"${RV_INTERNAL_APPLICATION_NAME}\"
244+
-DUI_APPLICATION_NAME=\"${RV_UI_APPLICATION_NAME}\"
245+
-DCOPYRIGHT_TEXT=\"${RV_COPYRIGHT_TEXT}\"
244246
)
245247

246248
RV_STAGE(TYPE "LIBRARY" TARGET ${_target})

src/lib/app/RvCommon/GLView.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ GLView::GLView(QWidget* parent,
143143
setObjectName((m_doc->session()) ? m_doc->session()->name().c_str() : "no session");
144144
//m_frameBuffer = new QTFrameBuffer( this );
145145
ostringstream str;
146-
str << "Open RV Main Window" << "/" << m_doc;
146+
str << UI_APPLICATION_NAME " Main Window" << "/" << m_doc;
147147
m_videoDevice = new QTGLVideoDevice(0, str.str(), this);
148148
m_activityTimer.start();
149149
setMouseTracking(true);

src/lib/app/RvCommon/RvApplication.cpp

+18-15
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ RvApplication::RvApplication(int argc, char** argv, DeviceCreationFunc F)
257257
m_webManager(0),
258258
m_presentationMode(false),
259259
m_presentationDevice(0),
260-
m_executableNameCaps("Open RV"),
260+
m_executableNameCaps(UI_APPLICATION_NAME),
261261
m_deviceCreationFunc(F),
262262
m_desktopModule(0),
263263
m_dispatchAtomicInt(0)
@@ -291,8 +291,8 @@ RvApplication::RvApplication(int argc, char** argv, DeviceCreationFunc F)
291291
m_lazyBuildTimer->setSingleShot(true);
292292
m_lazyBuildTimer->start();
293293

294-
m_aboutAct = new QAction(tr("About Open RV..."), this);
295-
m_aboutAct->setStatusTip(tr("Information about this version of Open RV"));
294+
m_aboutAct = new QAction(tr("About " UI_APPLICATION_NAME "..."), this);
295+
m_aboutAct->setStatusTip(tr("Information about this version of " UI_APPLICATION_NAME));
296296
m_aboutAct->setMenuRole(QAction::AboutRole);
297297
connect(m_aboutAct, SIGNAL(triggered()), this, SLOT(about()));
298298

@@ -310,24 +310,24 @@ RvApplication::RvApplication(int argc, char** argv, DeviceCreationFunc F)
310310
sep2->setSeparator(true);
311311

312312
m_networkAct = new QAction(tr("Network..."), this);
313-
m_networkAct->setStatusTip(tr("Allow remote communication with this Open RV"));
313+
m_networkAct->setStatusTip(tr("Allow remote communication with this " UI_APPLICATION_NAME));
314314
m_networkAct->setMenuRole(QAction::ApplicationSpecificRole);
315315
connect(m_networkAct, SIGNAL(triggered()), this, SLOT(showNetworkDialog()));
316316

317-
m_quitAct = new QAction(tr("Quit Open RV"), this);
317+
m_quitAct = new QAction(tr("Quit " UI_APPLICATION_NAME), this);
318318
#ifndef PLATFORM_DARWIN
319319
m_quitAct->setShortcut(QKeySequence("Ctrl+Q"));
320320
#endif
321-
m_quitAct->setStatusTip(tr("Exit all Open RV Sessions"));
321+
m_quitAct->setStatusTip(tr("Exit all " UI_APPLICATION_NAME " Sessions"));
322322
m_quitAct->setMenuRole(QAction::QuitRole);
323323
connect(m_quitAct, SIGNAL(triggered()), this, SLOT(quitAll()));
324324

325325

326326
#if defined(PLATFORM_DARWIN)
327327
m_macMenuBar = new QMenuBar(0);
328-
// NOTE: the 'Open RV' string below isn't what's visible as main menu.
328+
// NOTE: the UI_APPLICATION_NAME string below isn't what's visible as main menu.
329329
// The main menu visible string comes from the 'src/bin/nsapp/RV/Info.plist' file.
330-
m_macRVMenu = m_macMenuBar->addMenu("Open RV");
330+
m_macRVMenu = m_macMenuBar->addMenu(UI_APPLICATION_NAME);
331331
m_macRVMenu->addAction(m_aboutAct);
332332
if (m_networkAct) m_macRVMenu->addAction(m_networkAct);
333333
m_macRVMenu->addAction(m_prefAct);
@@ -500,19 +500,22 @@ RvApplication::about()
500500
vector<char> temp;
501501
temp.reserve(2048);
502502
sprintf(temp.data(),
503-
"<h1>Open RV</h1><h2>%d.%d.%d (%s)</h2> %s <p>Open RV Copyright contributors to the Open Review Initiative project. </p>",
503+
"<h1>%s</h1><h2>%d.%d.%d (%s)</h2> %s <p>%s %s </p>",
504+
UI_APPLICATION_NAME,
504505
TWK_DEPLOY_MAJOR_VERSION(),
505506
TWK_DEPLOY_MINOR_VERSION(),
506507
TWK_DEPLOY_PATCH_LEVEL(),
507508
GIT_HEAD,
508-
headerComment.str().c_str());
509+
headerComment.str().c_str(),
510+
UI_APPLICATION_NAME,
511+
COPYRIGHT_TEXT);
509512

510513
const TwkApp::Document* doc = TwkApp::Document::activeDocument();
511514
QWidget* parent = 0;
512515
if (doc) parent = (RvDocument *)doc->opaquePointer();
513516

514517
QMessageBox *msgBox =
515-
new QMessageBox("About Open RV", QString(temp.data()), QMessageBox::Information, 0, 0, 0, parent,
518+
new QMessageBox("About " UI_APPLICATION_NAME, QString(temp.data()), QMessageBox::Information, 0, 0, 0, parent,
516519
Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
517520
msgBox->setAttribute(Qt::WA_DeleteOnClose);
518521
QIcon icon = msgBox->windowIcon();
@@ -974,7 +977,7 @@ RvApplication::prefs()
974977
QWidget* parent = 0;
975978
if (doc) parent = (RvDocument *)doc->opaquePointer();
976979
QMessageBox box(parent);
977-
box.setWindowTitle(tr("Open RV: Preferences"));
980+
box.setWindowTitle(tr(UI_APPLICATION_NAME ": Preferences"));
978981
box.setText(tr("Presentation Mode is Enabled -- Preferences cannot be shown.\nDisable Presentation Mode?"));
979982
// the detailed box mess up the buttons on OS X with CSS
980983
// just getting rid of it fixes it
@@ -1572,10 +1575,10 @@ RvApplication::setPresentationMode(bool value)
15721575
QWidget* parent = 0;
15731576
if (doc) parent = (RvDocument *)doc->opaquePointer();
15741577
QMessageBox box(parent);
1575-
box.setWindowTitle(tr("Open RV: Presentation Mode"));
1578+
box.setWindowTitle(tr(UI_APPLICATION_NAME ": Presentation Mode"));
15761579
QString baseText = QString("The presentation device (%1/%2) is busy or cannot be opened.")
15771580
.arg(d->module()->name().c_str()).arg(d->name().c_str());
1578-
QString detailedText = QString("Open RV failed to open or bind the presentation device (%1/%2)."
1581+
QString detailedText = QString(UI_APPLICATION_NAME " failed to open or bind the presentation device (%1/%2)."
15791582
" Check to see if another program is using the device"
15801583
" and that the parameters are valid in the preferences."
15811584
" You can start RV with -noPrefs or -resetPrefs if you"
@@ -1597,7 +1600,7 @@ RvApplication::setPresentationMode(bool value)
15971600
QWidget* parent = 0;
15981601
if (doc) parent = (RvDocument *)doc->opaquePointer();
15991602
QMessageBox box(parent);
1600-
box.setWindowTitle(tr("Open RV: Presentation Mode"));
1603+
box.setWindowTitle(tr(UI_APPLICATION_NAME ": Presentation Mode"));
16011604
QString baseText = QString("The presentation device (%1/%2) failed to open.")
16021605
.arg(d->module()->name().c_str()).arg(d->name().c_str());
16031606
box.setText(baseText + "\n\n" + exc.what());

src/lib/app/RvCommon/RvConsoleWindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ RvConsoleWindow::RvConsoleWindow(QWidget* parent)
102102
//
103103
m_ui.showComboBox->setFocus();
104104

105-
setWindowTitle("Open RV Console");
105+
setWindowTitle(UI_APPLICATION_NAME " Console");
106106
setSizeGripEnabled(true);
107107
bool doRedirect = (getenv("RV_NO_CONSOLE_REDIRECT") == 0);
108108
//setAttribute(Qt::WA_MacBrushedMetal);

src/lib/app/RvCommon/RvDocument.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ RvDocument::receive( Notifier *originator,
573573
else if (m == IPCore::Session::audioUnavailbleMessage())
574574
{
575575
QMessageBox box(this);
576-
box.setWindowTitle(tr("Open RV: Audio Failure"));
576+
box.setWindowTitle(tr(UI_APPLICATION_NAME ": Audio Failure"));
577577
QString baseText = tr("Audio Device is Currently Unavailable");
578578
QString detailedText = tr("Another program (maybe another copy of RV?) "
579579
"is blocking use of the audio device. "
@@ -619,11 +619,11 @@ void
619619
RvDocument::resetGLStateAndPrefs()
620620
{
621621
QMessageBox box(this);
622-
box.setWindowTitle(tr("Open RV: Invalid Display Configuration"));
622+
box.setWindowTitle(tr(UI_APPLICATION_NAME ": Invalid Display Configuration"));
623623
QString baseText = tr("Display Configuration is Invalid");
624624
QString detailedText = tr("The display configuration in the preferences is\n"
625625
"incompatible with this driver and/or graphics hardware.\n"
626-
"Open RV will use the default display configuration to continue.\n"
626+
UI_APPLICATION_NAME " will use the default display configuration to continue.\n"
627627
#ifdef PLATFORM_LINUX
628628
"You can check available display possibilities\n"
629629
"using the glxinfo command with the -t option from a shell\n"
@@ -1708,7 +1708,7 @@ RvDocument::mergeMenu(const TwkApp::Menu* menu, bool shortcuts)
17081708
#if !defined(PLATFORM_DARWIN)
17091709
if (!m_rvMenu || !workAroundActionLeak)
17101710
{
1711-
m_rvMenu = mb()->addMenu("Open RV");
1711+
m_rvMenu = mb()->addMenu(UI_APPLICATION_NAME);
17121712
m_rvMenu->addAction(RvApp()->aboutAction());
17131713
m_rvMenu->addSeparator();
17141714
m_rvMenu->addAction(RvApp()->prefAction());
@@ -1717,7 +1717,7 @@ RvDocument::mergeMenu(const TwkApp::Menu* menu, bool shortcuts)
17171717
m_rvMenu->addSeparator();
17181718
m_rvMenu->addAction(RvApp()->quitAction());
17191719
m_rvMenu->menuAction()->font().setBold(true);
1720-
m_rvMenu->setObjectName("Open RV Menu");
1720+
m_rvMenu->setObjectName(UI_APPLICATION_NAME " Menu");
17211721
}
17221722
#endif
17231723

@@ -1956,14 +1956,14 @@ RvDocument::checkDriverVSync()
19561956
if (queryDriverVSync() && opts.vsync > 0)
19571957
{
19581958
QMessageBox box(this);
1959-
box.setWindowTitle(tr("Open RV: VSync Conflict"));
1959+
box.setWindowTitle(tr(UI_APPLICATION_NAME ": VSync Conflict"));
19601960
QString baseText = tr("Both the graphics driver and RV v-sync are ON. "
1961-
"Open RV vsync is being disabled.");
1961+
UI_APPLICATION_NAME " vsync is being disabled.");
19621962
QString detailedText("RV's vsync is being disabled for this session because "
19631963
"the graphics driver's vsync is also ON. "
19641964
"You can change this in the nvidia-settings or "
1965-
"in Open RV's preferences. "
1966-
"Running RV with both vsyncs enabled causes incorrect "
1965+
"in " UI_APPLICATION_NAME "'s preferences. "
1966+
"Running " UI_APPLICATION_NAME " with both vsyncs enabled causes incorrect "
19671967
"playback. ");
19681968
box.setText(baseText + "\n\n" + detailedText);
19691969
box.setWindowModality(Qt::WindowModal);
@@ -1983,12 +1983,12 @@ RvDocument::warnOnDriverVSync()
19831983
if (queryDriverVSync())
19841984
{
19851985
QMessageBox box(this);
1986-
box.setWindowTitle(tr("Open RV: Driver VSync Conflict"));
1986+
box.setWindowTitle(tr(UI_APPLICATION_NAME ": Driver VSync Conflict"));
19871987
QString baseText = tr("The graphics driver v-sync is ON. "
19881988
"This can result in bad playback performance in presentation mode.");
19891989
QString detailedText("The graphics driver's vsync is ON. "
19901990
"You can change this in the nvidia-settings OpenGL section. "
1991-
"Running Open RV in presentation mode with the driver "
1991+
"Running " UI_APPLICATION_NAME " in presentation mode with the driver "
19921992
"vsync enabled will cause incorrect "
19931993
"playback. ");
19941994
box.setWindowModality(Qt::WindowModal);

src/lib/app/RvCommon/RvPreferences.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ RvPreferences::RvPreferences(QWidget* parent)
126126
this, SLOT(exrAutoThreads(int)));
127127
connect(m_ui.exrNumThreadsEdit, SIGNAL(textChanged(const QString&)),
128128
this, SLOT(exrThreadNumChanged(const QString&)));
129-
setWindowTitle("Open RV Preferences");
129+
setWindowTitle(UI_APPLICATION_NAME " Preferences");
130130

131131
#ifndef PLATFORM_DARWIN
132132
m_ui.appleClientStorageToggle->setEnabled(false);

0 commit comments

Comments
 (0)