Ubuntu12.04.4_lts
2023-08-01 961efe36f62f7eba688d504ec0cdf3e1daa4dd74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "rename_page.h"
#include "ui_rename_page.h"
#include "Common/app_define.h"
#include "IMEKeyBoard/syszuxpinyin.h"
 
ReName_Page::ReName_Page(QWidget *parent, QString name, Work_Thread *thread) :
    customDialog(parent),
    ui(new Ui::ReName_Page)
{
    ui->setupUi(this);
    work_thread = thread;
    set_btn_beep(ui->edit_newName,SIGNAL(custom_click()));
    set_btn_beep(ui->pushButton_Exit,SIGNAL(pressed()));
    set_btn_beep(ui->pushButton_OK,SIGNAL(pressed()));
 
    connect(ui->edit_newName,SIGNAL(custom_click()),this,SLOT(CustomEditSlot()));
    connect(ui->pushButton_Exit,SIGNAL(released()),this,SLOT(RenameBtnSlot()));
    connect(ui->pushButton_OK,SIGNAL(released()),this,SLOT(RenameBtnSlot()));
 
    oldName = name;
    ui->label_oldName->setText(oldName);
}
 
ReName_Page::~ReName_Page()
{
    delete ui;
}
 
void ReName_Page::RenameBtnSlot()
{
    QPushButton *pb = dynamic_cast<QPushButton*>(sender());
    if(ui->pushButton_Exit == pb)
    {
        closeCustom(false);
    }
    else if(ui->pushButton_OK == pb)
    {
        newName = ui->edit_newName->text();
        rename_action();
        closeCustom(false);
    }
}
 
void ReName_Page::CustomEditSlot()
{
    ui->edit_newName->setStyleSheet("color:red");
//    KeyBoard_CN keyboard(this,ui->edit_newName,true);
//    keyboard.setGeometry(0,100,800,380);
//    keyboard.execKeyboard();
    SyszuxPinyin pinyin(this,ui->edit_newName,work_thread);
    pinyin.exec();
    ui->edit_newName->setStyleSheet("color:black");
}
 
void ReName_Page::rename_action()
{
    fileManage.renameDir(dataDir+oldName,dataDir+newName);
}