From b3eda791f4893b47a32128238ecaecafc073cb01 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Tue, 20 Jul 2010 22:19:41 +0000 Subject: [PATCH] Document properties: remove toggle button Simply shows the full path, file name can be extracted from it. The button did not toggle between title and file path, also because title is always shown if found. svn path=/trunk/KDE/kdegraphics/okular/; revision=1152390 --- ui/propertiesdialog.cpp | 47 ++--------------------------------------- ui/propertiesdialog.h | 7 ------ 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/ui/propertiesdialog.cpp b/ui/propertiesdialog.cpp index d953e04b8..8f3a4b756 100644 --- a/ui/propertiesdialog.cpp +++ b/ui/propertiesdialog.cpp @@ -59,8 +59,6 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc) return; } - m_showingTitle = true; - // mime name based on mimetype id QString mimeName = info->get( "mimeType" ).section( '/', -1 ).toUpper(); setCaption( i18n( "%1 Properties", mimeName ) ); @@ -70,11 +68,9 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc) int row = 0; int valMaxWidth = 100; - const QString filePathKey = Okular::DocumentInfo::getKeyString( Okular::DocumentInfo::FilePath ); - /* obtains the properties list, conveniently ordered */ QStringList orderedProperties; - orderedProperties << filePathKey + orderedProperties << Okular::DocumentInfo::getKeyString( Okular::DocumentInfo::FilePath ) << Okular::DocumentInfo::getKeyString( Okular::DocumentInfo::PagesSize ) << Okular::DocumentInfo::getKeyString( Okular::DocumentInfo::DocumentSize ); for (Okular::DocumentInfo::Key ks = Okular::DocumentInfo::Title; @@ -108,23 +104,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, Okular::Document *doc) // create labels and layout them KSqueezedTextLabel *value = new KSqueezedTextLabel( valueString, page ); - QWidget *key; - if ( element.tagName() == filePathKey ) { - m_toggleTitlePath = new QPushButton( page ); - m_toggleTitlePath->setToolTip( i18n("Toggles between File Path and Title") ); - setToggleTitlePathText(); - - m_toggleTitlePath->setFlat( true ); - connect( m_toggleTitlePath, SIGNAL( clicked() ), this, SLOT( filePathViewChanged() ) ); - key = m_toggleTitlePath; - m_filePathNameLabel = value; - m_filePathName = valueString; - - KUrl vurl( valueString ); - value->setText( vurl.fileName() ); - } else { - key = new QLabel( i18n( "%1:", titleString ), page ); - } + QWidget *key = new QLabel( i18n( "%1:", titleString ), page ); value->setTextInteractionFlags( Qt::TextSelectableByMouse ); layout->addWidget( key, row, 0, Qt::AlignRight ); layout->addWidget( value, row, 1 ); @@ -205,29 +185,6 @@ void PropertiesDialog::pageChanged( KPageWidgetItem *current, KPageWidgetItem * } } -void PropertiesDialog::setToggleTitlePathText() -{ - QString text; - if (m_showingTitle) - { - text = i18nc( "%1 is \"Title\"", "%1:", Okular::DocumentInfo::getKeyTitle( Okular::DocumentInfo::Title ) ); - } - else - { - text = i18nc( "%1 is \"File Path\"", "%1:", Okular::DocumentInfo::getKeyTitle( Okular::DocumentInfo::FilePath ) ); - } - m_toggleTitlePath->setText( text ); -} - -void PropertiesDialog::filePathViewChanged() -{ - m_showingTitle = !m_showingTitle; - setToggleTitlePathText(); - QString tmp(m_filePathName); - m_filePathName = m_filePathNameLabel->text(); - m_filePathNameLabel->setText( tmp ); -} - void PropertiesDialog::slotFontReadingProgress( int page ) { m_fontProgressBar->setValue( m_fontProgressBar->maximum() * ( page + 1 ) / m_document->pages() ); diff --git a/ui/propertiesdialog.h b/ui/propertiesdialog.h index 6790993cc..216448176 100644 --- a/ui/propertiesdialog.h +++ b/ui/propertiesdialog.h @@ -36,25 +36,18 @@ class PropertiesDialog : public KPageDialog private slots: void pageChanged( KPageWidgetItem *, KPageWidgetItem * ); - void filePathViewChanged(); void slotFontReadingProgress( int page ); void slotFontReadingEnded(); void reallyStartFontReading(); void showFontsMenu(const QPoint &pos); private: - void setToggleTitlePathText(); - Okular::Document * m_document; KPageWidgetItem * m_fontPage; FontsListModel * m_fontModel; QLabel * m_fontInfo; QProgressBar * m_fontProgressBar; bool m_fontScanStarted; - bool m_showingTitle; - QString m_filePathName; - KSqueezedTextLabel *m_filePathNameLabel; - QPushButton *m_toggleTitlePath; }; class FontsListModel