~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to kspread/kspread_dlg_show.cc

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "kspread_dlg_show.h"
24
24
#include "kspread_view.h"
 
25
#include "kspread_doc.h"
25
26
#include "kspread_tabbar.h"
26
 
#include "kspread_table.h"
27
 
#include <kapp.h>
 
27
#include <qlayout.h>
28
28
#include <klocale.h>
29
 
#include <qstringlist.h>
30
 
#include <qlayout.h>
31
 
#include <kbuttonbox.h>
32
29
#include <qlistbox.h>
33
 
 
 
30
#include <qlabel.h>
34
31
 
35
32
KSpreadshow::KSpreadshow( KSpreadView* parent, const char* name )
36
 
        : QDialog( parent, name,TRUE )
 
33
        : KDialogBase( parent, name,TRUE,i18n("Show Sheet"),Ok|Cancel )
37
34
{
38
35
  m_pView = parent;
39
 
 
40
 
 
41
 
  QVBoxLayout *lay1 = new QVBoxLayout( this );
42
 
  lay1->setMargin( 5 );
43
 
  lay1->setSpacing( 10 );
44
 
  list=new QListBox(this);
 
36
  QWidget *page = new QWidget( this );
 
37
  setMainWidget(page);
 
38
  QVBoxLayout *lay1 = new QVBoxLayout( page, 0, spacingHint() );
 
39
 
 
40
  QLabel *label = new QLabel( i18n("Select hidden sheets to show:"), page );
 
41
  lay1->addWidget( label );
 
42
 
 
43
  list=new QListBox(page);
45
44
  lay1->addWidget( list );
46
45
 
47
 
  setCaption( i18n("Table hidden") );
48
 
 
49
 
  KButtonBox *bb = new KButtonBox( this );
50
 
  bb->addStretch();
51
 
  m_pOk = bb->addButton( i18n("OK") );
52
 
  m_pOk->setDefault( TRUE );
53
 
  m_pClose = bb->addButton( i18n( "Close" ) );
54
 
  bb->layout();
55
 
  lay1->addWidget( bb );
 
46
  list->setSelectionMode(QListBox::Multi);
56
47
  QString text;
57
48
  QStringList::Iterator it;
58
49
  QStringList tabsList=m_pView->tabBar()->listhide();
62
53
        list->insertItem(text);
63
54
        }
64
55
  if(!list->count())
65
 
        m_pOk->setEnabled(false);
66
 
  connect( m_pOk, SIGNAL( clicked() ), this, SLOT( slotOk() ) );
67
 
  connect( m_pClose, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
 
56
        enableButtonOK(false);
 
57
  connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
68
58
  connect( list, SIGNAL(doubleClicked(QListBoxItem *)),this,SLOT(slotDoubleClicked(QListBoxItem *)));
69
59
  resize( 200, 150 );
70
 
 
 
60
  setFocus();
71
61
}
72
62
 
73
63
void KSpreadshow::slotDoubleClicked(QListBoxItem *)
79
69
 
80
70
void KSpreadshow::slotOk()
81
71
{
82
 
  QString text;
83
 
  if(list->currentItem()!=-1)
84
 
        {
85
 
        text=list->text(list->currentItem());
86
 
        m_pView->tabBar()->showTable(text);
 
72
    m_pView->doc()->emitBeginOperation( false );
 
73
 
 
74
    QStringList listTable;
 
75
 
 
76
    for (int i=0; i < list->numRows(); i++)
 
77
    {
 
78
        if (list->isSelected(i))
 
79
        {
 
80
            listTable.append( list->text(i));
87
81
        }
88
 
  accept();
89
 
}
90
 
 
91
 
void KSpreadshow::slotClose()
92
 
{
93
 
  reject();
94
 
}
95
 
 
 
82
    }
 
83
    m_pView->tabBar()->showTable(listTable);
 
84
 
 
85
    m_pView->slotUpdateView( m_pView->activeTable() );
 
86
    accept();
 
87
}
96
88
 
97
89
#include "kspread_dlg_show.moc"