Example #1
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    HelloDialog w;
    w.show();
    return a.exec();
}
Example #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    mDialog(0),
    mWebView(0),
    mCurrentNoteIndex(0)
{
    loadSettings();
    checkExistenceTempImgDir();

    setWindowTitle(tr("Zoth Reader"));
    setWindowIcon(QIcon(":/images/green_book_zoth.png"));
    createCentralWidget();
    //showFullScreen();
    showMaximized();
    setContextMenuPolicy(Qt::NoContextMenu);
    mDialog = new SettingsDialog();

    connect(&mEnExport, SIGNAL(exported()), SLOT(notesReloaded()));
    connect(&mEnExport, SIGNAL(exported()), SLOT(displayNotes()));
    connect(&mEnExport, SIGNAL(exported()), SLOT(refreshNavigationLabel()));
    connect(mDialog, SIGNAL(accepted()), SLOT(saveDialogSettings()));

    if(isFirstRun){
        HelloDialog* helloDialog = new HelloDialog(this);
        QPalette palette;
        palette.setColor(QPalette::Window, QColor(mBgColor));
        helloDialog->setPalette(palette);
        helloDialog->setBackgroundRole(QPalette::Window);
        helloDialog->activateWindow();
        helloDialog->show();
        connect(helloDialog, SIGNAL(tagAccepted(QString)), SLOT(setTagAndReload(QString)));
    }else{
        reloadNotes();
    }
}
Example #3
0
	virtual void draw(SDL_Surface *pScreen)
	{
		m_pDialog->update();

		// Clear the screen
		SDL_FillRect(pScreen, NULL/*&r*/, 0x000000);

		// Draw the dialog
		blitImage(pScreen, m_screenRect.x, m_screenRect.y, m_pDialog->image());
	}
Example #4
0
	virtual bool onMousePos(int x, int y)
	{
		return m_pDialog->handleMousePos(x - m_screenRect.x, y - m_screenRect.y);
	}
Example #5
0
	virtual void onMouseUp(int nButton, int x, int y)
	{
		m_pDialog->releaseButton(nButton);
	}
Example #6
0
	virtual void onMouseDown(int nButton, int x, int y)
	{
		m_pDialog->pressButton(nButton, x - m_screenRect.x, y - m_screenRect.y);
	}
Example #7
0
	virtual void onChar(char c)
	{
		m_pDialog->handleChar(c);
	}