5
5
A sequencer and musical notation editor.
7
This program is Copyright 2000-2007
7
This program is Copyright 2000-2008
8
8
Guillaume Laurent <glaurent@telegraph-road.org>,
9
9
Chris Cannam <cannam@all-day-breakfast.com>,
10
10
Richard Bown <bownie@bownie.com>
35
35
#include <kprocess.h>
36
36
#include <kglobalsettings.h>
38
#include <qstringlist.h>
38
43
#include "document/ConfigGroups.h"
39
44
#include "misc/Strings.h"
40
45
#include "misc/Debug.h"
41
46
#include "gui/application/RosegardenGUIApp.h"
47
#include "gui/widgets/CurrentProgressDialog.h"
42
48
#include "document/RosegardenGUIDoc.h"
43
49
#include "gui/kdeext/KStartupLogo.h"
409
414
KAboutData aboutData( "rosegarden", I18N_NOOP("Rosegarden"),
410
415
VERSION, description, KAboutData::License_GPL,
411
I18N_NOOP("Copyright 2000 - 2007 Guillaume Laurent, Chris Cannam, Richard Bown\nParts copyright 1994 - 2004 Chris Cannam, Andy Green, Richard Bown, Guillaume Laurent\nLilypond fonts copyright 1997 - 2005 Han-Wen Nienhuys and Jan Nieuwenhuizen"),
416
I18N_NOOP("Copyright 2000 - 2008 Guillaume Laurent, Chris Cannam, Richard Bown\nParts copyright 1994 - 2004 Chris Cannam, Andy Green, Richard Bown, Guillaume Laurent\nLilyPond fonts copyright 1997 - 2005 Han-Wen Nienhuys and Jan Nieuwenhuizen"),
413
418
"http://www.rosegardenmusic.com/",
414
419
"rosegarden-devel@lists.sourceforge.net");
421
426
aboutData.addAuthor("Heikki Johannes Junes", 0, "hjunes@users.sourceforge.net");
423
428
aboutData.addCredit("Randall Farmer", I18N_NOOP("Chord labelling code"), " rfarme@simons-rock.edu");
424
aboutData.addCredit("Hans Kieserman", I18N_NOOP("Lilypond output\nassorted other patches\ni18n-ization"), "hkieserman@mail.com");
429
aboutData.addCredit("Hans Kieserman", I18N_NOOP("LilyPond output\nassorted other patches\ni18n-ization"), "hkieserman@mail.com");
425
430
aboutData.addCredit("Levi Burton", I18N_NOOP("UI improvements\nbug fixes"), "donburton@sbcglobal.net");
426
431
aboutData.addCredit("Mark Hymers", I18N_NOOP("Segment colours\nOther UI and bug fixes"), "<markh@linuxfromscratch.org>");
427
432
aboutData.addCredit("Alexandre Prokoudine", I18N_NOOP("Russian translation\ni18n-ization"), "avp@altlinux.ru");
493
498
KConfig *config = kapp->config();
500
config->setGroup(GeneralOptionsConfigGroup);
501
QString lastVersion = config->readEntry("lastversion", "");
502
bool newVersion = (lastVersion != VERSION);
504
std::cerr << "*** This is the first time running this Rosegarden version" << std::endl;
505
config->writeEntry("lastversion", VERSION);
495
508
// If there is no config setting for the startup window size, set
496
509
// one now. But base the default on the appropriate desktop size
497
510
// (i.e. not the entire desktop, if Xinerama is in use). This is
504
517
// under Xinerama). These are obtained from QDesktopWidget.
506
519
config->setGroup("MainView");
520
int windowWidth = 0, windowHeight = 0;
508
522
QDesktopWidget *desktop = KApplication::desktop();
510
QRect totalRect(desktop->availableGeometry());
524
QRect totalRect(desktop->screenGeometry());
511
525
QRect desktopRect = KGlobalSettings::desktopGeometry(QPoint(0, 0));
512
526
QSize startupSize;
513
527
if (desktopRect.height() <= 800) {
520
534
QString widthKey = QString("Width %1").arg(totalRect.width());
521
535
QString heightKey = QString("Height %1").arg(totalRect.height());
522
if (!config->hasKey(widthKey)) {
523
config->writeEntry(widthKey, startupSize.width());
525
if (!config->hasKey(heightKey)) {
526
config->writeEntry(heightKey, startupSize.height());
536
windowWidth = config->readUnsignedNumEntry
537
(widthKey, startupSize.width());
538
windowHeight = config->readUnsignedNumEntry
539
(heightKey, startupSize.height());
530
542
config->setGroup("KDE Action Restrictions");
548
560
if (config->readBoolEntry("Logo", true) && (!kapp->isRestored() && args->isSet("splash")) ) {
549
561
RG_DEBUG << k_funcinfo << "Showing startup logo\n";
550
562
startLogo = KStartupLogo::getInstance();
563
startLogo->setShowTip(!newVersion);
551
564
startLogo->show();
584
597
args->isSet("existingsequencer"),
600
rosegardengui->setIsFirstRun(newVersion);
587
602
app.setMainWidget(rosegardengui);
604
if (windowWidth != 0 && windowHeight != 0) {
605
rosegardengui->resize(windowWidth, windowHeight);
589
608
rosegardengui->show();
591
610
// raise start logo
629
648
RG_DEBUG << "RosegardenGUI - " << e.getMessage() << endl;
634
// pause to ensure the logo has been visible for a reasonable
635
// length of time, just 'cos it looks a bit silly to show it
636
// and remove it immediately
639
gettimeofday(&now, 0);
641
RealTime visibleFor =
642
RealTime(now.tv_sec, now.tv_usec * 1000) -
643
RealTime(logoShowTime.tv_sec, logoShowTime.tv_usec * 1000);
645
if (visibleFor < RealTime(2, 0)) {
646
int waitTime = visibleFor.sec * 1000 + visibleFor.msec();
647
QTimer::singleShot(2500 - waitTime, startLogo, SLOT(close()));
654
// if the start logo is there, it's responsible for showing this;
655
// otherwise we have to
657
RG_DEBUG << "main: Showing Tips\n";
658
KTipDialog::showTip(locate("data", "rosegarden/tips"));
662
652
config->setGroup(SequencerOptionsConfigGroup);
690
680
XSetErrorHandler( _x_errhandler );
685
// pause to ensure the logo has been visible for a reasonable
686
// length of time, just 'cos it looks a bit silly to show it
687
// and remove it immediately
690
gettimeofday(&now, 0);
692
RealTime visibleFor =
693
RealTime(now.tv_sec, now.tv_usec * 1000) -
694
RealTime(logoShowTime.tv_sec, logoShowTime.tv_usec * 1000);
696
if (visibleFor < RealTime(2, 0)) {
697
int waitTime = visibleFor.sec * 1000 + visibleFor.msec();
698
QTimer::singleShot(2500 - waitTime, startLogo, SLOT(close()));
705
// if the start logo is there, it's responsible for showing this;
706
// otherwise we have to
709
RosegardenGUIApp::self()->awaitDialogClearance();
710
KTipDialog::showTip(locate("data", "rosegarden/tips"));
715
KStartupLogo::hideIfStillThere();
716
CurrentProgressDialog::freeze();
718
KDialogBase *dialog = new KDialogBase(rosegardengui, "welcome",
719
true, i18n("Welcome!"),
721
KDialogBase::Ok, false);
722
QVBox *mw = dialog->makeVBoxMainWidget();
723
QHBox *hb = new QHBox(mw);
724
QLabel *image = new QLabel(hb);
725
image->setAlignment(Qt::AlignTop);
726
QString iconFile = locate("appdata", "pixmaps/misc/welcome-icon.png");
728
image->setPixmap(QPixmap(iconFile));
730
QLabel *label = new QLabel(hb);
731
label->setText(i18n("<h2>Welcome to Rosegarden!</h2><p>Welcome to the Rosegarden audio and MIDI sequencer and musical notation editor.</p><ul><li>If you have not already done so, you may wish to install some DSSI synth plugins, or a separate synth program such as QSynth. Rosegarden does not synthesize sounds from MIDI on its own, so without these you will hear nothing.</li><br><br><li>Rosegarden uses the JACK audio server for recording and playback of audio, and for playback from DSSI synth plugins. These features will only be available if the JACK server is running.</li><br><br><li>Rosegarden has comprehensive documentation: see the Help menu for the handbook, tutorials, and other information!</li></ul><p>Rosegarden was brought to you by a team of volunteers across the world. To learn more, go to <a href=\"http://www.rosegardenmusic.com/\">http://www.rosegardenmusic.com/</a>.</p>"));
732
dialog->showButtonOK(true);
733
rosegardengui->awaitDialogClearance();
736
CurrentProgressDialog::thaw();
693
739
return kapp->exec();