Ejemplo n.º 1
0
void Window::createMenu()
{
    menuBar = new QMenuBar;

    fileMenu = new QMenu(tr("&File"), this);
    exitAction = fileMenu->addAction(tr("E&xit"));

    fileMenu2 = new QMenu(tr("&Help"), this);
    infoAction = fileMenu2->addAction(tr("Info"));

    fileMenu3 = new QMenu(tr("&Edit"), this);
    loadInputAction = fileMenu3->addAction(tr("L&oad Data"));
    loadTemplAction = fileMenu3->addAction(tr("L&oad Templates"));
    resetAction = fileMenu3->addAction(tr("R&eset"));

    menuBar->addMenu(fileMenu);
    menuBar->addMenu(fileMenu2);
    menuBar->addMenu(fileMenu3);

    connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
    connect(resetAction, SIGNAL(triggered()), this, SLOT(slotMenuReset()));
    connect(infoAction, SIGNAL(triggered()), this, SLOT(getInfo()));
    connect(loadInputAction, SIGNAL(triggered()), this, SLOT(setBrainDirectory()));
    connect(loadTemplAction, SIGNAL(triggered()), this, SLOT(setTargetDirectory()));

}
Ejemplo n.º 2
0
NewstuffModel::NewstuffModel( QObject *parent ) :
    QAbstractListModel( parent ), d( new NewstuffModelPrivate( this ) )
{
    setTargetDirectory(MarbleDirs::localPath() + QLatin1String("/maps"));
    // no default registry file

    connect( &d->m_networkAccessManager, SIGNAL(finished(QNetworkReply*)),
             this, SLOT(handleProviderData(QNetworkReply*)) );

    QHash<int,QByteArray> roles;
    roles[Qt::DisplayRole] = "display";
    roles[Name] = "name";
    roles[Author] = "author";
    roles[License] = "license";
    roles[Summary] = "summary";
    roles[Version] = "version";
    roles[ReleaseDate] = "releasedate";
    roles[Preview] = "preview";
    roles[Payload] = "payload";
    roles[InstalledVersion] = "installedversion";
    roles[InstalledReleaseDate] = "installedreleasedate";
    roles[InstalledFiles] = "installedfiles";
    roles[IsInstalled] = "installed";
    roles[IsUpgradable] = "upgradable";
    roles[Category] = "category";
    roles[IsTransitioning] = "transitioning";
    roles[PayloadSize] = "size";
    roles[DownloadedSize] = "downloaded";
    d->m_roleNames = roles;
}
Ejemplo n.º 3
0
FClient::FClient()
{
	char buf[PATH_MAX];
	
	/* set the default server name */
	setServerName("localhost");

	/* set the default port number */
	setServerPort(10002);

	/* set the directory to the current working directory */
	getcwd(buf,PATH_MAX);
	setTargetDirectory(buf);
	
}