QCommonDialog::QCommonDialog(const std::string &title) : QDialog(0, 0, true) {
	setCaption(title.c_str());

	QVBoxLayout *layout = new QVBoxLayout(this);
	QWidget *widget = new QVBox(this);
	layout->add(widget);
	myTab = new QOptionsDialogTab(widget);

	myButtonGroup = new QButtonGroup(this);
	layout->add(myButtonGroup);
	myButtonLayout = new QGridLayout(myButtonGroup, 1, 0, 8, 8);
}
Example #2
0
ZLQtDialog::ZLQtDialog(QWidget *parent, const ZLResource &resource) : QDialog(parent, 0, true), myButtonNumber(0) {
	setCaption(::qtString(resource[ZLDialogManager::DIALOG_TITLE].value()));

	QVBoxLayout *layout = new QVBoxLayout(this);
	QWidget *widget = new QVBox(this);
	layout->add(widget);
	myTab = new ZLQtDialogContent(widget, resource);

	myButtonGroup = new QButtonGroup(this);
	layout->add(myButtonGroup);
	myButtonLayout = new QGridLayout(myButtonGroup, 1, 0, 8, 8);
}
Example #3
0
KcmKRfb::KcmKRfb(QWidget *p, const char *name, const QStringList &) :
    KCModule(KcmKRfbFactory::instance(), p, name),
    m_configuration(KRFB_CONFIGURATION_MODE) {

    m_confWidget = new ConfigurationWidget(this);

    QVBoxLayout *l = new QVBoxLayout(this, 0, KDialog::spacingHint());
    l->add(m_confWidget);

    setButtons(Default|Apply|Reset);

    KAboutData* about = new KAboutData( "kcm_krfb", I18N_NOOP("Desktop Sharing Control Module"),
                                        VERSION,
                                        I18N_NOOP("Configure desktop sharing"), KAboutData::License_GPL,
                                        "(c) 2002, Tim Jansen\n",
                                        0, "http://www.tjansen.de/krfb", "*****@*****.**");
    about->addAuthor("Tim Jansen", 0, "*****@*****.**");
    setAboutData( about );

    load();

    connect(m_confWidget->passwordInput, SIGNAL(textChanged(const QString&)), SLOT(configChanged()) );
    connect(m_confWidget->allowUninvitedCB, SIGNAL(clicked()), SLOT(configChanged()) );
    connect(m_confWidget->enableSLPCB, SIGNAL(clicked()), SLOT(configChanged()) );
    connect(m_confWidget->confirmConnectionsCB, SIGNAL(clicked()), SLOT(configChanged()) );
    connect(m_confWidget->allowDesktopControlCB, SIGNAL(clicked()), SLOT(configChanged()) );
    connect(m_confWidget->autoPortCB, SIGNAL(clicked()), SLOT(configChanged()) );
    connect(m_confWidget->portInput, SIGNAL(valueChanged(int)), SLOT(configChanged()) );
    connect((QObject*)m_confWidget->manageInvitations, SIGNAL(clicked()),
            &m_configuration, SLOT(showManageInvitationsDialog()) );
    connect(&m_configuration, SIGNAL(invitationNumChanged(int)),
            this, SLOT(setInvitationNum(int)));
    setInvitationNum(m_configuration.invitations().size());
    connect(m_confWidget->disableBackgroundCB, SIGNAL(clicked()), SLOT(configChanged()) );
}
TestbedWebcamDialog::TestbedWebcamDialog( const QString &contactId, QWidget * parent, const char * name )
: KDialogBase( KDialogBase::Plain, Qt::WDestructiveClose, parent, name, false, i18n( "Webcam for %1" ).arg( contactId ),
                   KDialogBase::Close, KDialogBase::Close, true /*seperator*/ )
{
	setInitialSize( QSize(320,290), false );
	
	setEscapeButton( KDialogBase::Close );
//	QObject::connect( this, SIGNAL( closeClicked() ), this, SIGNAL( closingWebcamDialog() ) );

	QWidget *page = plainPage();
	setMainWidget(page);

	QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );	
	mImageContainer = new Kopete::WebcamWidget( page );
	mImageContainer->setMinimumSize(320,240);
	mImageContainer->setText( i18n( "No webcam image received" ) );
	mImageContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	topLayout->add( mImageContainer );
	
	show();
	
	mVideoDevicePool = Kopete::AV::VideoDevicePool::self();
	mVideoDevicePool->open();
	mVideoDevicePool->setSize(320, 240);
	mVideoDevicePool->startCapturing();
	mVideoDevicePool->getFrame();
	mVideoDevicePool->getImage(&mImage);
kdDebug() << "Just captured 1st frame" << endl;

	mPixmap=QPixmap(320,240,-1, QPixmap::DefaultOptim);
	if (mPixmap.convertFromImage(mImage,0) == true)
		mImageContainer->updatePixmap(mPixmap);
	connect(&qtimer, SIGNAL(timeout()), this, SLOT(slotUpdateImage()) );
	qtimer.start(0,FALSE);
}
DialogAddSourceDir::DialogAddSourceDir(QWidget* parent, const char* name) :
    KDialogBase(parent, name, true, i18n("Add source folder"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, false)
{
    QWidget* mainPanel = new QWidget(this, "mainPanel");
    setMainWidget(mainPanel);
    QVBoxLayout* mainPanelLayout = new QVBoxLayout(mainPanel, 0, 5, "mainPanelLayout");

    // append the directory panel
    QWidget* dirPanel = new QWidget(mainPanel, "dirPanel");
    mainPanelLayout->add(dirPanel);
    QHBoxLayout* dirLayout = new QHBoxLayout(dirPanel, 0, 5, "dirPanelLayout");

    QLabel* directoryLabel = new QLabel(i18n("Folder"), dirPanel, "directoryLabel");
    dirLayout->add(directoryLabel);
    QWhatsThis::add(dirPanel, i18n("<b>Folder</b><p>Enter the path to the folder you want to add to the <i>KPhotoBook</i> database.</p>"));

    m_currentDirectoryLineEdit = new KLineEdit(dirPanel, "dirLineEdit");
    m_currentDirectoryLineEdit->setMinimumWidth(300);
    m_currentDirectoryLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    dirLayout->add(m_currentDirectoryLineEdit);

    QObject::connect(m_currentDirectoryLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotTextChanged(const QString&)));

    QIconSet folderIconSet = KGlobal::iconLoader()->loadIconSet("folder", KIcon::Small, 24, false);
    QPushButton* dirButton = new QPushButton(folderIconSet, 0, dirPanel, "dirButton");
    dirButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    dirLayout->add(dirButton);

    QObject::connect(dirButton, SIGNAL(clicked()), this, SLOT(slotDirectoryButtonClicked()));

    // add checkbox
    m_recursiveCheckBox = new QCheckBox(i18n("Add folders recursively."), mainPanel, "recursiveCheckBox");
    m_recursiveCheckBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    mainPanelLayout->add(m_recursiveCheckBox);
    QWhatsThis::add(m_recursiveCheckBox, i18n("<b>Add folders recursively</b><p>If enabled, <i>KPhotoBook</i> will add the folder recursively, meaning that sub folders will be added to the database as well, while not following symbolic links to avoid an infinite loop.</p>"));

    // spacer
    mainPanelLayout->addStretch(1);

    // set the directory
    m_currentDirectoryLineEdit->setText(Settings::fileSystemLastAddedSourcedir());

    // set the focus
    m_currentDirectoryLineEdit->setFocus();
}
bool DisplayFlagsDataWidget::createWidgets()
{
    flags = new DisplayFlagWidget(this);
    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->add(flags);
    connect(flags, SIGNAL(clicked()), this, SLOT(setWidgetDirty()));
    //flags->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
    //flags->setMinimumSize(QSize(50,400));
    setMinimumSize(QSize(50,400));
    //setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
    return true;
}
Example #7
0
KonquerorConfig::KonquerorConfig( QWidget* parent_P, const char* )
    : KCModule( parent_P, "kcmperformance" )
    {
    setQuickHelp( i18n( "<h1>Konqueror Performance</h1>"
        " You can configure several settings that improve Konqueror performance here."
        " These include options for reusing already running instances"
        " and for keeping instances preloaded." ));

    QVBoxLayout *topLayout = new QVBoxLayout( this );
    widget = new Konqueror( this );
    connect( widget, SIGNAL( changed()), SLOT( changed()));
    topLayout->add( widget );
    load();
    }
