Skip to content

Commit

Permalink
Fix: Closing logic && Nomenclature
Browse files Browse the repository at this point in the history
Signed-off-by: datyuesh <[email protected]>
  • Loading branch information
datyuesh committed Jan 29, 2021
1 parent 76658ba commit 414c132
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 66 deletions.
2 changes: 1 addition & 1 deletion src/plugins/ukui-notebook/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ About::About(QWidget *parent) :
"style=\"color: palette(buttonText)\">"
"[email protected]</a>");
ui->appiconLabel->setPixmap(QIcon::fromTheme("kylin-notebook").pixmap(96,96));
ui->introduceLabel->setText(tr("Kylin Note is a self-developed sidebar application plug-in, "
ui->introduceLabel->setText(tr("Kylin Memo is a self-developed sidebar application plug-in, "
"which provides a rich interface, convenient operation and stable functions, "
"aiming at a friendly user experience."));
ui->introduceLabel->setAlignment(Qt::AlignJustify);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ukui-notebook/about.ui
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<item>
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>Note</string>
<string>Kylin Note</string>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ukui-notebook/editPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void Edit_page::leaveEvent(QEvent *event)
void Edit_page::initSetup()
{
//标题
this->setWindowTitle(tr("ukui-memo"));
this->setWindowTitle(tr("Kylin Memo"));
//任务栏图标
setWindowIcon(QIcon::fromTheme("kylin-notebook"));

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/ukui-notebook/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ int main(int argc, char *argv[])
如果调用了addVersionOption,则内置选项为--version,如果调用了addHelpOption,则为--help --help-all。
当调用这些选项之一时,或者当发生错误(例如,传递了未知选项)时,当前进程将使用exit()函数停止。
*/
parser.process(a); Widget w;
parser.process(a);
Widget w;
//if (QApplication::arguments().length() > 1) {
// if (QApplication::arguments().at(1) == "--display" || QApplication::arguments().at(1) == "-m") {
// w.createNewNote();
Expand Down
12 changes: 5 additions & 7 deletions src/plugins/ukui-notebook/noteExitWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ void noteExitWindow::on_pushButton_2_clicked()
{
this->close();
pNotebook->close();
if(ui->checkBox->isChecked()==true)
{
if(ui->checkBox->isChecked()==true){
for (auto it = pNotebook->m_editors.begin(); it!= pNotebook->m_editors.end();it++) {
(*it)->close();
//qDebug() << "before swap" << pNotebook->m_editors.size();
Expand All @@ -120,10 +119,9 @@ void noteExitWindow::exitImmediate()
{
this->close();
pNotebook->close();
// if(ui->checkBox->isChecked()==true)
// {
for (auto it = pNotebook->m_editors.begin(); it!= pNotebook->m_editors.end();it++) {
(*it)->close();
}
// if(ui->checkBox->isChecked()==true){
// for (auto it = pNotebook->m_editors.begin(); it!= pNotebook->m_editors.end();it++) {
// (*it)->close();
// }
// }
}
2 changes: 1 addition & 1 deletion src/plugins/ukui-notebook/noteHeadMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void noteHeadMenu::btnInit()
ui->pushButtonMenu->setProperty("isWindowButton", 0x1);
ui->pushButtonMenu->setProperty("useIconHighlightEffect", 0x2);
ui->pushButtonNew->setToolTip(tr("Create New Note"));
ui->pushButtonExit->setToolTip(tr("Exit"));
ui->pushButtonExit->setToolTip(tr("Close"));
ui->pushButtonMenu->setToolTip(tr("Menu"));

ui->pushButtonPalette->setProperty("isOptionButton", true);
Expand Down
14 changes: 7 additions & 7 deletions src/plugins/ukui-notebook/ukui-notebook.desktop
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[Desktop Entry]
Name=Notebook
Name=Kylin Memo
Name[zh_CN]=麒麟便签本
Name[tr_TR]=Not Defteri
GenericName=Kylin Notebook
Name[tr_TR]=Not
GenericName=Kylin Memo
GenericName[zh_CN]=麒麟便签本
GenericName[tr_TR]=Kylin Not Defteri
Comment=Kylin Notebook
Comment[zh_CN]=Notebook
Comment[tr_TR]=Not Defteri
GenericName[tr_TR]=Kylin Not
Comment=Kylin Memo
Comment[zh_CN]=麒麟便签本
Comment[tr_TR]=Kylin Not
Keywords=guide;
Exec=/usr/bin/ukui-notebook
Icon=kylin-notebook
Expand Down
21 changes: 9 additions & 12 deletions src/plugins/ukui-notebook/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void Widget::kyNoteInit()
m_pSreenInfo = new adaptScreenInfo();
move((m_pSreenInfo->m_screenWidth - this->width() + m_pSreenInfo->m_nScreen_x )/2, (m_pSreenInfo->m_screenHeight - this->height())/2);
//标题
this->setWindowTitle(tr("ukui-note"));
this->setWindowTitle(tr("Kylin Memo"));
//任务栏图标
setWindowIcon(QIcon::fromTheme("kylin-notebook"));
ui->iconLabel->setPixmap(QIcon::fromTheme("kylin-notebook").pixmap(24,24));
Expand Down Expand Up @@ -481,15 +481,15 @@ void Widget::btnInit()

m_menuActionEmpty = new QAction(m_menu);
QAction *m_aboutAction = new QAction(m_menu);
// m_menuActionSet = new QAction(m_menu);
//m_menuActionSet = new QAction(m_menu);

m_aboutAction->setText(tr("About"));
m_menuActionEmpty->setText(tr("Empty Note"));
// m_menuActionSet->setText(tr("Set Note"));
//m_menuActionSet->setText(tr("Set Note"));

m_menu->addAction(m_menuActionEmpty);
m_menu->addAction(m_aboutAction);
// m_menu->addAction(m_menuActionSet);
//m_menu->addAction(m_menuActionSet);
ui->menuBtn->setMenu(m_menu);

connect(m_aboutAction, &QAction::triggered, this, [=](){
Expand Down Expand Up @@ -541,8 +541,6 @@ void Widget::btnInit()
palette.setBrush(QPalette::ButtonText, brush);
//palette.setColor(QPalette::Highlight, Qt::transparent); /* 取消按钮高亮 */
// ui->pushButton_Mini->setPalette(palette);
//ui->pushButton_Exit->setPalette(palette);
//ui->menuBtn->setPalette(palette);

//设置新建按钮背景文本颜色
QPalette palette2 = m_newKynote->palette();
Expand All @@ -556,8 +554,8 @@ void Widget::btnInit()
m_newKynote->setToolTip(tr("Create New Note"));
m_trashButton->setToolTip(tr("Delete Selected Note"));
m_viewChangeButton->setToolTip(tr("Switch View"));
ui->pushButton_Exit->setToolTip(tr("Exit"));
ui->pushButton_Mini->setToolTip(tr("Mini"));
ui->pushButton_Exit->setToolTip(tr("Close"));
ui->pushButton_Mini->setToolTip(tr("Minimize"));
ui->menuBtn->setToolTip(tr("Menu"));
}

Expand Down Expand Up @@ -927,7 +925,7 @@ NoteData* Widget::generateNote(const int noteID)
QDateTime noteDate = QDateTime::currentDateTime();
newNote->setCreationDateTime(noteDate);
newNote->setLastModificationDateTime(noteDate);
newNote->setFullTitle(tr("Welcome to use Kylin Note."));
newNote->setFullTitle(tr("Welcome to use Kylin Memo."));
newNote->setNoteColor(15169356);
newNote->m_note = nullptr;
return newNote;
Expand Down Expand Up @@ -975,7 +973,7 @@ void Widget::moveNoteToTop()
QString Widget::getFirstLine(const QString& str)
{
if(str.simplified().isEmpty()){
return tr("Welcome to use Kylin Note.");
return tr("Welcome to use Kylin Memo.");
}

QString text = str.trimmed();
Expand Down Expand Up @@ -1231,8 +1229,7 @@ void Widget::onColorChanged(const QColor &color,int noteId)
*/
void Widget::exitSlot()
{
//m_noteExitWindow->exec(); //退出时弹窗弹窗
m_noteExitWindow->exitImmediate(); //不弹窗,直接退出
this->close();
}

/*!
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ukui-notebook/widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<item>
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>Note</string>
<string>Kylin Note</string>
</property>
</widget>
</item>
Expand Down
Binary file modified translations/ukui-notebook/ukui-notebook_zh_CN.qm
Binary file not shown.
Loading

0 comments on commit 414c132

Please sign in to comment.