Exemplo n.º 1
0
NovelsWindow::NovelsWindow(QWidget* parent, Database* data) :
	QWidget(parent, Qt::Dialog),
	m_data(data)
{
	setWindowTitle(tr("Select Novel"));

	m_novels = new QListWidget(this);
	connect(m_novels, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentNovelChanged(QListWidgetItem*)));
	connect(m_novels, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(hide()));

	m_add_button = new QPushButton(tr("New"), this);
	connect(m_add_button, SIGNAL(clicked()), this, SLOT(addClicked()));

	m_rename_button = new QPushButton(tr("Rename"), this);
	connect(m_rename_button, SIGNAL(clicked()), this, SLOT(renameClicked()));

	m_remove_button = new QPushButton(tr("Delete"), this);
	connect(m_remove_button, SIGNAL(clicked()), this, SLOT(removeClicked()));

	QPushButton* close_button = new QPushButton(tr("Close"), this);
	connect(close_button, SIGNAL(clicked()), this, SLOT(hide()));

	QVBoxLayout* button_layout = new QVBoxLayout;
	button_layout->addWidget(m_add_button);
	button_layout->addWidget(m_rename_button);
	button_layout->addWidget(m_remove_button);
	button_layout->addStretch();
	button_layout->addWidget(close_button);

	QHBoxLayout* layout = new QHBoxLayout(this);
	layout->addWidget(m_novels);
	layout->addLayout(button_layout);
}
Exemplo n.º 2
0
void InterfaceEditor::on_pushButtonInterface_clicked()
{
  if (m_widgetListEditor == NULL)
  {
    m_widgetListEditor = new WidgetListEditor(this);
    m_widgetListEditor->setButtonText(tr("add method"));
    m_widgetListEditor->setWindowTitle(tr("interface editor"));
    connect(m_widgetListEditor, SIGNAL(addClicked()), this, SLOT(addMethod()));
    fillMethodList();
  }

  if (m_widgetListEditor->exec() == QDialog::Accepted)
  {
    m_interface.clear();

    QList<QWidget*> items = m_widgetListEditor->items();

    for (auto it = items.begin(); it != items.end(); it++)
    {
      MethodGui* methodGui = dynamic_cast<MethodGui*>(*it);
      if (methodGui)
      {
        m_interface.append(methodGui->method());
      }
    }

    emit interfaceChanged();
  }
  else
  {
    m_widgetListEditor->clear();
    fillMethodList();
  }
}
Exemplo n.º 3
0
NoteView::NoteView(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::NoteView)
{
    //initialize controller
    ui->setupUi(this);
    this->_controller = new NoteController();

    //prepare green button
    QFile data(":/new/prefix1/greenButton.qss");
    data.open(QFile::ReadOnly);
    QTextStream styleIn(&data);
    this->_greenButton = styleIn.readAll();
    data.close();

    //fix screen size
    this->setFixedSize(this->width(), this->height());

    //setup error fields
    ui->addError->setStyleSheet("QLabel {color:red};");
    ui->bodyError->setStyleSheet("QLabel {color:red};");
    clear();

    //connect signals and slots
    connect(ui->doneButton, SIGNAL(clicked()), this, SLOT(doneClicked()));
    connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(nextClicked()));
    connect(ui->prevButton, SIGNAL(clicked()), this, SLOT(prevClicked()));
    connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
    connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
    connect(ui->editButton,SIGNAL(clicked()),this,SLOT(editClicked()));
}
Exemplo n.º 4
0
MirrorSettings::MirrorSettings(QWidget *parent, TransferHandler *handler, const KUrl &file)
  : KGetSaveSizeDialog("MirrorSettings", parent),
    m_transfer(handler),
    m_file(file)
{
    m_model = new MirrorModel(this);
    m_model->setMirrors(m_transfer->availableMirrors(m_file));
    m_proxy = new MirrorProxyModel(this);
    m_proxy->setSourceModel(m_model);

    QWidget *widget = new QWidget(this);
    ui.setupUi(widget);
    ui.add->setGuiItem(KStandardGuiItem::add());
    ui.remove->setGuiItem(KStandardGuiItem::remove());
    ui.treeView->setModel(m_proxy);
    ui.treeView->header()->setResizeMode(QHeaderView::ResizeToContents);
    ui.treeView->hideColumn(MirrorItem::Priority);
    ui.treeView->hideColumn(MirrorItem::Country);
    ui.treeView->setItemDelegate(new MirrorDelegate(this));

    updateButton();

    connect(ui.treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(updateButton()));
    connect(ui.add, SIGNAL(clicked()), this, SLOT(addClicked()));
    connect(ui.remove, SIGNAL(clicked()), this, SLOT(removeMirror()));
    connect(this, SIGNAL(finished()), this, SLOT(save()));

    setMainWidget(widget);
    setCaption(i18n("Modify the used mirrors"));
    setButtons(KDialog::Close);
}
Exemplo n.º 5
0
RateCenterManager::RateCenterManager
(
	QWidget* parent,
	const char* name
) : TAAWidget(parent)
{
    setCaption( "Rate Center Manager" );

    rcList = new Q3ListView(this, "Rate Center Manager");
    rcList->setAllColumnsShowFocus(true);
    rcList->setRootIsDecorated(true);
    rcList->addColumn("Country/State/City");
    rcList->addColumn("Active");
    rcList->addColumn("Avail");
    rcList->addColumn("Total");
    connect(rcList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemDoubleClicked(Q3ListViewItem *)));

    activeColumn    = 1;
    availColumn     = 2;
    totalColumn     = 3;
    idColumn        = 4;

    rcList->setColumnAlignment(activeColumn, Qt::AlignRight);
    rcList->setColumnAlignment(availColumn,  Qt::AlignRight);
    rcList->setColumnAlignment(totalColumn,  Qt::AlignRight);


    addButton = new QPushButton(this, "Add Button");
    addButton->setText("&Add");
    connect(addButton, SIGNAL(clicked()), this, SLOT(addClicked()));

    editButton = new QPushButton(this, "Edit Button");
    editButton->setText("&Edit");
    connect(editButton, SIGNAL(clicked()), this, SLOT(editClicked()));

    deleteButton = new QPushButton(this, "Delete Button");
    deleteButton->setText("&Delete");
    connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
    deleteButton->setEnabled(false);

    closeButton = new QPushButton(this, "Close Button");
    closeButton->setText("&Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));

    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
    ml->addWidget(rcList, 1);

    
    Q3BoxLayout  *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 1);
    bl->addStretch(1);
    bl->addWidget(addButton, 0);
    bl->addWidget(editButton, 0);
    bl->addWidget(deleteButton, 0);
    bl->addWidget(closeButton, 0);

    ml->addLayout(bl, 0);

    refreshRateCenters();
}
RegisteredUserPropertiesDialog::RegisteredUserPropertiesDialog(QWidget * p,KviPointerHashTable<QString,QString> * dict)
: QDialog(p)
{
	setObjectName("property_editor");
	setWindowModality(Qt::WindowModal);
	m_pPropertyDict = dict;

	setWindowTitle(__tr2qs_ctx("Property Editor","register"));
	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux)));

	QGridLayout * g = new QGridLayout(this);

	m_pTable = new QTableWidget(this);
	//g->addMultiCellWidget(m_pTable,0,1,0,1);
	g->addWidget(m_pTable,0,0);
	m_pTable->setColumnCount(2);
	m_pTable->setSelectionMode(QAbstractItemView::SingleSelection);
	m_pTable->setSelectionBehavior(QAbstractItemView::SelectRows);

	QStringList header;
	header.append(__tr2qs_ctx("Property","register"));
	header.append(__tr2qs_ctx("Value","register"));
	m_pTable->setHorizontalHeaderLabels(header);

	m_pTable->setMinimumSize(250,250);
	//connect(m_pTable,SIGNAL(valueChanged(int,int)),this,SLOT(propertyValueChanged(int,int)));

	KviTalVBox * vb = new KviTalVBox(this);
	vb->setSpacing(4);
	g->addWidget(vb,0,1,0,3);

	m_pAddButton = new QPushButton(__tr2qs_ctx("&New","register"),vb);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pDelButton = new QPushButton(__tr2qs_ctx("&Remove","register"),vb);
	connect(m_pDelButton,SIGNAL(clicked()),this,SLOT(delClicked()));
	m_pDelButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem)));

	KviTalHBox * b = new KviTalHBox(this);
	b->setSpacing(4);
	//g->addMultiCellWidget(b,2,2,1,2);
	g->addWidget(b,1,1);
	QPushButton * pb = new QPushButton(__tr2qs_ctx("&OK","register"),b);
	connect(pb,SIGNAL(clicked()),this,SLOT(okClicked()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));

	pb = new QPushButton(__tr2qs_ctx("Cancel","register"),b);
	connect(pb,SIGNAL(clicked()),this,SLOT(reject()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));

	g->setRowStretch(1,1);
	g->setColumnStretch(0,1);

	fillData();
}
bool AddTopicDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: addClicked(); break;
    case 1: enableAddButton((const QString&)static_QUType_QString.get(_o+1)); break;
    default:
	return AddTopicDialogBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
