]> git.lyx.org Git - features.git/blobdiff - src/frontends/kde/citationdlg.C
renaming, fix citation (still no search though)
[features.git] / src / frontends / kde / citationdlg.C
index 8fe96115608825ec3131eef1758c589828c16c03..5b36b251d27dff8af62ddfe433d5749120e58a04 100644 (file)
  */
 
 #include <config.h>
+#include <gettext.h>
 
+#include "FormCitation.h"
 #include "citationdlg.h"
-#include "dlg/helpers.h"
 
-using kde_helpers::setSizeHint;
+#include <qtooltip.h>
 
-CitationDialog::CitationDialog(FormCitation *form, QWidget *parent, char const * name, bool, WFlags)
-       : QDialog(parent,name,0), form_(form)
+CitationDialog::CitationDialog(FormCitation * f, QWidget * p, char const * name)
+       : CitationDialogData(p, name), form_(f)
 {
        setCaption(name);
-       setMinimumWidth(500);
-
-       // widgets
-
-       labelchosen = new QLabel(this);
-       labelchosen->setText(_("Selected keys"));
-       setSizeHint(labelchosen);
-       labelchosen->setMaximumSize(labelchosen->sizeHint());
-
-       chosen = new QListBox(this);
-
-       labelkeys = new QLabel(this);
-       labelkeys->setText(_("Available keys"));
-       setSizeHint(labelkeys);
-       labelkeys->setMaximumSize(labelkeys->sizeHint());
-
-       keys = new QListBox(this);
-
-       labelentry = new QLabel(this);
-       labelentry->setText(_("Reference entry"));
-       setSizeHint(labelentry);
-       labelentry->setMaximumSize(labelentry->sizeHint());
-
-       after = new QLineEdit(this);
-       setSizeHint(after);
-
-       entry = new QMultiLineEdit(this);
-       entry->setReadOnly(true);
-       entry->setFixedVisibleLines(2); 
-
-       labelafter = new QLabel(this);
-       labelafter->setText(_("Text after"));
-       labelafter->setMargin(5);
-       setSizeHint(labelafter);
-       labelafter->setMaximumSize(labelafter->sizeHint());
-
-       add = new QPushButton(this); 
-       add->setText(_("&Add"));
-       setSizeHint(add); 
-       add->setMaximumSize(add->sizeHint());
-       up = new QPushButton(this); 
-       up->setText(_("&Up"));
-       setSizeHint(up); 
-       up->setMaximumSize(up->sizeHint());
-       down = new QPushButton(this); 
-       down->setText(_("&Down"));
-       setSizeHint(down); 
-       down->setMaximumSize(down->sizeHint());
-       remove = new QPushButton(this); 
-       remove->setText(_("&Remove"));
-       setSizeHint(remove); 
-       remove->setMaximumSize(remove->sizeHint());
-
-       buttonOk = new QPushButton(this);
-       buttonOk->setText(_("&OK"));
-       buttonOk->setDefault(true);
-       setSizeHint(buttonOk); 
-       buttonOk->setMaximumSize(buttonOk->sizeHint());
-
-       buttonCancel = new QPushButton(this);
-       buttonCancel->setText(_("&Cancel"));
-       setSizeHint(buttonCancel); 
-       buttonCancel->setMaximumSize(buttonCancel->sizeHint());
 
        // tooltips
 
-       QToolTip::add(chosen,_("Keys currently selected"));
-       QToolTip::add(keys,_("Reference keys available"));
-       QToolTip::add(entry,_("Reference entry text"));
-       QToolTip::add(after,_("Text to place after citation"));
-
-       // layouts
+       QToolTip::add(button_add, _("Add reference to current citation"));
+       QToolTip::add(button_remove, _("Remove reference from current citation"));
+       QToolTip::add(button_up, _("Move reference before"));
+       QToolTip::add(button_down, _("Move reference after"));
+       QToolTip::add(line_after, _("Text to add after references"));
+       QToolTip::add(line_details, _("Reference details"));
+       QToolTip::add(button_search, _("Search through references"));
+       QToolTip::add(list_available, _("Available references"));
+       QToolTip::add(list_chosen, _("Current chosen references"));
 
-       topLayout = new QHBoxLayout(this,10);
-
-       layout = new QVBoxLayout();
-       topLayout->addLayout(layout);
-       layout->addSpacing(10);
-
-       browserLayout = new QHBoxLayout();
-       layout->addLayout(browserLayout,1);
-
-       chosenLayout = new QVBoxLayout();
-       browserLayout->addLayout(chosenLayout,1); 
-       iconLayout = new QVBoxLayout();
-       browserLayout->addLayout(iconLayout,0);
-       keysLayout = new QVBoxLayout();
-       browserLayout->addLayout(keysLayout,1);
-       chosenLayout->addWidget(labelchosen, 0, AlignLeft);
-       chosenLayout->addWidget(chosen, 1);
+       line_details->setMinimumHeight(30);
  
-       iconLayout->addStretch(1);
-       iconLayout->addWidget(add,1);
-       iconLayout->addStretch(1);
-       iconLayout->addWidget(up,1);
-       iconLayout->addStretch(1);
-       iconLayout->addWidget(down,1);
-       iconLayout->addStretch(1);
-       iconLayout->addWidget(remove,1);
-       iconLayout->addStretch(1);
-       keysLayout->addWidget(labelkeys, 0, AlignLeft);
-       keysLayout->addWidget(keys, 1);
-
-       entryLayout = new QVBoxLayout();
-       layout->addLayout(entryLayout);
-       entryLayout->addWidget(labelentry, 0, AlignLeft);
-       entryLayout->addWidget(entry, 0);
-
-       afterLayout = new QHBoxLayout();
-       layout->addLayout(afterLayout);
-
-       afterLayout->addWidget(labelafter, 0, AlignLeft);
-       afterLayout->addWidget(after, 1);
-       buttonLayout = new QHBoxLayout();
-       layout->addLayout(buttonLayout);
-       buttonLayout->addStretch(1);
-       buttonLayout->addWidget(buttonOk, 1);
-       buttonLayout->addStretch(2);
-       buttonLayout->addWidget(buttonCancel, 1);
-       buttonLayout->addStretch(1);
-       // connections
-
-       connect(keys, SIGNAL(selected(const char *)), this, SLOT(select_key_adaptor(const char *)));
-       connect(keys, SIGNAL(highlighted(const char *)), this, SLOT(highlight_key_adaptor(const char *)));
-       connect(chosen, SIGNAL(highlighted(const char *)), this, SLOT(highlight_chosen_adaptor(const char *)));
-       connect(add, SIGNAL(clicked()), this, SLOT(add_adaptor()));
-       connect(up, SIGNAL(clicked()), this, SLOT(up_adaptor()));
-       connect(down, SIGNAL(clicked()), this, SLOT(down_adaptor()));   
-       connect(remove, SIGNAL(clicked()), this, SLOT(remove_adaptor()));
-       connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply_adaptor()));
-       connect(buttonCancel, SIGNAL(clicked()), this, SLOT(close_adaptor()));
-       
-       resize(sizeHint());
+       setMinimumSize(200, 65);
 }
 
 
-CitationDialog::~CitationDialog()
+void CitationDialog::clicked_search()
 {
+       // FIXME 
 }
 
-
 void CitationDialog::closeEvent(QCloseEvent * e)
 {
        form_->CancelButton();