KTMainWindow::KTMainWindow(KTSplash *splash) : DMainWindow(), m_exposureSheet(0), m_scenes(0)
{
	DINIT;
	
	setObjectName("KTMainWindow_");
	
	m_osd = new KTOsd( centralWidget() );
	
	m_statusBar = new KTStatusBar(this);
	setStatusBar( m_statusBar );
	
	setWindowTitle(tr("KToon: 2D animation toolkit"));
	m_renderType = KToon::RenderType(DCONFIG->value("RenderType").toInt());
	
	
	m_projectManager = new KTProjectManager(this);
	splash->setMessage( tr("Setting up the project manager") );
	
	m_drawingSpace = new KTWorkspace;
	m_drawingSpace->setWindowIcon(QIcon(THEME_DIR+"/icons/illustration_mode.png"));
	m_drawingSpace->setScrollBarsEnabled( true );
	
	addWidget(m_drawingSpace, tr("Illustration"), true);
	
	m_animationSpace = new KTWorkspace;
	m_animationSpace->setWindowIcon(QIcon(THEME_DIR+"/icons/animation_mode.png"));
	m_animationSpace->setScrollBarsEnabled ( true );
	
	connect(m_animationSpace, SIGNAL(contextMenu( const QPoint& )), this, SLOT(showAnimationMenu( const QPoint& )));

	addWidget(m_animationSpace, tr("Animation"), true);
	
	splash->setMessage( tr("Loading action manager..."));
	m_actionManager = new DActionManager(this);
	
// 	Create the menubar;
	splash->setMessage( tr("Creating menu bar..."));
	setupActions();
	
	splash->setMessage( tr("Creating GUI..."));
	
	createGUI();
	
	setupMenu();
	
	m_pActiveTabWidget->setCurrentIndex( 0 );
	
	DCONFIG->beginGroup("TipOfDay");
	bool showTips = qvariant_cast<bool>(DCONFIG->value("ShowOnStart", true ));
	
	
	if ( showTips )
	{
		QTimer::singleShot(0, this, SLOT(showTipDialog()));
	}
	
	KTPluginManager::instance()->loadPlugins();
}
示例#2
0
void HelloWorld::menuCloseCallback(Ref* pSender)
{
//#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
//	MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
//    return;
//#endif
//
//    Director::getInstance()->end();
//
//#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//    exit(0);
//#endif

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    showTipDialog("GotoShit", "ZGL,ready Go");
#endif

}
示例#3
0
void TupMainWindow::setupHelpActions()
{
    new TAction(QPixmap(THEME_DIR + "icons/about.png"), tr("About Tupi"), QKeySequence(tr("Ctrl+K")), this, SLOT(aboutTupi()), m_actionManager, "about tupi");
    new TAction(QPixmap(THEME_DIR + "icons/today_tip.png"), tr("Tip of the day"), QKeySequence(tr("Ctrl+T")), this, SLOT(showTipDialog()), m_actionManager, "tipofday");
}
示例#4
0
TupMainWindow::TupMainWindow(TupSplash *splash, int parameters) : 
              TabbedMainWindow(), m_projectManager(0), drawingTab(0), animationTab(0), 
              m_viewChat(0), m_exposureSheet(0), m_scenes(0), isSaveDialogOpen(false), internetOn(false)
{
    #ifdef K_DEBUG
           TINIT;
    #endif

    // Loading audio player plugin
    // TAudioPlayer::instance()->loadEngine("gstreamer"); // FIXME: Move this to the settings 
    setObjectName("TupMainWindow_");

    // Defining the status bar
    m_statusBar = new TupStatusBar(this);
    setStatusBar(m_statusBar);

    // Naming the main frame...
    setWindowTitle(tr("Tupi: Open 2D Magic"));
    setWindowIcon(QIcon(THEME_DIR + "icons/about.png"));

    // Defining the render type for the drawings
    m_renderType = Tupi::RenderType(TCONFIG->value("RenderType").toInt());

    // Calling out the project manager
    m_projectManager = new TupProjectManager(this);

    splash->setMessage(tr("Setting up the project manager"));
    SleeperThread::msleep(500);

    // Calling out the events/actions manager
    splash->setMessage(tr("Loading action manager..."));
    m_actionManager = new TActionManager(this);

    // Defining the menu bar
    splash->setMessage(tr("Creating menu bar..."));
    SleeperThread::msleep(500);

    setupActions();
	
    splash->setMessage(tr("Creating GUI..."));
    SleeperThread::msleep(500);
	
    // Setting up all the GUI...
    createGUI(); // This method is called from the tupmainwindow_gui class
    setupMenu();
    setupToolBar();

    // Check if user wants to see a Tupi tip for every time he launches the program
    TCONFIG->beginGroup("TipOfDay");
    //bool showTips = qvariant_cast<bool>(TCONFIG->value("ShowOnStart", true));
    bool showTips = TCONFIG->value("ShowOnStart", true).toBool();

    // If option is enabled, then, show a little dialog with a nice tip
    if (showTips)
        QTimer::singleShot(0, this, SLOT(showTipDialog()));

    // Time to load plugins... 
    TupPluginManager::instance()->loadPlugins();

    // Defining the Animation view, as the first interface to show up	
    setCurrentPerspective(Animation);

    TCONFIG->beginGroup("General");
    // check if into the config file, user always wants to start opening his last project 
    // created
    bool openLast = TCONFIG->value("OpenLastProject").toBool();

    if (openLast && parameters == 1)
        openProject(TCONFIG->value("LastProject").toString());

    if (TCONFIG->firstTime()) {
        TCONFIG->setValue("OpenLastProject", openLast);
        TCONFIG->setValue("AutoSave", 2);
    }

    TupMainWindow::requestType = None;
    lastSave = false;
}