Exemplo n.º 8
0
MouseConfig::MouseConfig(KConfig *cfg, QWidget *parent)
    : RecordItNow::ConfigPage(cfg, parent)
{
    
    setupUi(this);
    kcfg_cursorWidgetSize->setSuffix(ki18np(" Pixel", " Pixels"));

    m_colorLayout = new RecordItNow::ListLayout;
    colorListWidget->setLayout(m_colorLayout);
    
    m_soundLayout = new RecordItNow::ListLayout;
    soundListWidget->setLayout(m_soundLayout);
    
    addButton->setIcon(KIcon("list-add"));
    soundAddButton->setIcon(KIcon("list-add"));
    volumeSlider->setAudioOutput(RecordItNow::Helper::self()->audioOutput());
    
    connect(addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
    connect(soundAddButton, SIGNAL(clicked()), this, SLOT(addSoundClicked()));

    buttonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::LeftButton));
    buttonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::RightButton));
    buttonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::MiddleButton));
    buttonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::WheelUp));
    buttonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::WheelDown));
    buttonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::SpecialButton1));
    buttonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::SpecialButton2));

    soundButtonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::LeftButton));
    soundButtonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::RightButton));
    soundButtonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::MiddleButton));
    soundButtonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::WheelUp));
    soundButtonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::WheelDown));
    soundButtonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::SpecialButton1));
    soundButtonCombo->addItem(MouseButtonWidget::getName(MouseButtonWidget::SpecialButton2));
    
    cursorWidget->switchToPreviewMode();

    connect(m_colorLayout, SIGNAL(removeRequested(QWidget*)), this, SLOT(removeColorRow(QWidget*)));
    connect(m_soundLayout, SIGNAL(removeRequested(QWidget*)), this, SLOT(removeSoundRow(QWidget*)));
    connect(kcfg_cursorWidgetSize, SIGNAL(valueChanged(int)), this, SLOT(buttonsChanged()));
    connect(kcfg_cursorOpacity, SIGNAL(valueChanged(int)), this, SLOT(buttonsChanged()));
    connect(appearanceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(modeActivated()));
    connect(buttonCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(currentButtonChanged()));
    connect(soundButtonCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(currentButtonChanged()));
    connect(RecordItNow::Helper::self(), SIGNAL(compositingChanged(bool)), this,
            SLOT(compositingChanged(bool)));
    connect(kcfg_cursorMode, SIGNAL(valueChanged(int)), this, SLOT(loadMode(int)));
    
    compositingChanged(RecordItNow::Helper::self()->compositingActive());

    currentButtonChanged();
    modeActivated();

}
Exemplo n.º 9
0
SubTabController::SubTabController(SubTabView* subTabView)
  : OSQObjectController(),
    m_subTabView(subTabView)
{
  addQObject(subTabView);

  bool isConnected = false;
  isConnected = connect(subTabView, SIGNAL(itemSelected(OSItem*)),
                        this, SLOT(selectItem(OSItem*)));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(itemRemoveClicked(OSItem*)),
                        this, SLOT(removeItem(OSItem*)));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(itemReplacementDropped(OSItem*, const OSItemId&)),
                        this, SLOT(replaceItem(OSItem*, const OSItemId&)));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(selectionCleared()),
                        this, SLOT(clearSelection()));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(itemDropped(const OSItemId&)),
                        this, SLOT(handleDrop(const OSItemId&)));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(addClicked()),
                        this, SLOT(doAdd()));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(copyClicked()),
                        this, SLOT(doCopy()));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(removeClicked()),
                        this, SLOT(doRemove()));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(purgeClicked()),
                        this, SLOT(doPurge()));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(openBclDlgClicked()),
                        this, SIGNAL(openBclDlgClicked()));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(openLibDlgClicked()),
                        this, SIGNAL(openLibDlgClicked()));
  BOOST_ASSERT(isConnected);

  isConnected = connect(subTabView, SIGNAL(dropZoneItemClicked(OSItem*)),
                        this, SLOT(inspectItem(OSItem*)));
  BOOST_ASSERT(isConnected);
}
Exemplo n.º 10
0
DictEditorWidget::DictEditorWidget(QWidget *parent)
    : QWidget(parent)
{

    mView = new QTableView;
    mModel = new DictEditorModel;
    mKeyEdit = new QComboBox;
    mValueEdit = new QLineEdit;
    mAddButton = new QToolButton;
    mRemButton = new QToolButton;
    mTypeLabel = new QLabel("type");
    mValueLabel = new QLabel("value");

    mAddButton->setIcon(QtAwesome::instance()->icon("plus"));
    mRemButton->setIcon(QtAwesome::instance()->icon("minus"));



    mView->setModel(mModel);
    mView->verticalHeader()->hide();
    mView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    mView->setSelectionBehavior(QAbstractItemView::SelectRows);




    QFormLayout * formLayout = new QFormLayout;
    formLayout->addRow(mTypeLabel,mKeyEdit);
    formLayout->addRow(mValueLabel,mValueEdit);
    formLayout->setVerticalSpacing(5);
    formLayout->setFormAlignment(Qt::AlignCenter);

    QVBoxLayout * vLayout = new QVBoxLayout;

    vLayout->addItem(formLayout);
    vLayout->addWidget(mView);


    QHBoxLayout * buttonLayout = new QHBoxLayout;
    buttonLayout->addWidget(mAddButton);
    buttonLayout->addWidget(mRemButton);
    buttonLayout->addStretch();

    vLayout->addLayout(buttonLayout);

    setLayout(vLayout);

    mKeyEdit->setEditable(true);


    connect(mAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
    connect(mRemButton,SIGNAL(clicked()),this,SLOT(removeClicked()));

}
Exemplo n.º 11
0
QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags fl ):
    QDialog( app, fl ), qgisApp( app )
{
  setupUi( this );
  setWindowTitle( tr( "Add SpatiaLite Table(s)" ) );
  connectionsGroupBox->setTitle( tr( "Databases" ) );
  btnEdit->hide();  // hide the edit button
  btnSave->hide();
  btnLoad->hide();

  mAddButton = new QPushButton( tr( "&Add" ) );
  buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
  connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClicked() ) );
  mAddButton->setEnabled( false );

  mBuildQueryButton = new QPushButton( tr( "&Build Query" ) );
  buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
  connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQuery() ) );
  mBuildQueryButton->setEnabled( false );

  populateConnectionList();

  mSearchModeComboBox->addItem( tr( "Wildcard" ) );
  mSearchModeComboBox->addItem( tr( "RegExp" ) );

  mSearchColumnComboBox->addItem( tr( "All" ) );
  mSearchColumnComboBox->addItem( tr( "Table" ) );
  mSearchColumnComboBox->addItem( tr( "Type" ) );
  mSearchColumnComboBox->addItem( tr( "Geometry column" ) );
  mSearchColumnComboBox->addItem( tr( "Sql" ) );

  mProxyModel.setParent( this );
  mProxyModel.setFilterKeyColumn( -1 );
  mProxyModel.setFilterCaseSensitivity( Qt::CaseInsensitive );
  mProxyModel.setDynamicSortFilter( true );
  mProxyModel.setSourceModel( &mTableModel );
  mTablesTreeView->setModel( &mProxyModel );
  mTablesTreeView->setSortingEnabled( true );

  //for Qt < 4.3.2, passing -1 to include all model columns
  //in search does not seem to work
  mSearchColumnComboBox->setCurrentIndex( 1 );

  //hide the search options by default
  //they will be shown when the user ticks
  //the search options group box
  mSearchLabel->setVisible( false );
  mSearchColumnComboBox->setVisible( false );
  mSearchColumnsLabel->setVisible( false );
  mSearchModeComboBox->setVisible( false );
  mSearchModeLabel->setVisible( false );
  mSearchTableEdit->setVisible( false );
  cbxAllowGeometrylessTables->setVisible( false );
}
Exemplo n.º 12
0
KviChannelListSelector::KviChannelListSelector(QWidget * par,const QString & txt,QStringList * pOption,bool bEnabled)
: KviTalVBox(par), KviSelectorInterface()
{
	m_pLabel = new QLabel(txt,this);
	m_pTreeWidget = new QTreeWidget(this);
	m_pTreeWidget->setRootIsDecorated(false);
	m_pTreeWidget->setColumnCount(2);
	QStringList columnLabels;
	columnLabels.append(__tr2qs("Channel Name"));
	columnLabels.append(__tr2qs("Channel Password"));
	m_pTreeWidget->setHeaderLabels(columnLabels);
	KviTalHBox* pEditsHBox = new KviTalHBox(this);

	m_pChanLineEdit = new QLineEdit(pEditsHBox);
	connect(m_pChanLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged(const QString &)));
	connect(m_pChanLineEdit,SIGNAL(returnPressed()),this,SLOT(addClicked()));

	m_pPassLineEdit = new QLineEdit(pEditsHBox);
	m_pPassLineEdit->setEchoMode(QLineEdit::Password);
	connect(m_pPassLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged(const QString &)));
	connect(m_pPassLineEdit,SIGNAL(returnPressed()),this,SLOT(addClicked()));


	KviTalHBox * hBox = new KviTalHBox(this);
	m_pAddButton = new QPushButton(__tr2qs("A&dd"),hBox);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pRemoveButton = new QPushButton(__tr2qs("Re&move"),hBox);
	connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked()));
	m_pOption = pOption;

	for ( QStringList::Iterator it = pOption->begin(); it != pOption->end(); ++it ) {
		new KviChanTreeViewItem(m_pTreeWidget,(*it).section(':',0,0),(*it).section(':',1));
	}

	m_pTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
	m_pTreeWidget->setAllColumnsShowFocus(true);
	connect(m_pTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(itemSelectionChanged()));
	setSpacing(4);
	setStretchFactor(m_pTreeWidget,1);
	setEnabled(bEnabled);
}
Exemplo n.º 13
0
KviStringListSelector::KviStringListSelector(QWidget * par,const QString & txt,QStringList * pOption,bool bEnabled)
: KviTalVBox(par), KviSelectorInterface()
{
	m_pLabel = new QLabel(txt,this);
	m_pListWidget = new KviTalListWidget(this);
	m_pLineEdit = new QLineEdit(this);
	connect(m_pLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged(const QString &)));
	connect(m_pLineEdit,SIGNAL(returnPressed()),this,SLOT(addClicked()));
	KviTalHBox * hBox = new KviTalHBox(this);
	m_pAddButton = new QPushButton(__tr2qs("A&dd"),hBox);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pRemoveButton = new QPushButton(__tr2qs("Re&move"),hBox);
	connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked()));
	m_pOption = pOption;
	m_pListWidget->addItems(*pOption);
	m_pListWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
	connect(m_pListWidget,SIGNAL(itemSelectionChanged()),this,SLOT(itemSelectionChanged()));
	setSpacing(4);
	setStretchFactor(m_pListWidget,1);
	setEnabled(bEnabled);
}
Exemplo n.º 14
0
EditCalendarsPage::EditCalendarsPage(QWidget *parent)
    :QWidget(parent),
    m_manager(0)
{
    m_calendarList = new QListWidget(this);
    connect(m_calendarList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(itemDoubleClicked(QListWidgetItem *)));

#ifndef Q_OS_SYMBIAN
    // Add push buttons for non-Symbian platforms as they do not support soft keys
    QHBoxLayout* hbLayout = new QHBoxLayout();
    QPushButton *addButton = new QPushButton("Add new", this);
    connect(addButton,SIGNAL(clicked()), this, SIGNAL(addClicked()));
    hbLayout->addWidget(addButton);
    QPushButton *editButton = new QPushButton("Edit", this);
    connect(editButton,SIGNAL(clicked()),this,SLOT(editClicked()));
    hbLayout->addWidget(editButton);
    QPushButton *deleteButton = new QPushButton("Delete", this);
    connect(deleteButton,SIGNAL(clicked()),this,SLOT(deleteClicked()));
    hbLayout->addWidget(deleteButton);
    QPushButton *backButton = new QPushButton("Back", this);
    connect(backButton,SIGNAL(clicked()),this,SLOT(backClicked()));
    hbLayout->addWidget(backButton);
#endif

    QVBoxLayout *scrollAreaLayout = new QVBoxLayout();
    scrollAreaLayout->addWidget(m_calendarList);

#ifndef Q_OS_SYMBIAN
    scrollAreaLayout->addLayout(hbLayout);
#endif

    QScrollArea *scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    QWidget *formContainer = new QWidget(scrollArea);
    formContainer->setLayout(scrollAreaLayout);
    scrollArea->setWidget(formContainer);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addWidget(scrollArea);
    setLayout(mainLayout);

    // Add softkeys
    QAction* cancelSoftKey = new QAction("Back", this);
    cancelSoftKey->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(cancelSoftKey);
    connect(cancelSoftKey, SIGNAL(triggered(bool)), this, SLOT(backClicked()));

    QAction* editSoftKey = new QAction("Edit",this);
    editSoftKey->setSoftKeyRole(QAction::PositiveSoftKey); // Perhaps SelectSoftKey
    addAction(editSoftKey);
    connect(editSoftKey, SIGNAL(triggered(bool)), this, SLOT(editClicked()));
}
Exemplo n.º 15
0
ZerberusGui::ZerberusGui(Ms::Synthesizer* s)
   : SynthesizerGui(s)
      {
      setupUi(this);
      connect(add, SIGNAL(clicked()), SLOT(addClicked()));
      connect(remove, SIGNAL(clicked()), SLOT(removeClicked()));
      connect(&_futureWatcher, SIGNAL(finished()), this, SLOT(onSoundFontLoaded()));
      _progressDialog = new QProgressDialog(tr("Loading..."), tr("Cancel"), 0, 100, 0, Qt::FramelessWindowHint);
      _progressDialog->reset(); // required for Qt 5.5, see QTBUG-47042
      connect(_progressDialog, SIGNAL(canceled()), this, SLOT(cancelLoadClicked()));
      _progressTimer = new QTimer(this);
      connect(_progressTimer, SIGNAL(timeout()), this, SLOT(updateProgress()));
      connect(files, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
      updateButtons();
      }
Exemplo n.º 16
0
bool CustomPriority::Create()
{
    if (!LoadWindowFromXML("schedule-ui.xml", "custompriority", this))
        return false;

    m_ruleList = dynamic_cast<MythUIButtonList *>(GetChild("rules"));
    m_clauseList = dynamic_cast<MythUIButtonList *>(GetChild("clauses"));

    m_prioritySpin = dynamic_cast<MythUISpinBox *>(GetChild("priority"));

    m_titleEdit = dynamic_cast<MythUITextEdit *>(GetChild("title"));
    m_descriptionEdit = dynamic_cast<MythUITextEdit *>(GetChild("description"));

    m_addButton = dynamic_cast<MythUIButton *>(GetChild("add"));
    m_installButton = dynamic_cast<MythUIButton *>(GetChild("install"));
    m_testButton = dynamic_cast<MythUIButton *>(GetChild("test"));
    m_deleteButton = dynamic_cast<MythUIButton *>(GetChild("delete"));
    m_cancelButton = dynamic_cast<MythUIButton *>(GetChild("cancel"));

    if (!m_ruleList || !m_clauseList || !m_prioritySpin || !m_titleEdit ||
        !m_descriptionEdit || !m_addButton || !m_installButton ||
        !m_testButton || !m_deleteButton || !m_cancelButton)
    {
        LOG(VB_GENERAL, LOG_ERR,
            "CustomPriority, theme is missing required elements");
        return false;
    }

    connect(m_ruleList, SIGNAL(itemSelected(MythUIButtonListItem *)),
                SLOT(ruleChanged(MythUIButtonListItem *)));

    connect(m_titleEdit, SIGNAL(valueChanged()), SLOT(textChanged()));
    m_titleEdit->SetMaxLength(128);
    connect(m_descriptionEdit, SIGNAL(valueChanged()), SLOT(textChanged()));
    m_descriptionEdit->SetMaxLength(0);

    connect(m_addButton, SIGNAL(Clicked()), SLOT(addClicked()));
    connect(m_testButton, SIGNAL(Clicked()), SLOT(testClicked()));
    connect(m_installButton, SIGNAL(Clicked()), SLOT(installClicked()));
    connect(m_deleteButton, SIGNAL(Clicked()), SLOT(deleteClicked()));
    connect(m_cancelButton, SIGNAL(Clicked()), SLOT(Close()));

    loadData();

    BuildFocusList();

    return true;
}
Exemplo n.º 17
0
Upload::Upload(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Upload)
{
    ui->setupUi(this);

    ui->immediatleyButton->setChecked(true);

    connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
    connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
    connect(ui->transmitButton, SIGNAL(clicked()), this, SLOT(transmitClicked()));
    connect(this, SIGNAL(removeFiles(QString, QStringList)), parentWidget(), SLOT(removeFiles(QString, QStringList)));
    connect(this, SIGNAL(uploadFiles(QString, QStringList)), parentWidget(), SLOT(uploadFiles(QString, QStringList)));

    fileSizeMap.clear();
}
Exemplo n.º 18
0
TierWNameW::TierWNameW()
{
    setWindowFlags(Qt::Window);
    setAttribute(Qt::WA_DeleteOnClose, true);

    QVBoxLayout *v = new QVBoxLayout(this);
    v->addWidget(line = new QLineEdit());
    v->addWidget(bTier = new QRadioButton("Tier"));
    v->addWidget(bCat = new QRadioButton("Category"));
    QPushButton *ok = new QPushButton("Ok");
    v->addWidget(ok);

    connect(ok, SIGNAL(clicked()), SLOT(addClicked()));
    connect(ok, SIGNAL(clicked()), SLOT(close()));

    show();
}
ListEditButtonsWidget::ListEditButtonsWidget(QWidget *parent) :
    QWidget(parent),
    m_addButton(new QPushButton(tr("Add"))),
    m_removeButton(new QPushButton(tr("Remove"))),
    m_editButton(new QPushButton(tr("Edit")))
{
    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setSpacing(10);
    layout->addStretch();
    layout->addWidget(m_addButton);
    layout->addWidget(m_removeButton);
    layout->addWidget(m_editButton);
    setLayout(layout);

    connect(m_addButton, SIGNAL(clicked()), this, SIGNAL(addClicked()));
    connect(m_removeButton, SIGNAL(clicked()), this, SIGNAL(removeClicked()));
    connect(m_editButton, SIGNAL(clicked()), this, SIGNAL(editClicked()));
}
Exemplo n.º 20
0
ShortcutCaptureDialog::ShortcutCaptureDialog(Shortcut* _s, QMap<QString, Shortcut*> ls, QWidget* parent)
   : QDialog(parent)
      {
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      localShortcuts = ls;
      s = _s;

      addButton->setEnabled(false);
      replaceButton->setEnabled(false);
      oshrtLabel->setText(s->keysToString());
      oshrtLabel->setEnabled(false);
      connect(clearButton, SIGNAL(clicked()), SLOT(clearClicked()));
      connect(addButton, SIGNAL(clicked()), SLOT(addClicked()));
      connect(replaceButton, SIGNAL(clicked()), SLOT(replaceClicked()));
      clearClicked();

      nshrtLabel->installEventFilter(this);
      }
Exemplo n.º 21
0
SharedFilesWindow::SharedFilesWindow()
: KviWindow(KviWindow::Tool,"shared files window",0)
{
	g_pSharedFilesWindow = this;
	m_pSplitter = new KviTalSplitter(Qt::Horizontal,this);
	m_pSplitter->setObjectName("sharedfiles_splitter");

	KviTalVBox * vbox = new KviTalVBox(m_pSplitter);

	m_pTreeWidget  = new KviThemedTreeWidget(vbox, this, "sharedfileswindow_treewidget");
	//m_pTreeWidget->header()->hide();
	m_pTreeWidget->setAllColumnsShowFocus(true);
	QStringList columsLabels;
	columsLabels.append(__tr2qs_ctx("Name","sharedfileswindow"));
	columsLabels.append(__tr2qs_ctx("Filename","sharedfileswindow"));
	columsLabels.append(__tr2qs_ctx("Mask","sharedfileswindow"));

	columsLabels.append(__tr2qs_ctx("Expires","sharedfileswindow"));
	m_pTreeWidget->setHeaderLabels(columsLabels);
	m_pTreeWidget->setColumnWidth(0,200);
	m_pTreeWidget->setColumnWidth(0,300);
	m_pTreeWidget->setColumnWidth(0,300);
	m_pTreeWidget->setColumnWidth(0,200);

	m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	connect(m_pTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(enableButtons()));

	connect(g_pSharedFilesManager,SIGNAL(sharedFilesChanged()),this,SLOT(fillFileView()));
	connect(g_pSharedFilesManager,SIGNAL(sharedFileAdded(KviSharedFile *)),this,SLOT(sharedFileAdded(KviSharedFile *)));
	connect(g_pSharedFilesManager,SIGNAL(sharedFileRemoved(KviSharedFile *)),this,SLOT(sharedFileRemoved(KviSharedFile *)));

	KviTalHBox * b = new KviTalHBox(vbox);

	m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...","sharedfileswindow"),b);
	connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked()));
	m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move","sharedfileswindow"),b);
	connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked()));
	m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit","sharedfileswindow"),b);
	connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked()));

	fillFileView();
}
bool WizardEditor::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: okClicked(); break;
    case 1: applyClicked(); break;
    case 2: cancelClicked(); break;
    case 3: helpClicked(); break;
    case 4: addClicked(); break;
    case 5: removeClicked(); break;
    case 6: upClicked(); break;
    case 7: downClicked(); break;
    case 8: itemHighlighted((int)static_QUType_int.get(_o+1)); break;
    case 9: itemSelected((int)static_QUType_int.get(_o+1)); break;
    case 10: itemDragged((QListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 11: itemDropped((QListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    default:
	return WizardEditorBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
bool WizardEditorBase::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: init(); break;
    case 2: destroy(); break;
    case 3: addClicked(); break;
    case 4: applyClicked(); break;
    case 5: cancelClicked(); break;
    case 6: downClicked(); break;
    case 7: helpClicked(); break;
    case 8: itemHighlighted((int)static_QUType_int.get(_o+1)); break;
    case 9: itemSelected((int)static_QUType_int.get(_o+1)); break;
    case 10: okClicked(); break;
    case 11: removeClicked(); break;
    case 12: upClicked(); break;
    default:
	return QDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
ManageTeachersWidget::ManageTeachersWidget(MainController *mainController, QWidget *parent) :
		QWidget(parent),
		m_ui(new Ui::ManageTeachersWidget),
		m_mainController(mainController),
		m_schoolDatabase(mainController->schoolData()->schoolDatabase())

{
	m_ui->setupUi(this);

	m_selectTeacherWidget = new SelectTeacherWidget(this);
	m_ui->verticalLayout->insertWidget(0, m_selectTeacherWidget);
	m_selectTeacherWidget->setTeacherTableModel(m_mainController->teacherTableModel());
	m_selectTeacherWidget->teacherTable()->
			hideColumn(TeacherTableModel::TeacherSelected);

	connect(m_ui->addTeacherButton, SIGNAL(clicked()), this, SLOT(addClicked()));
	connect(m_ui->editTeacherButton, SIGNAL(clicked()), this, SLOT(editClicked()));
	connect(m_ui->deleteTeacherButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
	connect(m_selectTeacherWidget->teacherTable()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(setEditButtons()));

	setEditButtons();
}
Exemplo n.º 25
0
TimeDialog::TimeDialog(QWidget* parent)
   : QWidget(parent, Qt::WindowFlags(Qt::Dialog | Qt::Window))
      {
      setupUi(this);
      setWindowTitle(tr("MuseScore: Time Signatures"));

      QLayout* l = new QVBoxLayout();
      l->setContentsMargins(0, 0, 0, 0);
      frame->setLayout(l);

      sp = MuseScore::newTimePalette();
      sp->setReadOnly(false);
      sp->setSelectable(true);

      connect(zNominal,  SIGNAL(valueChanged(int)), SLOT(zChanged(int)));
      connect(nNominal,  SIGNAL(currentIndexChanged(int)), SLOT(nChanged(int)));
      connect(sp,        SIGNAL(boxClicked(int)),   SLOT(paletteChanged(int)));
      connect(sp,        SIGNAL(changed()),         SLOT(setDirty()));
      connect(addButton, SIGNAL(clicked()),         SLOT(addClicked()));

      _timePalette = new PaletteScrollArea(sp);
      QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
      _timePalette->setSizePolicy(policy);
      _timePalette->setRestrictHeight(false);

      l->addWidget(_timePalette);

      _dirty = false;

      if (useFactorySettings || !sp->read(dataPath + "/" + "timesigs")) {
            Fraction sig(4,4);
            groups->setSig(sig, Groups::endings(sig));
            }
      for (int i = 0; i < sp->size(); ++i)      // cells can be changed
            sp->setCellReadOnly(i, false);

      sp->setSelected(2);
      paletteChanged(2);
      }
Exemplo n.º 26
0
    /**
     * @brief	Constructor
     */
    MultiFieldEditor()
        : m_buttonBox(new QVBoxLayout()),
          m_treeView(new QTreeWidget()),
          m_addButton(new QPushButton("&Add")),
          m_removeButton(new QPushButton("&Remove")),
          m_moveUpButton(new QPushButton("&Up")),
          m_moveDownButton(new QPushButton("&Down"))
    {
        m_widget = new MultiFieldLayout();
        m_status = new QLabel("label status");

        m_buttonBox->addWidget(m_addButton);
        m_buttonBox->addWidget(m_removeButton);
        m_buttonBox->addWidget(m_moveUpButton);
        m_buttonBox->addWidget(m_moveDownButton);
        m_buttonBox->addStretch();

        m_treeView->setRootIsDecorated(false);
        m_treeView->setColumnCount( 2 );
		m_treeView->setUniformRowHeights(true);

        m_adapter.addColumnsToView(m_treeView);

        m_widget->addWidget(m_treeView,0,0);
        m_widget->addLayout(m_buttonBox, 0, 1);
        m_widget->addWidget(m_status, 1, 0);

        updateLabel();

        connect(m_addButton, SIGNAL(clicked()), this, SLOT(addClicked()));
        connect(m_removeButton, SIGNAL(clicked()), this, SLOT(removeClicked()));
        connect(m_moveUpButton, SIGNAL(clicked()), this, SLOT(moveUpClicked()));
        connect(m_moveDownButton, SIGNAL(clicked()), this, SLOT(moveDownClicked()));

        connect(m_treeView, SIGNAL(itemChanged(QTreeWidgetItem*,int)), m_widget, SIGNAL(signalChanged()));
        connect(this, SIGNAL(signalChanged()), m_widget, SIGNAL(signalChanged()));
    }
Exemplo n.º 27
0
static void
gnc_recurrence_comp_init(GncRecurrenceComp *grc)
{
    GtkWidget *vb;

    grc->hbb = GTK_HBUTTON_BOX(gtk_hbutton_box_new());
    grc->vbox = GTK_VBOX(gtk_vbox_new(FALSE, 1));
    grc->rlist = NULL;

    grc->buttAdd = GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_ADD));
    g_signal_connect(G_OBJECT(grc->buttAdd), "clicked",
                     G_CALLBACK(addClicked), grc);
    grc->buttRemove = GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_REMOVE));
    g_signal_connect(G_OBJECT(grc->buttRemove), "clicked",
                     G_CALLBACK(removeClicked), grc);

    gtk_box_pack_start(GTK_BOX(grc->hbb), GTK_WIDGET(grc->buttAdd),
                       FALSE, FALSE, 3);
    gtk_box_pack_start(GTK_BOX(grc->hbb), GTK_WIDGET(grc->buttRemove),
                       FALSE, FALSE, 3);

    vb = gtk_vbox_new(FALSE, 1);
    gtk_box_pack_start(GTK_BOX(vb), GTK_WIDGET(grc->hbb),
                       FALSE, FALSE, 3);
    gtk_box_pack_start(GTK_BOX(vb), GTK_WIDGET(grc->vbox),
                       FALSE, FALSE, 3);

    gtk_scrolled_window_add_with_viewport(
        GTK_SCROLLED_WINDOW(grc), GTK_WIDGET(vb));
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(grc),
                                   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

    grc->num_rec = 0;
    gtk_widget_show_all(GTK_WIDGET(grc));
    addClicked(NULL, grc);
}
Exemplo n.º 28
0
AlbumManager::AlbumManager(QWidget* parent)
   : AbstractDialog(parent)
      {
      setObjectName("AlbumManager");
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      up->setIcon(*icons[int(Icons::arrowUp_ICON)]);
      down->setIcon(*icons[int(Icons::arrowDown_ICON)]);

      album = 0;
      connect(add,         SIGNAL(clicked()), SLOT(addClicked()));
      connect(addNew,      SIGNAL(clicked()), SLOT(addNewClicked()));
      connect(up,          SIGNAL(clicked()), SLOT(upClicked()));
      connect(down,        SIGNAL(clicked()), SLOT(downClicked()));
      connect(remove,      SIGNAL(clicked()), SLOT(removeClicked()));
      connect(scoreList,   SIGNAL(currentRowChanged(int)), SLOT(currentScoreChanged(int)));
      connect(scoreList,   SIGNAL(itemChanged(QListWidgetItem*)), SLOT(itemChanged(QListWidgetItem*)));
      connect(buttonBox,   SIGNAL(clicked(QAbstractButton*)), SLOT(buttonBoxClicked(QAbstractButton*)));
      currentScoreChanged(-1);
      add->setEnabled(false);

      MuseScore::restoreGeometry(this);
      //createNewClicked();
      }
Exemplo n.º 29
0
QTM_USE_NAMESPACE

CalendarDemo::CalendarDemo(QWidget *parent)
    :QMainWindow(parent),
    m_stackedWidget(0),
    m_monthPage(0),
    m_dayPage(0),
    m_eventEditPage(0),
    m_eventOccurrenceEditPage(0)
{
    m_stackedWidget = new QStackedWidget(this);

    m_dayPage = new DayPage(m_stackedWidget);
    m_monthPage = new MonthPage(m_stackedWidget);
    m_eventEditPage = new EventEditPage(m_stackedWidget);
    m_todoEditPage = new TodoEditPage(m_stackedWidget);
    m_journalEditPage = new JournalEditPage(m_stackedWidget);
    m_eventOccurrenceEditPage = new EventOccurrenceEditPage(m_stackedWidget);
    m_addCalendarPage = new AddCalendarPage(m_stackedWidget);
    m_editCalendarsPage = new EditCalendarsPage(m_stackedWidget);

    //qRegisterMetaType<QOrganizerManager>("QOrganizerManager");
    qRegisterMetaType<QOrganizerItem>("QOrganizerItem");
    qRegisterMetaType<QOrganizerItemId>("QOrganizerItemId");
    qRegisterMetaType<QOrganizerCollection>("QOrganizerCollection");
    qRegisterMetaType<QOrganizerAbstractRequest::State>("QOrganizerAbstractRequest::State");

    connect(m_monthPage, SIGNAL(showDayPage(QDate)), this, SLOT(activateDayPage()), Qt::QueuedConnection);
    connect(m_monthPage, SIGNAL(showEditPage(const QOrganizerItem &)), this, SLOT(activateEditPage(const QOrganizerItem &)), Qt::QueuedConnection);
    connect(m_monthPage, SIGNAL(addNewEvent()), this, SLOT(addNewEvent()), Qt::QueuedConnection);
    connect(m_monthPage, SIGNAL(addNewTodo()), this, SLOT(addNewTodo()), Qt::QueuedConnection);
    connect(m_monthPage, SIGNAL(managerChanged(QOrganizerManager*)), this, SLOT(changeManager(QOrganizerManager*)), Qt::QueuedConnection);
    connect(m_monthPage, SIGNAL(managerChanged(QOrganizerManager*)), m_dayPage, SLOT(changeManager(QOrganizerManager*)), Qt::QueuedConnection);
    connect(m_monthPage, SIGNAL(currentDayChanged(QDate)), this, SLOT(updateSelectedDay(QDate)));
    connect(m_dayPage, SIGNAL(showMonthPage()), this, SLOT(activateMonthPage()), Qt::QueuedConnection);
    connect(m_dayPage, SIGNAL(showEditPage(const QOrganizerItem &)), this, SLOT(activateEditPage(const QOrganizerItem &)), Qt::QueuedConnection);
    connect(m_dayPage, SIGNAL(addNewEvent()), this, SLOT(addNewEvent()), Qt::QueuedConnection);
    connect(m_dayPage, SIGNAL(addNewTodo()), this, SLOT(addNewTodo()), Qt::QueuedConnection);
    connect(m_eventEditPage, SIGNAL(showDayPage()), this, SLOT(activateDayPage()), Qt::QueuedConnection);
    connect(m_todoEditPage, SIGNAL(showDayPage()), this, SLOT(activateDayPage()), Qt::QueuedConnection);
    connect(m_journalEditPage, SIGNAL(showDayPage()), this, SLOT(activateDayPage()), Qt::QueuedConnection);
    connect(m_eventOccurrenceEditPage, SIGNAL(showDayPage()), this, SLOT(activateDayPage()), Qt::QueuedConnection);
    connect(m_addCalendarPage, SIGNAL(showPreviousPage()), this, SLOT(activatePreviousPage()), Qt::QueuedConnection);
    connect(m_editCalendarsPage, SIGNAL(showAddCalendarPage(QOrganizerManager*,QOrganizerCollection*)), this, SLOT(editExistingCalendar(QOrganizerManager*,QOrganizerCollection*)), Qt::QueuedConnection);
    connect(m_editCalendarsPage, SIGNAL(showPreviousPage()), this, SLOT(activateMonthPage()), Qt::QueuedConnection);
    connect(m_editCalendarsPage, SIGNAL(addClicked()), this, SLOT(addCalendar()), Qt::QueuedConnection);

    // Connect to the save and remove request status change signals
    connect(&m_saveReq, SIGNAL(stateChanged(QOrganizerAbstractRequest::State)),
            this, SLOT(saveReqStateChanged(QOrganizerAbstractRequest::State)));
    connect(&m_remReq, SIGNAL(stateChanged(QOrganizerAbstractRequest::State)),
            this, SLOT(removeReqStateChanged(QOrganizerAbstractRequest::State)));

    m_monthPage->init();
    
    m_stackedWidget->addWidget(m_monthPage);
    m_stackedWidget->addWidget(m_dayPage);
    m_stackedWidget->addWidget(m_eventEditPage);
    m_stackedWidget->addWidget(m_todoEditPage);
    m_stackedWidget->addWidget(m_journalEditPage);
    m_stackedWidget->addWidget(m_eventOccurrenceEditPage);
    m_stackedWidget->addWidget(m_addCalendarPage);
    m_stackedWidget->addWidget(m_editCalendarsPage);
    m_stackedWidget->setCurrentIndex(0);

    setCentralWidget(m_stackedWidget);
    buildMenu();

    activateMonthPage();
}
void ListWidgetButtonContainer::setButtons(const RecordItNow::CollectionListWidget::ButtonCodes &buttons)
{

    m_buttons.clear();

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setContentsMargins(-1, -1, -1, 0);
    mainLayout->setSizeConstraint(QVBoxLayout::SetMinimumSize);

    KSeparator *mainSeparator = new KSeparator(this);
    mainSeparator->setFrameShape(KSeparator::HLine);

    QHBoxLayout *layout = new QHBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSizeConstraint(QLayout::SetMinimumSize);

    mainLayout->addLayout(layout);
    mainLayout->addWidget(mainSeparator);

    QToolButton *button = 0;
    if (buttons & CollectionListWidget::PlayButton) {
        button = newButton(this);
        button->setIcon(KIcon("media-playback-start"));
        button->setToolTip(i18n("Play"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(playClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::PlayButton, button);
    }
/*
    if (button) {
        KSeparator *separator = new KSeparator(this);
        separator->setFrameShape(QFrame::VLine);
        layout->addWidget(separator);
    }
*/

    if (buttons & CollectionListWidget::UploadButton) {
        button = newButton(this);
        button->setIcon(KIcon("recorditnow-upload-media"));
        button->setToolTip(i18n("Upload"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(uploadClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::UploadButton, button);
    }

    if (buttons & CollectionListWidget::AddButton) {
        button = newButton(this);
        button->setIcon(KIcon("list-add"));
        button->setToolTip(i18n("Add"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(addClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::AddButton, button);
    }

    if (buttons & CollectionListWidget::EditButton) {
        button = newButton(this);
        button->setIcon(KIcon("document-edit"));
        button->setToolTip(i18n("Edit"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(editClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::EditButton, button);
    }

    if (buttons & CollectionListWidget::DeleteButton) {
        button = newButton(this);
        button->setIcon(KIcon("edit-delete"));
        button->setToolTip(i18n("Delete"));
        connect(button, SIGNAL(clicked()), this, SIGNAL(deleteClicked()));

        layout->addWidget(button);
        m_buttons.insert(CollectionListWidget::DeleteButton, button);
    }

    QWidget *spacer = new QWidget(this);
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    layout->addWidget(spacer);

    setLayout(mainLayout);

}