Skip to content

Commit

Permalink
Настройки -> Действия по двойному клику по заголовку: добавлено "Сохр…
Browse files Browse the repository at this point in the history
…анить заметку".

Обновлена локализация.
Рефакторинг.

Signed-off-by: gil9red <[email protected]>
  • Loading branch information
gil9red committed May 9, 2014
1 parent 6aec986 commit 593f77a
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 184 deletions.
13 changes: 7 additions & 6 deletions Manager/pages/page_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ Page_Settings::Page_Settings( QWidget * parent )
ui->lEditViewTitle->setPalette( palette );

ui->comboBoxActionsDoubleClickOnTitleNote->clear();
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "do nothing" ), Shared::DoNothing );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "edit the title" ), Shared::EditTitle );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "hide note" ), Shared::HideNote );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "do nothing" ), Shared::DoNothing );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "edit note title" ), Shared::EditTitleNote );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "hide note" ), Shared::HideNote );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "delete the note" ), Shared::DeleteNote );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "save as" ), Shared::SaveAs );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "print notes" ), Shared::PrintNotes );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "save note" ), Shared::SaveNote );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "save note as" ), Shared::SaveNoteAs );
ui->comboBoxActionsDoubleClickOnTitleNote->addItem( tr( "print note" ), Shared::PrintNotes );
}

Page_Settings::~Page_Settings()
Expand Down Expand Up @@ -99,7 +100,7 @@ void Page_Settings::mapToSettings()

ui->checkBoxAutosaveNotes->setChecked( mapSettings.value( "Notes_Autosave", true ).toBool() );
ui->sBoxAutosaveIntervalNotes->setValue( mapSettings.value( "Notes_AutosaveInterval", 7 ).toInt() );
index = ui->comboBoxActionsDoubleClickOnTitleNote->findData( mapSettings.value( "Notes_ActionDoubleClickOnTitle", Shared::EditTitle ) );
index = ui->comboBoxActionsDoubleClickOnTitleNote->findData( mapSettings.value( "Notes_ActionDoubleClickOnTitle", Shared::EditTitleNote ) );
ui->comboBoxActionsDoubleClickOnTitleNote->setCurrentIndex( index );
}
void Page_Settings::settingsToMap()
Expand Down
21 changes: 11 additions & 10 deletions Note/NoteShared.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@ namespace Shared
/*! Перечисление сторон рамки заметки. */
enum Side
{
Left = 0x0001, //!< Левая
Right = 0x0002, //!< Правая
Top = 0x0004, //!< Верхняя
Bottom = 0x0008 //!< Нижняя
Left = 0x0001, //!< Левая
Right = 0x0002, //!< Правая
Top = 0x0004, //!< Верхняя
Bottom = 0x0008 //!< Нижняя
};
Q_DECLARE_FLAGS ( Sides, Side )


//! Действия при двойном клике на заголовок
enum ActionDoubleClickingOnTitle
{
DoNothing, //!< Ничего не делать.
EditTitle, //!< Редактировать заголовок.
HideNote, //!< Скрыть заметку.
DeleteNote, //!< Удалить заметку.
SaveAs, //!< Сохранить заметку как....
PrintNotes //!< Печать заметки.
DoNothing, //!< Ничего не делать.
EditTitleNote, //!< Редактировать заголовок.
HideNote, //!< Скрыть заметку.
DeleteNote, //!< Удалить заметку.
SaveNote, //!< Сохранить заметку.
SaveNoteAs, //!< Сохранить заметку как....
PrintNotes //!< Печать заметки.
};
}

Expand Down
8 changes: 6 additions & 2 deletions Note/RichTextNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ void RichTextNote::doubleClickingOnTitle()
case Shared::DoNothing:
break;

case Shared::EditTitle:
case Shared::EditTitleNote:
selectTitle();
break;

Expand All @@ -807,7 +807,11 @@ void RichTextNote::doubleClickingOnTitle()
invokeRemove();
break;

case Shared::SaveAs:
case Shared::SaveNote:
save();
break;

case Shared::SaveNoteAs:
saveAs();
break;

Expand Down
Loading

0 comments on commit 593f77a

Please sign in to comment.