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 60 Lines • ▼ Show 20 Line(s) | |||||
234 | m_continueLaterBut = new QPushButton( i18n("Continue &Later") ); | 234 | m_continueLaterBut = new QPushButton( i18n("Continue &Later") ); | ||
235 | lay1->addWidget( m_continueLaterBut ); | 235 | lay1->addWidget( m_continueLaterBut ); | ||
236 | 236 | | |||
237 | QPushButton* cancelBut = new QPushButton(); | 237 | QPushButton* cancelBut = new QPushButton(); | ||
238 | KGuiItem::assign( cancelBut, KStandardGuiItem::cancel() ); | 238 | KGuiItem::assign( cancelBut, KStandardGuiItem::cancel() ); | ||
239 | lay1->addWidget( cancelBut ); | 239 | lay1->addWidget( cancelBut ); | ||
240 | 240 | | |||
241 | // It is unfortunately not possible to ask KAcceleratorManager not to setup the OK and cancel keys. | 241 | // It is unfortunately not possible to ask KAcceleratorManager not to setup the OK and cancel keys. | ||
242 | shortCutManager.addTaken( i18nc("@action:button","&Search") ); | 242 | shortCutManager.addTaken( i18nc("@action:button","&Search") ); | ||
pino: extra whitespace changes | |||||
243 | shortCutManager.addTaken( m_okBut->text() ); | 243 | shortCutManager.addTaken( m_okBut->text() ); | ||
244 | shortCutManager.addTaken( m_continueLaterBut->text()); | 244 | shortCutManager.addTaken( m_continueLaterBut->text()); | ||
245 | shortCutManager.addTaken( cancelBut->text() ); | 245 | shortCutManager.addTaken( cancelBut->text() ); | ||
246 | 246 | | |||
247 | connect( m_revertBut, SIGNAL(clicked()), this, SLOT(slotRevert()) ); | 247 | connect( m_revertBut, SIGNAL(clicked()), this, SLOT(slotRevert()) ); | ||
248 | connect( m_okBut, SIGNAL(clicked()), this, SLOT(doneTagging()) ); | 248 | connect( m_okBut, SIGNAL(clicked()), this, SLOT(doneTagging()) ); | ||
249 | connect( m_continueLaterBut, SIGNAL(clicked()), this, SLOT(continueLater()) ); | 249 | connect( m_continueLaterBut, SIGNAL(clicked()), this, SLOT(continueLater()) ); | ||
250 | connect( cancelBut, SIGNAL(clicked()), this, SLOT(reject()) ); | 250 | connect( cancelBut, SIGNAL(clicked()), this, SLOT(reject()) ); | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 298 | { | |||
335 | // Time | 335 | // Time | ||
336 | m_timeLabel = new QLabel( i18n("Time: ") ); | 336 | m_timeLabel = new QLabel( i18n("Time: ") ); | ||
337 | lay4->addWidget( m_timeLabel ); | 337 | lay4->addWidget( m_timeLabel ); | ||
338 | 338 | | |||
339 | m_time= new QTimeEdit; | 339 | m_time= new QTimeEdit; | ||
340 | lay4->addWidget( m_time ); | 340 | lay4->addWidget( m_time ); | ||
341 | 341 | | |||
342 | m_isFuzzyDate = new QCheckBox( i18n("Use Fuzzy Date") ); | 342 | m_isFuzzyDate = new QCheckBox( i18n("Use Fuzzy Date") ); | ||
343 | m_isFuzzyDate->setWhatsThis( i18nc("@info", | 343 | m_isFuzzyDate->setWhatsThis( i18nc("@info", | ||
344 | "<para>In KPhotoAlbum, images can either have an exact date and time" | 344 | "<para>In KPhotoAlbum, images can either have an exact date and time" | ||
345 | ", or a <emphasis>fuzzy</emphasis> date which happened any time during" | 345 | ", or a <emphasis>fuzzy</emphasis> date which happened any time during" | ||
346 | " a specified time interval. Images produced by digital cameras" | 346 | " a specified time interval. Images produced by digital cameras" | ||
347 | " do normally have an exact date.</para>" | 347 | " do normally have an exact date.</para>" | ||
348 | "<para>If you don't know exactly when a photo was taken" | 348 | "<para>If you don't know exactly when a photo was taken" | ||
349 | " (e.g. if the photo comes from an analog camera), then you should set" | 349 | " (e.g. if the photo comes from an analog camera), then you should set" | ||
350 | " <interface>Use Fuzzy Date</interface>.</para>") ); | 350 | " <interface>Use Fuzzy Date</interface>.</para>") ); | ||
pino: extra whitespace changes | |||||
351 | m_isFuzzyDate->setToolTip( m_isFuzzyDate->whatsThis() ); | 351 | m_isFuzzyDate->setToolTip( m_isFuzzyDate->whatsThis() ); | ||
352 | lay4->addWidget( m_isFuzzyDate ); | 352 | lay4->addWidget( m_isFuzzyDate ); | ||
353 | lay4->addStretch(1); | 353 | lay4->addStretch(1); | ||
354 | connect(m_isFuzzyDate,SIGNAL(stateChanged(int)),this,SLOT(slotSetFuzzyDate())); | 354 | connect(m_isFuzzyDate,SIGNAL(stateChanged(int)),this,SLOT(slotSetFuzzyDate())); | ||
355 | 355 | | |||
356 | QHBoxLayout* lay8 = new QHBoxLayout; | 356 | QHBoxLayout* lay8 = new QHBoxLayout; | ||
357 | lay2->addLayout( lay8 ); | 357 | lay2->addLayout( lay8 ); | ||
358 | 358 | | |||
▲ Show 20 Lines • Show All 235 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", "KPhotoAlbum Annotations (%1/%2)", m_current + 1, m_origList.count())); | ||
This could be clearer written as "@title:window image %1 of %2 images" johanneszarl: This could be clearer written as "@title:window image %1 of %2 images" | |||||
603 | m_preview->canCreateAreas( | 603 | m_preview->canCreateAreas( | ||
604 | m_setup == InputSingleImageConfigMode && ! info.isVideo() && m_positionableCategories | 604 | m_setup == InputSingleImageConfigMode && ! info.isVideo() && m_positionableCategories | ||
605 | ); | 605 | ); | ||
606 | #ifdef HAVE_KGEOMAP | 606 | #ifdef HAVE_KGEOMAP | ||
607 | updateMapForCurrentImage(); | 607 | updateMapForCurrentImage(); | ||
608 | #endif | 608 | #endif | ||
609 | } | 609 | } | ||
610 | 610 | | |||
▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Line(s) | |||||
810 | { | 810 | { | ||
811 | // Repopulate the listboxes in case data has changed | 811 | // Repopulate the listboxes in case data has changed | ||
812 | // An group might for example have been renamed. | 812 | // An group might for example have been renamed. | ||
813 | Q_FOREACH( ListSelect *ls, m_optionList ) { | 813 | Q_FOREACH( ListSelect *ls, m_optionList ) { | ||
814 | ls->populate(); | 814 | ls->populate(); | ||
815 | } | 815 | } | ||
816 | 816 | | |||
817 | if ( m_setup == SearchMode ) { | 817 | if ( m_setup == SearchMode ) { | ||
818 | KGuiItem::assign(m_okBut, KGuiItem(i18nc("@action:button","&Search"), QString::fromLatin1("find")) ); | 818 | KGuiItem::assign(m_okBut, KGuiItem(i18nc("@action:button","&Search"), QString::fromLatin1("find")) ); | ||
819 | m_continueLaterBut->hide(); | 819 | m_continueLaterBut->hide(); | ||
820 | m_revertBut->hide(); | 820 | m_revertBut->hide(); | ||
821 | m_clearBut->show(); | 821 | m_clearBut->show(); | ||
822 | m_preview->setSearchMode(true); | 822 | m_preview->setSearchMode(true); | ||
823 | setWindowTitle( i18nc("@title:window title of the 'find images' window","Search") ); | 823 | setWindowTitle( i18nc("@title:window title of the 'find images' window","Search") ); | ||
pino: extra whitespace changes | |||||
824 | loadInfo( m_oldSearch ); | 824 | loadInfo( m_oldSearch ); | ||
825 | } | 825 | } | ||
826 | else { | 826 | else { | ||
827 | m_okBut->setText( i18n("Done") ); | 827 | m_okBut->setText( i18n("Done") ); | ||
828 | m_continueLaterBut->show(); | 828 | m_continueLaterBut->show(); | ||
829 | m_revertBut->setEnabled( m_setup == InputSingleImageConfigMode ); | 829 | m_revertBut->setEnabled( m_setup == InputSingleImageConfigMode ); | ||
830 | m_clearBut->hide(); | 830 | m_clearBut->hide(); | ||
831 | m_revertBut->show(); | 831 | m_revertBut->show(); | ||
832 | m_preview->setSearchMode(false); | 832 | m_preview->setSearchMode(false); | ||
833 | m_preview->setToggleFullscreenPreviewEnabled(m_setup == InputSingleImageConfigMode); | 833 | m_preview->setToggleFullscreenPreviewEnabled(m_setup == InputSingleImageConfigMode); | ||
834 | setWindowTitle( i18n("Annotations") ); | 834 | setWindowTitle( i18nc("@title:window", "Annotations") ); | ||
835 | } | 835 | } | ||
836 | 836 | | |||
837 | Q_FOREACH( ListSelect *ls, m_optionList ) { | 837 | Q_FOREACH( ListSelect *ls, m_optionList ) { | ||
838 | ls->setMode( m_setup ); | 838 | ls->setMode( m_setup ); | ||
839 | } | 839 | } | ||
840 | } | 840 | } | ||
841 | 841 | | |||
842 | 842 | | |||
Show All 16 Lines | |||||
859 | } | 859 | } | ||
860 | 860 | | |||
861 | void AnnotationDialog::Dialog::slotOptions() | 861 | void AnnotationDialog::Dialog::slotOptions() | ||
862 | { | 862 | { | ||
863 | // create menu entries for dock windows | 863 | // create menu entries for dock windows | ||
864 | QMenu* menu = new QMenu( this ); | 864 | QMenu* menu = new QMenu( this ); | ||
865 | QMenu* dockMenu =m_dockWindow->createPopupMenu(); | 865 | QMenu* dockMenu =m_dockWindow->createPopupMenu(); | ||
866 | menu->addMenu( dockMenu ) | 866 | menu->addMenu( dockMenu ) | ||
867 | ->setText( i18n( "Configure window layout..." ) ); | 867 | ->setText( i18n( "Configure Window Layout..." ) ); | ||
868 | QAction* saveCurrent = dockMenu->addAction( i18n("Save Current Window Setup") ); | 868 | QAction* saveCurrent = dockMenu->addAction( i18n("Save Current Window Setup") ); | ||
869 | QAction* reset = dockMenu->addAction( i18n( "Reset layout" ) ); | 869 | QAction* reset = dockMenu->addAction( i18n( "Reset layout" ) ); | ||
870 | 870 | | |||
871 | // create SortType entries | 871 | // create SortType entries | ||
872 | menu->addSeparator(); | 872 | menu->addSeparator(); | ||
873 | QActionGroup* sortTypes = new QActionGroup( menu ); | 873 | QActionGroup* sortTypes = new QActionGroup( menu ); | ||
874 | QAction* alphaTreeSort = new QAction( | 874 | QAction* alphaTreeSort = new QAction( | ||
875 | SmallIcon( QString::fromLatin1( "view-list-tree" ) ), | 875 | SmallIcon( QString::fromLatin1( "view-list-tree" ) ), | ||
876 | i18n("Sort Alphabetically (Tree)"), | 876 | i18n("Sort Alphabetically (Tree)"), | ||
877 | sortTypes ); | 877 | sortTypes ); | ||
878 | QAction* alphaFlatSort = new QAction( | 878 | QAction* alphaFlatSort = new QAction( | ||
879 | SmallIcon( QString::fromLatin1( "draw-text" ) ), | 879 | SmallIcon( QString::fromLatin1( "draw-text" ) ), | ||
880 | i18n("Sort Alphabetically (Flat)"), | 880 | i18n("Sort Alphabetically (Flat)"), | ||
881 | sortTypes ); | 881 | sortTypes ); | ||
882 | QAction* dateSort = new QAction( | 882 | QAction* dateSort = new QAction( | ||
883 | SmallIcon( QString::fromLatin1( "x-office-calendar" ) ), | 883 | SmallIcon( QString::fromLatin1( "x-office-calendar" ) ), | ||
884 | i18n("Sort by date"), | 884 | i18n("Sort by Date"), | ||
885 | sortTypes ); | 885 | sortTypes ); | ||
886 | alphaTreeSort->setCheckable( true ); | 886 | alphaTreeSort->setCheckable( true ); | ||
887 | alphaFlatSort->setCheckable( true ); | 887 | alphaFlatSort->setCheckable( true ); | ||
888 | dateSort->setCheckable( true ); | 888 | dateSort->setCheckable( true ); | ||
889 | alphaTreeSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaTree ); | 889 | alphaTreeSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaTree ); | ||
890 | alphaFlatSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaFlat ); | 890 | alphaFlatSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortAlphaFlat ); | ||
891 | dateSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortLastUse ); | 891 | dateSort->setChecked( Settings::SettingsData::instance()->viewSortType() == Settings::SortLastUse ); | ||
892 | menu->addActions( sortTypes->actions() ); | 892 | menu->addActions( sortTypes->actions() ); | ||
893 | connect( dateSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortDate()) ); | 893 | connect( dateSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortDate()) ); | ||
894 | connect( alphaTreeSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaTree()) ); | 894 | connect( alphaTreeSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaTree()) ); | ||
895 | connect( alphaFlatSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaFlat()) ); | 895 | connect( alphaFlatSort, SIGNAL(triggered()), m_optionList.at(0), SLOT(slotSortAlphaFlat()) ); | ||
896 | 896 | | |||
897 | // create MatchType entries | 897 | // create MatchType entries | ||
898 | menu->addSeparator(); | 898 | menu->addSeparator(); | ||
899 | QActionGroup* matchTypes = new QActionGroup( menu ); | 899 | QActionGroup* matchTypes = new QActionGroup( menu ); | ||
900 | QAction* matchFromBeginning = new QAction( i18n( "Match tags from the first character."), matchTypes ); | 900 | QAction* matchFromBeginning = new QAction( i18n( "Match Tags from the First Character"), matchTypes ); | ||
901 | QAction* matchFromWordStart = new QAction( i18n( "Match tags from word boundaries." ), matchTypes ); | 901 | QAction* matchFromWordStart = new QAction( i18n( "Match Tags from Word Boundaries"), matchTypes ); | ||
902 | QAction* matchAnywhere = new QAction( i18n( "Match tags anywhere."),matchTypes ); | 902 | QAction* matchAnywhere = new QAction( i18n( "Match Tags Anywhere"), matchTypes ); | ||
pino: These should have Title Capitalization, since they are commands/menu items. | |||||
903 | matchFromBeginning->setCheckable( true ); | 903 | matchFromBeginning->setCheckable( true ); | ||
904 | matchFromWordStart->setCheckable( true ); | 904 | matchFromWordStart->setCheckable( true ); | ||
905 | matchAnywhere->setCheckable( true ); | 905 | matchAnywhere->setCheckable( true ); | ||
906 | // TODO add StatusTip text? | 906 | // TODO add StatusTip text? | ||
907 | // set current state: | 907 | // set current state: | ||
908 | matchFromBeginning->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromBeginning ); | 908 | matchFromBeginning->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromBeginning ); | ||
909 | matchFromWordStart->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromWordStart ); | 909 | matchFromWordStart->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchFromWordStart ); | ||
910 | matchAnywhere->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchAnywhere ); | 910 | matchAnywhere->setChecked( Settings::SettingsData::instance()->matchType() == AnnotationDialog::MatchAnywhere ); | ||
911 | // add MatchType actions to menu: | 911 | // add MatchType actions to menu: | ||
912 | menu->addActions( matchTypes->actions() ); | 912 | menu->addActions( matchTypes->actions() ); | ||
913 | 913 | | |||
914 | // create toggle-show-selected entry# | 914 | // create toggle-show-selected entry# | ||
915 | if ( m_setup != SearchMode ) | 915 | if ( m_setup != SearchMode ) | ||
916 | { | 916 | { | ||
917 | menu->addSeparator(); | 917 | menu->addSeparator(); | ||
918 | QAction* showSelectedOnly = new QAction( | 918 | QAction* showSelectedOnly = new QAction( | ||
919 | SmallIcon( QString::fromLatin1( "view-filter" ) ), | 919 | SmallIcon( QString::fromLatin1( "view-filter" ) ), | ||
920 | i18n("Show only selected Ctrl+S"), | 920 | i18n("Show Only Selected Ctrl+S"), | ||
921 | menu ); | 921 | menu ); | ||
922 | showSelectedOnly->setCheckable( true ); | 922 | showSelectedOnly->setCheckable( true ); | ||
923 | showSelectedOnly->setChecked( ShowSelectionOnlyManager::instance().selectionIsLimited() ); | 923 | showSelectedOnly->setChecked( ShowSelectionOnlyManager::instance().selectionIsLimited() ); | ||
924 | menu->addAction( showSelectedOnly ); | 924 | menu->addAction( showSelectedOnly ); | ||
925 | 925 | | |||
926 | connect( showSelectedOnly, SIGNAL(triggered()), &ShowSelectionOnlyManager::instance(), SLOT(toggle()) ); | 926 | connect( showSelectedOnly, SIGNAL(triggered()), &ShowSelectionOnlyManager::instance(), SLOT(toggle()) ); | ||
927 | } | 927 | } | ||
928 | 928 | | |||
▲ Show 20 Lines • Show All 821 Lines • Show Last 20 Lines |
extra whitespace changes