Changeset View
Changeset View
Standalone View
Standalone View
AnnotationDialog/Dialog.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | 92 | { | |||
---|---|---|---|---|---|
117 | 117 | | |||
118 | m_description = new DescriptionEdit(this); | 118 | m_description = new DescriptionEdit(this); | ||
119 | m_description->setProperty( "WantsFocus", true ); | 119 | m_description->setProperty( "WantsFocus", true ); | ||
120 | m_description->setObjectName( i18n("Description") ); | 120 | m_description->setObjectName( i18n("Description") ); | ||
121 | m_description->setCheckSpellingEnabled( true ); | 121 | m_description->setCheckSpellingEnabled( true ); | ||
122 | m_description->setTabChangesFocus( true ); // this allows tabbing to the next item in the tab order. | 122 | m_description->setTabChangesFocus( true ); // this allows tabbing to the next item in the tab order. | ||
123 | m_description->setWhatsThis( i18nc( "@info:whatsthis", | 123 | m_description->setWhatsThis( i18nc( "@info:whatsthis", | ||
124 | "<para>A descriptive text of the image.</para>" | 124 | "<para>A descriptive text of the image.</para>" | ||
125 | "<para>If <emphasis>Use EXIF description</emphasis> is enabled under " | 125 | "<para>If <emphasis>Use Exif description</emphasis> is enabled under " | ||
126 | "<interface>Settings|Configure KPhotoAlbum...|General</interface>, a description " | 126 | "<interface>Settings|Configure KPhotoAlbum...|General</interface>, a description " | ||
127 | "embedded in the image EXIF information is imported to this field if available.</para>" | 127 | "embedded in the image Exif information is imported to this field if available.</para>" | ||
128 | )); | 128 | )); | ||
129 | 129 | | |||
130 | m_descriptionDock = createDock( i18n("Description"), QString::fromLatin1("description"), Qt::LeftDockWidgetArea, m_description ); | 130 | m_descriptionDock = createDock( i18n("Description"), QString::fromLatin1("description"), Qt::LeftDockWidgetArea, m_description ); | ||
131 | shortCutManager.addDock( m_descriptionDock, m_description ); | 131 | shortCutManager.addDock( m_descriptionDock, m_description ); | ||
132 | 132 | | |||
133 | connect( m_description, SIGNAL(pageUpDownPressed(QKeyEvent*)), this, SLOT(descriptionPageUpDownPressed(QKeyEvent*)) ); | 133 | connect( m_description, SIGNAL(pageUpDownPressed(QKeyEvent*)), this, SLOT(descriptionPageUpDownPressed(QKeyEvent*)) ); | ||
134 | 134 | | |||
135 | #ifdef HAVE_KGEOMAP | 135 | #ifdef HAVE_KGEOMAP | ||
Show All 21 Lines | |||||
157 | m_mapDock = createDock( | 157 | m_mapDock = createDock( | ||
158 | i18n("Map"), | 158 | i18n("Map"), | ||
159 | QString::fromLatin1("map"), | 159 | QString::fromLatin1("map"), | ||
160 | Qt::LeftDockWidgetArea, | 160 | Qt::LeftDockWidgetArea, | ||
161 | m_annotationMapContainer | 161 | m_annotationMapContainer | ||
162 | ); | 162 | ); | ||
163 | shortCutManager.addDock(m_mapDock, m_annotationMapContainer); | 163 | shortCutManager.addDock(m_mapDock, m_annotationMapContainer); | ||
164 | connect(m_mapDock, SIGNAL(visibilityChanged(bool)), this, SLOT(annotationMapVisibilityChanged(bool))); | 164 | connect(m_mapDock, SIGNAL(visibilityChanged(bool)), this, SLOT(annotationMapVisibilityChanged(bool))); | ||
165 | m_mapDock->setWhatsThis( i18nc( "@info:whatsthis", "The map widget allows you to view the location of images if GPS coordinates are found in the EXIF information." )); | 165 | m_mapDock->setWhatsThis( i18nc( "@info:whatsthis", "The map widget allows you to view the location of images if GPS coordinates are found in the Exif information." )); | ||
166 | #endif | 166 | #endif | ||
167 | 167 | | |||
168 | // -------------------------------------------------- Categories | 168 | // -------------------------------------------------- Categories | ||
169 | QList<DB::CategoryPtr> categories = DB::ImageDB::instance()->categoryCollection()->categories(); | 169 | QList<DB::CategoryPtr> categories = DB::ImageDB::instance()->categoryCollection()->categories(); | ||
170 | 170 | | |||
171 | // Let's first assume we don't have positionable categories | 171 | // Let's first assume we don't have positionable categories | ||
172 | m_positionableCategories = false; | 172 | m_positionableCategories = false; | ||
173 | 173 | | |||
▲ Show 20 Lines • Show All 420 Lines • ▼ Show 20 Line(s) | 585 | while (areaData.hasNext()) { | |||
594 | if(m_listSelectList[category]->tagIsChecked(tag)) { | 594 | if(m_listSelectList[category]->tagIsChecked(tag)) { | ||
595 | m_preview->preview()->createTaggedArea(category, tag, areaData.value(), m_preview->showAreas()); | 595 | m_preview->preview()->createTaggedArea(category, tag, areaData.value(), m_preview->showAreas()); | ||
596 | } | 596 | } | ||
597 | } | 597 | } | ||
598 | } | 598 | } | ||
599 | } | 599 | } | ||
600 | 600 | | |||
601 | if (m_setup == InputSingleImageConfigMode) { | 601 | if (m_setup == InputSingleImageConfigMode) { | ||
602 | setWindowTitle(i18n("KPhotoAlbum Annotations (%1/%2)", m_current + 1, m_origList.count())); | 602 | setWindowTitle(i18nc("@title:window %1 is the current one, %2 is the number count", "KPhotoAlbum Annotations (%1/%2)", | ||
603 | m_current + 1, | ||||
604 | m_origList.count())); | ||||
603 | m_preview->canCreateAreas( | 605 | m_preview->canCreateAreas( | ||
604 | m_setup == InputSingleImageConfigMode && ! info.isVideo() && m_positionableCategories | 606 | m_setup == InputSingleImageConfigMode && ! info.isVideo() && m_positionableCategories | ||
605 | ); | 607 | ); | ||
606 | #ifdef HAVE_KGEOMAP | 608 | #ifdef HAVE_KGEOMAP | ||
607 | updateMapForCurrentImage(); | 609 | updateMapForCurrentImage(); | ||
608 | #endif | 610 | #endif | ||
609 | } | 611 | } | ||
610 | 612 | | |||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Line(s) | 813 | // Repopulate the listboxes in case data has changed | |||
815 | } | 817 | } | ||
816 | 818 | | |||
817 | if ( m_setup == SearchMode ) { | 819 | if ( m_setup == SearchMode ) { | ||
818 | KGuiItem::assign(m_okBut, KGuiItem(i18nc("@action:button","&Search"), QString::fromLatin1("find")) ); | 820 | KGuiItem::assign(m_okBut, KGuiItem(i18nc("@action:button","&Search"), QString::fromLatin1("find")) ); | ||
819 | m_continueLaterBut->hide(); | 821 | m_continueLaterBut->hide(); | ||
820 | m_revertBut->hide(); | 822 | m_revertBut->hide(); | ||
821 | m_clearBut->show(); | 823 | m_clearBut->show(); | ||
822 | m_preview->setSearchMode(true); | 824 | m_preview->setSearchMode(true); | ||
823 | setWindowTitle( i18nc("@title:window title of the 'find images' window","Search") ); | 825 | setWindowTitle(i18nc("@title:window title of the 'find images' window", "Search")); | ||
824 | loadInfo( m_oldSearch ); | 826 | loadInfo( m_oldSearch ); | ||
825 | } | 827 | } | ||
826 | else { | 828 | else { | ||
827 | m_okBut->setText( i18n("Done") ); | 829 | m_okBut->setText( i18n("Done") ); | ||
828 | m_continueLaterBut->show(); | 830 | m_continueLaterBut->show(); | ||
829 | m_revertBut->setEnabled( m_setup == InputSingleImageConfigMode ); | 831 | m_revertBut->setEnabled( m_setup == InputSingleImageConfigMode ); | ||
830 | m_clearBut->hide(); | 832 | m_clearBut->hide(); | ||
831 | m_revertBut->show(); | 833 | m_revertBut->show(); | ||
832 | m_preview->setSearchMode(false); | 834 | m_preview->setSearchMode(false); | ||
833 | m_preview->setToggleFullscreenPreviewEnabled(m_setup == InputSingleImageConfigMode); | 835 | m_preview->setToggleFullscreenPreviewEnabled(m_setup == InputSingleImageConfigMode); | ||
834 | setWindowTitle( i18n("Annotations") ); | 836 | setWindowTitle(i18nc("@title:window", "Annotations")); | ||
835 | } | 837 | } | ||
836 | 838 | | |||
837 | Q_FOREACH( ListSelect *ls, m_optionList ) { | 839 | Q_FOREACH( ListSelect *ls, m_optionList ) { | ||
838 | ls->setMode( m_setup ); | 840 | ls->setMode( m_setup ); | ||
839 | } | 841 | } | ||
840 | } | 842 | } | ||
841 | 843 | | |||
842 | 844 | | |||
Show All 16 Lines | |||||
859 | } | 861 | } | ||
860 | 862 | | |||
861 | void AnnotationDialog::Dialog::slotOptions() | 863 | void AnnotationDialog::Dialog::slotOptions() | ||
862 | { | 864 | { | ||
863 | // create menu entries for dock windows | 865 | // create menu entries for dock windows | ||
864 | QMenu* menu = new QMenu( this ); | 866 | QMenu* menu = new QMenu( this ); | ||
865 | QMenu* dockMenu =m_dockWindow->createPopupMenu(); | 867 | QMenu* dockMenu =m_dockWindow->createPopupMenu(); | ||
866 | menu->addMenu( dockMenu ) | 868 | menu->addMenu( dockMenu ) | ||
867 | ->setText( i18n( "Configure window layout..." ) ); | 869 | ->setText( i18n( "Configure Window Layout..." ) ); | ||
868 | QAction* saveCurrent = dockMenu->addAction( i18n("Save Current Window Setup") ); | 870 | QAction* saveCurrent = dockMenu->addAction( i18n("Save Current Window Setup") ); | ||
869 | QAction* reset = dockMenu->addAction( i18n( "Reset layout" ) ); | 871 | QAction* reset = dockMenu->addAction( i18n( "Reset layout" ) ); | ||
870 | 872 | | |||
871 | // create SortType entries | 873 | // create SortType entries | ||
872 | menu->addSeparator(); | 874 | menu->addSeparator(); | ||
873 | QActionGroup* sortTypes = new QActionGroup( menu ); | 875 | QActionGroup* sortTypes = new QActionGroup( menu ); | ||
874 | QAction* alphaTreeSort = new QAction( | 876 | QAction* alphaTreeSort = new QAction( | ||
875 | SmallIcon( QString::fromLatin1( "view-list-tree" ) ), | 877 | SmallIcon( QString::fromLatin1( "view-list-tree" ) ), | ||
876 | i18n("Sort Alphabetically (Tree)"), | 878 | i18n("Sort Alphabetically (Tree)"), | ||
877 | sortTypes ); | 879 | sortTypes ); | ||
878 | QAction* alphaFlatSort = new QAction( | 880 | QAction* alphaFlatSort = new QAction( | ||
879 | SmallIcon( QString::fromLatin1( "draw-text" ) ), | 881 | SmallIcon( QString::fromLatin1( "draw-text" ) ), | ||
880 | i18n("Sort Alphabetically (Flat)"), | 882 | i18n("Sort Alphabetically (Flat)"), | ||
881 | sortTypes ); | 883 | sortTypes ); | ||
882 | QAction* dateSort = new QAction( | 884 | QAction* dateSort = new QAction( | ||
883 | SmallIcon( QString::fromLatin1( "x-office-calendar" ) ), | 885 | SmallIcon( QString::fromLatin1( "x-office-calendar" ) ), | ||
884 | i18n("Sort by date"), | 886 | i18n("Sort by Date"), | ||
885 | sortTypes ); | 887 | sortTypes ); | ||
886 | alphaTreeSort->setCheckable( true ); | 888 | alphaTreeSort->setCheckable( true ); | ||
887 | alphaFlatSort->setCheckable( true ); | 889 | alphaFlatSort->setCheckable( true ); | ||
888 | dateSort->setCheckable( true ); | 890 | dateSort->setCheckable( true ); | ||
889 | alphaTreeSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaTree ); | 891 | alphaTreeSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaTree ); | ||
890 | alphaFlatSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaFlat ); | 892 | alphaFlatSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaFlat ); | ||
891 | dateSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortLastUse ); | 893 | dateSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortLastUse ); | ||
892 | menu->addActions( sortTypes->actions() ); | 894 | menu->addActions( sortTypes->actions() ); | ||
893 | connect( dateSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortDate()) ); | 895 | connect( dateSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortDate()) ); | ||
894 | connect( alphaTreeSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaTree()) ); | 896 | connect( alphaTreeSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaTree()) ); | ||
895 | connect( alphaFlatSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaFlat()) ); | 897 | connect( alphaFlatSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaFlat()) ); | ||
896 | 898 | | |||
897 | // create MatchType entries | 899 | // create MatchType entries | ||
898 | menu->addSeparator(); | 900 | menu->addSeparator(); | ||
899 | QActionGroup* matchTypes = new QActionGroup( menu ); | 901 | QActionGroup* matchTypes = new QActionGroup( menu ); | ||
900 | QAction* matchFromBeginning = new QAction( i18n( "Match tags from the first character."), matchTypes ); | 902 | QAction* matchFromBeginning = new QAction( i18n( "Match Tags from the First Character"), matchTypes ); | ||
901 | QAction* matchFromWordStart = new QAction( i18n( "Match tags from word boundaries." ), matchTypes ); | 903 | QAction* matchFromWordStart = new QAction( i18n( "Match Tags from Word Boundaries"), matchTypes ); | ||
902 | QAction* matchAnywhere = new QAction( i18n( "Match tags anywhere."),matchTypes ); | 904 | QAction* matchAnywhere = new QAction( i18n( "Match Tags Anywhere"), matchTypes ); | ||
903 | matchFromBeginning->setCheckable( true ); | 905 | matchFromBeginning->setCheckable( true ); | ||
904 | matchFromWordStart->setCheckable( true ); | 906 | matchFromWordStart->setCheckable( true ); | ||
905 | matchAnywhere->setCheckable( true ); | 907 | matchAnywhere->setCheckable( true ); | ||
906 | // TODO add StatusTip text? | 908 | // TODO add StatusTip text? | ||
907 | // set current state: | 909 | // set current state: | ||
908 | matchFromBeginning->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromBeginning ); | 910 | matchFromBeginning->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromBeginning ); | ||
909 | matchFromWordStart->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromWordStart ); | 911 | matchFromWordStart->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromWordStart ); | ||
910 | matchAnywhere->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchAnywhere ); | 912 | matchAnywhere->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchAnywhere ); | ||
911 | // add MatchType actions to menu: | 913 | // add MatchType actions to menu: | ||
912 | menu->addActions( matchTypes->actions() ); | 914 | menu->addActions( matchTypes->actions() ); | ||
913 | 915 | | |||
914 | // create toggle-show-selected entry# | 916 | // create toggle-show-selected entry# | ||
915 | if ( m_setup != SearchMode ) | 917 | if ( m_setup != SearchMode ) | ||
916 | { | 918 | { | ||
917 | menu->addSeparator(); | 919 | menu->addSeparator(); | ||
918 | QAction* showSelectedOnly = new QAction( | 920 | QAction* showSelectedOnly = new QAction( | ||
919 | SmallIcon( QString::fromLatin1( "view-filter" ) ), | 921 | SmallIcon( QString::fromLatin1( "view-filter" ) ), | ||
920 | i18n("Show only selected Ctrl+S"), | 922 | i18n("Show Only Selected Ctrl+S"), | ||
921 | menu ); | 923 | menu ); | ||
922 | showSelectedOnly->setCheckable( true ); | 924 | showSelectedOnly->setCheckable( true ); | ||
923 | showSelectedOnly->setChecked( ShowSelectionOnlyManager::instance().selectionIsLimited() ); | 925 | showSelectedOnly->setChecked( ShowSelectionOnlyManager::instance().selectionIsLimited() ); | ||
924 | menu->addAction( showSelectedOnly ); | 926 | menu->addAction( showSelectedOnly ); | ||
925 | 927 | | |||
926 | connect( showSelectedOnly, SIGNAL(triggered()), &ShowSelectionOnlyManager::instance(), SLOT(toggle()) ); | 928 | connect( showSelectedOnly, SIGNAL(triggered()), &ShowSelectionOnlyManager::instance(), SLOT(toggle()) ); | ||
927 | } | 929 | } | ||
928 | 930 | | |||
▲ Show 20 Lines • Show All 821 Lines • Show Last 20 Lines |