kivio
kivio_dlg_pageshow.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "kivio_dlg_pageshow.h"
00020 #include "kivio_view.h"
00021 #include "kivio_canvas.h"
00022 #include "kivio_page.h"
00023 #include "kivio_command.h"
00024 #include "kivio_doc.h"
00025 #include "kivio_map.h"
00026 #include <kapplication.h>
00027 #include <klocale.h>
00028 #include <qstringlist.h>
00029 #include <qlayout.h>
00030 #include <kbuttonbox.h>
00031 #include <qstrlist.h>
00032 #include <qptrlist.h>
00033 #include <kdebug.h>
00034 #include <KoTabBar.h>
00035
00036 KivioPageShow::KivioPageShow( KivioView* parent, const char* name )
00037 : KDialogBase( parent, name, true, i18n("Show Page"), Ok|Cancel, Ok )
00038 {
00039 m_pView = parent;
00040
00041 QWidget* view = new QWidget(this);
00042 setMainWidget(view);
00043
00044 QVBoxLayout *lay1 = new QVBoxLayout( view );
00045 lay1->setMargin( KDialog::marginHint() );
00046 lay1->setSpacing( KDialog::spacingHint() );
00047
00048 QLabel *label = new QLabel( i18n("Select hidden page to show:"), view );
00049 lay1->addWidget( label );
00050
00051 list = new QListBox(view);
00052 lay1->addWidget( list );
00053
00054 QStringList tabsList = m_pView->doc()->map()->hiddenPages();
00055 list->insertStringList(tabsList);
00056
00057 connect( list, SIGNAL(doubleClicked(QListBoxItem *)), this, SLOT(slotDoubleClicked(QListBoxItem *)));
00058 resize( 200, 150 );
00059 }
00060
00061 void KivioPageShow::slotDoubleClicked(QListBoxItem *)
00062 {
00063 slotOk();
00064 }
00065
00066 void KivioPageShow::slotOk()
00067 {
00068 QString text;
00069 if (list->currentItem()!=-1) {
00070 text=list->text(list->currentItem());
00071
00072 KivioPage * page = m_pView->doc()->map()->findPage( text );
00073 page->setHidden( false );
00074 }
00075 accept();
00076 }
00077
00078 #include "kivio_dlg_pageshow.moc"
|