Changeset View
Standalone View
src/project/projecttab.cpp
Show All 22 Lines | |||||
23 | **************************************************************************** */ | 23 | **************************************************************************** */ | ||
24 | 24 | | |||
25 | #include "projecttab.h" | 25 | #include "projecttab.h" | ||
26 | #include "project.h" | 26 | #include "project.h" | ||
27 | #include "projectwidget.h" | 27 | #include "projectwidget.h" | ||
28 | #include "tmscanapi.h" | 28 | #include "tmscanapi.h" | ||
29 | #include "prefs.h" | 29 | #include "prefs.h" | ||
30 | 30 | | |||
31 | #include <klocalizedstring.h> | 31 | #include <klocalizedstring.h> | ||
mlaurent: why ? you don't add new debug in this file no ? | |||||
32 | #include <kactioncategory.h> | 32 | #include <kactioncategory.h> | ||
33 | #include <kactioncollection.h> | 33 | #include <kactioncollection.h> | ||
34 | #include <kstandardaction.h> | 34 | #include <kstandardaction.h> | ||
35 | #include <kxmlguifactory.h> | 35 | #include <kxmlguifactory.h> | ||
36 | 36 | | |||
37 | #include <QLineEdit> | 37 | #include <QLineEdit> | ||
38 | #include <QIcon> | 38 | #include <QIcon> | ||
39 | #include <QContextMenuEvent> | 39 | #include <QContextMenuEvent> | ||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | 142 | #define ADD_ACTION_SHORTCUT_ICON(_name,_text,_shortcut,_icon)\ | |||
174 | connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoNextTemplateOnly())); | 174 | connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoNextTemplateOnly())); | ||
175 | 175 | | |||
176 | ADD_ACTION_SHORTCUT_ICON("go_prev_transOnly",i18nc("@action:inmenu","Previous translation only"),Qt::ALT+Qt::Key_Up,"prevpo") | 176 | ADD_ACTION_SHORTCUT_ICON("go_prev_transOnly",i18nc("@action:inmenu","Previous translation only"),Qt::ALT+Qt::Key_Up,"prevpo") | ||
177 | connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoPrevTransOnly())); | 177 | connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoPrevTransOnly())); | ||
178 | 178 | | |||
179 | ADD_ACTION_SHORTCUT_ICON("go_next_transOnly",i18nc("@action:inmenu","Next translation only"),Qt::ALT+Qt::Key_Down,"nextpo") | 179 | ADD_ACTION_SHORTCUT_ICON("go_next_transOnly",i18nc("@action:inmenu","Next translation only"),Qt::ALT+Qt::Key_Down,"nextpo") | ||
180 | connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoNextTransOnly())); | 180 | connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoNextTransOnly())); | ||
181 | 181 | | |||
182 | action=nav->addAction(QStringLiteral("toggle_translated_files")); | ||||
183 | action->setText(i18nc("@action:inmenu","Hide fully translated files")); | ||||
it also hides folders, though adding it probably makes it too long (at least for the toolbar). I think there's two ways a) This way the toolbar doesn't have the "and folders" but the menu does, saves some space on the toolbar but not on the menu since on the menu is less needed (though it can be a bit confusing to users the fact that there's two different texts for the same action) b) So the tooltip on the toolbar gives some more info. What do you think? Or am i making a big deal of nothing? 😄 aacid: it also hides folders, though adding it probably makes it too long (at least for the toolbar). | |||||
Why not both ? I was thinking of something like "items" instead of "files and folders" but it would be more confusing, some people may think it would hide the translated strings within the files. sdepiets: Why not both ?
I was thinking of something like "items" instead of "files and folders" but it… | |||||
I don´t think it is a bad idea to use "files", "items" or "content" on the text as long as the tooltip clarifies. Also, on the menu entry I would consider even removing the "fully" part, or replace "fully translated" by something shorter, like "complete" or "done". adrianchavesfernandez: I don´t think it is a bad idea to use "files", "items" or "content" on the text as long as the… | |||||
So "Hide completed items" for the text and "Hide fully translated files and folders" for the tooltip should be ok for everyone I hope. sdepiets: So "Hide completed items" for the text and "Hide fully translated files and folders" for the… | |||||
184 | action->setCheckable(true); | ||||
185 | ac->setDefaultShortcut(action, QKeySequence(Qt::CTRL+Qt::Key_T)); | ||||
186 | connect(action, &QAction::triggered, this, &ProjectTab::toggleTranslatedFiles); | ||||
mlaurent: it's better to use new connect api. | |||||
187 | | ||||
182 | // ADD_ACTION_SHORTCUT_ICON("edit_find",i18nc("@action:inmenu","Find in files"),Qt::ALT+Qt::Key_Down,"nextpo") | 188 | // ADD_ACTION_SHORTCUT_ICON("edit_find",i18nc("@action:inmenu","Find in files"),Qt::ALT+Qt::Key_Down,"nextpo") | ||
183 | //connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoNextTransOnly())); | 189 | //connect( action, SIGNAL(triggered(bool)), this, SLOT(gotoNextTransOnly())); | ||
184 | action=nav->addAction(KStandardAction::Find,this,SLOT(searchInFiles())); | 190 | action=nav->addAction(KStandardAction::Find,this,SLOT(searchInFiles())); | ||
185 | 191 | | |||
186 | KActionCategory* proj=new KActionCategory(i18nc("@title actions category","Project"), ac); | 192 | KActionCategory* proj=new KActionCategory(i18nc("@title actions category","Project"), ac); | ||
187 | 193 | | |||
188 | action = proj->addAction(QStringLiteral("project_open"),this,SIGNAL(projectOpenRequested())); | 194 | action = proj->addAction(QStringLiteral("project_open"),this,SIGNAL(projectOpenRequested())); | ||
189 | action->setText(i18nc("@action:inmenu","Open project")); | 195 | action->setText(i18nc("@action:inmenu","Open project")); | ||
Show All 10 Lines | 205 | { | |||
200 | //qCWarning(LOKALIZE_LOG)<<"destroyed"; | 206 | //qCWarning(LOKALIZE_LOG)<<"destroyed"; | ||
201 | } | 207 | } | ||
202 | 208 | | |||
203 | void ProjectTab::showRealProjectOverview() | 209 | void ProjectTab::showRealProjectOverview() | ||
204 | { | 210 | { | ||
205 | m_stackedLayout->setCurrentIndex(1); | 211 | m_stackedLayout->setCurrentIndex(1); | ||
206 | } | 212 | } | ||
207 | 213 | | |||
214 | void ProjectTab::toggleTranslatedFiles() | ||||
215 | { | ||||
216 | m_browser->toggleTranslatedFiles(); | ||||
217 | } | ||||
218 | | ||||
208 | QString ProjectTab::currentFilePath() | 219 | QString ProjectTab::currentFilePath() | ||
209 | { | 220 | { | ||
210 | return Project::instance()->path(); | 221 | return Project::instance()->path(); | ||
211 | } | 222 | } | ||
212 | 223 | | |||
213 | void ProjectTab::setFocus() | 224 | void ProjectTab::setFocus() | ||
214 | { | 225 | { | ||
215 | m_filterEdit->setFocus(); | 226 | m_filterEdit->setFocus(); | ||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |
why ? you don't add new debug in this file no ?