Example #8
0
ZLQtDialog::ZLQtDialog(QWidget *parent, const ZLResource &resource) : ZBaseDialog(parent, 0, true), myButtonNumber(0) {
	QFont f(qApp->font());
	f.setPointSize(15);
	setFont(f);

	QVBoxLayout *layout = new QVBoxLayout(this);
	QWidget *widget = new QVBox(this);
	layout->add(widget);
	
	QFrame *frmTitle = new QFrame(widget);
	frmTitle->setFixedHeight(25);
	QHBoxLayout *hblTitle = new QHBoxLayout(frmTitle);
	QLabel *lblTitle = new QLabel(::qtString("  " + resource[ZLDialogManager::DIALOG_TITLE].value()), frmTitle);
	hblTitle->addWidget(lblTitle);
	UTIL_Graph::makeTitle(lblTitle, 1);
	
	myTab = new ZLQtDialogContent(widget, resource);

	myButtonGroup = new QButtonGroup(this);
	layout->add(myButtonGroup);

	myButtonLayout = new QGridLayout(myButtonGroup, 1, 0, 0, 0);
}
Example #9
0
Config::Config( QWidget* parent_P, const char* )
    : KCModule( parent_P, "kcmperformance" )
    {
    setQuickHelp( i18n( "<h1>KDE Performance</h1>"
        " You can configure settings that improve KDE performance here." ));
    
    QVBoxLayout *topLayout = new QVBoxLayout( this );
    QTabWidget* tabs = new QTabWidget( this );
    konqueror_widget = new Konqueror( tabs );
    konqueror_widget->layout()->setMargin( KDialog::marginHint() );
    connect( konqueror_widget, SIGNAL( changed()), SLOT( changed()));
    tabs->addTab( konqueror_widget, i18n( "Konqueror" ));
    system_widget = new SystemWidget( tabs );
    system_widget->layout()->setMargin( KDialog::marginHint() );
    connect( system_widget, SIGNAL( changed()), SLOT( changed()));
    tabs->addTab( system_widget, i18n( "System" ));
    topLayout->add( tabs );
    load();
    }
Example #10
0
KCMKonsole::KCMKonsole(QWidget *parent, const char *name, const QStringList &) : KCModule(ModuleFactory::instance(), parent, name)
{

    setQuickHelp(
        i18n("<h1>Konsole</h1> With this module you can configure Konsole, the KDE terminal"
             " application. You can configure the generic Konsole options (which can also be "
             "configured using the RMB) and you can edit the schemas and sessions "
             "available to Konsole."));

    QVBoxLayout *topLayout = new QVBoxLayout(this);
    dialog = new KCMKonsoleDialog(this);
    dialog->line_spacingSB->setRange(0, 8, 1, false);
    dialog->line_spacingSB->setSpecialValueText(i18n("normal line spacing", "Normal"));
    dialog->show();
    topLayout->add(dialog);
    load();

    KAboutData *ab = new KAboutData("kcmkonsole", I18N_NOOP("KCM Konsole"), "0.2", I18N_NOOP("KControl module for Konsole configuration"),
                                    KAboutData::License_GPL, "(c) 2001, Andrea Rizzi", 0, 0, "*****@*****.**");

    ab->addAuthor("Andrea Rizzi", 0, "*****@*****.**");
    setAboutData(ab);

    connect(dialog->terminalSizeHintCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->warnCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->ctrldragCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->cutToBeginningOfLineCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->allowResizeCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->bidiCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->xonXoffCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->blinkingCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->frameCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->line_spacingSB, SIGNAL(valueChanged(int)), SLOT(changed()));
    connect(dialog->matchTabWinTitleCB, SIGNAL(toggled(bool)), SLOT(changed()));
    connect(dialog->silence_secondsSB, SIGNAL(valueChanged(int)), SLOT(changed()));
    connect(dialog->word_connectorLE, SIGNAL(textChanged(const QString &)), SLOT(changed()));
    connect(dialog->SchemaEditor1, SIGNAL(changed()), SLOT(changed()));
    connect(dialog->SessionEditor1, SIGNAL(changed()), SLOT(changed()));
    connect(dialog->SchemaEditor1, SIGNAL(schemaListChanged(const QStringList &, const QStringList &)), dialog->SessionEditor1,
            SLOT(schemaListChanged(const QStringList &, const QStringList &)));
    connect(dialog->SessionEditor1, SIGNAL(getList()), dialog->SchemaEditor1, SLOT(getList()));
}
Example #11
0
KSocksConfig::KSocksConfig(QWidget *parent)
  : KCModule(parent, "kcmkio")
{

  KAboutData *about =
  new KAboutData(I18N_NOOP("kcmsocks"), I18N_NOOP("KDE SOCKS Control Module"),
                0, 0, KAboutData::License_GPL,
                I18N_NOOP("(c) 2001 George Staikos"));

  about->addAuthor("George Staikos", 0, "*****@*****.**");

  setAboutData( about );


  QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
  base = new SocksBase(this);
  layout->add(base);

  connect(base->_c_enableSocks, SIGNAL(clicked()), this, SLOT(enableChanged()));
  connect(base->bg, SIGNAL(clicked(int)), this, SLOT(methodChanged(int)));

  // The custom library
  connect(base->_c_customPath, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(chooseCustomLib(KURLRequester *)));
  connect(base->_c_customPath, SIGNAL(textChanged(const QString&)),
                     this, SLOT(customPathChanged(const QString&)));

  // Additional libpaths
  connect(base->_c_newPath, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(chooseCustomLib(KURLRequester *)));
  connect(base->_c_newPath, SIGNAL(returnPressed(const QString&)),
          this, SLOT(addThisLibrary(const QString&)));
  connect(base->_c_newPath, SIGNAL(textChanged(const QString&)),
          this, SLOT(libTextChanged(const QString&)));
  connect(base->_c_add, SIGNAL(clicked()), this, SLOT(addLibrary()));
  connect(base->_c_remove, SIGNAL(clicked()), this, SLOT(removeLibrary()));
  connect(base->_c_libs, SIGNAL(selectionChanged()), this, SLOT(libSelection()));

  // The "Test" button
  connect(base->_c_test, SIGNAL(clicked()), this, SLOT(testClicked()));

  // The config backend
  load();
}
Example #12
0
KCMKuick::KCMKuick(QWidget *parent, const char *name, const QStringList &)
:KCModule(parent, name)
{
    KAboutData *ab=new KAboutData( "kcmkuick", I18N_NOOP("KCM Kuick"),
       "0.2",I18N_NOOP("KControl module for Kuick's configuration"), KAboutData::License_GPL,
       "(c) 2001, Holger Freyther", 0, 0, "*****@*****.**");
    ab->addAuthor("Holger Freyther",0, "*****@*****.**");
    setAboutData( ab );

    QVBoxLayout *topLayout = new QVBoxLayout(this, 0, 0);
    dialog = new KCMKuickDialog(this);
    topLayout->add(dialog);
    topLayout->addStretch();

    connect( dialog->m_sbCopy, SIGNAL(valueChanged(int) ), SLOT(configChanged() ) );
    connect( dialog->m_sbMove, SIGNAL(valueChanged(int) ), SLOT(configChanged() ) );
    connect( dialog->pbCopyClear, SIGNAL(pressed() ), SLOT(slotClearCopyCache() ) );
    connect( dialog->pbMoveClear, SIGNAL(pressed() ), SLOT(slotClearMoveCache() ) );
    connect( dialog->m_chkShow, SIGNAL(clicked() ), SLOT(slotShowToggled() ) );
    
    load();
}
Example #13
0
KateConfigDialog::KateConfigDialog(KateMainWindow *parent, Kate::View *view)
    : KDialogBase(KDialogBase::TreeList, i18n("Configure"), KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel | KDialogBase::Help,
                  KDialogBase::Ok, parent, "configdialog")
{
    KConfig *config = KateApp::self()->config();

    KWin::setIcons(winId(), KateApp::self()->icon(), KateApp::self()->miniIcon());

    actionButton(KDialogBase::Apply)->setEnabled(false);

    mainWindow = parent;

    setMinimumSize(600, 400);

    v = view;

    pluginPages.setAutoDelete(false);
    editorPages.setAutoDelete(false);

    QStringList path;

    setShowIconsInTreeList(true);

    path.clear();
    path << i18n("Application");
    setFolderIcon(path, SmallIcon("kate", KIcon::SizeSmall));

    path.clear();

    // BEGIN General page
    path << i18n("Application") << i18n("General");
    QFrame *frGeneral = addPage(path, i18n("General Options"), BarIcon("gohome", KIcon::SizeSmall));

    QVBoxLayout *lo = new QVBoxLayout(frGeneral);
    lo->setSpacing(KDialog::spacingHint());
    config->setGroup("General");

    // GROUP with the one below: "Appearance"
    QButtonGroup *bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("&Appearance"), frGeneral);
    lo->addWidget(bgStartup);

    // show full path in title
    config->setGroup("General");
    cb_fullPath = new QCheckBox(i18n("&Show full path in title"), bgStartup);
    cb_fullPath->setChecked(mainWindow->viewManager()->getShowFullPath());
    QWhatsThis::add(cb_fullPath, i18n("If this option is checked, the full document path will be shown in the window caption."));
    connect(cb_fullPath, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));


    // GROUP with the one below: "Behavior"
    bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("&Behavior"), frGeneral);
    lo->addWidget(bgStartup);

    // sync the konsole ?
    cb_syncKonsole = new QCheckBox(bgStartup);
    cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document"));
    cb_syncKonsole->setChecked(parent->syncKonsole);
    QWhatsThis::add(cb_syncKonsole, i18n("If this is checked, the built in Konsole will <code>cd</code> to the directory "
                                         "of the active document when started and whenever the active document changes, "
                                         "if the document is a local file."));
    connect(cb_syncKonsole, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    // modified files notification
    cb_modNotifications = new QCheckBox(i18n("Wa&rn about files modified by foreign processes"), bgStartup);
    cb_modNotifications->setChecked(parent->modNotification);
    QWhatsThis::add(cb_modNotifications, i18n("If enabled, when Kate receives focus you will be asked what to do with "
                                              "files that have been modified on the hard disk. If not enabled, you will "
                                              "be asked what to do with a file that has been modified on the hard disk only "
                                              "when that file gains focus inside Kate."));
    connect(cb_modNotifications, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    // GROUP with the one below: "Meta-informations"
    bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("Meta-Information"), frGeneral);
    lo->addWidget(bgStartup);

    // save meta infos
    cb_saveMetaInfos = new QCheckBox(bgStartup);
    cb_saveMetaInfos->setText(i18n("Keep &meta-information past sessions"));
    cb_saveMetaInfos->setChecked(KateDocManager::self()->getSaveMetaInfos());
    QWhatsThis::add(cb_saveMetaInfos, i18n("Check this if you want document configuration like for example "
                                           "bookmarks to be saved past editor sessions. The configuration will be "
                                           "restored if the document has not changed when reopened."));
    connect(cb_saveMetaInfos, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    // meta infos days
    QHBox *hbDmf = new QHBox(bgStartup);
    hbDmf->setEnabled(KateDocManager::self()->getSaveMetaInfos());
    QLabel *lDmf = new QLabel(i18n("&Delete unused meta-information after:"), hbDmf);
    sb_daysMetaInfos = new QSpinBox(0, 180, 1, hbDmf);
    sb_daysMetaInfos->setSpecialValueText(i18n("(never)"));
    sb_daysMetaInfos->setSuffix(i18n(" day(s)"));
    sb_daysMetaInfos->setValue(KateDocManager::self()->getDaysMetaInfos());
    lDmf->setBuddy(sb_daysMetaInfos);
    connect(cb_saveMetaInfos, SIGNAL(toggled(bool)), hbDmf, SLOT(setEnabled(bool)));
    connect(sb_daysMetaInfos, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));

    lo->addStretch(1); // :-] works correct without autoadd
    // END General page

    path.clear();

    // BEGIN Session page
    path << i18n("Application") << i18n("Sessions");
    QFrame *frSessions = addPage(path, i18n("Session Management"), BarIcon("history", KIcon::SizeSmall));

    lo = new QVBoxLayout(frSessions);
    lo->setSpacing(KDialog::spacingHint());

    // GROUP with the one below: "Startup"
    bgStartup = new QButtonGroup(1, Qt::Horizontal, i18n("Elements of Sessions"), frSessions);
    lo->addWidget(bgStartup);

    // restore view  config
    cb_restoreVC = new QCheckBox(bgStartup);
    cb_restoreVC->setText(i18n("Include &window configuration"));
    config->setGroup("General");
    cb_restoreVC->setChecked(config->readBoolEntry("Restore Window Configuration", true));
    QWhatsThis::add(cb_restoreVC, i18n("Check this if you want all your views and frames restored each time you open Kate"));
    connect(cb_restoreVC, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    QRadioButton *rb1, *rb2, *rb3;

    sessions_start = new QButtonGroup(1, Qt::Horizontal, i18n("Behavior on Application Startup"), frSessions);
    lo->add(sessions_start);

    sessions_start->setRadioButtonExclusive(true);
    sessions_start->insert(rb1 = new QRadioButton(i18n("&Start new session"), sessions_start), 0);
    sessions_start->insert(rb2 = new QRadioButton(i18n("&Load last-used session"), sessions_start), 1);
    sessions_start->insert(rb3 = new QRadioButton(i18n("&Manually choose a session"), sessions_start), 2);

    config->setGroup("General");
    QString sesStart(config->readEntry("Startup Session", "manual"));
    if(sesStart == "new")
        sessions_start->setButton(0);
    else if(sesStart == "last")
        sessions_start->setButton(1);
    else
        sessions_start->setButton(2);

    connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    sessions_exit = new QButtonGroup(1, Qt::Horizontal, i18n("Behavior on Application Exit or Session Switch"), frSessions);
    lo->add(sessions_exit);

    sessions_exit->setRadioButtonExclusive(true);
    sessions_exit->insert(rb1 = new QRadioButton(i18n("&Do not save session"), sessions_exit), 0);
    sessions_exit->insert(rb2 = new QRadioButton(i18n("&Save session"), sessions_exit), 1);
    sessions_exit->insert(rb3 = new QRadioButton(i18n("&Ask user"), sessions_exit), 2);

    config->setGroup("General");
    QString sesExit(config->readEntry("Session Exit", "save"));
    if(sesExit == "discard")
        sessions_exit->setButton(0);
    else if(sesExit == "save")
        sessions_exit->setButton(1);
    else
        sessions_exit->setButton(2);

    connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
    connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));

    lo->addStretch(1); // :-] works correct without autoadd
    // END Session page

    path.clear();

    // file selector page
    path << i18n("Application") << i18n("File Selector");

    QVBox *page = addVBoxPage(path, i18n("File Selector Settings"), BarIcon("fileopen", KIcon::SizeSmall));
    fileSelConfigPage = new KFSConfigPage(page, "file selector config page", mainWindow->fileselector);
    connect(fileSelConfigPage, SIGNAL(changed()), this, SLOT(slotChanged()));
    path.clear();

    path << i18n("Application") << i18n("Document List");
    page = addVBoxPage(path, i18n("Document List Settings"), BarIcon("view_text", KIcon::SizeSmall));
    filelistConfigPage = new KFLConfigPage(page, "file list config page", mainWindow->filelist);
    connect(filelistConfigPage, SIGNAL(changed()), this, SLOT(slotChanged()));
    path.clear();

    path << i18n("Application") << i18n("Plugins");
    /*QVBox **/ page = addVBoxPage(path, i18n("Plugin Manager"), BarIcon("connect_established", KIcon::SizeSmall));
    KateConfigPluginPage *configPluginPage = new KateConfigPluginPage(page, this);
    connect(configPluginPage, SIGNAL(changed()), this, SLOT(slotChanged()));

    // Tools->External Tools menu
    path.clear();
    path << i18n("Application") << i18n("External Tools");
    page = addVBoxPage(path, i18n("External Tools"), BarIcon("configure", KIcon::SizeSmall));
    configExternalToolsPage = new KateExternalToolsConfigWidget(page, "external tools config page");
    connect(configExternalToolsPage, SIGNAL(changed()), this, SLOT(slotChanged()));

    // editor widgets from kwrite/kwdialog
    path.clear();
    path << i18n("Editor");
    setFolderIcon(path, SmallIcon("edit", KIcon::SizeSmall));

    for(uint i = 0; i < KTextEditor::configInterfaceExtension(v->document())->configPages(); i++)
    {
        path.clear();
        path << i18n("Editor") << KTextEditor::configInterfaceExtension(v->document())->configPageName(i);
        /*QVBox **/ page = addVBoxPage(path, KTextEditor::configInterfaceExtension(v->document())->configPageFullName(i),
                                       KTextEditor::configInterfaceExtension(v->document())->configPagePixmap(i, KIcon::SizeSmall));

        KTextEditor::ConfigPage *cPage = KTextEditor::configInterfaceExtension(v->document())->configPage(i, page);
        connect(cPage, SIGNAL(changed()), this, SLOT(slotChanged()));
        editorPages.append(cPage);
    }

    KatePluginList &pluginList(KatePluginManager::self()->pluginList());
    for(unsigned int i = 0; i < pluginList.size(); ++i)
    {
        if(pluginList[i].load && Kate::pluginConfigInterfaceExtension(pluginList[i].plugin))
            addPluginPage(pluginList[i].plugin);
    }

    enableButtonSeparator(true);
    dataChanged = false;
    unfoldTreeList();
}
Example #14
0
//----------------------------------------------------------------------------------
// our main form for Brick-by-Brick
//----------------------------------------------------------------------------------
BBB_Form::BBB_Form( QWidget *parent, const char *name ) : QWidget( parent, name )
{
	// set our forms size and name
	setName("AutoMason");
	// setMinimumSize( 1024,768 );
	setMinimumSize( 1024,600 );
	
	setCaption("AutoMason v 2.0");

	//--------------------------------------------------------------------------------
	// Main Palette Creation
	//--------------------------------------------------------------------------------
	QPalette pal;
	QColorGroup cg;
	cg.setColor( QColorGroup::Foreground, black );
	cg.setColor( QColorGroup::Button, QColor( 158, 158, 158) );
	cg.setColor( QColorGroup::Light, QColor( 237, 237, 237) );
	cg.setColor( QColorGroup::Midlight, QColor( 197, 197, 197) );
	cg.setColor( QColorGroup::Dark, QColor( 79, 79, 79) );
	cg.setColor( QColorGroup::Mid, QColor( 105, 105, 105) );
	cg.setColor( QColorGroup::Text, black );
	cg.setColor( QColorGroup::BrightText, white );
	cg.setColor( QColorGroup::ButtonText, black );
	cg.setColor( QColorGroup::Base, white );
	cg.setColor( QColorGroup::Background, QColor( 197, 197, 197) );
	cg.setColor( QColorGroup::Shadow, black );
	cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
	cg.setColor( QColorGroup::HighlightedText, white );
	cg.setColor( QColorGroup::Link, black );
	cg.setColor( QColorGroup::LinkVisited, black );
	pal.setActive( cg );
	cg.setColor( QColorGroup::Foreground, black );
	cg.setColor( QColorGroup::Button, QColor( 158, 158, 158) );
	cg.setColor( QColorGroup::Light, QColor( 237, 237, 237) );
	cg.setColor( QColorGroup::Midlight, QColor( 181, 181, 181) );
	cg.setColor( QColorGroup::Dark, QColor( 79, 79, 79) );
	cg.setColor( QColorGroup::Mid, QColor( 105, 105, 105) );
	cg.setColor( QColorGroup::Text, black );
	cg.setColor( QColorGroup::BrightText, white );
	cg.setColor( QColorGroup::ButtonText, black );
	cg.setColor( QColorGroup::Base, white );
	cg.setColor( QColorGroup::Background, QColor( 197, 197, 197) );
	cg.setColor( QColorGroup::Shadow, black );
	cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
	cg.setColor( QColorGroup::HighlightedText, white );
	cg.setColor( QColorGroup::Link, black );
	cg.setColor( QColorGroup::LinkVisited, black );
	pal.setInactive( cg );
	cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
	cg.setColor( QColorGroup::Button, QColor( 158, 158, 158) );
	cg.setColor( QColorGroup::Light, QColor( 237, 237, 237) );
	cg.setColor( QColorGroup::Midlight, QColor( 181, 181, 181) );
	cg.setColor( QColorGroup::Dark, QColor( 79, 79, 79) );
	cg.setColor( QColorGroup::Mid, QColor( 105, 105, 105) );
	cg.setColor( QColorGroup::Text, QColor( 128, 128, 128) );
	cg.setColor( QColorGroup::BrightText, white );
	cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
	cg.setColor( QColorGroup::Base, white );
	cg.setColor( QColorGroup::Background, QColor( 197, 197, 197) );
	cg.setColor( QColorGroup::Shadow, black );
	cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
	cg.setColor( QColorGroup::HighlightedText, white );
	cg.setColor( QColorGroup::Link, white );
	cg.setColor( QColorGroup::LinkVisited, white );
	pal.setDisabled( cg );
	setPalette( pal );

	//--------------------------------------------------------------------------------
	// UI - Toolbox Container Setup
	//--------------------------------------------------------------------------------
	tb_MainUI = new QToolBox( this, "tb_MainUI" );
	tb_MainUI->setGeometry( QRect( 855, 10, 165, 750 ) );
	tb_MainUI->setFrameShape( QToolBox::NoFrame );
	tb_MainUI->setFrameShadow( QToolBox::Plain );
	tb_MainUI->setCurrentIndex( 0 );

	pg_BrickCreation = new QWidget( tb_MainUI, "pg_BrickCreation" );
    pg_BrickCreation->setBackgroundMode( QWidget::PaletteBackground );

	pg_StartCondition = new QWidget( tb_MainUI, "pg_StartCondition" );
    pg_StartCondition->setBackgroundMode( QWidget::PaletteBackground );

	pg_Rules = new QWidget( tb_MainUI, "pg_Rules" );
    pg_Rules->setBackgroundMode( QWidget::PaletteBackground );
	pg_Rules->setFocusPolicy(QWidget::StrongFocus);

	pg_BeamCreation = new QWidget( tb_MainUI, "pg_BeamCreation" );
    pg_BeamCreation->setBackgroundMode( QWidget::PaletteBackground );

	tb_MainUI->addItem( pg_BrickCreation, QString::fromLatin1("Brick Creation") );
	tb_MainUI->addItem( pg_StartCondition, QString::fromLatin1("Start Conditions") );
	tb_MainUI->addItem( pg_Rules, QString::fromLatin1("Pattern Generation") );
	tb_MainUI->addItem( pg_BeamCreation, QString::fromLatin1("Beam Generation") );

	//--------------------------------------------------------------------------------
	// UI - Brick Generation
	//--------------------------------------------------------------------------------
	grp_BrickCreation = new QGroupBox( pg_BrickCreation, "grp_BrickCreation" );
	grp_BrickCreation->setGeometry( QRect( 0, 0, 165, 165) ); // , 140) );
	
	// brick size
	lbl_BrickSize = new QLabel( grp_BrickCreation, "lbl_BrickSize" );
	lbl_BrickSize->setGeometry( QRect( 5, 7, 50, 14 ) );
	lbl_BrickSize->setText("Brick Size:");
	
	lbl_BrickSize_Length = new QLabel( grp_BrickCreation, "lbl_BrickSize_Length" );
	lbl_BrickSize_Length->setGeometry( QRect( 5, 23, 30, 20 ) );
	lbl_BrickSize_Length->setText("width:");
	
	edit_BrickSize_Length = new QLineEdit( grp_BrickCreation, "edit_BrickSize_Length" );
	edit_BrickSize_Length->setGeometry( QRect( 35, 22, 40, 20 ) );
	edit_BrickSize_Length->setText("8");
	
	lbl_BrickSize_Width = new QLabel( grp_BrickCreation, "lbl_BrickSize_Width" );
	lbl_BrickSize_Width->setGeometry( QRect( 80, 22, 33, 20 ) );
	lbl_BrickSize_Width->setText("height:");
	
	edit_BrickSize_Width = new QLineEdit( grp_BrickCreation, "edit_BrickSize_Width" );
	edit_BrickSize_Width->setGeometry( QRect( 115, 22, 40, 20 ) );
	edit_BrickSize_Width->setText("4");
	
	// number of bricks
	lbl_NumBricks = new QLabel( grp_BrickCreation, "lbl_NumBricks" );
	lbl_NumBricks->setGeometry( QRect( 5, 53, 85, 20 ) );
	lbl_NumBricks->setText("Number of Bricks:");
	
	lbl_NumBricks_Rows = new QLabel( grp_BrickCreation, "lbl_NumBricks_Rows" );
	lbl_NumBricks_Rows->setGeometry( QRect( 5, 72, 26, 20 ) );
	lbl_NumBricks_Rows->setText("rows:");
	
	edit_NumBricks_Row = new QLineEdit( grp_BrickCreation, "edit_NumBricks_Row" );
	edit_NumBricks_Row->setGeometry( QRect( 35, 72, 40, 20 ) );
	edit_NumBricks_Row->setText("20");

	// CHIPP - Begin cantilevered height edit
	// cantilevered height
	lbl_Cantilevered_Height = new QLabel( grp_BrickCreation, "lbl_Cantilevered_Height" );
	lbl_Cantilevered_Height->setGeometry( QRect( 5, 91, 100, 20 ) );
	lbl_Cantilevered_Height->setText("cantilevered height:");
	lbl_Cantilevered_Height->hide();

	edit_Cantilevered_Height = new QLineEdit( grp_BrickCreation, "edit_Cantilevered_Height" );
	edit_Cantilevered_Height->setGeometry( QRect( 104, 91, 40, 20 ) );
	edit_Cantilevered_Height->setText("12");
	edit_Cantilevered_Height->hide();
	// CHIPP - End cantilevered height edit

	// CHIPP - Swap cantilevered height with Padding Rows
	// padding height
	lbl_Padding_Rows = new QLabel( grp_BrickCreation, "lbl_Padding_Rows" );
	lbl_Padding_Rows->setGeometry( QRect( 5, 91, 100, 20 ) );
	lbl_Padding_Rows->setText("padding rows:");
	
	edit_Padding_Rows = new QLineEdit( grp_BrickCreation, "edit_Padding_Rows" );
	edit_Padding_Rows->setGeometry( QRect( 74, 91, 40, 20 ) ); 
	edit_Padding_Rows->setText("1");
	// CHIPP - Swap cantilevered height with Padding Rows
	
	// layout toggle
	btn_BrickOffset = new QPushButton( grp_BrickCreation, "btn_BrickOffset" );
	// btn_BrickOffset->setGeometry( QRect( 10, 102, 140, 25 ));
	btn_BrickOffset->setGeometry( QRect( 10, 121, 140, 25 )); // CHIPP - bumped down brick offset button
	btn_BrickOffset->setText("Offset Bricks");
	btn_BrickOffset->setToggleButton(true);
	btn_BrickOffset->setPalette( pal );

	//--------------------------------------------------------------------------------
	// UI - Start Conditions
	//--------------------------------------------------------------------------------
	btn_ActivateBricks = new QPushButton( pg_StartCondition, "btn_ActivateBricks" );
	btn_ActivateBricks->setGeometry( QRect( 10, 10, 140, 25 ));
	btn_ActivateBricks->setText("Activate Bricks");
	btn_ActivateBricks->setToggleButton(true);
	btn_ActivateBricks->setPalette( pal );
	btn_ActivateBricks->setFocusProxy(pg_StartCondition);
	
	btn_ClearActiveBricks = new QPushButton( pg_StartCondition, "btn_ClearActiveBricks" );
	btn_ClearActiveBricks->setGeometry( QRect( 10, 40, 140, 25 ) );
	btn_ClearActiveBricks->setText("Clear Start Condition");
	btn_ClearActiveBricks->setPalette( pal );
	btn_ClearActiveBricks->setFocusProxy(pg_StartCondition);

	btn_RandomActiveBricks = new QPushButton( pg_StartCondition, "btn_RandomActiveBricks" );
	btn_RandomActiveBricks->setGeometry( QRect( 10, 70, 140, 25 ) );
	btn_RandomActiveBricks->setText("Random Start Condition");
	btn_RandomActiveBricks->setPalette( pal );
	btn_RandomActiveBricks->setFocusProxy(pg_StartCondition);

	//--------------------------------------------------------------------------------
	// UI - Rules
	//--------------------------------------------------------------------------------
	btn_Rule_00000 = new QPushButton( pg_Rules, "btn_Rule_00000" );
	btn_Rule_00000->setGeometry( QRect( 10, 9, 70, 20 ) );
	btn_Rule_00000->setPixmap( QPixmap::fromMimeSource( "data\\rule_00000.bmp" ) );
	btn_Rule_00000->setToggleButton(true);
	btn_Rule_00000->setPalette( pal );
	btn_Rule_00000->setFocusProxy(pg_Rules);
	
	btn_Rule_10000 = new QPushButton( pg_Rules, "btn_Rule_10000" );
	btn_Rule_10000->setGeometry( QRect( 10, 29, 70, 20 ) );
	btn_Rule_10000->setPixmap( QPixmap::fromMimeSource( "data\\rule_10000.bmp" ) );
	btn_Rule_10000->setToggleButton(true);
	btn_Rule_10000->setPalette( pal );
	btn_Rule_10000->setFocusProxy(pg_Rules);

	btn_Rule_01000 = new QPushButton( pg_Rules, "btn_Rule_01000" );
	btn_Rule_01000->setGeometry( QRect( 10, 50, 70, 20 ) );
	btn_Rule_01000->setPixmap( QPixmap::fromMimeSource( "data\\rule_01000.bmp" ) );
	btn_Rule_01000->setToggleButton(true);
	btn_Rule_01000->setPalette( pal );
	btn_Rule_01000->setFocusProxy(pg_Rules);

	btn_Rule_00100 = new QPushButton( pg_Rules, "btn_Rule_00100" );
	btn_Rule_00100->setGeometry( QRect( 10, 70, 70, 20 ) );
	btn_Rule_00100->setPixmap( QPixmap::fromMimeSource( "data\\rule_00100.bmp" ) );
	btn_Rule_00100->setToggleButton(true);
	btn_Rule_00100->setPalette( pal );
	btn_Rule_00100->setFocusProxy(pg_Rules);

	btn_Rule_00010 = new QPushButton( pg_Rules, "btn_Rule_00010" );
	btn_Rule_00010->setGeometry( QRect( 10, 90, 70, 20 ) );
	btn_Rule_00010->setPixmap( QPixmap::fromMimeSource( "data\\rule_00010.bmp" ) );
	btn_Rule_00010->setToggleButton(true);
	btn_Rule_00010->setPalette( pal );
	btn_Rule_00010->setFocusProxy(pg_Rules);

	btn_Rule_00001 = new QPushButton( pg_Rules, "btn_Rule_00001" );
	btn_Rule_00001->setGeometry( QRect( 10, 110, 70, 20 ) );
	btn_Rule_00001->setPixmap( QPixmap::fromMimeSource( "data\\rule_00001.bmp" ) );
	btn_Rule_00001->setToggleButton(true);
	btn_Rule_00001->setPalette( pal );
	btn_Rule_00001->setFocusProxy(pg_Rules);
	
	btn_Rule_11000 = new QPushButton( pg_Rules, "btn_Rule_11000" );
	btn_Rule_11000->setGeometry( QRect( 10, 130, 70, 20 ) );
	btn_Rule_11000->setPixmap( QPixmap::fromMimeSource( "data\\rule_11000.bmp" ) );
	btn_Rule_11000->setToggleButton(true);
	btn_Rule_11000->setPalette( pal );
	btn_Rule_11000->setFocusProxy(pg_Rules);
	
	btn_Rule_10100 = new QPushButton( pg_Rules, "btn_Rule_10100" );
	btn_Rule_10100->setGeometry( QRect( 10, 150, 70, 20 ) );
	btn_Rule_10100->setPixmap( QPixmap::fromMimeSource( "data\\rule_10100.bmp" ) );
	btn_Rule_10100->setToggleButton(true);
	btn_Rule_10100->setPalette( pal );
	btn_Rule_10100->setFocusProxy(pg_Rules);
	
	btn_Rule_10010 = new QPushButton( pg_Rules, "btn_Rule_10010" );
	btn_Rule_10010->setGeometry( QRect( 10, 170, 70, 20 ) );
	btn_Rule_10010->setPixmap( QPixmap::fromMimeSource( "data\\rule_10010.bmp" ) );
	btn_Rule_10010->setToggleButton(true);
	btn_Rule_10010->setPalette( pal );
	btn_Rule_10010->setFocusProxy(pg_Rules);
	
	btn_Rule_10001 = new QPushButton( pg_Rules, "btn_Rule_10001" );
	btn_Rule_10001->setGeometry( QRect( 10, 190, 70, 20 ) );
	btn_Rule_10001->setPixmap( QPixmap::fromMimeSource( "data\\rule_10001.bmp" ) );
	btn_Rule_10001->setToggleButton(true);
	btn_Rule_10001->setPalette( pal );
	btn_Rule_10001->setFocusProxy(pg_Rules);
	
	btn_Rule_01100 = new QPushButton( pg_Rules, "btn_Rule_01100" );
	btn_Rule_01100->setGeometry( QRect( 10, 210, 70, 20 ) );
	btn_Rule_01100->setPixmap( QPixmap::fromMimeSource( "data\\rule_01100.bmp" ) );
	btn_Rule_01100->setToggleButton(true);
	btn_Rule_01100->setPalette( pal );
	btn_Rule_01100->setFocusProxy(pg_Rules);
	
	btn_Rule_01010 = new QPushButton( pg_Rules, "btn_Rule_01010" );
	btn_Rule_01010->setGeometry( QRect( 10, 230, 70, 20 ) );
	btn_Rule_01010->setPixmap( QPixmap::fromMimeSource( "data\\rule_01010.bmp" ) );
	btn_Rule_01010->setToggleButton(true);
	btn_Rule_01010->setPalette( pal );
	btn_Rule_01010->setFocusProxy(pg_Rules);
	
	btn_Rule_01001 = new QPushButton( pg_Rules, "btn_Rule_01001" );
	btn_Rule_01001->setGeometry( QRect( 10, 250, 70, 20 ) );
	btn_Rule_01001->setPixmap( QPixmap::fromMimeSource( "data\\rule_01001.bmp" ) );
	btn_Rule_01001->setToggleButton(true);
	btn_Rule_01001->setPalette( pal );
	btn_Rule_01001->setFocusProxy(pg_Rules);
	
	btn_Rule_00110 = new QPushButton( pg_Rules, "btn_Rule_00110" );
	btn_Rule_00110->setGeometry( QRect( 10, 270, 70, 20 ) );
	btn_Rule_00110->setPixmap( QPixmap::fromMimeSource( "data\\rule_00110.bmp" ) );
	btn_Rule_00110->setToggleButton(true);
	btn_Rule_00110->setPalette( pal );
	btn_Rule_00110->setFocusProxy(pg_Rules);
	
	btn_Rule_00101 = new QPushButton( pg_Rules, "btn_Rule_00101" );
	btn_Rule_00101->setGeometry( QRect( 10, 290, 70, 20 ) );
	btn_Rule_00101->setPixmap( QPixmap::fromMimeSource( "data\\rule_00101.bmp" ) );
	btn_Rule_00101->setToggleButton(true);
	btn_Rule_00101->setPalette( pal );
	btn_Rule_00101->setFocusProxy(pg_Rules);
	
	btn_Rule_00011 = new QPushButton( pg_Rules, "btn_Rule_00011" );
	btn_Rule_00011->setGeometry( QRect( 10, 310, 70, 20 ) );
	btn_Rule_00011->setPixmap( QPixmap::fromMimeSource( "data\\rule_00011.bmp" ) );
	btn_Rule_00011->setToggleButton(true);
	btn_Rule_00011->setPalette( pal );
	btn_Rule_00011->setFocusProxy(pg_Rules);
	
	btn_Rule_11100 = new QPushButton( pg_Rules, "btn_Rule_11100" );
	btn_Rule_11100->setGeometry( QRect( 85, 9, 70, 20 ) );
	btn_Rule_11100->setPixmap( QPixmap::fromMimeSource( "data\\rule_11100.bmp" ) );
	btn_Rule_11100->setToggleButton(true);
	btn_Rule_11100->setPalette( pal );
	btn_Rule_11100->setFocusProxy(pg_Rules);
	
	btn_Rule_11010 = new QPushButton( pg_Rules, "btn_Rule_11010" );
	btn_Rule_11010->setGeometry( QRect( 85, 29, 70, 20 ) );
	btn_Rule_11010->setPixmap( QPixmap::fromMimeSource( "data\\rule_11010.bmp" ) );
	btn_Rule_11010->setToggleButton(true);
	btn_Rule_11010->setPalette( pal );
	btn_Rule_11010->setFocusProxy(pg_Rules);
	
	btn_Rule_11001 = new QPushButton( pg_Rules, "btn_Rule_11001" );
	btn_Rule_11001->setGeometry( QRect( 85, 50, 70, 20 ) );
	btn_Rule_11001->setPixmap( QPixmap::fromMimeSource( "data\\rule_11001.bmp" ) );
	btn_Rule_11001->setToggleButton(true);
	btn_Rule_11001->setPalette( pal );
	btn_Rule_11001->setFocusProxy(pg_Rules);
	
	btn_Rule_11110 = new QPushButton( pg_Rules, "btn_Rule_11110" );
	btn_Rule_11110->setGeometry( QRect( 85, 190, 70, 20 ) );
	btn_Rule_11110->setPixmap( QPixmap::fromMimeSource( "data\\rule_11001.bmp" ) );
	btn_Rule_11110->setToggleButton(true);
	btn_Rule_11110->setPalette( pal );
	btn_Rule_11110->setFocusProxy(pg_Rules);
	
	btn_Rule_01111 = new QPushButton( pg_Rules, "btn_Rule_01111" );
	btn_Rule_01111->setGeometry( QRect( 85, 270, 70, 20 ) );
	btn_Rule_01111->setPixmap( QPixmap::fromMimeSource( "data\\rule_01111.bmp" ) );
	btn_Rule_01111->setToggleButton(true);
	btn_Rule_01111->setPalette( pal );
	btn_Rule_01111->setFocusProxy(pg_Rules);
	
	btn_Rule_01110 = new QPushButton( pg_Rules, "btn_Rule_01110" );
	btn_Rule_01110->setGeometry( QRect( 85, 90, 70, 20 ) );
	btn_Rule_01110->setPixmap( QPixmap::fromMimeSource( "data\\rule_01110.bmp" ) );
	btn_Rule_01110->setToggleButton(true);
	btn_Rule_01110->setPalette( pal );
	btn_Rule_01110->setFocusProxy(pg_Rules);
	
	btn_Rule_10101 = new QPushButton( pg_Rules, "btn_Rule_10101" );
	btn_Rule_10101->setGeometry( QRect( 85, 170, 70, 20 ) );
	btn_Rule_10101->setPixmap( QPixmap::fromMimeSource( "data\\rule_10101.bmp" ) );
	btn_Rule_10101->setToggleButton(true);
	btn_Rule_10101->setPalette( pal );
	btn_Rule_10101->setFocusProxy(pg_Rules);
	
	btn_Rule_10111 = new QPushButton( pg_Rules, "btn_Rule_10111" );
	btn_Rule_10111->setGeometry( QRect( 85, 250, 70, 20 ) );
	btn_Rule_10111->setPixmap( QPixmap::fromMimeSource( "data\\rule_10111.bmp" ) );
	btn_Rule_10111->setToggleButton(true);
	btn_Rule_10111->setPalette( pal );
	btn_Rule_10111->setFocusProxy(pg_Rules);
	
	btn_Rule_10011 = new QPushButton( pg_Rules, "btn_Rule_10011" );
	btn_Rule_10011->setGeometry( QRect( 85, 70, 70, 20 ) );
	btn_Rule_10011->setPixmap( QPixmap::fromMimeSource( "data\\rule_10011.bmp" ) );
	btn_Rule_10011->setToggleButton(true);
	btn_Rule_10011->setPalette( pal );
	btn_Rule_10011->setFocusProxy(pg_Rules);
	
	btn_Rule_01101 = new QPushButton( pg_Rules, "btn_Rule_01101" );
	btn_Rule_01101->setGeometry( QRect( 85, 150, 70, 20 ) );
	btn_Rule_01101->setPixmap( QPixmap::fromMimeSource( "data\\rule_01101.bmp" ) );
	btn_Rule_01101->setToggleButton(true);
	btn_Rule_01101->setPalette( pal );
	btn_Rule_01101->setFocusProxy(pg_Rules);
	
	btn_Rule_11011 = new QPushButton( pg_Rules, "btn_Rule_11011" );
	btn_Rule_11011->setGeometry( QRect( 85, 230, 70, 20 ) );
	btn_Rule_11011->setPixmap( QPixmap::fromMimeSource( "data\\rule_11011.bmp" ) );
	btn_Rule_11011->setToggleButton(true);
	btn_Rule_11011->setPalette( pal );
	btn_Rule_11011->setFocusProxy(pg_Rules);
	
	btn_Rule_01011 = new QPushButton( pg_Rules, "btn_Rule_01011" );
	btn_Rule_01011->setGeometry( QRect( 85, 130, 70, 20 ) );
	btn_Rule_01011->setPixmap( QPixmap::fromMimeSource( "data\\rule_01011.bmp" ) );
	btn_Rule_01011->setToggleButton(true);
	btn_Rule_01011->setPalette( pal );
	btn_Rule_01011->setFocusProxy(pg_Rules);
	
	btn_Rule_11101 = new QPushButton( pg_Rules, "btn_Rule_11101" );
	btn_Rule_11101->setGeometry( QRect( 85, 210, 70, 20 ) );
	btn_Rule_11101->setPixmap( QPixmap::fromMimeSource( "data\\rule_11101.bmp" ) );
	btn_Rule_11101->setToggleButton(true);
	btn_Rule_11101->setPalette( pal );
	btn_Rule_11101->setFocusProxy(pg_Rules);
	
	btn_Rule_11111 = new QPushButton( pg_Rules, "btn_Rule_11111" );
	btn_Rule_11111->setGeometry( QRect( 85, 290, 70, 20 ) );
	btn_Rule_11111->setPixmap( QPixmap::fromMimeSource( "data\\rule_11111.bmp" ) );
	btn_Rule_11111->setToggleButton(true);
	btn_Rule_11111->setPalette( pal );
	btn_Rule_11111->setFocusProxy(pg_Rules);
	
	btn_Rule_00111 = new QPushButton( pg_Rules, "btn_Rule_00111" );
	btn_Rule_00111->setGeometry( QRect( 85, 110, 70, 20 ) );
	btn_Rule_00111->setPixmap( QPixmap::fromMimeSource( "data\\rule_00111.bmp" ) );
	btn_Rule_00111->setToggleButton(true);
	btn_Rule_00111->setPalette( pal );
	btn_Rule_00111->setFocusProxy(pg_Rules);
	
	btn_Rule_10110 = new QPushButton( pg_Rules, "btn_Rule_10110" );
	btn_Rule_10110->setGeometry( QRect( 85, 310, 70, 20 ) );
	btn_Rule_10110->setPixmap( QPixmap::fromMimeSource( "data\\rule_10110.bmp" ) );
	btn_Rule_10110->setToggleButton(true);
	btn_Rule_10110->setPalette( pal );
	btn_Rule_10110->setFocusProxy(pg_Rules);
	
	btn_GeneratePattern = new QPushButton( pg_Rules, "btn_GeneratePattern" );
	btn_GeneratePattern->setGeometry( QRect( 16, 340, 135, 35 ) );
	btn_GeneratePattern->setText("Generate Pattern");
	//btn_GeneratePattern->setToggleButton(true);
	btn_GeneratePattern->setPalette( pal );
	btn_GeneratePattern->setFocusProxy(pg_Rules);

	btn_ClearPattern = new QPushButton( pg_Rules, "btn_ClearPattern" );
	btn_ClearPattern->setGeometry( QRect( 16, 380, 135, 25 ) );
	btn_ClearPattern->setText("Clear Pattern");
	btn_ClearPattern->setPalette( pal );
	btn_ClearPattern->setFocusProxy(pg_Rules);

	btn_ResetRules = new QPushButton( pg_Rules, "btn_ResetRules" );
	btn_ResetRules->setGeometry( QRect( 16, 410, 135, 25 ) );
	btn_ResetRules->setText("Reset Rules");
	btn_ResetRules->setPalette( pal );
	btn_ResetRules->setFocusProxy(pg_Rules);

	//--------------------------------------------------------------------------------
	// UI - Beam Creation
	//--------------------------------------------------------------------------------
	btn_GenerateBeams = new QPushButton( pg_BeamCreation, "btn_GenerateBeams" );
	btn_GenerateBeams->setGeometry( QRect( 10, 10, 145, 25 ) );
	btn_GenerateBeams->setText("Generate Beams");
	btn_GenerateBeams->setPalette( pal );

	btn_ClearBeams = new QPushButton( pg_BeamCreation, "btn_ClearBeams" );
	btn_ClearBeams->setGeometry( QRect( 10, 42, 145, 25 ) );
	btn_ClearBeams->setText("Clear Beams");
	btn_ClearBeams->setPalette( pal );

	//--------------------------------------------------------------------------------
	// UI - OpenGL Window
	//--------------------------------------------------------------------------------
	// Create a nice frame to put around the OpenGL widget
	qgl_GLFrame = new QFrame( this, "qgl_GLFrame" );
	qgl_GLFrame->setFrameStyle( QFrame::Sunken | QFrame::Panel );
	qgl_GLFrame->setLineWidth( 2 );
	qgl_GLFrame->setMinimumSize(840,550);
	
	// our OpenGL derived object/widget
	qgl_GLWindow = new BBB_GLWidget( qgl_GLFrame, "qgl_GLWindow" );
	qgl_GLWindow->setBackgroundColor(QColor(128,128,128));
	qgl_GLWindow->bindForm(this);

	//--------------------------------------------------------------------------------
	// Signals & Slots
	//--------------------------------------------------------------------------------
	QObject::connect( btn_ActivateBricks,		SIGNAL(clicked()),                   qgl_GLWindow, SLOT(activateBricks()) );
	QObject::connect( btn_ClearActiveBricks,	SIGNAL(clicked()),                   qgl_GLWindow, SLOT(clearActiveBricks()) );
	QObject::connect( btn_RandomActiveBricks, 	SIGNAL(clicked()),                   qgl_GLWindow, SLOT(randomActiveBricks()) );
	QObject::connect( btn_GeneratePattern,      SIGNAL(clicked()),                   qgl_GLWindow, SLOT(generatePattern()) );
	QObject::connect( btn_ClearPattern,		    SIGNAL(clicked()),                   qgl_GLWindow, SLOT(clearPattern()) );
	QObject::connect( btn_ResetRules,		 	SIGNAL(clicked()),                   qgl_GLWindow, SLOT(clearRules()) );
	QObject::connect( btn_GenerateBeams,	    SIGNAL(clicked()),                   qgl_GLWindow, SLOT(generateBeams()) );
	QObject::connect( btn_ClearBeams, 		    SIGNAL(clicked()),                   qgl_GLWindow, SLOT(clearBeams()) );
	QObject::connect( btn_BrickOffset, 		    SIGNAL(clicked()),                   qgl_GLWindow, SLOT(toggleOffset()) );

	QObject::connect( edit_NumBricks_Row, 		SIGNAL(textChanged(const QString&)), qgl_GLWindow, SLOT(rebuildBricks()) );
	QObject::connect( edit_BrickSize_Length, 	SIGNAL(textChanged(const QString&)), qgl_GLWindow, SLOT(rebuildBricks()) );
	QObject::connect( edit_BrickSize_Width, 	SIGNAL(textChanged(const QString&)), qgl_GLWindow, SLOT(rebuildBricks()) );
	QObject::connect( edit_Cantilevered_Height, SIGNAL(textChanged(const QString&)), qgl_GLWindow, SLOT(cantileverPattern()) );
	QObject::connect( edit_Padding_Rows, 		SIGNAL(textChanged(const QString&)), qgl_GLWindow, SLOT(rebuildBricks()) );

	//--------------------------------------------------------------------------------
	// Signals & Slots - Rules (used for "real-time" CA generation
	//--------------------------------------------------------------------------------
	//QObject::connect( btn_Rule_00000, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10000, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01000, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_00100, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_00010, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_00001, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11000, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10100, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10010, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10001, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01100, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01010, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01001, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_00110, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_00101, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_00011, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11100, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11010, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11001, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11110, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01111, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01110, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10101, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10111, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10011, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01101, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11011, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_01011, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11101, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_11111, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_00111, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	
	//QObject::connect( btn_Rule_10110, 			SIGNAL(clicked()), qgl_GLWindow, SLOT(generatePattern()) );	

	//--------------------------------------------------------------------------------
	// Menu
	//--------------------------------------------------------------------------------
	// Create a menu with "file" elements
	menu_File = new QPopupMenu( this );
	menu_File->insertItem( "Save Pattern",			qgl_GLWindow, SLOT(savePattern()), CTRL+Key_S );
	menu_File->insertItem( "Load Pattern",			qgl_GLWindow, SLOT(loadPattern()), CTRL+Key_L );
	menu_File->insertItem( "Clear Pattern",		qgl_GLWindow, SLOT(resetAll()),    CTRL+Key_N );
	menu_File->insertSeparator();
	menu_File->insertItem( "Import Path",			qgl_GLWindow, SLOT(importPath()),  CTRL+Key_I );
	menu_File->insertItem( "Export to OBJ",			qgl_GLWindow, SLOT(exportToObj()), CTRL+Key_X );
	menu_File->insertItem( "Export to RLE",			qgl_GLWindow, SLOT(exportToRLE()), CTRL+Key_R );
	menu_File->insertItem( "Export to Playlist",	qgl_GLWindow, SLOT(exportToMP3()), CTRL+Key_P );
	menu_File->insertSeparator();
	menu_File->insertItem( "Exit",					qApp, SLOT(quit()),		   CTRL+Key_Q );
	
	// Create a menu with "utility" elements
	menu_Utility = new QPopupMenu( this );
	menu_Utility->insertItem( "Invert Active",      qgl_GLWindow, SLOT(invertActive()),   ALT+Key_I);
	menu_Utility->insertItem( "Hide/Show Inactive",	qgl_GLWindow, SLOT(showInactive()),	  ALT+Key_H);
	menu_Utility->insertItem( "Take Screenshot",    qgl_GLWindow, SLOT(takeScreenshot()), ALT+Key_S);
	menu_Utility->insertItem( "Zoom Extensts",      qgl_GLWindow, SLOT(zoomExtents()),    ALT+Key_Z);
	menu_Utility->insertItem( "Draw Borders",       qgl_GLWindow, SLOT(toggleBorders()),  ALT+Key_B);
	menu_Utility->insertItem( "Draw Grid",          qgl_GLWindow, SLOT(toggleGrid()),     ALT+Key_G);
		
	// Create a menu with "help" elements
	//menu_Help = new QPopupMenu( this );
	//menu_Help->insertItem( "Online Help",	qApp, SLOT(quit()), 0);
	//menu_Help->insertItem( "About",		qApp, SLOT(quit()), 0);
	
	// create a menu bar to store the popup menu
	menu_MainBar = new QMenuBar( this );
	menu_MainBar->setSeparator( QMenuBar::InWindowsStyle );
	menu_MainBar->insertItem("&File",	 menu_File );
	menu_MainBar->insertItem("&Utility", menu_Utility );
	//menu_MainBar->insertItem("&Help",	  menu_Help );

	//--------------------------------------------------------------------------------
	// Layouts
	//--------------------------------------------------------------------------------
	QVBoxLayout* vlayout = new QVBoxLayout(1,"vlayout");
	vlayout->add(tb_MainUI);
	vlayout->setAlignment(Qt::AlignTop);
  
	QHBoxLayout* flayout = new QHBoxLayout( qgl_GLFrame, 2, 2, "flayout");
    flayout->addWidget( qgl_GLWindow, 1 );

	QHBoxLayout* hlayout = new QHBoxLayout( this, 5, 5, "hlayout");
	hlayout->setMenuBar( menu_MainBar );
    hlayout->addLayout( vlayout );
    hlayout->addWidget( qgl_GLFrame, 1 );
}
Example #15
0
LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
    : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 )
{
    setCaption( tr("Properties") );

    QVBoxLayout *vbox = new QVBoxLayout( this );
    d = new LnkPropertiesBase( this );
    vbox->add( d );

    // hide custom rotation feature for now, need a new implementation to fit quicklauch,
    // is confusing for the user and doubtable useful since life rotation
    d->rotate->hide();
    d->rotateButtons->hide();

    d->docname->setText(l->name());
    QString inf;
    if ( l->type().isEmpty() ) {
	d->type->hide();
	d->typeLabel->hide();
    } else {
	d->type->setText( l->type() );
    }

    if ( l->comment().isEmpty() ) {
	d->comment->hide();
	d->commentLabel->hide();
    } else {
	d->comment->setText( l->comment() );
    }

    connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk()));
    if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed)
	connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk()));
	connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk()));

	d->docname->setReadOnly( FALSE );
	d->preload->hide();
	d->rotate->hide();
	d->rotateButtons->hide();
	d->labelspacer->hide();

	// ### THIS MUST GO, FIX WIERD BUG in QLAYOUT
	d->categoryEdit->kludge();

	d->categoryEdit->setCategories( lnk->categories(),
					"Document View",
					tr("Document View") );
	setupLocations();
    } else {
	d->unlink->hide();
	d->duplicate->hide();
	d->beam->hide();
	d->hline->hide();
 	d->locationLabel->hide();
	d->locationCombo->hide();

	// Can't edit categories, since the app .desktop files are global,
	// possibly read-only.
 	d->categoryEdit->hide();

	d->docname->setReadOnly( TRUE );

	if ( l->property("CanFastload") == "0" )
	    d->preload->hide();
	if ( !l->property("Rotation"). isEmpty ()) {
	    d->rotate->setChecked ( true );
            //don't use rotate buttons for now (see comment above)
	    //d->rotateButtons->setButton((l->rotation().toInt()%360)/90);
	}
	else {
	    d->rotateButtons->setEnabled(false);
	}

        if ( !l->property( "Arguments" ).isEmpty() )
            d->arguments->setText( l->property( "Arguments" ) );

	Config cfg("Launcher");
	cfg.setGroup("Preload");
	QStringList apps = cfg.readListEntry("Apps",',');
	d->preload->setChecked( apps.contains(l->exec()) );
	if ( Global::isBuiltinCommand(lnk->exec()) )
	    d->preload->hide(); // builtins are always fast

	currentLocation = 0; // apps not movable (yet)
    }
}
CollectionChooser::CollectionChooser(QWidget *parent, const char *name)
 : QWidget(parent, name)
{
	QLabel *lblAvailable = new QLabel( this );
	lblAvailable->setText( i18n( "Available:" ) );

	m_available = new CollectionListView( 0, this );
	m_available->setDragEnabled( true );
	connect( m_available, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), SLOT(addClicked()) );
	connect( m_available, SIGNAL(dropped(QDropEvent*)), SLOT(droppedAvailable(QDropEvent*)) );

	m_add = new KPushButton( this );
	m_add->setText( i18n( "&Add" ) );
	//m_add->setGuiItem( KStdGuiItem::add() );
	connect( m_add, SIGNAL(clicked()), SLOT(addClicked()) );

	m_addAll = new KPushButton( this );
	//m_addAll->setIconSet( KStdGuiItem::add().iconSet() );
	m_addAll->setText( i18n( "Add A&ll" ) );
	connect( m_addAll, SIGNAL(clicked()), SLOT(addAllClicked()) );

	m_remove = new KPushButton( this );
	m_remove->setText( i18n( "&Remove" ) );
	//m_remove->setGuiItem( KStdGuiItem::remove() );
	connect( m_remove, SIGNAL(clicked()), SLOT(removeClicked()) );

	m_removeAll = new KPushButton( this );
	//m_removeAll->setIconSet( KStdGuiItem::remove().iconSet() );
	m_removeAll->setText( i18n( "R&emove All" ) );
	connect( m_removeAll, SIGNAL(clicked()), SLOT(removeAllClicked()) );

	QLabel *lblChoosen = new QLabel( this );
	lblChoosen->setText( i18n( "Selected:" ) );

	m_choosen = new CollectionListView( 0, this );
	m_choosen->setDragEnabled( true );
	connect( m_choosen, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), SLOT(removeClicked()) );
	connect( m_choosen, SIGNAL(dropped(QDropEvent*)), SLOT(droppedChoosen(QDropEvent*)) );

	QVBoxLayout *layAvailable = new QVBoxLayout();
	layAvailable->addSpacing( 10 );
	layAvailable->add( lblAvailable );
	layAvailable->addSpacing( 10 );
	layAvailable->add( m_available );

	QVBoxLayout *layButtons = new QVBoxLayout();
	layButtons->addSpacing( 10 );
	layButtons->add( m_add );
	layButtons->addSpacing( 10 );
	layButtons->add( m_addAll );
	layButtons->addSpacing( 30 );
	layButtons->add( m_remove );
	layButtons->addSpacing( 10 );
	layButtons->add( m_removeAll );
	layButtons->addStretch();

	QVBoxLayout *layChoosen = new QVBoxLayout();
	layChoosen->addSpacing( 10 );
	layChoosen->add( lblChoosen );
	layChoosen->addSpacing( 10 );
	layChoosen->add( m_choosen );

	QHBoxLayout *layout = new QHBoxLayout( this );
	layout->addLayout( layAvailable );
	layout->addSpacing( 10 );
	layout->addLayout( layButtons );
	layout->addSpacing( 10 );
	layout->addLayout( layChoosen );
}